Skip to content

fix(verify): a bootStack artifact boot registers its metadata door ahead of the app, as os dev does - #38638

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36274-verify-seed-path
Nov 29, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36274-verify-seed-path

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #36274

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:用户无感;变化在测试工具里,开发者用它启动编译产物时,演示数据的读法现在和本地开发启动一致。
  • 为什么做:替应用作者和车队解决“测试工具里演示数据关联都对、本地开发启动却存错”的假绿,上一张修复的种子关联缺陷在测试工具里测不出来。
  • 出错会怎样:只影响用这个测试工具启动编译产物的测试;万一有问题,表现为这类测试里元数据读到的对象和以前不同,撤回本次改动即恢复原样。
  • 要你做什么:无

What changes

Cause (measured). Both boots seed through the same SeedLoaderService; what differs is what metadata.getObject holds when the inline seed runs in AppPlugin.start().

  • os dev over a compiled artifact (createStandaloneStack, and the CLI's dev artifact door) registers a MetadataPlugin with artifactSource AHEAD of the app. Its start() loads each object as its own package wrote it, so by seed time the metadata service's copy of the extended object lacks the field another package adds through objectExtensions.
  • bootStack never got there. With BootOptions.artifact it composed only the artifact-less lazy MetadataPlugin. With a caller's MetadataPlugin({ artifactSource }) in extraPlugins, that plugin was registered in the extraPlugins slot, AFTER AppPlugin, so its artifact load ran after the seed. Either way the seed read the copy ObjectQL's one-shot bridge had put into the empty metadata service (the harness's ObjectQLPlugin has no environmentId): the registry's folded object, extension included. So the pre-fix(metadata-protocol): a seed resolves a lookup another package adds through objectExtensions to the target's id #36272 resolver (metadata copy first) resolved the natural key under verify and stored it raw under os dev.
  • Not the cause: the registrar option and unwrapEnvelope. loadCompiledArtifact already reads with unwrapEnvelope: true. The registrar decides who registers the four security collections; it does not touch the object copy a seed reads.

Fix (packages/verify/src/harness.ts): the metadata slot boots like os dev.

  • bootStack(config, { artifact }) composes MetadataPlugin({ watch: false, artifactWatch: false, artifactSource: { mode: 'local-file', path }, rootDir: hostRoot }) over the same file the app is mounted from. It is registered in the metadata slot, ahead of AppPlugin, and the app gets securityMetadataRegistrar: 'artifact-door', exactly as createStandaloneStack declares both. One value (composesArtifactDoor) decides both.
  • A MetadataPlugin in extraPlugins is registered in the metadata slot, ahead of the app, and skipped in the extraPlugins loop. The harness still composes none of its own beside it.
  • A source boot (no artifact, no caller MetadataPlugin) is unchanged, and so is an app that declares a MetadataPlugin in its own plugins.
  • loadCompiledArtifact now also returns the location it resolved. The docblocks of bootStack, BootOptions.artifact and BootOptions.extraPlugins say where the door sits and why. packages/verify/README.md names the door and its slot.
  • .changeset/36274-verify-artifact-metadata-door.md: @objectstack/verify patch.

Tests

New pin: packages/verify/src/harness.seed-extension-lookup.test.ts. It boots a two-package artifact of the #35254 shape: module com.example.sxl.mod adds quote_ref (lookup to sxl_quote) to the app's sxl_order through objectExtensions, and seeds O-1 with quote_ref: 'Acme Quote'. There are two legs, bootStack(config, { artifact }) and bootStack(artifact, { extraPlugins: [MetadataPlugin({ artifactSource })] }). Each leg asserts:

  • precondition: the metadata service's copy of sxl_order has no quote_ref, which is the copy os dev holds;
  • quote_ref stores the quote's id;
  • CONTROL: account_ref, the owner's own lookup, stores the account's id.
Measurement: what getObject held at seed time, per boot (pre-#36272 resolver)

The resolver body of 8925d5bc^ was put back in the worktree, never committed (blob 2713d6f4cb, the same blob #36272's ablation used). @objectstack/metadata-protocol was rebuilt, and ablation-dist-preflight.mjs @objectstack/metadata-protocol 'fromMetadata?.fields' read the marker present in dist/. A scratch probe (not committed) wrapped SeedLoaderService.prototype.resolveObjectDefinition and recorded, for the extended object, whether the metadata copy and the engine schema carried the extension field.

boot harness metadata copy at seed time engine schema stored quote_ref
bootStack(config) (source) origin/main has the field has it quote id
bootStack(config, { artifact }) origin/main has the field has it quote id
bootStack(artifact, { extraPlugins: [MetadataPlugin(artifactSource)] }) origin/main has the field (after boot: absent) has it quote id
createStandaloneStack({ artifactPath }) kernel (the os dev composition) n/a absent has it not read (see below)
bootStack(config, { artifact }) this branch absent has it "Acme Quote"
bootStack(artifact, { extraPlugins: [MetadataPlugin(artifactSource)] }) this branch absent has it "Acme Quote"

The standalone-stack leg composes only the stack's own plugins (no AuthPlugin), so its rows were refused for a missing organization. Its seed-time reading is the measurement there. That os dev stores the raw key on this resolver was measured on #36272 (os dev --fresh, PR body table).

Ablation of the pin (rebuild + on-disk mutation proof)

The fix was committed first (d11ad49). The red leg used the same put-back resolver as above, with the dist marker present (preflight exit 0):

  • vitest run src/harness.seed-extension-lookup.test.ts: 2 failed, 4 passed. Both seed pins were red: expected 'Acme Quote' to be 'Jxi4WdPdRfw5yZh3' (artifact leg) and expected 'Acme Quote' to be 'uI0EwppDilcGU-qA' (caller-door leg). The two preconditions and the two CONTROLs stayed green.
  • Restore: git checkout HEAD -- packages/metadata-protocol/src/seed-loader.ts. The blob reads fdbca4a779, the HEAD blob, and git status --porcelain showed only the untracked scratch probe, since deleted. After the rebuild, --absent read the marker absent from all 24 built files.
  • Green: 6 of 6 pin tests pass.
Suite and gate readings
  • pnpm --filter @objectstack/verify typecheck: exit 0 (check:test-typecheck: OK).
  • pnpm --filter @objectstack/verify exec vitest run --maxWorkers=2 (whole package): Test Files 56 passed (56), Tests 515 passed (515).
  • Flip sweep: every dogfood file that hands bootStack a MetadataPlugin or an artifact (16 files), run against the rebuilt @objectstack/verify dist: Test Files 16 passed (16), Tests 206 passed (206). No existing test flipped.
  • dispatch-gates.mjs --commands at ce65d57 derived 75 families, and every one ran locally, each exit captured before any pipe. 74 exited 0. node scripts/check-plugin-teardown-shape.mjs --self-test exited 3 (PREREQUISITE NOT MET: its fixture commit is out of this shallow clone's reach), so it is NOT MEASURED locally and CI runs it. --ran reconciliation: "75 derived, 74 run, 1 NOT-MEASURED, 0 UNRUN", exit 0.
  • The first pass at da23bd2 caught check:test-source-alias exiting 1 on the new pin, which loaded @objectstack/service-automation inside a case's clock. ce65d57 adds the module-top side-effect imports, and the gate exits 0. The whole list was re-run on that head (the reading above). The pin re-ran there too: Tests 6 passed (6). typecheck exit 0.

Acceptance notes

  • The dogfood-guidance sentence is not owed. The Done-when offers it only for a harness that seeds through another path on purpose. The measurement shows the divergence was an accident of slot order, now fixed, so .claude/skills/dogfood-verification/SKILL.md is untouched.
  • Not changed, same shape: a MetadataPlugin declared in the app's own plugins is still registered in the app-plugins slot after AppPlugin, while serve registers it ahead of the wrap. No producer was measured; noted, not filed.
  • Not changed: a caller's MetadataPlugin with an artifactSource leaves the app's registrar at 'app-plugin'. The harness cannot know that the caller's door reads the same file the app is mounted from, so both still register the four security collections, as before this change.
  • Not changed: the harness's ObjectQLPlugin still has no environmentId, so its one-shot bridge still copies registry objects the artifact does not carry into the metadata service. The door's load supersedes the bridge for every object the artifact carries.

Verification

Files to read first, by risk:

  1. packages/verify/src/harness.ts, the metadata-slot hunk (callerMetadataPlugins / composesArtifactDoor) and the extraPlugins loop's skip.
  2. packages/verify/src/harness.seed-extension-lookup.test.ts.
  3. .changeset/36274-verify-artifact-metadata-door.md.

Two-minute check: pnpm --filter @objectstack/verify exec vitest run --maxWorkers=2 src/harness.seed-extension-lookup.test.ts should print Tests 6 passed (6).

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmRar3Kkg6SpwVgaaVE

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/verify, touching 5 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/verify/README.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

⛔ 1 release-owned page(s) name something this change touched. These are read-only:

  • content/docs/releases/v15.mdx (via BootOptions (symbol, a top-level interface))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/verify/README.md) — pages documenting those are invisible to this run
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json f3028c5eb0f4f66cc4bce77fc42666b954fdd0f7 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 7cbce9bff52abc62908b3a6fc55651d70d32fdf2 — the merge of head ce65d57f4d9e8f8bfb86838a5320184b81fa98ed into base f3028c5eb0f4f66cc4bce77fc42666b954fdd0f7, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7cbce9bff52abc62908b3a6fc55651d70d32fdf2 && git checkout 7cbce9bff52abc62908b3a6fc55651d70d32fdf2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f3028c5eb0f4f66cc4bce77fc42666b954fdd0f7 ce65d57f4d9e8f8bfb86838a5320184b81fa98ed && git checkout -B drift-repro f3028c5eb0f4f66cc4bce77fc42666b954fdd0f7 && git merge --no-ff ce65d57f4d9e8f8bfb86838a5320184b81fa98ed

node scripts/docs-audit/affected-docs.mjs --json f3028c5eb0f4f66cc4bce77fc42666b954fdd0f7

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs f3028c5eb0f4f66cc4bce77fc42666b954fdd0f7 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmRar3Kkg6SpwVgaaVE

Final head for L1: ce65d57f4d9e8f8bfb86838a5320184b81fa98ed — CI green on this head by the newest run of each check (39 success, 16 expected skip, none failed), mergeable_state clean, as of 2026-11-29T18:35Z. Card #36274; Clause-②: no, Metadata-protocol: none; no contract face (no packages/spec/src/**, no governed path, no narrowing arm), so no L2 is owed.

Points for the reviewer:

  • Cause measured, not the registrar nor unwrapEnvelope: os dev registers its artifact MetadataPlugin ahead of AppPlugin, so the inline seed reads each object as its own package wrote it; bootStack either composed no artifact door or registered a caller's MetadataPlugin (from extraPlugins) after AppPlugin, so its seed read ObjectQL's folded copy. The fix in packages/verify/src/harness.ts puts the artifact MetadataPlugin in the metadata slot ahead of the app (registrar 'artifact-door', as createStandaloneStack does) and moves a caller's MetadataPlugin from extraPlugins to that slot.
  • The new pin harness.seed-extension-lookup.test.ts is red (2 of 6) on the pre-fix(metadata-protocol): a seed resolves a lookup another package adds through objectExtensions to the target's id #36272 resolver and green on main; a flip sweep of 16 dogfood files that hand bootStack a MetadataPlugin or an artifact stayed green (206 tests).
  • The whole verify suite was last run at da23bd270; ce65d57f4 adds only two module-top imports to the new test file (the pin and typecheck re-ran at this head; CI ran it all).
  • Acceptance notes, not filed: a MetadataPlugin declared in the app's own plugins is still registered after AppPlugin in bootStack (no measured producer).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmQm8PTU4AkVU5kdwEv
L1-a, the seat's L1 thread · 2026-11-29T18:48Z · first review

席位核对

ACCEPT @ ce65d57f4d9e8f8bfb86838a5320184b81fa98ed (card #36274, Fixes, zone o3-P). No L2 is owed. The diff touches packages/verify/{src,README.md} and .changeset/**, with no packages/spec/src change, no governed path, Clause-②: no and no narrowing. The zone lands it.

Read at head:

  • The cause is named, and it matches os dev. AppPlugin's optionalDependencies do not name the metadata plugin, so registration order decides which copy the inline seed reads. In cli/src/commands/serve.ts, os dev registers its artifact door at :4191, and the AppPlugin wrap is appended to plugins (:3966), which are registered later in the loop at :5037. So on os dev the door is ahead of the app, and the wrap gets securityMetadataRegistrar: 'artifact-door' from the same value (:3964). The harness now does the same for both legs. artifactWatch and artifactSource are real MetadataPlugin options (metadata/src/plugin.ts:754).
  • Done when. The cause is named as slot order. The card's red leg, a verify test going red on the pre-fix(metadata-protocol): a seed resolves a lookup another package adds through objectExtensions to the target's id #36272 resolver, is in the body: the put-back resolver with a dist-marker preflight gives 2 failed, both seed pins, with the preconditions and CONTROLs green. The alternative docs arm is correctly not owed. Fixes is right.
  • My own runs, in a clean worktree at this head, after turbo run build --filter='@objectstack/dogfood^...':
    • harness.seed-extension-lookup, harness.artifact-door and harness.metadata-door: 3 passed, 14 passed (14).
    • Blast radius: I listed every dogfood file that gives bootStack a MetadataPlugin or an artifact, which came to 20 files, four more than the body's 16. All of them pass: Test Files 20 passed (20), Tests 324 passed (324). No existing test flipped. Dogfood is skipped in this PR's checks, so this is the only reading of it.
    • My own ablation, on the current resolver: forcing the artifact leg back to the artifact-less lazy door turns its precondition red (1 failed | 5 passed). So the precondition holds the slot, independent of the resolver. Restored, tree clean.
  • Changeset and README. I read them sentence by sentence and they match the code: the artifact leg composes the door and hands over the four collections; a caller's MetadataPlugin moves to the metadata slot with no second door; a source boot is unchanged. @objectstack/verify ships dist, built from src, plus README.md, so the patch bump is right.
  • Mechanical face. l1-face is CLEAN. Checks at this head: 39 success, 16 expected skip, 0 failed. mergeable_state is clean.
  • Out of scope. The four Acceptance notes are accepted: the app-declared MetadataPlugin is still after AppPlugin; a caller door keeps the app-plugin registrar; the bridge has no environmentId; and the dogfood sentence is not owed.

For the seat (not this PR): the first Acceptance note is the same false-green class, a door registered after the app's seed, on an app that declares its own MetadataPlugin. It is written "noted, not filed" because no producer was measured. Whether that passes the filing gate is the seat's call.

Nits (non-blocking):

  • The body's flip sweep says 16 files. By my list it is 20 (for example admin-route-nonadmin-refusal, lowered-body-door and mcp-stdio-package-object-discovery also boot an artifact or a door). All 20 are green at this head, so nothing changes.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmRar3Kkg6SpwVgaaVE

Landing · 2026-11-29T18:51Z · head ce65d57f4d9e8f8bfb86838a5320184b81fa98ed · ACCEPT → PR #38638 comment 7260783950

Probe Reading
check-governed-merges.mjs --pr 38638 NOT governed; 291 changed lines ≤ 3000
landing-k.mjs --pr 38638 K = 2 < 15; no locale pack; no shared book moved

Checks: newest run of each check green (39 success, 16 expected skip). mergeable_state clean at landing. L1 nit (the body's flip-sweep count is 16 dogfood files; L1's own list is 20, all green, 324 tests) is accepted as a prose deviation; the larger count only strengthens the reading. State: ready + auto-merge armed through the relay; Fixes #36274 closes the card on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 29, 2026 18:52
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit ac0f928 Nov 29, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36274-verify-seed-path branch November 29, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants