@yunhozz/arc 0.2.3 → 0.2.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 (95) hide show
  1. package/MANIFEST.sha256 +86 -88
  2. package/claude/agents/arc-implementer.md +32 -42
  3. package/claude/agents/arc-planner.md +33 -47
  4. package/claude/agents/arc-qa.md +28 -44
  5. package/claude/agents/arc-reviewer.md +28 -41
  6. package/claude/agents/arc-scouter.md +26 -38
  7. package/claude/skill/SKILL.md +41 -59
  8. package/claude/skill/models.toml +11 -11
  9. package/claude/skill/references/arc-visual-companion.md +19 -24
  10. package/claude/skill/references/brainstorming.md +111 -42
  11. package/claude/skill/references/commit.md +38 -70
  12. package/claude/skill/references/coordination.md +77 -126
  13. package/claude/skill/references/git-recovery.md +17 -35
  14. package/claude/skill/references/handoff-prep.md +91 -103
  15. package/claude/skill/references/handoff.md +110 -208
  16. package/claude/skill/references/limits.md +19 -31
  17. package/claude/skill/references/planning.md +93 -244
  18. package/claude/skill/references/superpowers-provenance.json +3 -3
  19. package/claude/skill/references/verification.md +105 -261
  20. package/claude/skill/runtime/adapters/claude.mjs +10 -9
  21. package/claude/skill/runtime/adapters/codex.mjs +7 -8
  22. package/claude/skill/runtime/bootstrap.mjs +3 -2
  23. package/claude/skill/runtime/capabilities.mjs +12 -0
  24. package/claude/skill/runtime/cooperative-schema.mjs +3 -2
  25. package/claude/skill/runtime/cooperative.mjs +52 -4
  26. package/claude/skill/runtime/evaluate.mjs +115 -2
  27. package/claude/skill/runtime/identity.mjs +22 -0
  28. package/claude/skill/runtime/role-policy.json +18 -18
  29. package/claude/skill/runtime/schema.mjs +19 -0
  30. package/claude/skill/scripts/model_config.py +20 -84
  31. package/codex/agents/arc-implementer.toml +34 -30
  32. package/codex/agents/arc-planner.toml +27 -23
  33. package/codex/agents/arc-qa.toml +24 -15
  34. package/codex/agents/arc-reviewer.toml +25 -16
  35. package/codex/agents/arc-scouter.toml +20 -26
  36. package/codex/skill/SKILL.md +42 -57
  37. package/codex/skill/models.toml +13 -13
  38. package/codex/skill/references/arc-visual-companion.md +21 -27
  39. package/codex/skill/references/brainstorming.md +111 -42
  40. package/codex/skill/references/commit.md +35 -81
  41. package/codex/skill/references/coordination.md +76 -104
  42. package/codex/skill/references/git-recovery.md +29 -51
  43. package/codex/skill/references/handoff-prep.md +76 -134
  44. package/codex/skill/references/handoff-worktree.md +32 -66
  45. package/codex/skill/references/handoff.md +111 -271
  46. package/codex/skill/references/limits.md +21 -34
  47. package/codex/skill/references/planning.md +125 -299
  48. package/codex/skill/references/superpowers-provenance.json +3 -3
  49. package/codex/skill/references/verification.md +90 -272
  50. package/codex/skill/runtime/adapters/claude.mjs +10 -9
  51. package/codex/skill/runtime/adapters/codex.mjs +7 -8
  52. package/codex/skill/runtime/bootstrap.mjs +3 -2
  53. package/codex/skill/runtime/capabilities.mjs +12 -0
  54. package/codex/skill/runtime/cooperative-schema.mjs +3 -2
  55. package/codex/skill/runtime/cooperative.mjs +52 -4
  56. package/codex/skill/runtime/evaluate.mjs +115 -2
  57. package/codex/skill/runtime/identity.mjs +22 -0
  58. package/codex/skill/runtime/role-policy.json +18 -18
  59. package/codex/skill/runtime/schema.mjs +19 -0
  60. package/codex/skill/scripts/model_config.py +25 -6
  61. package/lib/installer/global-config.mjs +2 -1
  62. package/lib/installer/manifest.mjs +1 -1
  63. package/lib/installer/plan.mjs +6 -8
  64. package/lib/installer/preset.mjs +7 -4
  65. package/lib/installer/uninstall.mjs +2 -2
  66. package/lib/management/operations.mjs +4 -2
  67. package/lib/management/update.mjs +3 -3
  68. package/lib/models/catalog-anthropic.mjs +46 -0
  69. package/lib/models/catalog.mjs +62 -0
  70. package/lib/models/codex-catalog.mjs +103 -0
  71. package/lib/models/config.mjs +19 -11
  72. package/lib/models/index.mjs +1 -1
  73. package/lib/models/profiles.mjs +1 -40
  74. package/lib/policy/render.mjs +1 -5
  75. package/lib/policy/role-policy.json +18 -18
  76. package/lib/runtime/adapters/claude.mjs +10 -9
  77. package/lib/runtime/adapters/codex.mjs +7 -8
  78. package/lib/runtime/bootstrap.mjs +3 -2
  79. package/lib/runtime/capabilities.mjs +12 -0
  80. package/lib/runtime/cooperative-schema.mjs +3 -2
  81. package/lib/runtime/cooperative.mjs +52 -4
  82. package/lib/runtime/evaluate.mjs +115 -2
  83. package/lib/runtime/identity.mjs +22 -0
  84. package/lib/runtime/schema.mjs +19 -0
  85. package/lib/tui/app.mjs +26 -16
  86. package/lib/tui/custom-preset.mjs +122 -0
  87. package/lib/tui/render.mjs +3 -2
  88. package/lib/tui/setup.mjs +65 -12
  89. package/package.json +1 -2
  90. package/claude/skill/hooks/git-policy.json +0 -208
  91. package/claude/skill/hooks/role-git-guard.mjs +0 -18
  92. package/claude/skill/hooks/runtime-gate.mjs +0 -12
  93. package/codex/skill/hooks/runtime-gate.mjs +0 -10
  94. package/lib/policy/claude-hook.mjs +0 -80
  95. package/scripts/probe-runtime-hooks.mjs +0 -55
@@ -1,237 +1,155 @@
1
+ <a id="implementer-handoff"></a>
1
2
  # Implementer handoff
2
3
 
3
- ## Instruction Sources, Bounded Read Recovery, Visual Evidence, and Resumption
4
+ Orchestrator reads before every first-start/restart preparation; Implementer trusts verified brief/profile and reads cited sections only. Initial preparation follows [handoff-prep](handoff-prep.md).
4
5
 
5
- Keep the existing brief field order and record provenance and status within each field. Distinguish four sources: user-provided instructions, discovered workspace instruction files, installed role references, and task inputs. Record each source, applicability, version or approval, and access state. A missing root AGENTS.md file does not imply missing instructions; applicable user-provided instructions remain valid. Missing required skills, references, or approved inputs and conflicting instructions hold dependent work.
6
+ <a id="instruction-sources-bounded-read-recovery-visual-evidence-and-resumption"></a>
7
+ ## Instruction sources, bounded read recovery, visual evidence and resumption
6
8
 
7
- An optional read alternative is allowed only when the brief specifies its exact locator, material identity, approved version, purpose, method, preconditions, equivalent evidence, and return conditions in advance. Any alternate locator must be explicit and verified as the same material and version. Only pre-authorized, side-effect-free reads are allowed. Do not chain searches, guess paths, retry mutations, or change the environment, dependencies, or permissions. Immediately return missing required inputs, permission/target/ownership mismatches, partial changes, unknown state, and unauthorized, ambiguous, or failed alternatives to the Orchestrator. Report the initial failure, any alternative used, observed evidence and limits, and the dependent and independent work placed on hold. Orchestrator checks scope and valid evidence before deciding whether independent work may resume; unresolved required check failures continue to block acceptance.
9
+ Keep shared brief field order, recording source/status within fields. Distinguish user instructions, discovered workspace instructions, installed references and inputs by source/applicability/version or approval/access. Missing root AGENTS.md does not negate user instructions. Missing required skills/references/approved inputs and conflicts hold dependent work.
8
10
 
9
- A visual brief records the exact approved visual source, version, approval and access state, criterion IDs, required properties and comparison method, actual-output identity, revision, and comparison basis. An Implementer report is separate from a fresh QA comparison. Report each result as pass, mismatch, or unverified with evidence locations and limitations. Return new UI interpretations or unapproved substitutions for visual sources to the Orchestrator.
11
+ Optional alternatives need exact locator, material identity, approved version, purpose, method, preconditions, equivalent evidence and return conditions pre-authorized in the brief. Verify alternate locations identify the same material/version. Only side-effect-free reads; no chained search, guessed paths, mutation retries or environment/dependency/permission changes. Return required-input omissions, authority/target/ownership mismatches, partial changes, unknown states and unapproved/ambiguous/failed alternatives immediately. Report first failure/alternative/observations/limits and held dependent/independent work. Orchestrator validates scope/evidence before independent release; unresolved required checks still block acceptance.
10
12
 
11
- The resume brief preserves valid approvals for unchanged scope, completed work, failures, resolution evidence, valid and invalid evidence, remaining holds, and the next objective. The Orchestrator records changed facts and revalidates affected gates using resolution evidence. Do not repeat completed work. Preserve role, Git, QA revalidation, final Reviewer, acceptance, and commit boundaries.
13
+ Visual briefs include exact approved source/version/approval/access, criterion IDs/properties/method and actual-output identity/revision/basis. Implementer reports differ from fresh QA comparison. Report pass/mismatch/unverified with evidence/limits; return new UI interpretations/substitutions.
12
14
 
15
+ Resume briefs preserve valid unchanged-scope approval, completed work, failures/resolution, valid/invalid evidence, holds and next objective. Record changed facts/revalidate gates without repeated completed work. Preserve role/Git/QA/final Reviewer/acceptance/commit boundaries.
13
16
 
14
- Orchestrator verifies the absolute workspace/repository, branch or detached HEAD, HEAD, staged/unstaged/untracked state,
15
- ownership, document approvals and committed planning documents before first start and restart.
16
- The approved execution target must remain valid. Claude v1 supports current checkout execution and does not support
17
- ARC-managed worktrees.
17
+ <a id="workspace-handoff"></a>
18
+ ## Workspace handoff
18
19
 
19
- Execution-target choice and actual preparation precede formal drafting and saving of required specs/plans.
20
- Initial design proposals may precede choice. Initial target preparation does not authorize Implementer; all applicable
21
- approvals, complete documents, verified batch docs commits or valid absence, and final Git verification remain required.
22
- Record planned document scope/paths and actual preparation separately, followed by actual drafting/save/approval and
23
- commit results; preserve actual order and evidence gaps. Reuse a valid choice during document drafting and subsequent
24
- implementation while scope and target remain unchanged. Authorized HEAD and dirty-state changes alone do not invalidate
25
- choice; verify preservation and ownership. A changed scope or target requires fresh explicit choice before dependent
26
- drafting or preparation and does not require document completion. Never fall back automatically.
20
+ <a id="checkout-approval"></a>
21
+ ### Checkout approval
27
22
 
28
- Resolve the Git common directory (`git rev-parse --path-format=absolute --git-common-dir`) and keep one canonical record
29
- at `<git-common-dir>/arc/handoff/<plan-or-task-slug>.md`, outside the working tree.
30
- The slug is unique per plan: the dated plan filename stem, or a spec/task slug when no plan exists; never overwrite
31
- another plan's record. Never stage it or store secrets there. Orchestrator updates the record after each accepted task
32
- commit (task ID, SHA, state). Record approved document paths/versions/coverage/dependencies and approval evidence;
33
- explicit target choice; prior and resulting Git state; document commit SHA/subject/files; task scope, ownership,
34
- checks and limits. If a gate or record was late, record actual order and resolve forward; never claim retroactive
35
- compliance.
23
+ Before every Implementer start/restart verify supplied absolute workspace accessibility/intended repository. Record actual path, branch/detached HEAD, HEAD and staged/unstaged/untracked state. Inaccessible/wrong repository/unresolved HEAD stops work; no automatic Git initialization/repository switch.
36
24
 
37
- The Implementer brief supplies absolute workspace, verified branch/HEAD, canonical record path, approved task/criteria,
38
- exact file ownership, expected tests, dependency limits and blocked conditions. Restart brief: supply only verified
39
- deltas and mark unchanged fields; `unchanged` means unchanged relative to the record file the fresh Implementer reads,
40
- and every other brief field is in full. Implementer trusts Orchestrator verified prep rather than independently repeating
41
- approval/Git evidence checks, reads fields marked unchanged, and stops on an actual observed conflict.
42
- Tell Implementer that others share the repository and unrelated work MUST be preserved.
25
+ Formal spec/plan drafting/saving follows choice/actual preparation; initial design may precede choice. Preparation alone authorizes no Implementer. All approvals/full documents/verified batch or valid absence/final Git checks remain. Separate planned scope/paths, actual preparation and drafting/save/approval/commit, recording chronology/gaps.
43
26
 
44
- Roles report directly to Orchestrator. Do not delegate at depth 2. Orchestrator sequences dependent work,
45
- resolves actual blockers and revalidates affected gates before resume. No automatic retry after unexpected Git or tool
46
- failure.
27
+ After initial design approval record explicit selection: current checkout branch/detached HEAD or a task branch there. Without choice/valid reuse, wait. Reuse through unchanged-scope/target drafting/implementation. Authorized HEAD/dirty changes alone do not invalidate choice; verify preservation/ownership. Changed scope/target requires fresh choice before dependent drafting/preparation without waiting for full documents. Never fall back automatically.
47
28
 
48
- If the record write is denied or unavailable, Orchestrator carries the full record inline in every Implementer brief (no
49
- delta, no record-file `unchanged`) and states why; that satisfies the accessible-record requirement.
50
- Do not delete it automatically.
29
+ <a id="implementer-handoff-gate"></a>
30
+ ### Implementer handoff gate
51
31
 
32
+ Orchestrator verifies all before start/restart:
33
+
34
+ 1. Applicable design/spec/plan approvals/artifacts or valid omissions; for Spike, approved question/method/scope/criteria/constraints. Verify full current document set/versions/dependencies/order and no unfinished applicable documents. Future implementation artifacts are outside probe approval.
35
+ 2. Explicit initial choice or verified valid reuse.
36
+ 3. Accessible intended absolute workspace/repository.
37
+ 4. Actual branch/detached HEAD/HEAD/change state/preservation/ownership. Preserve unrelated staged files; they block until preparation is resolved.
38
+ 5. Verified planning-document commits or required-none/produced-none with depth reasons.
39
+ 6. Final path/branch/HEAD/state after mutations; no unresolved failure/partial completion.
40
+ 7. Brief preparation/final-verification facts/evidence.
41
+
42
+ Direct edits use approved scope records and the same gates before first edit. Any failure/missing condition blocks handoff, not authorized read-only investigation/preparation/recovery. Revalidate changes to approved content/target/branch/HEAD/state. Implementer reports actual conflicts under its profile; Orchestrator resolves and repasses gates.
43
+
44
+ <a id="handoff-evidence"></a>
45
+ ### Handoff evidence
46
+
47
+ One canonical record includes:
48
+
49
+ - Document-save gate/results, choice readiness and each mutation's pre-evidence/post-result.
50
+ - Absolute workspace, prior branch/detached HEAD/base/state/preservation/ownership, checkout approval/evidence/selected path.
51
+ - Final branch, attempted creation/switch results and post-selection path/branch/HEAD/state.
52
+ - Document SHA/message/paths/approved content; reused versus batch commits or valid absence/depth rationale.
53
+ - Absolute approved artifacts, full set/versions/coverage/dependencies/order and no pending writing/approval.
54
+ - Final verification, failures/partial completion/recovery and each start/restart's approval/choice/reuse.
55
+
56
+
57
+ Give all five roles the same actual workspace/selected checkout, preparation evidence and absolute artifacts. Roles stay there and report missing/inaccessible/conflicting paths/unexpected branches before dependent work, never create/switch workspaces/branches. Tell Implementer others share the repository and unrelated work must be preserved.
58
+
59
+ <a id="task-readiness-at-every-assignment"></a>
52
60
  ## Task readiness at every assignment
53
61
 
