@yunhozz/arc 0.1.3 → 0.1.5

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 (33) hide show
  1. package/MANIFEST.sha256 +32 -29
  2. package/claude/agents/arc-coder.md +1 -1
  3. package/claude/agents/arc-qa.md +2 -2
  4. package/claude/skill/SKILL.md +17 -294
  5. package/claude/skill/references/commit.md +5 -11
  6. package/claude/skill/references/coordination.md +148 -0
  7. package/claude/skill/references/git-recovery.md +3 -2
  8. package/claude/skill/references/handoff-prep.md +4 -11
  9. package/claude/skill/references/handoff.md +69 -8
  10. package/claude/skill/references/limits.md +1 -1
  11. package/claude/skill/references/planning.md +20 -24
  12. package/claude/skill/references/verification.md +39 -9
  13. package/claude/skill/references/visual-companion.md +1 -1
  14. package/codex/agents/arc-coder.toml +1 -0
  15. package/codex/agents/arc-planner.toml +2 -0
  16. package/codex/agents/arc-qa.toml +2 -0
  17. package/codex/agents/arc-reviewer.toml +2 -0
  18. package/codex/agents/arc-scouter.toml +2 -0
  19. package/codex/skill/SKILL.md +19 -281
  20. package/codex/skill/references/commit.md +10 -24
  21. package/codex/skill/references/coordination.md +129 -0
  22. package/codex/skill/references/git-recovery.md +21 -18
  23. package/codex/skill/references/handoff-prep.md +14 -25
  24. package/codex/skill/references/handoff-worktree.md +10 -12
  25. package/codex/skill/references/handoff.md +81 -34
  26. package/codex/skill/references/limits.md +1 -1
  27. package/codex/skill/references/planning.md +36 -46
  28. package/codex/skill/references/verification.md +73 -53
  29. package/codex/skill/references/visual-companion.md +6 -8
  30. package/lib/installer/global-config.mjs +1 -2
  31. package/lib/policy/placement.mjs +25 -0
  32. package/lib/policy/render.mjs +12 -4
  33. package/package.json +1 -1
@@ -1,30 +1,34 @@
1
1
  # Git recovery contract
2
2
 
3
- Read on branch collision, Git preparation failure, partial completion, or metadata write denial.
3
+ Read on branch collision, Git preparation failure, partial completion, metadata write denial, or handoff record write denial.
4
4
  Use [handoff-prep.md](handoff-prep.md) for approved branch selection, [handoff-worktree.md](handoff-worktree.md) for the
5
5
  managed worktree path, and [handoff.md](handoff.md) for the complete restart gate.
6
6
 
7
+ ## Recovery cases
8
+
7
9
  ### Git metadata write denial
8
10
 
9
11
  If authorized staging, committing, branch creation, or switching is denied while writing `.git/index.lock` or other
10
12
  Git metadata, Orchestrator blocks handoff and safely inspects the exact command, workspace, error, failed path,
11
- actual Git
12
- directory, branch, HEAD, index state, and partial completion. Read-only inspection includes lock existence and any
13
+ actual Git directory, branch, HEAD, index state, and partial completion. Read-only inspection includes lock existence and any
13
14
  observable related processes, sandbox restrictions, OS permissions/ACLs, and concurrent Git activity. Record supported
14
15
  causes and remaining uncertainty; denial of lock creation alone does not prove a stale lock.
15
16
 
16
17
  Apply the Preservation rule: do not delete lock files, use `chmod` or `chown`, bypass the sandbox, or move to another
17
- workspace. If
18
- evidence confirms sandbox denial of an already authorized operation, request through the permission system only (not
18
+ workspace. If evidence confirms sandbox denial of an already authorized operation, request through the permission system only (not
19
19
  a sandbox bypass) the tool-supported minimum escalation for only the exact single Git command and workspace, never
20
- broad Git access. Before retrying,
21
- recheck branch, HEAD, index, and partial completion; do not repeat work already completed. After success verify the
22
- commit or branch result and final state, then reevaluate the entire handoff gate. Denied escalation or unresolved OS
23
- permission/ACL problems keep handoff blocked; report the reason and actual state to Orchestrator/user.
24
- Choosing the final
25
- message in advance prevents unnecessary amend but does not repair required Git write access; only successful
20
+ broad Git access. Before retrying, recheck branch, HEAD, index, and partial completion; do not repeat work already
21
+ completed. After success verify the commit or branch result and final state, then reevaluate the entire handoff gate.
22
+ Denied escalation or unresolved OS permission/ACL problems keep handoff blocked; report the reason and actual state to Orchestrator/user.
23
+ Choosing the final message in advance prevents unnecessary amend but does not repair required Git write access; only successful
26
24
  authorized writes and verified results establish recovery.
27
25
 
26
+ ### Handoff record write denial
27
+
28
+ If writing the canonical handoff record is denied or unavailable, stop that write, report the path and error to
29
+ Orchestrator, and do not change permissions or bypass the sandbox. Use the inline-record fallback in
30
+ [handoff.md](handoff.md).
31
+
28
32
  ### Existing changes and failures
29
33
 
30
34
  A branch does not isolate uncommitted changes into a separate directory as a worktree does. Record how existing staged,
@@ -44,15 +48,14 @@ execution-target choice block handoff. Orchestrator resolves the problem and rec
44
48
  ### Worktree failures and partial completion
45
49
 
46
50
  Worktree creation, registration, attachment, identity/base verification, checkout, document transfer, staging,
47
- or commit failure means stop dependent work
48
- and Coder handoff. Partial completion includes branch-only creation, partial path creation, registration/actual-path
49
- mismatch, wrong base or branch, and partial document transfer. Record source and target exact command, error,
50
- branch, HEAD, Git common directory, registration, index and files, including target dirty state and source preservation.
51
- Before any authorized retry, inspect actual state and completed work under the Stop and inspect rule; do not repeat
52
- completed actions.
51
+ or commit failure means stop dependent work and Coder handoff. Partial completion includes branch-only creation, partial
52
+ path creation, registration/actual-path mismatch, wrong base or branch, and partial document transfer. Record source and
53
+ target exact command, error, branch, HEAD, Git common directory, registration, index and files, including target dirty
54
+ state and source preservation. Before any authorized retry, inspect actual state and completed work under the Stop and
55
+ inspect rule; do not repeat completed actions.
53
56
  Do not automatically fallback, retry another path/branch, delete paths, prune registrations with `git worktree prune`,
54
57
  or use `--force` or `-B`; apply the Preservation rule.
55
- Normal worktree preparation after explicit third-path selection is permitted under handoff; moving to an arbitrary
58
+ Normal worktree preparation after explicit managed-worktree selection is permitted under handoff; moving to an arbitrary
56
59
  workspace during recovery remains prohibited. Resolve preparation and revalidate the full gate; a new explicit choice
57
60
  follows Choice lifetime and restart record in handoff.md. No automatic cleanup/archive is authorized.
58
61
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Orchestrator reads before an execution-target choice request and each preparation Git mutation (branch creation/switch,
4
4
  staging, commit). The new managed worktree option's selection target is listed in the Execution-target request gate.
5
- The Coder start gate, handoff evidence and choice lifetime are in [handoff.md](handoff.md).
5
+ The [Coder handoff gate](handoff.md#coder-handoff-gate), handoff evidence and choice lifetime are in [handoff.md](handoff.md).
6
6
 
7
7
  ## Workspace handoff
8
8
 
@@ -22,14 +22,12 @@ For every supported execution-target option, before obtaining the user's choice,
22
22
 
23
23
  Obtain explicit choice under the Explicit choice rule before preparation.
24
24
  When offering the new managed worktree option, Orchestrator first verifies and then presents its selection target
25
- (source absolute
26
- path, intended repository and Git common directory, source branch or detached HEAD, verified full source HEAD SHA,
25
+ (source absolute path, intended repository and Git common directory, source branch or detached HEAD, verified full source HEAD SHA,
27
26
  approved branch candidate and collision status, descriptive name, planned document scope and any existing approved document transfer/commit scope). Verification
28
27
  validates the approved branch candidate and collision status under New task branch naming rules and checks source state
29
28
  (unrelated staged changes; existing approved document HEAD/index/working-tree state) before offering. The app chooses the actual
30
29
  destination path: do not ask the user for a destination path or propose one, and do not fetch or substitute a remote
31
- HEAD
32
- or default branch for the base. Read [handoff-worktree.md](handoff-worktree.md) only after the user
30
+ HEAD or default branch for the base. Read [handoff-worktree.md](handoff-worktree.md) only after the user
33
31
  explicitly selects that option and before its creation, branch work, or document transfer.
34
32
 
35
33
  ### Git mutation evidence gate
@@ -71,7 +69,9 @@ main purpose and a short, specific lowercase kebab-case topic with no spaces. Fo
71
69
  | revert/ | Revert a prior change |
72
70
 
73
71
  Validate the name and check for collisions before creation. If the base name exists, never automatically substitute a
74
- suffix; present a new candidate for explicit approval. Never reuse, delete, or overwrite an existing branch.
72
+ suffix; present a new candidate for explicit approval. Never reuse, delete, or overwrite an existing branch, except
73
+ that reuse of an approved existing branch on the managed worktree path follows the conditions in
74
+ [handoff-worktree.md](handoff-worktree.md) (Exception for this managed path).
75
75
  Distinguish a lookup error from a missing branch.
76
76
  Recheck the workspace, current branch or detached HEAD, base HEAD, and candidate before execution. If the approval
77
77
  target changes, present the new target and obtain explicit user approval. If the candidate changes because of a new
@@ -89,9 +89,9 @@ creation.
89
89
  ### Current checkout
90
90
 
91
91
  Only after the user explicitly selects the current checkout for this handoff, or valid reuse is verified,
92
- confirm the absolute workspace,
93
- current branch or detached HEAD, HEAD, and existing changes with their preservation and edit ownership. Record this
94
- state and the choice evidence in the brief. Missing choice, unconfirmed state, or unclear ownership blocks handoff.
92
+ confirm the absolute workspace, current branch or detached HEAD, HEAD, and existing changes with their preservation and
93
+ edit ownership. Record this state and the choice evidence in the brief. Missing choice, unconfirmed state, or unclear
94
+ ownership blocks handoff.
95
95
 
96
96
  ### Planning document commit
97
97
 
@@ -100,12 +100,11 @@ Verify complete approved document set, approval evidence and versions before sta
100
100
  On the new task branch path, verify the successful switch, actual branch, unchanged checkout path, and preserved
101
101
  changes first. On the current checkout path, verify the selected branch or detached HEAD, path, and existing changes.
102
102
  On the new worktree path, verify the created app-managed worktree, current-chat attachment, identity/base, approved
103
- branch and direct target documents (or protected legacy/restart document transfer) before any target docs commit.
103
+ branch and direct target documents (or protected pre-existing/restart document transfer) before any target docs commit.
104
104
  At the target, commit only remaining approved documents once; do not automatically make a source document commit.
105
105
  Record the selected base SHA and post-commit HEAD.
106
106
  Orchestrator verifies each approved spec/plan already committed for this task by SHA, actual message, included paths,
107
- and
108
- content matching the approved version and validity in the selected checkout; reuse valid commits without recommitting
107
+ and content matching the approved version and validity in the selected checkout; reuse valid commits without recommitting
109
108
  them.
110
109
 
111
110
  For approved documents still uncommitted, Orchestrator records the approved versions and paths, finalizes the specific
@@ -119,10 +118,9 @@ MUST NOT commit a generic temporary message and routinely repair it with `git co
119
118
 
120
119
  If the docs commit fails or staged content differs, stop handoff and apply the Stop and inspect rule to the actual
121
120
  branch, HEAD, index, and partial completion. Resolve the issue before resuming; do not commit implementation instead.
122
- After success verify SHA, actual
123
- message, included paths/content, post-commit HEAD, final branch, and staged/unstaged/untracked state in the brief.
124
- A successful command exit alone does not prove preparation complete. This commit is not implementation acceptance
125
- or push approval; do not push without a separate explicit user request.
121
+ After success verify SHA, actual message, included paths/content, post-commit HEAD, final branch, and
122
+ staged/unstaged/untracked state in the brief. A successful command exit alone does not prove preparation complete. This
123
+ commit is not implementation acceptance or push approval; do not push without a separate explicit user request.
126
124
 
127
125
  Skip this commit only when no planning documents were required and none were produced under the design/plan depth
128
126
  rules; record that fact and the applicable depth rationale. Uncommitted documents cannot be treated as absent.
@@ -139,14 +137,5 @@ Generated from lib/policy/role-policy.json; do not edit this managed section man
139
137
  - [git.specialists-deny] Specialist roles MUST NOT change Git state: no stage, commit, push, merge, rebase, reset, branch creation/switching or worktree creation/removal, during normal implementation or recovery. Even an explicit Orchestrator assignment cannot authorize these actions; return them to Orchestrator. Read-only Git inspection remains allowed within the assigned scope.
140
138
  - [git.orchestrator-accept-commit] Only Orchestrator accepts work and executes Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied; Orchestrator accepts then commits without additional user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership and verify the resulting SHA, included content, HEAD and remaining changes. Existing small-task direct and plan-omission paths are unchanged.
141
139
  - [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority grants no external authority. Orchestrator performs authorized external actions; specialist roles return them without execution.
142
- - [role.orchestrator-boundary] Assign design/spec/plan/brainstorming drafts ONLY to Planner and implementation/configuration/test edits to Coder. Orchestrator saves complete drafts and owns approval requests, preparation, scheduling, evidence, acceptance and completion. Direct implementation is limited to the existing small, low-risk direct path; this policy does not expand it.
143
- - [role.scouter-read-only] Research assigned static sources and report findings, evidence and limits. Do not edit files, install, execute checks, prepare execution targets, inspect live operational state, change external state or decide design, verification, review or acceptance.
144
- - [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response. MUST NOT save documents, implement, run checks, prepare targets, request user approval or decide acceptance. Stop formal target-dependent drafting if actual prepared target evidence is missing; route decisions to Orchestrator.
145
- - [role.coder-implementation] Edit only assigned, approved files and run focused checks under the existing TDD contract. Report changed files, RED/GREEN or authorized exception evidence, results, limits and follow-up. Do not plan, independently QA/review your own work, accept the task or declare overall completion. Git changes remain forbidden even when implementation succeeds.
146
- - [role.qa-verification] Run approved checks and report commands, observations, reproduction, evidence and limits. Create only essential temporary data/logs/reports in the brief-authorized location and lifetime. Do not edit product source, tests, fixtures or configuration to pass checks, deploy or accept work. Persistent product-state checks require explicit scope and cleanup ownership. Return failures for Coder correction and required QA recheck.
147
- - [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only. MUST NOT execute QA tests, edit files, perform Git mutations or decide acceptance.
148
- - [review.significant-no-plan] For significant/high-risk work without a plan: Coder → QA and required QA rechecks → Reviewer of the final full change → Orchestrator acceptance. MUST NOT omit Reviewer merely because no plan exists. This creates no new plan obligation.
149
- - [review.significant-plan] For significant/high-risk plan work: each task uses Coder → fresh QA as required → Orchestrator acceptance and focused commit. After all tasks are accepted and required QA is complete, Reviewer reviews the final full change once. Reviewer is NOT a per-task or per-commit required gate. Preserve required checks and necessary finding rechecks.
150
- - [review.final-plan-recheck] For final overall Reviewer findings on plan work, including behavior findings, use Coder → Reviewer without QA reassignment; repeat until resolved. This exception applies only at the final plan stage. Preserve required QA and QA failure rechecks before initial final review and outside this exception.
151
140
  - [platform.codex] Role restrictions are prompt-level contracts, not a filesystem sandbox. No documented role-specific Git hook or generic per-agent tool allowlist is assumed. Existing shell capabilities are retained because static read access after shell reduction has not been verified; Coder and QA need shell for approved checks.
152
141
  [ARC role policy: contract end]
@@ -1,8 +1,7 @@
1
1
  # Managed worktree handoff contract
2
2
 
3
3
  Orchestrator reads after the user explicitly selects the new managed worktree option, before its creation,
4
- branch work or
5
- document transfer. Apply [handoff-prep.md](handoff-prep.md) and [handoff.md](handoff.md) gates as well.
4
+ branch work or document transfer. Apply [handoff-prep.md](handoff-prep.md) and [handoff.md](handoff.md) gates as well.
6
5
 
7
6
  ## Workspace handoff
8
7
 
@@ -27,6 +26,7 @@ and verification, apply Choice lifetime and restart record in handoff.md.
27
26
  Before calling mcp__codex_app__create_worktree, validate the approved branch candidate and collision state with
28
27
  New task branch naming rules in handoff-prep.md. A collision requires a new explicit choice; never automatically
29
28
  substitute a suffix.
29
+ Default is the prohibition on reusing an existing branch in handoff-prep.md; only this narrow exception applies.
30
30
  Exception for this managed path: an existing approved branch at the same base and not checked out in any worktree
31
31
  may be reused; verify both conditions before reuse. An unexpected branch, different base or lookup uncertainty means
32
32
  stop.
@@ -47,19 +47,18 @@ For registration failure only, retry the returned workspace with mcp__codex_app_
47
47
  managed registration, current-chat attachment and approved branch verification, perform no formal drafting, saving, document transfer, staging,
48
48
  commit or Coder start. If tools are unavailable, reattachment fails or results mismatch, stop and record actual state.
49
49
  Do not fall back to raw Git worktree creation, automatically retry other name/ref/path/branch inputs,
50
- or perform automatic
51
- cleanup, delete, prune or archive. See git-recovery.md before dependent recovery.
50
+ or perform automatic cleanup, delete, prune or archive. See git-recovery.md before dependent recovery.
52
51
 
53
52
  Verify the returned actual absolute worktree path and app-managed current-chat attachment using app artifacts.
54
53
  Record initial branch or detached HEAD, approved branch candidate, final branch, and target HEAD equal to approved ref.
55
54
  Verify linked-worktree registration and source/target Git common directory identity, registered path,
56
- target dirty state,
57
- and source branch, HEAD, index and files preservation; shared Git metadata additions for the approved target are
55
+ target dirty state, and source branch, HEAD, index and files preservation; shared Git metadata additions for the approved target are
58
56
  authorized.
59
57
  Linked worktree .git may be a file; do not require the same top-level path or a .git directory for repository identity.
60
58
  Verify registration, attachment and base before creating/checking out the approved branch. If initially detached,
61
59
  use `git switch -c <approved-branch> <ref>`; if the existing approved branch has the same base and is not checked out
62
- in any worktree, use `git switch <approved-branch>`. Do not move a branch pointer, choose another branch or use --force
60
+ in any worktree, use `git switch <approved-branch>` (the exception above to the default no-reuse rule in
61
+ handoff-prep.md). Do not move a branch pointer, choose another branch or use --force
63
62
  or -B.
64
63
  If the app initially returns the approved branch, verify it and its base rather than repeating completed work.
65
64
  Unexpected branch or mismatched HEAD means stop. Verify final approved branch and HEAD before formal drafting, saving, document transfer,
@@ -77,16 +76,15 @@ For those existing approved documents, use Worktree document transfer before tar
77
76
 
78
77
  ### Worktree document transfer
79
78
 
80
- Use only for existing approved documents in legacy or restart/target-change cases.
79
+ Use only for existing approved documents in pre-existing-document or restart/target-change cases.
81
80
 
82
81
  Verify existing approved commits by SHA, message, paths and approved content valid at base and target; reuse them.
83
82
  Copy only uncommitted approved spec/plan documents to the target at the same repository-relative path.
84
83
  Do not move, delete, or modify the source documents. If a destination resolves outside the worktree, including through
85
84
  an escaping symlink, stop. Before transfer verify target HEAD equals the selected source base SHA.
86
- Before replacing an existing destination,
87
- prove its clean base state with no staged/unstaged changes and index and working-tree bytes matching the base version;
88
- then replace with the approved version. A document absent from base must also be absent at the destination.
89
- For unexpected changes, do not overwrite; stop.
85
+ Before replacing an existing destination, prove its clean base state with no staged/unstaged changes and index and
86
+ working-tree bytes matching the base version; then replace with the approved version. A document absent from base must
87
+ also be absent at the destination. For unexpected changes, do not overwrite; stop.
90
88
  For identical content, verify approved bytes before reuse. After transfer verify bytes match the approved version.
91
89
  The canonical record includes each document approval/version/evidence, source and target absolute paths and the common
92
90
  relative path plus content verification. Changed content or approval scope requires approval of the revised version.
@@ -1,8 +1,7 @@
1
1
  # Handoff contract
2
2
 
3
3
  Orchestrator reads before every Coder first start or restart preparation. Coder trusts the Orchestrator-verified facts
4
- in the brief under
5
- the Coder profile and reads this file only for sections the brief explicitly cites. First-start preparation
4
+ in the brief under the Coder profile and reads this file only for sections the brief explicitly cites. First-start preparation
6
5
  (execution-target choice request, preparation Git mutations, planning-document commit) is in
7
6
  [handoff-prep.md](handoff-prep.md); the new managed worktree path is in [handoff-worktree.md](handoff-worktree.md).
8
7
 
@@ -11,8 +10,7 @@ the Coder profile and reads this file only for sections the brief explicitly cit
11
10
  ### Checkout approval
12
11
 
13
12
  Before every Coder first start and restart, Orchestrator confirms the supplied absolute workspace is accessible and
14
- belongs
15
- to the intended Git repository; record its actual absolute path, current branch or detached HEAD, HEAD, and staged,
13
+ belongs to the intended Git repository; record its actual absolute path, current branch or detached HEAD, HEAD, and staged,
16
14
  unstaged, and untracked changes. Stop if the workspace is inaccessible, is not the intended repository, or HEAD
17
15
  cannot be resolved. Do not initialize Git or switch to another repository automatically.
18
16
 
@@ -28,9 +26,8 @@ drafting or preparation and does not require document completion. Never fall bac
28
26
  After initial design approval, obtain and record an explicit user choice for the first start under the
29
27
  Explicit choice rule: use the current checkout, create a new task branch from the verified base HEAD in that same
30
28
  checkout, or create a new managed worktree and task branch (selection target under handoff-prep.md; contract in
31
- handoff-worktree.md after selection). Without an
32
- explicit execution-target choice or verified valid reuse under the choice-lifetime rules below, wait and do not start or
33
- restart Coder.
29
+ handoff-worktree.md after selection). Without an explicit execution-target choice or verified valid reuse under the
30
+ choice-lifetime rules below, wait and do not start or restart Coder.
34
31
 
35
32
  ### Coder handoff gate
36
33
 
@@ -51,13 +48,11 @@ Orchestrator may start or restart Coder only after all of these conditions are v
51
48
  failure or partial completion.
52
49
  7. The brief includes these preparation and final-verification facts and evidence.
53
50
 
54
- Before a Orchestrator direct edit, Orchestrator verifies the same conditions, with the approved scope record as the
55
- applicable approval,
56
- and records them in the brief.
51
+ Before an Orchestrator direct edit, Orchestrator verifies the same conditions, with the approved scope record as the
52
+ applicable approval, and records them in the brief.
57
53
 
58
54
  A missing or failed condition blocks handoff. Orchestrator may continue read-only investigation and authorized
59
- preparation
60
- or recovery, but cannot start Coder early. Reverify affected evidence when approved content, execution target, branch,
55
+ preparation or recovery, but cannot start Coder early. Reverify affected evidence when approved content, execution target, branch,
61
56
  HEAD, or relevant state changes. Coder's conflict reporting is in its profile; Orchestrator
62
57
  resolves preparation and passes the gate again before Coder resumes.
63
58
 
@@ -79,12 +74,10 @@ Record the Complete planning-document set fields from planning.md, confirming no
79
74
  writing/approval.
80
75
  Distinguish reused commits from the batch preparation commit, or record valid document absence.
81
76
  Record applicable approvals and the initial explicit execution-target choice or verified reuse for each first start or
82
- restart. Give all five
83
- roles (Coder, QA, Planner, Reviewer, Scouter) the same actual workspace and selected execution checkout or absolute
84
- worktree path, preparation
85
- evidence, and absolute artifact paths. Each
86
- role stays in the supplied workspace, reports missing, inaccessible, or conflicting paths and unexpected branch state to
87
- Orchestrator before dependent work, and does not create or switch workspaces or branches.
77
+ restart. Give all five roles (Coder, QA, Planner, Reviewer, Scouter) the same actual workspace and selected execution checkout or absolute
78
+ worktree path, preparation evidence, and absolute artifact paths. Each role stays in the supplied workspace, reports
79
+ missing, inaccessible, or conflicting paths and unexpected branch state to Orchestrator before dependent work, and does
80
+ not create or switch workspaces or branches.
88
81
 
89
82
  ### Task readiness at every assignment
90
83
 
@@ -107,8 +100,7 @@ Unexpected HEAD or ownership changes stop affected work for Orchestrator resolut
107
100
 
108
101
  For the same approved scope, workspace, repository, and execution target, reuse the initial explicit choice only
109
102
  when its evidence is accessible and still valid. On every first start and restart, Orchestrator rechecks actual Git
110
- state
111
- against the current brief: absolute workspace and repository identity, branch or detached HEAD, HEAD,
103
+ state against the current brief: absolute workspace and repository identity, branch or detached HEAD, HEAD,
112
104
  staged/unstaged/untracked changes, preservation and edit ownership, applicable approvals and artifacts,
113
105
  planning-document SHA/message/paths/content or valid no-document rationale, and Orchestrator's final state verification
114
106
  (Coder handoff gate items 1-7); a reused choice never waives any gate. A restart without document changes reuses
@@ -119,14 +111,12 @@ verify that they match approved work, ownership, and the intended target. A work
119
111
  evidence; target HEAD need not remain at that base; source preservation and unexpected-state checks still apply.
120
112
  Link the approved plan version, task ID and commit SHA/content/validity with current Git state and edit ownership in
121
113
  the restart brief under Orchestrator's full handoff gate. Verify/reuse successful task commits without duplication and
122
- keep planning-document preparation
123
- evidence distinct; task commits do not require repeating valid document preparation.
114
+ keep planning-document preparation evidence distinct; task commits do not require repeating valid document preparation.
124
115
 
125
116
  If scope, workspace, repository, target, or approved branch candidate changes, obtain a fresh explicit choice before dependent drafting or preparation; reselection does not require document completion. If an invalidating failure means the old target cannot be trusted,
126
117
  obtain a fresh explicit choice after Orchestrator resolves preparation. State mismatches and unresolved failures block
127
118
  editing until Orchestrator resolves and revalidates the full gate; resolution does not automatically require a new
128
- choice
129
- unless it invalidates the old target. Do not fall back automatically; apply the Explicit choice rule.
119
+ choice unless it invalidates the old target. Do not fall back automatically; apply the Explicit choice rule.
130
120
 
131
121
  Keep one canonical initial handoff record accessible to each assigned role, containing the approved scope/version,
132
122
  repository/workspace identity, and the Handoff evidence fields above; do not create a separate storage service.
@@ -135,8 +125,7 @@ Markdown file at `<git-common-dir>/arc/handoff/<plan-or-task-slug>.md` (slug uni
135
125
  stem, or a spec/task slug when no plan exists; never overwrite another plan's record; resolve with
136
126
  `git rev-parse --path-format=absolute --git-common-dir`; outside the working tree and shared by linked worktrees; not a
137
127
  Git mutation, never staged or committed; contains no secrets), gives its absolute path in every brief, and restart
138
- briefs cite it. If
139
- the write is denied or unavailable, each Coder brief states why and includes the full record inline, with no delta;
128
+ briefs cite it. If the write is denied or unavailable, each Coder brief states why and includes the full record inline, with no delta;
140
129
  that inline record satisfies the accessible record requirement. Do not delete it automatically.
141
130
 
142
131
  Restart brief: supply only verified deltas and mark unchanged fields; `unchanged` means unchanged relative to the record
@@ -162,18 +151,76 @@ under its profile. Material scope/method/risk changes and invalid target evidenc
162
151
  planning and the choice-lifetime rules above. Report the missing condition and resume evidence rather than asking
163
152
  for an approval already valid for that scope.
164
153
 
154
+ Before any exception judgment, Orchestrator reads [Risk-scaled execution](verification.md#risk-scaled-execution) and [planning](planning.md) for the full risk and plan-depth conditions.
155
+
156
+ ## Common handoff gate
157
+
158
+ Before every Coder first start/restart, Orchestrator passes the full gate:
159
+ applicable approvals/artifacts or valid omissions, explicit execution-target choice
160
+ or verified reuse, intended accessible repository/workspace, actual Git identity/state, preservation/ownership,
161
+ verified document commits or valid absence, and no unresolved failure/partial completion.
162
+ Missing evidence, mismatches, unclear ownership or unresolved preparation block handoff and require Orchestrator
163
+ resolution and full revalidation. Handoff owns the evidence fields, canonical handoff record, restart brief, choice lifetime
164
+ and reuse. Coder trusts the Orchestrator-verified brief and reports actual conflicts under its self-contained profile;
165
+ never replace its local guards with a requirement to load Orchestrator procedures.
166
+ Depth-2 roles use the supplied workspace and report path/state conflicts; they cannot create/switch workspaces or
167
+ branches. The same conditions apply before an Orchestrator direct edit.
168
+ For a selected worktree, handoff requires common directory, registration, app-managed current-chat attachment,
169
+ approved branch, and source preservation; prepare only through the selected managed-worktree contract.
170
+
171
+
172
+ ## Coder TDD and constraints
173
+
174
+ Before feature, bug-fix, or behavior edits, Coder follows local `test-driven-development` unless the explicit
175
+ ARC exception applies; the Coder profile holds Coder's full TDD rules. TDD is waived only when every small,
176
+ low-risk criterion (Risk-scaled execution) and every plan-skip criterion (Orchestrator direct path) holds.
177
+ Before Coder starts,
178
+ Orchestrator records the scope, why every criterion is met, acceptance criteria, and focused verification in the brief.
179
+ An explicit user or task-specific TDD request overrides
180
+ this waiver. For qualifying tasks only, this exception takes precedence over the generic trigger in the local reference;
181
+ do not change that skill. Ordinary multi-step or significant/high-risk work is not eligible. The waiver skips only
182
+ RED-GREEN steps; focused checks and risk-appropriate QA/Reviewer remain, and do not claim TDD was followed.
183
+ If a constraint blocks a required TDD step, Orchestrator records the
184
+ decision in the brief/plan and obtains any required human approval; internal approval is not a substitute.
185
+ Non-behavior documentation/configuration uses only a specifically authorized exception recorded in the brief; do not
186
+ generalize it to behavior work.
187
+
188
+
189
+ ## Orchestrator direct path for small tasks
190
+
191
+ Orchestrator may make a task's edits directly, without Planner brainstorming or Coder, only when every small,
192
+ low-risk criterion holds, every plan-skip criterion holds (one local change, no dependent stages, no cross-component shared state,
193
+ lifecycle, or integration-order concerns, and one focused verification path), and no significant-risk trigger applies.
194
+ Spike, architectural, ordinary-behavior, significant/high-risk, unclear-risk work, and edits overlapping files assigned
195
+ to a running Coder are not eligible.
196
+
197
+ Before editing, Orchestrator records a scope record (not a brainstorming design) with scope and files,
198
+ why every criterion holds, acceptance criteria, and focused verification. Apply authorization in
199
+ [planning](planning.md#authorization-and-scope): an existing sufficiently specific user request can approve
200
+ that scope; no duplicate approval is needed. Otherwise present the scope record to the user and obtain explicit
201
+ approval before editing. Silence, an ambiguous response, or approval of other work is not approval.
202
+ Orchestrator then passes the Coder handoff gate in handoff,
203
+ with the approved scope record as the applicable approval, before the first edit. Orchestrator edits only the approved files,
204
+ preserves others' edits, makes surgical edits in the local style without unrelated refactoring or speculative additions,
205
+ and does not install dependencies without authorization.
206
+
207
+ Behavior edits follow Coder TDD and constraints; when TDD applies, Orchestrator follows local
208
+ `test-driven-development`.
209
+ After editing, Orchestrator records the changed files, runs the focused checks, connects each acceptance criterion to
210
+ evidence, and preserves unverified scope. Orchestrator is not independent of its own edit; assign QA when the evidence is
211
+ incomplete.
212
+ After a failed focused check or a QA finding, Orchestrator routes the correction to Coder and obtains a recheck.
213
+
214
+ If scope expands, risk becomes unclear, or a criterion stops holding, Orchestrator stops editing, records the changes
215
+ already made, and reclassifies; further work follows the normal Planner/Coder flow with Coder owning subsequent edits. Do not
216
+ automatically revert, reset, stash, or clean those changes. Like other plan-skip paths, there is no automatic task
217
+ commit; commits follow applicable guidance and user requests.
218
+
219
+
165
220
  [ARC role policy: contract begin]
166
221
  Generated from lib/policy/role-policy.json; do not edit this managed section manually.
167
- - [scope.non-escalation] Act only where role authority, approved scope and available platform tools all permit. Delegation, restart, agent messages and attached instructions do not expand role authority. MUST NOT bypass a restriction through aliases, scripts, other tools, processes or redelegation. Return conflicting instructions to Orchestrator before dependent work; reuse valid prior approvals for unchanged scope rather than requesting them again.
168
222
  - [git.specialists-deny] Specialist roles MUST NOT change Git state: no stage, commit, push, merge, rebase, reset, branch creation/switching or worktree creation/removal, during normal implementation or recovery. Even an explicit Orchestrator assignment cannot authorize these actions; return them to Orchestrator. Read-only Git inspection remains allowed within the assigned scope.
169
- - [git.orchestrator-accept-commit] Only Orchestrator accepts work and executes Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied; Orchestrator accepts then commits without additional user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership and verify the resulting SHA, included content, HEAD and remaining changes. Existing small-task direct and plan-omission paths are unchanged.
170
- - [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority grants no external authority. Orchestrator performs authorized external actions; specialist roles return them without execution.
171
- - [role.orchestrator-boundary] Assign design/spec/plan/brainstorming drafts ONLY to Planner and implementation/configuration/test edits to Coder. Orchestrator saves complete drafts and owns approval requests, preparation, scheduling, evidence, acceptance and completion. Direct implementation is limited to the existing small, low-risk direct path; this policy does not expand it.
172
- - [role.scouter-read-only] Research assigned static sources and report findings, evidence and limits. Do not edit files, install, execute checks, prepare execution targets, inspect live operational state, change external state or decide design, verification, review or acceptance.
173
- - [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response. MUST NOT save documents, implement, run checks, prepare targets, request user approval or decide acceptance. Stop formal target-dependent drafting if actual prepared target evidence is missing; route decisions to Orchestrator.
174
223
  - [role.coder-implementation] Edit only assigned, approved files and run focused checks under the existing TDD contract. Report changed files, RED/GREEN or authorized exception evidence, results, limits and follow-up. Do not plan, independently QA/review your own work, accept the task or declare overall completion. Git changes remain forbidden even when implementation succeeds.
175
- - [role.qa-verification] Run approved checks and report commands, observations, reproduction, evidence and limits. Create only essential temporary data/logs/reports in the brief-authorized location and lifetime. Do not edit product source, tests, fixtures or configuration to pass checks, deploy or accept work. Persistent product-state checks require explicit scope and cleanup ownership. Return failures for Coder correction and required QA recheck.
176
- - [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only. MUST NOT execute QA tests, edit files, perform Git mutations or decide acceptance.
177
224
  - [review.significant-no-plan] For significant/high-risk work without a plan: Coder → QA and required QA rechecks → Reviewer of the final full change → Orchestrator acceptance. MUST NOT omit Reviewer merely because no plan exists. This creates no new plan obligation.
178
225
  - [review.significant-plan] For significant/high-risk plan work: each task uses Coder → fresh QA as required → Orchestrator acceptance and focused commit. After all tasks are accepted and required QA is complete, Reviewer reviews the final full change once. Reviewer is NOT a per-task or per-commit required gate. Preserve required checks and necessary finding rechecks.
179
226
  - [review.final-plan-recheck] For final overall Reviewer findings on plan work, including behavior findings, use Coder → Reviewer without QA reassignment; repeat until resolved. This exception applies only at the final plan stage. Preserve required QA and QA failure rechecks before initial final review and outside this exception.
@@ -30,7 +30,7 @@ Serialize work when a batch does not fit. There are no reserved role slots.
30
30
 
31
31
  Preserve the ledger through continuation, resume and context compaction; reconcile actual instance
32
32
  IDs before dispatch. Ledger loss must never reset counters to zero. If reconstruction is incomplete,
33
- hold creation and report the unknown budget; use a conservative bound only with sufficient evidence.
33
+ hold creation and report the unknown budget; use a conservative upper bound only when the reconstructed records support it.
34
34
  Completion frees confirmed active capacity; it does not restore the total-created budget. Exhaustion holds new
35
35
  creation and requires reporting remaining work and budgets. It does not authorize skipping required
36
36
  QA or Reviewer, role freshness, approval, ownership, dependency or same-file edit gates.