Requirement · active · spec/exacly/execution-maintenance.yaml
REQ-022 Diagnose and preserve execution ledgers without implicit recovery
Give operators bounded access to diagnosis, consistent backup and validated recovery or upgrade copies while preserving source ledger files.
Why it exists
How it is realized
REQ-022Diagnose and preserve execution ledgers without implicit recovery Requirement main: verification passed- implements ←
APP-011Execution ledger maintenance Application- depends_on →
APP-010Execution binding registry Application- depends_on →
APP-007Verification planner Application- depends_on →
APP-003Query Application - depends_on →
APP-006Readiness policy evaluator Application- depends_on →
APP-003Query Application (above)
- depends_on →
- reads →
INFO-001Model config Information (above) - reads →
INFO-002Model state Information (above)
- depends_on →
- depends_on →
APP-008GitHub verification evidence admission Application - depends_on →
INF-003Private execution ledger Infrastructure - reads →
INFO-001Model config Information (above) - reads →
INFO-002Model state Information (above) - reads →
INFO-003Execution bindings Information- stores ←
INF-003Private execution ledger Infrastructure (above)
- stores ←
- writes →
INFO-003Execution bindings Information (above)
- depends_on →
- depends_on →
INF-003Private execution ledger Infrastructure (above) - reads →
INFO-003Execution bindings Information (above) - reads →
INFO-004Completion intents and receipts Information- stores ←
INF-003Private execution ledger Infrastructure (above)
- stores ←
- reads →
INFO-006Historical integrity baselines and semantic verdicts Information- stores ←
INF-003Private execution ledger Infrastructure (above)
- stores ←
- writes →
INFO-003Execution bindings Information (above) - writes →
INFO-004Completion intents and receipts Information (above) - writes →
INFO-006Historical integrity baselines and semantic verdicts Information (above)
- depends_on →
- implements ←
main config 94cbae926e86
| Assessment | Reason | Evidence | At |
|---|---|---|---|
| verification passed tests | All 292 selected test cases passed | 2026-11-22T17:48:12Z |
Findings
None.
Config
- owner
- exacly-maintainers
- lifecycle
- active
- last_reviewed_at
- 2026-10-29
- statement
- Given an explicitly selected private execution ledger, diagnose its condition without modifying it, back up a clean valid store, recover a supported interrupted transaction or explicitly upgrade a clean version-1 store into a new validated copy, preserving source files and requiring an explicit operator cutover.
- acceptance_criteria
- Inspection is read-only and does not open SQLite on residue or unknown formats that could cause recovery; clean supported stores exit 0, recovery-needed, unsupported or corrupt stores exit 1, and invalid inputs or operational errors exit 2.
- Backup accepts only a clean valid ledger and writes a consistent SQLite backup with a manifest into a new destination, validating the copied schema, records, supersession chains and watermarks without changing source database contents.
- Operational inspection, backup and recovery support exactly versions 1, 2 and 4 without changing their version; version 3 remains audit-only, version 2 retains fresh semantic history validation and version 4 checks complete byte baselines and freshly audits all semantics without terminal reuse.
- Version-4 backup and copy-only recovery preserve required baselines, terminal verdicts and all retained proof coherently; integrity mismatches cannot be repaired by copying or resealing, and profile changes require separate explicit activation rather than an implicit maintenance upgrade.
- Explicit upgrade accepts a clean validated version-1 source and publishes a new private bundle containing raw/ledger.sqlite3, upgraded/ledger.sqlite3 in schema version 2, and a manifest; it preserves binding identities and watermarks, leaves the source untouched and requires the operator to select one canonical ledger path.
- Recovery preserves raw copies of the database and rollback journal, performs supported SQLite DELETE-journal recovery only on a working copy, and validates its complete schema, records, supersession chains and watermarks before reporting success.
- Recovery leaves source database and journal files untouched; it never deletes source residue, repairs in place, replaces the active ledger or makes normal registration, show or bound previews recover implicitly.
- Unknown schemas, WAL or SHM residue, super-journals and partial initialization are diagnosed without automatic recovery; recovery rejects them with no published output and preserves the source files.
- A valid recovery bundle is published atomically with relative raw and recovered paths in its manifest; failed copied-store validation publishes no partial bundle and leaves the source intact.
- Backup, recovery and upgrade require a new destination outside Git working trees, model folders and protected inputs, reject source overlap and overwrite, create POSIX 0700 directories and 0600 files, and exit 0 on success or 2 on error.
- Maintenance accepts a finite nonnegative lock timeout defaulting to 30 seconds; one monotonic budget bounds directory and SQLite waits, zero permits an immediate attempt, and timeout reports an actionable nonmutating error without limiting whole-operation copying or computation.
- Reports identify the source, diagnosis and copied content in a versioned format; manifests do not authenticate global freshness, alter binding identities or grant new approval or task-closure authority.
- Version-1 and version-2 maintenance retain report schema 0.2.0; version-4 reports use 0.3.0 and disclose installed and retained profiles, integrity coverage and fresh semantic audit counts without silently refreshing the retained profile.
- Operators explicitly select one canonical ledger after reviewing a recovered copy; old and recovered copies must not operate as parallel active authorities, and same-user candidate code remains outside the protection provided by directory permissions.
- Maintenance changes only explicitly requested output copies and reports; it never modifies source model or state files, dispatches work, changes pending tasks or claims executor provenance or task closure.
- verification_method
- Maintenance, CLI, bounded-lock and real process termination and restart tests in CI.
- observe
- tests
- cases
- python/tests/test_execution_maintenance.py::*
- python/tests/test_execution_maintenance_cli.py::*
- python/tests/test_execution_store.py::*
- python/tests/test_completion_store.py::*
- python/tests/test_execution_maintenance_v4.py::*
- python/tests/test_execution_history_reuse_crashes.py::*