Skip to content

Add durable Studio confirmation ledger - #35

Merged
ohdearquant merged 6 commits into
mainfrom
codex/openrouter-confirmation-ledger
Aug 17, 2026
Merged

Add durable Studio confirmation ledger#35
ohdearquant merged 6 commits into
mainfrom
codex/openrouter-confirmation-ledger

Conversation

@ohdearquant

@ohdearquant ohdearquant commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • add an owner-private append-only Studio confirmation ledger outside challenge directories
  • bind exact canonical challenge/context bytes to principal, Studio session, creative session, and authority epoch
  • recheck epoch, revocation, expiry, and grant bindings inside one BEGIN IMMEDIATE consume transaction
  • authorize a generation POST only for a newly inserted consumption; replay and ambiguous commit acknowledgement never authorize
  • integrate the durable ledger into the real-E2E execute ordering before local evidence, Keychain, AttemptJournal, and transport
  • document the intentional no-compensation availability tradeoff and the same-UID rollback boundary

Scope and safety

This is an offline persistence/integration slice stacked on the credential-free finalizer PR.

Live/paid execution remains HOLD:

  • the trusted Studio producer and enrolled-identity wiring are not implemented
  • the current local Pixel-RAG evidence still belongs to a retired projection
  • same-UID whole-database rollback requires a different-UID service or external monotonic authority if brought into scope

No Keychain access, live discovery, or provider request was made.

Verification

  • affected real-E2E and ledger suite: 122 passed
  • repository run: 1770 passed, 5 skipped, 1 xfailed; the only failures were 9 packaging cases whose nested isolated build could not resolve build dependencies inside the sandbox
  • packaging rerun with build dependency access: 10 passed
  • Ruff check and format check: passed
  • Pyright on the new ledger and execute integration: 0 errors
  • git diff --check: passed
  • independent correctness, security, and spec reviews: approve for the offline slice; live/paid remains HOLD

@ohdearquant
ohdearquant marked this pull request as ready for review August 17, 2026 16:38
khive and others added 5 commits August 17, 2026 14:03
An interrupt between creating the database file and committing its schema
left a zero-byte file that failed the constructor's non-empty check
forever, taking down a deployment's confirmation authority until a human
deleted a file the module declares owner-private. The remnant is now
treated exactly like a missing file: constructible, denied on reads with
the same error, and adopted and re-initialized by the next bootstrap
under the init lock. The test helper no longer swallows ledger
registration failures for override-built contexts, so a tamper test
cannot silently change what it exercises.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…into fix/ledger-bootstrap-remnant

# Conflicts:
#	eval/openrouter_real_e2e.py
The durability pragmas write the SQLite header before the schema transaction
commits, so an interrupted first bootstrap usually leaves a non-empty,
schema-less file that the zero-byte adoption predicate never matched: every
later bootstrap failed ledger_corruption forever. Adoption now reads the
database and adopts exactly the files provably holding zero committed
objects; a committed schema still living in an uncheckpointed WAL is
recognized and never discarded, unreadable bytes stay ledger_corruption, and
reads deny a schema-less remnant like a missing file. Contract text updated
to match, with a rule-separating WAL fixture in the tests.
Merging the parent's scan-first handler and widening its post-scan
passthrough: a clock_invalid raised after the paid POST now runs the terminal
artifact scan first, so a regressed clock can never mask a persisted
credential; the diagnostic survives only a clean scan. Adds the post-response
clock-regression guard tests in both directions.
@ohdearquant
ohdearquant changed the base branch from codex/openrouter-e2e-finalizer to main August 17, 2026 18:56
@ohdearquant
ohdearquant merged commit 58674e9 into main Aug 17, 2026
3 checks passed
@ohdearquant
ohdearquant deleted the codex/openrouter-confirmation-ledger branch August 17, 2026 18:57
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