Skip to content

feat(retention): durable hard-admission reservations - #158

Merged
flyingrobots merged 11 commits into
mainfrom
feat/157-durable-reservations
Nov 2, 2026
Merged

flyingrobots merged 11 commits into
mainfrom
feat/157-durable-reservations

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Applications need to reserve retention capacity before publishing an irreversible effect. This adds a durable record-slot authority with exact caller attempt identity, ordered evidence custody and restart recovery. It preserves the existing CacheSet soft-capacity contract; record slots are not physical-byte quotas.

The public namespace exposes reserve, prepare, arm, settle, cancel, reconcile, inspect, readEvidence and bounded listing. One checked ledger owns admission and lifecycle decisions; custody refs retain original/final pages, support objects and history through real Git edges. Only the fresh armed acknowledgement grants permission to proceed. Reconciliation never arms, replays application work or refunds an armed charge. Exact retries recover their original attempt; conflicting bindings and detected unavailable evidence refuse honestly.

Listing binds namespace, immutable revision, route and phase to its cursor. Seek/tree/record reads spend an explicit node budget, even when a filter produces no matches. Collected snapshots return unavailable. Point admission/lookup follows a bounded hashed route rather than hydrating all retained records.

Design · public recovery · corruption acceptance · native work and residency · integrated runtime/package witness · release thesis.

Validation is recorded against complete copied-source identities in the guarded COPY-only worker:

  • Public native acceptance adds 32 before/after write-fault cases, 22 independent-process cases (including four actual SIGKILL cases around arming), and 14 corruption/refusal cases across both object formats. These preserve prior custody through reopen/GC and test cancellation winner orders and a delayed preparer after slot reuse. They do not claim physical power-loss or external-effect atomicity.
  • Sixty native measurements cover ten operations at 1/17/129 settled records in SHA-1/SHA-256. TRACE2 starts match instrumented launches (9–33); session requests are separate. Fresh Node peak RSS is 73.47–77.07 MiB and excludes Git children. Finite 4 KiB-page measurements are not arbitrary-cardinality, maximum-payload or Bun/Deno performance proofs.
  • After normally merging installer repair fix(ci): install Deno dependencies from the frozen pnpm graph #160, snapshot 7fad342 passes Node units 2,407 / three existing skips; Deno units 2,398 / 12 existing skips; 351 integration cases under each; lint and both declaration fixtures.
  • A separately installed npm-pack consumer passes public lifecycle, exact original/final reads, capacity refusal and close/GC/reopen in both formats. This local candidate retains 7.0.0 metadata and is not a published reservation release. No tarball hash was retained in that phase; release artifact identity remains a separate gate.

Head d920ee0 records that integrated evidence and updates draft documentation; current-head hosted CI and independent review remain required. The prior 6755a53 hosted Node/Bun/Deno matrix passed. #160 is merged; its required retrospective is included after integration. No hooks or review requirements were bypassed.

This remains the one draft PR for the complete #157 capability. Finish current-head review and release verification, publish npm/GitHub artifacts, then verify a fresh public-registry consumer before downstream WARP adoption. No reservation release or completed Optics integration is claimed.

Refs #157. Consumer: git-stunts/git-warp#1067.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 109 files, which is 9 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Check out review usage here.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 2aecfa22-e029-42df-9b9c-95fbf75a8c4f
Commits

Reviewing files that changed from the base of the PR and between 9a33df5 and d920ee0.

