@yunhozz/arc 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/MANIFEST.sha256 +69 -60
  2. package/claude/agents/arc-implementer.md +2 -2
  3. package/claude/agents/arc-planner.md +1 -1
  4. package/claude/agents/arc-reviewer.md +1 -1
  5. package/claude/agents/arc-scouter.md +1 -1
  6. package/claude/agents/arc-tester.md +1 -1
  7. package/claude/skill/SKILL.md +2 -2
  8. package/claude/skill/references/arc-visual-companion.md +2 -21
  9. package/claude/skill/references/commit.md +3 -30
  10. package/claude/skill/references/coordination.md +20 -126
  11. package/claude/skill/references/git-recovery.md +3 -3
  12. package/claude/skill/references/handoff-prep.md +7 -22
  13. package/claude/skill/references/handoff.md +19 -108
  14. package/claude/skill/references/limits.md +4 -15
  15. package/claude/skill/references/planning.md +22 -109
  16. package/claude/skill/references/verification.md +16 -118
  17. package/claude/skill/references/worktree-creation.md +1 -1
  18. package/codex/agents/arc-implementer.toml +3 -1
  19. package/codex/agents/arc-planner.toml +4 -0
  20. package/codex/agents/arc-reviewer.toml +6 -0
  21. package/codex/agents/arc-scouter.toml +6 -0
  22. package/codex/agents/arc-tester.toml +6 -0
  23. package/codex/skill/SKILL.md +2 -2
  24. package/codex/skill/references/arc-visual-companion.md +3 -27
  25. package/codex/skill/references/commit.md +3 -30
  26. package/codex/skill/references/coordination.md +19 -126
  27. package/codex/skill/references/git-recovery.md +2 -7
  28. package/codex/skill/references/handoff-prep.md +7 -22
  29. package/codex/skill/references/handoff.md +18 -107
  30. package/codex/skill/references/limits.md +5 -16
  31. package/codex/skill/references/planning.md +22 -109
  32. package/codex/skill/references/verification.md +15 -117
  33. package/gemini/agents/arc-implementer.md +1 -1
  34. package/gemini/skill/SKILL.md +2 -2
  35. package/gemini/skill/references/arc-visual-companion.md +2 -21
  36. package/gemini/skill/references/commit.md +3 -30
  37. package/gemini/skill/references/coordination.md +23 -129
  38. package/gemini/skill/references/git-recovery.md +3 -3
  39. package/gemini/skill/references/handoff-prep.md +7 -22
  40. package/gemini/skill/references/handoff.md +19 -108
  41. package/gemini/skill/references/limits.md +4 -15
  42. package/gemini/skill/references/planning.md +22 -109
  43. package/gemini/skill/references/verification.md +16 -118
  44. package/grok/agents/arc-implementer.md +1 -1
  45. package/grok/skill/SKILL.md +1 -1
  46. package/grok/skill/references/arc-visual-companion.md +2 -21
  47. package/grok/skill/references/commit.md +3 -30
  48. package/grok/skill/references/coordination.md +21 -127
  49. package/grok/skill/references/git-recovery.md +3 -3
  50. package/grok/skill/references/handoff-prep.md +7 -22
  51. package/grok/skill/references/handoff.md +19 -108
  52. package/grok/skill/references/limits.md +4 -15
  53. package/grok/skill/references/planning.md +22 -109
  54. package/grok/skill/references/verification.md +16 -118
  55. package/lib/policy/role-policy.json +1 -1
  56. package/lib/prompts/agent-fragments.json +19 -8
  57. package/lib/prompts/render.mjs +16 -5
  58. package/lib/runtime/adapters/codex.mjs +1 -1
  59. package/package.json +1 -1
  60. package/shared/skill/references/arc-visual-companion-common.md +39 -0
  61. package/shared/skill/references/commit-common.md +45 -0
  62. package/shared/skill/references/coordination-common.md +193 -0
  63. package/shared/skill/references/git-recovery-common.md +15 -0
  64. package/shared/skill/references/handoff-common.md +182 -0
  65. package/shared/skill/references/handoff-prep-common.md +53 -0
  66. package/shared/skill/references/limits-common.md +34 -0
  67. package/shared/skill/references/planning-common.md +185 -0
  68. package/shared/skill/references/verification-common.md +170 -0
  69. package/shared/skill/runtime/adapters/codex.mjs +1 -1
  70. package/shared/skill/runtime/role-policy.json +1 -1
