@rryando/arcs 3.4.0 → 3.4.2

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 (60) hide show
  1. package/README.md +12 -11
  2. package/dist/cli/arcs-orchestrate-caveman.d.ts +1 -1
  3. package/dist/cli/arcs-orchestrate-caveman.d.ts.map +1 -1
  4. package/dist/cli/arcs-orchestrate-caveman.js +4 -5
  5. package/dist/cli/arcs-orchestrate-caveman.js.map +1 -1
  6. package/dist/cli/arcs-orchestrate.d.ts +1 -1
  7. package/dist/cli/arcs-orchestrate.d.ts.map +1 -1
  8. package/dist/cli/arcs-orchestrate.js +91 -101
  9. package/dist/cli/arcs-orchestrate.js.map +1 -1
  10. package/dist/cli/instructions.d.ts.map +1 -1
  11. package/dist/cli/instructions.js +2 -0
  12. package/dist/cli/instructions.js.map +1 -1
  13. package/dist/cli/setup.d.ts +9 -0
  14. package/dist/cli/setup.d.ts.map +1 -1
  15. package/dist/cli/setup.js +138 -0
  16. package/dist/cli/setup.js.map +1 -1
  17. package/dist/utils/rtk.d.ts +7 -0
  18. package/dist/utils/rtk.d.ts.map +1 -0
  19. package/dist/utils/rtk.js +26 -0
  20. package/dist/utils/rtk.js.map +1 -0
  21. package/opencode/arcs/.opencode/plugins/arcs.js +1 -40
  22. package/opencode/arcs/manifest.json +67 -7
  23. package/opencode/arcs/prompts/arcs-docs.txt +34 -33
  24. package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +95 -106
  25. package/opencode/arcs/prompts/arcs-orchestrate.txt +91 -101
  26. package/opencode/arcs/prompts/code-reviewer.txt +27 -20
  27. package/opencode/arcs/prompts/devil-advocate.txt +16 -6
  28. package/opencode/arcs/prompts/docs-researcher.txt +17 -14
  29. package/opencode/arcs/prompts/graph-explorer.txt +17 -14
  30. package/opencode/arcs/prompts/oncall-ops.txt +26 -19
  31. package/opencode/arcs/prompts/qa-analyst.txt +26 -20
  32. package/opencode/arcs/prompts/software-engineer.txt +18 -19
  33. package/opencode/arcs/prompts/system-architect.txt +18 -13
  34. package/opencode/arcs/prompts/tech-architect.txt +18 -13
  35. package/opencode/arcs/skills/code-agent/SKILL.md +2 -2
  36. package/opencode/arcs/skills/deep-pr-review/SKILL.md +7 -7
  37. package/opencode/arcs/skills/deep-pr-review/review-template.md +2 -2
  38. package/opencode/arcs/skills/executing-plans/SKILL.md +12 -8
  39. package/opencode/arcs/skills/init-project/SKILL.md +1 -1
  40. package/opencode/arcs/skills/quick-dev/SKILL.md +3 -3
  41. package/opencode/arcs/skills/requesting-code-review/SKILL.md +11 -7
  42. package/opencode/arcs/skills/requesting-code-review/code-reviewer.md +36 -76
  43. package/opencode/arcs/skills/subagent-driven-development/SKILL.md +30 -11
  44. package/opencode/arcs/skills/subagent-driven-development/code-quality-reviewer-prompt.md +3 -2
  45. package/opencode/arcs/skills/subagent-driven-development/implementer-prompt.md +13 -13
  46. package/opencode/arcs/skills/subagent-driven-development/spec-reviewer-prompt.md +1 -1
  47. package/opencode/arcs/skills/systematic-debugging/SKILL.md +3 -3
  48. package/opencode/arcs/skills/systematic-debugging/root-cause-tracing.md +2 -2
  49. package/opencode/arcs/skills/test-driven-development/SKILL.md +4 -4
  50. package/opencode/arcs/skills/test-driven-development/tdd-rationalizations-and-examples.md +2 -2
  51. package/opencode/arcs/skills/to-diagram/SKILL.md +3 -1
  52. package/opencode/arcs/skills/writing-plans/SKILL.md +3 -1
  53. package/package.json +1 -1
  54. package/scripts/arcs-init.mjs +3 -2
  55. package/scripts/deploy-claudecode-bundle.mjs +42 -15
  56. package/scripts/deploy-opencode-bundle.mjs +5 -1
  57. package/scripts/lib/bundle-helpers.mjs +27 -1
  58. package/scripts/lint-bundle.mjs +0 -1
  59. package/skills/init-project.md +1 -1
  60. package/skills/orchestrate.md +10 -3
