Repository navigation
fix(scripts): relate the recorded @object-ui version to the objectui pin - #18814
Merged
Merged
Conversation
check-sdui-manifest read `objectuiPackagesVersion` as a presence check only: the record could name a pin and a version with nothing asking whether that version is the one the pinned commit declares. The generator's default makes that the live shape — with `--objectui-version` unset it reuses the version already in the record, so a regeneration after a pin bump re-records the NEW pin under the OLD version while every check here stayed green. The new check reads `packages/core/package.json` at the pinned commit from an objectui checkout (OBJECTUI_ROOT, else the ../objectui sibling) and fails when it disagrees with the record. That checkout is an oracle a required lint job does not have, so an absent one is REPORTED, never scored: the success line names the leg that did not run, and --require-objectui turns that gap into an exit 1 for callers that hold a checkout. An oracle present and unable to answer is a failure, not a skip. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JbZnqu8bt6YqfJsr9vaFb3
This was referenced Sep 17, 2026
os-bill
marked this pull request as ready for review
September 17, 2026 23:06
os-bill
deleted the
claude/issue-18611-sdui-manifest-version-pin-check
branch
September 17, 2026 23:32
This was referenced Sep 17, 2026
akarma-synetal
pushed a commit
to akarma-synetal/framework
that referenced
this pull request
Sep 28, 2026
…from the PIN, not the record (objectstack-ai#18875) Fixes objectstack-ai#18819 Clause-②: no ## The defect, re-measured on this branch's base `origin/main` `36583e989b`. The generator read its two provenance fields at two different moments: ``` :129 const version = arg('--objectui-version') ?? record.objectuiPackagesVersion; :199 objectuiSha: pin, :200 objectuiPackagesVersion: version, ``` `objectuiSha` is re-read from the LIVE `.objectui-sha`; `objectuiPackagesVersion` fell back to the value already sitting in `scripts/sdui-manifest.record.json`. A regeneration after a pin bump therefore wrote the NEW pin under the OLD version string — a record whose two objectui fields describe two different commits, which is exactly the record `scripts/check-sdui-manifest.mjs` check 4 rejects. The person that reds is the one who followed the documented bump procedure, so the producer is where it gets fixed. ## Step one, before writing any fix: is that path reachable today? The counterfactual on `:129` is that the defect is unreachable if `arg('--objectui-version')` is never empty. It is reachable. **Paths, not counts.** **No automated caller exists at all.** No `package.json` script, no workflow step and no shell line executes this generator. `scripts/bump-objectui.sh` and `scripts/build-console.sh` only `echo` the command. Every invocation is therefore a person or an agent typing one of the spellings the tree documents. Of those spellings, six omit `--objectui-version`: | path | spelling | |:---|:---| | `scripts/check-sdui-manifest.mjs:228` | `Regenerate: node scripts/gen-sdui-manifest-node.mjs` — printed when the artefact is missing | | `scripts/check-sdui-manifest.mjs:275` | `Regenerate: node scripts/gen-sdui-manifest-node.mjs` — printed on a sha256 mismatch | | `scripts/sdui-manifest.record.json:10` | `Regenerate + re-record: node scripts/gen-sdui-manifest-node.mjs` | | `packages/spec/scripts/manifest-prescription.ts:81` | ``regenerate it and its record with `node scripts/gen-sdui-manifest-node.mjs` `` | | `scripts/gen-sdui-manifest-node.mjs:8` | the bare usage line | | `scripts/gen-sdui-manifest-node.mjs:9` | the `--modules-root DIR` offline usage line | Two of those six are printed **by the gate itself**. The remaining spellings do carry the flag: `AGENTS.md:156`, `docs/releases-maintenance.md:116` and `:279`, `scripts/bump-objectui.sh:11` and `:739`, `scripts/build-console.sh:297`, `scripts/check-sdui-manifest.mjs:301` `:303` `:320`. The other paths that name the generator carry no command at all and are listed here for completeness: `.github/workflows/lint.yml:799` (a comment), `packages/spec/scripts/check-generated.ts:391`, `packages/spec/scripts/check-react-blocks-declaration-parity.ts:85`, and `packages/spec/scripts/check-react-blocks-declaration-parity.test.ts:565` `:569` (a pin test on the prescription text). ## A or B — decided by that reading, not by preference Zero automated call sites means option B's stated cost ("every call site has to change") is nearly zero *in code*. But B is not free: it would turn all six documented no-flag spellings into refusals, including the `--modules-root` offline mode, and it would refuse even when the answer is sitting in the objectui checkout the bump already required. So: **A for the default, B for the residue.** - `--objectui-version` still wins when passed. - Otherwise the version is what `packages/core/package.json` DECLARES at the pinned commit, read through `check-sdui-manifest.mjs`'s exported `readPinnedDeclaredVersion` — the same function check 4 judges the written record with, imported rather than re-typed. Producer and gate now read one oracle; two readers of two oracles is where this drift came from. - When that oracle cannot answer (no objectui checkout, or one that does not carry the pin) the generator REFUSES and names both remedies. An unread version is never converted into a version string — Route and surface ownership §3, prefer failing to falling back, and Prime Directive objectstack-ai#12's ban on a lenient `??` fallback in place of fixing the producer. Importing the gate's exported oracle changes no gate: `scripts/check-sdui-manifest.mjs` is untouched in this diff, and its CLI body is behind `isEntrypoint(import.meta.url)`, so importing it runs nothing. ## Verification Every leg below ran against a fixture tree in a scratchpad, or against the real repo with a trap and a proved restore. `.objectui-sha` and `scripts/sdui-manifest.record.json` are read-only this round; neither is in this diff. ### LIT — pin bumped, `--objectui-version` not passed. Both legs read. A synthetic objectui checkout with two commits (`a183cfbf…` declaring `17.6.0`, `51ecffcc…` declaring `18.0.0-fixture`), a stub `@object-ui` install behind `--modules-root`, and a fixture record naming the OLD sha at `17.6.0`. The fixture pin is the NEW sha. | leg | generator | record written | `check-sdui-manifest.mjs` | |:---|:---|:---|:---| | before | `36583e989b` | `51ecffccfb32 / 17.6.0` — new pin, **old version** | **exit 1**, check 4 red | | after | this branch | `51ecffccfb32 / 18.0.0-fixture` | **exit 0**, green | The before leg's gate output is check 4 naming the defect verbatim: ``` the record's two objectui fields describe different commits: objectuiPackagesVersion is "17.6.0", but objectui 51ecffccfb32… — the pin the record itself names — declares "18.0.0-fixture" in packages/core/package.json ``` ### DARK — pin not bumped. Reads zero, on the REAL artefact. Not a fixture: the real `scripts/gen-sdui-manifest-node.mjs`, the real pin `53ded82bf7a494f54e344e19099dbf00854b8694`, and the real published `@object-ui/*` 17.6.0 set installed once and reused by both legs so the install cannot be the variable. The base generator was swapped in on disk, its arrival proved by anchor counts before the leg ran (`?? record.objectuiPackagesVersion` = 1, `readPinnedDeclaredVersion` = 0, and a `git hash-object` differing from the HEAD blob), then restored. ``` leg after (fixed) : 57 components, 66910 bytes, sha256 49211fee7792cf51174930dc2c1be2169d5175f77a83491f68f90b3f0c19e69d leg before (base) : 57 components, 66910 bytes, sha256 49211fee7792cf51174930dc2c1be2169d5175f77a83491f68f90b3f0c19e69d cmp: BYTE-IDENTICAL ``` That sha256 is also the one the tracked record already carries, and the tracked `sdui.manifest.json` HEAD blob is still `78f870e42fe9` — unmoved. Restore proved by state, not by an exit code: `git diff HEAD` empty and `git status --porcelain` empty afterwards. ### Two further legs - **Refusal residue.** Pin bumped, no flag, oracle unreachable (`OBJECTUI_ROOT` at a directory with no `.git`): base generator exits 0 and silently writes the drifted record; this branch exits 1, writes no manifest, and leaves the record untouched. - **Explicit precedence.** `--objectui-version 99.1.2-explicit` is honoured unchanged on both legs; the success line now also names where the version came from. ### Gates - `node scripts/check-sdui-manifest.mjs` — **exit 0** on the clean tree, and its check 4 leg resolved for real: "@object-ui 17.6.0 is the version objectui 53ded82… declares in packages/core/package.json (read from /home/user/objectui)". - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 26 commands; all 26 run, **all exit 0**, and `--ran` with exit codes recorded reconciles: "26 derived famil(ies) accounted for — 26 run, 0 NOT-MEASURED (a DERIVED zero)". - The seven roster families the tool flags as "roster under scripts, which one of your paths is in — silence is not evidence in EITHER direction" were run too. Six exit 0. `pnpm check:published-readme-exports` exits **3 — PREREQUISITE NOT MET** (46 packages unbuilt); that is NOT MEASURED, not a finding, and this diff moves no package source and no README. - `pnpm lint` (`eslint . --no-inline-config`), the whole repo, **exit 0** at `1c3a721ac1`. - `pnpm check:nul-bytes` exit 0; an independent control-byte scan of the changed file is clean. No changeset: nothing published moves. `scripts/**` appears in no package's `files[]` and the root package is `private`, so no released package's contents change. ## Acceptance notes Noted, not filed — none is a reproducible defect, a declared-contract violation, or a metadata-authoring trap, so none earns a card under Prime Directive objectstack-ai#10: - `scripts/check-sdui-manifest.mjs` check 4's header paragraph, and its check-4 failure text at `:318-319`, both explain the producer default this PR removes ("The generator REUSES the version already recorded when `--objectui-version` is not passed"). After this lands those sentences describe history rather than current behaviour. The gate is fenced read-only for this card, so they are left exactly as they are. The check itself stays load-bearing — it still catches a hand-edited record, an explicitly-wrong `--objectui-version`, and any other producer. - `packages/spec/scripts/check-react-blocks-declaration-parity.ts:88-89` says the node producer "enumerates the PUBLISHED `@object-ui/*` packages at the version named in `scripts/sdui-manifest.record.json`". That sentence is wrong-by-default after this change. Not fixed in place: editing it pulls `packages/spec` into the diff and with it a whole gate family this card does not otherwise owe, against the bounded-in-place-fix condition of adding no new verification surface. - The residual hole this PR deliberately does not close: an operator who passes `--objectui-version` **explicitly and wrongly** still writes a drifted record. The generator could warn when an explicit value disagrees with the resolvable pin oracle. Check 4 already reds the resulting record, so this is a loudness improvement, not a correctness gap. - objectstack-ai#17735 is not addressed here — whether the published tarballs at a version were built from the pinned commit is that card's producer question, and it carries `needs-user-decision`. This change moves the version's SOURCE and nothing about that relation. objectstack-ai#18814's check 4 is not modified here either. Fenced files honoured: `scripts/sdui-manifest.record.json` and `.objectui-sha` are held by open PR objectstack-ai#18723 and are read-only in this round. The real DARK leg did rewrite the record as a side effect of running the generator, exactly as warned; both were restored from HEAD and the restore is proved by an empty `git diff HEAD`, never by an exit code. --- _Generated by [Claude Code](https://claude.ai/code/session_01JbZnqu8bt6YqfJsr9vaFb3)_ Co-authored-by: Claude <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #18611
Clause-②: no — one repo script,
scripts/check-sdui-manifest.mjs. No published bytes move (measured below).What changed
The gate gains check 4: the record's
objectuiPackagesVersionmust be the versionpackages/core/package.jsondeclares at the pinned commit. Checks 1-3 already reached both fields and related neither — the version was a presence check only, so a record naming pin C and a version C never declared was green.That is not hypothetical:
gen-sdui-manifest-node.mjsdefaults--objectui-versionto the version already in the record, while re-recordingobjectuiShafrom the live pin. A regeneration after a pin bump therefore writes the NEW pin under the OLD version string, and every check in this gate stayed green through it.Question 1 — how "corresponds" is judged, and the channel readings behind the choice
The seat marked this unverified and asked for the channel to be measured first. Measured in this container, worktree at
034f5a3af:../objectui/home/user/objectui). Shallow (--is-shallow-repository= true) and still carries the pin:git cat-file -e 53ded82b...^{commit}exit 0;git show 53ded82b:packages/core/package.jsonreads"version": "17.6.0"grep -c "@object-ui/" pnpm-lock.yaml= 0; no workspacepackage.jsondeclares an@object-ui/*dependency;packages/sdui-parser/objectui-lockstep.jsonrecords objectui'srevbut no version. There is no second in-repo fact to relate the version to.github/workflows/lint.ymlhas oneactions/checkout@v7(this repo) and no objectui clone; this gate's own header declines a network dependency inside a required lint jobci.ymlconsole-build jobgit init+git fetch --depth=1 origin 53ded82bf7a494f54e344e19099dbf00854b8694exit 0, commit resolves. The remedy line the gate prints is true, not a guessSo the predicate cannot be offline: nothing in this repo can relate the two fields. Check 4 reads the pinned commit's
packages/core/package.jsonfrom an objectui checkout —OBJECTUI_ROOT, else the../objectuisibling, the same two placesbump-objectui.shandobjectui-range.mjslook (deliberately not a second env spelling for one checkout).Because the oracle is external, absence is reported and never scored. Three outcomes are kept apart:
resolved(compare),unreachable(no checkout, or one without the commit — NOT converted into a disagreement),unsupported(checkout in hand and still unable to answer — that is RED). On an unreachable oracle the success line says which leg did not run, and--require-objectuiturns that gap into an exit 1 for callers that do hold a checkout.Question 2 — the BEFORE reading: do they agree today?
They agree. Record
objectuiPackagesVersion=17.6.0;packages/core/package.jsonat pin53ded82bdeclares17.6.0. Tightening the gate does not red main, and no data was touched —sdui.manifest.json,scripts/sdui-manifest.record.jsonand.objectui-shaare read-only on this card and are unchanged in this diff (1 file, 259 insertions, 24 deletions).17.6.0was built from a commit earlier than the pin. Check 4 cannot see that and does not pretend to: it asserts only that the record's two fields describe one objectui commit. Which mechanism should produce the artefact — so that the published bytes and the pinned tree are the same thing — remains #17735's question and is not ruled here.Acceptance controls
Both legs are the real CLI, on a tree assembled from the real
sdui.manifest.jsonand the real.objectui-sha, with the gate copied in asscripts/check-sdui-manifest.mjssoDEFAULT_ROOTresolves to the fixture. Only the record's version field differs between LIT and DARK; the artefact bytes are untouched, sosha256still matches and the hash leg stays green in every run.OBJECTUI_ROOT=/home/user/objectui. "before" is the gate taken from the merge base034f5a3afbygit show, not from memory — control:grep -c readPinnedDeclaredVersionon that copy is 0, with a non-zero control on the same file (grep -c checkTree= 8) proving the instrument reached it.LIT — the red leg (record says
17.5.0, pin declares17.6.0)✓ check-sdui-manifest: ... and fresh at objectui pin 53ded82bf7a4….✗ check-sdui-manifest: the record's two objectui fields describe different commits: objectuiPackagesVersion is "17.5.0", but objectui 53ded82bf7a4… — the pin the record itself names — declares "17.6.0" in packages/core/package.json…Regenerate against the pin: node scripts/gen-sdui-manifest-node.mjs --objectui-version 17.6.0Same input, same command. The red leg is the evidence; "it is still green" is not.
DARK — the real, agreeing record
✓ ... and fresh at objectui pin 53ded82bf7a4….✓ ... and recorded at the live objectui pin 53ded82bf7a4….+@object-ui 17.6.0 is the version objectui 53ded82bf7a4… declares in packages/core/package.json (read from /home/user/objectui)Plus, on this worktree at
3ba8c97dd4:node scripts/check-sdui-manifest.mjsexit 0,--self-testexit 0 (11 cases),--require-objectuiexit 0 (the sibling is in hand here).The no-oracle shape — what CI will see today
NOT CHECKED — objectuiPackagesVersion "17.5.0" was not compared with what the pin declares: no objectui checkout at …— the disagreement is not scored as a match--require-objectui--require-objectui was passed and check 4 could not run: …This is the honest cost of an external oracle, stated rather than hidden: in the required lint job check 4 will report NOT CHECKED, not green. Wiring
--require-objectuiwhere a checkout already exists (theci.ymlconsole-build job) is a workflow edit outside this card's declared file surface — named in the report for the seat, not smuggled in here.Self-test
The red leg is pinned, not just demonstrated. Five rows added (roster and floor 6 → 11), each against a throwaway objectui git repository — a real one, because check 4 resolves the pin through
git cat-file/git showand a stubbed resolver would leave exactly that resolution unexercised:pin-declared version agreeing with the record passespin-declared version disagreeing with the record is REDan unreachable objectui checkout is not a version verdict(same disagreeing tree, oracle removed → GREEN)--require-objectui turns an unreachable checkout REDa pinned commit with no packages/core/package.json is REDEvery row now passes its oracle explicitly, so
OBJECTUI_ROOTin the ambient environment can neither green nor red this self-test. Each new row was probed for the reason it reds: the four RED rows carry four different problems, and the unreachable row carries none.Gates
30 derived families, 30 run, all exit 0, reconciled with the deriver itself:
Re-derived after a fresh
git fetch origin main: the family list is unchanged.pnpm check:nul-bytesexit 0 (8855 files), plus a direct control-byte scan of the changed file (no matches, with a non-zero control on the same predicate).Lint, narrowed and the narrowing proven — measured at
3ba8c97dd4, clean tree:filesglobs) filtered by eslint's ownisPathIgnored, with both controls firing (the changed file reads in-population; a built artefact reads ignored);npx eslint --no-inline-config --format json scripts/check-sdui-manifest.mjs→ 1 file, 0 errors, 0 warnings, exit 0 (file count read from the JSON output, not from prose);eslint.config.mjsstates noparserOptions.projectand no typed rules; the onlyparserOptionsareecmaVersion/sourceType), so this diff cannot move the verdict on any file it does not touch.The repo-wide
pnpm lintrun is CI's.Changeset: none owed, measured
Not inferred from the path. The root package is
private. All 70 publishable packages declare package-relativefiles[](dist,README.md,CHANGELOG.md;packages/specadds seven more, all inside itself), and npm packs only from the package directory, so a repo-rootscripts/file is outside every tarball. Measured on the package with the widest surface:npm pack --dry-run --jsoninpackages/speclists 275 entries — 0 matchingcheck-sdui-manifest, 0 underscripts/, with the positive control firing (202 shippedsrc/**/*.zod.tsentries), so the zero is a reading and not a dead instrument.skip-changesetapplied.Acceptance notes (out of scope, noted and not folded in)
.objectui-shaand the record is silent here (check 3 compares equals, check 4 reports unreachable-by-shape).cut-rc.ymlshape-checks the pin on the release lane, which is where that is caught.gen-sdui-manifest-node.mjs's--objectui-versiondefault is the mechanism that makes a stale-version record reachable at all. It is producer behaviour and [finding] the tracked rootsdui.manifest.jsonand the browser dump differ on the fields the parity gate consumes (18 of 57 components;dataSourcemissing on 15 in the root artefact) — the gate's verdict set is identical under both today, which is the configuration in which the drift is least visible #17735 is the open decision card on the producer mechanism — reported back with dedupe words rather than filed from here, and ⛔ not fixed here.Generated by Claude Code