Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d41ddf5
test(plugin-audit): pin the late re-read, the lost-sequence seed drop…
claude Nov 14, 2026
88a4abc
fix(plugin-audit): admit and open each checkpoint once per redaction …
claude Nov 14, 2026
3bcc332
docs(spec): the plugin-audit group of the platform object names says …
claude Nov 14, 2026
5ada48f
test(plugin-audit): pin per-chain sealer isolation: a chain-local fau…
claude Nov 14, 2026
14873e9
fix(plugin-audit): isolate sealer faults per chain: a chain-local fau…
claude Nov 14, 2026
03a059d
test(plugin-audit): pin a host handing an app-composed AuditPlugin it…
claude Nov 14, 2026
a065011
feat(plugin-audit): AuditPlugin.adoptHostCryptoProvider takes a host'…
claude Nov 14, 2026
e1b0acc
test(cli): pin os serve handing its crypto provider to an app-supplie…
claude Nov 14, 2026
574c27c
fix(cli): os serve hands its crypto provider to an app-supplied Audit…
claude Nov 14, 2026
812588a
chore(changeset): plugin-audit and cli patch for per-chain sealer iso…
claude Nov 14, 2026
4cbd2fc
fix(plugin-audit): the skipped-chain report claims only what the seal…
claude Nov 14, 2026
22d4da3
test(plugin-audit): pin the window-major pass and that a lagging chai…
claude Nov 14, 2026
4412d2f
Merge origin/main into claude/area-A2-31908-p4b1 (P4a landed)
claude Nov 15, 2026
4827322
test(plugin-audit): pin bounded checkpoint parts, the duplicate-listi…
claude Nov 15, 2026
b080e65
feat(plugin-audit): seal a window into consecutive checkpoints of at …
claude Nov 15, 2026
0dd58a8
fix(plugin-audit): a checkpoint written before the parts amendment re…
claude Nov 15, 2026
b189644
test(plugin-audit): pin the part cut across a tie, rows that go betwe…
claude Nov 15, 2026
faadaaa
Merge remote-tracking branch 'origin/main' into claude/area-A2-31908-…
claude Nov 15, 2026
e930216
test(plugin-audit): the re-seal pin's precondition is that the cap ho…
claude Nov 15, 2026
6bb7f49
fix(plugin-audit): the idle cap counts only while a chain is skipped,…
claude Nov 15, 2026
ff13294
docs(changeset): P4b2 declares Clause-② yes (narrowing) with the BREA…
claude Nov 15, 2026
60960cd
Merge origin/main into claude/area-A2-31908-p4b2
claude Nov 15, 2026
f08afca
docs(audit): an hour seals into checkpoints of at most 10,000 rows, v…
claude Nov 15, 2026
b234eee
test(plugin-audit): state a 30 s budget on the three stalled-chain re…
claude Nov 15, 2026
59ad96d
Merge origin/main into claude/area-A2-31908-p4b2
claude Nov 15, 2026
5ef334e
docs(changeset): name the two skills/objectstack-data files a follow-…
claude Nov 15, 2026
55dfebc
docs(changeset): name follow-up #33773 in the P4b2 Skills-docs line
claude Nov 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .changeset/31908-p4b2-bounded-checkpoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@objectstack/plugin-audit': patch
---

fix(plugin-audit)!: the audit sealer seals a window into checkpoints of at most 10,000 rows each, `os audit verify` fails on a row two checkpoints list, and a pass bounds what it re-reads while a chain stays skipped

Clause-②: yes (narrowing) — narrowed: `os audit verify` reports a row id that two checkpoints list as the new chain fault `listed_twice` and fails the run, where the 18.4.0 verifier accepted it, and the 18.4.0 sealer could write such a chain when two of its late sealings overlapped. Widened: the checkpoint's signed body gains two optional fields, `part_index` and `final_part`; `sys_audit_checkpoint` gains two nullable columns for them; and the exported `AuditChainFaultKind` union gains `listed_twice`.
Metadata-protocol: none
Skills-docs: follow-up #33773 — skills/objectstack-data/evals/objects-fields-relationships.json, skills/objectstack-data/rules/lifecycle.md — both still teach that the sealer signs each `created_at` hour into one checkpoint per organization, where this change cuts a window into checkpoints of at most 10,000 rows each (the eval's graded `expected_output`, and `lifecycle.md` § Sealing); the card also carries their older stale claim that no verifier exists, which `os audit verify` already contradicts. `skills/**` is changed only on a `domain:skills` PR, so this one does not edit them; `content/docs/data-modeling/objects.mdx` and `content/docs/deployment/cli.mdx` gain the parts, the new fault and what a removed checkpoint shows in this change.

