Repository navigation
feat(spec, plugin-audit): a sealed object names its chain column with lifecycle.seal.chainField - #34351
Conversation
… 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
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
📓 Docs Drift CheckThis PR changes 2 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 3 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 176 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # 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
|
|
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.
|
…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>
Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw Co-authored-by: Claude <noreply@anthropic.com>
|
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
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi 席位核对 · ACCEPT (L1, first read) · Head-sha: ebd7fbd · 2026-11-16T10:36ZL1 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
Notes for the hand-off (not blocking)
Landing: Tier H. After review#1's PASS on this head, area o1-A hands it to the seat ( |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head ebd7fbd · 2026-11-16T10:36Z |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract reviewServed-tier: 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 ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implementing files.
Attempts to break it. None of these found a way to change a sealed row unseen.
Implemented-by: 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>
…describe text Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw Co-authored-by: Claude <noreply@anthropic.com>
|
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
|
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head 55812f7 · 2026-11-16T13:20Z |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi 席位核对 · ACCEPT (L1, delta) · Head-sha: 55812f7 · 2026-11-16T13:21ZL1 thread L1-a for area o1-A, on the final head declared in 6917562999. This is a delta read against my ACCEPT 6914039961 at
Nit (not blocking)
Landing: Tier H. After review#1's L2 delta PASS on this head, area o1-A hands it to the seat ( |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract reviewServed-tier: Delta on record 6914221841 (PASS at Read:
Earlier ids: S1: closed. N2 and N3 are declined in the PR body. Both remain nits and neither changes the verdict. ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implementing files. Other text.
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.
Implemented-by: VERDICT: PASS |
Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw Co-authored-by: Claude <noreply@anthropic.com>
|
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
|
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head a93c050 · 2026-11-16T13:33Z |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi 席位核对 · ACCEPT (L1, prose-only head move) · Head-sha: a93c050 · 2026-11-16T13:34ZThis carries my delta ACCEPT 6917609539 at
I put no machine 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. |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract reviewServed-tier: Carry of record 6917789374 (PASS at Read:
① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentEarlier ids: S5: closed.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pmEYLVFDcQ1Z1CS8H 维护者速读Head-sha:
席位意见:建议批准。这是加键放宽( 席位核对
|
Fixes #34164
Requested by Steedos · project thread
Clause-②: yes (widening). A sealed object may name its chain column with
lifecycle.seal.chainField; the default staystenant_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)。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.sealgains the optionalchainField: the column whose value is the organization chain a sealed row joins.refuseUnknownSealChainFieldrefuses a NAMED column, each time with one located issue atlifecycle.seal.chainField:resolveInjectedSystemColumns):organization_idcounts unless the object opts out of the tenant column;NUMERIC_VALUE_TYPES,BOOLEAN_VALUE_TYPES,CALENDAR_DATE_TYPES,INSTANT_TYPESandSTRUCTURED_JSON_TYPESfrom the field-value contract, plus any fieldisMultiValueFieldcalls multi-value. A declared column is judged by its own definition; an injected one by the definition the registry injects (injectedSystemColumnDefs), so the injectedupdated_at(adatetime) is refused.chainValueOfreads a chain only from a non-empty string, so such a column would put rows into the deployment chain with no report;idandcreated_at, throughisSealLeafOrderColumn, the predicate thevalueFieldsrefusal now reads too (extracted from its inline check, same two names);valueFieldsalso 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), withsealChainFieldOf(lifecycle)for the default, both inaudit-seal/canonical.ts. It replaces the sealer's and the verifier'stenantOf. 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'sunsealedentries come from. The checkpoint's signedtenant_idmember keeps its name and carries the chain value. No source change in round 3.os audit verify. No source change:--orgpasses through asorgsto the live check, which reads the chain column.content/docs/data-modeling/objects.mdx§ Sealed audit objects teacheschainField: its default, every name authoring refuses (round 3 adds the non-text, leaf-order andvalueFieldsrefusals), 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 injectedorganization_id, a declared field, and (round 3 control) a declaredtext,lookupandselectcolumn. 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 undeclaredtenant_id,organization_idunder the three tenant opt-outs; (round 3) a declarednumber,currency,boolean,date,datetime,jsonandmultiselectcolumn, alookupdeclaredmultiple: true, the injectedupdated_at;idandcreated_atdeclared, andidonly the driver provides; a chain column also invalueFields, declared or the injectedorganization_id.packages/plugins/plugin-audit/src/audit-seal/audit-seal-chain-field-34164.test.ts(52 tests):ObjectKernelover SQLite: one chain per organization by the injectedorganization_id;verifyAuditLedger({ orgs: ['org_x'] })reports only org_x; a row edited below the hooks readsmodifiedin its own chain.chainField: 'tenant_id'.error.FieldTypewith a canonical rule, the spec refuses it as a chain column exactly when the sealer's own rule (AUDIT_SEAL_TYPE_RULES) is nottext;select,radio,lookupanduserwithmultiple: trueare refused. This holds the derived spec set to the reader's rules.tenant_idand then switched tochainField: 'org_ref': the next pass seals the last sealed window's row again under the new chain (checkpointsorg:org_a window r1,org:org_a window r2, thenorg:org_b window r2,org:org_b window r3); the whole check reportsorg:org_b#0:listed_twiceand is not ok; scoped toorg_b, the row sealed earlier readslate, 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)
@objectstack/plugin-auditwhole suite Test Files 98 passed (98), Tests 1623 passed (1623);typecheckexit 0.@objectstack/specwhole suite Test Files 936 passed (936), Tests 28607 passed, 1 todo;typecheckexit 0.pnpm --filter @objectstack/spec check:generatedafter 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/clicard 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)
if (nonText !== null)made dead): spec card file 9 failed (the seven declared types, the multi-value lookup, the injectedupdated_at); plugin-audit card file 24 failed (every non-textrule type and the fourmultiple: truecases).isSealLeafOrderColumnbranch made dead): spec card file 3 failed (iddeclared,created_atdeclared,idfrom the driver).valueFieldsoverlap refusal (made dead): spec card file 2 failed (declared column, injectedorganization_id).dist/preflight was owed: the spec suite runs on its ownsrc/, and plugin-audit's vitest config aliases@objectstack/specto source.Acceptance notes
chainField. An object that names none and has notenant_idstill parses, and the sealer still reports it aterrorand does not seal it. Refusing that case, and a non-texttenant_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.lifecycle.sealis a strict object: onmainanychainFieldis refused as an unknown key. Each added refusal fires only whenchainFieldis present, so nothing that parses onmainis refused here, andClause-②: yes (widening)/Metadata-protocol: addedhold.chainValueOfaccepts (a non-empty string): numbers and booleans are never strings;date/datetimeand JSON payloads are text on one store and aDateor parsed value on another, which is why the sealer gives them their own canonical rules.timestays allowed (its stored form is alwaysHH:MMtext, sealer ruletext). 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.tenant_iddoes onmaintoday; 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.object.zod.tsimportsresolveInjectedSystemColumnsand nowinjectedSystemColumnDefs; both modules importisTenancyDisabledback fromobject.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, sincefield-value.zodsits in thefield.zodevaluation cycle.chainFieldalso listed invalueFields" is now refused (S2). The platform-global deployment case stays accepted as shipped, per the review's ①: achainField: 'organization_id'passes authoring, and the sealer reports that object aterrorand does not seal it.sealChainFieldOfanswerstenant_idfor an empty or non-stringchainFieldon a definition that skipped the parse) and N3 (sys_audit_checkpoint.chain_keyis sized for an organization id).skills/objectstack-data/rules/lifecycle.md§ Sealing and the stale verifier claim inskills/objectstack-data/evals/objects-fields-relationships.jsongo to skills(objectstack-data): audit sealing still teaches one checkpoint per organization-hour; #33637 seals into parts of at most 10,000 rows #33773 (theSkills-docs:line).skills/**is not touched here.Verification
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackover 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 SDKdist/),check:i18n(workspace CLIdist/) andcheck: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 insideLint & Repo Gates, success on d1d44a3 and on 55812f7.--ranwith exit codes recorded: 120 derived, 117 run, 3 NOT-MEASURED, 0 UNRUN.check-partof-closing-keywordexit 0;check-closing-keyword-parity --bodyexit 2 (the report: only the card's own closing line on line 2, bound by 2 of 3 parsers);check-closing-target-claimexit 0, with one UNDETERMINED warning: the card's newestClaim:comment (the round-2 amendment) carries noBranch:line.--ran, 0 unrun) stand for their paths; round 3 derived its own list over the seven round-3 paths.main(35c9a30) after this branch's base. A driver-free bare-clonemerge-treeof this head againstorigin/main(23a18fd) exits 0 with a tree id: no conflict, so no merge ofmainwas made.Type Check · source gatesatcheck:docs: the reference page was not regenerated;Test Core (2/8): themultiselectfixture's option valueawas 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 GateandLive E2E UIsuccess;Test Core,Build Core,Type Check · workspace,Type Check UI,Test UIandBuild & E2E UIin progress; 0 failed.Tier H: the diff touchesdocs/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