Files selected for processing: 109
  • ARCHITECTURE.md
  • BEARING.md
  • CHANGELOG.md
  • README.md
  • ROADMAP.md
  • docs/API.md
  • docs/design/0063-durable-reservations/durable-reservations.md
  • docs/design/0063-durable-reservations/witness/README.md
  • docs/design/0063-durable-reservations/witness/integrated-runtime.json
  • docs/design/0063-durable-reservations/witness/integrated-runtime.md
  • docs/design/0063-durable-reservations/witness/ledger-admission.json
  • docs/design/0063-durable-reservations/witness/ledger-admission.md
  • docs/design/0063-durable-reservations/witness/native-cost-receipt.json
  • docs/design/0063-durable-reservations/witness/native-cost-results.json
  • docs/design/0063-durable-reservations/witness/native-cost.md
  • docs/design/0063-durable-reservations/witness/ordered-custody.json
  • docs/design/0063-durable-reservations/witness/ordered-custody.md
  • docs/design/0063-durable-reservations/witness/point-index.json
  • docs/design/0063-durable-reservations/witness/point-index.md
  • docs/design/0063-durable-reservations/witness/public-corruption.json
  • docs/design/0063-durable-reservations/witness/public-corruption.md
  • docs/design/0063-durable-reservations/witness/public-recovery.json
  • docs/design/0063-durable-reservations/witness/public-recovery.md
  • docs/design/0063-durable-reservations/witness/public-surface.json
  • docs/design/0063-durable-reservations/witness/public-surface.md
  • docs/design/0063-durable-reservations/witness/transition-core.json
  • docs/design/0064-deno-locked-install/deno-locked-install.md
  • docs/design/README.md
  • docs/method/retro/0064-deno-locked-install/deno-locked-install.md
  • index.d.ts
  • index.js
  • scripts/diagnostics/ReservationMeasurementScenario.js
  • scripts/diagnostics/measure-reservations.js
  • src/domain/errors/Codes.js
  • src/domain/errors/ReservationStorageError.js
  • src/domain/services/ReservationCustodyObjects.js
  • src/domain/services/ReservationCustodyStore.js
  • src/domain/services/ReservationIndex.js
  • src/domain/services/ReservationIndexNode.js
  • src/domain/services/ReservationLedger.js
  • src/domain/services/ReservationLedgerStore.js
  • src/domain/services/ReservationListing.js
  • src/domain/services/ReservationNamespace.d.ts
  • src/domain/services/ReservationNamespace.js
  • src/domain/services/ReservationNamespaceRegistry.js
  • src/domain/services/ReservationRecord.js
  • src/domain/services/ReservationScan.js
  • src/domain/value-objects/ReservationCursor.d.ts
  • src/domain/value-objects/ReservationCursor.js
  • src/domain/value-objects/ReservationCustodyDescriptor.js
  • src/domain/value-objects/ReservationCustodySnapshot.js
  • src/domain/value-objects/ReservationEvidence.js
  • src/domain/value-objects/ReservationEvidenceRead.js
  • src/domain/value-objects/ReservationEvidenceRoots.js
  • src/domain/value-objects/ReservationIndeterminate.js
  • src/domain/value-objects/ReservationInspection.js
  • src/domain/value-objects/ReservationKey.js
  • src/domain/value-objects/ReservationLedgerHeader.js
  • src/domain/value-objects/ReservationLedgerRefusal.js
  • src/domain/value-objects/ReservationLedgerSnapshot.js
  • src/domain/value-objects/ReservationListRequest.js
  • src/domain/value-objects/ReservationListUnavailable.js
  • src/domain/value-objects/ReservationOpenIndeterminate.js
  • src/domain/value-objects/ReservationOpenRefusal.js
  • src/domain/value-objects/ReservationPage.js
  • src/domain/value-objects/ReservationPolicy.js
  • src/domain/value-objects/ReservationRefusal.js
  • src/domain/value-objects/ReservationResult.js
  • src/domain/value-objects/ReservationSupport.js
  • src/infrastructure/adapters/GitRefAdapter.js
  • src/infrastructure/codecs/ReservationCustodyCodec.js
  • src/infrastructure/codecs/ReservationLedgerCodec.js
  • src/infrastructure/codecs/ReservationRecordCodec.js
  • src/ports/GitRefPort.js
  • src/ports/ReservationCustodyCodecPort.js
  • src/ports/ReservationLedgerCodecPort.js
  • src/ports/ReservationRecordCodecPort.js
  • test/fixtures/reservation-ledger-worker.js
  • test/fixtures/reservation-package-consumer.js
  • test/fixtures/reservation-public-worker.js
  • test/helpers/MemoryRefAdapter.js
  • test/helpers/NativeReservationFaultRefs.js
  • test/helpers/NativeReservationHarness.js
  • test/helpers/NativeReservationPublicFault.js
  • test/helpers/reservation-custody.js
  • test/helpers/reservation-ledger-processes.js
  • test/helpers/reservation-ledger.js
  • test/helpers/reservation-namespace.js
  • test/integration/reservation-custody-faults.test.js
  • test/integration/reservation-custody.test.js
  • test/integration/reservation-index.test.js
  • test/integration/reservation-ledger.test.js
  • test/integration/reservation-public-corruption.test.js
  • test/integration/reservation-public-faults.test.js
  • test/integration/reservation-public-processes.test.js
  • test/integration/reservation-public.test.js
  • test/types/reservations.ts
  • test/unit/domain/services/ReservationCustodyObjects.test.js
  • test/unit/domain/services/ReservationCustodyProtocol.test.js
  • test/unit/domain/services/ReservationIndex.test.js
  • test/unit/domain/services/ReservationLedger.test.js
  • test/unit/domain/services/ReservationLedgerStore.test.js
  • test/unit/domain/services/ReservationListing.test.js
  • test/unit/domain/services/ReservationNamespace.test.js
  • test/unit/domain/services/ReservationRecord.test.js
  • test/unit/facade/ContentAddressableStore.reservations.test.js
  • test/unit/infrastructure/codecs/ReservationCustodyCodec.test.js
  • test/unit/infrastructure/codecs/ReservationLedgerCodec.test.js
  • test/unit/infrastructure/codecs/ReservationRecordCodec.test.js

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Review on demand using usage pricing
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@flyingrobots

