Parent design
Gap claim
The local control-plane JSON store performs unlocked whole-file read/modify/write operations. Concurrent writers lose records; replacement is not file-and-directory fsynced; idempotency lookup is linear. API-404 cannot claim durable or idempotent operation state.
Existing surface audit
The audit covers local store serialization, audit append, state transition, idempotency lookup, control-plane execution, repository contracts, and issue #8. An in-process lock would not protect multiple workers or crash consistency. ADR-104 now owns the lifecycle, concurrency, recovery, identity, and profile decisions that were previously implicit here.
Scope
Re-land the transactional local-store work from PR #1136 under the CP-1, CP-2, CP-4, and CP-5 contracts. Provide atomic claim and terminal-commit capabilities, verified WAL/durability admission, path and permission hardening, integrity checks, strict lossless snapshot/operation codecs, and a one-time legacy JSON import with durable backup. Recovery classification belongs to CP-3 and actor-scoped receipt semantics belong to CP-7.
Dependencies
Acceptance criteria
- The P1 provider supplies atomic claim, snapshot-revision compare-and-swap, terminal snapshot/record/audit commit, and single-owner lease capabilities.
- Startup acquires ownership before schema inspection, migration, codec loading, reconciliation, or state reads.
- The store pins immutable target/run identity and refuses mismatched reopen.
- Published/domain snapshot and operation state round-trip through one closed, lossless codec; malformed or unknown state fails closed.
- WAL/synchronization configuration is verified from the provider's granted result.
- Legacy import verifies counts and digests, fsyncs data and directory changes, retains a durable backup, and switches only after validation.
- No multi-process, high-availability, multitenancy, automatic-replay, or exactly-once backend-effect claim is introduced.
Verification
- Store-contract and crash-consistency tests, including process and commit-boundary fault injection.
- Concurrent-owner, revision-race, path/symlink/permission, corruption, and interrupted-migration tests.
- Full snapshot/operation round-trip tests, including participant episode closure records and malformed-carrier rejection.
- Profile P1 conformance through CP-9.
Traceability
- Requirement: API-404
- Decision: ADR-104
- Formal model: specs/formal/runtime-control-plane/README.md
Parent design
Gap claim
The local control-plane JSON store performs unlocked whole-file read/modify/write operations. Concurrent writers lose records; replacement is not file-and-directory fsynced; idempotency lookup is linear. API-404 cannot claim durable or idempotent operation state.
Existing surface audit
The audit covers local store serialization, audit append, state transition, idempotency lookup, control-plane execution, repository contracts, and issue #8. An in-process lock would not protect multiple workers or crash consistency. ADR-104 now owns the lifecycle, concurrency, recovery, identity, and profile decisions that were previously implicit here.
Scope
Re-land the transactional local-store work from PR #1136 under the CP-1, CP-2, CP-4, and CP-5 contracts. Provide atomic claim and terminal-commit capabilities, verified WAL/durability admission, path and permission hardening, integrity checks, strict lossless snapshot/operation codecs, and a one-time legacy JSON import with durable backup. Recovery classification belongs to CP-3 and actor-scoped receipt semantics belong to CP-7.
Dependencies
Acceptance criteria
Verification
Traceability