@yunhozz/arc 0.5.5 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/MANIFEST.sha256 +83 -74
  2. package/claude/agents/arc-implementer.md +2 -2
  3. package/claude/agents/arc-planner.md +1 -1
  4. package/claude/agents/arc-reviewer.md +1 -1
  5. package/claude/agents/arc-scouter.md +1 -1
  6. package/claude/agents/arc-tester.md +1 -1
  7. package/claude/skill/SKILL.md +3 -3
  8. package/claude/skill/references/arc-visual-companion.md +2 -21
  9. package/claude/skill/references/commit.md +3 -30
  10. package/claude/skill/references/coordination.md +20 -126
  11. package/claude/skill/references/git-recovery.md +3 -3
  12. package/claude/skill/references/handoff-prep.md +9 -24
  13. package/claude/skill/references/handoff.md +19 -108
  14. package/claude/skill/references/limits.md +4 -15
  15. package/claude/skill/references/planning.md +56 -95
  16. package/claude/skill/references/verification.md +16 -118
  17. package/claude/skill/references/worktree-creation.md +1 -1
  18. package/codex/agents/arc-implementer.toml +3 -1
  19. package/codex/agents/arc-planner.toml +4 -0
  20. package/codex/agents/arc-reviewer.toml +6 -0
  21. package/codex/agents/arc-scouter.toml +6 -0
  22. package/codex/agents/arc-tester.toml +6 -0
  23. package/codex/skill/SKILL.md +3 -3
  24. package/codex/skill/references/arc-visual-companion.md +3 -27
  25. package/codex/skill/references/commit.md +3 -30
  26. package/codex/skill/references/coordination.md +19 -126
  27. package/codex/skill/references/git-recovery.md +2 -7
  28. package/codex/skill/references/handoff-prep.md +9 -24
  29. package/codex/skill/references/handoff.md +18 -107
  30. package/codex/skill/references/limits.md +5 -16
  31. package/codex/skill/references/planning.md +56 -95
  32. package/codex/skill/references/verification.md +15 -117
  33. package/gemini/agents/arc-implementer.md +1 -1
  34. package/gemini/skill/SKILL.md +3 -3
  35. package/gemini/skill/references/arc-visual-companion.md +2 -21
  36. package/gemini/skill/references/commit.md +3 -30
  37. package/gemini/skill/references/coordination.md +23 -129
  38. package/gemini/skill/references/git-recovery.md +3 -3
  39. package/gemini/skill/references/handoff-prep.md +9 -24
  40. package/gemini/skill/references/handoff.md +19 -108
  41. package/gemini/skill/references/limits.md +4 -15
  42. package/gemini/skill/references/planning.md +56 -95
  43. package/gemini/skill/references/verification.md +16 -118
  44. package/grok/agents/arc-implementer.md +1 -1
  45. package/grok/skill/SKILL.md +2 -2
  46. package/grok/skill/references/arc-visual-companion.md +2 -21
  47. package/grok/skill/references/commit.md +3 -30
  48. package/grok/skill/references/coordination.md +21 -127
  49. package/grok/skill/references/git-recovery.md +3 -3
  50. package/grok/skill/references/handoff-prep.md +9 -24
  51. package/grok/skill/references/handoff.md +19 -108
  52. package/grok/skill/references/limits.md +4 -15
  53. package/grok/skill/references/planning.md +56 -95
  54. package/grok/skill/references/verification.md +16 -118
  55. package/lib/policy/role-policy.json +1 -1
  56. package/lib/prompts/agent-fragments.json +20 -9
  57. package/lib/prompts/render.mjs +16 -5
  58. package/lib/runtime/adapters/codex.mjs +1 -1
  59. package/lib/runtime/assignment.mjs +3 -2
  60. package/lib/runtime/cooperative.mjs +36 -3
  61. package/lib/runtime/evaluate.mjs +21 -6
  62. package/lib/runtime/gate.mjs +2 -1
  63. package/lib/runtime/schema.mjs +16 -0
  64. package/lib/runtime/target-preparation.mjs +7 -2
  65. package/lib/runtime/verification.mjs +1 -1
  66. package/package.json +1 -1
  67. package/shared/skill/references/arc-visual-companion-common.md +39 -0
  68. package/shared/skill/references/commit-common.md +45 -0
  69. package/shared/skill/references/coordination-common.md +193 -0
  70. package/shared/skill/references/git-recovery-common.md +15 -0
  71. package/shared/skill/references/handoff-common.md +182 -0
  72. package/shared/skill/references/handoff-prep-common.md +53 -0
  73. package/shared/skill/references/limits-common.md +34 -0
  74. package/shared/skill/references/planning-common.md +185 -0
  75. package/shared/skill/references/verification-common.md +170 -0
  76. package/shared/skill/runtime/adapters/codex.mjs +1 -1
  77. package/shared/skill/runtime/assignment.mjs +3 -2
  78. package/shared/skill/runtime/cooperative.mjs +36 -3
  79. package/shared/skill/runtime/evaluate.mjs +21 -6
  80. package/shared/skill/runtime/gate.mjs +2 -1
  81. package/shared/skill/runtime/role-policy.json +1 -1
  82. package/shared/skill/runtime/schema.mjs +16 -0
  83. package/shared/skill/runtime/target-preparation.mjs +7 -2
  84. package/shared/skill/runtime/verification.mjs +1 -1
