Skip to content

feat(plugin-audit): seal the audit log by default and expire sealed rows by whole checkpoints (ADR-0154 D8, D10) - #37605

Merged
os-zhuang merged 16 commits into
mainfrom
claude/project-thread-vslp7g
Nov 27, 2026
Merged

os-zhuang merged 16 commits into
mainfrom
claude/project-thread-vslp7g

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Part of #31908

Clause-②: yes (narrowing) — narrowed: sys_audit_log now declares lifecycle.seal on every deployment, so os migrate audit-key-material, audit-mail-bodies, audit-metadata-bodies and audit-side-copies with --apply refuse on SQLite or Turso without --sealer-stopped, and on Postgres or MySQL take the audit seal lock and refuse after ten minutes, where 18.6.0 ran them unlocked on a deployment that sealed nothing; os audit verify exits 1 on a row it reads late and unsealed (the S4 arm); os audit verify refuses with archive_not_connected and exits 2 where the archive datasource is declared and not connected on its own boot (fix: autoConnect: true, or make it reachable), where 18.6.0 printed that nothing is sealed and exited 0; verifyAuditLedger throws for sys_audit_log when its archive datasource is not connected and no archive is passed; on a sealed object with no archive whose lifecycle is declared in packaged metadata, a retention override below the declared window, global or for one organization, is rejected (reported at error, the declared window applies), where 18.6.0 applied it. An object created at runtime is outside the override arm and outside signed expiry: it keeps the 18.6.0 row-cutoff retention sweep, and a settings override applies to it; the os audit verify arms hold for it as for any sealed object. This breaks the bound changeset 35c9a30 (#33675) set ("a deployment that did not opt in sees no change"). Widened: LifecycleService.registerExpiryPrefix and the LifecycleExpiryPrefix* types (the request with tenants and tenantColumn), takesSignedExpiry and SignedExpiryRegistryLike, three optional owner reads on LifecycleEngineLike.registry, policy: 'expiry', the skip reasons seal-expiry-pending and seal-delete-unsupported.
Metadata-protocol: semantic — beside lifecycle.seal, the authored retention.maxAge, ttl.expireAfter and archive.keep no longer delete a row at its row cutoff: rows leave by whole checkpoints under a signed expiry amendment (seat ruling on review 7198128323 S2; the changeset moves all four packages minor)
Skills-docs: #37881 — this claim's second PR (amendment 7193137455) rewrites skills/objectstack-data/rules/lifecycle.md, which says the sweeper deletes sealed rows until it lands (hence Part of, not Fixes)

维护者速读

  • 每个部署的审计日志从此默认带防篡改封印:管理员跑审计校验时,被改、被删、被脱敏、按策略到期的记录都能分辨出来,热库和归档库都算。
  • 这是对运维可见的破坏性变化:SQLite 和 Turso 部署下次跑 os migrate audit-*(包括升级流程里的 audit-side-copies --apply)会被拒,要先停掉服务再带 --sealer-stopped;Postgres 和 MySQL 会先等封存锁,最多等 10 分钟。
  • 过期删除不可撤回:过了保留期的审计记录按整段检查点删除,删之前先签一份到期说明,校验时读作“到期”而不是“丢失”,但删掉的行找不回来。
  • 宿主没有传加密服务时,sys_audit_log 过了 archive.keep 也会一直留着,封存器每小时报一次 error。出错时只会多留、不会多删:链条有缺口、签名不可信、检查点或到期说明不属于这条链、前后接不上,都一律保留并告警一次。
  • 没有 archive 的封存对象上,保留期覆盖不能把窗口缩短到声明值以下:运维在设置里把这类对象的保留期改短(全局或某个组织)会被拒绝并报 error,按对象声明的窗口执行;改长照常生效。想留得更短,只能改对象自己的声明。带 archive 的对象(比如 sys_audit_log)上,覆盖仍然决定什么时候转入归档。
  • 签名到期只覆盖打包元数据里声明的对象:运行时创建的封存对象(在 Studio 等处建的、存在数据库里的)照旧按保留期清扫(被清掉的行在校验里读作“丢失”)、覆盖照样生效,和现在一样,不受“覆盖下限”和“签名到期”这两条收窄影响;但 os audit verify 的两条收窄对它一样适用,比如有 late 未封存的行时同样 exit 1。让运行时对象也支持签名到期另开卡。
  • 按租户设的保留期设在对象的 organization_id 列上,所以只有链列也是 organization_id(seal.chainField: 'organization_id')的对象,才按这个组织自己的保留期过期;其他链(不属于任何组织的链,以及保留期设在另一列上的对象的所有链)一律按所有保留期里最长的那个保留。代价是:保留期设在非链列上的对象,租户设的更短保留期对它的封存记录不起作用,记录会留到最长的保留期。

Tier: Tier H (declared narrowing: the Clause-② line above; seat ruling on review 7202871622). About 2,996 changed lines (under 3,000). No governed path: packages/spec/src/data/object.zod.ts changes one .describe() sentence only, and the skills/** wording fix is split into this claim's second PR (amendment 7193137455), Tier H on its own. The release page content/docs/releases/v18/18-6.mdx is release-owned and is not edited here (AGENTS.md "Documentation Guardrails").

What changes

ADR-0154 D8 + D10, slice P4c, the last slice of #31908.

  • sys_audit_log is sealed by default. Its lifecycle now declares seal: { valueFields: ['old_value', 'new_value', 'metadata'] } (packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts). The chain column is the default tenant_id (a lookup, one text value on every store).
  • LifecycleService: sealed objects expire only through a registered seam (packages/objectql/src/lifecycle/lifecycle-service.ts). Signed expiry covers objects whose lifecycle is declared in packaged metadata; an object created at runtime keeps the row-cutoff retention sweep. Extending signed expiry to runtime-created objects is a separate card. The test is one predicate, takesSignedExpiry (new, lifecycle/signed-expiry-scope.ts, exported), which the routing, the audit floors and the sealer's expiry all ask; it answers yes only for an object the registry places in packaged metadata. Any other sealed object keeps the row-cutoff path, and the sealer's expiry answers no run for it (seat ruling 7209154881). New public registerExpiryPrefix(expiry) (the name slice plan 6759503769 ruled) (one slot; a later registration replaces it; the disposer clears only its own) and the types LifecycleExpiryPrefix, LifecycleExpiryPrefixRequest, LifecycleExpiryPrefixRun. For an object with lifecycle.seal:
    • the retention.maxAge / ttl.expireAfter legs and the archive's keep prune never delete by a row cutoff; each asks the seam to plan({ object, policy, policyValue, cutoff, tenants?, tenantColumn? });
    • each run's rowIds are deleted by id (hot and archive for an archiving object; through the engine, reap guards asked, for the rest), and run.complete() is called only when every one is gone;
    • with no seam registered, rows are kept, the archive copy still runs, the sweep reports seal-expiry-pending, and one warn says so;
    • a tenant-scoped window (on the partition reap() uses, through the same floors) travels as tenants, with the column it is set on (tenantColumn), which need not be the chain column (review 7202871622 S4);
    • an archive store with no bulkDelete is never planned (seal-delete-unsupported), so no amendment is signed over rows it could not delete.
  • plugin-audit: the expiry writer (new audit-seal/expiry.ts, AuditSealer.expire, registration in audit-plugin.ts):
    • per chain, from the first remaining checkpoint (which must follow and link to the last admitted expiry, or be sequence 0), take consecutive checkpoints whose window ended at or before the chain's cutoff aligned down to a UTC day, each the chain's own, linked to the one before and admitted by a trusted signature, at most 10,000 rows a sweep; a chain holding a checkpoint or stored expiry that is not its own, or one that does not link, is not expired at all and is said once (review 7202871622 M3);
    • each chain's window: where tenantColumn is the object's chain column, an organization's chain takes its own tenant window (else the global one); every other chain, the chain of rows about no organization and every chain of an object whose windows sit on another column, takes the longest window configured; its amendment signs it (seat rulings on S1 and on review 7202871622 S4). No row is read to pick a window;
    • sign and store the chain's expiry amendment (the S1 key-id loop, then the sink, best-effort), then answer the run; complete() removes each checkpoint's seed, then the checkpoint, oldest first (review n5), and removes a seed only when it is the secret sealed under that checkpoint's own coordinate;
    • a stored, admitted amendment that still covers the first remaining checkpoint is resumed (no second amendment); the resume branch admits each checkpoint as the fresh branch does (the chain's own, linked to the one before, a trusted signature), requires them consecutive from the amendment's first sequence to its last sequence and digest, reads them a page at a time, and removes them oldest first; otherwise nothing in the range is deleted; an unadmitted amendment deletes nothing;
    • a gap or an untrusted checkpoint stops the chain there and is said once;
    • planning holds the audit.sealer lock and the DB seal-pass lock, so two replicas never sign two amendments over one range; a fully drained plan is memoised for the day;
    • registered only when the plugin has a crypto provider (otherwise nothing could be signed);
    • on a sealed object with no archive, a retention override cannot shorten the declared window (review 7207510869): beside the expiry, the plugin registers a retention floor (LifecycleService.registerRetentionFloor, the mechanism the job queue uses) for every object whose packaged metadata declares lifecycle.seal and no archive, at its declared retention.maxAge and ttl.expireAfter (new audit-seal/retention-floor.ts), and registers it again before every sealer pass (new AuditSealerOptions.beforePass) so it follows the registry; a lifecycle service with no retention floors is given no expiry, so its sealed rows are kept, and the plugin says so at error. An archiving sealed object expires only past archive.keep, which takes no override;
    • the sealer's head falls back to the last admitted expiry (the chain's own, its signature verified) when a chain has no checkpoint left (last_sequence, last_removed_digest), and the object floor to the newest admitted covered_to; both, like the expiry, read stored amendments page by page until an admitted one answers.
  • Verifier: the S4 arm (seat ruling 6885452378, ADR-0154 D3 as amended in docs(adr): ADR-0154 amendments — bounded checkpoints (D4) and the DB session seal lock (D3) #33489): a window that starts at or before the newest window a trusted window checkpoint names is sealed, so a lagging chain's rows read late and unsealed. It also holds an honoured expiry to what it signed: an amendment stored under another chain than its signed organization is a chain_key fault, as a checkpoint is, and a checkpoint in an honoured range reads expired only within the window the range covers (review 7202871622 M3).
  • verify harness (packages/verify/src/harness.ts, ruling 6884540128 item 4): an AuditPlugin that bootStack mounts (extra, stack plugins, or requires: ['audit'] provider) adopts harnessCryptoProvider(), the instance settings and the engine get; an instance with its own provider keeps it.
  • Docs: the lifecycle.seal describe sentence (and the regenerated content/docs/references/data/object.mdx), content/docs/data-modeling/objects.mdx (the sentence at :277, the day alignment, the row budget and tenant windows, plus one line that sys_audit_log declares the block), content/docs/deployment/cli.mdx (the audit seal lock and --sealer-stopped for every run covering the audit log), content/docs/upgrading.mdx (the 18.5.0 line now holds on every deployment), content/docs/deployment/production-readiness.mdx.

Tests

  • packages/objectql/src/lifecycle/lifecycle-service.sealed-expiry.test.ts (new, 13): a sealed object created at runtime keeps the row-cutoff sweep, retained and archiving, and never asks the expiry (seat ruling 7209154881); against a real SchemaRegistry, a sealed object the registry does not place in an installed package's metadata keeps the row-cutoff sweep, while one it does takes the signed expiry; pending skip and the once-only warning; archive.keep plan on both stores and complete-after-delete; retention.maxAge per-id engine deletes; ttl.expireAfter; a partial guard veto leaves its run uncompleted; a failing plan deletes nothing; slot replacement and disposer; a malformed registration; an unsealed object keeps the row-cutoff path; an archive store with no bulkDelete is never planned; a tenant-scoped window travels to the expiry with the column it is set on (review S1, S4, n3).
  • packages/objectql/src/lifecycle/signed-expiry-scope.test.ts (new, 3): takesSignedExpiry answers yes only when the registry places the object in packaged metadata: a registry that cannot be asked answers no; an installed code or marketplace source answers yes, an authored or unknown one no; a plain registration from code answers yes, an owner under no installed package or a tenant-authored one no.
  • packages/plugins/plugin-audit/src/audit-seal/audit-seal-expiry-live.integration.test.ts (new, 10): the real-kernel end-to-end over SQLite with an archive datasource. sys_audit_log sealed by its own declaration; the plugin's sealer seals; an interrupted expiry (amendment stored, rows still there) reads expired; the kernel's own LifecycleService sweep archives, resumes, deletes exactly the expired rows from both stores and then their checkpoints and seeds; a second same-day sweep signs nothing; verify then reads no gap and the untouched windows unmodified in hot and in archive; a fully expired chain's next checkpoint links to last_removed_digest; modified, missing and redacted are still told apart. A second boot: a sound chain expires whole, a chain stops at a checkpoint no trusted key signed, a chain with a gap is kept, each said once; a stored expiry is never resumed over a checkpoint no trusted key signed (no row and no seed it lists is deleted); a chain head never follows an expiry amendment no trusted key signed (review M1).
  • audit-seal-expiry-window.test.ts (new, 7): each chain's window — its organization's own where the windows are set on the chain column, the global one, the longest for a chain of no one organization (review S1) and for every chain where the windows are set on another column (S4); and the policy_change_log shape over the sealer itself (declared tenant_id, injected organization_id, the two values differing): windows on tenant_id expire each organization's chain under its own window, windows on organization_id keep every row to the longest (S4).
  • audit-seal-expiry-admission.test.ts (new, 14, review 7202871622 M3 and n6, review 7205485052): one pin per check an expiry or the sealer's head makes before it acts — a fresh run's checkpoints bound to the chain and linked, the first linked to the last expiry; a resumed range's checkpoints bound, consecutive, linked, each signature trusted, ending at the amendment's digest, none before its first sequence; a stored expiry bound to the chain; the newest admitted expiry found past more stored ones than one page; and the sealer's head under the same two rules; and a checkpoint whose seed handle names another secret drops nothing but its own row.
  • audit-seal-verifier.test.ts (+2): an amendment stored under another chain is a chain_key fault; a checkpoint whose window ends past its honoured range's covered_to is judged, not read expired (M3).
  • audit-seal-sealer.test.ts (+1): the S4 sole-chain window reads late unsealed and ok false.
  • audit-seal-retention-floor.test.ts (new, 10, review 7207510869, S7 of 7209130288 and seat rulings 7209154881, 7210805783): over a real LifecycleService and the plugin's own registration, an object created at runtime, and one owned under a package id no installed code or marketplace package answers, take no floor and no expiry while a packaged one takes both, and the sealer's expiry answers no run for a runtime object before it resolves a seam; a global and a tenant override below the declared window are rejected and the expiry is asked for the declared window, with both rejections on the sweep report; an override above it still applies and is what the expiry signs; a lengthened declaration is the floor from the next sealer pass on; a lifecycle service without floors gets no expiry; and which windows a sealed object is floored at.
  • audit-plugin.test.ts (+3): the expiry is registered with a crypto provider, unregistered on destroy, not registered without one, and boot survives a lifecycle service without the seam.
  • Existing pins adjusted for the seal default (not loosened): packages/cli/src/commands/audit/verify.integration.test.ts and verify.ownership-queue.integration.test.ts now expect sys_audit_log beside the fixture ledger in objects and in the unreachable-archive message, and case 4 reads that a project with no seal of its own still checks the platform's sealed audit log (exit 0); the four os migrate audit-* archive and preview integration files (audit-mail-bodies.archive, audit-key-material.archive, audit-side-copies.archive, preview-read-only) pass --sealer-stopped on their SQLite --apply runs (and preview-read-only, now judged by the test-source alias gate's source reach, pays its twelve dynamic imports at module top); the two os migrate audit-* dogfood files (packages/qa/dogfood/test/audit-key-material.dogfood.test.ts, audit-mail-bodies.dogfood.test.ts) pass the same flag on their --apply runs; and in plugin-audit, audit-seal-chain-field-34164.test.ts passes archive: () => 'none' (its boot connects no archive datasource, as os audit verify establishes), and audit-seal-host-seam-resolve-34280.integration.test.ts forgets what the loop's own first pass reported before each pin counts its own passes.
Ablations (each restored, blob == HEAD)
  • Verifier S4 arm || start <= this.newestSealedWindow() → || false: the new sole-chain pin goes red (expected [] to deeply equal [ Array(1) ]), 1 failed | 57 passed.
  • Lifecycle routing if (lc.seal) return this.reapSealed(…) disabled: 5 of the 9 new lifecycle pins go red.
  • Archive keep branch if (lc.seal) { disabled: the two archive pins go red.
  • Resume admission (signature check and the last-sequence/digest match) disabled, and the sealer's expiry signature check disabled: the two M1 pins go red, 2 failed | 8 passed.
  • Reviews 7202871622 and 7205485052, one check at a time (each its own pin red, 1 failed, every other selected pin skipped): the fresh run's binding, link and first link; the resumed range's binding, sequence continuity, link, signature, last digest and first-sequence floor; the stored expiry's binding and paging; the sealer head's binding and paging; the verifier's chain_key fault on an amendment and its window bound on an honoured range (15); S4's own-window branch and its longest-elsewhere branch (2); the seed coordinate check (1); review 7207510869: the floor registration, its refresh before each sealer pass, and the no-floors refusal (3); seat ruling 7209154881: the lifecycle routing, the floor and the sealer's expiry each scoped to packaged objects (3); the packaged-metadata predicate's installed-source answer and its default when the registry cannot answer (2). 26 of 26 red.

Acceptance notes

  • Rows are kept, never over-deleted, whenever something is off. No crypto provider, a one-shot boot, a gap, an untrusted checkpoint, a reap guard veto, or a failing plan all keep the rows. A deployment whose AuditPlugin has no crypto provider now keeps sys_audit_log rows past archive.keep instead of pruning them, says so once per process at warn, and its sealer reports the missing provider hourly at error. An expiry, once run, deletes for good.
  • os migrate audit-* --apply on SQLite or Turso now needs --sealer-stopped whenever it rewrites sys_audit_log: the 18.6.0 rule for a sealed object (ADR-0154 D3 amended, B, seat ruling 6885005594) now meets every deployment. On Postgres and MySQL every such run now takes the audit seal lock and waits up to ten minutes; dry runs are unchanged. Declared as the narrowing arm with a BREAKING banner and an ADR-0087 marker (review M2).
  • The day-aligned cutoff keeps a row up to one day past its policy, on top of D8's bound, so a drained chain gains at most one expiry amendment a day; amendments are never removed. 10,000 rows a sweep per sealed object, across its chains; a backlog keeps rows longer, and a cut run continues in the next amendment. Both exceed D8's stated bound in the safe direction; the seat kept them and the add-only ADR-0154 note follows in its own governed PR, beside the skills PR.
  • On a sealed object with no archive, a retention override cannot shorten the declared window (review 7207510869, S7 of 7209130288): an override may lengthen it, one below it is rejected at every sweep (floorViolations, error), and the declared window applies. On an object that archives (sys_audit_log among them), an override still sets when rows move to the archive, and archive.keep takes no override.
  • Signed expiry covers objects whose lifecycle is declared in packaged metadata (seat ruling 7209154881): an object created at runtime keeps the 18.6.0 row-cutoff retention sweep (its expired rows read as missing), its overrides apply, and it takes no floor. Extending signed expiry to runtime-created objects is a separate card.
  • Tenant-scoped retention windows are set on the object's organization_id column, and apply as the seat ruled on S1 and S4: where the windows are set on the chain column an organization's chain expires under its own window; every other chain under the longest of all, never shorter than a window set for a row in it; each amendment signs the value its chain expired under. The cost: on an object whose windows sit on another column than its chain column, a shorter tenant window has no effect on its sealed rows, which are kept to the longest. sys_audit_log itself archives, and keep has no override.
  • os audit verify on a deployment with no archive datasource anywhere already reads the hot store alone ('none'); a library caller of verifyAuditLedger that composes no archive must now pass archive for sys_audit_log, as the adjusted test does.
  • File surface past the claim: the two CLI os audit verify integration pins, the four CLI os migrate audit-* integration files and the two dogfood files above (expectations, the flag and module-top imports only), content/docs/deployment/production-readiness.mdx, content/docs/upgrading.mdx, the new audit-seal-expiry-window.test.ts and audit-seal-expiry-admission.test.ts, seal-store.testkit.ts (the in-memory store double judges $lte), packages/verify/vitest.config.ts (one anchored alias the source-alias gate asks for), scripts/engine-double-contract.pinned.json and the plugin-audit tenant-audit census page (both regenerated by their own --write). Named here for the seat's claim amendment.
  • The CLI os serve composition is unchanged (it already hands its host provider to AuditPlugin, P4b).
  • The skills/objectstack-data/rules/lifecycle.md "not built yet" wording follows in this claim's second PR (Tier H, amendment 7193137455); until then this PR is Part of #31908.
  • Small decisions: the seam is registerExpiryPrefix as ruled, and its three types now share that stem (LifecycleExpiryPrefix, LifecycleExpiryPrefixRequest, LifecycleExpiryPrefixRun), so a reader finds them beside the method. A chain of no one organization takes the longest window rather than the global one, the safe reading of the S1 ruling. Under S4 no row is read to pick a window (seat ruling on review 7205485052). Stored expiry amendments are read 50 a page until an admitted one answers, in place of the 10-row scans (review minor). The in-memory store double now judges $lte, which the expiry's queries use. A resumed range is read 20 checkpoints a page, as a fresh run is; the chain walk never takes a row with no chain_key as its key. These last two have no pin of their own: neither changes a result on a store the platform writes.
  • Owed before queueing: the delta contract-review-tier L2 over this head (round 7, after review 7210787318 PASS with S8, S9, n17, n19 and n20 to close), done by the seat.

Verification

Two-minute check: cd packages/plugins/plugin-audit && pnpm exec vitest run src/audit-seal/audit-seal-expiry-live.integration.test.ts — expect Tests 10 passed (10).

Read first (risk order): packages/plugins/plugin-audit/src/audit-seal/expiry.ts (chainRun: resume, gap, admission, budget), packages/objectql/src/lifecycle/lifecycle-service.ts (sweepSealed / deleteSealedRows: complete only after every row is gone), packages/plugins/plugin-audit/src/audit-seal/sealer.ts (expire: locks around planning; the head fallback).

Local runs at ff14eb2 (each under os-verify-lock, exit captured before any pipe)
  • pnpm turbo run build over spec, objectql, plugin-audit and verify: exit 0.
  • plugin-audit full: Tests 1879 passed (1879), exit 0.
  • objectql full: Tests 14449 passed (14449), exit 0.
  • verify full: Tests 503 passed (503), exit 0.
  • cli src/commands/audit/, serve-audit-registration.contract, app-audit-plugin-host-crypto, schema-migrate.one-shot-family.integration: Tests 221 passed (221), exit 0.
  • tsc --noEmit of plugin-audit (with its test-typecheck layer) and objectql, and eslint on the changed sources: exit 0.
  • gen:schema && gen:docs regenerated content/docs/references/data/object.mdx.
  • dispatch-gates --commands: 142 derived, 141 exit 0. One NOT MEASURED: check-plugin-teardown-shape --self-test exits 3, PREREQUISITE NOT MET (needs an unshallow clone).
  • dogfood_battery at ff14eb2: turbo run build --filter='@objectstack/dogfood^...' 73 of 73 tasks, then pnpm --filter @objectstack/dogfood test: Test Files 488 passed | 3 skipped (491), Tests 4135 passed | 68 skipped (4203), exit 0.
  • Ablations at ff14eb2: 26 single-check ablations, each its own pin red, each file restored byte for byte.
  • overlap-check at ff14eb2: merges cleanly with origin/main c826e8a and the PR heads sharing content/docs/deployment/cli.mdx (fix(lint)!: three publish-time checks for seeds, flow nodes and actions that save and do not work #37807, refactor(spec)!: rename the Studio helper defineForm to defineMetadataForm and its modules to *.metadata-form.ts #37366).
  • Earlier heads: 51ba1c1, 5860216, 4deab94, 46e272e (review 7198128323), 48e81f3 and c05884d (review 7202871622; CI green), 65a5d7d (reviews 7205485052 and 7207510869; CI green), 71bb12a (review 7209130288; CI green), 05e6a57 (review 7210787318; CI green).

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUd6hon2o34LQSLbZt

…ned expiry amendments (WIP)

ADR-0154 D8/D10 P4c: sys_audit_log seals by default; the sealer writes an
expiry amendment before the lifecycle service deletes a covered prefix.

Claude-Session: https://claude.ai/code/session_01L6bhgUd6hon2o34LQSLbZt
Co-authored-by: Claude <noreply@anthropic.com>
…sealed expiry (WIP)

Claude-Session: https://claude.ai/code/session_01L6bhgUd6hon2o34LQSLbZt
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 4 package(s): @objectstack/objectql, @objectstack/plugin-audit, @objectstack/spec, @objectstack/verify, touching 103 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/objectql/src/index.ts, packages/verify/vitest.config.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

37 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json e69fa46dd326c4dcbbce206f35c8b3398776e76e.

⛔ 15 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

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

Coarse fallback — 183 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 e69fa46dd326c4dcbbce206f35c8b3398776e76e → packageMentionDocs.

Which tree this was computed on

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

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

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

@github-actions github-actions Bot added 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 26, 2026
…pins; type the sealed-expiry test's veto

sys_audit_log now declares lifecycle.seal, so an `os migrate audit-* --apply`
run on SQLite needs --sealer-stopped (ADR-0154 D3 amended, B). The four
archive/preview integration files pass it; the changeset names the operator
change. The lifecycle sealed-expiry test's partial-veto double returns
string ids.

Claude-Session: https://claude.ai/code/session_01L6bhgUd6hon2o34LQSLbZt
Co-authored-by: Claude <noreply@anthropic.com>
…ule load

The edited test file is now judged by the test-source alias gate's source
reach: each dist-resolved dependency its served boot reaches through a
dynamic import gets a module-top side-effect import.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 4deab949980d45dd8a860ca86b187b4c38379691
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts + packages/objectql/src/lifecycle/lifecycle-service.ts, packages/objectql/src/index.ts, packages/plugins/plugin-audit/src/audit-seal/expiry.ts, packages/plugins/plugin-audit/src/audit-seal/sealer.ts, packages/plugins/plugin-audit/src/audit-seal/verifier.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts, packages/verify/src/harness.ts

Inputs: card #31908 (body and all 62 comments), PR #37605 (body, 28 files, net diff against merge base 061e3422), ADR-0154 as on the head, and the head's check-runs, read 2026-11-26T16:48Z: 62 success, 12 skipped, none failed or pending. The rest of the diff (tests, the changeset's prose, the three docs pages, the census page, engine-double-contract.pinned.json, packages/verify/vitest.config.ts) is the lane seat's ACCEPT at TIER_DEFAULT.

① Derived judgments

  1. sys_audit_log declares seal: { valueFields: ['old_value', 'new_value', 'metadata'] }. Right: ADR-0154 D10's value, word for word; the chain column is the default.
  2. Every project's os audit verify now reports sealed: true with sys_audit_log in objects, and exits 2 when the archive datasource the ledger names is declared and not reachable. Right (D9, D10).
  3. LifecycleService.registerSealedExpiry and the exported types LifecycleSealedExpiry, LifecycleSealedExpiryRequest, LifecycleSealedExpiryRun. Right as a widening (D8, "a seam beside registerReapGuard"). The name is not the one slice plan 6759503769 ruled; see ③.
  4. LifecycleSweepEntry.policy gains 'expiry' and report.skipped gains the reason seal-expiry-pending. Right, a widening of a published report shape; the declaration line does not name it.
  5. On an object declaring lifecycle.seal, retention.maxAge, ttl.expireAfter and archive.keep no longer delete by a row cutoff. Right against D8. It is a changed meaning of authored keys, which the declaration reads as none: wrong, see ② S2.
  6. A tenant-scoped retention_overrides window is not applied to a sealed object with no archive. Wrong as built, see ④ S1; and a narrowing the declaration does not carry.
  7. With no sealed expiry registered the rows are kept, including the cold archive.keep prune of sys_audit_log on a deployment whose AuditPlugin has no crypto provider. Right (D8's seam bullet), and stated.
  8. os migrate audit-* --apply needs --sealer-stopped on SQLite and Turso on every deployment, and takes the audit seal lock on Postgres and MySQL on every deployment. Ruled; declared wrong, see ② M2.
  9. The verifier's third sealed-window arm: more rows read late unsealed and os audit verify exits 1 where it exited 0. Right: seat ruling 6885452378 and D3 as amended, as written.
  10. verifyAuditLedger (a root export) needs archive passed where the datasource sys_audit_log archives to is not connected. Follows from 1; a narrowing for a library caller, stated in the PR body only.
  11. The verify harness hands harnessCryptoProvider() to an AuditPlugin it mounts, on all three mount paths, through adoptHostCryptoProvider. Right: ruling 6884540128 item 4.
  12. The sealer's head and floor fall back to the last expiry when no checkpoint is left. Right (D8).
  13. The lifecycle.seal .describe() sentence: prose only, no accept-set change, the reference page regenerated.

② Semver level

The changeset moves plugin-audit, objectql, verify and spec at patch, with Clause-②: yes (widening) and Metadata-protocol: none. The widening half is true. Two things are not.

M2 (must-fix) — the declaration carries no narrowing, and this diff narrows. This card's own precedent is changeset 35c9a30 (#33675): it declared the same refusal yes (narrowing) under a **BREAKING** banner with an ADR-0087 marker, and bounded it with "No object declares lifecycle.seal by default, so a deployment that did not opt in sees no change". This diff is the change that opts every deployment in. Narrowed here:

  • os migrate audit-key-material, audit-mail-bodies, audit-metadata-bodies and audit-side-copies with --apply on SQLite or Turso are refused without --sealer-stopped on every deployment. Their object lists name sys_audit_log statically and holdAuditSealLock reads lifecycle.seal off the registry, so the refusal does not depend on whether a row needs rewriting.
  • On Postgres and MySQL the same runs now take the audit seal lock on every deployment, wait up to ten minutes for a sealer pass, then refuse. The changeset's "as before" holds only for a deployment that had opted in.
  • os audit verify exits 1 on rows the new arm reads late unsealed (item 9).
  • verifyAuditLedger without archive (item 10).
  • The tenant-scoped window (item 6).
    Owed on both carriers: the (narrowing) arm beside the widening, the BREAKING banner with the one-line fix for each item, the ADR-0087 disposition marker, and the Skills-docs: line the arm brings. The changeset's bullet on --sealer-stopped is true as far as it goes; it is the banner and the arm that are missing.

S2 (should-fix) — Metadata-protocol: none reads the diff as a platform object's declaration only. The diff also changes what retention, ttl and archive.keep mean beside seal on any author's object (item 5), and rewrites the key's own .describe() to say so. AGENTS.md names a changed meaning semantic, and the shipped changelogs use semantic for runtime changes of this kind. semantic takes at least minor on a package the diff moves, so the level does not match either. The seat rules the kind on the card; if it keeps none, the ruling says why item 5 is not a changed meaning.

③ Boundary flags

  • Sealed by default, so --sealer-stopped on every SQLite and Turso deployment. Covered: D10 rules the default, D3 as amended (B) and seat ruling 6885005594 item 2 rule the flag for any object declaring lifecycle.seal, and slice plan 6759503769 put the default in this slice. Stated true in the changeset. Maintainer's decision: none is owed on the rule itself. What is owed is M2, the dev's to fix. It goes to the maintainer only if the seat contests that M2 is a narrowing, because 18.6.0 told operators a deployment that did not opt in would see no change.
  • Operator pages outside this diff, for the lane seat: content/docs/deployment/cli.mdx is on the claimed surface and untouched; its os migrate audit-* section says only "Run them with the server stopped" and never names the flag or the lock. content/docs/upgrading.mdx ties the flag to "where an app declares lifecycle.seal". Both are false for a default deployment once this lands.
  • Carrier: cloud. Turso environments meet the refusal on their next os migrate audit-* run, and a host that passes no crypto provider to AuditPlugin now keeps sys_audit_log past archive.keep and reports hourly at error.
  • No crypto provider: rows kept, said once at warn. Answered: right. D8 rules that a missing amendment keeps the rows, and the sealer's own error line carries the durability half.
  • A tenant-scoped override does not apply to a sealed object. Named for this review by amendment 7195525477; no ruling covers it. S1 below. It needs a ruling of record: the seat's, and the maintainer's if the ruling would let a chain expire under a window shorter than the one configured for it.
  • The cutoff aligned down to a UTC day, and 10,000 rows a sweep. Escalated to the seat. D8 states the extra retention as "at most one window plus the late horizon" and the Consequences line repeats it; the build adds up to one day, and a backlog adds more. The direction is safe and verification still honours the amendment. Under Prime Directive 13 the bound changes by a record: a seat ruling on the card and an add-only ADR-0154 note in its own governed PR, as docs(adr): ADR-0154 amendments — bounded checkpoints (D4) and the DB session seal lock (D3) #33489 did for the three rulings before it. The budget is also per object across all chains, where the Archiver bound it cites is per pass.
  • The seam's name. Slice plan 6759503769 ruled registerExpiryPrefix; the diff ships registerSealedExpiry and no later ruling renames it. The seat confirms the name on the card before it is published.
  • File surface. content/docs/deployment/production-readiness.mdx and the four os migrate integration files are in the diff and in no claim line (7193045552, 7193137455, 7195525477). An amendment is owed; the lane seat's.
  • The skills sentence. skills/objectstack-data/rules/lifecycle.md keeps "Not built yet ... the sweeper still deletes sealed rows" from this merge until the second PR, and this PR's closing keyword closes the card first. The seat's call; its own example there (retention beside seal, no archive) is the shape S1 is about.
  • SQL push-down. No finding. The chain walk, the run walk and the head reads push their filter, order and limit down. The id lists of runOf and deleteSealedRows are the row ids a checkpoint's signed body carries, which D8 makes the unit of deletion, and the per-row engine delete is batchedReap's, for the guards.
  • Ruling 6885452378 item 6 (the notice and the no-later-window case) is deferred by the ruling itself.

④ Design judgment

packages/spec/src/data/object.zod.ts. One .describe() sentence. It holds against D8 and D10 and against its first consumer, sys_audit_log: archive.keep expires by whole checkpoints through the seam, and without a registered expiry the sweeper keeps the rows. No shape change.

packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts. Holds: D10's value, class audit, no onlyWhen, archive.after equal to retention.maxAge.

packages/objectql/src/lifecycle/lifecycle-service.ts. The routing holds against D8: an archiving sealed object expires on keep alone, on both stores, by id; any other sealed object expires through its ttl and retention legs; rows go before complete(); an unfinished run is not completed; a throwing plan deletes nothing; no expiry means no delete.

S1 (should-fix) — reapSealed drops a tenant-scoped window and expires every chain under the global one. On main that window was applied to a sealed object like any other (reap, tenantWindowsFor). Where a tenant's window is longer than the global one, its rows are now expired earlier than the operator configured, after one warn. That is a delete, on an audit-class object, and it contradicts the PR's own rule that anything off keeps rows. The stated reason, one signed policy value per chain, does not force it: by default a chain is one organization's, and each chain's amendment carries its own policy value. The seat rules the shape (a per-chain value, or the longest window as the one value); either way a chain is never expired under a window shorter than the one configured for it. sys_audit_log itself is not affected: it archives, and keep has no override.

packages/plugins/plugin-audit/src/audit-seal/expiry.ts. The fresh run holds against D8 sentence by sentence: it starts at the first remaining sequence, which must follow the last admitted expiry; takes consecutive checkpoints whose windows ended by the cutoff; admits each; signs and stores the amendment before it answers; carries the last removed digest, the policy and its value; resumes a stored range before it signs another.

M1 (must-fix) — expiry.ts. One finding in a security-adjacent path. Its statement is withheld from this record and handed to the seat off the public thread, as report 6821958333 did. The delta record closes it by id.

S3 (should-fix) — the resumed range is read with no orderBy, so complete() removes its checkpoints in driver order. sealer.ts says of expire that the pass's locks keep a sealer pass from reading a chain head the expiry is moving, but complete() runs after expire has released them. What keeps a concurrent pass's head right is that the newest checkpoint goes last and the expiry fallback then answers the same head, which is true by construction only in the fresh run. Read the resumed range ascending by sequence, and make the sentence name what protects the head.

sealer.ts, audit-plugin.ts. expire holds: both locks around planning and signing, no run while either is held, a throw with no crypto or signer, the memo only for a plan that found nothing. The head and floor fallbacks hold against D8. Registration only with a crypto provider, and its removal on destroy(), hold.

verifier.ts. The arm is ruling 6885452378 item 1 as written, and D3's amended bullet says the same.

packages/verify/src/harness.ts, packages/objectql/src/index.ts. Hold: the one harness provider on all three mount paths, never a bare provider, an instance with its own provider left alone; the three types exported.

Nits:

  • n1 — the .describe() sentence and objects.mdx do not say what a tenant-scoped window or the day alignment does on a sealed object; they follow S1's ruling.
  • n2 — expiry.ts's header says rows stay at most one day past their policy on top of D8's bound; the row budget can add more.
  • n3 — on the stores path deleteSealedRows answers that every row is gone once bulkDelete did not throw, and asks bulkDelete of a cold driver the boot checked for upsert only (the old prune guarded deleteMany). A cold driver without it fails each sweep after the amendment is signed: loud, and it keeps the rows.

Implemented-by: claude/project-thread-vslp7g
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: FAIL

…pply tenant windows per chain

Review 7198128323 and its seat rulings:
- a resumed expiry admits each checkpoint left in its range under a trusted
  key, consecutively to the amendment's last sequence and digest, or deletes
  nothing; a chain head and the object floor follow only an admitted expiry;
- a tenant-scoped retention window travels to the sealed expiry and applies
  to its organization's chain; a chain of no one organization takes the
  longest window;
- the resumed range is removed oldest first; an archive store with no
  bulkDelete is never planned;
- the seam is registerExpiryPrefix, as the slice plan ruled;
- the changeset declares the narrowing and the semantic change (minor), with
  the BREAKING banner and the ADR-0087 marker; cli.mdx and upgrading.mdx name
  the audit seal lock for every deployment.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 46e272ed4599332945e9a7e0709e08f08408f8aa
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts + packages/objectql/src/lifecycle/lifecycle-service.ts, packages/objectql/src/index.ts, packages/plugins/plugin-audit/src/audit-seal/expiry.ts, packages/plugins/plugin-audit/src/audit-seal/sealer.ts, packages/plugins/plugin-audit/src/audit-seal/verifier.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts, packages/verify/src/harness.ts

Delta record over review 7198128323 (FAIL at 4deab949). Inputs: card #31908 (body and all 63 comments, the newest being claim amendment 7199938858), PR #37605 (body, 31 files, net diff against merge base 061e3422), the delta 4deab949..46e272ed read in full (one commit, 14 files), the dev thread's reply as a claim to test, and the head's check-runs, read 2026-11-26T20:35Z: 74 runs, 61 success, 12 skipped, 1 failure. The failure is the first Check Changeset run, made on the old PR-body declarations; its rerun on the same head after the body was replaced is success, and that one governs. check-governed-merges.mjs --pr 37605, read only: 0 of 31 paths governed, 1,843 changed lines. The rest of the diff (tests, the changeset's prose, the docs pages, the census page, engine-double-contract.pinned.json, packages/verify/vitest.config.ts) is the lane seat's ACCEPT at TIER_DEFAULT.

① Derived judgments

Items 1, 2, 4 and 7 to 13 of the earlier record stand as judged there. What the delta changes:

  1. The seam is LifecycleService.registerExpiryPrefix; no registerSealedExpiry is left in the tree. Right: the name slice plan 6759503769 ruled. The export was never released, so the rename narrows nothing.
  2. LifecycleSealedExpiryRequest gains the optional tenants (each a tenant id, its applied policy value and its cutoff). Right as a widening, and declared.
  3. report.skipped gains the reason seal-delete-unsupported: an archive store with no bulkDelete is refused before anything is planned or signed. Right, and declared.
  4. A tenant-scoped window now reaches a sealed object: an organization's chain expires under its own window, any other chain under the longest, and each amendment signs the value its chain expired under. Right against the S1 ruling as the brief states it, in the shape where a chain's key is the organization the window is configured for. Outside that shape, see S4.
  5. The sealer's head and floor pass over a stored expiry that is not admitted. Right.
  6. A stored expiry whose remaining range does not check out is not resumed, and its rows are kept, said once. Right: the keep direction.
  7. The changeset moves the four packages at minor and declares yes (narrowing) and semantic. See ②.
  8. The lifecycle.seal .describe() sentence gains the tenant window and the UTC-day alignment. Prose only, no accept-set change, the reference page regenerated.

② Semver level

M2: closed. Both carriers declare Clause-②: yes (narrowing) with the narrowed and the widened surface, the changeset carries the **BREAKING** banner with a one-line fix for each item it names, one ADR-0087 marker (not-required, no-migration-prescription), and the Skills-docs: follow-up owed line naming the file. It says in words that it breaks the bound changeset 35c9a30 set. The 维护者速读 states the operator change, that an expiry cannot be undone, and what a host with no crypto provider sees.

S2: closed. Metadata-protocol: semantic on both carriers, as ruled; all four packages at minor, which is the level the kind takes; the governing Check Changeset run is success.

S5 (should-fix) — the narrowed list and the banner leave one change out. Because sys_audit_log is now sealed on every deployment, os audit verify refuses with archive_not_connected and exits 2 wherever the archive datasource is declared and not connected on the command's own boot, where 18.6.0 printed that nothing is sealed and exited 0. The declaration carries the library form of the same change (verifyAuditLedger throws) and not the command's. Owed on both carriers: the item in the narrowed list and a banner line with its fix (declare the datasource with autoConnect: true, or make it reachable from where the command runs). The earlier record named this behaviour under ① item 2 and did not list it under M2, so the omission starts there, not with the dev.

③ Boundary flags

  • Rulings of record. The brief states three seat rulings this head implements: the S1 window rule, the S2 kind, and keeping the UTC-day alignment and the 10,000-row budget past D8's stated bound. No comment on card plugin-audit + objectql lifecycle: build the audit tamper-evidence ADR — sealer, signed checkpoints, redaction and expiry amendments, os audit verify #31908 carries any of them; the newest comment is the file-surface amendment. The code was judged against the wording the brief gives. The seat owes them on the card before ACCEPT, since the changeset and the PR body cite them as rulings.
  • The D8 bound. The PR body says the add-only ADR-0154 note follows in its own governed PR after this one. Until it lands, the ADR states a tighter bound than the code keeps. The direction is safe. The order is the maintainer's to accept at approval (Prime Directive 13).
  • Tier. The PR body's Tier: line reads "not Tier H". Path and size agree with it (the read above). A declared narrowing takes the final-four pack with a human approval all the same (pm-dispatch SKILL, the fork after ACCEPT). The line is the seat's to correct at hand-off.
  • Dogfood battery. The (narrowing) arm owes a full dogfood battery pinned to the final head (os-dev.md; the L1 checklist reads its absence as REWORK), and landing refuses without it. The body's local runs list none. M3's fix moves the head, so it is owed once, on that head.
  • The three type names. LifecycleSealedExpiry, LifecycleSealedExpiryRequest and LifecycleSealedExpiryRun keep the old stem beside a seam now named registerExpiryPrefix. No ruling names them; the dev flags it as a small decision. The seat confirms or renames them on the card before they publish.
  • Claim surface. Amendment 7199938858 names content/docs/cli.mdx; the file in the diff is content/docs/deployment/cli.mdx. packages/objectql/src/index.ts (the three type exports) is in no claim line. The lane seat's.
  • Part of #31908. Right: the skills PR and the ADR note are still owed, so the card stays open.
  • Docs. content/docs/deployment/cli.mdx and content/docs/upgrading.mdx are updated in the delta; they are prose, the lane seat's ACCEPT, and not reviewed here. The 18.6 release page still says a deployment that did not opt in sees no change; it is left to the release process by the seat's choice, which AGENTS.md's documentation guardrail supports.
  • SQL push-down. No finding. The delta's new reads (the resumed range, the two bounded amendment reads) push their filter, order and limit down; the tenant windows come from settings the service already holds.
  • Carrier and the no-crypto-provider flag: as answered in the earlier record, unchanged.

④ Design judgment

packages/spec/src/data/object.zod.ts. The added sentence holds against the code for an object whose chain column carries the organization, and against its first consumer: sys_audit_log archives, keep has no tenant override, and its expiry is day-aligned. n1: closed.

packages/objectql/src/lifecycle/lifecycle-service.ts, packages/objectql/src/index.ts. S1: closed, as to the finding raised: the tenant window is no longer dropped, each one passes the same floors as the global window, and the value applied is the value signed. n3: closed: the store check runs before the plan, so nothing is signed over rows that could not be deleted. The rename holds on every caller.

S4 (should-fix) — the tenant windows are computed on one column and matched on another. tenantWindowsFor answers a partition: its windows and the column they are configured on (organization_id, or the attribution column for sys_audit_log alone). reapSealed keeps the windows and drops the column, and windowOf in expiry.ts matches each window to a chain by the chain's key, which is the seal's chain column (tenant_id unless chainField says otherwise). Where the two columns are the same value on every row, this is the ruling. Where they are not (the shape skills/objectstack-data/rules/lifecycle.md teaches: a tenant-scoped ledger with a declared tenant_id beside the injected organization_id), a row owned by one organization and chained under another expires under the other's window, or under the global one, and that can be shorter than the window configured for the organization that owns it. That is the delete the ruling excludes: by the partition reap() uses, such a chain is a cross-tenant chain and takes the longest window. The jsdoc on reapSealed ("on the partition tenantWindowsFor decides for every reap") and on windowOf ("no chain expires under a window shorter than one configured for its rows") is untrue there. The seat rules which column decides; the invariant is that a row never expires under a window shorter than its organization's. Carrying the partition column in the request, and giving a chain its own window only when its chain column is that column, is one way. sys_audit_log is not affected.

packages/plugins/plugin-audit/src/audit-seal/expiry.ts, sealer.ts.

M1: closed. Its two pins: this round ran nothing, so by reading, and by the ablation the PR body reports, both go red with the fix's checks removed together. Read singly, the head pin goes red with its one check removed; the resume pin does not go red with either one of its branch's checks removed alone (n6).

S3: closed. The resumed range is read ascending by sequence, and the sentence on expire now names what protects the head. n2: closed.

M3 (must-fix) — expiry.ts, sealer.ts. One finding in the same security-adjacent path, distinct from M1 and not closed by its fix. Its statement is withheld from this record and handed to the seat off the public thread. Part of it stood at the earlier head, and that record did not raise it. Its fix carries a pin for each check it adds, each shown red with that check alone removed. The next delta record closes it by id.

audit-plugin.ts, verifier.ts, sys-audit-log.object.ts, packages/verify/src/harness.ts. audit-plugin.ts changes by the rename alone and holds; the other three are untouched by the delta and stand as judged.

Nits:

  • n4 — sealer.ts: the jsdoc line "One pass over one sealed object." now sits above the new LAST_EXPIRY_SCAN constant, not above the class it describes.
  • n5 — expiry.ts: complete() removes every checkpoint of the run, then every seed. A stop between the two leaves seeds whose checkpoints are gone, and no resume lists them; they are left to os secret orphans.
  • n6 — the resume pin's fixture is refused by more than one of the fix's checks, so no single check in that branch is pinned alone. M3's fix reaches the same branch and rides with it.
  • n7 — the .describe() sentence says a row "can stay up to a day longer"; that is the alignment alone, and a backlog over the row budget keeps rows longer, as objects.mdx says.

Implemented-by: claude/project-thread-vslp7g
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: FAIL

- M3: the expiry writer and the sealer's chain head check that each
  checkpoint and stored expiry amendment they use belongs to the chain and
  links in order, and page through stored amendments; the verifier adds two
  matching checks. New audit-seal-expiry-admission.test.ts plus two verifier
  tests, one per check.
- S4: a chain expires under the longest tenant window among the owners of
  its rows (by the column the windows are set on, hot store then archive);
  `tenantColumn` travels on the request.
- S5: the `os audit verify` exit 2 change is in the narrowed list and the
  BREAKING banner.
- Rename the seam types to LifecycleExpiryPrefix, LifecycleExpiryPrefixRequest,
  LifecycleExpiryPrefixRun.
- n4, n5, n7.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUd6hon2o34LQSLbZt
… --apply runs

sys_audit_log is sealed by default, so an --apply run over SQLite needs the
flag (ADR-0154 D3 amended, B), as the CLI integration tests already do. No
server seals these fixtures while the command runs.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c05884d460b1e3b8aa6dbe33a588175f47d7a822
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts + packages/objectql/src/lifecycle/lifecycle-service.ts, packages/objectql/src/index.ts, packages/plugins/plugin-audit/src/audit-seal/expiry.ts, packages/plugins/plugin-audit/src/audit-seal/sealer.ts, packages/plugins/plugin-audit/src/audit-seal/verifier.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts, packages/verify/src/harness.ts

Delta record, round 3 (record 7202871622: FAIL at 46e272ed, M3 must-fix withheld, should-fix S4 and S5, nits n4 to n7). Inputs: card #31908 (body and all 64 comments, the seat's rulings of record 7202915675 among them), the two earlier records on this PR, PR #37605 (body, 36 files), the delta 46e272ed..c05884d4 read in full (two commits, 16 files), M3's off-thread statement and the dev thread's reply as claims to test, and the head's check-runs, read 2026-11-26T23:14Z: 74 runs, 62 success, 12 skipped, none failed or pending; both Check Changeset runs are success. Nothing was built or run. The rest of the diff (tests, the changeset's prose, the docs pages) is the lane seat's ACCEPT at TIER_DEFAULT; the new pins were read only to see what each one pins.

① Derived judgments

The items of the two earlier records stand as judged there. What this delta changes:

  1. The three seam types are LifecycleExpiryPrefix, LifecycleExpiryPrefixRequest and LifecycleExpiryPrefixRun; no LifecycleSealedExpiry name is left in the tree. Right: the stem ruling 7202915675 names. The old names were never released, so the rename narrows nothing.
  2. LifecycleExpiryPrefixRequest gains the optional tenantColumn, sent exactly when tenants is. Right as a widening, and declared on both carriers.
  3. An expiry now refuses a whole chain, and says so once, when a stored checkpoint or expiry amendment it reads under the chain is not the chain's own or does not link to the one before it; a resumed range must also run unbroken to the amendment's last sequence and digest. Right: every new refusal keeps rows, deletes nothing and points at os audit verify.
  4. os audit verify gains two faults: an amendment stored under a chain other than the one its signed organization names (chain_key), and a checkpoint inside an honoured expiry range whose window ends after the range's covered_to (expiry; its rows are then judged, not read expired). Right, and neither fires on what the platform's own writers store: every amendment row derives its chain_key from the signed organization, an 18.6.0 proof bundle already carries it, and the expiry writer signs covered_to as the latest window end it took. No released state turns from exit 0 to exit 1, so no line is owed in the narrowed list. (The honour rule that was already there is another matter: S6.)
  5. A tenant-scoped window is now matched to a row by the column the windows are set on. See S4 and S6.
  6. complete() removes each checkpoint's seed and then the checkpoint, oldest first. Right (n5).
  7. The lifecycle.seal .describe() sentence: prose only, no accept-set change, the reference page regenerated in both tables. For the sentence itself see S4.
  8. The two dogfood files pass --sealer-stopped on their SQLite --apply runs; no assertion changed. See ③.

② Semver level

S5: closed. Both carriers now name os audit verify refusing with archive_not_connected and exit 2 in the narrowed list, and the changeset's banner carries the line with its fix.

The level stands: four packages at minor, Clause-②: yes (narrowing), Metadata-protocol: semantic, one ADR-0087 marker, Skills-docs: follow-up owed. The widened list names the three types by their new names, and tenantColumn.

The narrowed list names every affected command. Four commands take the audit seal lock (audit-key-material, audit-mail-bodies, audit-metadata-bodies, audit-side-copies) and all four are named, beside os audit verify twice (exit 1 on a late unsealed row, exit 2 on an unconnected archive) and the library verifyAuditLedger. The delta adds no further item: its new refusals keep rows, and its two verifier faults do not fire on a released state (① item 4).

③ Boundary flags

  • Rulings of record. Now on the card (7202915675): the window rule, the kind, the kept day alignment and row budget, the names, Part of, and the corrected claim surface. The earlier record's flag is answered.
  • The S4 small decision. The PR body flags that under S4 "the window grows as the walk reaches rows of more owners". That is another rule than the one ruling 7202915675 states, and it is not the dev's to settle: a ruling binds until the seat changes it (Prime Directive 13). Escalated to the seat under S4.
  • Dogfood battery. The four failures are the declared narrowing's own consequence, not a masked failure. An --apply run on SQLite over a sealed object refuses without --sealer-stopped; the two files each run --apply twice over an 18.0 fixture; the fix adds the flag the banner tells an operator to add, and no assertion changed. The body's battery is the full run at 48e81f3c plus the two changed files at this head, and this head differs from 48e81f3c in those two files alone, so the reading holds. This head's CI did not run the dogfood shards (the aggregate job is success with its matrix skipped), so the battery rests on the local run until the queue's. Whether that meets "pinned to the final head" is the lane seat's L1 call.
  • Claim surface. The two dogfood files and the new audit-seal-expiry-admission.test.ts are in no claim line; the PR body names them for the seat's amendment. The lane seat's.
  • Tier. The Tier: line now reads Tier H by the declared narrowing. Answered.
  • The D8 bound. Unchanged: the add-only ADR-0154 note follows in its own governed PR, and the order is the maintainer's to accept at approval.
  • SQL push-down. One finding, carried as part of S4. ownersOf in expiry.ts is a new in-app join with no reason given in the code: it takes every row id a checkpoint lists, reads the rows back whole, 500 ids a read, from the hot store and then the archive, and keeps one column of each. It runs before the checkpoint's own window is checked, so every sweep reads the owners of each such chain's first unexpired checkpoint and then stops. The ids come from the signed body, so that join cannot be pushed down as written; the projection can, and so can the order of the two checks. Under the rule the ruling states (the owners of the rows the chain holds) the read is one grouped query per chain per store on the chain column, and no id is materialised. S4's ruling decides which read is right.
  • Part of #31908, the carrier and the no-crypto-provider flag: as answered in the earlier records, unchanged.

④ Design judgment

Admission: expiry.ts, sealer.ts, verifier.ts.

M3: closed. Every part of its off-thread statement was read against this tree, the lesser variants and the paged reads that replace the two bounded scans included. The design consequence: an expiry acts only on checkpoints and amendments that are the chain's own by their signed content, in unbroken linked order, each under a trusted key; the sealer's head and floor pass over a stored expiry that is not; a stored row that fails any of this deletes nothing, is said once, and is left to os audit verify. The verifier holds an honoured range to the windows it signs, and reports an amendment stored under another chain. Neither verifier check refuses honest data (① item 4). Each of the fifteen pins was read: its fixture is refused by the one check it names, so the tree supports the ablation table in the PR body; nothing was run here.

n6: closed. The resumed range's checks are pinned one at a time, each fixture refused by its one check.

The tenant window: expiry.ts, lifecycle-service.ts, object.zod.ts.

S4 (should-fix) — closed in part: the column mismatch is gone and no row leaves before its own window, but the rule built is not the rule ruled, and the published sentences state the ruled one.

Closed: the request carries the column the windows are set on; a chain takes its own organization's window only when that column is its chain column; where it is not, each row's owner is read by that column, and a checkpoint is judged by the longest window among the owners of its rows and of the rows taken before it (a row neither store holds takes the longest of all). Pinned on the policy_change_log shape.

Open: ruling 7202915675 gives the window to the chain ("a chain whose rows span several owners, expires under the longest window among them", "resolved from the owners of the rows the chain holds"). The code gives it to the checkpoint, growing along the walk. The two differ on the PR's own pin: chain org:org_short holds a row owned by org_long (400d) at sequence 1, and its sequence 0 expires under 10d; under the ruling as written the chain expires under 400d. The PR body's small decisions state the checkpoint rule. The sentence in object.zod.ts ("a chain expires under the longest window among the organizations whose rows it holds"), the jsdoc on windowOf, on LifecycleExpiryPrefixRequest.tenants and tenantColumn and on reapSealed, the changeset and objects.mdx state the chain rule, which is untrue of the code on that pin. The seat rules which one stands:

  • per chain, as ruled: the code changes, and the owners are one grouped read per chain per store (③);
  • per checkpoint, as built: the ruling of record and those sentences are corrected to say the window is each checkpoint's and the invariant is the row's, and the read in ③ gets its projection and its reason;
  • or a chain takes its own window only when the windows' column is its chain column, and the longest of all otherwise: the ruling's bound holds on its safe side with no row read, and S6 and the read in ③ go with it.

One further consideration bearing on this choice is handed to the seat off the public thread.

S6 (should-fix) — expiry.ts, the S4 walk: a run can sign a policy value that its own covered_to does not yet satisfy, and the verifier then reads an untouched range as missing.

The walk's comment says "The window only lengthens as owners join, and windows end in order: every checkpoint taken ended by it." Windows do not end in sequence order: the sealer appends a late checkpoint at the chain's head for a window up to seven days older (sealLate). When such a checkpoint brings in an owner with a longer window, the run keeps the checkpoints it already took under the shorter one, signs the longer value as policy_value, and signs covered_to as the latest window end taken. The verifier honours an expiry only when covered_to lies at least policy_value before the check (honour), so until the clock catches up, at most about the late horizon, that range and every later expiry of the chain are not honoured: os audit verify reports the rows missing and exits 1 on a ledger nobody touched. No row leaves early and nothing is hidden; it clears by itself. It needs windows set on a column other than the chain column, a late checkpoint, and either two windows within about eight days of each other or a backlog (a first run, a sealer that was down, a run cut by the row budget). sys_audit_log is not affected. Fix: end the run before a checkpoint whose owners would lengthen the window past a window end already taken, so each amendment's value covers its whole range, and pin it with a late checkpoint of a longer-window owner behind a taken one. The third option under S4 removes it.

sealer.ts. n4: closed (the jsdoc line is back above ObjectPass). The head fallback and the floor read stored expiries a page at a time and pass over one that is not the chain's own. Holds.

lifecycle-service.ts, index.ts. The renames hold on every caller. tenantColumn is sent exactly when tenants is, from the partition tenantWindowsFor decides; the archive keep leg sends neither. Holds, but for the jsdoc named under S4.

object.zod.ts. n7: closed (the sentence now names the row budget beside the day). The tenant sentence is S4's. Against its first consumer the block holds: sys_audit_log archives and its keep has no tenant window, so that sentence does not reach it.

verifier.ts. The two checks hold (① item 4).

audit-plugin.ts, sys-audit-log.object.ts, packages/verify/src/harness.ts. Untouched by the delta; they stand as judged.

n5: closed (each seed goes before its checkpoint, oldest first, so a stop leaves no seed whose checkpoint is gone, and the rest is resumed).

Nits:

  • n8 — expiry.ts: ownersOf's archive read and ObjectExpiryOptions.archive have no caller through the lifecycle service. Tenant windows arrive only from reapSealed, which runs only for an object with no archive; the archive keep leg sends none. The read runs in its pin alone.
  • n9 — expiry.ts: the jsdoc on bound says the row's sealed_object column is not signed. It is the signed body's own member (checkpointBodyFromRow, amendmentBodyFromRow); only chain_key stands outside it. The sealed_object compare there and in the sealer's lastExpiry repeats the query's own filter.
  • n10 — verifier.ts: the AuditChainFaultKind jsdoc for 'expiry' still reads "An expiry amendment that is not honoured"; the kind now also reports a checkpoint past an honoured range's covered_to.

Implemented-by: claude/project-thread-vslp7g
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

- S4 (seat ruling, option 3): a tenant's own window applies to a chain only
  where the windows are set on the chain column; every other chain takes the
  longest window configured. No row is read to pick a window. Every sentence
  stating the rule says so, with its cost: on an object whose windows sit on
  another column, a shorter tenant window has no effect on its sealed rows.
- An expiry drops a seed only when it is the secret sealed under that
  checkpoint's own coordinate.
- The resumed range is read a page at a time; the chain walk never takes a
  row with no chain_key as its key.
- n9, n10, and the jsdoc of the stored-expiry read.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 65a5d7dcb676ca89ad7f054bce4c2fc51d43b385
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts + packages/objectql/src/lifecycle/lifecycle-service.ts, packages/objectql/src/index.ts, packages/plugins/plugin-audit/src/audit-seal/expiry.ts, packages/plugins/plugin-audit/src/audit-seal/sealer.ts, packages/plugins/plugin-audit/src/audit-seal/signer.ts, packages/plugins/plugin-audit/src/audit-seal/verifier.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts, packages/verify/src/harness.ts

Delta record, round 4 (record 7205485052: PASS at c05884d4, M3 closed, S4 and S6 open, nits n8 to n10). Inputs: card #31908 (body and all 65 comments, claim amendment 7206884584 the newest), the three earlier records on this PR, PR #37605 (body, 37 files), the delta c05884d4..65a5d7dc read in full (one commit, 11 files), the seat's ruling for this round and the dev thread's reply as claims to test, and the head's check-runs, read 2026-11-27T01:42Z: 74 runs, 62 success, 12 skipped, none failed or pending; both Check Changeset runs are success. Nothing was built or run. signer.ts joins the scope: the delta changes the function the expiry removes a seed through. The rest of the diff (tests, the changeset's prose, the docs pages) is the lane seat's ACCEPT at TIER_DEFAULT; the new and changed pins were read only to see what each one pins.

① Derived judgments

The items of the three earlier records stand as judged there. What this delta changes:

  1. A tenant-scoped window now reaches a chain by one rule with two arms. Where the windows are set on the object's chain column, an organization's chain takes its own window (the global one if it has none). Every other chain takes the longest of the global window and every tenant window: the chain of rows about no organization, and every chain of an object whose windows are set on another column. Right: the third option of record 7205485052, which the seat ruled, on both arms. Its consequence is a behaviour change the carriers state: on an object whose windows sit on another column than its chain column, a shorter tenant window no longer shortens anything.
  2. windowOf loses its fourth parameter, ObjectExpiryOptions.archive is gone, and dropAuditSealSecret gains an optional third parameter. None of the three is exported from the package (src/index.ts, audit-seal/index.ts), so no public surface moves.
  3. LifecycleExpiryPrefixRequest keeps its shape; the jsdoc of tenants and tenantColumn alone changes. No accept-set change.
  4. The lifecycle.seal .describe() sentence: prose only, no accept-set change, the reference page regenerated in both tables; TypeScript Type Check, which carries the spec's generated-artifact gates, is success.
  5. An expiry removes a checkpoint's seed only when the stored secret is the one sealed under that checkpoint's own coordinate. Right: the keep direction, and an honest removal is untouched (④).
  6. The chain walk's first step asks for a chain_key that is not null, and a resumed range is read a page at a time. Right: neither changes a result on rows the platform writes.
  7. The refusal for a row signed for another chain now reads "signed for another organization". A log line, no contract.

② Semver level

Unchanged and it stands: four packages at minor, Clause-②: yes (narrowing), Metadata-protocol: semantic, one ADR-0087 marker, Skills-docs: follow-up owed. The widened list still names tenants and tenantColumn, whose shape did not move.

The new rule adds no item to the narrowed list. It refuses nothing and deletes nothing sooner; like the host with no crypto provider, it keeps rows longer than a setting asks. The ruling asks for that cost in words on three carriers, and all three carry it: the changeset's tenant bullet ("On such an object a shorter tenant window has no effect on its sealed rows: they are kept to the longest"), the PR body (维护者速读 and the acceptance notes), and objects.mdx.

③ Boundary flags

  • The ruling of record. Escalated to the seat. The card's rulings of record (7202915675) still give the window to "the owners of the rows the chain holds". The rule this head builds is stated on the card only as a phrase in claim amendment 7206884584 ("option 3 of the seat's S4 ruling"), while the PR body cites a "seat ruling on review 7205485052" and the windowOf jsdoc cites the rulings on S1 and S4. A ruling binds until the seat changes it on the record (Prime Directive 13): the seat owes the superseding ruling on the card, with its cost, before ACCEPT, so the citations resolve. It does not move the head.
  • The cost, where the ruling asks. Answered: stated in the PR body, the changeset and objects.mdx (②), and also in the .describe() sentence and the tenantColumn jsdoc.
  • The skills follow-up. skills/objectstack-data/rules/lifecycle.md teaches exactly the shape the cost falls on (a declared tenant_id, retention beside seal, no archive) and, a few lines on, tenant-scoped retention_overrides. The second PR owes this sentence beside the one it already owes. The seat's, for that PR's brief.
  • No pin for the two reviewer items. The not-null first step: accepted as argued. The filter is the driver's own IS NOT NULL, the platform writes no checkpoint without a chain_key, and the real-kernel SQLite run passes through it on every plan. The paged resume: right by reading, and its second page is n12.
  • Dogfood battery. The body reports the full battery at this head. This head's CI did not run the dogfood shards (the aggregate job is success with its matrix skipped), so the battery rests on the local run until the queue's. Whether that meets "pinned to the final head" stays the lane seat's L1 call.
  • Claim surface. Every one of the 37 paths is under a claim line: the claim itself (the lifecycle and audit-seal trees, audit-plugin.ts, the object, the harness, their tests, the two docs pages, the changeset) and amendments 7193137455, 7195525477, 7199938858, the correction in 7202915675, and 7206884584. Two descriptions in 7206884584 do not match the files: the two dogfood files pass --sealer-stopped on their --apply runs and assert nothing about a window, and seal-store.testkit.ts changes by the $lte judge alone. The paths are what binds; the wording is the lane seat's to correct in a line.
  • SQL push-down. The finding carried under S4 is closed: ownersOf and its two reads are gone, no id is materialised and nothing is joined in the app to pick a window. The delta's new reads push their filter, order and limit down: the not-null first step, the resumed range by sequence with a page limit, and one read by id before a seed is removed. One over-wide filter is left, n13.
  • Tier, the D8 bound, Part of #31908. Unchanged, as answered in the earlier records.

④ Design judgment

The tenant window: expiry.ts, sealer.ts, lifecycle-service.ts, object.zod.ts.

S4: closed. Both arms were read against the ruling and against the code that feeds them.

  • The chain-column arm. windowOf gives an organization's chain its own window only when tenantColumn equals the object's chain column, and the chain key is then the very value the windows are keyed by: a chain's membership is what its signed checkpoints say, so the chain of one organization holds that organization's rows alone. An organization with no window of its own takes the global one.
  • The other arm. Any other chain takes the earliest cutoff among the global window and every tenant window, with the value that goes with it, and its amendment signs that value. A request that carries windows and no column falls here too, on the safe side.
  • No row is read. ownersOf, its archive read, the archive option and the sealer's archive lookup for an expiry are gone; the window is fixed per chain before the walk.
  • The sentences. Each one the ruling names now states this rule, and none read in the diff still states the other: the .describe() sentence and both tables of the regenerated reference page, the windowOf jsdoc, LifecycleExpiryPrefixRequest.tenants and tenantColumn, reapSealed, the changeset bullet, objects.mdx, and the window pins' header. The one place that still states the old rule is the card's ruling of record (③).
  • The pins. Over the sealer on the policy_change_log shape: with the windows on tenant_id, the short organization's chain expires both of its checkpoints under its own value and nothing else leaves; with the windows on organization_id, nothing leaves and nothing is signed. Each fixture is decided by the one arm it names, so the tree supports the two ablations the body reports; nothing was run here.
  • The bound "no row expires under a window shorter than one set for it" holds for every window the request carries.

S6: closed. A chain's window no longer changes during a walk. Every checkpoint a run takes ended at or before the one cutoff its amendment's value belongs to, so the signed covered_to always lies at least the signed value before the check, whatever order late checkpoints sit in. The walk still stops at the first checkpoint past the cutoff, which only keeps rows.

No must-fix, no should-fix.

The seed check: signer.ts, expiry.ts. Holds, and it does not refuse an honest removal. complete() builds the coordinate with checkpointSeedContext from the checkpoint's signed object, organization and sequence, the same call with the same three values the sealer makes when it writes the seed (writeCheckpoint), and the secret row stores exactly that namespace and key (writeAuditSealSecret). So every seed the sealer wrote compares equal. A handle that names any other secret removes nothing, the checkpoint row still goes, and a seed already removed by an interrupted run is passed over. The coordinate is built outside the removal's own try; it cannot throw for a checkpoint the sealer wrote, since the sealer builds the same coordinate before it writes anything. The sealer's own removals of a handle it has just written pass no expectation and are unchanged. The pin gives the chain's last checkpoint, re-signed, a handle naming the signing key's wrapped half: that secret stays, an earlier checkpoint's own seed goes, and every checkpoint of the chain goes. The real-kernel SQLite run still asserts that an expiry's seeds are gone, and Test Core is success.

The walk and the resume: expiry.ts. The first step's not-null filter is an operator both the SQL driver and the store double judge. The resumed range is read from the next sequence to the amendment's last, twenty a page, ascending; the sequence, link and signature checks carry across pages, and the last-sequence and digest check still closes the range. Holds.

bound: expiry.ts, sealer.ts. n9: closed. sealed_object is a member of the signed body, read from the same column every read here filters on, so the dropped compare repeated the filter; the jsdoc now says so, in both files.

verifier.ts. n10: closed. The 'expiry' kind's jsdoc names both uses.

n8: closed. The read it named no longer exists.

object.zod.ts. The sentence holds against the code and against its first consumer: sys_audit_log archives and its keep carries no tenant window, so neither arm reaches it. Against the next consumer, an author's sealed ledger, it is accurate and leaves one thing unsaid (n14).

lifecycle-service.ts, index.ts, audit-plugin.ts, sys-audit-log.object.ts, packages/verify/src/harness.ts. The service changes by jsdoc alone, which now agrees with windowOf sentence by sentence; the others are untouched by the delta and stand as judged.

Nits:

  • n11 — expiry.ts, lifecycle-service.ts: nothing is said at run time when a tenant window is set and not applied; the sweep reports the object like any other. The ruling asks for the cost in the three texts, which carry it. A once-only notice naming the object and the column is a follow-up card, not this PR's.
  • n12 — audit-seal-expiry-admission.test.ts: no resume pin holds more than one page, so the second page of the paged read runs in no test. A backlog range of more than twenty checkpoints is an ordinary one. A follow-up pin.
  • n13 — expiry.ts plan(): chains are found by the latest cutoff any window allows. Where the windows sit on another column no chain can use that cutoff, so every chain with a checkpoint that old is opened, on each plan the day's memo does not skip, to take nothing. Finding them by the longest window's cutoff in that case is a follow-up.
  • n14 — objects.mdx: "set on the chain column (tenant_id, or seal.chainField)" does not say which column a tenant window is set on. For an author's object that is always organization_id (tenantWindowsFor), so a tenant's own window applies only to a ledger chained by organization_id, and never under the default tenant_id chain. The page is a prose face and can say so; the .describe() sentence is accurate as it stands.

What is left before ACCEPT. On the tree: nothing. The seat's own acts: the superseding S4 ruling on the card (③), the L1 call on the dogfood battery, and the approval a declared narrowing takes.

Implemented-by: claude/project-thread-vslp7g
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

…horten the declared window

AuditPlugin registers a retention floor for every object that declares
lifecycle.seal and no archive, at its declared retention.maxAge and
ttl.expireAfter, beside the sealed expiry, and again before every sealer
pass so the floors follow the registry. A lifecycle service without
retention floors is given no expiry. Docs say which column a tenant
window is set on.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 71bb12a931f8e3eed30c04164076de98d4e3a9f8
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts + packages/objectql/src/lifecycle/lifecycle-service.ts, packages/objectql/src/index.ts, packages/plugins/plugin-audit/src/audit-seal/expiry.ts, packages/plugins/plugin-audit/src/audit-seal/retention-floor.ts, packages/plugins/plugin-audit/src/audit-seal/sealer.ts, packages/plugins/plugin-audit/src/audit-seal/signer.ts, packages/plugins/plugin-audit/src/audit-seal/verifier.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts, packages/verify/src/harness.ts

Delta record, round 5 (record 7207510869: PASS at 65a5d7dc, S4 and S6 closed, nits n11 to n14). Inputs: card #31908 (body and all 66 comments, the superseding S4 ruling 7207559410 the newest), the four earlier records on this PR, PR #37605 (body, 39 files), the delta 65a5d7dc..71bb12a9 read in full (one commit, 10 files), the dev thread's reply as claims to test, and the head's check-runs, read 2026-11-27T03:36Z: 71 runs so far, 32 success, 12 skipped, 27 still running (eight Test Core shards, the sixteen Test UI shards, Type Check · workspace, Type Check UI, Build & E2E UI), none failed; both Check Changeset runs are success. The gate had not finished when this was written: the verdict is on the tree as read and vouches for no run still open. Nothing was built or run. retention-floor.ts joins the scope: it is the new rule. The rest of the diff (tests, the changeset's prose, the docs pages, the pinned double entry) is the lane seat's ACCEPT at TIER_DEFAULT; the new pins were read only to see what each one pins.

① Derived judgments

The items of the four earlier records stand as judged there. What this delta changes:

  1. A new rule: on an object that declares lifecycle.seal and no archive, a lifecycle settings override cannot shorten the declared retention.maxAge or ttl.expireAfter. AuditPlugin registers a retention floor per such window at its declared value, through LifecycleService.registerRetentionFloor, which this PR does not change. An override below the floor, global or for one organization, is rejected by the service, reported at error and on the sweep report (floorViolations), and the declared window is what the expiry is asked for and what its amendment signs. A longer override applies. Right, for the objects it names (④).
  2. An object that declares seal and archive gets no floor. Its sealed rows leave only past archive.keep, which is read off the declaration and has no settings key, so nothing can shorten it. An override of its other window still applies there, as on 18.6.0: it decides when a row moves to the archive, not when it leaves. Right in the code; the carriers say otherwise (S7).
  3. Public surface: none moves. retention-floor.ts and AuditSealerOptions.beforePass are not exported from the package index, and registerRetentionFloor, LifecycleRetentionFloor and parseLifecycleDuration are existing exports of @objectstack/objectql.
  4. The lifecycle.seal .describe() gains one sentence and rewrites the tenant sentence: prose only, no accept-set change, the reference page regenerated in both tables with the same text.
  5. A lifecycle service that takes a sealed expiry and has no registerRetentionFloor is now given no expiry, and the plugin says so at error. The keep direction: such a host keeps its sealed rows. Right.
  6. The sealer now starts after the expiry and the floors are registered, where it started before. Right: the first pass begins with the floors in place.

② Semver level

The level stands: four packages at minor, Clause-②: yes (narrowing), Metadata-protocol: semantic, one ADR-0087 marker, Skills-docs: follow-up owed.

The narrowed list gains one arm and the BREAKING list one bullet, and both are owed: an override that 18.6.0 applied is now rejected. Checked against main: its lifecycle.seal description says the retention sweeper still deletes sealed rows, and its lifecycle service has no branch for a sealed object, so a sealed object's rows left at the row cutoff under whatever window the override resolved to. "Where 18.6.0 applied it" is true.

The arm is true for a sealed object that declares no archive, and it is written for every sealed object. That is S7, below. The fix is prose; the level does not move with it.

③ Boundary flags

  • The ruling of record for the floor. Escalated to the seat. The PR body cites "review 7207510869" for this rule in three places. That record does not state it, and the card carries no ruling for it: the newest ruling there (7207559410) is the S4 one. The rule is a declared narrowing, so it needs its sentence on the card, in design terms, with its cost (an operator can no longer shorten a sealed ledger's window from settings; the declaration is the only place), before ACCEPT. It does not move the head.
  • Claim surface. Every one of the 10 paths of the delta, and so all 39 of the PR, is under a claim line. The two new files sit under the claimed packages/plugins/plugin-audit/src/audit-seal/**; scripts/engine-double-contract.pinned.json and the spec description with its reference page were added by the amendments; the rest is the claim itself. No file is outside it.
  • A floor that outlives its declaration. The thread declares it and it is accepted: the service has no way to take a floor back, so an object that drops seal, or gains archive, keeps its last floor until restart. The keep direction (n16).
  • The skills follow-up. skills/objectstack-data/rules/lifecycle.md teaches retention beside seal and, a few lines on, retention_overrides. The second PR now owes this rule's sentence there too, in the wording S7 asks for. The seat's, for that PR's brief.
  • SQL push-down. Nothing to answer: the delta adds no read. The floors are computed from the registry in memory.
  • Dogfood battery, Tier, the D8 bound, Part of #31908. Unchanged, as answered in the earlier records. The battery's pinning to this head stays the lane seat's L1 call.

④ Design judgment

The floor: retention-floor.ts, audit-plugin.ts, lifecycle-service.ts. Holds for the objects it names. Read path by path:

  • The global override. reapSealed resolves each window through effectiveWindowMs with the leg's own policy (retention for maxAge, ttl for expireAfter), and the floor is registered under the same policy at the declared value. An override below it falls back to the declaration, and appliedLiteral then hands the expiry the declared literal.
  • A tenant override. The same call, one scope down; its fallback is the global window already resolved through the floor. So both arms of the tenant rule (an organization's own window on its own chain, the longest window on every other chain) choose among values none of which is below the declaration.
  • A longer override. Applies, and is the value signed. The floor is a minimum, and the service takes the strictest floor registered, so another registrar's floor on the same object still holds.
  • An archiving sealed object. Left alone, correctly (① 2).
  • A window that does not parse. No floor; the service cannot apply that window either and reports the object itself.

The bound this buys: no sealed row expires under a window shorter than the one its object declares.

Fail closed, where the host cannot register a floor: right. The alternative is an expiry that runs with the rule unenforced, and the cost of the choice made is rows kept, said at error with the fix.

The refresh: right. beforePass runs first in runPass, before the plans are read and before any early return, so a process refreshes on every pass whether or not it takes the lock, at most five minutes apart. An object the registry gains has its floor before the first pass that can seal it, and until a checkpoint exists nothing of it can expire. A shortened declaration replaces its floor (same key). A lengthened one is followed from the next pass; until then the old floor holds, which admits nothing the old declaration did not already admit. A failing beforePass does not stop the pass and is reported at error, by cause.

The pins. Over a real LifecycleService and the plugin's own registration, with the expiry spied: a global and a tenant override below the declaration yield a request for the declared value on both, a longer tenant window kept, two floorViolations and the error line; a longer global override is what the expiry is asked for; a lengthened declaration is the floor after one runPass; a service without floors gets no expiry. Each is decided by the line it names. Nothing was run here.

S7 (should-fix) — the changeset (the new Clause-② arm and the new BREAKING bullet), content/docs/data-modeling/objects.mdx, and the PR body (its Clause-② arm, the 维护者速读 bullet and the acceptance note): each says an override below the declared window is rejected on "a sealed object" or "an object that declares lifecycle.seal". The code does that only where the object declares no archive. On an archiving sealed object no floor is registered, and an override of retention.maxAge below the declaration still applies, exactly as on 18.6.0: it moves rows to the archive sooner, nothing is rejected and nothing is reported. sys_audit_log is such an object and the only sealed one every deployment has, and the same Clause-② sentence opens on it, so an operator holding a shorter sys_audit_log override reads a break and a fix ("remove the override or raise it") that do not apply, and following it changes when their audit rows leave the hot store. A declared narrowing has to be the one the code makes. The changeset's own body bullet and the PR body's file notes already say "lifecycle.seal and no archive"; these sentences need the same qualifier, and objects.mdx one clause on what the override still does on an archiving object. No code moves. The .describe() sentence stands: its paragraph is about the window sealed rows leave under.

No must-fix.

sealer.ts. beforePass is an option of an unexported class, called once per pass inside its own try. Holds.

object.zod.ts. n14: closed. The description, both tables of the reference page, objects.mdx and the changeset's tenant bullet now say a tenant window is set on organization_id, applies to an organization's own chain only where chainField is organization_id, and that the default tenant_id chain keeps to the longest window.

lifecycle-service.ts, expiry.ts, signer.ts, verifier.ts, index.ts, sys-audit-log.object.ts, packages/verify/src/harness.ts. Untouched by the delta; they stand as judged.

Nits:

  • n15 — audit-plugin.ts: the rule holds by registration, and one branch does not hold it. If a refresh throws, the expiry stays registered and the line it logs says an override may shorten the window until a refresh succeeds; a throw on one object also skips the objects after it in that call. Nothing shipped can throw there (the floors are built from parsed positive windows and a constant registrar), so no composition in the repo reaches it. A check in the expiry itself, against the declaration the registry already holds, would keep the rule without depending on registration at all. A follow-up.
  • n16 — retention-floor.ts, lifecycle-service.ts: a floor is never taken back. After seal is dropped, or archive added, the last floor stays until restart: an override below it is rejected with a line naming a seal the object no longer declares, and a declaration then shortened below it is reported as a floor violation on every sweep while it still applies. Taking a floor back needs a disposer on a public method, so it is its own card.
  • n11, n12, n13 — untouched by this delta; they stand for the follow-up card.

What is left before ACCEPT. On the tree: S7, prose in the changeset and objects.mdx, and the same in the PR body. The seat's own acts: the floor's ruling of record on the card (③), the L1 call on the dogfood battery, the approval a declared narrowing takes, and this head's CI to finish.

Implemented-by: claude/project-thread-vslp7g
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

…adata

An object created at runtime (a tenant-authored definition) keeps the
row-cutoff retention sweep: the lifecycle service does not route it to
the sealed expiry, AuditPlugin registers no retention floor for it, and
the sealer's expiry answers no run for it. Docs and changeset say the
override floor applies to sealed objects with no archive.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 05e6a57937f630c437490c20d47f292cdae822a7
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts + packages/objectql/src/lifecycle/lifecycle-service.ts, packages/objectql/src/index.ts, packages/plugins/plugin-audit/src/audit-seal/expiry.ts, packages/plugins/plugin-audit/src/audit-seal/retention-floor.ts, packages/plugins/plugin-audit/src/audit-seal/sealer.ts, packages/plugins/plugin-audit/src/audit-seal/signer.ts, packages/plugins/plugin-audit/src/audit-seal/verifier.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts, packages/verify/src/harness.ts

Delta record, round 6 (record 7209130288: PASS at 71bb12a9, S7 open, n14 closed, nits n11 to n13, n15, n16). Inputs: card #31908 (body and all 67 comments, seat ruling 7209154881 the newest), the five earlier records on this PR, PR #37605 (body as replaced for this head, 39 files), the delta 71bb12a9..05e6a579 read in full (one commit, 9 files), the dev thread's reply as claims to test, and the head's check-runs, read 2026-11-27T05:36Z: 74 runs, 62 success, 12 skipped, none failed or pending; both Check Changeset runs are success. Nothing was built or run. The rest of the diff (tests, the changeset's prose, the docs pages) is the lane seat's ACCEPT at TIER_DEFAULT; the new pins were read only to see what each one pins, and each changed sentence of the changeset, the two docs faces and the PR body was read against the code.

① Derived judgments

The items of the five earlier records stand as judged there. What this delta changes:

  1. Signed expiry now covers a sealed object only when its definition is not tenant-authored. The test is the registry's existing one (isTenantAuthored, @objectstack/metadata-core: ADR-0010 _provenance: 'org'), asked in three places: the lifecycle service's routing (expiresSealed, on the row-cutoff leg and on the archive's keep leg), the floors (sealedWindowFloors), and the sealer's own expiry (SealPlan.signedExpiry). Right: point 2 of ruling 7209154881, and the three agree, so no object can be asked for an expiry it has no floor for.
  2. A sealed object created at runtime takes the path main gives it: its rows leave at their row cutoff with a settings override applied, an archiving one is pruned from the archive at keep by the store's own delete, no seal-expiry-pending skip is reported and nothing is said at warn. Checked against main, whose lifecycle service has no branch for a sealed object. The sealer still seals such an object, as on main. Right.
  3. The resolved definition is what both readers take: the sweep reads getAllStorageObjects, the sealer and the floors read getAllObjects, and the registry keeps the base layer's provenance on both. A tenant layer over a packaged object is the base (ADR-0029 D9.2), so an object first created at runtime and later shipped by a package stays outside signed expiry while its stored definition stands. Right: its lifecycle is still the stored one. A definition registered from code with no provenance counts as packaged.
  4. Public surface: none moves. expiresSealed is a module function, SealPlan is internal, and @objectstack/metadata-core is already a dependency of both packages. registerExpiryPrefix changes by jsdoc alone.
  5. The lifecycle.seal .describe() gains one sentence: prose only, no accept-set change, the reference page regenerated in both tables with the same text. Acceptable as a change; what it says is S9.

② Semver level

The level stands: four packages at minor, Clause-②: yes (narrowing), Metadata-protocol: semantic, one ADR-0087 marker, Skills-docs: follow-up owed.

The scope makes the declared narrowing smaller, never larger: the override arm and the Metadata-protocol line now name objects sealed in packaged metadata, which is what the code does, and a runtime-created object keeps the 18.6.0 sweep. One sentence then says more than that (S8).

③ Boundary flags

  • The ruling of record. Answered: 7209154881 carries both rules on the card, with their costs. One line of it for the seat to tighten: point 2 says this PR "changes nothing" for an object created at runtime. That holds for the sweep. The os audit verify arms of this PR are judged per chain of every sealed object, whoever authored it (S8).
  • Claim surface. The delta's 9 paths were all claimed before it: the lifecycle and audit-seal trees with their tests, the spec description with its reference page, objects.mdx, the changeset. No new file, none outside.
  • The skills follow-up. The second PR now owes skills/objectstack-data/rules/lifecycle.md three things: the floor rule with "and no archive", the scope, and, for an object created at runtime, the sentence it still carries today (the sweeper deletes sealed rows, which then read as missing), kept for that case only.
  • The follow-up card. Extending signed expiry to objects created at runtime is the seat's card at ACCEPT, as the ruling says. n15 and n16 belong beside it.
  • SQL push-down. Nothing to answer: the delta adds no read.
  • Dogfood battery, Tier, the D8 bound, Part of #31908. Unchanged. The body reports the battery at this head; its pinning stays the lane seat's L1 call. The size line (about 2,830) matches the platform's count.

④ Design judgment

The scope: lifecycle-service.ts, retention-floor.ts, sealer.ts. Holds.

  • The routing. reapObject sends an object to reapSealed only when expiresSealed holds, and archiveObject hands keep to the sealed expiry under the same test; otherwise both fall through to the code main runs. No other branch of the service reads seal.
  • The floors. No floor for a tenant-authored object, so its override applies and no rejection is reported: the service and the plugin cannot disagree about one object.
  • The sealer. expire answers no run for such an object before it resolves a seam or takes a lock. It is the second of two guards: the service never asks, and the sealer would not answer.
  • Moving between the two. An object that leaves signed expiry is swept by row cutoff from then on, and an object that enters it finds checkpoints whose rows may already be gone, which an expiry removes without deleting anything. Neither direction deletes a row early or signs for a row it did not judge.

The pins. lifecycle-service.sealed-expiry.test.ts: a retained and an archiving object stamped as created at runtime are swept by row cutoff, the archive pruned at keep, the expiry never asked, nothing skipped, nothing warned. audit-seal-retention-floor.test.ts: over a real LifecycleService and the plugin's own registration, a runtime object's 1d override applies with no rejection and no request, the same object stamped as packaged is floored and asked at the declared 30d, and the sealer's expire answers [] with the seam unresolved for the first and goes on for the second. Each is decided by the line it names. Nothing was run here.

S7: closed. "And no archive" is in the changeset's Clause-② arm, its BREAKING bullet and its design bullet, in objects.mdx with the sentence on what an override still does on an archiving object, and in the PR body's arm, 维护者速读 bullet and acceptance note. Each now says what the code does for sys_audit_log.

S8 (should-fix) — the changeset's Clause-② line and the PR body's (and the body's 维护者速读 bullet, "不在这次收窄范围内"): "An object created at runtime is outside every arm of this narrowing." It is outside the override arm and outside signed expiry. It is inside the os audit verify arms: the verifier judges every chain of every sealed object the same way, so a late row no checkpoint holds, in a window already sealed, exits 1 for an object created at runtime too, where 18.6.0 exited 0. An object created at runtime and sealed on 18.6.0 is among the objects that arm reaches, so the sentence tells its operator that nothing narrowed when one thing did. Say what it is outside of: the override arm and signed expiry. Two neighbours in the changeset want the same care while it is open: the BREAKING bullet states the floor rule for "a sealed object with no archive" without the scope its own Clause-② arm carries, and in "Sealed rows leave only by whole checkpoints" the phrase "a row of such an object" follows the runtime sentence, so it reads as the opposite of what is meant. No code moves.

S9 (should-fix) — object.zod.ts .describe() (and so both tables of the reference page) and objects.mdx: the new sentence says an object created at runtime "keeps the retention sweep" and stops. What the description on main tells an author is the consequence: the sweeper deletes sealed rows, "which then read as missing". That is still true for exactly these objects, and it is the fact an author needs before putting seal beside retention on an object created at runtime: os audit verify fails once the window passes. The lifecycle service's own notice in this PR already says a row deleted by a row cutoff reads as missing. One clause restores it. In the description the order also misleads: "an object created at runtime keeps the retention sweep. A retention override cannot shorten the declared window." reads the second sentence onto the first's object, where an override does shorten. Put the override sentence with the packaged case. The first half of the seat's sentence without "a separate card" is the right cut for both faces. Prose only; the page regenerates.

No must-fix.

object.zod.ts. Judged above (① 5, S9). Nothing else in the file moves.

expiry.ts, signer.ts, verifier.ts, audit-plugin.ts, index.ts, sys-audit-log.object.ts, packages/verify/src/harness.ts. Untouched by the delta; they stand as judged.

Nits:

  • n17 — lifecycle-service.ts: expiresSealed and its jsdoc are inserted between appliedLiteral and appliedLiteral's own jsdoc, which now sits above the wrong function.
  • n18 — the three pins stamp the provenance on a hand-built definition. None saves a sealed definition through the metadata door and sweeps it, so the path from a stored definition to the row-cutoff sweep runs in no test of this PR. The real-kernel SQLite run is the place; a follow-up pin.
  • n19 — objects.mdx and the changeset's design bullet say "today's retention sweep". A docs page outlives the day; "the row-cutoff retention sweep" says it.
  • n20 — PR body, acceptance notes: "To keep rows for less time, shorten the window the object declares." now ends the bullet on objects created at runtime, where an override does that; it belongs to the bullet above it.
  • n11, n12, n13, n15, n16 — untouched by this delta; they stand for the follow-up card.

What is left before ACCEPT. On the tree: S8 and S9, prose in the changeset, the description with its regenerated page, and objects.mdx; the PR body follows. The seat's own acts: the one line of ruling 7209154881 (③), the L1 call on the dogfood battery, the approval a declared narrowing takes.

Implemented-by: claude/project-thread-vslp7g
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

…; round-6 wording

One predicate, takesSignedExpiry, decides whether a sealed object takes the
signed expiry and its retention floor: the lifecycle routing, the audit floors
and the sealer's own expiry all ask it. It answers yes only when the registry
places the object in packaged metadata; any other sealed object keeps the
row-cutoff retention sweep.

Docs, describe and changeset wording follow review 7210787318 (S8, S9, n17,
n19, n20).

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: ff14eb26ed32f4a34e684bfb3f810746d665940f
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts + packages/objectql/src/lifecycle/lifecycle-service.ts, packages/objectql/src/lifecycle/signed-expiry-scope.ts, packages/objectql/src/index.ts, packages/plugins/plugin-audit/src/audit-seal/expiry.ts, packages/plugins/plugin-audit/src/audit-seal/retention-floor.ts, packages/plugins/plugin-audit/src/audit-seal/sealer.ts, packages/plugins/plugin-audit/src/audit-seal/signer.ts, packages/plugins/plugin-audit/src/audit-seal/verifier.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts, packages/verify/src/harness.ts

Delta record, round 7 (record 7210787318: PASS at 05e6a579, S8 and S9 open, nits n17 to n20). Inputs: card #31908 (body and all 68 comments, seat correction 7210805783 the newest), the six earlier records on this PR, PR #37605 (body as replaced for this head, 41 files), the delta 05e6a579..ff14eb26 read in full (one commit, 14 files), the dev thread's reply as claims to test, and the head's check-runs, read 2026-11-27T07:52Z: 74 runs, 62 success, 12 skipped, none failed or pending; both Check Changeset runs and both Check PR Size runs are success. Nothing was built or run. signed-expiry-scope.ts joins the scope: it is the rule the three callers now ask. The rest of the diff (tests, the changeset's prose, the docs pages) is the lane seat's ACCEPT at TIER_DEFAULT; the new pins were read only to see what each one pins, and each changed sentence of the changeset, the two docs faces and the PR body was read against the code.

① Derived judgments

The items of the six earlier records stand as judged there. What this delta changes:

  1. Which sealed objects take the signed expiry is now one predicate, takesSignedExpiry(registry, object), and its answer is yes only on a positive answer from the registry: the resolved definition is not tenant-authored, and its owner is the code-shipped contributor of an installed package whose source is code or marketplace, or an owner with no package at all. Everything else answers no: a tenant-authored definition, an owner under a package id that no installed package answers, an authored or unknown source, and a registry that cannot be asked. Right, and the right default: an object the registry cannot place keeps the 18.6.0 row-cutoff sweep, so a wrong answer costs the new expiry and never signs one.
  2. The lifecycle routing (expiresSealed, both legs), the floors (sealedWindowFloors) and the sealer's own expiry (SealPlan.signedExpiry) each call that predicate with the registry they already read their objects from. The three cannot disagree on one object, and if two processes' registries did, the sealer's own answer still stands between a request and a signed run.
  3. sys_audit_log is placed: the audit plugin registers it through the manifest service, which installs com.objectstack.audit from code. The real-kernel SQLite run still expires it by whole checkpoints, and its shards are success on this head.
  4. Public surface, widened and declared: @objectstack/objectql exports takesSignedExpiry and the type SignedExpiryRegistryLike, and LifecycleEngineLike.registry gains three optional reads (getPackagedObjectOwner, getObjectOwner, getPackage). Optional, so every existing implementer still type-checks. The consequence for a library caller: a LifecycleService handed a registry without those reads gives every sealed object the 18.6.0 sweep. That is 18.6.0's behaviour, so nothing narrows against it.
  5. sealedWindowFloors and registerSealedWindowFloors take the registry where they took a list. Neither is exported from the package.
  6. The lifecycle.seal .describe() paragraph is reordered and gains one clause: prose only, no accept-set change, the reference page regenerated in both tables with the same text.

② Semver level

The level stands: four packages at minor, Clause-②: yes (narrowing), Metadata-protocol: semantic, one ADR-0087 marker, Skills-docs: follow-up owed.

The widened list now names the predicate, its type and the three optional reads, which is all the delta adds to the surface. The narrowed list changes by wording alone (S8), and the positive default makes the set of objects the override arm reaches smaller, never larger.

③ Boundary flags

  • The ruling of record. Answered for S8: correction 7210805783 tightens point 2 of 7209154881 as record 7210787318 asked. One reading for the seat to put on the card: the ruling says "declared in packaged metadata", and the tree reads that as "owned by an installed package whose source is code or marketplace", with every other sealed object on the 18.6.0 sweep. Its cost is n21. A sentence of record would let the predicate's jsdoc cite it; it does not move the head.
  • Size. The platform counts 2,935 additions and 61 deletions over 41 files: 2,996 changed lines, under 3,000 by four. Check PR Size is success. Any further edit to this head has to stay inside the lines it already changes.
  • Claim surface. All 14 paths of the delta are claimed: the two new files sit under packages/objectql/src/lifecycle/**, packages/objectql/src/index.ts is in the surface since the correction in 7202915675, and the rest was claimed before this delta. No file outside.
  • Citations. The scope now cites ruling 7209154881 (and 7210805783) alone, in the body and in the test list.
  • The skills follow-up and the follow-up card. As in record 7210787318; the skills page should take the wording this head settles on.
  • SQL push-down. Nothing to answer: the delta adds no read. The predicate asks the registry in memory.
  • Dogfood battery, Tier, the D8 bound, Part of #31908. Unchanged. The body reports the battery at this head; its pinning stays the lane seat's L1 call.

④ Design judgment

The predicate: signed-expiry-scope.ts, and its callers in lifecycle-service.ts, retention-floor.ts, sealer.ts. Holds.

  • Read against the registry it asks. getPackagedObjectOwner answers only for a code-shipped own contributor, resolving the name as getObject does; getPackage answers the installed package with the source its installer stated, which the registry records and never infers. A package installed through the protocol's own install is authored, so the source test puts it outside.
  • A tenant layer over a packaged owner still reads as tenant-authored on the resolved definition (ADR-0029 D9.2), which the first test catches before the owner is asked.
  • The no-package branch (an owner with no package id) is what a hand-built registry in a test presents. The engine's own registerObject defaults a package id, so in a composed kernel the answer is yes only through an installed package (n21).
  • Nothing else in the three callers moved: the routing's two legs, the floor windows and the sealer's early return are as judged in record 7210787318.

The pins. signed-expiry-scope.test.ts: no for a registry that cannot be asked, yes for code and marketplace, no for authored and for no installed package, yes for an owner with no package, no for a tenant-authored definition or owner. lifecycle-service.sealed-expiry.test.ts, on a real SchemaRegistry: a definition registered under a package id with no installed package, one under a key that names no package, and one under an authored install are each swept by row cutoff and ask no expiry; under a code and under a marketplace install the same definition asks retention.maxAge. audit-seal-retention-floor.test.ts: an owner under a package id no installed package answers takes no floor and no expiry, its 1d override applies, and the packaged object beside it is still floored and asked at 30d. Each is decided by the line it names, so the tree supports the two ablations the body reports (the source test, and the default when the registry cannot answer). Nothing was run here.

S8: closed. The Clause-② line, in the changeset and in the body, says an object created at runtime is outside the override arm and outside signed expiry, keeps the 18.6.0 row-cutoff sweep with its override applied, and that the os audit verify arms hold for it as for any sealed object; the 维护者速读 bullet says the same. The BREAKING bullet names the packaged scope. The design bullet's sentence now names its object ("a sealed object whose lifecycle is declared in packaged metadata").

S9: closed. The description, both tables of the reference page and objects.mdx say that on an object created at runtime the retention sweeper still deletes sealed rows at their row cutoff, "which then read as missing", and the override sentence now sits with the packaged case ("on such an object with no archive").

No must-fix, no should-fix.

object.zod.ts. Judged above (① 6, S9). The paragraph now reads in one order: what signed expiry covers, what it does there, what an object created at runtime gets.

index.ts. Two export lines, declared (②).

expiry.ts, signer.ts, verifier.ts, audit-plugin.ts (one call site), sys-audit-log.object.ts, packages/verify/src/harness.ts. Unchanged in substance; they stand as judged.

Nits:

  • n17: closed. appliedLiteral has its jsdoc back.
  • n19: closed. "Today's" is gone from the changeset, objects.mdx and the test comment.
  • n20: closed. The acceptance note on objects created at runtime no longer ends with the floor's remedy.
  • n18 — stands in a smaller form. The new pin places definitions on a real SchemaRegistry; none yet saves a sealed definition through the metadata door on a real kernel and sweeps it. For the follow-up card.
  • n21 — the description, objects.mdx and the changeset name two cases, "declared in packaged metadata" and "created at runtime". The predicate leaves a third on the row-cutoff sweep: an object registered from code under a package id that no installed code or marketplace package answers, which is what ObjectQL.registerObject gives by default. It is 18.6.0's behaviour and the safe side, and such an object's deleted rows read as missing exactly as the runtime sentence says. "Any other sealed object" in place of "an object created at runtime" would cover it; with four lines of size left, the skills PR or the follow-up card can carry it.
  • n11, n12, n13, n15, n16 — untouched by this delta; they stand for the follow-up card.

What is left before ACCEPT. On the tree: nothing. The seat's own acts: the one sentence of record on how "packaged metadata" is read (③), the L1 call on the dogfood battery, and the approval a declared narrowing takes.

Implemented-by: claude/project-thread-vslp7g
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

An owner under a package id that no installed code or marketplace package
answers keeps the row-cutoff sweep, and takes no floor and no expiry.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 2a45517cfa6d738d31cd3b8278b43d3444be6f86
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts + packages/objectql/src/lifecycle/lifecycle-service.ts, packages/objectql/src/lifecycle/signed-expiry-scope.ts, packages/objectql/src/index.ts, packages/plugins/plugin-audit/src/audit-seal/expiry.ts, packages/plugins/plugin-audit/src/audit-seal/retention-floor.ts, packages/plugins/plugin-audit/src/audit-seal/sealer.ts, packages/plugins/plugin-audit/src/audit-seal/signer.ts, packages/plugins/plugin-audit/src/audit-seal/verifier.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts, packages/verify/src/harness.ts

Delta record, round 8 (record 7212916843: PASS at ff14eb26, no must-fix, no should-fix). Inputs: the delta ff14eb26..2a45517c read in full (one commit, 2 files, 2 lines added and 3 removed), card #31908 (69 comments, the seat's reading of record 7212989029 the newest), and the head's check-runs, read 2026-11-27T08:34Z: 70 runs, 60 success, 10 skipped, none failed or pending; Check Changeset and Check PR Size are success. Nothing was built or run.

① Derived judgments

Nothing to derive. The delta rewrites one comment in each of two test files, lifecycle-service.sealed-expiry.test.ts and audit-seal-retention-floor.test.ts, so that each states the rule its test pins: an owner under a package id that no installed code or marketplace package answers keeps the row-cutoff sweep, and takes no floor and no expiry. No source file, no assertion, no fixture and no test title moves, and no file in the scope above is touched. Every judgment of record 7212916843 stands at this head.

② Semver level

Unchanged and it stands: four packages at minor, Clause-②: yes (narrowing), Metadata-protocol: semantic, one ADR-0087 marker, Skills-docs: follow-up owed. A comment changes no surface.

③ Boundary flags

  • The reading of record. Answered: 7212989029 puts on the card how "declared in packaged metadata" is read (owned by an installed package whose source is code or marketplace, and not tenant-authored), with n21 as its cost. It is what takesSignedExpiry does.
  • Size. The platform counts 2,934 additions and 61 deletions over 41 files: 2,995 changed lines, under 3,000.
  • Claim surface. Both paths were claimed before this delta. No file outside.
  • Everything else. As in record 7212916843.

④ Design judgment

The two comments now say what the pins beneath them decide, in the words of the predicate's own jsdoc. Holds.

No must-fix, no should-fix.

Nits, carried as they stand:

  • n18 — no pin yet saves a sealed definition through the metadata door on a real kernel and sweeps it. For the follow-up card.
  • n21 — the description, objects.mdx and the changeset name two cases; an object registered from code under a package id no installed code or marketplace package answers is the third, on the row-cutoff sweep. The reading of record assigns the wording to the follow-up card.
  • n11, n12, n13, n15, n16 — untouched; they stand for the follow-up card.

What is left before ACCEPT. On the tree: nothing. The seat's own acts: the L1 call on the dogfood battery, and the approval a declared narrowing takes.

Implemented-by: claude/project-thread-vslp7g
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head 2a45517 · card #31908 · area s2-data · 2026-11-27T09:16Z

L1 checklist

Tier: H. Landing: hand-off to the maintainer follows this record.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Tier H hand-off · 2026-11-27T09:17Z · head 2a45517 · approver os-zhuang

维护者速读

@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 27, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 27, 2026 09:21
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 0296d97 Nov 27, 2026
80 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-vslp7g branch November 27, 2026 09:52
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 domain:server Domain lane — seat card indexed by label:pm:seat pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue 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.

3 participants