Skip to content

feat(metadata-core): export the schema upgrade verdict and its finding set token, so a host's install door forwards the platform's own verdict - #31529

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-hfjaim
Nov 8, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-hfjaim

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sam · project thread

Fixes #31526

What changes

  • @objectstack/metadata-core gains src/package-upgrade-verdict.ts, exported from the index next to package-upgrade-plan.ts. It contains:
    • schemaUpgradeVerdict(packageId, plan) → { findings, findingSet }. These need confirming:

      • a suspected rename, always;
      • a type change in the needs_confirm or destructive drift category, including on a declared rename.

      These are not findings: a declared rename, a removed field or object, a safe type change, a seed change.

    • installedRecordUnavailableVerdict(packageId, finding): the verdict for a door that has no installed side to compare. It returns one confirmable finding, never "no finding". The finding's sentence stays the door's own.

    • schemaUpgradeFindingSet(packageId, findings): the token. It is schema-upgrade: followed by 32 hex characters of a SHA-256 over the package id and the findings' sorted identities.

    • Constants: SCHEMA_UPGRADE_CONFIRMATION_REQUIRED, SCHEMA_UPGRADE_CONFIRMATION_STATUS, SCHEMA_UPGRADE_TOPIC, SCHEMA_UPGRADE_CONFIRMED_CATEGORIES.

    • Types: SchemaUpgradeFinding, SchemaUpgradeUnavailableFinding, SchemaUpgradeVerdict.

  • @objectstack/cloud-connection: the install-local door now imports all of the above, and the moved code is verbatim. The door keeps only ledgerRecordUnavailableVerdict, its sentence for an install record that is unreadable or missing; that function now calls the exported installedRecordUnavailableVerdict. createHash and three type imports the door no longer uses are dropped.
  • @objectstack/spec: one PROVENANCE_WAIVERS entry, because the provenance gate attributes a constant to the package that defines it. SCHEMA_UPGRADE_CONFIRMATION_REQUIRED is now defined in metadata-core but stays registered under @objectstack/cloud-connection, whose door puts it on the wire. This follows the UPDATE_ID_MISMATCH shape. No ledger row is added or moved.

Why

cloud#3654 (epic cloud#3652, ruling Q3 「默认拒绝,需显式映射(推荐)」) has the hosted install door refuse an undeclared rename or a type change "with the framework's code and finding-set token". Its card forbids cloud from re-judging.

Before this PR, the verdict and the token were private to marketplace-install-local-plugin.ts, so the hosted door could only copy the judgement or refuse nothing. With the export, both doors apply one rule and mint one token: the same pair of versions gets the same findings and the same token, whichever door installs it.

The hosted consumer is cloud#3861.

Verification

Run in a worktree at origin/main 4cd48e27 plus this branch. The workspace dependencies' dist/ were borrowed from a build of objectstack 3c380253 (27 commits behind main), and metadata-core was rebuilt from this branch.

  • packages/metadata-core: vitest run src/package-upgrade-verdict.test.ts src/package-upgrade-plan.test.ts gives 2 files, 27 tests passed. The new test file pins two token values, both computed with the door's original digest before the move, so the test pins byte identity:
    • schema-upgrade:a168d8927e7a5afc25f947ee715fa848: a one-field suspected rename on com.acme.deals;
    • schema-upgrade:c29494e0b3b3e33a84adf0c2188baa37: the empty set.
  • packages/cloud-connection: vitest run on the three install-local suites that exercise the gate (marketplace-install-local-upgrade-plan, -corrupt-ledger, -declared-rename) gives 3 files, 47 tests passed, unchanged.
  • packages/spec: check:error-code-provenance OK (11 waivers, all live). src/api/error-code-ledger.test.ts gives 26 tests passed.
  • tsc --noEmit is clean in metadata-core (both configs) and in cloud-connection. eslint is clean on the changed source files.
  • check-changeset-fixed, check-empty-changeset, check-adr-0087-registration, check-changeset-no-major and check-doc-authoring all pass.
  • Docs drift comment: the two pages it names (data-modeling/fields.mdx and deployment/cli.mdx) describe the install-local refusal and renamedFrom. Their behaviour is unchanged by a verbatim move, so neither needs an edit.

Clause-②: yes (widening)
Metadata-protocol: none

This is widening only: @objectstack/metadata-core gains the exports listed above. No request, answer, key or error code changes on any door. The changeset is graded patch, since the protocol kind is none.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (packages/spec gains one data entry in PROVENANCE_WAIVERS.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (eslint on the changed files)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: one ledger waiver entry. No schema, key or export changes.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done. (A full pnpm test was not run in this container; CI carries it.)

Generated by Claude Code

…g set token, so a host's install door forwards the platform's own verdict

The verdict that decides which findings of a package upgrade plan stop a
managed upgrade until the installer confirms them, and the token that
confirmation echoes, were module-private in the install-local door. They
move into @objectstack/metadata-core beside comparePackageVersions
(package-upgrade-verdict.ts) and are exported; install-local imports them
and keeps only its ledger-specific sentence for an unreadable install
record. No behaviour change: the refusal, its findings, sentences and token
are unchanged, and a test pins two token values the door's digest minted.

The hosted control plane's install door (cloud#3654) applies the same rule
and mints the same token from its two stored versions instead of keeping a
second reading of it.

Fixes #31526

Claude-Session: https://claude.ai/code/session_01QUs3BsJ2E2byCWsBstMjAJ
Co-authored-by: Claude <noreply@anthropic.com>
@os-zhuang os-zhuang self-assigned this Nov 8, 2026
@github-actions github-actions Bot added size/l 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 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/cloud-connection, @objectstack/metadata-core, @objectstack/spec, touching 24 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/metadata-core/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/data-modeling/fields.mdx (via renamedFrom (symbol, a field of type SchemaUpgradeFinding))
  • content/docs/deployment/cli.mdx (via SCHEMA_UPGRADE_CONFIRMATION_REQUIRED (symbol, a top-level const object), renamedFrom (symbol, a field of type SchemaUpgradeFinding), SCHEMA_UPGRADE_CONFIRMATION_REQUIRED (literal, a string literal in PROVENANCE_WAIVERS; a string literal in SCHEMA_UPGRADE_CONFIRMATION_REQUIRED), needs_confirm (literal, a string literal in SCHEMA_UPGRADE_CONFIRMED_CATEGORIES))

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

  • content/docs/releases/v17/17-0.mdx (via needs_confirm (literal, a string literal in SCHEMA_UPGRADE_CONFIRMED_CATEGORIES))
  • content/docs/releases/v18/18-1.mdx (via findingSet (symbol, a field of interface SchemaUpgradeVerdict))

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/metadata-core/src/index.ts) — pages documenting those are invisible to this run
  • 9 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 64 of 227 client-bound route-ledger rows — the other 163 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 163: 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; 104 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 — 174 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 46ec2ec10fafc1d7aa760598c1f1b6fdb80c9b47 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 50a21644e39e2fca90630635c961951df9155920 — the merge of head 44d510c5115afdf824c719840c1f735ca0baf2ad into base 46ec2ec10fafc1d7aa760598c1f1b6fdb80c9b47, 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 50a21644e39e2fca90630635c961951df9155920 && git checkout 50a21644e39e2fca90630635c961951df9155920
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 46ec2ec10fafc1d7aa760598c1f1b6fdb80c9b47 44d510c5115afdf824c719840c1f735ca0baf2ad && git checkout -B drift-repro 46ec2ec10fafc1d7aa760598c1f1b6fdb80c9b47 && git merge --no-ff 44d510c5115afdf824c719840c1f735ca0baf2ad

node scripts/docs-audit/affected-docs.mjs --json 46ec2ec10fafc1d7aa760598c1f1b6fdb80c9b47

⚠️ 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 46ec2ec10fafc1d7aa760598c1f1b6fdb80c9b47 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…ON_REQUIRED now that metadata-core defines it; grade the changeset patch

The error-code provenance gate attributes a constant to its DEFINING
package. The code moved into metadata-core's verdict module (#31526) while
its wire emitter stays install-local's door, so the row stays under
@objectstack/cloud-connection and a PROVENANCE_WAIVERS entry records the
shared-verdict shape (as UPDATE_ID_MISMATCH does).

The changeset is regraded patch: Metadata-protocol is none, and the level
follows the protocol kind alone.

Refs #31526

Claude-Session: https://claude.ai/code/session_01QUs3BsJ2E2byCWsBstMjAJ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 8, 2026 14:34
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 8, 2026 14:34
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 3b7219e Nov 8, 2026
68 of 69 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-hfjaim branch November 8, 2026 15:01
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/l 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