@@ -10,9 +10,7 @@ Keep shared brief field order, recording source/status within fields. Distinguis
10
10
 
11
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.
12
12
 
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 Tester comparison. Report pass/mismatch/unverified with evidence/limits; return new UI interpretations/substitutions.
14
-
15
- Resume briefs preserve valid approval for unchanged scope, completed work, failures and their resolution, valid and invalid evidence, holds and the next objective. Record changed facts and revalidate gates without repeating completed work. Preserve role/Git/Tester/final Reviewer/acceptance/commit boundaries.
13
+ Shared text for this section: [handoff-common.md#instruction-sources-bounded-read-recovery-visual-evidence-and-resumption](handoff-common.md#instruction-sources-bounded-read-recovery-visual-evidence-and-resumption). It applies here exactly as if written in place.
16
14
 
17
15
  <a id="workspace-handoff"></a>
18
16
  ## Workspace handoff
@@ -20,26 +18,12 @@ Resume briefs preserve valid approval for unchanged scope, completed work, failu
20
18
  <a id="checkout-approval"></a>
21
19
  ### Checkout approval
22
20
 
23
- Before every Implementer start or restart, verify access to the supplied absolute workspace and its intended repository. Record the actual path, branch or detached HEAD, HEAD, and staged, unstaged and untracked state. An inaccessible or wrong repository or unresolved HEAD stops work; DO NOT automatically initialize Git or switch repositories.
24
-
25
- The first required spec/plan draft follows choice and verified source evidence and precedes actual preparation; saving follows verified preparation. Initial design MAY precede choice. Preparation alone authorizes no Implementer. All approvals/full documents/verified batch or valid absence/final Git checks remain. Separate planned scope/paths, actual preparation and drafting/save/approval/commit, recording chronology/gaps.
26
-
27
- After initial design approval record explicit selection: current checkout, new task branch from verified base there, or managed worktree/task branch. Without choice/valid reuse, wait. Reuse through unchanged-scope/target drafting/implementation. Authorized HEAD/dirty changes alone do not invalidate choice; verify preservation/ownership. Changed scope/target requires fresh choice before dependent drafting/preparation without waiting for full documents. NEVER fall back automatically.
21
+ Shared text for this section: [handoff-common.md#checkout-approval](handoff-common.md#checkout-approval). It applies here exactly as if written in place.
28
22
 
29
23
  <a id="implementer-handoff-gate"></a>
30
24
  ### Implementer handoff gate
31
25
 
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
- Before the first direct edit, use approved scope records and the same gates. Any failure/missing condition blocks handoff, not authorized read-only investigation/preparation/recovery. Revalidate changes to approved content/target/branch/HEAD/state. Implementer reports actual conflicts under its profile; Orchestrator resolves and repasses gates.
26
+ Shared text for this section: [handoff-common.md#implementer-handoff-gate](handoff-common.md#implementer-handoff-gate). It applies here exactly as if written in place.
43
27
 
44
28
  <a id="handoff-evidence"></a>
45
29
  ### Handoff evidence
@@ -55,37 +39,27 @@ One canonical record includes:
55
39
  - Each plan task ID and current Implementer conversation ID, status, last result and reuse/replacement decision. Before same-task replacement, record the prior ID and status, allowed reason and supporting evidence; hold if the reason is not established. Record the returned ID after a successful initial or replacement call, and reconcile an uncertain call result before another assignment.
56
40
  - Worktree source/target paths/common directory/base/branch/name/returned path/app attachment/operationId/registration/source preservation/transfer evidence. No automatic recreation/cleanup/archive.
57
41
 
58
- 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.
42
+ Shared text for this section: [handoff-common.md#handoff-evidence](handoff-common.md#handoff-evidence). It applies here exactly as if written in place.
59
43
 
60
44
  <a id="task-readiness-at-every-assignment"></a>
61
45
  ## Task readiness at every assignment
62
46
 
63
- 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.
64
-
65
- Apply all [planning](planning.md#dependency-and-readiness-record) conditions: predecessor checks/Orchestrator acceptance/verified commit or accepted no-change. Reports alone are insufficient. Verify current records/capacity/ownership. Readiness supplements, never replaces handoff/target gates. Authorized HEAD/state changes refresh records/briefs/preservation/gates and [shared-checkout](commit.md#shared-checkout-coordination) readiness. Unexpected HEAD/ownership stops affected work for resolution.
47
+ Shared text for this section: [handoff-common.md#task-readiness-at-every-assignment](handoff-common.md#task-readiness-at-every-assignment). It applies here exactly as if written in place.
66
48
 
67
49
  <a id="choice-lifetime-and-restart-record"></a>
68
50
  <a id="choice-lifetime-and-reuse"></a>
69
51
  ## Choice lifetime and restart record
70
52
 
71
- 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.
72
-
73
- Unchanged-document restarts reuse valid commits/choice with fresh state checks. Accepted task/docs commits and authorized implementation/dirty changes alone invalidate no choice; record matching work/ownership/target. Authorized worktree transfers also preserve reuse. Creation base remains evidence, not a permanent target HEAD constraint; source-preservation/unexpected-state checks remain. Link plan version/task ID/commit content-validity/current Git/ownership in restart brief. NEVER duplicate successful commits or confuse task commits with document preparation; DO NOT repeat valid docs preparation.
74
-
75
- 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.
53
+ Shared text for this section: [handoff-common.md#choice-lifetime-and-restart-record](handoff-common.md#choice-lifetime-and-restart-record). It applies here exactly as if written in place.
76
54
 
77
55
  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.
78
56
 
79
- In a worktree session, use the ARC runtime command `node <runtime>/cli.mjs handoff-record write --cwd <abs> --slug <slug> --input -` instead of a file tool. Set `<runtime>` to the installed ARC skill runtime directory and send a JSON object with a nonempty `content` string containing the full Markdown record on stdin. Use the existing inline fallback if the command fails. This user-approved ARC runtime command respects `scope.non-escalation` by writing only to `<git-common-dir>/arc/handoff/<slug>.md` and leaving permissions and sandbox settings unchanged.
80
-
81
- Unavailable/denied record writes require reason/full inline record in every Implementer brief, without deltas or record-file `unchanged`; inline satisfies accessibility.
82
-
83
- 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.
57
+ Shared text for this section: [handoff-common.md#choice-lifetime-and-restart-record-2](handoff-common.md#choice-lifetime-and-restart-record-2). It applies here exactly as if written in place.
84
58
 
85
59
  <a id="authorization-continuity"></a>
86
60
  ## Authorization continuity
87
61
 
88
- 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.
62
+ Shared text for this section: [handoff-common.md#authorization-continuity](handoff-common.md#authorization-continuity). It applies here exactly as if written in place.
89
63
 
90
64
  <a id="common-handoff-gate"></a>
91
65
  ## Common handoff gate
@@ -96,7 +70,7 @@ Selected worktrees require common directory, registration, app-managed current-c
96
70
  <a id="implementer-tdd-and-constraints"></a>
97
71
  ## Implementer TDD and constraints
98
72
 
99
- 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.
73
+ Shared text for this section: [handoff-common.md#implementer-tdd-and-constraints](handoff-common.md#implementer-tdd-and-constraints). It applies here exactly as if written in place.
100
74
 
101
75
  Waiver skips RED-GREEN only, preserving focused checks/risk-scaled Tester/Reviewer; NEVER claim TDD. Follow an applicable higher-priority prohibition on adding or running tests; when precedence and scope are clear, DO NOT report a conflict on that basis or ask permission to violate it. TDD remains applicable to permitted test work. Record unperformed verification and its limits; if precedence or scope is genuinely unclear, or required verification is blocked, hold only affected work and acceptance and report the evidence. Other 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. Test scope follows [verification](verification.md#test-scope-and-result-comparison) and takes precedence over upstream TDD's per-task project-suite instruction.
102
76
 
@@ -105,12 +79,7 @@ Waiver skips RED-GREEN only, preserving focused checks/risk-scaled Tester/Review
105
79
 
106
80
  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 Spike/Architectural, ordinary behavior/significant/high/unclear risk and active Implementer file overlaps. File count proves no eligibility.
107
81
 
108
- 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.
109
- 2. Read this/[preparation](handoff-prep.md), pass full gate before edit and edit approved files surgically, preserving others. No unrelated refactoring/unapproved dependencies.
110
- 3. Follow Implementer TDD/recorded waivers; explicit TDD still requires local skill. Record files/checks/criterion evidence/gaps. Orchestrator is not independent; assign Tester for incomplete evidence.
111
- 4. Failed checks/Tester findings route to Implementer/recheck, never self-correction. Scope/risk/condition changes stop edits, record work/reclassify and return subsequent edits to normal Planner/Implementer flow.
112
-
113
- Add no plans/automatic commits to omission paths; follow guidance/user requests.
82
+ Shared text for this section: [handoff-common.md#orchestrator-direct-path-for-small-tasks](handoff-common.md#orchestrator-direct-path-for-small-tasks). It applies here exactly as if written in place.
114
83
 
115
84
 
116
85
  ### Fast gate
@@ -126,52 +95,24 @@ Select the existing direct path only when all eight conditions are `proven`. Rec
126
95
  - **F7**: Applicable TDD is identified; any waiver or non-behavior exception meets existing conditions and is recorded beforehand. Explicit user/task TDD overrides waiver.
127
96
  - **F8**: Applicable instruction source-set and approval, target, criteria and verification evidence are accessible, consistent and unambiguous.
128
97
 
129
- Security/permissions and public-interface changes are never eligible under the existing significant-risk exclusions. File count, LOC and apparent simplicity prove none of F2–F5. This gate does not replace the first direct edit gate, Implementer start/restart gate, target choice, TDD, independent Tester and Reviewer, acceptance or commit; existing triggers determine whether each gate applies. The fast path does not add untriggered role, Tester/Reviewer, acceptance or commit obligations. Preserve all existing platform restrictions.
98
+ Shared text for this section: [handoff-common.md#handoff-fast-gate](handoff-common.md#handoff-fast-gate). It applies here exactly as if written in place.
130
99
 
131
100
  ### Instruction fingerprint
132
101
 
133
- Record the actual applicable source-set: platform ARC SKILL, these initial reference sections, applicable workspace instructions, and triggered references/skills; record user/platform messages by message and approval reference, not invented file hashes. Record native role profile source/version when assigned; a new role receives actual instructions, profile, needed paths and criteria, not merely a hash. DO NOT assume disk profile changes updated an active role.
134
-
135
- Distinguish user-provided instructions, workspace instructions, installed references and task inputs by source, applicability and access state: available, absent, inaccessible, conflicting or unverified. For every file record source kind, absolute and resolved path, read sections, available revision, SHA-256 of entire file bytes, access state, observation and read-context references. Neither HEAD nor installer manifest substitutes for actual installed-source hash. Use only already identified source paths; DO NOT search or guess. An uncertain source-set makes F8 `unverified`.
136
-
137
- Reuse read content only for the same source-set, absolute source locators, resolved paths, hashes, scope and same conversation context with meaning still available. Different absolute locators cannot be reused even if they resolve to the same path. New context, inaccessible record or context loss requires rereading; changed source/hash requires rereading and reassessing affected judgments. Verify the current source-set/hash at a new fast judgment, first-edit or assignment/restart/resumption gate, before acceptance, and on known source changes; reuse observations within the same gate. If hashing fails, DO NOT reuse; follow existing read recovery and hold required inaccessible inputs. When Node is already available, batch identified absolute paths with built-in `node:fs` realpath/readFileSync and `node:crypto` SHA-256; install nothing and print no source content.
138
-
139
-
140
- For identified absolute sources only, when Node is already available, this read-only example prints paths and hashes, not contents:
141
-
142
- ```sh
143
- node --input-type=module -e '
144
- import fs from "node:fs";
145
- import crypto from "node:crypto";
146
- const sources = process.argv.slice(1);
147
- if (!sources.length) throw new Error("No instruction sources");
148
- for (const source of sources) {
149
- const resolvedPath = fs.realpathSync(source);
150
- const contentHash = "sha256:" + crypto.createHash("sha256").update(fs.readFileSync(resolvedPath)).digest("hex");
151
- process.stdout.write(JSON.stringify({source, resolvedPath, contentHash}) + "\n");
152
- }
153
- ' -- '/absolute/identified/source-1' '/absolute/identified/source-2'
154
- ```
155
- A new conversation or lost context requires reread; unchanged HEAD alone does not prove instruction, file or check evidence current.
102
+ Shared text for this section: [handoff-common.md#handoff-instruction-fingerprint](handoff-common.md#handoff-instruction-fingerprint). It applies here exactly as if written in place.
156
103
 
157
104
  ### Task envelope
158
105
 
159
- Place the compact envelope in the existing canonical handoff record or existing inline scope record, not a new file, store or API. Record task path and outcome; instructions; target; approval; scope and criteria; risk and depth; TDD; verification; refresh. Specifically include task ID/path, source fingerprint/read context, workspace/branch/HEAD/change state/preservation/ownership, scope approval and target choice, edit boundaries/criteria, F1–F8 evidence/risk/depth, TDD or recorded exception, criterion checks/Tester/Reviewer/acceptance, and observations/changes/revalidation/holds. Link accessible records; inaccessible references do not replace required content. Embed it in the existing eight specialist brief fields in their fixed order, without a ninth field or full history.
160
-
161
- The nine fields are `task`, `instructions`, `target`, `authorization`, `scopeCriteria`, `riskDepth`, `tdd`, `verification`, and `refresh`; task records the task ID/path and selected path `fast-direct` or `full`, and verification includes criteria-specific checks and their evidence.
106
+ Shared text for this section: [handoff-common.md#handoff-task-envelope](handoff-common.md#handoff-task-envelope). It applies here exactly as if written in place.
162
107
 
163
108
  ### Evidence refresh
164
109
 
165
- Evaluate target choice validity separately from evidence validity. Approved HEAD or expected dirty changes do not invalidate target choice by themselves: record current state, preservation and ownership, and assess affected criteria/checks. Revalidate only affected evidence; a related file change after a check leaves that check unverified until repeated as needed. Changed instructions require reassessing linked fast/risk/TDD/authorization judgments. Preserve unaffected evidence and valid approvals. Unclear impact, missing or inaccessible evidence, ownership conflict, failure or partial/unknown state requires existing hold and recovery; workspace/target change or loss of trust follows target-choice rules. For a target change, obtain a new choice where required and state confirmation before dependent edit. Scope/criteria/method/risk changes follow existing approval and fresh-role rules. A failed direct check or Tester finding returns to existing Implementer/recheck ownership.
110
+ Shared text for this section: [handoff-common.md#handoff-evidence-refresh](handoff-common.md#handoff-evidence-refresh). It applies here exactly as if written in place.
166
111
 
167
112
  <a id="cooperative-cli-verification-handoff"></a>
168
113
  ## Cooperative CLI verification handoff
169
114
 
170
- 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
-
172
- Include spec/plan paths in cooperative `task.paths` to commit task progress records and pending revisions; missing paths hold the commit until an approved scope revision, and the cooperative CLI does not support the standalone `docs(plan)` closing commit, so include pending revisions in task or follow-up commits. When `task.paths` includes the plan path, the cooperative CLI holds R-8 separation commits (staging progress records without revision hunks) at both preflight and result verification; while revisions are pending, prior-version tasks cannot be committed through the CLI. Plan-level progress records follow the same `task.paths` rule; when no task or follow-up commit follows, they stay only in the canonical record, and the cooperative CLI adds no support for them.
173
-
174
- On scope/docs/approval changes inspect `affectedTaskIds`/dependencies, preserve history and supply current approval/contracts. NEVER reuse checks across fingerprints. Link findings to same-version Implementer resolution/Tester rechecks; only plan-final Reviewer findings use Implementer→Reviewer. No task-level Reviewer prerequisite. Detailed fields/holds follow [verification](verification.md#verification-lifecycle-in-the-cooperative-cli); unsupported omission is no policy violation/document obligation.
115
+ Shared text for this section: [handoff-common.md#cooperative-cli-verification-handoff](handoff-common.md#cooperative-cli-verification-handoff). It applies here exactly as if written in place.
175
116
 
176
117
  [ARC role policy: contract begin]
177
118
  Generated from lib/policy/role-policy.json; do not edit this managed section manually.
@@ -186,44 +127,14 @@ Generated from lib/policy/role-policy.json; do not edit this managed section man
186
127
  <a id="initial-implementer-assignment-through-the-cooperative-cli"></a>
187
128
  ## Initial Implementer assignment through the cooperative CLI
188
129
 
189
- 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`.
190
-
191
- 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.
192
-
193
- 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.
194
- 2. At final HEAD `init` with `mode: "plan"`, `actor: {id: "operator"}`, `selection: {messageRef, contentHash}`.
195
- 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.
196
- 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.
197
- 5. Invoke native assignment with saved task/scope/correlation.
198
- 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.
199
-
200
- 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.
130
+ Shared text for this section: [handoff-common.md#initial-implementer-assignment-through-the-cooperative-cli](handoff-common.md#initial-implementer-assignment-through-the-cooperative-cli). It applies here exactly as if written in place.
201
131
 
202
132
  <a id="external-operations-and-recovery-in-the-cooperative-cli"></a>
203
133
  ## External operations and recovery in the cooperative CLI
204
134
 
205
- 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.
206
-
207
- Operator-confirmed approvals/results are `operator-attested`, `nativeVerified: false`, `remoteVerified: false`; no outside-call blocking or independent remote verification.
208
-
209
- 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:
210
-
211
- | operation | descriptor fields |
212
- |---|---|
213
- | push | repository, destination, refspec, sourceOid, expectedRemoteOid |
214
- | merge | repository, changeRef, targetRef, expectedTargetOid |
215
- | deploy | service, project, environment, artifactId, destination |
216
- | publish | service, namespace, name, version, artifactHash, destination |
217
-
218
- 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.
219
-
220
- `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.
221
-
222
- `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.
223
-
224
- 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.
135
+ Shared text for this section: [handoff-common.md#external-operations-and-recovery-in-the-cooperative-cli](handoff-common.md#external-operations-and-recovery-in-the-cooperative-cli). It applies here exactly as if written in place.
225
136
 
226
137
  <a id="composite-bridge-results-and-briefs"></a>
227
138
  ## Composite bridge results and briefs
228
139
 
229
- For a bridge dispatch the result is the child's final message, saved at the `resultPath` returned by `run-dispatch` and `observe`; read it from there and treat it as `operator-attested` text, not as acceptance. The brief sent to `run-dispatch` or `resume` keeps the fixed brief order from [coordination](coordination.md#token-discipline-and-handoffs) and is delivered on stdin only: NEVER put it in argv, environment variables or a positional prompt, and keep it at most 256 KiB. For audit ARC also stores the brief in `<gitCommonDir>/arc/workflows/<workflowId>/dispatches/<dispatchId>/brief.md` (mode 0600); the child still receives it on stdin only. DO NOT include secrets or raw CLI output.
140
+ Shared text for this section: [handoff-common.md#composite-bridge-results-and-briefs](handoff-common.md#composite-bridge-results-and-briefs). It applies here exactly as if written in place.
@@ -1,31 +1,20 @@
1
1
  <a id="subagent-limits"></a>
2
2
  # Subagent limits
3
3
 
4
- Before the first creation, Orchestrator reads this reference and the 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.
4
+ Shared text for this section: [limits-common.md#subagent-limits](limits-common.md#subagent-limits). It applies here exactly as if written in place.
5
5
 
6
6
  <a id="counting-and-reservations"></a>
7
7
  ## Counting and reservations
8
8
 
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. A follow-up or resume using the same instance adds nothing; fresh instances, new-instance retries and replacements increment the total.
11
- - Waiting, blocked, running and resumable idle instances consume concurrency until completion or termination is confirmed. Obey lower actual runtime capacity, including native retention of completed instances. ARC counts do not prove free native slots.
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.
9
+ Shared text for this section: [limits-common.md#counting-and-reservations](limits-common.md#counting-and-reservations). It applies here exactly as if written in place.
19
10
 
20
11
  <a id="continuation-and-exhaustion"></a>
21
12
  ## Continuation and exhaustion
22
13
 
23
- Preserve the ledger across continuation, resume and 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
- Confirmed completion or termination frees active capacity. Exhaustion holds creation and reports remaining work/budget; it never waives Tester/Reviewer, role freshness, approval, ownership, dependency or same-file edit gates.
14
+ Shared text for this section: [limits-common.md#continuation-and-exhaustion](limits-common.md#continuation-and-exhaustion). It applies here exactly as if written in place.
26
15
 
27
16
  Cumulative limits and scheduling are prompt policy, not hard runtime controls. Text tests prove package consistency, not live compliance/native support.
28
- Codex `[agents].max_concurrent_threads_per_session` and Claude `settings.json.env.CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS` constrain their respective sessions.
17
+ Codex `[agents].max_concurrent_threads_per_session` constrains its native session.
29
18
  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.
30
19
 
31
- Composite platform routes observe these limits and each platform's actual capacity. ARC enforces the bridge limits at `prepare-dispatch`: active bridge dispatches (`reserved`, `starting`, `running`, `unknown`) must not exceed `max_concurrent_subagents` of the installed `limits.toml`, and the bridge dispatches created per workflow must not exceed `max_total_subagents`. `resume` rechecks only `max_concurrent_subagents`; it does not increase the cumulative count. Every bridge dispatch also counts as a created instance in the Orchestrator ledger; the native plus bridge total is kept in that ledger (prompt policy). A dispatch in `unknown` keeps its slot until the operator confirms termination; its slot is never released automatically. Role timeouts are fixed: `arc_implementer` 60 minutes, `arc_tester` 60 minutes, others 20 minutes; `limits.toml` format is unchanged. Terminal leases (`completed`, `failed`, `cancelled`) older than 30 days are pruned automatically; non-terminal leases are never pruned.
20
+ Shared text for this section: [limits-common.md#continuation-and-exhaustion-2](limits-common.md#continuation-and-exhaustion-2). It applies here exactly as if written in place.