AIOS Single-Owner Governance Prerequisites
This package is a dormant candidate produced under the PR #29 prerequisite authorization. It validates exact-head Owner approvals and machine gates, models protection-policy compare-and-swap with compensation, builds evidence, and exercises every mutation path only against disposable fixtures.
The prerequisite shadow services remain static and refuse live mutation. This
branch adds a separate, one-shot activation executor with --plan,
--activate, --verify, --rollback, and --status commands. It is not an
always-on writer and never enables global GitOps writes.
The executor is fail-closed: every consequential command is bound to an exact approval merge, governance OID, evidence closure, Owner review, component digests, full branch-protection snapshot, operation ID, and plan ID. It writes a fsynced WAL before the single-row SQLite CAS, verifies the full applied row, and only rolls back with a target-to-previous CAS. Audit records are hash-chained and credentials are redacted.
Hardening Contract
Fresh activation is authorized only before the approved expires_at instant.
An already-recorded PREPARED transaction may recover after expiry only to
reach a safe terminal state using the same exact bindings; --verify and
--rollback remain available for that recorded transaction after expiry.
ROLLED_BACK and FAILED are terminal states and must never be replayed as a
new activation.
The approved execution binding must pin the implementation commit and its
exact tree, the installed hashes of the five runtime source files
(activation.py, gitea_protected_branch.py, journal.py, validator.py,
and state_machine.py), and independent SHA-256 values for the deployment
artifact, rollback artifact, and test evidence. It must also bind an evidence
closure that is a commit with the exact direct parent and exactly one approved
closure file, including that file's Git blob OID and SHA-256.
Every required machine status is accepted only when its exact status record, creator identity, producer provenance, target URL, description digest, head OID, state, and observation time match the approved binding. A fixture status or a dormant self-check is not machine-status producer provenance.
This contract hardens validation; it does not authorize deployment. The existing governed approval rules still apply, and installation remains disabled and inactive until the required merged approval authorizes one explicit execution.
Installation must remain disabled and inactive until a merged
SINGLE_OWNER_GOVERNANCE_LIVE_ACTIVATION_IMPLEMENTATION_AND_EXECUTION
approval authorizes one explicit execution. The approved runtime paths are
/var/lib/aios-gitops/governance-activation/ and
/run/aios-gitops/governance-activation.lock.