@@ -17,7 +17,7 @@ flowchart TD
17
17
  K --> B{Fully bounded?}
18
18
  B -->|Yes| C[Execute change directly]
19
19
  B -->|No| D[Escalate to code-agent or brainstorming]
20
- C --> E[Verify: typecheck + lint + affected tests]
20
+ C --> E[Verify scoped: tsc --noEmit + lint + tests for touched files]
21
21
  E --> F[Done — commit only when asked]
22
22
  ```
23
23
 
@@ -33,13 +33,13 @@ Check for patterns, gotchas, and lessons before implementing. Skip only if the c
33
33
 
34
34
  1. Orient with ARCS context + search if pattern-related
35
35
  2. Execute directly — no planning doc, no brainstorming, no TDD ritual
36
- 3. Run focused verification (not full suite unless pervasive)
36
+ 3. Scoped verification only — run the dispatch VERIFY command (tests + lint for files you touched). NEVER the full suite. Pervasive change (shared types, config, build) or failures in out-of-scope files → report under BLOCKED_BY, never fix; full-project verification belongs to the devil-advocate completion gate.
37
37
 
38
38
  ## Escalation
39
39
 
40
40
  If hidden complexity surfaces mid-task — **pause immediately**, state the issue, offer to switch to `code-agent` or `brainstorming`. Do not silently expand scope.
41
41
 
42
- If self-confidence drops below 80% per `confidence-gate` (open decision, unverified assumption, sibling pattern unclear), escalate to `code-agent` — `quick-dev` does not permit exploration loops; `code-agent` does.
42
+ If self-confidence drops below 80% (open decision, unverified assumption, sibling pattern unclear), escalate to `code-agent` — `quick-dev` does not permit exploration loops; `code-agent` does.
43
43
 
44
44
  ## NOT for
45
45
 
@@ -18,9 +18,9 @@ flowchart TD
18
18
  C --> D[Fill code-reviewer.md template]
19
19
  D --> E[Dispatch arcs:code-reviewer subagent]
20
20
  E --> F{Review results}
21
- F -->|Critical| G[Fix immediately]
22
- F -->|Important| H[Fix before proceeding]
23
- F -->|Minor| I[Note for later]
21
+ F -->|CRITICAL| G[Fix immediately]
22
+ F -->|HIGH| H[Fix before proceeding]
23
+ F -->|MEDIUM/LOW| I[Note for later]
24
24
  G --> E
25
25
  H --> E
26
26
  ```
@@ -30,18 +30,22 @@ flowchart TD
30
30
  - `{WHAT_WAS_IMPLEMENTED}` — what you built
31
31
  - `{PLAN_OR_REQUIREMENTS}` — what it should do
32
32
  - `{BASE_SHA}` / `{HEAD_SHA}` — commit range
33
- - `{PROJECT_CONVENTIONS}` — CLAUDE.md / linter configs / style guides
33
+ - `{PROJECT_CONVENTIONS}` — CLAUDE.md / linter configs / style guides (gather once per session, reuse across dispatches)
34
34
 
35
35
  ## When to Request
36
36
 
