-
Notifications
You must be signed in to change notification settings - Fork 1.9k
chore: update spec.types.ts from upstream #2027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
github-actions
wants to merge
1
commit into
main
Choose a base branch
from
update-spec-types
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1
−1
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 This sync bumps the anchor's provenance header to upstream commit
2ffc3fa2, but the derived twins that the repo's OPERATIVE lifecycle rule 4 requires to be refreshed in the same commit still pin the old commitf68d864a:packages/core-internal/test/corpus/schema-twins/manifest.jsonandtest/corpus/fixtures/2026-07-28/manifest.json. Please runpnpm fetch:schema-twins 2ffc3fa2d00e637ae7c3d1438aaa0561ddfda184(andpnpm fetch:spec-examplesif upstream examples changed) in this PR so both manifests record the same commit as the anchor — and longer-term, the nightly cron workflow should regenerate the twins alongside the anchor, since it currently only runsfetch:spec-typesand onlygit adds the anchor file.Extended reasoning...
What the bug is
This automated sync updates the 2026-07-28 anchor's provenance header to upstream commit
2ffc3fa2d00e637ae7c3d1438aaa0561ddfda184(packages/core-internal/src/types/spec.types.2026-07-28.ts:6), but it does not refresh the derived artifacts that the repo's own lifecycle policy ties to that anchor.packages/core-internal/src/types/README.mdlifecycle rule 4 — explicitly marked OPERATIVE — states: "any refresh that changes the anchor must regenerate those artifacts in the same commit. The anchor and its derived twins must never be out of sync at any commit onmain." It then names the governed artifacts: the vendoredschema.jsontwins underpackages/core-internal/test/corpus/schema-twins/(whosemanifest.jsonrecords the source commit and content hashes), and the spec example corpus manifest (test/corpus/fixtures/<revision>/manifest.json), which "follows the same atomicity rule when the examples are re-vendored."The code path / state that triggers it
After this PR merges, the repository on
mainis in exactly the state rule 4 forbids:spec.types.2026-07-28.ts:6) saysLast updated from commit: 2ffc3fa2d00e637ae7c3d1438aaa0561ddfda184.packages/core-internal/test/corpus/schema-twins/manifest.json:5still records\"commit\": \"f68d864a813754e188c6df52dcc5772a12f96c63\"— and its own header comment says refreshes must happen "ATOMICALLY with the matching spec.types anchor (see … lifecycle rule 4)".packages/core-internal/test/corpus/fixtures/2026-07-28/manifest.json:6likewise still recordsf68d864a.mainfrom the merge onward.Why existing checks don't prevent it
This divergence lands silently.
schemaTwinConformance.test.tsonly hashes the vendored twin bytes against the manifest's ownsha256/bytesentries and validates fixtures against the twin — it never cross-checks the manifest'ssource.commitagainst the anchor header's commit. Because the anchor's TypeScript body is byte-identical in this diff (only the provenance line changed), the content lock stays green and CI gives no signal. The README anticipates a content mismatch being "the desired loud signal of a missed twin update", but a header-only bump produces a provenance-only mismatch that nothing detects.The root cause is structural:
.github/workflows/update-spec-types.ymlonly runspnpm run fetch:spec-types 2026-07-28(line 48) and onlygit adds the anchor file (line 73).fetch:schema-twinsandfetch:spec-examplesare separate scripts that the cron job never invokes, so every nightly sync that bumps the anchor will recreate this violation.Step-by-step proof
main, rungrep 'Last updated from commit' packages/core-internal/src/types/spec.types.2026-07-28.ts→2ffc3fa2….grep '\"commit\"' packages/core-internal/test/corpus/schema-twins/manifest.json packages/core-internal/test/corpus/fixtures/2026-07-28/manifest.json→ both sayf68d864a….main, and the schema-twins manifest's "ATOMICALLY with the matching spec.types anchor" instruction has been violated.pnpm vitest run test/wire/schemaTwinConformance.test.tsstays green, so nothing flags it.Impact
Beyond the policy violation itself, the practical risk is that the vendored test oracles silently go stale: if upstream's generated
schema.jsonor examples changed betweenf68d864aand2ffc3fa2(descriptions,requiredlists, examples), the conformance suites would be validating against an older oracle while the anchor claims a newer commit, and the manifests would be lying about their provenance. (Mitigating fact: the anchor's TS body is byte-identical here, so the twin content is likely unchanged — but the only way to know, and the thing the policy demands, is to regenerate and re-pin in the same commit.)How to fix
In this PR: run
pnpm fetch:schema-twins 2ffc3fa2d00e637ae7c3d1438aaa0561ddfda184(andpnpm fetch:spec-examplesif upstream examples changed) so the twin and both manifests record the same commit as the anchor — or, if the twins are intentionally being left atf68d864a, document why in the PR. Longer-term, update.github/workflows/update-spec-types.ymlto run the twin/example fetch scripts andgit addtheir outputs alongside the anchor, so the nightly sync can satisfy rule 4 on its own; optionally add a check inschemaTwinConformance.test.tsthat compares the manifest'ssource.committo the anchor header so a future provenance-only divergence fails loudly.