Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
fa6e67e
refactor(fleet-control): isolate the Wrangler CLI behind a PlainWorke…
gcharang Aug 26, 2026
cfcd24c
refactor(fleet-control): extract the provider-neutral PlainWorkerBack…
gcharang Aug 26, 2026
bb9291c
feat(fleet-control): direct Cloudflare API ordinary-Worker backend
gcharang Aug 27, 2026
e3a6325
test(fleet-control): one conformance suite for both ordinary-Worker b…
gcharang Aug 27, 2026
b1fba20
refactor(fleet-control): extract the Cloudflare provider-error boundary
gcharang Aug 27, 2026
5ddb574
refactor(fleet-control): move the ordinary-Worker operations behind a…
gcharang Aug 27, 2026
daa7ef8
feat(fleet-control): D1 binding adapter for the fleet-state database …
gcharang Aug 28, 2026
9426faa
refactor(fleet-control): name the D1 adapter's shim and its validator
gcharang Aug 28, 2026
c49cec3
feat(fleet-control): stream database exports into R2 with a proven co…
gcharang Aug 28, 2026
6d80d6e
refactor(fleet-control): funnel synchronous R2 bucket throws like rej…
gcharang Aug 28, 2026
373798e
test(fleet-control): pin and regroup the synchronous bucket throw case
gcharang Aug 28, 2026
224421b
feat(fleet-control): optional name filter for D1 inventory listing
gcharang Aug 28, 2026
d96d8d5
test(fleet-control): assert the unfiltered D1 listing and derive its …
gcharang Aug 28, 2026
c5ae31d
refactor(fleet-control): extract the JSON field readers and tighten l…
gcharang Aug 28, 2026
280f539
chore(fleet-control): rewrap a header note and requalify two rule com…
gcharang Aug 29, 2026
6543c6f
fix(fleet-control): stop awaiting a tee branch cancel in export cleanup
gcharang Aug 29, 2026
267837a
chore(fleet-control): separate one test's setup and wrap a probe query
gcharang Aug 29, 2026
6c64d0d
test(fleet-control): fence the client and export port against back-edges
gcharang Aug 29, 2026
57dab7a
test(fleet-control): raise the controls harness spawn output limit
gcharang Aug 29, 2026
a086f24
fix(flowsafe): cap the flowsafe-provision Wrangler capture at 64 MiB
gcharang Aug 29, 2026
e59fe25
test(flowsafe): assert empty stderr on the oversized provisioning run
gcharang Aug 29, 2026
3c0ec09
fix(fleet-control): guard the R2 refusal's cancel against a sync throw
gcharang Aug 29, 2026
9695451
test(fleet-control): pin export cancel refusal identity
gcharang Aug 29, 2026
9e89be4
fix(fleet-control): harden R2 export settlement
gcharang Aug 29, 2026
deb7425
test(fleet-control): pin R2 put cancellation identity
gcharang Aug 29, 2026
f100ab3
fix(fleet-control): bound Worker attachment scans
gcharang Aug 29, 2026
bdec481
refactor(fleet-control): tighten attachment scan internals
gcharang Aug 29, 2026
936401b
feat(fleet-control): persist decommission operations
gcharang Aug 29, 2026
a14f808
refactor(fleet-control): clarify decommission state helpers
gcharang Aug 29, 2026
0003627
feat(fleet-control): add bounded attachment capability
gcharang Aug 29, 2026
5c6b4d7
docs(fleet-control): fix bounded scan wording
gcharang Aug 29, 2026
c5ad1c5
feat(fleet-control): add bounded decommission advance
gcharang Aug 30, 2026
3dea0bf
refactor(fleet-control): clarify decommission advance state
gcharang Aug 30, 2026
e31f39c
feat(fleet-control): add durable export receipts
gcharang Aug 30, 2026
eb71c3f
refactor(fleet-control): trim receipt publication input
gcharang Aug 30, 2026
36a4b7c
feat(fleet-control): complete bounded decommission
gcharang Aug 30, 2026
47f8e2a
refactor(fleet-control): trim decommission test state
gcharang Aug 30, 2026
ece0b77
refactor(fleet-control): extract decommission database choreography
gcharang Aug 30, 2026
5d28063
docs(fleet-control): mark decommission database helpers internal
gcharang Aug 30, 2026
7ef8fa1
feat(fleet-control): add bounded backend-switch teardown
gcharang Aug 30, 2026
d83aecb
refactor(fleet-control): reuse pending artifact inspection
gcharang Aug 30, 2026
a9d6d2c
docs: remove superseded repository documentation
gcharang Aug 31, 2026
facf2cd
feat(fleet-control): add durable cleanup state, receipts, and termina…
gcharang Aug 31, 2026
8ae28bf
feat(fleet-control): add bounded cleanup engine with rollback and inv…
gcharang Aug 31, 2026
09dfe69
docs(fleet-control): clarify eligibility re-check comment and receipt…
gcharang Aug 31, 2026
716b36f
feat(fleet-control): add account inventory run state and D1 run store
gcharang Aug 31, 2026
1c6f006
refactor(fleet-control): align inventory row helper and error names w…
gcharang Aug 31, 2026
362e331
test(fleet-control): freeze the fleet inventory drain golden baseline
gcharang Aug 31, 2026
0c3c7d3
chore(fleet-control): use pnpm exec for baseline formatting and note …
gcharang Aug 31, 2026
d2b387f
refactor(fleet-control): share the inventory bound refusal across pro…
gcharang Aug 31, 2026
2600c07
feat(fleet-control): add bounded account inventory and drain the shar…
gcharang Sep 1, 2026
82bfde1
feat(fleet-control): add the fleet-operation state machine, D1 operat…
gcharang Sep 1, 2026
f077217
refactor(fleet-control): apply the R4-A review nit ledger
gcharang Sep 1, 2026
9f3598b
refactor(fleet-control): close the R4-A nit ledger
gcharang Sep 1, 2026
64a7a12
test(fleet-control): freeze the golden audit baseline
gcharang Sep 1, 2026
1001eeb
refactor(fleet-control): apply the R4-B.1 review nit ledger
gcharang Sep 1, 2026
1c2ff4a
refactor(fleet-control): close the R4-B.1 nit ledger
gcharang Sep 1, 2026
d9f864f
feat(fleet-control): add the bounded fleet audit coordinator and extr…
gcharang Sep 2, 2026
39eb70f
test(fleet-control): give the package a 20 s test timeout and the D1 …
gcharang Sep 2, 2026
530ddaf
test(fleet-control): raise the D1 harness cap to 150 s, close the nit…
gcharang Sep 2, 2026
f04c122
test(fleet-control): close the nit ledger for the timeout comments
gcharang Sep 2, 2026
92922dd
refactor(fleet-control): apply the R4-B.2 source-side nit ledger
gcharang Sep 3, 2026
4990c0e
refactor(fleet-control): close the R4-B.2 N-A nit ledger
gcharang Sep 3, 2026
9613fb9
refactor(fleet-control): apply the R4-B.2 docs and architecture nit l…
gcharang Sep 3, 2026
75bb706
refactor(fleet-control): close the R4-B.2 N-B.1 nit ledger
gcharang Sep 3, 2026
2739c8e
refactor(fleet-control): close the second R4-B.2 N-B.1 nit ledger
gcharang Sep 3, 2026
fa50230
test(fleet-control): close the R4-B.2 N-B.2 test-side nit ledger
gcharang Sep 3, 2026
d9bfdee
fix(fleet-control): close the R4-A/B.1 QA claims in the operation store
gcharang Sep 3, 2026
a4a176e
test(fleet-control): freeze the migration drain in two golden baselines
gcharang Sep 4, 2026
00ef384
fix(fleet-control): a lost race in the operation store is a conflict
gcharang Sep 5, 2026
d5ff4ad
refactor(fleet-control): execute fleet migrations through frozen steps
gcharang Sep 5, 2026
d9c1e75
chore: upgrade Wrangler to 4.129.0
gcharang Sep 5, 2026
9111eb9
feat(fleet-control): add bounded migration coordinator core
gcharang Sep 5, 2026
e3edf87
feat(fleet-control): publish resumable fleet migration API
gcharang Sep 5, 2026
6bd8bfc
feat(flowsafe): version execution fence administration
gcharang Sep 5, 2026
996eec8
feat(flowsafe): add execution identity and binding representations
gcharang Sep 6, 2026
f8834a3
feat(flowsafe): add atomic initial workflow admission
gcharang Sep 6, 2026
c30ca44
feat(flowsafe): repair interrupted initial admissions without replay
gcharang Sep 6, 2026
1b0b52a
feat(flowsafe): capture trusted start authority before waits
gcharang Sep 7, 2026
fbc7855
fix(flowsafe): keep stored summaries on the selected workflow
gcharang Sep 7, 2026
a576c59
feat(flowsafe): add a single-observation execution reader
gcharang Sep 7, 2026
8a2850d
feat(flowsafe): stage exact reservation primitives
gcharang Sep 7, 2026
6029d15
feat(flowsafe): activate durable execution generations
gcharang Sep 8, 2026
0f328e9
refactor(flowsafe): resolve pending review cleanup
gcharang Sep 8, 2026
d068ad8
fix(fleet-control): preserve immutable operation progress
gcharang Sep 8, 2026
9b6134b
fix(fleet-control): preserve inventory identity and recovery
gcharang Sep 8, 2026
76026a9
fix(fleet-control): strengthen public architecture boundaries
gcharang Sep 8, 2026
0918ca8
test(fleet-control): make audit fixture failures and retries discrimi…
gcharang Sep 8, 2026
302e554
test(fleet-control): enforce migration fixture wiring and credential …
gcharang Sep 8, 2026
ef962d8
fix(tooling): make baseline recording explicit and preserve literal f…
gcharang Sep 8, 2026
eb41e0c
fix(flowsafe): retain exact run generations with durable scan progress
gcharang Sep 8, 2026
b74dcbe
test(flowsafe): clarify retention fixtures and simplify interception
gcharang Sep 8, 2026
1b92733
fix(flowsafe): guard schedule and initial run mutations with captured…
gcharang Sep 9, 2026
a027f13
fix(flowsafe): redact unexpected run-router errors and retain diagnos…
gcharang Sep 9, 2026
e79b92a
feat(flowsafe): carry run context and preserve scoped agent lookups
gcharang Sep 9, 2026
323c2ce
feat(flowsafe): validate signal targets and isolate audit failures
gcharang Sep 9, 2026
6301191
docs(flowsafe): reference shared route role defaults
gcharang Sep 9, 2026
647092e
feat(flowsafe): expose suspension deadline helpers
gcharang Sep 9, 2026
9de1217
docs(flowsafe): clarify timeout fixture and retry boundaries
gcharang Sep 9, 2026
37c0fee
feat(breakwater): classify connector decisions and isolate audit fail…
gcharang Sep 9, 2026
77e90e7
fix(fleet-control): use Worker-native hostname and crypto primitives
gcharang Sep 9, 2026
dcd8e77
feat(fleet-control): compose an internal Worker control plane
gcharang Sep 9, 2026
308bd39
feat(fleet-control): expose Worker control-plane entry
gcharang Sep 9, 2026
806512e
docs(fleet-control): document dedicated Worker operations
gcharang Sep 9, 2026
f10379b
fix(fleet-control): forward ordinary Worker subrequest limits
gcharang Sep 9, 2026
ef0a5e2
test(fleet-control): define direct conformance configuration
gcharang Sep 9, 2026
89c5277
test(fleet-control): prepare direct conformance artifacts
gcharang Sep 9, 2026
3c13571
feat(fleet-control): add direct tenant conformance artifacts
gcharang Sep 9, 2026
2fefade
test(fleet-control): define direct reference requests
gcharang Sep 9, 2026
5729f03
test(fleet-control): retain direct reference replay inputs
gcharang Sep 9, 2026
560db87
test(fleet-control): authenticate direct reference actions
gcharang Sep 9, 2026
25c976a
fix(fleet-control): preserve native fetch in bounded reference calls
gcharang Sep 9, 2026
2cdeed4
test(fleet-control): exercise durable reference inventory
gcharang Sep 9, 2026
6c493cf
test(fleet-control): retain reference resource and settlement identities
gcharang Sep 9, 2026
4f4da55
fix(fleet-control): encode Worker uploads for direct lifecycle
gcharang Sep 10, 2026
6b55190
fix(fleet-control): complete reference audit and migration actions
gcharang Sep 10, 2026
8c43533
fix(fleet-control): restore signed catalog maintenance and migration …
gcharang Sep 10, 2026
5cfffdd
fix(fleet-control): retire pending migration fields during force tear…
gcharang Sep 10, 2026
034348d
feat(fleet-control): add private force recovery witnesses and observa…
gcharang Sep 10, 2026
121dd63
fix(fleet-control): reject incomplete inventory absence proofs
gcharang Sep 10, 2026
d34ac7c
feat(fleet-control): add fixed reference tenant probes
gcharang Sep 10, 2026
9cc6c2c
feat(fleet-control): expose saved decommission export metadata
gcharang Sep 10, 2026
96cfeab
test(fleet-control): resolve export metadata review polish
gcharang Sep 10, 2026
0a09088
fix(fleet-control): require positive ingress observations
gcharang Sep 10, 2026
f593e66
feat(fleet-control): recover witnessed force residuals
gcharang Sep 10, 2026
75435e7
feat(fleet-control): build default direct conformance artifacts
gcharang Sep 10, 2026
ceab639
feat(fleet-control): persist direct invocation state
gcharang Sep 10, 2026
dd282de
fix(fleet-control): close staged Wrangler export streams
gcharang Sep 10, 2026
9dca232
feat(fleet-control): drive authenticated direct invocations
gcharang Sep 10, 2026
17f1a4e
feat(fleet-control): bootstrap owned direct reference infrastructure
gcharang Sep 10, 2026
c52edf4
feat(fleet-control): verify direct provider observations and exports
gcharang Sep 10, 2026
60b3ac8
feat(fleet-control): run the direct credentialed tenant scenario
gcharang Sep 11, 2026
4da50a4
docs(fleet-control): name the account permissions the credentialed to…
gcharang Sep 12, 2026
0f90bf7
fix(fleet-control): close the direct scenario review findings
gcharang Sep 12, 2026
4cb59a1
feat(flowsafe): bound notification delivery and patch Core source keys
gcharang Sep 12, 2026
7e8e267
fix(flowsafe): guard notification ingestion, declare D1 batch rows
gcharang Sep 12, 2026
21c20d2
test(flowsafe): give the deploy proof DO storage and a cursor owner
gcharang Sep 12, 2026
3f537a3
merge: integrate agent/worker-control-plane-c2 into dev
gcharang Sep 12, 2026
06e0da0
fix(fleet-control): map own specifiers to source, fix four stale suites
gcharang Sep 13, 2026
20acc6b
merge: integrate agent/worker-control-plane-f7 into dev
gcharang Sep 13, 2026
11334cf
feat(fleet-control): tear down the direct reference with exact receipts
gcharang Sep 13, 2026
8680bc0
test(fleet-control): force the preflight compiler failure at the seam
gcharang Sep 13, 2026
0b2520e
ci: size the verify job timeout to the full gate
gcharang Sep 13, 2026
469a354
feat(fleet-control): prove the execution fence in the direct scenario
gcharang Sep 13, 2026
73bde57
ci: run the direct scenario suites in their own job behind a verify gate
gcharang Sep 13, 2026
dc7ed23
feat(fleet-control): add the direct credentialed conformance CLI
gcharang Sep 13, 2026
ef6fec6
test(fleet-control): add the offline acceptance for the direct CLI
gcharang Sep 14, 2026
7eb450f
feat(breakwater): declare and audit connector egress posture
gcharang Sep 14, 2026
8b7f087
feat(breakwater): assert connector conformance against supplied cases
gcharang Sep 14, 2026
7a446d2
fix(fleet-control): accept live Cloudflare provisioning behaviour
gcharang Sep 15, 2026
c8c5039
feat(flowsafe): list not-yet-due pending notifications in the inventory
gcharang Sep 15, 2026
25fa879
fix(fleet-control): move the R2 jurisdictions and the SDK refusal check
gcharang Sep 15, 2026
28395fa
fix(fleet-control): attest ownership before every teardown dispatch
gcharang Sep 15, 2026
a534f63
feat(fleet-control): add migration abort signal and completion callback
gcharang Sep 15, 2026
621fda7
fix(fleet-control): refuse redirects on the credentialed transports
gcharang Sep 15, 2026
893c1e5
docs(threat-model): cover split traffic and route ambiguity
gcharang Sep 15, 2026
0e14950
fix(breakwater): build the conformance report for a foreign thrown value
gcharang Sep 15, 2026
8d1b1f1
fix(fleet-control): record single-page attestations and scan queues
gcharang Sep 15, 2026
f48a525
refactor(breakwater): point the conformance limit at one documented list
gcharang Sep 15, 2026
53902fa
test(fleet-control): prove cross-backend audit and 429/timeout refusal
gcharang Sep 15, 2026
ce0913c
feat(fleet-control): admit a retired terminal row as an absent prior
gcharang Sep 15, 2026
37c6d15
feat(fleet-control): prove routes and terminal force, record run cost
gcharang Sep 16, 2026
90bcbf5
chore: check root vitest projects and record the toolchain
gcharang Sep 16, 2026
7a7838e
ci: fail the verify gate on an empty needs context and cap the Test step
gcharang Sep 16, 2026
7fec4af
fix(breakwater): correct the conformance diagnostics and egress posture
gcharang Sep 16, 2026
6f54bc6
fix(flowsafe): require the purge cursor seam, probe both patch subjects
gcharang Sep 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 0 additions & 21 deletions .changeset/README.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/bounded-attachment-scans.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@proofoftech/fleet-control': patch
---

