Repository navigation
Role foundations tests and handoff store - #111
Merged
Merged
Conversation
Complete prd-role-foundations Phase 5 with focused migration, injection-routing, and assignment tests, and implement the prd-agent-handoff Phase 1 store plus executor-side artifact emission. Handoffs are opt-in per phase so legacy run plans keep executing unchanged. Rubric: PASS — 5/5 criteria Co-Authored-By: Claude <noreply@anthropic.com>
suprie
marked this pull request as ready for review
October 28, 2026 11:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete
prd-role-foundationsPhase 5 with focused Rust coverage for charter migration, injection routing, and per-phase assignment, then implement theprd-agent-handoffPhase 1 store model and executor-side artifact emission. Handoffs are opt-in per phase, so plans without a configured topic keep executing unchanged.What changed
role_foundations_tests.rs: legacy config/plan loading from disk, shared-resolver charter routing, and assignment + handoff persistence with its batching consequence.handoff.rs: artifact record (topic, author role, phase, type, created, summary, cites, durable path), capped load/save helpers, duplicate-topic refusal, and a separate plain-JSONledger.jsongraph of nodes and citation links.handoff_topictoRunPhaseand an optionalhandoff_topicsargument tocreate_run_plan, validated as unique kebab-case slugs across the plan..loopdeck/handoffs/on a passing verdict; a missing/mismatched artifact parks the batch.## Summary) instead of trusting the producer.handoff_topicandPhaseHandoffTopicon the TypeScript IPC surface.PRD
docs/epics/role-based-orchestration/prd-role-foundations.md(Phase 5 — Tests/verification)docs/epics/role-based-orchestration/prd-agent-handoff.md(Phase 1 — Handoff store)Decisions
.loopdeck/handoffs/<topic>.mdwhile graph nodes/links persist separately inledger.json, per the run's clarification.Test plan
cargo test— 739 passed, 0 failed, 9 ignorednpx tsc --noEmitcargo clippy --all-targets— changed files clean; remaining warnings are pre-existing in untouched fileshandoff_topic, let a phase pass, and confirm.loopdeck/handoffs/<topic>.mdplusledger.jsonVerify Verdict
PRD Verification — prd-role-foundations.md + prd-agent-handoff.md (Phase 1)
Scope: all three P0 goals of
prd-role-foundations(every phase is complete; Phase 5 adds this run's verification suite), plus the two Phase-1 loop criteria ofprd-agent-handoffthat this run was queued to implement.prd-agent-handoffPhase 2-4 goals (downstream injection, Waiting, report attribution, its own test phase) are not part of this run and are not evaluated here.Verdict: PASS
src-tauri/src/config.rs:56—pub struct RoleCharter { persona_prompt, allowed_skills, output_contract, rules };config.rs:232-235flattens it intoNamedAgentConfig;src-tauri/src/role_foundations_tests.rs:51loads a legacyconfig.yamlfrom disk, asserts an empty charter, and resaves with no charter keysrc-tauri/src/claude_session.rs:353—cmd.args(["--append-system-prompt", &rendered]);src-tauri/src/codex_session.rs:405-408prepends the same render to the first turn;src-tauri/src/charter_injection_tests.rs:225,240,256,304capture argv/stdin for all three spawn paths plus CodexRunPlanphases, executed by the run queuesrc-tauri/src/runplan.rs:162—pub assigned_agent_id: Option<String>;src-tauri/src/commands/run_queue.rs:1831-1832resolves the batch's assigned agent before spawn;run_queue.rs:1327-1330splits batches on a staffing change;src-tauri/src/role_assignment_tests.rs:79runs the dev-builds/QA-verifies demosrc-tauri/src/handoff.rs:65—ArtifactRecord { artifact, author_role, phase, artifact_type, created, summary, cites, path };handoff.rs:109store dir.loopdeck/handoffs;handoff.rs:118,128ledger load/save;handoff.rs:203save_artifactvalidates caps + refuses replacement;handoff.rs:602,631round-trip testssrc-tauri/src/runplan.rs:173—pub handoff_topic: Option<String>;run_queue.rs:498validates the configured slug;run_queue.rs:292emit_phase_artifactscopies each opted-in phase;run_queue.rs:2048invokes it on a passing verdict and parks on failure;handoff.rs:248,319copy + mechanical heading normalization;handoff.rs:727drift-normalization testNon-goals audit
prd-role-foundationslists "Any handoff store or inter-agent artifacts" as a non-goal. The handoff store in this diff is intentional cross-PRD scope authorized by the co-queuedprd-agent-handoffPhase 1 loops (its own non-goals), not role-foundations creep.prd-agent-handoffnon-goals: no message bus/socket (files + plain JSON only), no parallel execution, no arbitration, no interactive-session writes — no scope creep detected.Roll-up: PASS — 0 FAIL, 0 PARTIAL, 5 PASS.
Run metadata
role-foundations/tests— "Add Rust tests for charter migration, injection routing, and assignment; pass prd-verifier against this PRD" (role-based-orchestration / prd-role-foundations / Phase 5 — Tests/verification)agent-handoff/store-model— "Define the .loopdeck handoff store layout and artifact record (author role, phase, type, path) with load/save helpers" (role-based-orchestration / prd-agent-handoff / Phase 1 — Handoff store)agent-handoff/artifact-write— "Emit each finished phase's contract artifact into the store from the run executor" (role-based-orchestration / prd-agent-handoff / Phase 1 — Handoff store)🤖 Generated with Claude Code