Copy link
Copy Markdown
Member Author

Current-head CI at 24ad750587ade2a6931ed596e42cb67892b34764: lint, unit and Bun passed; Node Docker remains in progress. Deno job failed while building its image, before executing tests:

RUN deno install --allow-scripts
error: Could not find npm package '@cbor-extract/cbor-extract-win32-x64' matching '2.2.3'.

The log identifies a dependency-resolution failure, not a reservation test failure. Its underlying cause is not yet established. Deno remains an unresolved runtime gate; local Node evidence does not waive it. The PR stays draft for the remaining implementation and verification.

@flyingrobots

Copy link
Copy Markdown
Member Author

The immutable point index is committed at 8c593bb9b6e89bc987f25a144279794d64cb08e9 and pushed to the existing draft.

Exact-source evidence: 84 focused tests, two native object-format cases, lint and 2,307 Node unit tests passed locally in the guarded COPY-only worker. The executed numeric-name RED returned false absence before explicit string validation fixed it. Native roots are supplied by the harness; this is not evidence of ledger capacity, ordered custody or a public API.

Next are the namespace policy/header and checked ledger publication. #157 remains open. Deno failed again on this head during image installation with the same missing optional package version; #159 now owns that independent repair. Current Deno job.

@flyingrobots

Copy link
Copy Markdown
Member Author

Public recovery checkpoint pushed at a0bad97aeae193ad9f49dd8f2d23710a249e03b7.

The public facade now has 32 before/after durable-boundary fault cases and 22 independent-process cases across SHA-1/SHA-256. The latter include process-group SIGKILL on both sides of arm CAS, both arm/cancel and settle/cancel winner orders, and a stale preparation resumed after cancellation and replacement-slot admission. Earlier settled receipts and retained objects survive close/GC/reopen/reconcile/retry.

Final guarded Docker phase: 118 reservation integration cases pass; full Node units 2,406 pass / 3 existing conditional skips; lint passes; Deno runs the 54 new public cases successfully. public-recovery.md/.json record complete source identity, raw hashes, counts and scope. This is process-death and exception-injection evidence, not physical power-loss proof. The initial 76-case phase passed tests then failed max-params lint; the final phase verifies the corrected descriptor.

Keep this PR draft. Native operation counts, measured peak residency, complete acceptance/runtime/package/review gates and release remain open. #159/#160 own the independent Deno install repair; publication and a fresh downstream install must precede WARP #1067 adoption.