<!-- adr-0087: not-required (no-migration-prescription) No schema key, accepted value or metadata type is added, removed or renamed: the moved answer is a verify verdict over stored audit checkpoints, which no metadata author writes. Nothing stored is rewritten and no tolerance or repair is shipped, so a chain sealed by 18.4.0 with overlapping late sealers now reports listed_twice. -->

**BREAKING** for `os audit verify` on a chain that an 18.4.0 sealer wrote while two of its late sealings overlapped (two replicas with no cluster service, whose lock is in-process only, or a lease that lapsed). Such a chain lists one late row in two checkpoints. Verify now reports it as a `listed_twice` fault and fails, where it passed. No tolerance and no repair ships for it. A chain one sealer wrote at a time is not affected.

**Bounded checkpoints (ADR-0154 D4, as amended 2026-11-14).** A chain's rows of one window now seal into consecutive checkpoints of at most 10,000 rows each, cut in `(created_at, id)` order, instead of one checkpoint however many rows the window holds. Each checkpoint has its own seed. Its signed body carries two new fields, `part_index` (from 0) and `final_part`, and `sys_audit_checkpoint` stores them in two new nullable columns. A pass that stops in the middle of a window resumes it on the next pass as further `window` checkpoints, never as `late` ones. Late rows split into checkpoints of at most 10,000 rows the same way. The work and memory of one checkpoint no longer grow with the window. A checkpoint written before this release has neither field. It still verifies, reads as one final part, and its chain goes on. `part_index` can skip a number, and a window can end with no final part: a part whose rows were all deleted or moved between the sealer's two reads of the window is not written.

**`os audit verify`.** A row id that two checkpoints list is now a fault of the new kind `listed_twice`, and the run fails. The second listing holds nothing for that row. Verify does not check that a window's parts are continuous or that it ends in a final part. The chain links show a removed interior part, as a `gap` or a `link` fault. They do not show a removed newest part; that part's rows read as late and unsealed instead.

**Skipped chains.** While a chain stays skipped by a chain-local fault, it holds back the sealed-through watermark, so each pass walked every window from there and re-read all of them. Now, while a chain is skipped, a pass walks at most 168 windows that seal nothing (one late horizon) and then stops. When it stops, the sealer says so at `error`, naming the skipped chains. Once no chain is skipped, the walk is not cut, so sealing catches up whether the chain's fault was fixed or the chain has nothing left to seal.