Harden account-wide D1 and R2 attachment scans with a request-bounded, page-independent resumable engine. Rechecked inventory drift, malformed provider metadata, non-string or repeated dispatch cursors, and page or item overflows now fail closed instead of allowing an incomplete absence proof.
14 changes: 14 additions & 0 deletions .changeset/bounded-cleanup-receipts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@proofoftech/fleet-control': minor
---

Add token-driven bounded no-export cleanup with durable operation-keyed terminal receipts. `advanceCleanupDeployment()` performs at most one bounded scan chunk or one action group per call; the terminal call persists an immutable receipt, releases the deployment's ownership claims, and deletes the fleet row in one D1 batch. Receipts survive same-key reprovisioning and force decommission; read them with `readCleanupReceipt()` and garbage-collect them explicitly with `pruneCleanupReceipts()` (database-time cutoff, stable order, limit 1..1,000). `cleanupDeploymentArtifacts()` and the default failed-provision rollback drain this engine on capable stacks.

- **BEHAVIOR CHANGE:** No-export cleanup is narrowed to deployments that provably never authorized a candidate invocation. New records persist an invocation-authority carrier on their first durable write, and every candidate-invoking dispatch (external candidate upload, first maintenance request, version override, promotion) commits an authorization timestamp durably before the provider call. Authorized rows, legacy carrier-less rows at `application-resources-deployed` through `maintenance-armed`, and rows with external staging evidence now refuse toward export-backed decommissioning; trusted plain deployments keep no-export cleanup through `worker-deployed`.
- **BEHAVIOR CHANGE:** Workers for Platforms and external-artifact deployments always refuse no-export cleanup: every current candidate binds the deployment D1, and no reviewed no-data profile exists.
- **BEHAVIOR CHANGE:** A failed provision whose rollback admitted the bounded engine is durably `cleanup-advancing`. `provisionDeployment()` refuses to resume it with a fixed redirect to cleanup; complete the cleanup (receipt) and reprovision fresh. Previously the row kept its provisioning phase and could be retried as provisioning.
- **BEHAVIOR CHANGE:** External-candidate and WFP failed-provision rollback no longer tears the deployment down. The engine refuses before any mutation, the row keeps its phase and stays provisioning-retryable, and teardown routes to export-backed decommissioning.
- **BEHAVIOR CHANGE:** Cleanup completion releases the deployment's ownership claims; decommission claim behavior is unchanged. Force decommission releases current claims on capable stores, refuses during an active bounded cleanup, and on legacy lease implementations without `deleteReleasingClaims` deletes the row and leaves claims for later reconciliation. Force does not delete the ordinary Worker script or application R2, so do not reprovision the same names until residual physical resources are confirmed removed; provisioning fails closed on ownership mismatch.
- **BEHAVIOR CHANGE:** `auditFleetDrift()` treats a deployment under active bounded cleanup as its own reconciliation authority: no expectation-based, orphan, or record-level findings (including `incomplete-provisioning`) while the cleanup intent is active.