@@ -0,0 +1,39 @@
1
+ # Visual companion — shared text
2
+
3
+ This file holds text shared by every platform's arc-visual-companion.md. Each part belongs to the section that links to it and has the same force there.
4
+
5
+ <a id="visual-companion"></a>
6
+ # Visual companion
7
+
8
+ Read before offering or operating the companion. Design discussion is distinct from Tester UI acceptance under an approved test brief.
9
+
10
+ Use visuals when they materially help design discussion or verification. Orchestrator determines actual capability/consent. Planner returns visualization needs only; DO NOT invent browser/shell access. Other depth-2 roles stay within their profile tool limits and cannot delegate visualization.
11
+
12
+ - Verify actual browser/preview capability; NEVER assume platform preview support.
13
+ - Use an available authorized local/browser flow only within Orchestrator scope.
14
+ - Separate preview artifacts from user files, record side effects and preserve unrelated work. Report unavailable capability without claiming visual verification.
15
+ - NEVER expose secrets or publish previews without authorization.
16
+
17
+ 1. Planner returns a useful visual question, reason, options, user decision and complete content draft; no screen writing, server/browser operation or approval request.
18
+ 2. Orchestrator offers in a separate message when visuals clarify the question, then waits for acceptance. After refusal, continue in text without reoffering unless the user raises it.
19
+ 3. After acceptance, decide per question. A UI topic or companion consent does not route every question to a browser.
20
+ 4. Orchestrator owns guide, server/browser, paths, live-session checks, complete keyed URL, screens/session state, feedback/events and cleanup. Clear stale screens when returning to text. Check the server before display. After replies, terminal text is primary and events supplemental.
21
+
22
+ Upstream guide/scripts: `<installed ARC>/references/visual-companion.md` and adjacent `scripts/`. ARC guide: `references/arc-visual-companion.md`. Orchestrator supplies absolute paths and owns approval/server/browser. Missing files stop dependent work; no global fallback.
23
+
24
+ 1. Run upstream relative commands from installed ARC `references/`; Orchestrator supplies the absolute working directory.
25
+ 2. Record `screen_dir`, `state_dir` and the complete keyed URL from the server or this session's `state/server-info`. NEVER guess another session path.
26
+ 3. A/B highlighting proves selection display only. Separately inspect that session's exact `state_dir/events` for saved events. Clicking starts neither a chat turn nor an automatic response.
27
+ 4. Tell the user to return to chat and send a follow-up after selection. On the actual next turn, reread the same events file and combine it with the current message. Current chat text is primary; events are supplemental. Chat wins conflicts; clarify missing/ambiguous feedback.
28
+ 5. DO NOT infer storage from highlighting or next-turn consumption from an earlier Tester parse. Preserve imported guide/scripts.
29
+
30
+ <a id="follow-up-verification-of-approved-visual-sources"></a>
31
+ ## Follow-up verification of approved visual sources
32
+
33
+ Each visual criterion requires the exact approved source location, version, approval and access state; criterion IDs, properties and comparison method; and evidence linking the actual output to its revision. Implementer reporting does not replace fresh Tester comparison.
34
+
35
+ - Record pass/mismatch/unverified and connect to proven/unmet/unverified criterion verdicts. Pass requires accessible evidence meeting the criterion; unsupported claims remain unverified.
36
+ - A missing revision link is unverified; a visible difference is a mismatch. Record them separately without inferring the current branch UI state.
37
+ - Hold comparison for inaccessible source/output or missing interpretation approval.
38
+
39
+ Static checks of policy, generated files and the manifest prove structure only, not actual role behavior, installed builds, platform CLI compliance or visual fidelity. Report changes, exclusions, checks run and omitted, criterion evidence and limits, and platform availability. Separate baseline failures. Independent progress never relaxes checks or criteria.
@@ -0,0 +1,45 @@
1
+ # Focused commits — shared text
2
+
3
+ This file holds text shared by every platform's commit.md. Each part belongs to the section that links to it and has the same force there.
4
+
5
+ <a id="automatic-commit-after-plan-task-acceptance"></a>
6
+ ## Automatic commit after plan-task acceptance
7
+
8
+ One approved top-level task is one focused implementation commit. Orchestrator verifies criteria, current checks and findings, accepts by judgment, then immediately commits locally without separate user commit approval. After acceptance, Orchestrator records that task's progress (checkboxes, notes, results, evidence and status) and includes it with that task's implementation work in the same commit. DO NOT amend the original planning commit or create a separate docs/fixup commit for those records. After acceptance, check Git state/scope, stage and commit. NEVER commit before acceptance or defer until plan completion. Implementer completion is not acceptance; explicit assignment never permits Implementer commits.
9
+
10
+ Substeps and checkboxes track progress, not commits. Completion marks, reports and passing checks do not establish acceptance; connect conditions and expected results to evidence. Plan omission creates neither new plans nor automatic commits; follow applicable guidance/user requests. Push/merge/publish/deploy/install retain separate approvals. Reviewer timing follows [verification](verification.md#risk-scaled-execution).
11
+
12
+ 1. Before commit verify approved plan version/task ID/accepted scope, actual absolute workspace/repository/branch or detached HEAD/HEAD, staged/unstaged/untracked state and ownership.
13
+ 2. Verify staged content/paths include only this task, its own progress records, eligible plan-level progress records, eligible pending approved spec/plan revisions and final message; verify revision scope and required trailers. Prove safe separation of other tasks/user changes in shared files. Unrelated staging blocks commit under Preservation rule.
14
+ 3. After commit verify SHA/message/paths/content, HEAD/branch and remaining state. Successful exit alone proves no completion.
15
+ 4. Canonically link plan path/version, task ID, acceptance evidence/judgment, required checks/findings, commit results/state, hold/no-change/reuse reasons and remaining final verification.
16
+
17
+ Hold commits for unmet/unresolved criteria, failed/not-run required checks, undispositioned findings/gaps, scope expansion/revised-plan needs, ownership/staged scope/content mismatch, unexpected workspace/branch/HEAD/Git state or failure/partial completion. Record reason/next action; NEVER waive criteria/checks to commit. Disposition follows Evidence verdict. Inspect actual branch/HEAD/index/working tree/partial completion before retry; uncertain commit creation stops immediate retries. Orchestrator follows [recovery](git-recovery.md), resolves and revalidates evidence.
18
+
19
+ No-change tasks record acceptance/no change without empty commits. Resume verifies/reuses the same task's SHA/content/validity without duplication. Missing records require actual-result inspection before retry. Normal accepted commits retain valid choice reuse with fresh state/ownership checks. Task acceptance/commit differs from final plan acceptance; remaining Tester/Reviewer/integration checks retain their timing.
20
+
21
+ For final Reviewer findings on committed plan work, define follow-up task/required planning/approvals. Implementer leaves corrections uncommitted through rechecks. Orchestrator refreshes committed state plus uncommitted diff/changed-file list in Reviewer artifacts/briefs. Reuse/assign an independent Reviewer; repeat Implementer → Reviewer without Tester reassignment until resolved, then accept and create one focused follow-up commit. Final Tester findings retain Implementer → Tester before a new commit. NEVER automatically amend/reset/duplicate original implementation commits. NEVER amend planning or implementation commits. Scope expansion retains planning/approval duties.
22
+
23
+ Local commit authority never permits early planning-document commits. Pre-Implementer approvals/explicit target/batch preparation remain. NEVER amend planning or implementation commits or retroactively authorize past work. Structural checks prove no live compliance.
24
+
25
+ <a id="execution-time-plan-document-updates"></a>
26
+ ## Execution-time plan document updates
27
+
28
+ Follow [planning](planning.md#plan-updates-during-execution) and [preparation](handoff-prep.md#execution-time-plan-revision). Include all pending approved spec/plan revisions in the accepted commit of the first top-level task executed or reconfirmed against the revised version; otherwise use a current task acceptance or final Reviewer follow-up commit. Same-task progress records follow the task implementation commit path above. Preserve actual approval chronology; NEVER authorize past work retroactively.
29
+
30
+ Plan-level progress records are final verification results, each final Reviewer round's verdict and finding dispositions (including references to user decisions) and overall completion status. Preserving the approved contract, they need no new approval; changing it makes them a plan revision. They are the sole exception to excluding other tasks' records: Orchestrator includes them in that plan's next commit, either a task acceptance commit created by final Reviewer finding work or the final Reviewer follow-up commit. When no implementation work remains, such as a final Reviewer approval without findings or a user decision not to fix a non-blocking finding, Orchestrator creates no commit for them alone: unless a standalone closing commit made for pending revisions carries them, Orchestrator keeps them only in the canonical handoff record, leaves the plan document unchanged and the working tree clean, and states this in the completion report. Plan-level progress records alone never trigger the standalone `docs(plan)` closing commit. Write plan-level progress records into the plan document only while staging the commit that carries them; until then keep them in the canonical handoff record.
31
+
32
+ Only when no implementation work remains before overall completion MAY Orchestrator create one standalone `docs(plan): <description>` closing commit. Record the supporting evidence canonically, include all pending revisions and required trailers, and include no implementation files. This is the sole separate docs/fixup exception; overall completion requires no pending revision. NEVER amend planning or implementation commits, reset, replay or rewrite their history. When this closing commit is made for pending revisions, it also carries the plan-level progress records.
33
+
34
+ For independent tasks accepted against a prior version, exclude pending revision hunks and stage only that task's own progress records; hold the commit if separation is unsafe. Before staging/commit verify pending revision inclusion/exclusion against the selected task/version and compare staged scope/content to approved copies. For every document add `Plan-Revision: <gitPath> v<from> -> v<to>`; for each version after from through to add `Plan-Approved-At: <gitPath> v<N> <actual ISO 8601 approval time>` and `Plan-Reason: <gitPath> v<N> <reason>`. Use ASCII `->`, repeat keys as needed, preserve existing Git trailers and verify trailers before commit.
35
+
36
+ After commit verify blobs/latest approved content and clear pending revisions under [verification](verification.md#evidence-after-plan-revision-commit). Preserve implementation acceptance, focused commits and correction follow-ups. Initial complete approved batch still precedes handoff; existing approvals/authority remain.
37
+
38
+ <a id="shared-checkout-coordination"></a>
39
+ ## Shared-checkout coordination
40
+
41
+ Orchestrator serializes shared Git/index/staging/commits across tasks; parallel Implementers NEVER compete in Git transactions. Preserve all other unfinished changes/ownership. Commit accepted work only after scope/content checks. Unrelated staging blocks, but unrelated unstaged work need not finish or enter this commit. Unclear separation/ownership holds affected work.
42
+
43
+ After each normal independent commit verify/record SHA/content/HEAD/remaining state, refresh canonical record/briefs/gates and immediately reassess readiness. Authorized HEAD changes alone invalidate neither choice nor independent dispatch. Predecessors release dependents only after checks/acceptance/verified commit; accepted no-change replaces commits, never empty commits. Unexpected HEAD/ownership/Git failure stops affected work until resolution/revalidation.
44
+
45
+ Authorization follows [planning](planning.md#authorization-and-scope); completion/limits follow [verification](verification.md#completion-continuity). Add no no-plan commit duty or claim that local commits establish overall completion.
@@ -0,0 +1,193 @@
1
+ # Role assignment and coordination — shared text
2
+
3
+ This file holds text shared by every platform's coordination.md. Each part belongs to the section that links to it and has the same force there.
4
+
5
+ <a id="role-assignment-and-coordination"></a>
6
+ # Role assignment and coordination
7
+
8
+ Orchestrator reads this before the first specialist creation or assignment and related decisions. Also read [limits](limits.md) and installed `../limits.toml` before creation. Report exact missing, inaccessible or conflicting paths; hold dependent work.
9
+
10
+ <a id="ownership"></a>
11
+ ## Ownership
12
+
13
+ | Role | Ownership and return |
14
+ |---|---|
15
+ | Orchestrator | Sole coordinator of development/configuration/tests/dependent docs/mixed implementation. Assigns edits to Implementer; owns scope, planning, approval, integration (save/review/directly revise the same spec or plan after Planner first draft, route decisions and request approval), verification, acceptance and completion |
16
+ | Scouter | Read-only material research/analysis and assigned static exploration. Reports evidence, assumptions, questions, impact, next actions and path issues. No editing, standalone documents or design/plan/verification/review/completion decisions |
17
+ | Planner | Returns design/spec/plan drafts |
18
+ | Implementer | Edits approved assigned implementation/configuration/tests/dependent docs; Orchestrator direct edits only under the small-task path |
19
+ | Tester | Verifies without editing |
20
+ | Reviewer | Independently reviews the final full change |
21
+
22
+ Orchestrator is depth 1. All five specialists report directly at depth 2 without creating agents/delegating. Reviewer stays independent.
23
+
24
+ <a id="coordination-execution-mode"></a>
25
+ ### Execution mode
26
+
27
+ Obey concurrency limits across the tree, including Scouter. No reserved role slots. Read limits before first creation and maintain cumulative ledger/reservations. Parallelize independent tasks only; dependent handoffs are sequential and edit scopes never overlap.
28
+
29
+ <a id="instruction-and-execution-adapter"></a>
30
+ ## Instruction and execution adapter
31
+
32
+ Apply platform/user/project instructions by precedence, then ARC ownership/permissions/models/concurrency/routing/approval and role-local references. Skills add neither agents nor authority. Map `superpowers:executing-plans`/`superpowers:subagent-driven-development` to dependency-aware Orchestrator coordination and risk-scaled verification, replacing executor mechanics and separate execution-method prompts in existing references.
33
+
34
+ Preserve plan approval, workspace, design, spec and all applicable requirements. TDD applies to permitted test work under [handoff](handoff.md#implementer-tdd-and-constraints)'s explicit ARC exceptions. Follow an applicable higher-priority prohibition on adding or running tests; when its precedence and scope are clear, neither report a conflict on that basis nor ask permission to violate it. Record unperformed verification; hold only affected work and acceptance when scope or precedence is genuinely unclear or required verification is blocked. Adapt local `brainstorming` role/save/early-spec-commit instructions to Planner ownership and planning/handoff evidence gates, preserving upstream text. Report conflicts/missing required references before dependent work.
35
+
36
+ Orchestrator integrates results, routes decisions/approvals and owns acceptance/completion. Run dependent implementation sequentially with a fresh Implementer per top-level task. Reuse current Implementer only for same-task correction/rework/rechecks while scope/workspace/ownership/context remain valid. Default same-task Tester corrections to it; findings alone create no new task. Before reuse, compare actual workspace, branch/HEAD and change state to the brief.
37
+
38
+ For each plan task, keep the current Implementer conversation ID, status, last result and reuse/replacement decision in the canonical handoff record. Before each call, identify the task and current Implementer. Send same-task corrections, rework and rechecks as follow-up work in that conversation. A completed or idle turn, partial implementation, failed result, missing brief, division by step or file, or Tester/Reviewer finding alone does not justify a new Implementer; consolidate the missing information or findings and send them to the current one. For an initial successful call, record the returned ID; if its result is uncertain, reconcile it before another assignment.
39
+
40
+ Before a same-task replacement, establish an allowed reason: the existing context is invalid/unavailable or the Implementer cannot continue, or an approved plan/acceptance-criteria amendment requires a fresh Implementer. Record the prior conversation ID, status, reason and supporting evidence before calling. Hold if the reason is not established. After a successful call, update the current ID; reconcile an uncertain result before any further assignment. These are prompt-level procedures, not proof of automatic interception of native collaboration calls.
41
+
42
+ Replace/restart only for invalid/unavailable context or changed task boundary, except approved plan/criteria amendments require a fresh Implementer for remaining work even within the same task. Next-task and amendment assignments are handoff restarts, subject to choice reuse/restart briefs. Follow [risk-scaled execution](verification.md#risk-scaled-execution) at task boundaries.
43
+
44
+ <a id="local-superpowers-references"></a>
45
+ ### Local Superpowers references
46
+
47
+ Supply absolute paths under the selected installed ARC directory. Planner reads `references/brainstorming.md`/`references/writing-plans.md`; Implementer reads `references/test-driven-development.md` and required relative references. Resolve relatives within skill directories. Runtime needs no global discovery/external Skill call/automatic download. Missing/damaged files stop dependent work; report paths without global fallback. Preserve ARC approvals, ownership, TDD exceptions and executor adapters.
48
+
49
+ <a id="token-discipline-and-handoffs"></a>
50
+ ### Local Superpowers references
51
+
52
+ Return the complete first required draft and self-review from the verified source before target preparation; compare the prepared target before saving or handoff.
53
+
54
+ <a id="coordination-context-discipline-and-handoffs"></a>
55
+ ## Context discipline and handoffs
56
+
57
+ Use this fixed brief order:
58
+
59
+ 1. Goal
60
+ 2. Criteria (IDs)
61
+ 3. Exact scope/ownership: absolute workspace, branch or detached HEAD and HEAD, existing record path, files
62
+ 4. Constraints/decisions
63
+ 5. Evidence: paths/lines, commands, artifact links
64
+ 6. Prior findings
65
+ 7. Exact next objective: one bounded objective
66
+ 8. Return format: conclusion, evidence locations, unresolved points, next step
67
+
68
+ <a id="coordination-context-discipline-and-handoffs-2"></a>
69
+ ## Context discipline and handoffs
70
+
71
+ The [task envelope](handoff.md#orchestrator-direct-path-for-small-tasks) fits this fixed brief order: Goal carries task/path/outcome; Criteria carries IDs and checks; Exact scope/ownership carries target/state/ownership/record; Constraints/decisions carries approval, F1–F8, risk/depth and TDD; Evidence carries fingerprint and approval/check evidence; Prior findings carries changes, revalidation and holds; Exact next objective gives the bounded next goal; Return format requests evidence, limits and unresolved points. Give a new role its native profile and actual applicable instructions, not hash alone.
72
+
73
+ <a id="coordination-planner-dispatch-efficiency"></a>
74
+ ## Planner dispatch efficiency
75
+
76
+ Before Planner dispatch, evaluate F1–F8 direct-path eligibility and Bounded plan-omission eligibility independently. Enter each path only when all of that path's existing conditions are proven; if neither path qualifies, use normal full evaluation. Orchestrator can read a few already identified files; route material research and broad static exploration to Scouter. Planner briefs carry path/line-verified evidence and a Read/Grep exploration budget (default about 15 for Bounded and about 30 for Architectural when no task-specific number is set; state a number before depth is chosen or for Spike work); additional broad exploration goes to Scouter, not Planner. NEVER reuse a Planner across stages, except that on the Architectural path the design Planner continues as the spec Planner after [start confirmation](planning.md#architectural-start-confirmation) while role, context and source remain valid. Within the design/brainstorming stage one Planner handles every [design conversation](planning.md#design-conversation) response, the final design, its consolidated correction and any eligible further call; within a spec or plan stage, that stage's Planner is reused only for a budget-hold delta. Every plan stage, and an Architectural spec stage without that continuation, uses a fresh Planner whose brief contains every required field plus saved document paths and approved versions (for the Architectural plan stage, the reviewed spec path, version and SHA-256); cite a prior brief only when it is an accessible file. A Planner return that stops at the budget with a Scouter request is an input hold, not a missing or failed draft: after Scouter evidence arrives, resend that stage's brief as a delta to the same stage Planner, which counts as new input. In the design stage, conversation responses are expected returns and use no correction opportunity; calls after the final-design correction still need new input. Orchestrator MAY set a handback size limit in the brief.
77
+
78
+ <a id="models"></a>
79
+ ## Models
80
+
81
+ Adjacent `models.toml` is authoritative for role models/effort. Orchestrator uses the current model. DO NOT substitute settings or reduce effort; report unavailability. Declarations prove no provider support/account access/alias resolution/actual model-effort application/concurrency/depth enforcement. New sessions reload profiles; running agents retain settings/parents. Changes do not automatically reparent or prove runtime parent behavior.
82
+
83
+ <a id="instruction-and-input-provenance"></a>
84
+ ## Instruction and input provenance
85
+
86
+ Briefs identify source/applicability/version or approval/access state for user instructions, discovered workspace instructions, installed references and task inputs. Optional read recovery follows policy only; report first failure and dependent/independent work. Return missing required inputs without inventing authority/interpretation. Full fields follow [handoff](handoff.md#instruction-sources-bounded-read-recovery-visual-evidence-and-resumption).
87
+
88
+ <a id="coordination-composite-platform-role-dispatch"></a>
89
+ ## Composite Platform Role Dispatch
90
+
91
+ `Mixed routing` keeps the current session as the Orchestrator. Each role runs either as a native `arc-routing-*` profile on the host or as a bridge: a child process of the peer CLI started by the runtime. Invoke `$ARC_RUNTIME_ENTRY` as described in [planning](planning.md#approved-cooperative-execution-path-within-the-repository): `node "$ARC_RUNTIME_ENTRY" <command> --cwd <absolute worktree> --workflow <workflow ID> --input -`, with one JSON object on stdin. Output is one JSON line. Exit codes: allow 0, deny 2, hold 3, error 1. Every input is validated against an exact key set; a missing or unknown key is denied with `invalid_request`. `hostPlatform` (`codex`, `claude`, `gemini` or `grok`) and `executionEnvironment` (`codex-cli`, `claude-cli`, `gemini-cli`, `grok-cli`, `codex-desktop`, or `claude-desktop`) are caller-provided claims, not host attestations. Gemini host routing is held in this release (see the host support table below).
92
+
93
+ Choose `executionEnvironment` by where the session actually runs: a terminal CLI or TUI session, including one in an IDE integrated terminal, uses `codex-cli`, `claude-cli`, `gemini-cli` or `grok-cli` for its host. Desktop values apply only to Codex and Claude. Use them only for a session confirmed to run inside the corresponding Desktop app. NEVER infer the environment from paths or directory names (for example `~/Desktop/...`). When unsure, declare the CLI value.
94
+
95
+ Procedure, in order:
96
+
97
+ 1. `routing-status` with `hostPlatform`, `executionEnvironment`. Reads the active revision, each role's route, profile, model and effort, platform authentication and CLI versions without reserving anything. Authentication and version probes start a child process. The Codex authentication probe refreshes the login token over the network through `codex app-server`; a permanently rejected refresh is `Unauthorized` and a probe that cannot decide is `Incomplete`.
98
+ 2. `prepare-dispatch` with `hostPlatform`, `executionEnvironment`, `role` (`arc_scouter`, `arc_planner`, `arc_implementer`, `arc_tester`, or `arc_reviewer`), `expectedRevision` (the revision from step 1), `requestId`, `taskId`, and `allowedPaths` (worktree-relative path array; required and non-empty for `arc_implementer`, optional for `arc_tester` where empty or omitted allows no writes, omitted for other roles). `allow` returns `dispatchId`, the route and initial claims and reserves a lease; `hold` returns every reason with its release condition; `deny` rejects the request. Reuse of a `requestId`, or a non-terminal dispatch for the same workflow, task and role, is denied with `duplicate_dispatch`.
99
+ 3. Native route: before spawning, compare the `[arc-routing rev <revision>]` tag in the agent list description with the `routing-status` revision. If it differs or is not shown, hold the role as `native_profile_reload_unverified` and report that a new session is required. Then spawn: Claude host Agent tool `subagent_type: "arc-routing-<suffix>"`; Codex host `spawn_agent` `agent_type: "arc_routing_<suffix>"` with the existing `fork_turns="none"` and `task_name` rules. On Grok use `spawn_subagent` with `subagent_type: "arc-routing-<suffix>"`. The revision tag appears in the `subagent_type` description. Use the returned `subagent_id` as `nativeAgentId`. The Grok child uses the session model, so its model claim remains `operator-attested`. The child has no `spawn_subagent` tool. NEVER pass a model argument. On Claude and Codex the profile decides. Record the lifecycle with `observe` using `dispatchId`, `event` (`started`, `completed`, `failed`, or `cancelled`) and `nativeAgentId`. `nativeAgentId` is required with `started` and forbidden with every other event. A `cancelled` event is also accepted for a `reserved` native lease that was never started (without `nativeAgentId`). These are `operator-attested` claims.
100
+ 4. Bridge route: `run-dispatch` with `hostPlatform`, `executionEnvironment`, `dispatchId`, `brief` (UTF-8, at most 256 KiB, delivered on stdin only). It starts a detached supervisor and returns at once with `routeStatus` and `resultPath`. Then `observe` with `hostPlatform`, `executionEnvironment`, `dispatchId` and optional `waitMs` (0 to 540000). Use the maximum wait for each call and DO NOT run a short polling loop. With `waitMs`, `observe` returns only when the dispatch reaches `completed`, `failed`, `cancelled` or `unknown`, or when `waitMs` elapses; a transition such as `starting` to `running` does not end the wait. `observe` returns status, claims, `resultPath` and reasons; `failed` and `unknown` are reported as hold (exit 3).
101
+ 5. `resume` with `hostPlatform`, `executionEnvironment`, `dispatchId`, `brief`. It continues the same session as a new segment only for a dispatch in `completed` or `failed` state with a recorded session ID and an unchanged active revision (otherwise `revision_changed`). All flags are re-specified, the concurrency limit is checked again, and a session ID mismatch makes the state `unknown`. `unknown` and `cancelled` dispatches cannot be resumed. New Tester or Reviewer assignments never reuse a session.
102
+ 6. `cancel` with `hostPlatform`, `executionEnvironment`, `dispatchId`. A `reserved` lease (native or bridge) becomes `cancelled` at once; a `starting` or `running` native lease is denied and is closed with `observe` events. A cancelled `unknown` lease keeps its recorded reasons. A running child gets SIGTERM, a 10 second grace, then SIGKILL; the result is `cancelling` and `cancelled` is recorded only after exit is observed. A reused PID or missing child information (including a `starting` lease whose supervisor is lost and that has no child record) is left unchanged and the result is hold, because exit cannot be observed; clean it up manually.
103
+
104
+ <a id="coordination-host-rules"></a>
105
+ ### Host rules
106
+
107
+ | executionEnvironment | Claude target | Codex target | Gemini target | Grok target |
108
+ |---|---|---|---|---|
109
+ | `claude-cli` | Native, all roles | Bridge, all roles | Bridge, read roles only (GG1 `fail`; Implementer/Tester held as `permission_scope_unverified`) | Bridge, all roles |
110
+ | `codex-cli` | Bridge, all roles | Native, all roles | Bridge, read roles only (GG1 `fail`; Implementer/Tester held as `permission_scope_unverified`) | Bridge, all roles |
111
+ | `gemini-cli` | Held (`capability_not_verified`; GG2 `fail`, `compositeHost` off) | Held (`capability_not_verified`; GG2 `fail`, `compositeHost` off) | Held (`capability_not_verified`; GG2 `fail`, `compositeHost` off) | Held (`capability_not_verified`; GG2 `fail`, `compositeHost` off) |
112
+ | `grok-cli` | Bridge, all roles | Bridge, all roles | Bridge, read roles only (GG1 `fail`; Implementer/Tester held as `permission_scope_unverified`) | Native, all roles |
113
+ | `claude-desktop` | Held (`environment_unverified`) | Held (`environment_unverified`) | Held (`environment_unverified`) | Held (`environment_unverified`) |
114
+ | `codex-desktop` | Held (`environment_unverified`) | Held (`environment_unverified`) | Held (`environment_unverified`) | Held (`environment_unverified`) |
115
+
116
+ Read roles are Scouter, Planner and Reviewer. The table shows which routes the recorded gates permit; apply the host rules and check each dispatch result.
117
+
118
+ **Claude**
119
+
120
+ - Approval: No per-call ARC approval gate.
121
+ - Target home probe: None.
122
+ - Desktop: Held as described below.
123
+
124
+ **Codex**
125
+
126
+ - On a Codex host ask the user for escalation approval each time any runtime command (`routing-status`, `prepare-dispatch`, `run-dispatch`, `observe`, `resume`, `cancel`) runs, because each may write `CODEX_HOME`. The runtime does not check this approval; asking for it is an Orchestrator obligation. Without approval or on failure the result is `host_sandbox_blocked`.
127
+ - In a Codex host sandbox writes to `CODEX_HOME` are denied (G2), so a Codex-host bridge is not held in advance but runs only with the per-call escalation approval; a refused approval or a denied write is `host_sandbox_blocked`. Detached supervisor survival itself was observed under variant conditions, and native routes there remain supported.
128
+ - Target home probe: None.
129
+ - Desktop: Held as described below.
130
+
131
+ **Gemini**
132
+
133
+ - Approval: Hold the host pending live host measurement (GG2). The registry lists `gemini` and `gemini-cli`, but `compositeHost` is off.
134
+ - Target home probe: See the shared probe rule below. The capability hold applies before the probe.
135
+ - Desktop: No Desktop value.
136
+
137
+ **Grok**
138
+
139
+ GK2 is `approval`.
140
+
141
+ - On a Grok host start the session with `grok --permission-mode default` (ask), keep the platform-default sandbox off, and ask the user for approval each time any runtime command (`routing-status`, `prepare-dispatch`, `run-dispatch`, `observe`, `resume`, `cancel`) runs; NEVER use auto-review, `/auto`, `bypassPermissions`, `--always-approve` or `--yolo`, and DO NOT choose `Always allow`, which saves `permission_mode = "always-approve"` to the Grok config. Spawn with `spawn_subagent` only roles whose route is `native`; Grok can also list Claude `arc-routing-*` profiles, which remain bridge roles. The runtime does not check this approval; asking for it is an Orchestrator obligation. A denied write (for example by a host sandbox) is `host_sandbox_blocked`; ARC does not detect whether the host sandbox is on.
142
+ - Target home probe: See the shared probe rule below.
143
+ - Desktop: No Desktop value.
144
+
145
+ <a id="coordination-shared-host-rules"></a>
146
+ #### Shared host rules
147
+
148
+ - On a Grok or Gemini host, bridge `prepare-dispatch`, `run-dispatch` and `resume` first check that the target platform home is writable: a denied write is `host_sandbox_blocked`, a missing home is `activation_unverified`, and a probe file that cannot be removed is reported in `residualPaths`.
149
+ - On Desktop hosts (`codex-desktop`, `claude-desktop`) every role (native and bridge) is held as `environment_unverified` in this release; the manual checklist in the ARC operation guide is a list of manual checks for a future ARC update that may change the support status, and recording it releases nothing. Even then `supportStatus` is at most `unverified`.
150
+
151
+ <a id="coordination-bridge-target-rules"></a>
152
+ ### Bridge target rules
153
+
154
+ - Bridge prepare, run and resume hold `permission_scope_unverified` when `allowedPaths` cover `.`, `.git`, `.claude`, `.claude/settings*.json`, `.codex` or `.codex/config.toml`; any change to `.git` config, hooks or info (except `info/refs`, which `git update-server-info` may rewrite after a fetch or gc; that change alone is recorded under `tolerated.control`), `.claude/settings*.json` or `.codex/config.toml` fails the dispatch as `permission_violation_observed` regardless of role and `allowedPaths`, and Grok writing roles also fail on changes to the security keys of the Grok home `config.toml` or to its `sandbox.toml`.
155
+ - All bridge children: Apply the shared child guard in [Shared dispatch rules](coordination.md#coordination-shared-dispatch-rules). The guard denies routing commands only; native delegation inside a child follows each platform's Delegation item below.
156
+
157
+ **Claude**
158
+
159
+ - Writing roles: Claude bridge `arc_implementer` and `arc_tester` run with recorded sandbox settings on every host and are held as `permission_scope_unverified` when an injected G1 fails or settings are missing (G1). Claude Implementer/Tester bridges also deny writes under `.git` (permission rules and sandbox `denyWrite`), and are held as `permission_scope_unverified` when the worktree `.claude/settings.json` or `.claude/settings.local.json` would widen their scope (additional directories, allow rules for tools outside the safe list (Bash, Read, Grep, Glob, WebFetch, WebSearch), hooks, sandbox or defaultMode).
160
+ - Permission claim: Compare the `init` event with the expected tools and permission mode. If `init` is missing, the `permissions` claim is `unverified`. If the tools or permission mode differ, the claim is `unverified` and the reason is `permission_scope_mismatch`.
161
+ - Delegation: Role instructions forbid re-delegation. Claude children expose no Task tool.
162
+ - Execution confirmation: Check the stream session identity and model, transcript effort, and the observed terminal result.
163
+
164
+ **Codex**
165
+
166
+ - Gate: G4 applies to every Codex bridge role. G4 `pass` permits dispatch; a failed G4 holds as `permission_scope_unverified`.
167
+ - Writing roles: Codex `workspace-write` may reach beyond the worktree (G5): writes outside the worktree are outside post-run detection.
168
+ - Permission claim: For a Codex bridge the `permissions` claim is at most `operator-attested` and notes `user-config-mcp-not-controlled`, because the child loads the user's Codex configuration (for example MCP servers), which ARC does not control; its `supportStatus` is therefore never `verified`.
169
+ - Delegation: Codex rollout checks apply. The re-delegation of a Codex child is not blocked, and a spawn found afterwards in its rollout fails the dispatch as `delegation_observed` (G3).
170
+ - Execution confirmation: Check the rollout for model, effort, sandbox mode and approval policy, and check the observed terminal result.
171
+
172
+ **Gemini**
173
+
174
+ - Writing roles: Gemini bridge `arc_implementer` and `arc_tester` are held as `permission_scope_unverified` while GG1 is `fail`. Scouter, Planner and Reviewer remain supported.
175
+ - Permission claim: The worktree snapshot covers only Git-visible worktree changes.
176
+ - Delegation: The dispatch record reports `unverifiedContracts.delegation` as `undetectable`.
177
+ - Execution confirmation: Check the stream session ID against the recorded ID, the observed model and the terminal result. Effort stays `unverified`.
178
+
179
+ **Grok**
180
+
181
+ - Writing roles: Grok bridge `arc_implementer` and `arc_tester` use a per-dispatch sandbox profile and require a verified `ProfileApplied` event after execution (GK1), with read-role behavior unchanged. Writing roles are held as `permission_scope_unverified` if GK1 is anything other than `pass`.
182
+ - Grok records `ProfileApplied` itself in a file the child can write. If a Grok version neither applies the profile nor emits the event, a single forged candidate is indistinguishable from a genuine one. A forgery alongside a genuine event fails the two-candidate check.
183
+ - On cancellation, the events check adds no `permission_scope_mismatch` if a valid events file has no matching `ProfileApplied` candidate or the file was absent both before and after execution. Other reasons still apply.
184
+ - Permission claim: The worktree snapshot covers only Git-visible worktree changes.
185
+ - Delegation: The dispatch record reports `unverifiedContracts.delegation` as `undetectable`.
186
+ - Execution confirmation: Check the stream session ID against the recorded ID, the observed model and the terminal result. Effort stays `unverified`.
187
+
188
+ <a id="coordination-bridge-tool-access"></a>
189
+ ### Bridge tool access
190
+
191
+ The Orchestrator requests `toolAccess` only for the current bridge dispatch when the approved task needs it (D-a). Use scratch first. Scouter, Planner and Reviewer cannot request `toolAccess`. Implementer MAY request loopback, registered path or socket IDs, and the `ci`, `daemon-off` and `polling` presets. Tester MAY also request domain-scoped or full network access and registered browser services, subject to the platform gates. On Codex, Claude and Gemini, the gates for full network access and all three Playwright services have the value `held`; on Grok they are `unmeasured`. NEVER enable additional access by default for Tester. Check the dispatch's `toolAccess.conditions` when a grant is conditional.
192
+
193
+ Use `ARC_SCRATCH_DIR` for temporary files and put files that MUST survive the dispatch in `ARC_EVIDENCE_DIR` for supervisor collection. Read `ARC_HOST_SERVICES_FILE` for service endpoints when a host service was granted. When a host-only operation blocks a check, report it as “environment constraint (host only)” and identify the blocked check and what remains unverified. Host-only operations include process inspection (`ps`, `pgrep`), Docker, writes to actual CLI authentication or configuration, dependency installation and its remote fetches, Git writes, Cypress, and Keychain operations. The Orchestrator handles host verification within existing authority.
@@ -0,0 +1,15 @@
1
+ # Preserve state after failure — shared text
2
+
3
+ This file holds text shared by every platform's git-recovery.md. Each part belongs to the section that links to it and has the same force there.
4
+
5
+ <a id="branch-collision-and-invalid-names"></a>
6
+ ## Branch collisions and invalid names
7
+
8
+ Invalid names, creation/switch failures, lookup errors or unexpected branches require recorded errors/state and stopped handoff. Branch creation without switching is partial completion; report it without automatic deletion or success claims. No branch/checkout fallback. New collision suffixes need approval. Preserve staged/unstaged/untracked changes; blocked switching or unclear ownership waits for Orchestrator.
9
+
10
+ <a id="handoff-record-write-denial"></a>
11
+ ## Handoff record write denial
12
+
13
+ In a worktree session, use the ARC runtime command `node <runtime>/cli.mjs handoff-record write --cwd <abs> --slug <slug> --input -` instead of a file tool. Set `<runtime>` to the installed ARC skill runtime directory and send a JSON object with a nonempty `content` string containing the full Markdown record on stdin. Use the existing inline fallback if the command fails.
14
+
15
+ Failed profile reapplication MUST restore replaced bytes/modes. If rollback fails, preserve recovery files/paths; NEVER claim clean state or remove recovery material.
@@ -0,0 +1,182 @@
1
+ # Implementer handoff — shared text
2
+
3
+ This file holds text shared by every platform's handoff.md. Each part belongs to the section that links to it and has the same force there.
4
+
5
+ <a id="instruction-sources-bounded-read-recovery-visual-evidence-and-resumption"></a>
6
+ ## Instruction sources, bounded read recovery, visual evidence and resumption
7
+
8
+ Visual briefs include exact approved source/version/approval/access, criterion IDs/properties/method and actual-output identity/revision/basis. Implementer reports differ from fresh Tester comparison. Report pass/mismatch/unverified with evidence/limits; return new UI interpretations/substitutions.
9
+
10
+ Resume briefs preserve valid approval for unchanged scope, completed work, failures and their resolution, valid and invalid evidence, holds and the next objective. Record changed facts and revalidate gates without repeating completed work. Preserve role/Git/Tester/final Reviewer/acceptance/commit boundaries.
11
+
12
+ <a id="checkout-approval"></a>
13
+ ### Checkout approval
14
+
15
+ Before every Implementer start or restart, verify access to the supplied absolute workspace and its intended repository. Record the actual path, branch or detached HEAD, HEAD, and staged, unstaged and untracked state. An inaccessible or wrong repository or unresolved HEAD stops work; DO NOT automatically initialize Git or switch repositories.
16
+
17
+ The first required spec/plan draft follows choice and verified source evidence and precedes actual preparation; saving follows verified preparation. Initial design MAY precede choice. Preparation alone authorizes no Implementer. All approvals/full documents/verified batch or valid absence/final Git checks remain. Separate planned scope/paths, actual preparation and drafting/save/approval/commit, recording chronology/gaps.
18
+
19
+ After initial design approval, or within the Architectural [start confirmation](planning.md#architectural-start-confirmation), record explicit selection: current checkout, new task branch from verified base there, or managed worktree/task branch. Without choice/valid reuse, wait. Reuse through unchanged-scope/target drafting/implementation. Authorized HEAD/dirty changes alone do not invalidate choice; verify preservation/ownership. Changed scope/target requires fresh choice before dependent drafting/preparation without waiting for full documents. NEVER fall back automatically.
20
+
21
+ <a id="implementer-handoff-gate"></a>
22
+ ### Implementer handoff gate
23
+
24
+ Orchestrator verifies all before start/restart:
25
+
26
+ 1. Applicable design/spec/plan approvals/artifacts or valid omissions; for Spike, approved question/method/scope/criteria/constraints. Verify full current document set/versions/dependencies/order and no unfinished applicable documents. Future implementation artifacts are outside probe approval.
27
+ 2. Explicit initial choice or verified valid reuse.
28
+ 3. Accessible intended absolute workspace/repository.
29
+ 4. Actual branch/detached HEAD/HEAD/change state/preservation/ownership. Preserve unrelated staged files; they block until preparation is resolved.
30
+ 5. Verified planning-document commits or required-none/produced-none with depth reasons.
31
+ 6. Final path/branch/HEAD/state after mutations; no unresolved failure/partial completion.
32
+ 7. Brief preparation/final-verification facts/evidence.
33
+
34
+ Before the first direct edit, use approved scope records and the same gates. Any failure/missing condition blocks handoff, not authorized read-only investigation/preparation/recovery. Revalidate changes to approved content/target/branch/HEAD/state. Implementer reports actual conflicts under its profile; Orchestrator resolves and repasses gates.
35
+
36
+ <a id="handoff-evidence"></a>
37
+ ### Handoff evidence
38
+
39
+ Give all five roles the same actual workspace/selected checkout, preparation evidence and absolute artifacts. Roles stay there and report missing/inaccessible/conflicting paths/unexpected branches before dependent work, NEVER create/switch workspaces/branches. Tell Implementer others share the repository and unrelated work MUST be preserved.
40
+
41
+ <a id="task-readiness-at-every-assignment"></a>
42
+ ## Task readiness at every assignment
43
+
44
+ Link current approved-plan readiness in canonical record/brief before every start/restart. Valid omission records judgment/reasons, not a new plan/map solely for linking. Absence alone permits no omission or bypass of required-plan approval.
45
+
46
+ Apply all [planning](planning.md#dependency-and-readiness-record) conditions: predecessor checks/Orchestrator acceptance/verified commit or accepted no-change. Reports alone are insufficient. Verify current records/capacity/ownership. Readiness supplements, never replaces handoff/target gates. Authorized HEAD/state changes refresh records/briefs/preservation/gates and [shared-checkout](commit.md#shared-checkout-coordination) readiness. Unexpected HEAD/ownership stops affected work for resolution.
47
+
48
+ <a id="choice-lifetime-and-restart-record"></a>
49
+ ## Choice lifetime and restart record
50
+
51
+ Reuse only for unchanged approved scope/workspace/repository/target with accessible valid evidence. Every start/restart compares actual identity/branch/detached HEAD/HEAD/changes/preservation/ownership, approvals/artifacts, document SHA/message/paths/content or absence and final state with the brief. Reuse waives none of gates 1–7.
52
+
53
+ Unchanged-document restarts reuse valid commits/choice with fresh state checks. Accepted task/docs commits and authorized implementation/dirty changes alone invalidate no choice; record matching work/ownership/target. Authorized worktree transfers also preserve reuse. Creation base remains evidence, not a permanent target HEAD constraint; source-preservation/unexpected-state checks remain. Link plan version/task ID/commit content-validity/current Git/ownership in restart brief. NEVER duplicate successful commits or confuse task commits with document preparation; DO NOT repeat valid docs preparation.
54
+
55
+ Changed scope/workspace/repository/target/candidate needs fresh choice before dependent work. Failures invalidating target trust need new choice after resolution. Resolution alone needs none if choice remains valid. Mismatches/unresolved failures hold edits through full revalidation; NEVER fallback.
56
+
57
+ <a id="choice-lifetime-and-restart-record-2"></a>
58
+ ## Choice lifetime and restart record
59
+
60
+ In a worktree session, use the ARC runtime command `node <runtime>/cli.mjs handoff-record write --cwd <abs> --slug <slug> --input -` instead of a file tool. Set `<runtime>` to the installed ARC skill runtime directory and send a JSON object with a nonempty `content` string containing the full Markdown record on stdin. Use the existing inline fallback if the command fails. This user-approved ARC runtime command respects `scope.non-escalation` by writing only to `<git-common-dir>/arc/handoff/<slug>.md` and leaving permissions and sandbox settings unchanged.
61
+
62
+ Unavailable/denied record writes require reason/full inline record in every Implementer brief, without deltas or record-file `unchanged`; inline satisfies accessibility.
63
+
64
+ Restart briefs send verified deltas and record-relative `unchanged`; fresh Implementer reads it and gets other fields fully. Include record location, next goal/ownership, changed decisions/approvals/docs/scope or no-change, current Git/differences, choice/reuse validation, refreshed commit/artifact checks, final verification/issues. Inaccessible records, missing evidence or unclear ownership block edits. Prior conversation/inaccessible links are no substitute. Revalidate revised docs/approvals/state; NEVER backdate pre-gate preparation.
65
+
66
+ <a id="authorization-continuity"></a>
67
+ ## Authorization continuity
68
+
69
+ Use [planning](planning.md#authorization-and-scope), recording scope/criteria/constraints/valid omissions with target/preparation. Reuse valid unchanged approvals across role restarts without duplicates. Orchestrator still verifies actual workspace/Git/preservation/ownership/docs/preparation; Implementer trusts verified brief. Material scope/method/risk changes or invalid target evidence hold affected work; report missing condition/resume evidence. Before exceptions read full [risk](verification.md#risk-scaled-execution)/[depth](planning.md) conditions.
70
+
71
+ <a id="implementer-tdd-and-constraints"></a>
72
+ ## Implementer TDD and constraints
73
+
74
+ Before feature/bug/behavior edits use local `test-driven-development` except explicit ARC exceptions. Full rules live in the profile. Waiver requires all low-risk and plan-skip/direct conditions, recorded scope/justification/criteria/checks before work. User/task-specific TDD overrides it; only qualifying tasks override local generic triggers without changing skills. Ordinary multistep/significant/high-risk work is ineligible.
75
+
76
+ <a id="orchestrator-direct-path-for-small-tasks"></a>
77
+ ## Orchestrator direct path for small tasks
78
+
79
+ 1. Record scope/files, every condition's justification, criteria/checks, not brainstorming. A specific existing request may authorize under [planning](planning.md#authorization-and-scope); otherwise obtain explicit approval. Silence/ambiguity/other approvals are insufficient.
80
+ 2. Read this/[preparation](handoff-prep.md), pass full gate before edit and edit approved files surgically, preserving others. No unrelated refactoring/unapproved dependencies.
81
+ 3. Follow Implementer TDD/recorded waivers; explicit TDD still requires local skill. Record files/checks/criterion evidence/gaps. Orchestrator is not independent; assign Tester for incomplete evidence.
82
+ 4. Failed checks/Tester findings route to Implementer/recheck, never self-correction. Scope/risk/condition changes stop edits, record work/reclassify and return subsequent edits to normal Planner/Implementer flow.
83
+
84
+ Add no plans/automatic commits to omission paths; follow guidance/user requests.
85
+
86
+ <a id="handoff-fast-gate"></a>
87
+ ### Fast gate
88
+
89
+ Security/permissions and public-interface changes are never eligible under the existing significant-risk exclusions. File count, LOC and apparent simplicity prove none of F2–F5. This gate does not replace the first direct edit gate, Implementer start/restart gate, target choice, TDD, independent Tester and Reviewer, acceptance or commit; existing triggers determine whether each gate applies. The fast path does not add untriggered role, Tester/Reviewer, acceptance or commit obligations. Preserve all existing platform restrictions.
90
+
91
+ <a id="handoff-instruction-fingerprint"></a>
92
+ ### Instruction fingerprint
93
+
94
+ Record the actual applicable source-set: platform ARC SKILL, these initial reference sections, applicable workspace instructions, and triggered references/skills; record user/platform messages by message and approval reference, not invented file hashes. Record native role profile source/version when assigned; a new role receives actual instructions, profile, needed paths and criteria, not merely a hash. DO NOT assume disk profile changes updated an active role.
95
+
96
+ Distinguish user-provided instructions, workspace instructions, installed references and task inputs by source, applicability and access state: available, absent, inaccessible, conflicting or unverified. For every file record source kind, absolute and resolved path, read sections, available revision, SHA-256 of entire file bytes, access state, observation and read-context references. Neither HEAD nor installer manifest substitutes for actual installed-source hash. Use only already identified source paths; DO NOT search or guess. An uncertain source-set makes F8 `unverified`.
97
+
98
+ Reuse read content only for the same source-set, absolute source locators, resolved paths, hashes, scope and same conversation context with meaning still available. Different absolute locators cannot be reused even if they resolve to the same path. New context, inaccessible record or context loss requires rereading; changed source/hash requires rereading and reassessing affected judgments. Verify the current source-set/hash at a new fast judgment, first-edit or assignment/restart/resumption gate, before acceptance, and on known source changes; reuse observations within the same gate. If hashing fails, DO NOT reuse; follow existing read recovery and hold required inaccessible inputs. When Node is already available, batch identified absolute paths with built-in `node:fs` realpath/readFileSync and `node:crypto` SHA-256; install nothing and print no source content.
99
+
100
+
101
+ For identified absolute sources only, when Node is already available, this read-only example prints paths and hashes, not contents:
102
+
103
+ ```sh
104
+ node --input-type=module -e '
105
+ import fs from "node:fs";
106
+ import crypto from "node:crypto";
107
+ const sources = process.argv.slice(1);
108
+ if (!sources.length) throw new Error("No instruction sources");
109
+ for (const source of sources) {
110
+ const resolvedPath = fs.realpathSync(source);
111
+ const contentHash = "sha256:" + crypto.createHash("sha256").update(fs.readFileSync(resolvedPath)).digest("hex");
112
+ process.stdout.write(JSON.stringify({source, resolvedPath, contentHash}) + "\n");
113
+ }
114
+ ' -- '/absolute/identified/source-1' '/absolute/identified/source-2'
115
+ ```
116
+ A new conversation or lost context requires reread; unchanged HEAD alone does not prove instruction, file or check evidence current.
117
+
118
+ <a id="handoff-task-envelope"></a>
119
+ ### Task envelope
120
+
121
+ Place the compact envelope in the existing canonical handoff record or existing inline scope record, not a new file, store or API. Record task path and outcome; instructions; target; approval; scope and criteria; risk and depth; TDD; verification; refresh. Specifically include task ID/path, source fingerprint/read context, workspace/branch/HEAD/change state/preservation/ownership, scope approval and target choice, edit boundaries/criteria, F1–F8 evidence/risk/depth, TDD or recorded exception, criterion checks/Tester/Reviewer/acceptance, and observations/changes/revalidation/holds. Link accessible records; inaccessible references do not replace required content. Embed it in the existing eight specialist brief fields in their fixed order, without a ninth field or full history.
122
+
123
+ The nine fields are `task`, `instructions`, `target`, `authorization`, `scopeCriteria`, `riskDepth`, `tdd`, `verification`, and `refresh`; task records the task ID/path and selected path `fast-direct` or `full`, and verification includes criteria-specific checks and their evidence.
124
+
125
+ <a id="handoff-evidence-refresh"></a>
126
+ ### Evidence refresh
127
+
128
+ Evaluate target choice validity separately from evidence validity. Approved HEAD or expected dirty changes do not invalidate target choice by themselves: record current state, preservation and ownership, and assess affected criteria/checks. Revalidate only affected evidence; a related file change after a check leaves that check unverified until repeated as needed. Changed instructions require reassessing linked fast/risk/TDD/authorization judgments. Preserve unaffected evidence and valid approvals. Unclear impact, missing or inaccessible evidence, ownership conflict, failure or partial/unknown state requires existing hold and recovery; workspace/target change or loss of trust follows target-choice rules. For a target change, obtain a new choice where required and state confirmation before dependent edit. Scope/criteria/method/risk changes follow existing approval and fresh-role rules. A failed direct check or Tester finding returns to existing Implementer/recheck ownership.
129
+
130
+ <a id="cooperative-cli-verification-handoff"></a>
131
+ ## Cooperative CLI verification handoff
132
+
133
+ Supported plan-mode handoffs include registered task contract, exact check descriptor, task/final scope, `status.changeFingerprints`, independent actor attestations, intent ID/result messageRef/verdict. Authorized roles execute after `prepare` and record through `result`; CLI records prove no identity/compliance.
134
+
135
+ Include spec/plan paths in cooperative `task.paths` to commit task progress records and pending revisions; missing paths hold the commit until an approved scope revision, and the cooperative CLI does not support the standalone `docs(plan)` closing commit, so include pending revisions in task or follow-up commits. When `task.paths` includes the plan path, the cooperative CLI holds R-8 separation commits (staging progress records without revision hunks) at both preflight and result verification; while revisions are pending, prior-version tasks cannot be committed through the CLI. Plan-level progress records follow the same `task.paths` rule; when no task or follow-up commit follows, they stay only in the canonical record, and the cooperative CLI adds no support for them.
136
+
137
+ On scope/docs/approval changes inspect `affectedTaskIds`/dependencies, preserve history and supply current approval/contracts. NEVER reuse checks across fingerprints. Link findings to same-version Implementer resolution/Tester rechecks; only plan-final Reviewer findings use Implementer→Reviewer. No task-level Reviewer prerequisite. Detailed fields/holds follow [verification](verification.md#verification-lifecycle-in-the-cooperative-cli); unsupported omission is no policy violation/document obligation.
138
+
139
+ <a id="initial-implementer-assignment-through-the-cooperative-cli"></a>
140
+ ## Initial Implementer assignment through the cooperative CLI
141
+
142
+ In approved plan mode all mutations pass stdin JSON through `node "$ARC_RUNTIME_ENTRY" <command> --cwd "$ARC_CHECKOUT" --workflow "$ARC_WORKFLOW_ID" --input -`. Resolve `ARC_RUNTIME_ENTRY` as `<target-home>/skills/arc/runtime/cli.mjs` from the actual installer-selected loaded skill, including custom homes, never guessed home/package/checkout/cache entries. Use separate argv for path/checkout/workflow. Safely assign/double-quote shell variables; NEVER interpolate executable paths or `eval`. Query `status` without `--input`.
143
+
144
+ Entry installation/update migrates no common-directory state or approvals. Preserve runtime/hash/target/actor/revision gates; drift holds evidence for current recovery/approval. New workflows prove no historical compliance.
145
+
146
+ 1. Verify the approved planning-document docs-only commit (Architectural spec/plan; Bounded plan), exact set/Git objects/current bytes. Only then run `init`, approval `record`, `prepare`, even if approval preceded commit.
147
+ 2. At final HEAD `init` with `mode: "plan"`, `actor: {id: "operator"}`, `selection: {messageRef, contentHash}`.
148
+ 3. Record confirmed approval as `{requestId, expectedRevision, actor, evidence: {kind: "approval", messageRef, data: {approvalVersion, documentVersion, documents}}}`. `documents` is exactly the prepared document set (spec/plan for Architectural, plan for Bounded) with `{kind, path, gitPath, contentHash, approvalRef, commit}`; `contentHash`=`sha256:<hex>`, `approvalRef` matches approval `messageRef`. HEAD drift needs fresh observation/renewed approval, not reconnection to old intent.
149
+ 4. `prepare` with `{requestId, expectedRevision, actor, operation: "assign-agent", taskId, arguments: {role: "implementer", paths, operations: ["edit"], documents, approvalRef, approvalVersion, documentVersion, correlation}}`. Absolute `paths` remain in checkout. Confirm `allow`, `persisted: true` and saved intent.
150
+ 5. Assign the Implementer with saved task/scope/correlation. Without `Mixed routing`, invoke native assignment. With `Mixed routing`, after step 4 run `prepare-dispatch` with `role: "arc_implementer"`, the same `taskId` and `allowedPaths` set to the worktree-relative form of saved `paths`, then follow the native or bridge route in [coordination](coordination.md#composite-platform-role-dispatch); the brief carries saved task/scope/correlation.
151
+ 6. Record `{requestId, expectedRevision, actor, intentId, result: {status, messageRef, data: {correlation, taskId, agentId}}}`. `intentId` is prepare requestId. Distinguish `succeeded`, `failed`, `unknown`, `mismatch`. Success needs the returned agent ID; on a bridge route it is the `dispatchId`, recorded after `run-dispatch` returns `allow`. A `prepare-dispatch` hold/deny is `failed` after `cancel` of any still-reserved lease. A `run-dispatch` hold/deny or error is `unknown`, because the bridge child may already have started; `cancel` any still-reserved lease and investigate before another assignment. unknown/mismatch holds duplicate assignment for investigation.
152
+
153
+ Approval/assignment are `operator-attested`, not native identity/event authentication. CLI blocks no outside direct call; new workflow legitimizes no historical omission. Preserve trusted-adapter provenance.
154
+
155
+ <a id="external-operations-and-recovery-in-the-cooperative-cli"></a>
156
+ ## External operations and recovery in the cooperative CLI
157
+
158
+ Three phases cover state/documents/assignment; scope/verification/acceptance/focused commits; external approval/results/audit recovery. Inspect nine areas/limits with `status.support`. Support is `plan` mode with the Architectural spec+plan or Bounded plan-only set, not no-plan/omission. CLI executes no native/provider/push/merge/deploy/publish calls.
159
+
160
+ Operator-confirmed approvals/results are `operator-attested`, `nativeVerified: false`, `remoteVerified: false`; no outside-call blocking or independent remote verification.
161
+
162
+ Record already confirmed external approval using `evidence: {kind: "external-approval", messageRef, data: {operation, scope, descriptor}}`. `scope` is unique absolute checkout paths. Local commit approval grants no external approval. Record exact action/scope/target and all descriptor fields:
163
+
164
+ | operation | descriptor fields |
165
+ |---|---|
166
+ | push | repository, destination, refspec, sourceOid, expectedRemoteOid |
167
+ | merge | repository, changeRef, targetRef, expectedTargetOid |
168
+ | deploy | service, project, environment, artifactId, destination |
169
+ | publish | service, namespace, name, version, artifactHash, destination |
170
+
171
+ Git OIDs are full lowercase 40/64-character hex; artifactHash is `sha256:<64-hex>`. Without remote observation OIDs are asserted expectations, not verified state. Destination is secret-free. No URL userinfo/query/fragment/password/token/credentials. Recognized secrets are rejected before persistence, but arbitrary-string secrecy cannot be guaranteed.
172
+
173
+ `prepare` accepts `{requestId, expectedRevision, actor: {id, role: "orchestrator"}, operation, arguments: {approvalRef, scope, descriptor}}`; approvalRef matches external approval messageRef. Persist only exact approval/scope/target/runtime versions with no unresolved effects. After `allow`/`persisted: true`, Orchestrator executes separately approved scope; CLI expands no authority.
174
+
175
+ `result`/`reconcile` accept `{requestId, expectedRevision, actor, intentId, result: {status, messageRef, data: {operation, scope, descriptor}}}`, with prepare requestId as intentId. Mismatch/unknown/stale outcomes hold while preserving attestations. After interruption inspect intent/`state.requests`/`state.audit`/`state.results` through `status` and investigate actual effects. Reconcile that same intent, not fresh preparation or replayed approvals.
176
+
177
+ Cancellation also requires `notExecutedEvidence: {messageRef}`; approval remains consumed. No automatic update/migration/renewed permission to fix drift. Report holds. Succeeded results remain attestations, not remote proof. `audit` links request→decision→intent→result→resolution but is locally editable, not tamper-proof. NEVER retry uncertain external outcomes.
178
+
179
+ <a id="composite-bridge-results-and-briefs"></a>
180
+ ## Composite bridge results and briefs
181
+
182
+ For a bridge dispatch the result is the child's final message, saved at the `resultPath` returned by `run-dispatch` and `observe`; read it from there and treat it as `operator-attested` text, not as acceptance. The brief sent to `run-dispatch` or `resume` keeps the fixed brief order from [coordination](coordination.md#token-discipline-and-handoffs) and is delivered on stdin only: NEVER put it in argv, environment variables or a positional prompt, and keep it at most 256 KiB. For audit ARC also stores the brief in `<gitCommonDir>/arc/workflows/<workflowId>/dispatches/<dispatchId>/brief.md` (mode 0600); the child still receives it on stdin only. DO NOT include secrets or raw CLI output.
@@ -0,0 +1,53 @@
1
+ # Handoff preparation contract — shared text
2
+
3
+ This file holds text shared by every platform's handoff-prep.md. Each part belongs to the section that links to it and has the same force there.
4
+
5
+ <a id="execution-target-request-gate"></a>
6
+ ### Execution-target request gate
7
+
8
+ Obtain explicit choice before preparation.
9
+
10
+ <a id="git-mutation-evidence-gate"></a>
11
+ ### Git mutation evidence gate
12
+
13
+ Before branch/worktree preparation, obtain the complete first required draft and self-review and pass the focused source/intent/preservation check. Before every preparation mutation (branch creation/switch, worktree creation, approved-doc staging/commit), read this and record/recheck:
14
+
15
+ 1. Explicit choice or verified valid reuse.
16
+ 2. Absolute workspace/intended repository, actual branch or detached HEAD and HEAD.
17
+ 3. Staged/unstaged/untracked state, preservation and ownership.
18
+ 4. Exact command/paths/approved scope; no unresolved failure or partial completion.
19
+
20
+ Missing or mismatched evidence blocks mutation. Initial preparation verifies planned scope/inputs without requiring complete approved documents. Document staging/commit also verifies the full set, applicable approvals (Architectural combined spec+plan approval; Bounded plan approval)/versions/dependencies and actual index. Read-only Git remains allowed. External skills' early commits grant no authority.
21
+
22
+ After branch/commit operations verify path/branch/HEAD/preservation/result before dependent action. After staging verify index paths/diff and finalized message. Unrelated staged paths block changes. Revalidate affected evidence after a change or failure; NEVER retroactively authorize pre-gate actions.
23
+
24
+ <a id="current-checkout"></a>
25
+ ### Current checkout
26
+
27
+ After explicit selection or valid reuse, verify absolute workspace, branch/detached HEAD, HEAD and existing changes/preservation/ownership. Record state/choice. Missing choice, uncertain state or unclear ownership blocks handoff.
28
+
29
+ <a id="planning-document-commit"></a>
30
+ ### Planning document commit
31
+
32
+ Skip only when depth rules required no documents and none were created; record why. Uncommitted documents are not absent. This adds neither documents nor gate exceptions. Unchanged authorized target/scope needs no repeated choice. NEVER automatically commit or delete other changes to prepare a target; approved planning-document commits are the sole exception, and unrelated dirty files stay preserved.
33
+
34
+ <a id="execution-time-plan-revision"></a>
35
+ ### Execution-time plan revision
36
+
37
+ After initial document batching, follow [planning](planning.md#plan-updates-during-execution) for spec/plan revisions and same-task progress records. Orchestrator alone manages pending revisions and Git; preserve unrelated work and actual approval chronology.
38
+
39
+ 1. Classify progress records versus contract/mechanical plan revisions. Verify applicable approvals under [planning](planning.md#plan-updates-during-execution) (combined spec+plan revision approval, plan approval, or spec approval with recorded no-plan-impact), actual approval time, preparation and holds; contract revisions require a fresh Implementer for remaining work. NEVER authorize past work retroactively.
40
+ 2. After approval edit the same document, append its revision-history row and leave it uncommitted. Record each pending revision with its approved content hash and approval in the canonical `.git/arc/handoff/<workflow>/` record: `gitPath`, `fromVersion`, `toVersion`, `contentHash` (approved content SHA-256), `approvalRef`, `approvedAt` (actual time), `classification` (`contract|mechanical`), `reason`, `affectedTaskIds`, `status` (`pending|committed`). Preserve each full approved version at `.git/arc/handoff/<workflow>/plan-revisions/<flattened-gitPath>.v<N>.md`; NEVER overwrite prior approvals or copies.
41
+ 3. In every role brief identify the Orchestrator-owned pending revision, working-tree version and `contentHash`. If another task's progress records were committed after approval, also include in the brief the SHA-256 of the working-tree document content, which is the approved content plus those progress records. Implementer and Tester preserve it untouched as neither their own work nor unrelated user changes.
42
+ 4. Include all pending revisions in the accepted commit of the first top-level task executed or reconfirmed against the revised version, otherwise a current task or final Reviewer follow-up commit. Only before overall completion, a standalone `docs(plan)` closing commit MAY include all pending revisions/trailers and no implementation files when no implementation work remains; keep canonical supporting evidence. Exclude pending revision hunks from independent prior-version task commits; hold the commit if separation is unsafe. Add `Plan-Revision: <gitPath> v<from> -> v<to>`, `Plan-Approved-At: <gitPath> v<N> <actual ISO 8601 approval time>` and `Plan-Reason: <gitPath> v<N> <reason>`: one revision trailer per document, approval/reason trailers per version after from through to; repeat keys as needed and preserve existing Git trailers. Use ASCII `->`. Plan-level progress records follow [commit](commit.md#execution-time-plan-document-updates) and alone never justify the closing commit.
43
+ 5. After commit verify the SHA-256 of each committed document's content (not the Git blob OID) equals the latest approved `contentHash` if no progress records have been committed since approval. Otherwise compare against the latest approved copy and allow only classified progress records of this commit's task or committed for other tasks after approval (including R-8 separation) and plan-level progress records carried by this commit. Record the SHA-256 of the expected content used for this comparison in the canonical record; NEVER overwrite approved copies. Mark recorded revisions `committed` and verify no pending revisions remain under [verification](verification.md#evidence-after-plan-revision-commit). Link commit SHA only in the canonical record, never the document. NEVER amend/reset/replay/rewrite planning or implementation commits or create other docs/fixup commits.
44
+
45
+ <a id="recovery-prerequisite"></a>
46
+ ### Recovery prerequisite
47
+
48
+ Read [git-recovery](git-recovery.md) before dependent collision/failure/partial-completion/metadata-denial recovery. Stop/preservation rules are mandatory.
49
+
50
+ <a id="instruction-and-input-provenance"></a>
51
+ ## Instruction and input provenance
52
+
53
+ Distinguish instruction/input sources, versions/approvals and access. Missing root AGENTS.md alone implies no missing user instructions. Optional reads follow only [handoff](handoff.md#instruction-sources-bounded-read-recovery-visual-evidence-and-resumption)'s pre-authorization. This exception never covers Git/generation/preparation failure or partial changes. Verify resolution evidence/gates before resume.