**Upgrading is one way once this release writes a checkpoint.** An 18.4.0 reader does not know `part_index` and `final_part`. The 18.4.0 verifier drops them and then fails the signature of every checkpoint that carries them. An 18.4.0 sealer computes the chain head's digest without them, so the checkpoint it writes next is a `link` fault. Roll back to 18.4.0 only before this release seals its first checkpoint. A host's checkpoint sink receives the two fields in each body.
8 changes: 5 additions & 3 deletions content/docs/data-modeling/objects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,11 @@ lifecycle: {
}
```

- Each hour of `created_at` is sealed ten minutes after it ends: one
checkpoint per organization (and one for rows about no organization),
holding a Merkle root over the rows, signed with the deployment's Ed25519
- Each hour of `created_at` is sealed ten minutes after it ends, per
organization (and once for rows about no organization): into one
checkpoint, or, when the hour holds more than 10,000 such rows, into
consecutive checkpoints of at most 10,000 rows each. Each checkpoint holds a
Merkle root over its rows and is signed with the deployment's Ed25519
key. A row that arrives later in a sealed hour is sealed as a `late`
checkpoint; rows that already exist when sealing starts are sealed oldest
first, archived rows included.
Expand Down
11 changes: 9 additions & 2 deletions content/docs/deployment/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,12 @@ Each row a checkpoint lists reads as one of:
A row in a sealed window that no checkpoint lists is reported `late` and **unsealed**: on
the host alone it cannot be told from a forged insert.

A checkpoint removed from a chain shows as a gap in the chain's links, unless it was the
chain's newest: the links cannot see that one. Its rows then read `late` and unsealed
while their window still counts as sealed (another checkpoint of the object names that
window, or one's sealed-through passes it); otherwise the removal does not show. A row
that two checkpoints list is a fault of its own.

Trust comes only from the deployment's own signing key. A key is trusted only when its
wrapped private half opens with the crypto provider `os serve` seals with (the declaring
plugin's, or the existing data key from `OS_SECRET_KEY` or the persisted key file; this
Expand All @@ -811,8 +817,9 @@ Exit codes:

- **0**: every chain, link and signature verifies under a trusted key, and every row is
`unmodified`, `late` (sealed), `redacted` or `expired`. Also 0 when nothing is sealed.
- **1**: a row is `modified`, `missing` or `late` and unsealed, or a link or signature
fails. The report names every row that is not `unmodified` and every fault.
- **1**: a row is `modified`, `missing` or `late` and unsealed, a link or signature
fails, or two checkpoints list the same row. The report names every row that is not
`unmodified` and every fault.
- **2**: no verdict is given. The cause is one of these: a usage error, a stack that would
not boot, a crypto provider that cannot open what is sealed, an archive datasource a
sealed object declares that this run did not connect (every archived row would read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ describe('signed bodies (D4, D7, D8)', () => {
tenant_id: 'org_1',
sequence: 3,
kind: 'window',
part_index: 0,
final_part: true,
window_start: '2026-11-10T04:00:00.000Z',
window_end: '2026-11-10T05:00:00.000Z',
sealed_through: '2026-11-10T05:00:00.000Z',
Expand All @@ -279,6 +281,8 @@ describe('signed bodies (D4, D7, D8)', () => {
window_end: '2026-11-10 05:00:00',
sealed_at: Date.parse(body.sealed_at),
fencing_token: 17,
part_index: '0',
final_part: 1, // a driver with no boolean column hands back 1 / 0
};
const back = checkpointBodyFromRow(driverRow);
expect(back).toEqual(body);
Expand All @@ -304,6 +308,8 @@ describe('signed bodies (D4, D7, D8)', () => {
{ ...body, tenant_id: 'org_2' },
{ ...body, sealed_through: '2026-11-10T06:00:00.000Z' },
{ ...body, seed_handle: 'sec_other' },
{ ...body, part_index: 1 },
{ ...body, final_part: false },
]) {
expect(checkpointDigest(checkpointBodyFromRow(changed))).not.toBe(digest);
}
Expand All @@ -323,6 +329,10 @@ describe('signed bodies (D4, D7, D8)', () => {
{ ...body, columns: { clear: ['id', 'created_at'], committed: [] } },
{ ...body, columns: { clear: ['id'], committed: ['id'] } },
{ ...body, fencing_token: '-1' },
{ ...body, part_index: -1 },
{ ...body, part_index: undefined },
{ ...body, final_part: undefined },
{ ...body, final_part: 'yes' },
]) {
expect(() => checkpointBodyFromRow(bad as unknown as Record<string, unknown>), JSON.stringify(bad).slice(0, 80)).toThrow(SignedBodyError);
}
Expand Down Expand Up @@ -400,6 +410,8 @@ describe('the deployment chain signs a NULL organization (D5)', () => {
tenant_id: null,
sequence: 0,
kind: 'window',
part_index: 0,
final_part: true,
window_start: '2026-11-10T04:00:00.000Z',
window_end: '2026-11-10T05:00:00.000Z',
sealed_through: '2026-11-10T05:00:00.000Z',
Expand Down Expand Up @@ -467,7 +479,7 @@ describe('a redaction names its checkpoint by the signed sequence (D7)', () => {

it('declares one checkpoint column per stored field, the sequence a redaction refers to among them', () => {
const body: CheckpointSignedBody = {
sealed_object: 'sys_audit_log', tenant_id: null, sequence: 0, kind: 'window',
sealed_object: 'sys_audit_log', tenant_id: null, sequence: 0, kind: 'window', part_index: 0, final_part: true,
window_start: '2026-11-10T04:00:00.000Z', window_end: '2026-11-10T05:00:00.000Z',
sealed_through: '2026-11-10T05:00:00.000Z', leaf_count: 1, row_ids: ['r1'], root: 'a'.repeat(64),
previous_digest: null, columns: { clear: ['created_at', 'id'], committed: [] },
Expand All @@ -482,7 +494,7 @@ describe('a redaction names its checkpoint by the signed sequence (D7)', () => {

describe('NULL names the deployment chain only when it is stated (D5)', () => {
const checkpoint: CheckpointSignedBody = {
sealed_object: 'sys_audit_log', tenant_id: null, sequence: 0, kind: 'window',
sealed_object: 'sys_audit_log', tenant_id: null, sequence: 0, kind: 'window', part_index: 0, final_part: true,
window_start: '2026-11-10T04:00:00.000Z', window_end: '2026-11-10T05:00:00.000Z',
sealed_through: '2026-11-10T05:00:00.000Z', leaf_count: 1, row_ids: ['r1'], root: 'a'.repeat(64),
previous_digest: null, columns: { clear: ['created_at', 'id'], committed: [] },
Expand Down Expand Up @@ -530,6 +542,8 @@ describe('the leaf hashes beside a checkpoint are trusted only through its signe
tenant_id: 'org_1',
sequence: 0,
kind: 'window',
part_index: 0,
final_part: true,
window_start: '2026-11-10T04:00:00.000Z',
window_end: '2026-11-10T05:00:00.000Z',
sealed_through: '2026-11-10T05:00:00.000Z',
Expand Down
Loading
Loading