54
- Before each first start or restart, if an approved plan exists, link its current dependency/readiness record
55
- (planning.md) in the canonical record and brief. Where plan omission is valid under existing rules, do not create a
56
- plan or map solely to satisfy this linking duty; record the applicable omission judgment and rationale in the
57
- canonical record and brief. Plan absence alone does not qualify for omission, and an unapproved required plan
58
- cannot bypass its approval gate.
59
-
60
- Before assignment, apply every readiness condition in
61
- [planning.md, Dependency and readiness record](planning.md#dependency-and-readiness-record), including predecessor
62
- checks, Orchestrator acceptance and verified focused commit or accepted no-change evidence. An Implementer completion report alone is insufficient. Verify the linked record is current and capacity and file ownership permit assignment.
63
- Readiness supplements the full handoff gate and execution-target restrictions; it never waives them.
64
- For authorized HEAD or state changes, refresh this record and affected briefs, verify preservation and ownership,
65
- revalidate affected gates, and reassess readiness under planning.md and [commit.md](commit.md#shared-checkout-coordination).
66
- Unexpected HEAD or ownership changes stop affected work for Orchestrator resolution and revalidation.
67
-
68
- ## Choice lifetime and reuse
69
-
70
- Accepted task commits do not by themselves invalidate the initial execution-target choice for the same approved scope,
71
- workspace, repository, and target; verify and reuse successful task commits without duplication.
72
- On every first start and restart recheck actual state against the brief (workspace/repository identity,
73
- branch or detached HEAD, HEAD, changes, ownership, approvals, document commits or valid absence); reuse never waives a
74
- gate. Reuse the choice only while its evidence is accessible and valid. If scope, workspace, repository, target,
75
- or approved branch candidate changes, or a failure means the old target cannot be trusted, obtain a fresh explicit
76
- choice before dependent drafting or preparation; reselection does not require document completion. Authorized HEAD and dirty-state changes alone do not
77
- invalidate it; record them and verify they match approved work. State mismatches block editing until Orchestrator
78
- revalidates the gate; resolution does not by itself require a new choice unless it invalidates the old target;
79
- never fall back automatically (apply the Explicit choice rule). Inaccessible records or unclear ownership block editing;
80
- prior conversation cannot substitute for evidence.
62
+ Link current approved-plan readiness in canonical record/brief before every start/restart. Valid omission records judgment/reasons, not a new plan/map solely for linking. Absence alone permits no omission or bypass of required-plan approval.
81
63
 
82
- ## Authorization continuity
64
+ Apply all [planning](planning.md#dependency-and-readiness-record) conditions: predecessor checks/Orchestrator acceptance/verified commit or accepted no-change. Reports alone are insufficient. Verify current records/capacity/ownership. Readiness supplements, never replaces handoff/target gates. Authorized HEAD/state changes refresh records/briefs/preservation/gates and [shared-checkout](commit.md#shared-checkout-coordination) readiness. Unexpected HEAD/ownership stops affected work for resolution.
83
65
 
84
- Use [planning](planning.md#authorization-and-scope) for approval evidence and scope classification. Record that evidence,
85
- its scope, criteria, constraints, and valid document-depth omissions alongside execution-target choice and preparation.
86
- Reuse valid authorization for the same approved scope and target. A restart or new role assignment does not require
87
- repeat approval. Reuse never waives verification of actual workspace/repository, branch or detached HEAD, HEAD,
88
- changes, preservation, ownership, applicable documents, and preparation evidence by Orchestrator. Refresh actual state
89
- and affected briefs for authorized changes; they alone do not invalidate approval. Implementer trusts the verified brief
90
- under its profile. Material scope/method/risk changes and invalid target evidence hold affected work; resolve using
91
- planning and the choice-lifetime rules above. Report the missing condition and resume evidence rather than asking
92
- for an approval already valid for that scope.
66
+ <a id="choice-lifetime-and-restart-record"></a>
67
+ <a id="choice-lifetime-and-reuse"></a>
68
+ ## Choice lifetime and restart record
93
69
 
94
- 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.
70
+ Reuse only for unchanged approved scope/workspace/repository/target with accessible valid evidence. Every start/restart compares actual identity/branch/detached HEAD/HEAD/changes/preservation/ownership, approvals/artifacts, document SHA/message/paths/content or absence and final state with the brief. Reuse waives none of gates 1–7.
95
71
 
96
- ## Common handoff gate
72
+ Unchanged-document restarts reuse valid commits/choice with fresh state checks. Accepted task/docs commits and authorized implementation/dirty changes alone invalidate no choice; record matching work/ownership/target. Link plan version/task ID/commit content-validity/current Git/ownership in restart brief. Never duplicate successful commits or confuse task commits with document preparation; do not repeat valid docs preparation.
97
73
 
98
- Before every Implementer first start/restart, Orchestrator passes the full gate:
99
- applicable approvals/artifacts or valid omissions, explicit execution-target choice
100
- or verified reuse, intended accessible repository/workspace, actual Git identity/state, preservation/ownership,
101
- verified document commits or valid absence, and no unresolved failure/partial completion.
102
- Missing evidence, mismatches, unclear ownership or unresolved preparation block handoff and require Orchestrator
103
- resolution and full revalidation. Handoff owns the evidence fields, canonical handoff record, restart brief, choice lifetime
104
- and reuse. Implementer trusts the Orchestrator-verified brief and reports actual conflicts under its self-contained profile;
105
- never replace its local guards with a requirement to load Orchestrator procedures.
106
- Depth-2 roles use the supplied workspace and report path/state conflicts; they cannot create/switch workspaces or
107
- branches. The same conditions apply before an Orchestrator direct edit.
108
- Claude v1 supports the current checkout only; obtain the explicit current-branch or task-branch choice and complete
109
- approved document preparation under [handoff-prep](handoff-prep.md).
110
- ARC-managed worktree execution is unsupported; report an isolated worktree request before dependent work.
74
+ Changed scope/workspace/repository/target/candidate needs fresh choice before dependent work. Failures invalidating target trust need new choice after resolution. Resolution alone needs none if choice remains valid. Mismatches/unresolved failures hold edits through full revalidation; never fallback.
111
75
 
76
+ Maintain one accessible initial canonical record, not a separate service. Resolve `git rev-parse --path-format=absolute --git-common-dir`; write `<git-common-dir>/arc/handoff/<plan-or-task-slug>.md` with scope/version/identity/evidence. Use a unique dated-plan stem or no-plan spec/task slug; never overwrite another record. It is outside working tree, shared by linked worktrees, not a Git mutation, never staged/committed, secret-free. Give every brief its absolute path; update task ID/SHA/state after accepted commits. Never delete automatically.
112
77
 
113
- ## Implementer TDD and constraints
78
+ Unavailable/denied record writes require reason/full inline record in every Implementer brief, without deltas or record-file `unchanged`; inline satisfies accessibility.
79
+
80
+ Restart briefs send verified deltas and record-relative `unchanged`; fresh Implementer reads it and gets other fields fully. Include record location, next goal/ownership, changed decisions/approvals/docs/scope or no-change, current Git/differences, choice/reuse validation, refreshed commit/artifact checks, final verification/issues. Inaccessible records, missing evidence or unclear ownership block edits. Prior conversation/inaccessible links are no substitute. Revalidate revised docs/approvals/state; never backdate pre-gate preparation.
114
81
 
115
- Before feature, bug-fix, or behavior edits, Implementer follows local `test-driven-development` unless the explicit
116
- ARC exception applies; the Implementer profile holds Implementer's full TDD rules. TDD is waived only when every small,
117
- low-risk criterion (Risk-scaled execution) and every plan-skip criterion (Orchestrator direct path) holds.
118
- Before Implementer starts,
119
- Orchestrator records the scope, why every criterion is met, acceptance criteria, and focused verification in the brief.
120
- An explicit user or task-specific TDD request overrides
121
- this waiver. For qualifying tasks only, this exception takes precedence over the generic trigger in the local reference;
122
- do not change that skill. Ordinary multi-step or significant/high-risk work is not eligible. The waiver skips only
123
- RED-GREEN steps; focused checks and risk-appropriate QA/Reviewer remain, and do not claim TDD was followed.
124
- If a constraint blocks a required TDD step, Orchestrator records the
125
- decision in the brief/plan and obtains any required human approval; internal approval is not a substitute.
126
- Non-behavior documentation/configuration uses only a specifically authorized exception recorded in the brief; do not
127
- generalize it to behavior work.
82
+ <a id="authorization-continuity"></a>
83
+ ## Authorization continuity
128
84
 
85
+ Use [planning](planning.md#authorization-and-scope), recording scope/criteria/constraints/valid omissions with target/preparation. Reuse valid unchanged approvals across role restarts without duplicates. Orchestrator still verifies actual workspace/Git/preservation/ownership/docs/preparation; Implementer trusts verified brief. Material scope/method/risk changes or invalid target evidence hold affected work; report missing condition/resume evidence. Before exceptions read full [risk](verification.md#risk-scaled-execution)/[depth](planning.md) conditions.
129
86
 
130
- ## Orchestrator direct path for small tasks
87
+ <a id="common-handoff-gate"></a>
88
+ ## Common handoff gate
131
89
 
132
- This path does not waive explicit execution-target choice: before the first edit, record the user's choice or verified valid reuse. Approval of the edit scope alone does not select the execution target.
90
+ Before every start/restart verify approvals/artifacts or omissions, explicit target/reuse, accessible intended repository/workspace, actual Git identity/state, preservation/ownership, docs commits or absence and no unresolved failure/partial completion. Missing/mismatched/unclear evidence blocks until resolution/full revalidation. This reference owns records/restarts/lifetime. Implementer uses self-contained guards, not mandatory Orchestrator-procedure loading. Depth 2 never creates/switches workspace/branches. Direct edits require the same.
91
+ Claude v1 supports current checkout only. Explicitly select current/task branch and follow [preparation](handoff-prep.md). Report unsupported isolated-worktree requests before dependent work.
133
92
 
134
- Orchestrator may edit directly only when every small, low-risk criterion (Risk-scaled execution) holds.
135
- Every plan-skip criterion must also hold: one local change, no dependent stages, no cross-component shared state,
136
- lifecycle, or integration-order concerns, and one focused verification path. Significant, architectural,
137
- ordinary-behavior, unclear-risk work and edits overlapping a running Implementer's assigned files are ineligible.
93
+ <a id="implementer-tdd-and-constraints"></a>
94
+ ## Implementer TDD and constraints
95
+
96
+ Before feature/bug/behavior edits use local `test-driven-development` except explicit ARC exceptions. Full rules live in the profile. Waiver requires all low-risk and plan-skip/direct conditions, recorded scope/justification/criteria/checks before work. User/task-specific TDD overrides it; only qualifying tasks override local generic triggers without changing skills. Ordinary multistep/significant/high-risk work is ineligible.
138
97
 
139
- Significant risk is defined in Risk-scaled execution and excludes work from the Orchestrator direct path;
140
- do not infer eligibility from a small file count.
98
+ Waiver skips RED-GREEN only, preserving focused checks/risk-scaled QA/Reviewer; never claim TDD. Blocked required steps need recorded decision/required human approval, not internal substitutes. Non-behavior docs/config use specifically approved exceptions only, never generalize to behavior.
141
99
 
142
- Before editing, Orchestrator records a scope record (not a brainstorming design) with scope and files,
143
- why every criterion holds, acceptance criteria, and focused verification. Apply authorization in
144
- [planning](planning.md#authorization-and-scope): an existing sufficiently specific user request can approve
145
- that scope; no duplicate approval is needed. Otherwise present the scope record to the user and obtain explicit
146
- approval before editing. Silence, an ambiguous response, or approval of other work is not approval.
147
- Orchestrator then verifies the same handoff gate as a Implementer first start: explicit execution-target choice or valid
148
- reuse, accessible intended workspace and repository, branch or detached HEAD, HEAD, staged/unstaged/untracked state,
149
- preservation and ownership, and no unresolved failure or partial completion. Read this reference
150
- and [handoff preparation](handoff-prep.md) before checking this gate.
100
+ <a id="orchestrator-direct-path-for-small-tasks"></a>
101
+ ## Orchestrator direct path for small tasks
151
102
 
152
- Orchestrator edits only the approved files, preserves others' edits, and makes surgical changes without unrelated
153
- refactoring or unapproved dependencies. Behavior edits follow the Implementer TDD rules and applicable recorded waiver
154
- criteria; an explicit user or task-specific TDD request still requires test-driven-development.
155
- Do not claim TDD under a waiver. After editing, Orchestrator records changed files, runs focused checks,
156
- connects each acceptance criterion to evidence, and reports unverified scope. Orchestrator is not an independent
157
- reviewer of its own edits; assign QA when evidence is incomplete. If scope expands, risk becomes unclear,
158
- or any criterion fails, stop editing, record completed changes, and return subsequent edits to the normal Planner/Implementer
159
- flow. A failed focused check or a QA finding routes the correction to Implementer, and it is rechecked; Orchestrator does not
160
- self-correct.
103
+ Record target choice/reuse before first edit; scope approval alone selects no target. Direct edits without Planner/Implementer need every low-risk/plan-skip condition: one local change, no dependent stages/cross-component shared state/lifecycle/integration-order concerns, one check path and no significant trigger. Exclude Architectural, ordinary behavior/significant/high/unclear risk and active Implementer file overlaps. File count proves no eligibility.
161
104
 
162
- Like other plan-skip paths, there is no automatic task commit; commits follow applicable guidance and user requests.
105
+ 1. Record scope/files, every condition's justification, criteria/checks, not brainstorming. A specific existing request may authorize under [planning](planning.md#authorization-and-scope); otherwise obtain explicit approval. Silence/ambiguity/other approvals are insufficient.
106
+ 2. Read this/[preparation](handoff-prep.md), pass full gate before edit and edit approved files surgically, preserving others. No unrelated refactoring/unapproved dependencies.
107
+ 3. Follow Implementer TDD/recorded waivers; explicit TDD still requires local skill. Record files/checks/criterion evidence/gaps. Orchestrator is not independent; assign QA for incomplete evidence.
108
+ 4. Failed checks/QA findings route to Implementer/recheck, never self-correction. Scope/risk/condition changes stop edits, record work/reclassify and return subsequent edits to normal Planner/Implementer flow.
163
109
 
110
+ Add no plans/automatic commits to omission paths; follow guidance/user requests.
164
111
 
112
+ <a id="cooperative-cli-verification-handoff"></a>
165
113
  ## Cooperative CLI verification handoff
166
114
 
167
- For the supported spec+plan path, the verification handoff includes the registered task contract, exact check descriptor,
168
- task/final scope, `status.changeFingerprints`, independent actor attestations, intent ID, result messageRef and verdict.
169
- An externally authorized role performs each check/review after `prepare`, and records the actual result through `result`.
170
- CLI records do not authenticate identities or prove actual agent policy compliance.
115
+ Supported spec+plan handoffs include registered task contract, exact check descriptor, task/final scope, `status.changeFingerprints`, independent actor attestations, intent ID/result messageRef/verdict. Authorized roles execute after `prepare` and record through `result`; CLI records prove no identity/compliance.
171
116
 
172
- When scope, documents or approvals change, inspect `affectedTaskIds` and the dependency chain, preserve earlier approval and
173
- result records, and hand off new approvals and contracts for affected tasks. Do not reuse an old passing check for a different fingerprint.
174
- Link failed findings to the assigned Implementer's resolution evidence and QA rechecks for that change version. Only final overall Reviewer
175
- findings use Implementer→Reviewer revalidation. Do not add Reviewer as a prerequisite for individual task acceptance or commits.
176
- Follow [verification.md](verification.md#verification-lifecycle-in-the-cooperative-cli) for detailed fields and hold conditions.
177
- An unsupported no-plan/omission path does not imply a policy violation or a requirement to write documents.
117
+ On scope/docs/approval changes inspect `affectedTaskIds`/dependencies, preserve history and supply current approval/contracts. Never reuse checks across fingerprints. Link findings to same-version Implementer resolution/QA rechecks; only plan-final Reviewer findings use Implementer→Reviewer. No task-level Reviewer prerequisite. Detailed fields/holds follow [verification](verification.md#verification-lifecycle-in-the-cooperative-cli); unsupported omission is no policy violation/document obligation.
178
118
 
179
119
  [ARC role policy: contract begin]
180
120
  Generated from lib/policy/role-policy.json; do not edit this managed section manually.
181
- - [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. An explicit Orchestrator assignment cannot authorize these actions; return them to Orchestrator. Read-only Git inspection remains allowed within the assigned scope.
182
- - [role.implementer-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. Include the exact approved visual source, version, approval and access state, criterion IDs, required properties and comparison method, and actual-output identity, revision and comparison basis in Implementer and fresh QA handoffs. Record each visual result as pass, mismatch or unverified with accessible evidence and limits. Implementer self-report does not replace fresh QA and its actual comparison. A missing output-to-revision link is unverified; record a visible difference separately as mismatch, without inferring current branch UI status. Hold the affected visual claim for Orchestrator if source/output is missing, evidence is inaccessible or an interpretation is unapproved; do not silently substitute or redesign.
183
- - [review.significant-no-plan] For significant/high-risk work without a plan: Implementer → QA and required QA rechecks → Reviewer of the final full change → Orchestrator acceptance. MUST NOT omit Reviewer because no plan exists. This creates no new plan obligation.
184
- - [review.significant-plan] For significant/high-risk plan work: each task uses Implementer → fresh QA as required → Orchestrator acceptance and focused commit. Reviewer reviews the final full change once after all tasks are accepted and required QA is complete. Reviewer is NOT a per-task or per-commit required gate. Preserve required checks and necessary finding rechecks.
185
- - [review.final-plan-recheck] For final overall Reviewer findings on plan work, including behavior findings, use Implementer → 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.
186
- - [platform.claude] Existing per-role tool allowlists reduce available tools; Bash and role contracts are not a filesystem sandbox. A role-scoped Git guard is a separate integration and is not supplied by these policy sections alone.
121
+ - [git.specialists-deny] Specialists must not change Git state during implementation or recovery: no stage, commit, push, merge, rebase, reset, branch creation/switching or worktree creation/removal. Explicit Orchestrator assignment cannot authorize these actions; return them to Orchestrator. Read-only Git inspection within the assigned scope remains allowed.
122
+ - [role.implementer-implementation] Edit only assigned, approved files and run focused checks under the existing TDD contract. Report changed files, RED/GREEN or approved exception evidence, results, limits and follow-up. Do not plan, independently QA/review your own work, accept the task or declare overall completion. Git mutations remain forbidden after successful implementation. Implementer and fresh QA handoffs include the exact approved visual source, version, approval and access state; criterion IDs, required properties and comparison method; and actual-output identity, revision and comparison basis. Record pass, mismatch or unverified with accessible evidence and limits. Implementer self-report does not replace fresh QA and its actual comparison. A missing output-to-revision link is unverified; record a visible difference separately as mismatch without inferring current branch UI state. Missing source/output, inaccessible evidence or unapproved interpretation holds the affected visual claim for Orchestrator. Do not silently substitute or redesign.
123
+ - [review.significant-no-plan] Significant/high-risk work without a plan follows Implementer → QA and required QA rechecks → Reviewer of the final full change → Orchestrator acceptance. Do not omit Reviewer because no plan exists. This adds no plan obligation.
124
+ - [review.significant-plan] Significant/high-risk plan work follows Implementer → required fresh QA → Orchestrator acceptance and focused commit for each task. 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 gate. Preserve required checks and necessary finding rechecks.
125
+ - [review.final-plan-recheck] Final overall Reviewer findings on plan work, including behavior findings, follow Implementer → Reviewer without QA reassignment until resolved. This exception applies only at the final plan stage. Preserve required QA and QA failure rechecks before the initial final review and outside this exception.
126
+ - [platform.claude] Existing per-role tool allowlists reduce available tools; Bash and role contracts are not a filesystem sandbox. ARC supplies no native observer hook or Bash Git guard; Git restrictions remain prompt-level role contracts.
187
127
  [ARC role policy: contract end]
188
128
 
129
+ <a id="initial-implementer-assignment-through-the-cooperative-cli"></a>
189
130
  ## Initial Implementer assignment through the cooperative CLI
190
131
 
191
- In approved plan mode, Orchestrator performs the following sequence. All mutation commands pass JSON through stdin with
192
- `node "$ARC_RUNTIME_ENTRY" <command> --cwd "$ARC_CHECKOUT" --workflow "$ARC_WORKFLOW_ID" --input -`.
193
- Resolve `ARC_RUNTIME_ENTRY` from the actual ARC skill directory selected by the installation resolver:
194
- `<target-home>/skills/arc/runtime/cli.mjs`. Use the loaded skill's location, including a custom target home;
195
- do not guess the default home or use a package, checkout or cache entry. Pass the resolved path, checkout and
196
- workflow ID as separate argv values when using a process API. In a shell, assign values safely and double-quote
197
- these variables; never interpolate paths into executable shell text or use `eval`.
198
- Query `status` without `--input`.
199
-
200
- The entry preserves the cooperative state path in the selected checkout's Git common directory. Installing or
201
- updating the entry does not migrate state or renew approvals. Runtime/hash, target, actor and revision checks still
202
- apply: runtime drift holds existing evidence; obtain the required current evidence and approval through the
203
- existing recovery procedure. A new workflow cannot retroactively validate earlier execution.
204
-
205
- 1. Prepare the docs-only commit of the approved spec and plan, and verify the exact document set, objects and current files.
206
- Perform `init`, approval `record` and `prepare` only after this commit verification, even when user approval preceded the document commit.
207
- 2. After document commit verification, pass `mode: "plan"`, `actor: {id: "operator"}` and `selection: {messageRef, contentHash}` to `init` at the final target HEAD.
208
- 3. Use `record` to persist the user approval attestation already confirmed. The input is
209
- `{requestId, expectedRevision, actor, evidence: {kind: "approval", messageRef, data: {approvalVersion, documentVersion, documents}}}`.
210
- `documents` contains exactly the spec and plan, each with `{kind, path, gitPath, contentHash, approvalRef, commit}`.
211
- `contentHash` is `sha256:<hex>`, and `approvalRef` must match the approval `messageRef`.
212
- On HEAD drift, record a fresh target observation and renewed approval instead of reconnecting an earlier intent.
213
- 4. Pass `{requestId, expectedRevision, actor, operation: "assign-agent", taskId, arguments: {role: "implementer", paths, operations: ["edit"], documents, approvalRef, approvalVersion, documentVersion, correlation}}` to `prepare`.
214
- Absolute `paths` must be inside the checkout. Confirm `allow`, `persisted: true` and the persisted intent.
215
- 5. Invoke the native assignment with the task, scope and correlation from the persisted intent.
216
- 6. Pass `{requestId, expectedRevision, actor, intentId, result: {status, messageRef, data: {correlation, taskId, agentId}}}` to `result`.
217
- `intentId` is the prepare requestId. Distinguish success as `succeeded`, failure as `failed`, uncertain execution as `unknown` and a response mismatch as `mismatch`.
218
- Success requires the returned agent ID. `unknown`/`mismatch` causes a hold; stop duplicate assignments and investigate the actual result.
219
-
220
- Approval and assignment results on this path are `operator-attested`. They do not authenticate native identities or verify platform events.
221
- The CLI cannot block direct calls outside it, and a new workflow cannot legitimize omitted past execution. Existing trusted adapter provenance requirements remain in force.
132
+ In approved plan mode all mutations pass stdin JSON through `node "$ARC_RUNTIME_ENTRY" <command> --cwd "$ARC_CHECKOUT" --workflow "$ARC_WORKFLOW_ID" --input -`. Resolve `ARC_RUNTIME_ENTRY` as `<target-home>/skills/arc/runtime/cli.mjs` from the actual installer-selected loaded skill, including custom homes, never guessed home/package/checkout/cache entries. Use separate argv for path/checkout/workflow. Safely assign/double-quote shell variables; never interpolate executable paths or `eval`. Query `status` without `--input`.
222
133
 
134
+ Entry installation/update migrates no common-directory state or approvals. Preserve runtime/hash/target/actor/revision gates; drift holds evidence for current recovery/approval. New workflows prove no historical compliance.
223
135
 
136
+ 1. Verify approved spec/plan docs-only commit, exact set/Git objects/current bytes. Only then run `init`, approval `record`, `prepare`, even if approval preceded commit.
137
+ 2. At final HEAD `init` with `mode: "plan"`, `actor: {id: "operator"}`, `selection: {messageRef, contentHash}`.
138
+ 3. Record confirmed approval as `{requestId, expectedRevision, actor, evidence: {kind: "approval", messageRef, data: {approvalVersion, documentVersion, documents}}}`. `documents` is exactly spec/plan with `{kind, path, gitPath, contentHash, approvalRef, commit}`; `contentHash`=`sha256:<hex>`, `approvalRef` matches approval `messageRef`. HEAD drift needs fresh observation/renewed approval, not reconnection to old intent.
139
+ 4. `prepare` with `{requestId, expectedRevision, actor, operation: "assign-agent", taskId, arguments: {role: "implementer", paths, operations: ["edit"], documents, approvalRef, approvalVersion, documentVersion, correlation}}`. Absolute `paths` remain in checkout. Confirm `allow`, `persisted: true` and saved intent.
140
+ 5. Invoke native assignment with saved task/scope/correlation.
141
+ 6. Record `{requestId, expectedRevision, actor, intentId, result: {status, messageRef, data: {correlation, taskId, agentId}}}`. `intentId` is prepare requestId. Distinguish `succeeded`, `failed`, `unknown`, `mismatch`. Success needs returned agent ID; unknown/mismatch holds duplicate assignment for investigation.
142
+
143
+ Approval/assignment are `operator-attested`, not native identity/event authentication. CLI blocks no outside direct call; new workflow legitimizes no historical omission. Preserve trusted-adapter provenance.
144
+
145
+ <a id="external-operations-and-recovery-in-the-cooperative-cli"></a>
224
146
  ## External operations and recovery in the cooperative CLI
225
147
 
226
- The three phases support state, documents and assignment; scope, verification, acceptance and focused commits; and external approval, results and audit recovery.
227
- Use `status.support` to inspect all nine areas and their limits. The supported mode is `plan` with spec+plan; no-plan and omission are unsupported. The CLI does not execute native/provider calls or push, merge, deploy or publish.
228
- User approvals and execution results confirmed by the operator are `operator-attested`, with `nativeVerified: false` and
229
- `remoteVerified: false`. Blocking direct calls outside the CLI and independent remote verification are not provided.
148
+ Three phases cover state/documents/assignment; scope/verification/acceptance/focused commits; external approval/results/audit recovery. Inspect nine areas/limits with `status.support`. Support is spec+plan `plan`, not no-plan/omission. CLI executes no native/provider/push/merge/deploy/publish calls.
149
+
150
+ Operator-confirmed approvals/results are `operator-attested`, `nativeVerified: false`, `remoteVerified: false`; no outside-call blocking or independent remote verification.
230
151
 
231
- Orchestrator records an explicit approval it has already confirmed through `record` with
232
- `evidence: {kind: "external-approval", messageRef, data: {operation, scope, descriptor}}`.
233
- `scope` is an array of unique absolute paths within the checkout. Local commit approval does not authorize external operations.
234
- Include the exact action, scope and target in the approval, and record every descriptor field below.
152
+ Record already confirmed external approval using `evidence: {kind: "external-approval", messageRef, data: {operation, scope, descriptor}}`. `scope` is unique absolute checkout paths. Local commit approval grants no external approval. Record exact action/scope/target and all descriptor fields:
235
153
 
236
154
  | operation | descriptor fields |
237
155
  |---|---|
@@ -240,26 +158,10 @@ Include the exact action, scope and target in the approval, and record every des
240
158
  | deploy | service, project, environment, artifactId, destination |
241
159
  | publish | service, namespace, name, version, artifactHash, destination |
242
160
 
243
- Git OIDs are full 40/64-character lowercase hex values; artifactHash is `sha256:<64-hex>`. Without a remote observation,
244
- an OID is an expected value asserted by the user, not verified remote state. destination must be an identifier without secrets.
245
- Do not submit URL userinfo, query or fragment components, or authentication information such as passwords, tokens or credentials.
246
- The CLI rejects recognized credential inputs before persistence, but cannot determine whether every arbitrary string contains a secret.
247
-
248
- Pass `{requestId, expectedRevision, actor: {id, role: "orchestrator"}, operation,
249
- arguments: {approvalRef, scope, descriptor}}` to `prepare`. approvalRef matches the external approval messageRef.
250
- An intent is persisted only when the exact approval, scope/target versions and runtime version match and no effect is unresolved.
251
- After confirming `allow` and `persisted: true`, Orchestrator performs the external operation within its separately approved scope.
252
- This CLI does not expand that execution authority.
253
-
254
- `result`/`reconcile` accepts `{requestId, expectedRevision, actor, intentId,
255
- result: {status, messageRef, data: {operation, scope, descriptor}}}`. intentId is the prepare requestId.
256
- Target mismatches, unknown outcomes and stale results cause a hold while preserving earlier attestations. After an interruption,
257
- use `status` to inspect the intent, `state.requests`, `state.audit` and `state.results`, and investigate whether the effect occurred.
258
- Reconcile the investigation result against the same intent rather than preparing again or reusing the same approval to execute again.
259
- Cancellation additionally requires a `notExecutedEvidence: {messageRef}` attestation that the operation was not executed.
260
- The approval remains consumed after cancellation. Do not resolve version drift through automatic updates, migration or renewed permission.
261
- Report the cause of the hold to Orchestrator.
262
-
263
- Even succeeded results are operator attestations, not independent remote verification. `audit` retains the
264
- request→decision→intent→result→resolution linkage, but is a locally editable record rather than tamper-proof security evidence.
265
- Do not retry while the actual external outcome is uncertain.
161
+ Git OIDs are full lowercase 40/64-character hex; artifactHash is `sha256:<64-hex>`. Without remote observation OIDs are asserted expectations, not verified state. Destination is secret-free. No URL userinfo/query/fragment/password/token/credentials. Recognized secrets are rejected before persistence, but arbitrary-string secrecy cannot be guaranteed.
162
+
163
+ `prepare` accepts `{requestId, expectedRevision, actor: {id, role: "orchestrator"}, operation, arguments: {approvalRef, scope, descriptor}}`; approvalRef matches external approval messageRef. Persist only exact approval/scope/target/runtime versions with no unresolved effects. After `allow`/`persisted: true`, Orchestrator executes separately approved scope; CLI expands no authority.
164
+
165
+ `result`/`reconcile` accept `{requestId, expectedRevision, actor, intentId, result: {status, messageRef, data: {operation, scope, descriptor}}}`, with prepare requestId as intentId. Mismatch/unknown/stale outcomes hold while preserving attestations. After interruption inspect intent/`state.requests`/`state.audit`/`state.results` through `status` and investigate actual effects. Reconcile that same intent, not fresh preparation or replayed approvals.
166
+
167
+ Cancellation also requires `notExecutedEvidence: {messageRef}`; approval remains consumed. No automatic update/migration/renewed permission to fix drift. Report holds. Succeeded results remain attestations, not remote proof. `audit` links request→decision→intent→result→resolution but is locally editable, not tamper-proof. Never retry uncertain external outcomes.
@@ -1,41 +1,29 @@
1
+ <a id="subagent-limits"></a>
1
2
  # Subagent limits
2
3
 
3
- Before the first subagent creation, Orchestrator reads this reference and the adjacent
4
- `../limits.toml` (installed at `skills/arc/limits.toml`). Require version = 1,
5
- `max_total_subagents` and `max_concurrent_subagents` as positive safe integers.
6
- Installation defaults are max_total_subagents = 100 and max_concurrent_subagents = 5.
7
- A missing, malformed or unreadable policy blocks new creation. Report it; MUST NOT assume defaults.
8
- Freeze these settings for one ARC coordination session/tree; reinstalling affects new sessions.
4
+ Before first creation, Orchestrator reads this reference and adjacent `../limits.toml` (installed at `skills/arc/limits.toml`). Require `version = 1` and positive safe-integer `max_total_subagents`/`max_concurrent_subagents`. Installation defaults are `100`/`5`. Missing, malformed or unreadable policy blocks creation; report it without assuming defaults. Freeze settings for one ARC session/tree; reinstalling affects new sessions.
9
5
 
6
+ <a id="counting-and-reservations"></a>
10
7
  ## Counting and reservations
11
8
 
12
- Maintain a session ledger of instance IDs, parent IDs, pending reservations, creation outcomes,
13
- and active/completed state. The Orchestrator itself is excluded. All created descendants,
14
- including nested or non-ARC agents, count toward the total. Completed agents never refund the cumulative budget. Follow-up/resume of the same instance does not increment total;
15
- a fresh instance, retry creating a new instance, or replacement increments it.
16
- Waiting, blocked, running and idle resumable instances consume concurrency until their
17
- completion/termination is confirmed. Obey any lower actual runtime capacity, including
18
- native retention of completed instances; ARC counts do not prove that a native slot is free.
19
-
20
- Before any parallel dispatch, reserve the entire proposed batch in the ledger:
21
- created + pending reservations + proposed <= max_total_subagents, and
22
- active + pending reservations + proposed <= max_concurrent_subagents and available runtime capacity.
23
- Record a reservation before each creation call. Confirmed creation converts it into a created,
24
- active ID. Release a reservation only when failure proves no instance was created.
25
- An uncertain result retains its reservation and capacity until reconciled. MUST NOT retry blindly.
26
- Serialize work when a batch does not fit. There are no reserved role slots.
9
+ - Track instance IDs, parent IDs, pending reservations, creation outcomes and active/completed state in the session ledger. Exclude Orchestrator, but count every created descendant, including nested/non-ARC agents.
10
+ - Completion never refunds cumulative creation. Same-instance follow-up/resume adds nothing; fresh instances, new-instance retries and replacements increment the total.
11
+ - Waiting, blocked, running and resumable idle instances consume concurrency until confirmed completion/termination. Obey lower actual runtime capacity, including native retention of completed instances. ARC counts do not prove free native slots.
27
12
 
13
+ Reserve the full proposed parallel batch before dispatch, satisfying both:
14
+
15
+ 1. `created + pending reservations + proposed <= max_total_subagents`
16
+ 2. `active + pending reservations + proposed <= max_concurrent_subagents`, within actual available runtime capacity.
17
+
18
+ Reserve before each call. Confirmed creation becomes a created/active ID. Release only when failure proves no instance was created. Uncertain results retain capacity until reconciled; never retry blindly. Serialize batches that do not fit. No role has reserved slots.
19
+
20
+ <a id="continuation-and-exhaustion"></a>
28
21
  ## Continuation and exhaustion
29
22
 
30
- Preserve the ledger through continuation, resume and context compaction; reconcile actual instance
31
- IDs before dispatch. Ledger loss must never reset counters to zero. If reconstruction is incomplete,
32
- hold creation and report the unknown budget; use a conservative upper bound only when the reconstructed records support it.
33
- Completion frees confirmed active capacity; it does not restore the total-created budget. Exhaustion holds new
34
- creation and requires reporting remaining work and budgets. It does not authorize skipping required
35
- QA or Reviewer, role freshness, approval, ownership, dependency or same-file edit gates.
23
+ Preserve the ledger across continuation/resume/compaction and reconcile actual IDs before dispatch. Never reset lost counters to zero. Incomplete reconstruction holds creation and reports unknown budget; use a conservative upper bound only when records support it.
24
+
25
+ Completion frees confirmed active capacity only. Exhaustion holds creation and reports remaining work/budget; it never waives QA/Reviewer, role freshness, approval, ownership, dependency or same-file edit gates.
36
26
 
37
- This cumulative guard and ARC scheduling are prompt-level policy, not hard runtime enforcement.
38
- Policy text tests prove package consistency, not actual agent compliance or native runtime support.
27
+ Cumulative limits and scheduling are prompt policy, not hard runtime controls. Text tests prove package consistency, not live compliance/native support.
39
28
  Claude `settings.json.env.CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS` constrains its native session.
40
- Independent sessions, accounts and platforms do not share this ARC ledger; Agent Teams and hosted APIs
41
- are outside this contract. Native application must be checked in a supported new session separately.
29
+ Independent sessions/accounts/platforms do not share the ledger. Agent Teams and hosted APIs are outside this contract. Verify native application separately in a supported new session.