Repository navigation
Description
Problem and intended outcome
Agent OS treats human approval as an authority-bearing lifecycle, but its state transitions are currently enforced through distributed status checks rather than one closed transition contract comparable to Task, Goal, Agent, Experiment, and Knowledge revision validation.
Centralize the approval state machine so routine admission, mutation, recovery, and tests share one authoritative transition validator.
Required outcome
Define an explicit transition contract for core.HumanApproval, for example through a single function such as:
ValidateHumanApprovalTransition(previous, next)The exact valid graph should be derived from current intended behavior rather than guessed from this issue.
The validator should own:
- immutable approval identity and exact effect binding;
- allowed lifecycle transitions;
- version progression;
- which fields may change at each transition;
- terminal-state behavior;
- expiry/decision invariants where applicable.
Design constraints
- Acknowledgement remains attention state, not decision authority.
- Approval/denial must remain exact-effect decisions.
- Recovery must not accept transitions routine admission would reject.
- Generic projection/event writers must not be able to mint terminal approval state.
- This issue must not expand who may approve, what requires approval, or the existing HITL policy.
Acceptance criteria
- Publish one closed approval transition validator used by every approval lifecycle writer.
- The validator preserves immutable Organization, approval, effect, consequence, actor, scope, and fingerprint bindings.
- Every allowed transition is covered by positive tests.
- Skipped, reversed, duplicated, conflicting, or post-terminal transitions fail closed.
- Recovery/event replay uses equivalent approval-transition semantics.
- Existing approval inbox, acknowledgement, decision, expiry, effect validation, and replay tests remain valid.
- No new human-approval requirement is introduced by this refactor.
Priority rationale
This is current control hardening, not evidence of a demonstrated approval bypass. Promote only if implementation review identifies a reachable invalid transition today.
Eliminate duplicate transition authority
Adding a central approval-transition validator is not sufficient if existing lifecycle checks remain as independent authorities beside it.
Inventory every current approval-transition enforcement site, including the status-comparison branches in internal/approvals/service.go, and migrate lifecycle decisions to the single transition contract.
Read-only classification helpers may still inspect status where appropriate, but they must not independently decide whether a lifecycle mutation is valid.
Additional acceptance criteria
- Inventory every current approval lifecycle mutation/transition check before implementation.
- All approval lifecycle writers route transition validity through the single authoritative validator.
- Existing ad hoc status comparisons that independently authorize or reject lifecycle mutations are removed or reduced to non-authoritative/read-only classification.
- Tests fail if a new approval lifecycle writer bypasses the central transition contract.
- Recovery and live admission cannot maintain separate notions of valid approval transition.
Activity