@flyingrobots

Copy link
Copy Markdown
Member Author

Hosted runtime follow-up at a0bad97aeae193ad9f49dd8f2d23710a249e03b7: run 41463669407 passes all five jobs. Raw logs show 337 integration cases in each of Node, Bun and Deno; Node/Bun units each pass 2,406 with 3 existing conditional skips, and Deno units pass 2,397 with 12 existing conditional skips. Lint passes. CodeRabbit's draft-skipped status is not a review.

The historical unlocked Deno installation can now complete because the previously missing upstream package was published. This successful run does not remove #159's dependency-graph reproducibility concern. #160 has a separate frozen-install repair and current-head green CI. No dependency release or WARP adoption is claimed.

@flyingrobots

Copy link
Copy Markdown
Member Author

Native cost/residency checkpoint at 6755a537dfe0c58cbac1e3207222c920938f91f0:

  • 60 finite measurements: ten public-facade operations x 1/17/129 previously settled records x SHA-1/SHA-256. Separate seeders and fresh Node processes per operation.
  • Native Git TRACE2 starts agree with instrumented process-opening calls for every sample: 9–33 starts including open/close. Session request counts are recorded separately; filtered listing stops at its explicit 129-node budget and returns an empty page with continuation.
  • Fresh Node kernel peak RSS spans 73.47–77.07 MiB, excluding Git children. The complete validation phase's cgroup peak is separately recorded at 888,233,984 bytes and includes tmpfs, dependency installation, seeders and tests.
  • Oldest original/final pages remain retrievable through close/GC, a later settlement and capacity refusal. Final collected store sizes grow with retained history; no constant-disk or arbitrary-cardinality claim.
  • Full Node units: 2,406 passed / three existing conditional skips. Lint passes. The first trace pilot failed; corrected pilot and full run pass, with complete source identities and original phase hashes retained.

Witness. No production implementation changed in this checkpoint. This remains draft: integrated supported-runtime/packed-consumer acceptance, current-head review and actual release remain. It does not promote a finite Node measurement into maximum-payload, adversarial-contention or Bun/Deno performance evidence.

@flyingrobots
flyingrobots marked this pull request as ready for review November 2, 2026 15:52
@flyingrobots

Copy link
Copy Markdown
Member Author

All five hosted CI jobs now pass at d920ee0bec0b7c2fcf3e3dc4c47b17c0a5bf82e3, including the integrated Node/Bun/Deno matrix. The public fault/race/corruption, bounded native measurement and installed-package evidence is retained in the PR body and source-bound witnesses. This PR is now ready for independent review; it is not merge-approved or released.

A fresh Opus review attempt returned provider quota before inspecting source (zero input/output tokens; no verdict). Its previous reported cooldown had elapsed, but the new response reports roughly 162 hours. This is an incomplete review, not an approval or a code defect. Sonnet is also quota-limited; those providers will not be repeatedly retried during that window. CodeRabbit's draft-skipped status does not count as review.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@flyingrobots

Copy link
Copy Markdown
Member Author

Maintainer-directed admin merge at d920ee0bec0b7c2fcf3e3dc4c47b17c0a5bf82e3.

The maintainer explicitly instructed “Just merge --admin” after being told that the independent-review providers were unavailable. This overrides the session's independent-review gate for this merge; it is not an independent APPROVE and the skipped CodeRabbit status is not counted as review evidence.

The current head is mergeable, all current hosted validation jobs pass, and the fully paginated review snapshot contains no submitted reviews, inline threads, or pending review requests. Previously documented source findings and their validated repairs remain recorded in this PR. CodeRabbit's file-count cap and the terminal Agy quota responses are provider limitations, not passing reviews.

The merge will use an exact-head match. Release publication and fresh downstream registry verification remain separate work; this merge does not claim either.

@flyingrobots
flyingrobots merged commit 4782052 into main Nov 2, 2026
6 checks passed
@flyingrobots
flyingrobots deleted the feat/157-durable-reservations branch November 2, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant