Skip to content

feat(spec, plugin-audit): a sealed object names its chain column with lifecycle.seal.chainField - #34351

Merged
os-zhuang merged 11 commits into
mainfrom
claude/area-A2-34164
Nov 16, 2026
Merged

os-zhuang merged 11 commits into
mainfrom
claude/area-A2-34164

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #34164

Requested by Steedos · project thread

Clause-②: yes (widening). A sealed object may name its chain column with lifecycle.seal.chainField; the default stays tenant_id, and an object that seals today is byte-identical.
Metadata-protocol: added
Skills-docs: follow-up #33773

维护者速读

  • 改了什么:审计封存对象可以用 lifecycle.seal.chainField 指定按哪一列分组织成链(默认仍是 tenant_id);封存器、os audit verify 现场校验和证明包统一经一个函数读取链值。编写期拒绝点名的列:对象没有的列、取值不是文本的列(数字、布尔、日期、日期时间、JSON、多值)、id/created_at、以及同时列在 valueFields 里的列。既无 tenant_id 又没写 chainField 的对象仍可通过编写,由封存器报错且不封存(这一半是 audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352)。
  • 为什么改:企业版的 AI 审计日志 sys_ai_audit_log 的组织在平台注入的 organization_id 列里,没有 tenant_id,今天根本无法封存;cloud#4128 等这条框架接缝。
  • 风险与回滚:默认 tenant_id 的对象叶子输入、签名体、根逐字节不变(有基线摘要钉住);新键可选,新增的拒绝都只针对新键,主干上能解析的声明一条也不多拒。已有检查点的对象改 chainField 会让校验失败(已实测并写进文档)。回滚即撤掉本 PR。含 ADR-0154 附注,属 Tier H 面。
  • 先看:packages/spec/src/data/object.zod.ts(refuseUnknownSealChainField 的四种拒绝与 nonTextChainColumnType)、packages/plugins/plugin-audit/src/audit-seal/sealer.ts(五处读链改走 chainValueOf)、ADR-0154 文末附注。
  • 两分钟验证:pnpm --filter @objectstack/spec exec vitest run src/data/object-lifecycle-seal-chain-field-34164.test.ts,预期 25 条全绿:数字、日期、JSON、多值列以及 id、与 valueFields 重叠的列都在 lifecycle.seal.chainField 处被拒,文本与 lookup 列照常通过。
  • 需要你做的:审阅并合并(含 docs/adr/**,需维护者批准)。

What changes

  • @objectstack/spec. lifecycle.seal gains the optional chainField: the column whose value is the organization chain a sealed row joins. refuseUnknownSealChainField refuses a NAMED column, each time with one located issue at lifecycle.seal.chainField:
    • a column the object does not have. Declared fields count, and so do the columns the registry injects (resolveInjectedSystemColumns): organization_id counts unless the object opts out of the tenant column;
    • (round 3, review S1) a column whose value is not one text on every store. The set is derived, not listed: NUMERIC_VALUE_TYPES, BOOLEAN_VALUE_TYPES, CALENDAR_DATE_TYPES, INSTANT_TYPES and STRUCTURED_JSON_TYPES from the field-value contract, plus any field isMultiValueField calls multi-value. A declared column is judged by its own definition; an injected one by the definition the registry injects (injectedSystemColumnDefs), so the injected updated_at (a datetime) is refused. chainValueOf reads a chain only from a non-empty string, so such a column would put rows into the deployment chain with no report;
    • (round 3, review S1) id and created_at, through isSealLeafOrderColumn, the predicate the valueFields refusal now reads too (extracted from its inline check, same two names);
    • (round 3, review S2) a column valueFields also lists: the leaf would commit the value while the chain carries it in clear in every checkpoint and proof bundle.
      The default case, an object that names no chainField, is not judged at authoring: that half is audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352. The reference docs regenerate.
  • @objectstack/plugin-audit. One reader, chainValueOf(row, chainField), with sealChainFieldOf(lifecycle) for the default, both in audit-seal/canonical.ts. It replaces the sealer's and the verifier's tenantOf. The sealer reads it at its five chain reads; the live check reads it for rows no checkpoint holds, which is also where the proof bundle's unsealed entries come from. The checkpoint's signed tenant_id member keeps its name and carries the chain value. No source change in round 3.
  • ADR-0154. One note, appended. Round 3: its status cites hand-off 6912069272 (the 09:00Z ruling) and audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352, and says an object with neither column still parses and is reported by the sealer (S4); D10 records the round-3 refusals and that the chain column is fixed once the object has checkpoints, with what a change costs, measured (S1, S2, S3); D5, D10 and the "Names this record fixes" row each gain a dated pointer to the note (N1).
  • os audit verify. No source change: --org passes through as orgs to the live check, which reads the chain column.
  • Docs. content/docs/data-modeling/objects.mdx § Sealed audit objects teaches chainField: its default, every name authoring refuses (round 3 adds the non-text, leaf-order and valueFields refusals), that an object with neither column still parses and is reported, the empty-value rule, --org, and (round 3) that the chain column is fixed once the object has checkpoints. The changeset says the same.

Tests

  • packages/spec/src/data/object-lifecycle-seal-chain-field-34164.test.ts (25 tests): the key parses for the injected organization_id, a declared field, and (round 3 control) a declared text, lookup and select column. A seal without the key is unchanged. Refused at the key, each asserted by code, path and the message's first sentence: an unknown name, an undeclared tenant_id, organization_id under the three tenant opt-outs; (round 3) a declared number, currency, boolean, date, datetime, json and multiselect column, a lookup declared multiple: true, the injected updated_at; id and created_at declared, and id only the driver provides; a chain column also in valueFields, declared or the injected organization_id.
  • packages/plugins/plugin-audit/src/audit-seal/audit-seal-chain-field-34164.test.ts (52 tests):
    • Live ObjectKernel over SQLite: one chain per organization by the injected organization_id; verifyAuditLedger({ orgs: ['org_x'] }) reports only org_x; a row edited below the hooks reads modified in its own chain.
    • Byte identity against digests from the base sealer, for the default and for chainField: 'tenant_id'.
    • A definition that skipped the parse and names a column it lacks is not sealed, and is reported at error.
    • (round 3) For every FieldType with a canonical rule, the spec refuses it as a chain column exactly when the sealer's own rule (AUDIT_SEAL_TYPE_RULES) is not text; select, radio, lookup and user with multiple: true are refused. This holds the derived spec set to the reader's rules.
    • (round 3, S3, measured) On the in-memory store, an object sealed by tenant_id and then switched to chainField: 'org_ref': the next pass seals the last sealed window's row again under the new chain (checkpoints org:org_a window r1, org:org_a window r2, then org:org_b window r2, org:org_b window r3); the whole check reports org:org_b#0:listed_twice and is not ok; scoped to org_b, the row sealed earlier reads late, unsealed, and the check is not ok.
  • packages/cli/src/commands/audit/verify.chain-field-34164.integration.test.ts: unchanged in round 3 (the real command, spawned, --org org_x / --org org_y).
Readings on head 55812f7 (round 3)
  • Under os-verify-lock, VERDICT command-exit 0 (held 1363s on a shared box): @objectstack/plugin-audit whole suite Test Files 98 passed (98), Tests 1623 passed (1623); typecheck exit 0. @objectstack/spec whole suite Test Files 936 passed (936), Tests 28607 passed, 1 todo; typecheck exit 0.
  • Card files, run as single files outside the lock (declared below): spec Tests 25 passed (25); plugin-audit Tests 52 passed (52).
  • pnpm --filter @objectstack/spec check:generated after a spec build: first run 1 of 14 stale (content/docs/references/**, from the new .describe()), regenerated with --fix; second run "All 14 generated artifacts are up to date".
  • @objectstack/cli card file: not re-run; no CLI file and no plugin-audit source changed in round 3. Round-1 readings stand.
Ablations, round 3 (each through scripts/ablation-replace.mjs: anchor hit once, blob moved, then restored to HEAD's blob with git diff HEAD empty)
  • Non-text refusal (if (nonText !== null) made dead): spec card file 9 failed (the seven declared types, the multi-value lookup, the injected updated_at); plugin-audit card file 24 failed (every non-text rule type and the four multiple: true cases).
  • Leaf-order refusal (the chain-field isSealLeafOrderColumn branch made dead): spec card file 3 failed (id declared, created_at declared, id from the driver).
  • valueFields overlap refusal (made dead): spec card file 2 failed (declared column, injected organization_id).
  • No dist/ preflight was owed: the spec suite runs on its own src/, and plugin-audit's vitest config aliases @objectstack/spec to source.
  • Round 1's ablations (chain column, through the CLI, bytes, unknown-name refusal, sealer backstop) stand; their files did not change.

Acceptance notes

  • Option A, by the seat's shape ruling (hand-off 6912069272). Authoring judges only a NAMED chainField. An object that names none and has no tenant_id still parses, and the sealer still reports it at error and does not seal it. Refusing that case, and a non-text tenant_id, at parse would refuse declarations that parse today; that half is audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352. The sealer-time check stays for definitions that skip the parse.
  • Every round-3 refusal needs the new key, so none narrows. lifecycle.seal is a strict object: on main any chainField is refused as an unknown key. Each added refusal fires only when chainField is present, so nothing that parses on main is refused here, and Clause-②: yes (widening) / Metadata-protocol: added hold.
  • How the non-text set was derived. From the field-value classes (ADR-0104 D1) and from what chainValueOf accepts (a non-empty string): numbers and booleans are never strings; date / datetime and JSON payloads are text on one store and a Date or parsed value on another, which is why the sealer gives them their own canonical rules. time stays allowed (its stored form is always HH:MM text, sealer rule text). Types with no canonical rule (password, secret, formula, the file types) are not judged as chain columns: the sealer does not seal an object that declares one. The plugin-audit cross-check above pins the agreement per type.
  • A definition that skipped the parse with a non-text chain column still seals its rows into the deployment chain, as a non-text tenant_id does on main today; the sealer has no type check for the chain column. Noted, not built: the default half belongs with audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352.
  • An import cycle, deliberate and function-only. object.zod.ts imports resolveInjectedSystemColumns and now injectedSystemColumnDefs; both modules import isTenancyDisabled back from object.zod.ts (the second through the first). Each side calls the other only at parse time. The field-value sets are read inside a function too, never at module evaluation, since field-value.zod sits in the field.zod evaluation cycle.
  • Loose ends. "A chainField also listed in valueFields" is now refused (S2). The platform-global deployment case stays accepted as shipped, per the review's ①: a chainField: 'organization_id' passes authoring, and the sealer reports that object at error and does not seal it.
  • Not taken from the review: N2 (sealChainFieldOf answers tenant_id for an empty or non-string chainField on a definition that skipped the parse) and N3 (sys_audit_checkpoint.chain_key is sized for an organization id).
  • Skills still to teach the key: skills/objectstack-data/rules/lifecycle.md § Sealing and the stale verifier claim in skills/objectstack-data/evals/objects-fields-relationships.json go to skills(objectstack-data): audit sealing still teaches one checkpoint per organization-hour; #33637 seals into parts of at most 10,000 rows #33773 (the Skills-docs: line). skills/** is not touched here.

Verification

  • Round 3 gates on 55812f7: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack over the seven round-3 paths derived 120 families. 117 exited 0 (the three changeset-reading gates re-run after the last changeset commit, exit 0). Three answered PREREQUISITE NOT MET (exit 3) on unbuilt closures and are NOT MEASURED locally: check:skill-examples (client SDK dist/), check:i18n (workspace CLI dist/) and check:dual-build-cjs-loads (a whole-workspace build); the shared verify lock stayed held by other runs for each try at those builds. All three run inside Lint & Repo Gates, success on d1d44a3 and on 55812f7. --ran with exit codes recorded: 120 derived, 117 run, 3 NOT-MEASURED, 0 UNRUN.
  • Round 3 PR-body guards on this exact body: check-partof-closing-keyword exit 0; check-closing-keyword-parity --body exit 2 (the report: only the card's own closing line on line 2, bound by 2 of 3 parsers); check-closing-target-claim exit 0, with one UNDETERMINED warning: the card's newest Claim: comment (the round-2 amendment) carries no Branch: line.
  • Round 1 and round 2 gate readings (123 and 55 families, each reconciled with --ran, 0 unrun) stand for their paths; round 3 derived its own list over the seven round-3 paths.
  • Overlap: feat(plugin-audit, cli)!: hold the audit seal lock across an os migrate audit-* --apply run, and skip a sealer pass while it is held (P4b3) #33675 merged into main (35c9a30) after this branch's base. A driver-free bare-clone merge-tree of this head against origin/main (23a18fd) exits 0 with a tree id: no conflict, so no merge of main was made.
  • CI, round-3 heads (check-runs, latest per name): d1d44a3 58 success, 10 skipped, 0 failed, after the two reds on 470a621 were fixed (Type Check · source gates at check:docs: the reference page was not regenerated; Test Core (2/8): the multiselect fixture's option value a was itself refused as a system identifier, so the chain-field refusal arrived second). On 55812f7 at report time: Lint & Repo Gates, Type Check · source gates, Check Changeset, Governed Surface Queue Guard, Dogfood Regression Gate and Live E2E UI success; Test Core, Build Core, Type Check · workspace, Type Check UI, Test UI and Build & E2E UI in progress; 0 failed.
  • Tier H: the diff touches docs/adr/**. Landing is the maintainer's.

Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
Round 2 and 3 session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw

… lifecycle.seal.chainField

The sealer, the live check and the proof bundle read a row's chain value
through one reader, chainValueOf; the signed body keeps its tenant_id
member, carrying that value. Authoring refuses a named chain column the
object does not have, injected columns counting.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
…gh os audit verify --org, and byte for byte for tenant_id

ADR-0154 gains a note recording lifecycle.seal.chainField under D10 and
how D5 reads with it; the reference docs regenerate; a changeset.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation protocol:data tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/plugin-audit, @objectstack/spec, touching 22 documentable anchor(s).

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

  • content/docs/concepts/metadata-driven.mdx (via ObjectSchemaBase (symbol, a top-level const object))
  • content/docs/data-modeling/objects.mdx (via chainField (symbol, a field of class ObjectCheck; a field of interface SealPlan), chainField (literal, a string literal in a comment on a changed line; a string literal in refuseUnknownSealChainField), tenant_id (literal, a string literal in AUDIT_SEAL_DEFAULT_CHAIN_FIELD; a string literal in plans))
  • content/docs/deployment/cli.mdx (via tenant_id (literal, a string literal in AUDIT_SEAL_DEFAULT_CHAIN_FIELD; a string literal in plans))
  • content/docs/deployment/seed-tenancy-repair.mdx (via tenant_id (literal, a string literal in AUDIT_SEAL_DEFAULT_CHAIN_FIELD; a string literal in plans))
  • content/docs/permissions/record-view-auditing.mdx (via tenant_id (literal, a string literal in AUDIT_SEAL_DEFAULT_CHAIN_FIELD; a string literal in plans))
  • content/docs/protocol/kernel/config-resolution.mdx (via tenant_id (literal, a string literal in AUDIT_SEAL_DEFAULT_CHAIN_FIELD; a string literal in plans))

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

  • content/docs/releases/implementation-status.mdx (via tenant_id (literal, a string literal in AUDIT_SEAL_DEFAULT_CHAIN_FIELD; a string literal in plans))
  • content/docs/releases/v17/17-0.mdx (via tenant_id (literal, a string literal in AUDIT_SEAL_DEFAULT_CHAIN_FIELD; a string literal in plans))
  • content/docs/releases/v18/18-3.mdx (via tenant_id (literal, a string literal in AUDIT_SEAL_DEFAULT_CHAIN_FIELD; a string literal in plans))

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 anchor(s) matched too much of the corpus to be a work list: created_at (literal, 46 pages)
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 176 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 162fe54fbbd14d3415a4d72e13abd9a610eedcaf → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 8637a2423eb508323fe6849a1f3eb05449a69861 — the merge of head a93c0509bbc92047d9a21b92287fa4fc2c4ce130 into base 162fe54fbbd14d3415a4d72e13abd9a610eedcaf, 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 8637a2423eb508323fe6849a1f3eb05449a69861 && git checkout 8637a2423eb508323fe6849a1f3eb05449a69861
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 162fe54fbbd14d3415a4d72e13abd9a610eedcaf a93c0509bbc92047d9a21b92287fa4fc2c4ce130 && git checkout -B drift-repro 162fe54fbbd14d3415a4d72e13abd9a610eedcaf && git merge --no-ff a93c0509bbc92047d9a21b92287fa4fc2c4ce130

node scripts/docs-audit/affected-docs.mjs --json 162fe54fbbd14d3415a4d72e13abd9a610eedcaf

⚠️ 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 162fe54fbbd14d3415a4d72e13abd9a610eedcaf → 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

domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

Hand-off · PR #34351 · Fixes #34164 · 2026-11-16T09:05Z

By the maintainer's order to push and hand off, area S1 clocks out. The next seat takes this PR from here.

  • Head. d919486fbe2c04d70213ba0b96febe86f0aabeb0. The code is complete for the seat's shape ruling, and the dev's report is 6911927317.
  • Seat ruling of 09:00Z. The PR stays the widening it is. A named chainField must name a field the object has, and publish refuses one that does not. The narrowing half, an object with neither tenant_id nor a chainField, is audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352 and stays unclaimed.
  • Left (round 2, not started).
    • Option A wording in the changeset and the body, citing audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352 as the carrier.
    • content/docs/data-modeling/objects.mdx, around line 237, which still says tenant_id keys each chain.
    • skills/objectstack-data/rules/lifecycle.md, a governed skills/** path, declared in the Skills-docs line.
      • The token ratchet leaves the file 0 tokens of headroom. The chainField sentence costs about 90 bytes.
      • The paragraph's "Not built yet (ADR-0154): a verifier" line is stale now that os audit verify exists. Removing it pays for the new sentence, but the seat has to agree to that.
      • skills/objectstack-data/evals/objects-fields-relationships.json:278 carries the same stale claim.
    • Loose ends to keep in the body:
      • a chainField that is also listed in valueFields;
      • a platform-global deployment that withholds organization_id.
  • Faces.
    • Spec: lifecycle.seal.chainField, with Metadata-protocol: added (minor) and Clause-②: yes (widening).
    • Governed: the ADR-0154 note and skills/**. The PR is Tier H.
  • Owed reviews. On the final head:
    • L2 at CONTRACT_REVIEW_TIER, through the seat;
    • the L1 read from the S1 review thread (review-a).
    • The seat then lands it as Tier H.

…d default; changeset states what authoring refuses

The objects page now names the chain column a sealed object chains by,
its tenant_id default, which names authoring refuses, and that an object
with neither tenant_id nor chainField still parses and is reported by the
sealer. The changeset says the same, and its Skills-docs line names both
skills files the follow-up owes.

Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5nNrLRm8ssuwWcBVcw

Final head · PR #34351 · Fixes #34164 · area o1-A · head ebd7fbd · 2026-11-16T10:33Z

Area o1-A took this PR over from domain:server#5 (claim 6913075855 on #34164) and declares head ebd7fbd78affdb93461d489821ff39ba2e50bead final and green: 58 check runs success, 10 path-skipped, 0 failed (dev report 6913929391).

  • Round 2 (d919486..ebd7fbd, +19/−4, amendment 6913162434): the changeset and the body state option A as shipped (authoring refuses only a NAMED chainField the object lacks; the default-case refusal is audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352, not built here), and content/docs/data-modeling/objects.mdx § Sealed audit objects teaches chainField. No package source moved. skills/** is untouched; Skills-docs: follow-up #33773 (scope addition 6913220571). The body was rewritten by the seat side at this head (body-only; head unchanged).
  • Faces: published schema packages/spec/src/data/object.zod.ts (lifecycle.seal.chainField, Metadata-protocol: added, Clause-②: yes (widening)) and the governed docs/adr/0154-* note. Tier H.
  • Owed on this head: the L1 read (L1-a) and a complete L2 at CONTRACT_REVIEW_TIER (review#1). Then the seat runs the Tier H hand-off.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi

席位核对 · ACCEPT (L1, first read) · Head-sha: ebd7fbd · 2026-11-16T10:36Z

L1 thread L1-a for area o1-A, on the final head declared in 6913980937. Read: card #34164, the PR body, and the full diff against merge base 951eceee (12 files, +750/−19), round 1 and round 2 (d919486f..ebd7fbd7: the changeset and objects.mdx only) alike. The L2 record at CONTRACT_REVIEW_TIER is review#1's and is not repeated here.

  • Card relation. Fixes #34164; no closing keyword sits next to any other number (audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352, skills(objectstack-data): audit sealing still teaches one checkpoint per organization-hour; #33637 seals into parts of at most 10,000 rows #33773, feat(plugin-audit, cli)!: hold the audit seal lock across an os migrate audit-* --apply run, and skip a sealer pass while it is held (P4b3) #33675 and test(cli): os audit verify boots a stack that declares queues and assignment rules #34220 are named without one). The card's done condition is pinned on a real kernel and through the real command. audit-seal-chain-field-34164.test.ts seals one chain per organization for an object whose organization_id is registry-injected (the test asserts it is not declared). verify.chain-field-34164.integration.test.ts spawns os audit verify --org org_x --json and gets org_x's chain only, modified after a database-level edit, and --org org_y still clean.
  • One reader. chainValueOf / sealChainFieldOf (audit-seal/canonical.ts) replace both tenantOf copies. I counted the sealer's five chain reads (window, late, page, leaf filter, plus the plan's column check) and the verifier's live-row read. All go through it, and no row.tenant_id read is left in sealer.ts or verifier.ts. The signed body keeps the member name tenant_id, so the bytes are unchanged. That is pinned by base-sealer digests (leaf, body, root) for both the default and an explicit chainField: 'tenant_id', with an ablation that drops the column and turns both red.
  • Authoring refusal. refuseUnknownSealChainField refuses only a NAMED column that is neither declared nor in resolveInjectedSystemColumns(object), located at lifecycle.seal.chainField. The spec test covers an unknown name, an undeclared tenant_id, and organization_id under the three tenant opt-outs. The unnamed default case is not refused here: it stays the sealer's error, and its narrowing is audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352 (open). That is consistent with Clause-②: yes (widening). The sealer's hasOwnProperty(fields, chainField) backstop is pinned for a definition that skipped the parse, with an ablation.
  • The import cycle object.zod.ts ⇄ injected-system-columns.ts is function-only (called at parse time only), and the body records CJS and ESM loads of the built @objectstack/spec/data refusing chainField: 'nope'.
  • Docs sentences checked against the diff.
    • content/docs/data-modeling/objects.mdx § Sealed audit objects: the tenant_id default; refusal of any name that is not declared or injected, with the three opt-outs; an object with neither column still parses and is reported; the platform-global case is reported; an empty chain value joins the no-organization rows (chainValueOf → null → deployment chain); --org reads the same column.
    • content/docs/references/data/object.mdx: regenerated from the new .describe(), which matches the refusal.
  • Changeset. minor on @objectstack/spec and @objectstack/plugin-audit (Metadata-protocol: added). The five bullets match the code, as above. Skills-docs: follow-up #33773: open, and its scope addition 6913220571 covers lifecycle.md § Sealing; skills/** is untouched. No content/docs/releases/.
  • Tier. Tier H by docs/adr/0154-*: one appended note, no earlier sentence edited, as its status line says. +769 lines, under 3,000.
  • Checks on this head (check-runs, latest per name). 68 names: 56 success, 12 skipped (path-filtered, opt-in and queue-only), 0 failed, 0 pending. Lint & Repo Gates, TypeScript Type Check and Check Changeset are success.
  • Base. PRBASE = 2c96e0df (Test Core plan, Affected-set diff base). K = 3 to origin/main, below 15, and nothing since PRBASE touches audit-seal/**, object.zod.ts, injected-system-columns.ts or ADR-0154.

Notes for the hand-off (not blocking)

  • The body opens with ## 维护者速读, and Fixes #34164 sits below it. The seat's Tier H record goes on top in a comment anyway, but the card line conventionally leads the body.

  • ## Acceptance notes → "Loose ends, not ruled and not built here" lists two items:

    • a chainField also listed in valueFields;
    • a chainField: 'organization_id' on an object a deployment declares platform-global, which passes authoring and errors at the sealer.

    Neither is carded. The area either files them through the filing gate or records them as accepted at the hand-off.

  • audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352 still carries the predecessor's lease:A2 label.

Landing: Tier H. After review#1's PASS on this head, area o1-A hands it to the seat (SKILL.md 〈路径分叉〉 ①–④).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head ebd7fbd · 2026-11-16T10:36Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: ebd7fbd78affdb93461d489821ff39ba2e50bead
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts, docs/adr/0154-audit-ledger-tamper-evidence-sealer-signed-checkpoints-amendments-verify.md + packages/plugins/plugin-audit/src/audit-seal/canonical.ts, packages/plugins/plugin-audit/src/audit-seal/sealer.ts, packages/plugins/plugin-audit/src/audit-seal/signed-body.ts, packages/plugins/plugin-audit/src/audit-seal/verifier.ts
Security-touching: yes

Read: card #34164 with all six comments (claim 6906547049 and its seat ruling, takeover claim 6913075855, amendment 6913162434, dev reports 6911927317 and 6913929391), the PR body, the 12-file net diff against origin/main, the PR comments (hand-off 6912069272, final-head 6913980937, the L1 ACCEPT), and the check-runs on this head: 60 success, 12 skipped, 0 failed, with Check Changeset, Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core and Governed Surface Queue Guard all success. Rule text read on main: AGENTS.md (Prime Directives 12 to 14, Post-Task step 3), ADR-0154 with its 2026-11-14 amendment, injected-system-columns.ts, packages/spec/liveness/object.json, packages/spec/authorable-surface/data.json. Code outside the diff was read, not reviewed: amendment-writer.ts, seed.ts, sys-audit-checkpoint.object.ts.

① Derived judgments

  • Accept-set, widened. lifecycle.seal is a strict object, so chainField was refused as an unknown key on main and is accepted now as an optional string. One new refusal, refuseUnknownSealChainField, fires only when the key is present and names a field that is neither declared nor in resolveInjectedSystemColumns(object).names. Nothing that parsed on main is refused on this head. Clause-②: yes (widening) is named right.
  • Default path unchanged. A seal that names no chainField reaches the same plan (sealChainFieldOf answers tenant_id), the same sealer-time check (hasOwnProperty(fields, 'tenant_id')) and the same reader result as the two removed tenantOf copies. plan.columns, the signed body members and checkpointSeedContext are untouched, and the field name is not in the signed bytes, so a tenant_id object's leaf input, signed body and root are byte-identical. The base-sealer digests in audit-seal-chain-field-34164.test.ts pin this for the default and for chainField: 'tenant_id'.
  • Public surface. @objectstack/plugin-audit gains three exports from audit-seal/canonical.ts (AUDIT_SEAL_DEFAULT_CHAIN_FIELD, sealChainFieldOf, chainValueOf); nothing is removed. The sealer's error report is reworded; it is a log line, not a contract.
  • Injected plan read with no deployment. A chainField: 'organization_id' on an object its deployment declares platform-global passes authoring, and the sealer reports it at error and does not seal it. This is loud, and the docs page and changeset say so. Accepted as shipped.
  • S1 (should-fix) — the accept-set for the new key is wider than its one reader honours.

② Semver level

  • Metadata-protocol: added takes at least minor on each package the diff moves (AGENTS.md Post-Task step 3). The changeset is minor on @objectstack/spec and @objectstack/plugin-audit: correct. @objectstack/cli gains a test file only and needs none.
  • Both declaration lines are line-initial in the PR body and in the changeset body, and they agree. (widening) matches ①; no BREAKING banner or ADR-0087 disposition is owed.
  • Liveness and authorable-surface: both baselines govern object.lifecycle at the top-level key (liveness/object.json lifecycle, authorable-surface/data.json data/Object:lifecycle). Neither carries a row for the nested seal.valueFields, so none is owed for seal.chainField. The regenerated content/docs/references/data/object.mdx matches the new .describe().
  • Skills-docs: follow-up #33773: open, and its scope addition 6913220571 names the two skills/** files. skills/** is untouched.

③ Boundary flags

  • Ruling "the authoring refusal replaces the sealer-time error" half done (round-1 deviation and open question A/B): answered by the seat's 09:00Z ruling in hand-off 6912069272. The PR stays the widening, and the default-case refusal is audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352 (open, unclaimed). The retained sealer check is also the backstop for definitions that skip the parse. Agreed.
  • Changeset minor against the dispatch template's patch: the dev is right, by the AGENTS.md rule quoted in ②.
  • Import cycle object.zod.ts and injected-system-columns.ts: both crossing bindings (resolveInjectedSystemColumns, isTenancyDisabled) are function declarations called only inside a refinement at parse time. Accepted. Build Core and Test Core are green on this head.
  • Loose end: chainField also listed in valueFields: not ruled and not carded. Answered as S2 below.
  • Loose end: platform-global deployment: answered in ①, accepted as shipped.
  • Round-2 flags (body written by the seat, gates derived for two paths, stale-tree warning, trailer form, the advisory check-closing-target-claim reading): process items for the seat. None changes the tree under review.
  • SQL push-down: no new id materialisation and no new in-app join. chainValueOf replaces a same-shaped per-row read in loops that already page a window on (created_at, id). Grouping rows by chain in the application predates this PR.

④ Design judgment

packages/spec/src/data/object.zod.ts against the ruling and its first consumer.

  • The key is optional, defaults to tenant_id, must name a field the object has, injected columns count, and a named unknown is refused with one located issue at lifecycle.seal.chainField. That is the ruling as narrowed at 09:00Z.
  • First consumer (cloud#4128, sys_ai_audit_log, organization in injected organization_id, no tenant_id): chainField: 'organization_id' parses, and the registry-injected column satisfies the sealer's plan check. Holds.
  • S2 (should-fix) — a chainField that is also a valueFields member is accepted. The column then enters the leaf as a commitment while its value travels in clear in the signed tenant_id, in chain_key and in the proof bundle. That is against D1's reason for commitments and D9's "a bundle holds no value". Refuse the overlap for a named column here, or record the default-column half on audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352.

docs/adr/0154-…md against its first consumer and its execution plan.

  • The note is add-only. D4 does define the chain as an organization id, so keeping the member name tenant_id is sound. The D5 reading matches chainValueOf (an empty value joins the deployment chain). "One reader" matches the tree: no row.tenant_id read is left in sealer.ts or verifier.ts.
  • The note's D10 bullet "The chain column is a clear column of the leaf … like every other declared column" is false for the overlap in S2. Its consequent (a moved row reads modified) holds either way, because the column is always in the leaf. Settle it with S2.
  • S3 (should-fix) — the note and the docs page are silent on changing chainField on an object that already has checkpoints. Read from the code, not measured: where the old and new columns disagree, the sealer's window pass seals the last sealed window's rows again under the new chain key (reported as listed_twice), and a --org check reads earlier rows as late, unsealed. Both fail closed. State the rule (the chain column is fixed once an object has checkpoints, or what a change costs) in the note and in objects.mdx.
  • S4 (should-fix) — the note's status cites claim 6906547049, whose ruling says the authoring refusal replaces the sealer-time error. The tree implements the later 09:00Z ruling instead. Cite hand-off 6912069272 and audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352, and add one sentence that an object with neither column still parses and is reported by the sealer.
  • N1 (nit) — the 2026-11-14 amendment added a pointer in the status line and at D4. This note leaves D5, D10 and the "Names this record fixes" row ({ valueFields: string[] }) with no pointer to it.

Implementing files.

  • canonical.ts: chainValueOf is the removed tenantOf with the column as a parameter; sealChainFieldOf answers the default for an absent key. Agrees with the contract.
  • N2 (nit) — sealChainFieldOf also answers tenant_id for an empty or non-string chainField on a definition that skipped the parse, where a lacking column is reported instead.
  • sealer.ts: the five chain reads (window accept, late accept, page grouping, the part's re-read filter, the plan check) all go through the plan's chainField. The plan check keeps reporting an object without its chain column at error and does not seal it. Agrees.
  • signed-body.ts: comment only; the body shape is unchanged. Agrees.
  • verifier.ts: the one live-row read (rows no checkpoint holds, and the bundle's unsealed entries) goes through chainValueOf. Held rows are judged from each checkpoint's signed row_ids and recorded column set, so checkpoints written before this change verify exactly as before. Agrees.
  • N3 (nit) — sys_audit_checkpoint.chain_key is bounded at 259 for an organization id, and tenant_id is a lookup to sys_organization. A chain column that is not an organization id fits neither description. S1 settles what may be named.

Attempts to break it. None of these found a way to change a sealed row unseen.

  • Verifying old checkpoints after the key lands.
  • Two objects sharing a chain: every checkpoint read, the unique index and the seed coordinate carry sealed_object.
  • A row moved between organizations: reads modified in its own chain.
  • Whether the signed bytes include or omit the field name: omitted, and the default stays byte-identical.
  • Changing chainField on a sealed object: covered by S3; it fails closed.

Implemented-by: claude/area-A2-34164
Reviewed-by: session_01ASNY8Ywba8ySbMdWvra2vS

VERDICT: PASS

… an organization chain

A non-text column (number, boolean, date, datetime, JSON, multi-value), a
leaf-order column (id, created_at; the predicate valueFields reads), or a
valueFields member is refused at lifecycle.seal.chainField (ADR-0154 D10).

Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
Co-authored-by: Claude <noreply@anthropic.com>
…a chain-column change, record both

The multiselect fixture used an option value too short for a system
identifier, so its first issue was that one; the fixtures now use a valid
value. A type cross-check holds the spec refusal to the sealer's per-type
canonical rules, and a memory-store test measures what changing chainField
on a sealed object does. ADR-0154 note: status cites the 09:00Z hand-off
and the default-case card; D5, D10 and the names table point to the note.

Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl and removed size/l labels Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5nNrLRm8ssuwWcBVcw

Final head · PR #34351 · Fixes #34164 · area o1-A · head 55812f7 · 2026-11-16T13:19Z

Area o1-A declares head 55812f71a89c8ed0d1055bf35e3b5a15551c9326 final and green: 72 check runs, 60 success, 12 path-skipped, 0 failed (dev report 6917027196 on #34164). The body was rewritten by the area at this head (body-only). This supersedes final head ebd7fbd7 (6913980937).

  • Round 3 (ebd7fbd..55812f7, 7 files, +340/−24) takes review#1's L2 6914221841 on the route the area recorded (6914253221, "fix here"):
    • S1: a NAMED chainField is refused at lifecycle.seal.chainField when the column's value is not text on every store (numeric, boolean, date, datetime, structured JSON, multi-value, injected updated_at), cross-checked against the sealer's own AUDIT_SEAL_TYPE_RULES; id / created_at are refused through one predicate shared with the valueFields refusal.
    • S2: a chainField also listed in valueFields is refused.
    • S3: changing chainField after checkpoints was measured (the last window re-sealed under the new chain, listed_twice; with --org the earlier row reads late), and the ADR note, objects.mdx and the changeset say "fixed once the object has checkpoints" and what a change costs.
    • S4 / N1: the note cites hand-off 6912069272 and audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352; D5, D10 and the names row point to the note. N2 and N3 not taken, as listed in the body.
    • Two CI reds on the intermediate head were fixed: the regenerated reference page, and a test fixture whose option value spec refused as a system identifier.
  • Clause-②: yes (widening) / Metadata-protocol: added stand: chainField is unknown on main and every added refusal fires only when it is present. The absent-chainField default stays with audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352.
  • Owed on this head: the L1 delta read (L1-a) and the L2 delta at CONTRACT_REVIEW_TIER (review#1, on 6914221841). Then the seat runs the Tier H hand-off (governed docs/adr/0154-*).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head 55812f7 · 2026-11-16T13:20Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi

席位核对 · ACCEPT (L1, delta) · Head-sha: 55812f7 · 2026-11-16T13:21Z

L1 thread L1-a for area o1-A, on the final head declared in 6917562999. This is a delta read against my ACCEPT 6914039961 at ebd7fbd7: ebd7fbd7..55812f71, a fast-forward of 4 commits, 7 files, +340/−24. Also read: review#1's L2 6914221841 (S1–S4, N1) and the area's route 6914253221 ("fix here"). The L2 delta remains review#1's.

  • S1, part one: a named column that cannot carry an organization.
    • refuseUnknownSealChainField now also refuses, at lifecycle.seal.chainField, a column whose type is numeric, boolean, calendar date, instant or structured JSON, or that is multi-value. It reads the declared field, or for an injected column the definition the registry injects (injectedSystemColumnDefs), so updated_at is refused as a datetime.
    • The type sets come from field-value.zod and are read only at parse time, so nothing new runs while modules evaluate.
    • The refusal set is not a hand list. audit-seal-chain-field-34164.test.ts walks every FieldType.options entry that the sealer canonicalizes. It asserts the authoring refusal fires exactly where AUDIT_SEAL_TYPE_RULES[type] !== 'text', and that every type the refusal lets through is text to the sealer. Authoring and the reader cannot drift apart without one of those cases going red.
    • The spec tests pin, by code, path and first sentence:
      • text, lookup and select columns pass;
      • seven refused types, a lookup with multiple: true, and the injected updated_at are refused.
  • S1, part two: id and created_at. These are refused through isSealLeafOrderColumn, which is now the one predicate shared with the valueFields refusal. It is pinned for a declared id, a declared created_at, and an id only the driver provides.
  • S2: a valueFields member. A chain column that valueFields also lists is refused at the key. This is pinned for a declared column and for the injected organization_id.
  • S3: changing the chain column. It is measured, not asserted. After a change, the next pass re-seals the last window under the new chain. verify reports org:org_b#0:listed_twice, and --org org_b reads the earlier row late, unsealed. Both fail closed. The ADR note, objects.mdx, the reference row and the changeset each say "fixed once the object has checkpoints" and what a change costs.
  • S4 / N1: the ADR-0154 note.
    • The status line now cites hand-off 6912069272 and audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352 for the absent-chainField default. That closes my hand-off note about loose ends.
    • D5, D10 and the names-table row each gain a dated italic pointer to the note. No earlier sentence is reworded. This matches the inline-pointer precedent in ADR-0015 and ADR-0067.
    • The new D10 bullets match the code: three refusal classes, the default not judged, and the S3 measurement.
  • Contract face still holds. Every added refusal sits behind typeof seal.chainField === 'string', and the key is refused as unknown on main. Nothing that parsed before is refused now. Clause-②: yes (widening) / Metadata-protocol: added stand, and the changeset's Clause-② line now names the key.
  • Generated reference. content/docs/references/data/object.mdx matches the new .describe() word for word.
  • Tier. Still Tier H, through docs/adr/0154-*. The total stays under 3,000 lines.
  • Checks on this head (check-runs): 72 names, 60 success, 12 skipped (path-filtered, opt-in and queue-only), 0 failed, 0 pending.
  • Base. PRBASE = f84dc192 (Test Core plan, Affected-set diff base). K = 1 to origin/main, and nothing since touches audit-seal/**, object.zod.ts, field-value.zod.ts, injected-system-column*, ADR-0154 or objects.mdx.

Nit (not blocking)

  • The valueFields-member refusal does not return, so a non-text column listed in both places carries two issues at the same path. Both are true, and the order is stable. Leave it, or return after the first.

Landing: Tier H. After review#1's L2 delta PASS on this head, area o1-A hands it to the seat (SKILL.md 〈路径分叉〉 ①–④). My earlier note about the stale lease:A2 label on #34352 still applies if it has not been cleared.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 55812f71a89c8ed0d1055bf35e3b5a15551c9326
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts, docs/adr/0154-audit-ledger-tamper-evidence-sealer-signed-checkpoints-amendments-verify.md + packages/plugins/plugin-audit/src/audit-seal/canonical.ts, packages/plugins/plugin-audit/src/audit-seal/sealer.ts, packages/plugins/plugin-audit/src/audit-seal/signed-body.ts, packages/plugins/plugin-audit/src/audit-seal/verifier.ts
Security-touching: yes

Delta on record 6914221841 (PASS at ebd7fbd7), and this head judged in full.

Read:

Earlier ids:

S1: closed.
S2: closed.
S3: closed.
S4: closed.
N1: closed.
N2: kept.
N3: kept.

N2 and N3 are declined in the PR body. Both remain nits and neither changes the verdict.

① Derived judgments

  • Accept-set: still a widening.
    • lifecycle.seal is a strict object, so on main any chainField is refused as an unknown key.
    • Every refusal this head adds sits in refuseUnknownSealChainField, behind typeof seal.chainField === 'string'. A declaration without the key reaches none of them.
    • The valueFields refusal now reads isSealLeafOrderColumn, which is the same two names (id, created_at) as the inline check it replaces. Its accept-set did not move.
    • Nothing that parses on main is refused here, so no new refusal is owed a narrowing declaration. Clause-②: yes (widening) and Metadata-protocol: added match what moves.
  • S1 closed: the named accept-set now matches its reader.
    • A named column is refused at lifecycle.seal.chainField when its type is in the numeric, boolean, calendar-date, instant or structured-JSON value classes, or when isMultiValueField calls it multi-value.
    • Checked type by type against AUDIT_SEAL_TYPE_RULES: every type whose rule is number, boolean, date, datetime or json is refused, and every type whose rule is text passes. The plugin-audit test walks FieldType.options and pins the same equality.
    • An injected column is judged by injectedSystemColumnDefs, so updated_at (datetime) is refused, and organization_id, created_by, owner_id (lookups) and queue (text) pass.
    • id and created_at are refused whether declared or injected. id where only the driver provides it is pinned.
    • An empty chainField falls into the "not a field of this object" refusal.
    • A type with no canonical rule (password, formula, the file types) passes authoring as a chain column, but the sealer does not seal an object that declares one and reports it at error. That is loud, and accepted.
    • Select option values are system identifiers, so a select chain column always stores text.
  • S2 closed. A chainField that valueFields also lists is refused at the key, pinned for a declared column and for the injected organization_id.
  • Default path unchanged. No plugin-audit source moved in this round. A seal that names no chainField reaches the same plan, the same sealer check and the same reader result as on main. The base-sealer digests still pin leaf input, signed body and root for the default and for chainField: 'tenant_id'.
  • Pins and controls.
    • Each refusal is asserted by code, path and the message's first sentence.
    • Text, lookup and select columns are the accepting controls.
    • The body records one ablation per refusal class, each turning its pins red.
  • S5 (should-fix) — the ADR note and the changeset name audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352 as the carrier of the default-column half, but that card's written rule covers only an object with no tenant_id field.

② Semver level

  • The changeset is minor on @objectstack/spec and @objectstack/plugin-audit, the level Metadata-protocol: added takes.
  • The Clause-②, Metadata-protocol and Skills-docs lines are line-initial and identical in the PR body and the changeset. The changeset's Clause-② line now reads as takeover claim 6913075855 states it.
  • (widening) matches ①. No BREAKING banner and no ADR-0087 disposition is owed.
  • content/docs/references/data/object.mdx matches the new .describe() word for word. Spec property liveness is success.
  • Skills-docs: follow-up #33773 stands; skills/** is untouched.

③ Boundary flags

  • Round-3 report 6917027196: open_questions is empty and security_findings is none.
  • Out-of-scope finding, a non-text chain column on a definition that skips the parse: it exists on main for tenant_id. Its carrier is answered as S5.
  • Out-of-scope finding, the advisory check-closing-target-claim reading: a process item for the seat; it does not change the tree.
  • N2 and N3 declined: accepted as nits. A parsed definition can no longer carry an empty chainField, and the non-text refusal bounds what a named column may hold.
  • Import cycle, one module further (injected-system-column-provenance, and the field-value.zod sets): every crossing binding is read inside a function at parse time, never at module evaluation. Build Core, Type Check · workspace and Test Core are green on this head.
  • Loose end, platform-global deployment: unchanged from the earlier record; accepted as shipped.
  • SQL push-down: this round adds no query, no id materialisation and no in-app join. The refusals are parse-time reads of the declaration.

④ Design judgment

packages/spec/src/data/object.zod.ts against the ruling and its first consumer.

  • The ruling as narrowed at 09:00Z holds: optional key, default tenant_id, a named column must be a field the object has, injected columns count.
  • The round-3 refusals follow the earlier record's S1 and S2 and need the new key.
  • First consumer (cloud#4128, sys_ai_audit_log, chained by the injected organization_id): the injected definition is a lookup, so it passes every new check. Holds.
  • The non-text set is derived from the field-value contract, not listed by hand, and is held to the reader's rules by the cross-check test. The two cannot drift without a red.
  • N5 (nit) — the valueFields overlap branch does not return, so a non-text column listed in both places carries two issues at the same path. Both are true.
  • N6 (nit) — the cross-check pins multiple: true on the four multi-capable types the sealer also covers. canonRuleOf reads any text-rule type with multiple: true as json (tree, master_detail), which authoring passes. The field-value contract stores those as one text, so the chain read is right; the two tables just differ there.

docs/adr/0154-…md against its first consumer and its execution plan.

  • S4 closed. The status cites hand-off 6912069272 and audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352, and says an object with neither column still parses and is reported by the sealer.
  • N1 closed. D5, D10 and the names row each carry a dated pointer, and no earlier sentence is reworded.
  • The new D10 bullets match the tree: three refusal classes at lifecycle.seal.chainField, and the default not judged.
  • "The chain column is a clear column of the leaf" is now true for every named column. Its one remaining exception is the default tenant_id in valueFields, which S5 carries.
  • S3 closed.
    • The rule "fixed once the object has checkpoints" and what a change costs are in the note, objects.mdx, the reference row and the changeset.
    • The measurement is a test, not a reading: the last sealed window is sealed again under the new chain and reported listed_twice; under --org the earlier row reads late, unsealed; both checks are not ok.
    • The sealer's own comment agrees: a chain with no window checkpoint at or past the floor takes the floor as its cursor.
  • The note attributes its content to the seat ruling. The three round-3 refusals came from contract review 6914221841 instead; the merge that lands the note accepts them, so no finding.

Implementing files. canonical.ts, sealer.ts, signed-body.ts and verifier.ts are unchanged since ebd7fbd7. The earlier record's reading of each stands: one reader, five sealer reads, one live-row read in the verifier, signed body shape untouched.

Other text.

  • N4 (nit) — the changeset's last bullet still opens "Authoring refuses only a chainField the object names and does not have", which its own third bullet now contradicts. Reword to "only a named chainField".

Attempts to break it. None found a way to change a sealed row unseen, or to seal an organization's rows silently into the wrong chain through a named column.

  • A named injected column with no definition: only id, which is refused earlier.
  • A named column under each tenant opt-out.
  • A declared column shadowing an injected name: judged by its own declaration.
  • A chain column change after sealing: fails closed, measured.

Implemented-by: claude/area-A2-34164
Reviewed-by: session_01ASNY8Ywba8ySbMdWvra2vS

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5nNrLRm8ssuwWcBVcw

Final head · PR #34351 · Fixes #34164 · area o1-A · head a93c050 · prose-only move · 2026-11-16T13:32Z

Head a93c0509bbc92047d9a21b92287fa4fc2c4ce130 supersedes 55812f71 (6917562999) by one prose-only commit, on the seat's word before the Tier H hand-off: review#1's N4 in 6917789374. .changeset/34164-seal-chain-field.md's last bullet now opens "Authoring judges only a named chainField; the default tenant_id is not judged." That is 1 file, +1/−1, and no code, test, ADR or generated file moved.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head a93c050 · 2026-11-16T13:33Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi

席位核对 · ACCEPT (L1, prose-only head move) · Head-sha: a93c050 · 2026-11-16T13:34Z

This carries my delta ACCEPT 6917609539 at 55812f71 forward to a93c0509, the head declared in 6917895632. That record's findings stand unchanged.

  • The move, read on the committed trees.
    • git log 55812f71..a93c0509 shows one commit, a93c0509, a fast-forward.
    • git diff --name-only 55812f71 a93c0509 lists .changeset/34164-seal-chain-field.md and nothing else. That is a prose face outside the review surface (REVIEW_SURFACE_EXCLUDED_PROSE_FACES, id changeset). The diff is +1/−1.
  • The one sentence, read against the code. The last bullet now reads "Authoring judges only a named chainField; the default tenant_id is not judged."
    • That is true on this head. Every refusal in refuseUnknownSealChainField sits behind typeof seal.chainField === 'string', and an object that names no chain column is still only reported by the sealer at error.
    • It fixes a sentence that became false in round 3. The old wording, "refuses only a chainField the object names and does not have", stopped being complete once the type, leaf-order and valueFields refusals landed. That is review#1's N4 in 6917789374.
    • The rest of the bullet is unchanged.
  • Checks. CI on a93c0509 was still running when I read it: 37 names so far, 10 success, 9 skipped, 18 in progress, 0 failed. Landing needs it green on this head, as always.

I put no machine Regen-provenance: line here on purpose. That line belongs to the contract-review record's carry, and a second hop naming a different record (this L1) on the same PR would give the guard's chain two records. The provenance is the prose above: record 6917609539 · 55812f71 → a93c0509 · git diff --name-only → .changeset/34164-seal-chain-field.md only.

Landing: Tier H. After review#1's L2 is carried or re-posted on this head and CI is green, area o1-A hands it to the seat.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a93c0509bbc92047d9a21b92287fa4fc2c4ce130
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts, docs/adr/0154-audit-ledger-tamper-evidence-sealer-signed-checkpoints-amendments-verify.md + .changeset/34164-seal-chain-field.md
Security-touching: yes

Carry of record 6917789374 (PASS at 55812f71a89c8ed0d1055bf35e3b5a15551c9326) to this head. No must-fix, no should-fix.

Read:

  • The move 55812f71..a93c0509: one commit (a93c0509, parent 55812f71), a fast-forward with no merge of main.
  • Its diff: .changeset/34164-seal-chain-field.md only, +1/−1, one bullet of prose. Both hits files and every implementing file are byte for byte what 6917789374 judged.
  • Card audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352 with its two comments, including scope addition 6917812639.
  • The PR comments, including final-head 6917895632 and the L1 carry ACCEPT 6917935405.
  • The check-runs on this head, read after the run finished: 58 success, 10 skipped, 0 failed, 0 pending. Test Core (8 of 8 shards), Build Core, Lint & Repo Gates, TypeScript Type Check, Check Changeset, Spec property liveness and Governed Surface Queue Guard are all success.

① Derived judgments

  • Every judgment of 6917789374 ① stands on this head: no schema, ADR or plugin-audit line moved.
  • The accept-set is still a widening. Clause-②: yes (widening) and Metadata-protocol: added still match what moves.

② Semver level

  • Unchanged from 6917789374 ②. The changeset's front matter and its Clause-②, Metadata-protocol and Skills-docs lines did not move; Check Changeset is success on this head.
  • minor on @objectstack/spec and @objectstack/plugin-audit holds.

③ Boundary flags

  • Unchanged from 6917789374 ③. The move adds no flag and no open question.
  • The out-of-scope finding carried there as S5 now has a written carrier (see ④).
  • SQL push-down: the move is one sentence of prose; no query, id materialisation or in-app join.

④ Design judgment

Earlier ids:

S5: closed.
N2: kept.
N3: kept.
N4: closed.
N5: kept.
N6: kept.

  • S5. Comment 6917812639 on audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352 widens that card's rule in writing. Publish is to refuse an object that names no chainField when its default tenant_id, declared or injected, would be refused as a named one. It lists three cases:
  • N4. The last changeset bullet now opens "Authoring judges only a named chainField; the default tenant_id is not judged."
    • It no longer contradicts the bullet on refused columns.
    • It is true of the tree: every refusal in refuseUnknownSealChainField sits behind typeof seal.chainField === 'string'.
    • The rest of the bullet is unchanged.
  • N2, N3, N5, N6. No code moved, so each reads as it did in 6917789374. All four remain nits and none changes the verdict.
  • packages/spec/src/data/object.zod.ts and docs/adr/0154-…md: unchanged since 55812f71. The judgment of each in 6917789374 ④ stands, as does its reading of the four implementing files and of the attempts to break the change.

Implemented-by: claude/area-A2-34164
Reviewed-by: session_01ASNY8Ywba8ySbMdWvra2vS

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5pmEYLVFDcQ1Z1CS8H

维护者速读

Head-sha: a93c0509bbc92047d9a21b92287fa4fc2c4ce130

  • 改了什么:审计封存对象可以用新键 lifecycle.seal.chainField 指定按哪一列分组织成链,默认仍是 tenant_id。封存器、os audit verify 与证明包统一经 chainValueOf 读链值。编写期拒绝四类点名:对象没有的列、非文本列(数字/布尔/日期/日期时间/JSON/多值)、id/created_at、以及同时列在 valueFields 的列。
  • 为什么改:卡 The audit sealer chains only by a tenant_id column, so an object whose organization lives in another column cannot be sealed #34164。企业版 AI 审计日志 sys_ai_audit_log 的组织在平台注入的 organization_id 列里,没有 tenant_id,今天无法封存;cloud#4128 在等这条接缝。
  • 风险与回滚:默认 tenant_id 的对象,叶子输入、签名体与根都逐字节不变,有基线摘要钉住。新键可选,新增的拒绝只针对新键,主干上能解析的声明一条也不会多被拒。已有检查点的对象改 chainField 会让校验失败,PR 已实测并写进文档。回滚即 revert。
  • 先看:① packages/spec/src/data/object.zod.ts 的 refuseUnknownSealChainField 与 nonTextChainColumnType;② plugin-audit/src/audit-seal/sealer.ts 五处读链改走 chainValueOf;③ ADR-0154 文末附注。
  • 两分钟验证:pnpm --filter @objectstack/spec exec vitest run src/data/object-lifecycle-seal-chain-field-34164.test.ts,预期 25 passed。
  • 需要你做的:对 head a93c0509 点 Approve。它因 docs/adr/0154-* 属 Tier H,共 1,091 行,未超 3,000 行。批准后由席位落地。

席位意见:建议批准。这是加键放宽(Clause-②: yes (widening),Metadata-protocol: added),默认路径逐字节不变,两份审核都在本 head 上通过。席位在本 head 亲跑了上面的验证命令:25/25 通过。

席位核对

  1. 形态:12 个文件,+1,069/−22。check-governed-merges --branch origin/claude/area-A2-34164 读数:Tier H,命中 docs/adr/** 一处(ADR-0154 附注),规模 1,091 行 ≤ 3,000。正文声明 Clause-②: yes (widening)、Metadata-protocol: added(lifecycle.seal.chainField)、Skills-docs: follow-up #33773,Fixes #34164。
  2. 前提实测:席位在 head a93c0509 的工作树里跑 spec 钉测,Tests 25 passed (25)。其余钉测(plugin-audit 单测、cli audit verify 集成测)以 CI 读数为准。
  3. 门禁 check-runs:head a93c0509 上 58 success、10 skipped,无失败、无待跑;mergeable_state clean。
  4. 审核:L1 ACCEPT 6917935405(L1-a,承接 6917609539 的纯文字改动)。L2 CONTRACT_REVIEW_TIER PASS 6918613450(review#1,承接 6917789374),记录写明 S5 已由 audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352 扩范围 6917812639 关闭、N4 已关。无 must-fix 或 should-fix 残留,N2、N3、N5、N6 作为 nit 保留。
  5. 范围外去向:默认列那一半(既无 tenant_id 又没写 chainField,以及默认 tenant_id 为非文本或列在 valueFields)由 audit seal: publish refuses a sealed object that has neither a tenant_id field nor a chainField #34352 承接,已书面扩范围。Skills 文档 follow-up 是 skills(objectstack-data): audit sealing still teaches one checkpoint per organization-hour; #33637 seals into parts of at most 10,000 rows #33773。
  6. 落地条款:等 GOVERNED_APPROVERS 的 APPROVED(或维护者直接合并)。落地前席位重读 head 与 check-runs;head 若再移动,撤掉挂签回到等待。之后清 pm:awaiting-merge、标 ready、开 auto-merge。

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 16, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 16, 2026 15:53
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 9e6fee1 Nov 16, 2026
74 checks passed
@os-zhuang
os-zhuang deleted the claude/area-A2-34164 branch November 16, 2026 16:18
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 16, 2026
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 protocol:data size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The audit sealer chains only by a tenant_id column, so an object whose organization lives in another column cannot be sealed

2 participants