Add `ProvisionDeploymentOptions.failureCleanup: 'drain' | 'bounded'` (default `'drain'`); with `'bounded'` the rollback performs at most one bounded advance and surfaces the resumable outcome through the new `ProvisioningError.cleanup` field.
9 changes: 9 additions & 0 deletions .changeset/bounded-decommission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@proofoftech/fleet-control': minor
---

Add token-driven bounded normal decommissioning for at-least-once control-plane Worker workflows. Fleet D1 owns scan progress. Each call performs at most one bounded scan chunk; only an exact matching verify may immediately consume that result through its single same-lease resource action. Other calls perform at most one lifecycle or resource action group.

Persist an immutable database-export receipt authority before the first D1 scan or export. Retries after artifact commit or Fleet state-write loss converge on the same filesystem or R2 receipt; authority changes and byte collisions preserve the committed winner and fail closed. Custom bounded backends must expose the paired receipt authority and export capability. Queue-driven bounded decommissioning requires Workers Paid because its bounded multi-R2 read groups can exceed the Free plan external-subrequest limit.

Add a root-only bounded backend-switch advance API that uses the same durable token and receipt guarantees. It binds teardown to one immutable switch snapshot and captured entry subphase, advances at most one release, R2 resource, scan chunk, or D1 action group per call, and preserves legacy recovery after a shell-less deployment reaches export authorization. A pending ordinary Worker requires lossless exact-version inspection, authoritative secret-name inventory, and its persisted Durable Object namespace identities. Custom switch providers must expose the bounded scan, receipt, database, residual, delete, and conditional pending-artifact inspection capabilities required by the durable state they resume.
21 changes: 21 additions & 0 deletions .changeset/bounded-fleet-audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@proofoftech/fleet-control': minor
---

