Skip to content

Check SCSpecType is a superset of SCValType - #314

Merged
leighmcculloch merged 2 commits into
mainfrom
check-scspectype-superset
Aug 13, 2026
Merged

Check SCSpecType is a superset of SCValType#314
leighmcculloch merged 2 commits into
mainfrom
check-scspectype-superset

Conversation

@leighmcculloch

@leighmcculloch leighmcculloch commented Aug 13, 2026

Copy link
Copy Markdown
Member

What

Add a CI check that every SCValType variant has a matching SC_SPEC_TYPE_ counterpart, excluding the three internal values that cannot cross a contract function boundary.

Why

Nothing catches a new SCValType landing without a corresponding SCSpecType, which leaves a value type that contracts can pass but cannot declare in their spec — the check fails today on SCV_EXECUTABLE_TAG.

Comment thread .github/workflows/scspectype-superset.yml Fixed
@leighmcculloch
leighmcculloch force-pushed the check-scspectype-superset branch 2 times, most recently from f4d34da to 5ef8ba8 Compare August 13, 2026 21:32
@leighmcculloch
leighmcculloch force-pushed the check-scspectype-superset branch from 5ef8ba8 to 147f1ac Compare August 13, 2026 21:33
@leighmcculloch
leighmcculloch marked this pull request as ready for review August 13, 2026 21:34
Copilot AI balanced review requested due to automatic review settings August 13, 2026 21:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds CI validation intended to ensure contract-visible SCValType variants have matching SCSpecType variants.

Changes:

  • Adds an XDR type-comparison script.
  • Runs the check through GitHub Actions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.scripts/check-scspectype-superset.ts Implements the superset check.
.github/workflows/scspectype-superset.yml Adds CI execution for the check.
Suppressed comments (1)

.scripts/check-scspectype-superset.ts:20

  • This check is guaranteed to fail on the current tree: SCV_EXECUTABLE_TAG is present in SCValType, is not excluded here, and SC_SPEC_TYPE_EXECUTABLE_TAG does not exist. Because the new workflow runs this on every push and pull request, it introduces permanently failing CI. Add the corresponding spec type (and required XDR handling/generated updates), or exclude it here only if it truly cannot cross a contract boundary, before enabling the workflow.
const missing = [...new Set(val.map((name) => name.slice("SCV_".length)))]
  .filter((name) => !EXCLUDED.includes(name))
  .filter((name) => !new RegExp(`\\bSC_SPEC_TYPE_${name}\\b`).test(spec));

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .scripts/check-scspectype-superset.ts
@leighmcculloch
leighmcculloch merged commit 89555ff into main Aug 13, 2026
7 of 8 checks passed
@leighmcculloch
leighmcculloch deleted the check-scspectype-superset branch August 13, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants