@yunhozz/arc 0.5.5 → 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 (84) hide show
  1. package/MANIFEST.sha256 +83 -74
  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 +3 -3
  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 +9 -24
  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 +56 -95
  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 +3 -3
  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 +9 -24
  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 +56 -95
  32. package/codex/skill/references/verification.md +15 -117
  33. package/gemini/agents/arc-implementer.md +1 -1
  34. package/gemini/skill/SKILL.md +3 -3
  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 +9 -24
  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 +56 -95
  43. package/gemini/skill/references/verification.md +16 -118
  44. package/grok/agents/arc-implementer.md +1 -1
  45. package/grok/skill/SKILL.md +2 -2
  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 +9 -24
  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 +56 -95
  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 +20 -9
  57. package/lib/prompts/render.mjs +16 -5
  58. package/lib/runtime/adapters/codex.mjs +1 -1
  59. package/lib/runtime/assignment.mjs +3 -2
  60. package/lib/runtime/cooperative.mjs +36 -3
  61. package/lib/runtime/evaluate.mjs +21 -6
  62. package/lib/runtime/gate.mjs +2 -1
  63. package/lib/runtime/schema.mjs +16 -0
  64. package/lib/runtime/target-preparation.mjs +7 -2
  65. package/lib/runtime/verification.mjs +1 -1
  66. package/package.json +1 -1
  67. package/shared/skill/references/arc-visual-companion-common.md +39 -0
  68. package/shared/skill/references/commit-common.md +45 -0
  69. package/shared/skill/references/coordination-common.md +193 -0
  70. package/shared/skill/references/git-recovery-common.md +15 -0
  71. package/shared/skill/references/handoff-common.md +182 -0
  72. package/shared/skill/references/handoff-prep-common.md +53 -0
  73. package/shared/skill/references/limits-common.md +34 -0
  74. package/shared/skill/references/planning-common.md +185 -0
  75. package/shared/skill/references/verification-common.md +170 -0
  76. package/shared/skill/runtime/adapters/codex.mjs +1 -1
  77. package/shared/skill/runtime/assignment.mjs +3 -2
  78. package/shared/skill/runtime/cooperative.mjs +36 -3
  79. package/shared/skill/runtime/evaluate.mjs +21 -6
  80. package/shared/skill/runtime/gate.mjs +2 -1
  81. package/shared/skill/runtime/role-policy.json +1 -1
  82. package/shared/skill/runtime/schema.mjs +16 -0
  83. package/shared/skill/runtime/target-preparation.mjs +7 -2
  84. package/shared/skill/runtime/verification.mjs +1 -1
@@ -1,21 +1,12 @@
1
1
  <a id="role-assignment-and-coordination"></a>
2
2
  # Role assignment and coordination
3
3
 