Add a bounded, resumable fleet drift audit API with a durable, provider-neutral operation store. `advanceFleetAudit()` performs at most one bounded stage chunk per call — one global-stage slice of up to `maxItemsPerCall` items (1..2,000, default 500), or exactly one Fleet record's inspection and re-arm — against a `FleetOperationStore`; `D1FleetOperationStore` implements that port over the existing Fleet D1 binding with account-and-kind-scoped leases, lease-fenced guarded batches, and audit generation pinning. Call `start` with an operation id, the audited records, and `staleAfterMs`, then re-enqueue only the pending token each call returns. Start requires at most 10,000 records whose canonical bytes total at most 16 MiB, with each record within the 96 KiB staged-row byte bound and the per-record structure bounds: plain JSON data (no `undefined`-valued properties, dates, class instances, or cycles) within depth 64, 8,192 nodes, and 4 KiB per string value or object key. Every record must satisfy the deployment identifier grammar, and an explicit generation must be a positive safe integer. Every such refusal has a fixed message and precedes every durable effect. The `staleAfterMs` and operation-id refusals also occur before the lease; after the lease row is written, the foreign-kind, no-finalized-generation, and `auditClock`-sample refusals write nothing else. These accepted inputs are intentionally narrower than `auditFleetDrift()`, which does not require that identifier grammar, an explicit generation, or the bounded path's row and structure bounds. Read the findings back page by page with `readFleetAuditFindingsPage()` once the operation is terminal. Each page comes back in ordinal order whatever order the store's page arrived in and carries `nextAfterOrdinal`, the cursor to pass back as `afterOrdinal` on the next call — absent only on an empty page, which is legal only when `done` is set. The reader verifies the page rather than trusting it: a page that is empty while unfinished, or that is not the contiguous ordinal run following the cursor, refuses with `fleet operation state is malformed`. `abandonFleetAuditOperation()` unblocks a stuck running operation and releases any pin an already-terminal one still holds.