37
- **Mandatory:** after each subagent task, after major features, before merge to main.
37
+ **Mandatory:** after major features, before merge to main.
38
+ **Already scheduled:** when `subagent-driven-development` drives the loop, its pipeline dispatches this review as stage 2 (code-quality-reviewer applies this template's checklist but returns the SDD JSON envelope) — do not schedule it twice for the same task.
38
39
  **Optional:** when stuck, before refactoring, after complex bugfix.
39
40
 
40
41
  ## Red Flags
41
42
 
42
43
  - Never skip because "it's simple"
43
- - Never ignore Critical issues
44
- - Never proceed with unfixed Important issues
44
+ - Never ignore CRITICAL findings
45
+ - Never proceed with unfixed HIGH findings
45
46
  - Always include project conventions in reviewer context
47
+ - CRITICAL/HIGH fixes route to the owning implementer — never fix files outside your own scope
46
48
 
47
49
  See template at: `requesting-code-review/code-reviewer.md`
50
+
51
+ Reviewer returns the unified envelope: STATUS → VERDICT (approve | request-changes | comment-only) → FINDINGS by severity (CRITICAL/HIGH/MEDIUM/LOW) with 📍 file:line anchors.
@@ -1,14 +1,14 @@
1
1
  # Code Review Agent
2
2
 
3
- You are reviewing code changes for production readiness. Write your findings like a thoughtful teammate, not a linter.
3
+ You are reviewing code changes for production readiness. Your output is consumed by the orchestrator (an LLM) — structured, terse, evidence-backed findings.
4
4
 
5
5
  **Your task:**
6
6
  1. Read the project conventions below **before judging anything**
7
7
  2. Review {WHAT_WAS_IMPLEMENTED}
8
8
  3. Compare against {PLAN_OR_REQUIREMENTS}
9
9
  4. Check code quality, architecture, testing
10
- 5. Categorize issues by severity with inline diff anchors
11
- 6. Assess production readiness
10
+ 5. Categorize findings by severity with 📍 file:line anchors
11
+ 6. Deliver VERDICT: approve | request-changes | comment-only
12
12
 
13
13
  ## Project Conventions
14
14
 
@@ -57,7 +57,7 @@ git diff {BASE_SHA}..{HEAD_SHA}
57
57
  - Tests actually test logic (not mocks)?
58
58
  - Edge cases covered?
59
59
  - Integration tests where needed?
60
- - All tests passing?
60
+ - Scoped verification passing — the dispatch VERIFY command only? Do NOT run the full suite — the completion gate owns it.
61
61
 
62
62
  **Requirements:**
63
63
  - All plan requirements met?
@@ -73,107 +73,67 @@ git diff {BASE_SHA}..{HEAD_SHA}
73
73
 
74
74
  ## Output Format
75
75
 
76
- ### Strengths
77
- [What's well done? Be specific. Sound like a colleague giving genuine praise, not a form response.]
76
+ No prose narrative. No "Overall this looks..." — open with the Standard Return Envelope, then VERDICT, then FINDINGS grouped by severity.
78
77
 
79
- ### Issues
78
+ When dispatched via subagent-driven-development, return its JSON envelope instead (see code-quality-reviewer-prompt.md).
80
79
 
81
- All issues must include a **file:line anchor** pointing to the specific diff line. Write in a collegial tone — direct but not harsh.
82
-
83
- #### Critical (Must Fix)
84
- [Bugs, security issues, data loss risks, broken functionality]
85
-
86
- #### Important (Should Fix)
87
- [Architecture problems, missing features, poor error handling, test gaps]
80
+ ```
81
+ STATUS: done | blocked | partial
88
82
 
89
- #### Minor (Nice to Have)
90
- [Code style, optimization opportunities, documentation improvements]
83
+ FILES_TOUCHED: none (review-only you never edit)
91
84
 
92
- **For each issue:**
93
- ```
94
- 📍 path/to/file.ts:42
95
- Change: [what changed — show old → new if helpful]
96
- Finding: [what looks off]
97
- Why it matters: [practical impact]
98
- Suggested direction: [concrete fix or question]
99
- ```
85
+ VERIFY: <scoped VERIFY command from dispatch> → pass|fail (omit when the dispatch provides none)
100
86
 
101
- **Tone guide:**
102
- - "Heads up — this can throw if X is null (line 42), since you removed the guard"
103
- - "Worth double-checking: the fallback here (line 88) looks unreachable given the condition above"
104
- - "Minor nit: this magic number (line 130) could be a named constant for readability"
87
+ BLOCKED_BY: <only when blocked/partial — what prevented a complete review>
105
88
 
106
- Not:
107
- - "VIOLATION: null check missing"
108
- - "This is wrong"
89
+ VERDICT: approve | request-changes | comment-only
109
90
 
110
- ### Recommendations
111
- [Improvements for code quality, architecture, or process written as suggestions, not mandates]
91
+ FINDINGS:
92
+ - [CRITICAL] 📍 <file:line> <issue> <why it matters> <suggested fix>
93
+ - [HIGH] 📍 <file:line> — <issue> — <why it matters> — <suggested fix>
94
+ - [MEDIUM] 📍 <file:line> — <issue> — <suggested fix>
95
+ - [LOW] 📍 <file:line> — <issue>
112
96
 
113
- ### Assessment
97
+ TASKS: <none | suggested follow-up tasks for orchestrator>
114
98
 
115
- **Ready to merge?** [Yes/No/With fixes]
99
+ YAGNI: <none | speculative code identified with file:line>
100
+ ```
116
101
 
117
- **Reasoning:** [Technical assessment in 1-2 sentences]
102
+ Every finding carries a **📍 file:line anchor** pointing to the specific diff line. Severity guide: CRITICAL (bugs, security, data loss, broken functionality) → HIGH (architecture problems, missing features, poor error handling, test gaps) → MEDIUM (convention deviations) → LOW (style, optimization opportunities, documentation).
118
103
 
119
104
  ## Critical Rules
120
105
 
121
106
  **DO:**
122
107
  - Read project conventions before evaluating style or patterns
123
- - Categorize by actual severity (not everything is Critical)
124
- - Be specific with file:line anchors
108
+ - Categorize by actual severity (not everything is CRITICAL)
109
+ - Be specific with 📍 file:line anchors
125
110
  - Explain WHY issues matter
126
- - Acknowledge strengths
127
- - Give clear verdict
128
- - Sound like a teammate, not a linter
111
+ - Give a clear VERDICT
129
112
 
130
113
  **DON'T:**
131
114
  - Flag something as wrong if it matches the project's own conventions
132
115
  - Say "looks good" without checking
133
- - Mark nitpicks as Critical
116
+ - Mark nitpicks as CRITICAL
134
117
  - Give feedback on code you didn't review
135
118
  - Be vague ("improve error handling")
136
- - Avoid giving a clear verdict
137
- - Use harsh or robotic phrasing
119
+ - Omit the VERDICT
120
+ - Wrap the envelope in prose narrative
138
121
 
139
122
  ## Example Output
140
123
 
141
124
  ```
142
- ### Strengths
143
- - Clean database schema with proper migrations (db.ts:15-42) — easy to follow
144
- - Comprehensive test coverage (18 tests, all edge cases hit)
145
- - Good error handling with fallbacks (summarizer.ts:85-92)
146
-
147
- ### Issues
148
-
149
- #### Important
150
-
151
- 1. 📍 index-conversations:1-31
152
- Change: Added CLI wrapper without help flag
153
- Finding: No --help flag; users won't discover --concurrency
154
- Why it matters: Discoverability — first-time users will hit a wall
155
- Suggested direction: Add `--help` case with a short usage example
156
-
157
- 2. 📍 search.ts:25-27
158
- Change: Added date filtering without validation
159
- Finding: Invalid dates silently return no results instead of erroring
160
- Why it matters: Silent failures are hard to debug
161
- Suggested direction: Validate ISO format and throw with an example date
162
-
163
- #### Minor
125
+ STATUS: done
164
126
 
165
- 1. 📍 indexer.ts:130
166
- Change: Added batch loop with no progress output
167
- Finding: Long operations give no feedback
168
- Suggested direction: A simple "X of Y" counter would help
127
+ FILES_TOUCHED: none
169
128
 
170
- ### Recommendations
171
- - Consider a config file for excluded projects — hardcoded list will grow
172
- - Progress reporting would meaningfully improve UX for large repos
129
+ VERDICT: request-changes
173
130
 
174
- ### Assessment
131
+ FINDINGS:
132
+ - [HIGH] 📍 index-conversations:1-31 — no --help flag; users won't discover --concurrency — first-time users hit a discoverability wall — add a `--help` case with a short usage example
133
+ - [HIGH] 📍 search.ts:25-27 — invalid dates silently return no results instead of erroring — silent failures are hard to debug — validate ISO format and throw with an example date
134
+ - [LOW] 📍 indexer.ts:130 — batch loop gives no progress feedback on long runs — a simple "X of Y" counter would help
175
135
 
176
- **Ready to merge: With fixes**
136
+ TASKS: config file for excluded projects — hardcoded list will grow
177
137
 
178
- **Reasoning:** Core implementation is solid with good architecture and tests. The Important issues (help text, date validation) are quick fixes and don't affect core functionality.
138
+ YAGNI: none
179
139
  ```
@@ -44,10 +44,15 @@ flowchart TD
44
44
  R -->|yes| T[Mark task done]
45
45
  T --> U{More tasks?}
46
46
  U -->|yes| B
47
- U -->|no| V[Dispatch final cross-task reviewer]
48
- V --> W[Load skill: finishing-a-development-branch]
47
+ U -->|no| V[Dispatch devil-advocate PHASE: completion — the single full-project pass]
48
+ V -->|PASS| W[Report completion]
49
+ V -->|BLOCK| X[Re-dispatch scoped fixes per FAILURES] --> V
49
50
  ```
50
51
 
52
+ **Gate cap:** two consecutive completion BLOCKs → stop and escalate to human; never loop the V→X cycle a third time.
53
+
54
+ **Under the ARCS orchestrator:** the orchestrator's devil-advocate PHASE: execute gate replaces the code-quality reviewer step (the gate runs the scoped VERIFY and the drift check); spec review remains. Running standalone, keep both reviewer stages as drawn.
55
+
51
56
  ## Retry & Escalation
52
57
 
53
58
  ```mermaid
@@ -84,8 +89,9 @@ Every implementer subagent prompt MUST include:
84
89
  | **Context** | Where this task fits in the plan; what came before |
85
90
  | **Scope** | File boundaries — what to touch, what NOT to touch |
86
91
  | **Acceptance** | Done criteria copied verbatim from plan/diagram |
87
- | **Verify** | Exact command to run before claiming done |
92
+ | **Verify** | Exact command to run before claiming done — scoped to the task's files, never the full suite |
88
93
  | **Skill** | Which work-mode skill to load (from diagram metadata or inferred) |
94
+ | **Return** | Structured Return envelope (below) — brief prose findings first, JSON block last |
89
95
 
90
96
  Do NOT make the subagent read the plan file. Provide full text in the prompt.
91
97
 
@@ -102,15 +108,25 @@ Do NOT make the subagent read the plan file. Provide full text in the prompt.
102
108
  - `./implementer-prompt.md`
103
109
  - `./spec-reviewer-prompt.md`
104
110
  - `./code-quality-reviewer-prompt.md`
105
- - `./return-schema.md` — structured output format (inject into every dispatch)
106
111
 
107
112
  ## Structured Return
108
113
 
109
- All sub-agents MUST return a JSON block as the final thing in their message, per `./return-schema.md`.
110
- Orchestrator parses `status` for routing, `payload` for action. Free-form prose above is fine.
114
+ All sub-agents MUST return a JSON block as the LAST thing in their message — brief prose findings first, JSON block last, nothing after it:
115
+
116
+ ```json
117
+ {
118
+ "status": "DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT",
119
+ "summary": "<1-2 sentences>",
120
+ "payload": { "<role-specific fields per prompt template>": "..." }
121
+ }
122
+ ```
123
+
124
+ Role payloads: implementer → `filesChanged`/`filesCreated`/`verification{command,result,scopeReason}`/`concerns`/`scopeChanges`; spec reviewer → `compliant`/`issues`; quality reviewer → `approved`/`issues`.
125
+ Orchestrator parses `status` for routing, `payload` for action.
126
+ Mapping to the orchestrator's Standard Return Envelope: DONE→done, DONE_WITH_CONCERNS→done + concerns surfaced, BLOCKED→blocked, NEEDS_CONTEXT→blocked.
111
127
 
112
128
  Include in every dispatch prompt:
113
- > "Return format: JSON envelope with status + typed payload. See return-schema.md for your role's schema."
129
+ > "Return format: brief prose findings first, then the JSON envelope (status + typed payload) from your role's prompt template as the LAST thing in your message — nothing after it."
114
130
 
115
131
  ## Git State Discipline
116
132
 
@@ -129,10 +145,13 @@ Sub-agents lint and test **only files they touched**:
129
145
  |-------|---------|----------|
130
146
  | Lint | `biome check src/changed.ts` | `biome check .` |
131
147
  | Test | `vitest run test/changed.test.ts` | `vitest run` / `npm test` |
132
- | Type check | `tsc --noEmit` (whole-project exception) | |
148
+ | Type check | `tsc --noEmit` — read-only signal; out-of-scope errors are report-only | fixing type errors outside your scope |
133
149
 
134
- Full suite justified ONLY when change is pervasive (shared types, config, build).
135
- Sub-agent must state `scopeReason` in return payload.
150
+ Sub-agents NEVER run the full suite not even for pervasive changes. If a change is pervasive
151
+ (shared types, config, build), record it in `scopeChanges`/`concerns`; the orchestrator defers
152
+ full-project verification to the devil-advocate completion gate. Type errors or test failures in
153
+ files outside your scope are report-only — never fix them; the authoritative project-wide tsc run
154
+ belongs to that gate. Sub-agent must state `scopeReason` in return payload.
136
155
 
137
156
  ## Parallelism Rules
138
157
 
@@ -140,7 +159,7 @@ Parallel implementers are allowed when tasks touch **zero shared files**.
140
159
 
141
160
  1. **Independence check:** Orchestrator verifies no file overlap before dispatch. If overlap → serialize.
142
161
  2. **Batch limit:** Maximum 4 concurrent subagents per round. Queue remaining.
143
- 3. **Prompt construction:** Each subagent gets: Scope, Goal, Context, Constraints, Output format — all required.
162
+ 3. **Prompt construction:** Per the Sub-Agent Prompt Construction table above — all rows required.
144
163
  4. **Conflict detection:** After fan-out completes, check for conflicting edits before committing.
145
164
  5. **Shared context:** Fetch once (e.g., project brief), inject into all subagent prompts — don't make each agent re-fetch.
146
165
 
@@ -8,7 +8,8 @@ Use this template when dispatching a code quality reviewer subagent.
8
8
 
9
9
  ```
10
10
  Task tool (arcs:code-reviewer):
11
- Use template at requesting-code-review/code-reviewer.md
11
+ Apply the review dimensions/checklist from requesting-code-review/code-reviewer.md.
12
+ Output format: the JSON envelope defined below — NOT the template's envelope+VERDICT format.
12
13
 
13
14
  WHAT_WAS_IMPLEMENTED: [from implementer's report]
14
15
  PLAN_OR_REQUIREMENTS: Task N from [plan-file]
@@ -25,7 +26,7 @@ Task tool (arcs:code-reviewer):
25
26
 
26
27
  ## Report Format (MANDATORY)
27
28
 
28
- Return prose explanation followed by this EXACT JSON block as the LAST thing in your message:
29
+ Return brief prose findings FIRST, then this EXACT JSON block as the LAST thing in your message — nothing after it:
29
30
 
30
31
  ```json
31
32
  {
@@ -18,13 +18,9 @@ Task tool (general-purpose):
18
18
 
19
19
  ## Before You Begin
20
20
 
21
- If you have questions about:
22
- - The requirements or acceptance criteria
23
- - The approach or implementation strategy
24
- - Dependencies or assumptions
25
- - Anything unclear in the task description
26
-
27
- **Ask them now.** Raise any concerns before starting work.
21
+ If the requirements, acceptance criteria, approach, dependencies, or anything in the
22
+ task description is unclear or insufficient: do NO work — immediately return status
23
+ NEEDS_CONTEXT listing the specific questions.
28
24
 
29
25
  ## Your Job
30
26
 
@@ -38,8 +34,8 @@ Task tool (general-purpose):
38
34
 
39
35
  Work from: [directory]
40
36
 
41
- **While you work:** If you encounter something unexpected or unclear, **ask questions**.
42
- It's always OK to pause and clarify. Don't guess or make assumptions.
37
+ **While you work:** If you encounter something unexpected or unclear, don't guess or
38
+ make assumptions stop and return BLOCKED or NEEDS_CONTEXT with the specific question.
43
39
 
44
40
  ## Git Rules
45
41
 
@@ -55,10 +51,14 @@ Task tool (general-purpose):
55
51
  Lint and test ONLY the files you touched:
56
52
  - Lint: `biome check src/your-file.ts` (NOT `biome check .`)
57
53
  - Test: `vitest run test/your-file.test.ts` (NOT `vitest run` or `npm test`)
58
- - Type check: `tsc --noEmit` (this one is whole-projectexception)
54
+ - Type check: `tsc --noEmit` is allowed as a read-only signal if it reports errors
55
+ in files OUTSIDE your scope, do NOT fix them; record them under `concerns` and
56
+ proceed. The authoritative project-wide tsc run belongs to the devil-advocate gate.
59
57
 
60
- Full suite only when your change is pervasive (shared types, config, build).
61
- You MUST state why your verification scope is sufficient in your report.
58
+ NEVER run the full suite not even for pervasive changes. If your change is pervasive
59
+ (shared types, config, build), record it in `scopeChanges`. Failures you observe in
60
+ files outside your scope are report-only — leave them untouched.
61
+ You MUST state why your verification scope is sufficient in your report (`scopeReason`).
62
62
 
63
63
  ## Code Organization
64
64
 
@@ -118,7 +118,7 @@ Task tool (general-purpose):
118
118
 
119
119
  ## Report Format (MANDATORY)
120
120
 
121
- When done, return prose explanation followed by this EXACT JSON block as the LAST thing in your message:
121
+ When done, return brief prose findings FIRST, then this EXACT JSON block as the LAST thing in your message — nothing after it:
122
122
 
123
123
  ```json
124
124
  {
@@ -57,7 +57,7 @@ Task tool (general-purpose):
57
57
 
58
58
  ## Report Format (MANDATORY)
59
59
 
60
- Return prose explanation followed by this EXACT JSON block as the LAST thing in your message:
60
+ Return brief prose findings FIRST, then this EXACT JSON block as the LAST thing in your message — nothing after it:
61
61
 
62
62
  ```json
63
63
  {
@@ -43,7 +43,7 @@ flowchart TD
43
43
 
44
44
  Fix --> WriteFail[Write failing test]
45
45
  WriteFail --> Implement[Single targeted fix]
46
- Implement --> Green{Tests pass?}
46
+ Implement --> Green{Scoped tests pass?}
47
47
  Green -->|Yes| Capture[Capture as ARCS knowledge]
48
48
  Green -->|No| FailCount
49
49
 
@@ -78,8 +78,8 @@ flowchart TD
78
78
 
79
79
  - Write a failing test FIRST (proves the bug exists)
80
80
  - Implement a single targeted fix
81
- - Verify all tests pass
82
- - If fix introduces new failures, revert and return to Phase 2
81
+ - Verify the scoped tests for the files you changed pass (your dispatch VERIFY command — never the full suite; the devil-advocate completion gate owns that)
82
+ - If your fix introduces new failures in YOUR scoped tests, revert and return to Phase 2. Failures in files outside your scope are report-only (BLOCKED_BY) — likely a sibling agent's in-flight work; never fix or revert it
83
83
 
84
84
  ## Log Triage Protocol
85
85
 
@@ -84,9 +84,9 @@ async function gitInit(directory: string) {
84
84
 
85
85
  **Critical:** Use `console.error()` in tests (not logger - may not show)
86
86
 
87
- **Run and capture:**
87
+ **Run and capture (scoped to the suspect test file — never the full suite):**
88
88
  ```bash
89
- npm test 2>&1 | grep 'DEBUG git init'
89
+ npm test -- path/to/suspect.test.ts 2>&1 | grep 'DEBUG git init'
90
90
  ```
91
91
 
92
92
  **Analyze stack traces:**
@@ -21,11 +21,11 @@ flowchart TD
21
21
  B -->|Passes immediately| D[Test is wrong — fix or delete]
22
22
  D --> A
23
23
  C --> E{Run test}
24
- E -->|All pass| F[Refactor — keep green]
24
+ E -->|Your tests pass| F[Refactor — keep green]
25
25
  E -->|Fails| C
26
26
  F --> G{More behavior needed?}
27
27
  G -->|Yes| A
28
- G -->|No| H[Done — verify all green]
28
+ G -->|No| H[Done — your test files green, scoped VERIFY passes]
29
29
  ```
30
30
 
31
31
  ## Iron Law
@@ -35,12 +35,12 @@ Code written before a test? **Delete it.** No "reference", no "adapting". Start
35
35
  ## RED — Write Failing Test
36
36
 
37
37
  - One behavior per test, clear name, real code (no mocks unless unavoidable)
38
- - Run: `npm test path/to/test.test.ts` — confirm fails for the right reason
38
+ - Run: `npm test -- path/to/test.test.ts` — confirm fails for the right reason
39
39
 
40
40
  ## GREEN — Minimal Code
41
41
 
42
42
  - Simplest code to pass. Nothing beyond what the test requires.
43
- - Run: confirm all tests pass, output pristine
43
+ - Run: re-run YOUR test file(s) (`npm test -- path/to/test.test.ts`) — confirm they pass, output pristine. Never the unscoped suite; the devil-advocate completion gate owns full-project verification.
44
44
 
45
45
  ## REFACTOR — Clean Up
46
46
 
@@ -66,7 +66,7 @@ test('rejects empty email', async () => {
66
66
 
67
67
  ### Verify RED
68
68
  ```bash
69
- $ npm test
69
+ $ npm test -- submitForm.test.ts
70
70
  FAIL: expected 'Email required', got undefined
71
71
  ```
72
72
 
@@ -82,7 +82,7 @@ function submitForm(data: FormData) {
82
82
 
83
83
  ### Verify GREEN
84
84
  ```bash
85
- $ npm test
85
+ $ npm test -- submitForm.test.ts
86
86
  PASS
87
87
  ```
88
88
 
@@ -142,6 +142,8 @@ Between plan-level header and `flowchart TD` declaration:
142
142
 
143
143
  **Required:** node, title, status, skill, scope, acceptance. **Optional:** files, verify, blocked-by, delegate.
144
144
 
145
+ `verify` must name a command scoped to the node's files (e.g. `npm test -- --testPathPattern=orders`, `vitest run test/orders.test.ts`) — never the bare full suite (`npm test`, `vitest run`). The devil-advocate completion gate owns the single full-project pass.
146
+
145
147
  ## Plan-Level Header Comments
146
148
 
147
149
  ```
@@ -182,7 +184,7 @@ Plans with 15+ nodes: cluster into `subgraph` blocks by phase. If unreadable, sp
182
184
  - **Ownership:** Only orchestrator/coordinator writes .mmd files. Sub-agents read only and report status back
183
185
  - **Presentation:** Internal skill — never narrate conventions to user. Show rendered diagram or URL only
184
186
  - **Determinism:** Same metadata must produce byte-identical .mmd output (nodes ordered by ID, edges by source→target, fields in fixed order)
185
- - **Confidence gate:** Self-score ≥80% via confidence-gate skill before writing .mmd files
187
+ - **Confidence gate:** Self-score ≥80% before writing .mmd files
186
188
  - **Validation before write:** unique IDs, valid edges, all 4 classDef present, valid :::class suffixes
187
189
  - **Backward compat:** Plans without .mmd remain valid; diagrams without rich metadata upgraded during SYNC
188
190
 
@@ -138,6 +138,8 @@ Diagrams are **agentic execution maps** in separate `.mmd` files — never embed
138
138
 
139
139
  All nodes start `:::backlog` but metadata must be fully populated at creation time for diagram-first execution.
140
140
 
141
+ Per-node `verify` commands MUST be scoped to that task's files (e.g. `npm test -- tests/exact/path/test.py`, `vitest run test/orders.test.ts`) — never the bare full suite (`npm test`, `vitest run`, `biome check .`). The devil-advocate completion gate owns the single full-project pass.
142
+
141
143
  ## Plan Review Loop
142
144
 
143
145
  ```mermaid
@@ -153,7 +155,7 @@ flowchart TD
153
155
 
154
156
  - Chunk boundaries: `## Chunk N: <name>`, ≤1000 lines each
155
157
  - Same agent fixes (preserves context). Max 5 iterations, then surface to human.
156
- - Reviewer must announce confidence score per `confidence-gate`. Score <80% loops back to "Fix chunk" — never proceed past a sub-threshold review.
158
+ - Reviewer must announce a confidence score (0-100). Score <80% loops back to "Fix chunk" — never proceed past a sub-threshold review.
157
159
 
158
160
  ## Storage
159
161
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rryando/arcs",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "ARCS — DAG-based task orchestration for AI agents. Persistent workflow continuity via graph-structured context.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -76,6 +76,7 @@ if (!isCommandAvailable("gh")) {
76
76
 
77
77
  if (!isCommandAvailable("rtk")) {
78
78
  console.warn(`WARNING: rtk not found.`);
79
- console.warn(` RTK improves AI command usage tracking: https://github.com/rtk-ai/rtk`);
80
- console.warn(` Install: rtk init -g (or rtk init -g --opencode for OpenCode)`);
79
+ console.warn(` RTK cuts agent token usage on shell commands: https://github.com/rtk-ai/rtk`);
80
+ console.warn(` Install: brew install rtk`);
81
+ console.warn(` Then wire it up: rtk init -g (add --opencode to also wire OpenCode)`);
81
82
  }