4
- 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.
4
+ Shared text for this section: [coordination-common.md#role-assignment-and-coordination](coordination-common.md#role-assignment-and-coordination). It applies here exactly as if written in place.
5
5
 
6
6
  <a id="ownership"></a>
7
7
  ## Ownership
8
8
 
9
- | Role | Ownership and return |
10
- |---|---|
11
- | 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 |
12
- | 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 |
13
- | Planner | Returns design/spec/plan drafts |
14
- | Implementer | Edits approved assigned implementation/configuration/tests/dependent docs; Orchestrator direct edits only under the small-task path |
15
- | Tester | Verifies without editing |
16
- | Reviewer | Independently reviews the final full change |
17
-
18
- Orchestrator is depth 1. All five specialists report directly at depth 2 without creating agents/delegating. Reviewer stays independent.
9
+ Shared text for this section: [coordination-common.md#ownership](coordination-common.md#ownership). It applies here exactly as if written in place.
19
10
 
20
11
  ### Execution mode
21
12
 
@@ -25,54 +16,37 @@ Standalone native names: Scouter=`arc-scouter`, Planner=`arc-planner`, Implement
25
16
 
26
17
  Composite native names (`Mixed routing`): Markdown-profile platforms use `arc-routing-<suffix>`; Codex uses `arc_routing_<suffix>`; the suffix is the role name. NEVER pass a model argument when spawning them.
27
18
 
28
- 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.
19
+ Shared text for this section: [coordination-common.md#coordination-execution-mode](coordination-common.md#coordination-execution-mode). It applies here exactly as if written in place.
29
20
 
30
21
  ARC limits do not prove native concurrency/depth support. Invoke installed native names and receive results; report unavailable execution. Scouter/Planner/Reviewer cannot edit, execute commands or save documents. Tester verifies without edits. Stay within shipped allowlists, which are not filesystem sandboxes.
31
22
 
23
+ After each read-only role return (Scouter/Planner/Reviewer), compare `git status` with the pre-spawn snapshot. Unexpected changes stop under Preservation rule. Concurrent Implementer edits and ignored/out-of-repository paths cannot be attributed/detected. Read-only is prompt policy, not sandbox enforcement.
24
+
32
25
  <a id="instruction-and-execution-adapter"></a>
33
26
  ## Instruction and execution adapter
34
27
 
35
28
  Claude profiles use Markdown frontmatter with `effort`. Native `env.CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS` is a string separate from the ARC ledger. Allowlists/prompts are not a filesystem sandbox; declarations prove no enforcement.
36
29
 
37
- 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.
38
-
39
- 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.
40
-
41
- 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.
42
-
43
- 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.
44
-
45
- 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.
46
-
47
- 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.
30
+ Shared text for this section: [coordination-common.md#instruction-and-execution-adapter](coordination-common.md#instruction-and-execution-adapter). It applies here exactly as if written in place.
48
31
 
49
32
  Planner/Reviewer/Scouter return findings/questions/actions/path issues; Planner preserves complete drafts. Task boundaries alone add no Tester/review. Unverified risky dependencies require boundary Tester and resolved/explicitly dispositioned findings before implementation, not blanket task gates.
50
33
 
51
34
  <a id="local-superpowers-references"></a>
52
35
  ### Local Superpowers references
53
36
 
54
- 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.
37
+ Shared text for this section: [coordination-common.md#local-superpowers-references](coordination-common.md#local-superpowers-references). It applies here exactly as if written in place.
55
38
 
56
39
  <a id="token-discipline-and-handoffs"></a>
57
- Return the complete first required draft and self-review from the verified source before target preparation; compare the prepared target before saving or handoff.
40
+ Shared text for this section: [coordination-common.md#token-discipline-and-handoffs](coordination-common.md#token-discipline-and-handoffs). It applies here exactly as if written in place.
58
41
 
59
42
  ## Context discipline and handoffs
60
43
 
61
44
  Only Orchestrator invokes/assigns Claude roles. Describe role and bounded objective. Installed native profiles determine role/local models.
62
45
 
63
- Use this fixed brief order:
64
-
65
- 1. Goal
66
- 2. Criteria (IDs)
67
- 3. Exact scope/ownership: absolute workspace, branch or detached HEAD and HEAD, existing record path, files
68
- 4. Constraints/decisions
69
- 5. Evidence: paths/lines, commands, artifact links
70
- 6. Prior findings
71
- 7. Exact next objective: one bounded objective
72
- 8. Return format: conclusion, evidence locations, unresolved points, next step
46
+ Shared text for this section: [coordination-common.md#coordination-context-discipline-and-handoffs](coordination-common.md#coordination-context-discipline-and-handoffs). It applies here exactly as if written in place.
73
47
 
74
48
  - Follow-ups send changed fields only; mark others `unchanged` relative to a received brief. Restarts follow handoff; fresh specialists receive other fields in full.
75
- - Send a self-contained needed subset and accessible artifacts. Omit full history/repeated instructions/raw logs. No-findings reports may be brief; requested full drafts remain complete. Cite locations/commands/links, investigating gaps only.
49
+ - Send a self-contained needed subset and accessible artifacts. Omit full history/repeated instructions/raw logs. No-findings reports MAY be brief; requested full drafts remain complete. Cite locations/commands/links, investigating gaps only.
76
50
  - `AskUserQuestion` uses only `question`, `header` of at most 12 characters, 2–4 `options` with `label`/`description`, and `multiSelect`.
77
51
  - Start installed `arc-*` names with scoped briefs only, never inheriting forks such as `fork`; claim fresh isolation only with evidence. Reuse valid related context, not unrelated/bloated context. Role gate governs Implementer/Tester freshness.
78
52
  - Brief absolute local ARC SKILL.md paths: `test-driven-development` for Implementer, `brainstorming`/`writing-plans` for Planner. Read before dependent work.
@@ -85,23 +59,23 @@ Use this fixed brief order:
85
59
  - At plan completion or before another plan in a long session, record canonical handoff and recommend a new session.
86
60
  - Before handoff briefly state role/objective/output; after return combine findings/next stage. NEVER expose hidden reasoning/raw prompts.
87
61
 
88
- 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.
62
+ Shared text for this section: [coordination-common.md#coordination-context-discipline-and-handoffs-2](coordination-common.md#coordination-context-discipline-and-handoffs-2). It applies here exactly as if written in place.
89
63
 
90
64
  ## Planner dispatch efficiency
91
65
 
92
- 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. Within the design/brainstorming stage one Planner handles the initial draft, 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. After design approval, the spec stage and the plan stage each use a fresh Planner whose brief contains every required field plus saved document paths and approved versions; 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, a resend after a return without a draft uses the consolidated-correction opportunity; later further calls still need new input. Orchestrator MAY set a handback size limit in the brief.
66
+ Shared text for this section: [coordination-common.md#coordination-planner-dispatch-efficiency](coordination-common.md#coordination-planner-dispatch-efficiency). It applies here exactly as if written in place.
93
67
 
94
68
  <a id="models"></a>
95
69
  ## Models
96
70
 
97
- 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.
71
+ Shared text for this section: [coordination-common.md#models](coordination-common.md#models). It applies here exactly as if written in place.
98
72
 
99
73
  `arc_scouter`, `arc_planner`, `arc_implementer`, `arc_tester`, `arc_reviewer` settings map to hyphenated native names, not tool calls. For visualization read [visual companion](arc-visual-companion.md), use only actual allowlisted tools and report unavailable/unverified scope. Shipped `model`/`effort` defaults are replaced with active `models.toml` role settings at installation.
100
74
 
101
75
  <a id="instruction-and-input-provenance"></a>
102
76
  ## Instruction and input provenance
103
77
 
104
- 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).
78
+ Shared text for this section: [coordination-common.md#instruction-and-input-provenance](coordination-common.md#instruction-and-input-provenance). It applies here exactly as if written in place.
105
79
 
106
80
  [ARC role policy: contract begin]
107
81
  Generated from lib/policy/role-policy.json; do not edit this managed section manually.
@@ -116,105 +90,25 @@ Generated from lib/policy/role-policy.json; do not edit this managed section man
116
90
 
117
91
  ## Composite Platform Role Dispatch
118
92
 
119
- `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).
120
-
121
- 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.
122
-
123
- Procedure, in order:
124
-
125
- 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`.
126
- 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`.
127
- 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.
128
- 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).
129
- 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.
130
- 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.
93
+ Shared text for this section: [coordination-common.md#coordination-composite-platform-role-dispatch](coordination-common.md#coordination-composite-platform-role-dispatch). It applies here exactly as if written in place.
131
94
 
132
95
  ### Host rules
133
96
 
134
- | executionEnvironment | Claude target | Codex target | Gemini target | Grok target |
135
- |---|---|---|---|---|
136
- | `claude-cli` | Native, all roles | Bridge, all roles | Bridge, read roles only (GG1 `fail`; Implementer/Tester held as `permission_scope_unverified`) | Bridge, all roles |
137
- | `codex-cli` | Bridge, all roles | Native, all roles | Bridge, read roles only (GG1 `fail`; Implementer/Tester held as `permission_scope_unverified`) | Bridge, all roles |
138
- | `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) |
139
- | `grok-cli` | Bridge, all roles | Bridge, all roles | Bridge, read roles only (GG1 `fail`; Implementer/Tester held as `permission_scope_unverified`) | Native, all roles |
140
- | `claude-desktop` | Held (`environment_unverified`) | Held (`environment_unverified`) | Held (`environment_unverified`) | Held (`environment_unverified`) |
141
- | `codex-desktop` | Held (`environment_unverified`) | Held (`environment_unverified`) | Held (`environment_unverified`) | Held (`environment_unverified`) |
142
-
143
- 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.
144
-
145
- **Claude**
146
-
147
- - Approval: No per-call ARC approval gate.
148
- - Target home probe: None.
149
- - Desktop: Held as described below.
150
-
151
- **Codex**
152
-
153
- - 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`.
154
- - 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.
155
- - Target home probe: None.
156
- - Desktop: Held as described below.
157
-
158
- **Gemini**
159
-
160
- - Approval: Hold the host pending live host measurement (GG2). The registry lists `gemini` and `gemini-cli`, but `compositeHost` is off.
161
- - Target home probe: See the shared probe rule below. The capability hold applies before the probe.
162
- - Desktop: No Desktop value.
163
-
164
- **Grok**
165
-
166
- GK2 is `approval`.
167
-
168
- - 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.
169
- - Target home probe: See the shared probe rule below.
170
- - Desktop: No Desktop value.
97
+ Shared text for this section: [coordination-common.md#coordination-host-rules](coordination-common.md#coordination-host-rules). It applies here exactly as if written in place.
171
98
 
172
99
  #### Shared host rules
173
100
 
174
- - 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`.
175
- - 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`.
101
+ Shared text for this section: [coordination-common.md#coordination-shared-host-rules](coordination-common.md#coordination-shared-host-rules). It applies here exactly as if written in place.
176
102
 
177
103
  ### Bridge target rules
178
104
 
179
- - 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`.
180
-
181
- **Claude**
182
-
183
- - 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).
184
- - 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`.
185
- - Delegation: Role instructions forbid re-delegation. Claude children expose no Task tool. Apply the shared child guard below.
186
- - Execution confirmation: Check the stream session identity and model, transcript effort, and the observed terminal result.
187
-
188
- **Codex**
189
-
190
- - Gate: G4 applies to every Codex bridge role. G4 `pass` permits dispatch; a failed G4 holds as `permission_scope_unverified`.
191
- - Writing roles: Codex `workspace-write` may reach beyond the worktree (G5): writes outside the worktree are outside post-run detection.
192
- - 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`.
193
- - 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).
194
- - Execution confirmation: Check the rollout for model, effort, sandbox mode and approval policy, and check the observed terminal result.
195
-
196
- **Gemini**
197
-
198
- - 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.
199
- - Permission claim: The worktree snapshot covers only Git-visible worktree changes.
200
- - Delegation: The dispatch record reports `unverifiedContracts.delegation` as `undetectable`.
201
- - Execution confirmation: Check the stream session ID against the recorded ID, the observed model and the terminal result. Effort stays `unverified`.
202
-
203
- **Grok**
204
-
205
- - 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`.
206
- - 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.
207
- - 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.
208
- - Permission claim: The worktree snapshot covers only Git-visible worktree changes.
209
- - Delegation: The dispatch record reports `unverifiedContracts.delegation` as `undetectable`.
210
- - Execution confirmation: Check the stream session ID against the recorded ID, the observed model and the terminal result. Effort stays `unverified`.
105
+ Shared text for this section: [coordination-common.md#coordination-bridge-target-rules](coordination-common.md#coordination-bridge-target-rules). It applies here exactly as if written in place.
211
106
 
212
107
  ### Bridge tool access
213
108
 
214
- 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 and Claude, the gates for full network access and all three Playwright services have the value `held`. Never enable additional access by default for Tester. Check the dispatch's `toolAccess.conditions` when a grant is conditional.
215
-
216
- 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.
109
+ Shared text for this section: [coordination-common.md#coordination-bridge-tool-access](coordination-common.md#coordination-bridge-tool-access). It applies here exactly as if written in place.
217
110
 
111
+ <a id="coordination-shared-dispatch-rules"></a>
218
112
  ### Shared dispatch rules
219
113
 
220
114
  - Bridge children receive the profile instructions only and NEVER load ARC `SKILL.md`. Role instructions forbid re-delegation.
@@ -10,7 +10,7 @@ Apply the Preservation rule: preserve unrelated work and recovery artifacts. No
10
10
  <a id="branch-collision-and-invalid-names"></a>
11
11
  ## Branch collisions and invalid names
12
12
 
13
- 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.
13
+ Shared text for this section: [git-recovery-common.md#branch-collision-and-invalid-names](git-recovery-common.md#branch-collision-and-invalid-names). It applies here exactly as if written in place.
14
14
 
15
15
  <a id="git-metadata-write-denial"></a>
16
16
  ## Git metadata write denial
@@ -24,11 +24,11 @@ Invalid names, creation/switch failures, lookup errors or unexpected branches re
24
24
  <a id="handoff-record-write-denial"></a>
25
25
  ## Handoff record write denial
26
26
 
27
- 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.
27
+ Shared text for this section: [git-recovery-common.md#handoff-record-write-denial](git-recovery-common.md#handoff-record-write-denial). It applies here exactly as if written in place.
28
28
 
29
29
  If canonical-record writing is denied/unavailable, stop it and report path/error. NEVER change permissions or bypass sandbox. Use [handoff](handoff.md)'s inline fallback.
30
30
 
31
- Orchestrator inspects related processes/ACLs read-only itself or assigns Tester; Scouter/Planner/Reviewer cannot execute commands. Failed profile reapplication MUST restore replaced bytes/modes. If rollback fails, preserve recovery files/paths; NEVER claim clean state or remove recovery material.
31
+ Orchestrator inspects related processes/ACLs read-only itself or assigns Tester; Scouter/Planner/Reviewer cannot execute commands.
32
32
 
33
33
  <a id="worktree-failures-and-partial-completion"></a>
34
34
  ### Worktree failures and partial completion
@@ -9,30 +9,21 @@ Offer three options: current checkout, new task branch in that checkout, or new
9
9
  <a id="execution-target-request-gate"></a>
10
10
  ### Execution-target request gate
11
11
 
12
- Before requesting choice, verify/record planned document scope, absolute paths/coverage, design/plan depth/valid omissions, dependencies and order. Completed documents/individual approvals are not yet required; unfinished drafts alone do not block asking. Include required artifacts, not mandatory specs everywhere. Settle scope/dependencies needed to identify the target without requiring choice evidence before asking.
12
+ Before requesting choice, verify/record planned document scope, absolute paths/coverage, design/plan depth/valid omissions, dependencies and order. Completed documents/approvals are not yet required; unfinished drafts alone do not block asking. Include required artifacts, not mandatory specs everywhere. Settle scope/dependencies needed to identify the target without requiring choice evidence before asking.
13
13
 
14
14
  Present each supported option with:
15
15
 
16
16
  - Planned documents, coverage, expected relative paths, dependencies/order and pending drafting/approval.
17
17
  - Verified absolute workspace/repository, branch or detached HEAD, base HEAD, validated offered branch candidate/collision, staged/unstaged/untracked state, preservation/ownership.
18
18
 
19
- Obtain explicit choice before preparation.
19
+ Shared text for this section: [handoff-prep-common.md#execution-target-request-gate](handoff-prep-common.md#execution-target-request-gate). It applies here exactly as if written in place.
20
20
 
21
21
  Present current checkout (current branch/detached HEAD), new task branch in that checkout, or new managed worktree and task branch at `.claude/worktrees/<name>`. Planning approval/silence chooses none. Before offering managed worktrees, verify/present source absolute path/repository/common directory, source branch/detached HEAD/full SHA, approved candidate/collision, name/path, planned documents and existing approved transfer/commit scope. Validate naming/collision and source unrelated staging/approved document HEAD/index/working bytes. NEVER substitute/fetch remote/default base. Only after explicit selection read [handoff-worktree](handoff-worktree.md), before creation/branch/transfer. Preserve unrelated work; no preparation stash/reset/clean.
22
22
 
23
23
  <a id="git-mutation-evidence-gate"></a>
24
24
  ### Git mutation evidence gate
25
25
 
26
- 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:
27
-
28
- 1. Explicit choice or verified valid reuse.
29
- 2. Absolute workspace/intended repository, actual branch or detached HEAD and HEAD.
30
- 3. Staged/unstaged/untracked state, preservation and ownership.
31
- 4. Exact command/paths/approved scope; no unresolved failure or partial completion.
32
-
33
- 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, individual approvals/versions/dependencies and actual index. Read-only Git remains allowed. External skills' early commits grant no authority.
34
-
35
- 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.
26
+ Shared text for this section: [handoff-prep-common.md#git-mutation-evidence-gate](handoff-prep-common.md#git-mutation-evidence-gate). It applies here exactly as if written in place.
36
27
 
37
28
  <a id="new-task-branch"></a>
38
29
  <a id="new-task-branch-naming"></a>
@@ -61,12 +52,12 @@ Immediately recheck workspace, branch/detached HEAD, base and candidate. Changed
61
52
  <a id="current-checkout"></a>
62
53
  ### Current checkout
63
54
 
64
- 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.
55
+ Shared text for this section: [handoff-prep-common.md#current-checkout](handoff-prep-common.md#current-checkout). It applies here exactly as if written in place.
65
56
 
66
57
  <a id="planning-document-commit"></a>
67
58
  ### Planning document commit
68
59
 
69
- Begin after target preparation and all applicable documents are written/individually approved. Paths requiring both spec and plan (Architectural or spec-required Bounded) permit no document commit on spec approval alone; after every planned spec/plan is individually approved, record the remaining ones in one planning-document commit. Plan-less paths commit their own approved document set. Verify full set/evidence/versions before staging/commit. New branches require successful switch, actual branch, unchanged path/preservation. Current checkout requires selected branch/detached HEAD/path/changes.
60
+ Begin after target preparation and all applicable documents are written and approved. Architectural paths permit no document commit before the one combined spec+plan approval; after it, record the spec and every plan in one planning-document commit. Bounded plan-required paths commit their approved plans in one planning-document commit. Plan-less paths commit their own approved document set. Verify full set/evidence/versions before staging/commit. New branches require successful switch, actual branch, unchanged path/preservation. Current checkout requires selected branch/detached HEAD/path/changes.
70
61
  For worktrees verify actual registration/`EnterWorktree` session attachment/identity/base/branch and directly written documents or protected legacy/restart transfers before target docs commits. Commit remaining approvals once at target; no automatic source docs commit.
71
62
 
72
63
  1. Verify already committed approvals by SHA, actual message/paths/content and selected-checkout validity; reuse without recommitting.
@@ -76,18 +67,12 @@ For worktrees verify actual registration/`EnterWorktree` session attachment/iden
76
67
  5. Failure/staged-content mismatch stops handoff. Inspect branch/HEAD/index/partial completion and resolve before resuming; NEVER commit implementation instead.
77
68
  6. Verify SHA/message/paths/content, post-commit HEAD/branch and remaining state in the brief, including selected base and actual order/deviations. Command success alone proves no preparation. Docs commit is neither implementation acceptance nor push approval; no push without separate explicit request.
78
69
 
79
- 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.
70
+ Shared text for this section: [handoff-prep-common.md#planning-document-commit](handoff-prep-common.md#planning-document-commit). It applies here exactly as if written in place.
80
71
 
81
72
  <a id="execution-time-plan-revision"></a>
82
73
  ### Execution-time plan revision
83
74
 
84
- 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.
85
-
86
- 1. Classify progress records versus contract/mechanical plan revisions. Verify applicable approvals, actual approval time, ordered written-spec/dependent-plan approval, preparation and holds; contract revisions require a fresh Implementer for remaining work. NEVER authorize past work retroactively.
87
- 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.
88
- 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.
89
- 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.
90
- 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.
75
+ Shared text for this section: [handoff-prep-common.md#execution-time-plan-revision](handoff-prep-common.md#execution-time-plan-revision). It applies here exactly as if written in place.
91
76
 
92
77
  <a id="verification-brief-inputs"></a>
93
78
  ### Verification brief inputs
@@ -97,12 +82,12 @@ Tester briefs MUST include the required field `mode: task | final`. One assignme
97
82
  <a id="recovery-prerequisite"></a>
98
83
  ### Recovery prerequisite
99
84
 
100
- Read [git-recovery](git-recovery.md) before dependent collision/failure/partial-completion/metadata-denial recovery. Stop/preservation rules are mandatory.
85
+ Shared text for this section: [handoff-prep-common.md#recovery-prerequisite](handoff-prep-common.md#recovery-prerequisite). It applies here exactly as if written in place.
101
86
 
102
87
  <a id="instruction-and-input-provenance"></a>
103
88
  ## Instruction and input provenance
104
89
 
105
- 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.
90
+ Shared text for this section: [handoff-prep-common.md#instruction-and-input-provenance](handoff-prep-common.md#instruction-and-input-provenance). It applies here exactly as if written in place.
106
91
 
107
92
  [ARC role policy: contract begin]
108
93
  Generated from lib/policy/role-policy.json; do not edit this managed section manually.