Repository navigation
[ALLEN Pi/Spark G3] Rebuild a workflow after a restart from the authoritative records - #62
aien-spark wants to merge 2 commits into
Conversation
#56) New src/orchestration/recovery.rs. AuthorityLookup is a read-only trait for effect state, grant state and receipt presence, keyed by the ids DELEGATED-DAG.md names (effect intent id, grant id, receipt digest). rebuild() takes the spec, the stored pointers and the lookup and returns a WorkflowSnapshot: DONE with receipt is Completed; OPEN or UNRESOLVED is Uncertain (G2); NOT_DONE is Ready only under a still-valid grant, else WaitingForApproval; a spent grant with no nameable intent is Uncertain; a no-effect task that never finished is Ready once its prerequisites are Completed. No task body is ever called. Named refusals, never a silent fresh start: spec mismatch, missing or unknown pointers, unreachable authority, missing effect record, unknown grant, intent mismatch, DONE without receipt (negative control). WorkflowSpec gains dependencies(). Tests use an in-memory fake; the deliberate break (accept DONE without receipt) turns the negative control red. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
⚖️ Sovereign Code Review & Alignment GateGreetings @aien-spark. I am AIEN, the automated review gate for the AIENOS project. Your pull request #62 ("[ALLEN Pi/Spark G3] Rebuild a workflow after a restart from the authoritative records") has undergone automated auditing against the project standards. ✅ Doctrine Diff Audit: PASS
🌿 Sovereign Steward: Contributor Alignment InterviewGreetings @aien-spark. I am AIEN, the automated steward for the AIENOS project. We welcome all contributors who share our commitment to open collaboration, global humanity, and disciplined systems craftsmanship. We build to expand computing capability, advance open-source intelligence, and share technology freely with the world. Your pull request #62 ("[ALLEN Pi/Spark G3] Rebuild a workflow after a restart from the authoritative records") is ready for stewardship alignment. Please respond directly to these four alignment inquiries:
Reply to this comment with your affirmation. Once verified against the project standards, I will grant the |
Closes #56
Stacked on #61 (G2). Base is the G2 branch so this diff shows G3 only.
What changed
src/orchestration/recovery.rs:AuthorityLookup(read-only async trait):effect_state(intent),grant(grant),receipt_present(receipt), keyed by the ids indocs/DELEGATED-DAG.md(effect intent id, grant id, receipt digest).StoredPointers/TaskPointers: what AEGIS keeps (run id, cause id, objective id, spec digest; per task: effect class, intent id, grant id, receipt digest, no-effect result digest).rebuild(spec, pointers, lookup) -> Result<WorkflowSnapshot, RecoveryRefusal>, pure (same records, same snapshot), never calls a task body.Uncertain(G2); NOT_DONE gives Ready only under a still-valid grant, else WaitingForApproval (needs a newly issued grant); a spent grant whose intent nobody can name givesUncertain; a no-effect task that never finished gives Ready once its prerequisites are Completed (Pending otherwise); DONE is terminal and never run again.RECOVERY_*): spec mismatch, missing pointers (including an effect task with no grant), unknown task pointer, unreachable authority, missing effect record, unknown grant, intent mismatch between pointer and desk, DONE without receipt.WorkflowSpec::dependencies()added (needed to read edges from outsideworkflow.rs). One sentence indocs/WORKFLOW-DAG.mdso the restart boundary is not stale.Tested commit
833b8a5(host, 2026-10-16, sibling../aien-protocolsatmain4b76f7f).aegis::orchestration::recoveryunresolved)tests/workflow_recovery_tests.rs)-D warnings), AEGIS-FMT, AEGIS-CHECKRECOVERY_DONE_WITHOUT_RECEIPT, both with no receipt pointer and with a pointer the authority does not holdnegative_control_done_without_receipt_is_refusedfails; restored, 15 of 15 greenRemaining gap
Nothing stores
StoredPointersyet (no table; D2 in DELEGATED-DAG.md proposes the #379 objective record as their home). Pointer ids are opaque strings; their byte form follows PST1 once C4 lands. Objective and cause checks on resume are G4 row 4.Next dependency
G4 (#57) stacks on this branch and drills it.
🤖 Generated with Claude Code