- `auditFleetDrift()` keeps its exact signature, refusal message, finding vocabulary, finding order, provider interaction order, return value, and stop behavior. It now drains the same decomposed stages in memory, and a frozen golden baseline (findings and the full store/backend/resolver call log) pins all of that.
- **HARDENING:** the bounded engine never persists the raw diagnostic bytes a one-shot audit composes call-locally. The three resolvers, the inspection, the re-arm, and the segmented multi-duty `maintenance-stale` composition durably record a fixed template alone; any finding detail, composed by the engine or passed through from the pinned inventory generation, that fails a non-throwing credential-substring and control-byte gate persists a fixed withheld-detail fallback instead of aborting the operation.
- An audit start pins exactly one finalized `@proofoftech/fleet-control` R3 inventory generation and keeps it through completion, so a finding page stays interpretable against the exact generation it was computed from; only explicit result garbage collection, terminal failure, or abandonment releases it. A replayed start never re-resolves "latest": it reuses the persisted generation.
- Every finding or fact must fit the staged-row envelope: a 16 KiB JSON-serialized payload, 4 KiB per string, and the codec's depth and node bounds. The coordinator detects an excess before the store sees the row, fails the whole operation with the durable `emission-bound-exceeded` reason, and releases the pin. One record's whole per-call emission set (its findings plus the cross-record ownership facts it newly claims) must also fit inside the one guarded D1 batch its `per-record` call commits — a ceiling of 99 rows: 99 emitted rows plus the one run-record update is exactly the 100-statement budget and is accepted, while 100 or more emitted rows fail. A record whose live inspection alone would emit 100 rows fails with the same reason rather than emitting a partial finding set.
- The bounded path differs from the drain in exactly four classes: every resolver, inspection, and re-arm failure and every multi-duty `maintenance-stale` finding persists one of the six fixed detail-template families where the drain composes the raw diagnostic; any unsafe finding detail, composed or passed through, becomes the fixed withheld-detail fallback; concurrent mutation can cause either a re-arm refusal on a Fleet reread mismatch or inspection-derived findings against later provider truth, with the bounded path's typically older snapshot making both more likely; and `emission-bound-exceeded` (from the staged-row envelope or the 99-row ceiling) and `generation-unavailable` are terminal whole-operation failures with no drain counterpart, while `auditFleetDrift()` completes and returns its full finding array over the identical world and clocks. Every other output is proven byte-for-byte equivalent to the drain under identical frozen worlds and clocks. The four-class claim also assumes `backendFor`, `specFor`, and `maintenanceSecretFor` are functions of record *value*: the bounded path hands them canonical snapshots rebuilt from the staged rows, never the caller's own objects, so an identity- or prototype-keyed resolver diverges from the drain in a fifth way this list does not cover.
- Per-call cost is not free: every advance call that runs a stage chunk re-reads the pinned generation in full and re-pages the accumulated `record` rows; a record-processing `per-record` call additionally re-pages the accumulated `fact` rows. Each stage-running call also structurally re-parses every accumulated `record` row through three plain-data traversals. That three is this coordinator's own ingress only: against the D1 store each of those same rows additionally costs a `JSON.parse` of the stored payload and the staged-row codec's own bounded-plain pass, so the real per-row constant factor is higher than three. `finding` rows are never re-paged. A stale token, a `start`, and a `finalize` call read neither.
- Aggregate cost: one bounded audit spans `1 + records + Σ max(1, ⌈stage_i / maxItemsPerCall⌉)` stage-running calls, for a `maxItemsPerCall` held constant across the operation — the option is per-call, so varying it between calls changes the count: one per-record-to-finalize transition, one processing call per record, and at least one call per global stage. The sum runs over the eleven global stages rather than over distinct sources: `deployment-gaps`, `namespace-expectations`, and `r2-expected` each chunk the audited-record array independently, so that one array is walked by three separate stage runs. Every such call re-reads O(G) generation rows and re-pages and structurally re-parses O(R) accumulated `record` rows. In the records-dominated case, this is O(records) full generation re-reads, O(records²/1,000) accumulated-row page reads, O(records²) billed rows read, and O(records²) structural `FleetRecord` re-parses at three plain-data traversals each, the dominant CPU term. This checkpoint's in-memory suite measured roughly 0.25 ms per record-row re-parse and roughly 0.5 s for one `per-record` call over 1,001 accumulated rows. Multiplying the first figure by that row count accounts for about half the second; the remainder is the call's fixed cost: the pinned-generation re-read, both row pagings, and the record's own provider step. Read the per-row rate as the 0.25-to-0.5 ms band those two figures bracket rather than as a single constant, and as an order of magnitude from in-memory fakes rather than a production measurement. A late per-record call at the 10,000-record ceiling therefore spends seconds of isolate CPU re-parsing before its provider work. The per-call guarantee covers bounded provider work and bounded emission, not bounded CPU or bounded rows read. See the fleet control guide for the full envelope.

The operation store rejects invalid row-page selectors before schema work. Invalid public selectors use input-specific errors; malformed durable records retain `FleetOperationStateError`.

`stageRows` rejects conflicting immutable staged payloads within its current batch. `commitProgress` refuses conflicting immutable payloads and missing item-update targets without advancing progress or retaining sibling mutations from that batch. Exact restaging remains idempotent. Replaying an uncertain commit requires the same intended run record and row payloads; composing a new transition requires reading persisted progress first. Database errors propagate to the trusted caller. Lease expiry can still leave earlier staged rows while the progress update refuses, so immutable retry payloads remain a caller obligation.

`failOperation` accepts at most one item update. Terminal transitions refuse operation IDs belonging to another operation kind. Row-watermark refusals preserve sibling rows, and noncontiguous caller inserts below a claimed watermark refuse before SQL. See `FleetOperationLease` for the operation-store contract.

The new `readFleetAuditFindingsPage()` resolves to the exported `FleetAuditFindingsPage` type, a `done`-discriminated result: `{findings, done: true, nextAfterOrdinal?}` or `{findings, done: false, nextAfterOrdinal}`. No existing public export changes shape, and the Worker subpath is unchanged.
Loading
Loading