@yunhozz/arc 0.4.6 → 0.5.0

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 (93) hide show
  1. package/MANIFEST.sha256 +89 -76
  2. package/README.md +35 -51
  3. package/claude/agents/arc-implementer.md +2 -2
  4. package/claude/agents/arc-planner.md +1 -1
  5. package/claude/agents/arc-qa.md +1 -1
  6. package/claude/agents/arc-reviewer.md +1 -1
  7. package/claude/agents/arc-scouter.md +1 -1
  8. package/claude/skill/models.toml +7 -7
  9. package/claude/skill/references/coordination.md +6 -2
  10. package/claude/skill/references/handoff-prep.md +5 -0
  11. package/claude/skill/references/handoff.md +2 -2
  12. package/claude/skill/references/planning.md +2 -2
  13. package/claude/skill/references/verification.md +21 -3
  14. package/claude/skill/references/worktree-creation.md +2 -2
  15. package/codex/agents/arc-implementer.toml +1 -1
  16. package/codex/agents/arc-planner.toml +1 -1
  17. package/codex/agents/arc-qa.toml +1 -1
  18. package/codex/agents/arc-reviewer.toml +1 -1
  19. package/codex/agents/arc-scouter.toml +1 -1
  20. package/codex/skill/models.toml +5 -5
  21. package/codex/skill/references/coordination.md +6 -2
  22. package/codex/skill/references/handoff-prep.md +5 -0
  23. package/codex/skill/references/handoff.md +2 -2
  24. package/codex/skill/references/planning.md +2 -2
  25. package/codex/skill/references/verification.md +20 -2
  26. package/gemini/agents/arc-implementer.md +3 -3
  27. package/gemini/agents/arc-planner.md +2 -2
  28. package/gemini/agents/arc-qa.md +2 -2
  29. package/gemini/agents/arc-reviewer.md +2 -2
  30. package/gemini/agents/arc-scouter.md +2 -2
  31. package/gemini/skill/models.toml +6 -6
  32. package/gemini/skill/references/coordination.md +7 -3
  33. package/gemini/skill/references/handoff-prep.md +5 -0
  34. package/gemini/skill/references/handoff.md +2 -2
  35. package/gemini/skill/references/planning.md +2 -2
  36. package/gemini/skill/references/verification.md +21 -3
  37. package/gemini/skill/references/worktree-creation.md +2 -2
  38. package/grok/agents/arc-implementer.md +2 -2
  39. package/grok/agents/arc-planner.md +1 -1
  40. package/grok/agents/arc-qa.md +1 -1
  41. package/grok/agents/arc-reviewer.md +1 -1
  42. package/grok/agents/arc-scouter.md +1 -1
  43. package/grok/skill/references/coordination.md +6 -2
  44. package/grok/skill/references/handoff-prep.md +5 -0
  45. package/grok/skill/references/handoff.md +2 -2
  46. package/grok/skill/references/planning.md +2 -2
  47. package/grok/skill/references/verification.md +21 -3
  48. package/grok/skill/references/worktree-creation.md +2 -2
  49. package/lib/cli/postinstall.mjs +1 -1
  50. package/lib/cli/root.mjs +1 -1
  51. package/lib/installer/runtime-assets.mjs +5 -1
  52. package/lib/management/reapply.mjs +117 -0
  53. package/lib/management/update.mjs +59 -5
  54. package/lib/models/catalog-gemini.mjs +4 -1
  55. package/lib/models/gemini-models.json +4 -0
  56. package/lib/npm/upgrade.mjs +6 -2
  57. package/lib/policy/role-policy.json +1 -1
  58. package/lib/prompts/agent-fragments.json +5 -5
  59. package/lib/runtime/final-verify.mjs +2158 -0
  60. package/lib/runtime/node-test-reporter.mjs +81 -0
  61. package/lib/runtime/platform-registry.mjs +1 -1
  62. package/lib/runtime/role-bridge.mjs +10 -1
  63. package/lib/runtime/role-dispatch-policy.mjs +4 -0
  64. package/lib/runtime/role-observe.mjs +192 -14
  65. package/lib/runtime/role-supervisor.mjs +268 -23
  66. package/lib/runtime/test-results.mjs +736 -0
  67. package/lib/runtime/verify-cli.mjs +60 -0
  68. package/lib/tui/app.mjs +7 -41
  69. package/lib/tui/interface.mjs +40 -0
  70. package/lib/tui/render.mjs +1 -1
  71. package/lib/tui/setup.mjs +27 -16
  72. package/lib/watch/args.mjs +12 -27
  73. package/lib/watch/dispatch.mjs +2 -2
  74. package/lib/watch/index.mjs +38 -26
  75. package/lib/watch/markdown.mjs +232 -0
  76. package/lib/watch/menu.mjs +54 -0
  77. package/lib/watch/model.mjs +7 -3
  78. package/lib/watch/render.mjs +28 -67
  79. package/lib/watch/scope.mjs +1 -5
  80. package/lib/watch/status-line.mjs +2 -4
  81. package/lib/watch/text-width.mjs +43 -0
  82. package/lib/watch/watcher.mjs +17 -36
  83. package/package.json +1 -1
  84. package/shared/skill/runtime/final-verify.mjs +2158 -0
  85. package/shared/skill/runtime/node-test-reporter.mjs +81 -0
  86. package/shared/skill/runtime/platform-registry.mjs +1 -1
  87. package/shared/skill/runtime/role-bridge.mjs +10 -1
  88. package/shared/skill/runtime/role-dispatch-policy.mjs +4 -0
  89. package/shared/skill/runtime/role-observe.mjs +192 -14
  90. package/shared/skill/runtime/role-policy.json +1 -1
  91. package/shared/skill/runtime/role-supervisor.mjs +268 -23
  92. package/shared/skill/runtime/test-results.mjs +736 -0
  93. package/shared/skill/runtime/verify-cli.mjs +60 -0
@@ -1,7 +1,7 @@
1
1
  <a id="verification-and-acceptance"></a>
2
2
  # Verification and acceptance
3
3
 
4
- Behavior work follows meaningful failing test observation → minimal implementation → focused success → project suite. Report skill/test constraints before edits. Waivers need recorded narrow/understood/reversible scope, no dependent/cross-component lifecycle stages and one check path. Docs exceptions permit named structural checks only, never TDD claims. Report side effects within scope. Reviewer lacks Bash and requests runtime checks. Local tests prove neither remote models nor effort application. Policy prose needs independent role/approval review; text presence proves no compliance. Unexpected failure triggers diagnosis/holds; expected RED grants no unrelated repairs.
4
+ Behavior work follows meaningful failing test observation → minimal implementation → focused success → scoped checks under [Test scope and result comparison](#test-scope-and-result-comparison). Report skill/test constraints before edits. Waivers need recorded narrow/understood/reversible scope, no dependent/cross-component lifecycle stages and one check path. Docs exceptions permit named structural checks only, never TDD claims. Report side effects within scope. Reviewer lacks Bash and requests runtime checks. Local tests prove neither remote models nor effort application. Policy prose needs independent role/approval review; text presence proves no compliance. Unexpected failure triggers diagnosis/holds; expected RED grants no unrelated repairs.
5
5
 
6
6
  Read before verification design, QA/Reviewer assignment, correction rechecks or UI acceptance. QA/Reviewer use their profiles and brief-cited sections only. Design companions differ from UI acceptance.
7
7
 
@@ -14,6 +14,24 @@ Each criterion needs the exact approved source, version, approval and access sta
14
14
 
15
15
  Policy, generated-file and manifest checks prove structure, not role behavior, installed builds, Grok CLI compliance or fidelity. Report changes, exclusions, checks run and omitted, criterion evidence and limits, and platform availability. Report baseline failures separately; independent progress does not relax checks.
16
16
 
17
+ <a id="test-scope-and-result-comparison"></a>
18
+ ## Test scope and result comparison
19
+
20
+ **Task checks and rechecks** run only tests related to the change: test files that directly exercise a changed module, contract tests that the change requires updating, and the matching check scripts. The brief lists the minimum set; executors MAY add only items in these three categories, each with a reason. Other additions need Orchestrator authorization. Report every selected item and why. This rule takes precedence over the upstream TDD per-task project-suite instruction; upstream text is unchanged. Report every failure observed in any run by name.
21
+
22
+ **Final verification** runs once after all tasks are accepted: the union of all tasks' related tests, plus all contract tests and all check scripts. Orchestrator runs it directly, not through QA, as a background process where the host supports one, and continues independent work such as assigning the final Reviewer meanwhile. Run it in a clean detached worktree of the verified HEAD commit, prepared with the same prerequisites as the baseline, for example through the runtime [final verification commands](#final-verification-runtime-commands); uncommitted changes MAY be captured as a snapshot commit without changing refs, the index or working files, reporting included and excluded paths. Orchestrator then performs the result comparison below and records the verdict. A new failure from final verification follows Implementer → QA even after the final Reviewer has started; Reviewer evidence for affected files becomes stale and needs a refreshed-diff recheck.
23
+
24
+ **Full regression** runs once within final verification only if at least one trigger applies: (1) the change modifies a shared module; (2) changes made by others were integrated after the approved base, by merge, rebase onto a newer base or cherry-pick; (3) the change modifies dependency manifests or lockfiles, language or runtime versions, or build or test configuration; (4) the change removes, renames or changes the signature of a public interface such as an exported function, CLI option or configuration key. A shared module is code, configuration, schema, data or generator input that more than one task, role, component or execution or delivery path imports, loads or renders at run time, including its mirrors and generated outputs; documentation read only by people and modules used by a single component are not shared. Decide from actual consumers; when they cannot be determined, treat the module as shared. Planner records a provisional judgment in the plan; Orchestrator decides from the actual final diff and history. If no trigger applies, omit it and report the reason; if applicability cannot be determined, run it. Change size, risk level alone and out-of-scope failures seen during task checks are not triggers; report such failures as findings. Full regression uses the same clean worktree and prerequisites as the baseline.
25
+
26
+ **Baseline:** Before dependent work, Orchestrator records a baseline at the approved base revision after the prerequisites the checks require (for example build outputs and environment settings): commands, environment, revision and failures by test name, covering every command final verification may run, including the full suite when the provisional trigger judgment is run or undetermined. A file-level load or collection failure without test names marks that file baseline-incomplete; re-record with prerequisites or treat current failures in that file as new candidates. NEVER absorb them as baseline failures. Orchestrator MAY record the baseline in the background in a separate clean worktree immediately after base approval while continuing independent work, but MUST complete it before the result comparison. Record its load (quiet, contended or unknown), and by default DO NOT run baseline and HEAD verification concurrently. Reuse a cached baseline only when every cache key input matches and the cached run was quiet and complete; a missing, unreadable or differing input requires a fresh record, and a contended or unknown baseline serves only the current comparison.
27
+
28
+ **Result comparison:** Compare failures with the baseline by test name; only new failures are findings. Report baseline failures separately. Identify tests by name from structured results such as JUnit XML, TAP or a declared line pattern; a failure without a test name, or in a command or file whose results are incomplete, is a new-failure candidate, never a baseline failure. Report intermittent candidates, tests whose outcomes differ across runs with the same inputs, separately from baseline and new failures. Report the slowest files and tests (default ten) for information only. If a failure looks intermittent, rerun only that test in isolation, up to three times unless the brief sets another limit. This is diagnosis, not an automatic retry. Report "passes in isolation: yes/no" and the rerun count. A pass in isolation never erases the original failure; Orchestrator dispositions it. A failure in isolation is a new-failure finding.
29
+
30
+ <a id="final-verification-runtime-commands"></a>
31
+ ## Final verification runtime commands
32
+
33
+ Orchestrator MAY run `node <skill>/runtime/verify-cli.mjs <command> --cwd <workspace> --workflow <id> --input -` with `verify-start`, `verify-status`, `verify-compare`, `verify-rerun` or `verify-cleanup`. The commands reject bridge children, never retry, restart or delete automatically, create worktrees only under the system temporary directory and store records under `<git-common-dir>/arc/verify`. Commands receive only a fixed environment allowlist plus declared `envNames` and command `env`, all of which enter the cache key; declare any other variable a check needs. Use `detach: true` only on a host whose detached-process survival is verified in [coordination](coordination.md); otherwise run with `detach: false`, through the host's own background facility where available. `verify-rerun` runs one isolated attempt per call within the rerun limit, and `verify-cleanup` removes only worktrees the tool created and recorded, on explicit request.
34
+
17
35
  <a id="risk-scaled-execution"></a>
18
36
  ## Risk-scaled execution
19
37
 
@@ -60,7 +78,7 @@ Existing commit evidence links remain valid because history is unchanged. For a
60
78
 
61
79
  Task acceptance differs from final verification/acceptance. Connect criteria/observations/current checks/findings, not checkboxes/reports/passing commands alone. Use fresh QA where required or low-risk focused checks. For same-task QA findings and required QA rechecks, reuse the current QA while scope/workspace/ownership/context remain valid. Final overall Reviewer findings on plan work follow Implementer → Reviewer without QA reassignment; see the [final plan Reviewer correction loop](#final-plan-reviewer-correction-loop).
62
80
 
63
- DO NOT delay independently acceptable tasks solely for final-only checks or defer currently required checks to accept early. State final integration scope/timing separately. Whole-plan Reviewer is final verification; task commits prove no unperformed final checks. Orchestrator decides final acceptance with QA/Reviewer/integration evidence/findings and unverified/disposition records. Shared evidence MUST satisfy all reuse rules. Before the overall completion report and any push, PR or merge authorization request, Orchestrator verifies that plan-level progress records are carried by the verified next commit of the plan or, when none follows, recorded only in the canonical handoff record with the plan document unchanged and a clean working tree. While a user decision on a non-blocking final Reviewer finding is pending, hold overall completion; a fix decision follows plan revision and a new task whose accepted commit carries the records, and a no-fix disposition stays canonical only when no later commit follows.
81
+ DO NOT delay independently acceptable tasks solely for final-only checks or defer currently required checks to accept early. State final integration scope/timing separately. Whole-plan Reviewer is part of final verification; task commits prove no unperformed final checks. Orchestrator decides final acceptance with QA/Reviewer/integration evidence/findings and unverified/disposition records. Shared evidence MUST satisfy all reuse rules. Before the overall completion report and any push, PR or merge authorization request, Orchestrator verifies that plan-level progress records are carried by the verified next commit of the plan or, when none follows, recorded only in the canonical handoff record with the plan document unchanged and a clean working tree. While a user decision on a non-blocking final Reviewer finding is pending, hold overall completion; a fix decision follows plan revision and a new task whose accepted commit carries the records, and a no-fix disposition stays canonical only when no later commit follows.
64
82
 
65
83
  Committed-plan final Reviewer findings need a follow-up task/planning/approvals. Keep corrections uncommitted; refresh committed state plus uncommitted diff/files in Reviewer artifacts/briefs. Reuse/assign independent Reviewer and repeat Implementer → Reviewer until resolved, then accept/commit one focused follow-up. Final QA findings still use Implementer → QA. No automatic amend/reset/duplicate originals; scope growth retains planning/approvals.
66
84
 
@@ -125,7 +143,7 @@ Generated from lib/policy/role-policy.json; do not edit this managed section man
125
143
  - [git.orchestrator-accept-commit] Only Orchestrator accepts work and performs Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied. Orchestrator accepts, then includes that task's own progress records made after task completion (checkboxes, notes, results, evidence and status) with its implementation work in that commit, without a separate docs/fixup commit or planning-commit amendment for those records. Exclude other tasks; pending approved spec/plan revisions follow planning.plan-revision and preserve the no-change path without empty commits. Plan-level progress records (final verification results, final Reviewer verdicts and finding dispositions, overall completion status) are the sole exception: include them in the plan's next task acceptance or final Reviewer follow-up commit; when no implementation work remains and no standalone closing commit for pending revisions is made, keep them only in the canonical handoff record without changing the plan document or creating a commit. Orchestrator commits without separate user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership; verify the resulting SHA, content, HEAD and remaining changes. Existing small-task direct and plan-omission paths remain unchanged.
126
144
  - [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.
127
145
  - [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.
128
- - [review.final-plan-recheck] Complete required QA and QA failure rechecks before the initial final overall Reviewer review. Once that review begins on plan work, every final Reviewer finding, including behavior, follows Implementer → Reviewer without QA reassignment until resolved. Keep corrections uncommitted through Reviewer rechecks, then accept and create one focused follow-up commit. Separate QA findings follow Implementer → QA. Preserve required QA outside this final Reviewer exception.
146
+ - [review.final-plan-recheck] Complete required QA and QA failure rechecks before the initial final overall Reviewer review. Once that review begins on plan work, every final Reviewer finding, including behavior, follows Implementer → Reviewer without QA reassignment until resolved. Keep corrections uncommitted through Reviewer rechecks, then accept and create one focused follow-up commit. Separate QA findings and new failures from final verification, which may run concurrently with the final Reviewer, follow Implementer → QA; Reviewer evidence for affected files then needs a refreshed-diff recheck. Preserve required QA outside this final Reviewer exception.
129
147
  - [planning.plan-revision] Task progress records (checkboxes, notes, results, evidence and status) preserving the approved contract need no new user approval; Orchestrator includes the completed task's own records in its accepted implementation commit and records classification, reason and actual time as applicable. Plan-level progress records preserving the approved contract also need no new user approval and alone never trigger the standalone docs(plan) closing commit. All other spec/plan content changes, contract or mechanical, require applicable approval and preparation; changes to goals, scope, criteria, method, risk, dependencies or required verification need revised-version approval, preparation and holds on affected work before it continues, with a fresh Implementer for remaining work. After approval Orchestrator edits the same document, appends a revision-history row and leaves it uncommitted as an Orchestrator-owned pending revision, recording version, content hash, approval reference, actual time, classification, reason, affected tasks and the full approved content in the canonical handoff record. Orchestrator includes all pending revisions with Plan-Revision, Plan-Approved-At and Plan-Reason trailers in the accepted commit of the first top-level task executed or reconfirmed against the revised version, otherwise in a current task or final Reviewer follow-up commit; only when no implementation work remains before overall completion MAY it make one standalone docs(plan) closing commit without implementation files. Exclude revision hunks from commits of independent tasks accepted on a prior version, or hold that commit when separation is unsafe. NEVER amend or rewrite planning or implementation commits, create any other docs/fixup commit or authorize past work retroactively. After commit verify the committed document content matches the latest approved content apart from classified progress records of that commit's task or committed for other tasks after approval, or plan-level progress records carried by that commit, and that no pending revision remains. Follow planning, handoff-prep, commit and verification for the full contract.
130
148
  - [platform.grok] Role restrictions are prompt-level contracts, not a filesystem sandbox. Grok sandboxing, native tool restriction fields, observer hooks and Git guards are unverified, and Grok may continue without its sandbox. Use only available authorized tools; ARC disables Grok Claude compatibility (agents, skills, rules in config.toml; also MCPs and hooks for bridge children), but whether Grok sessions honor these settings is unverified.
131
149
  [ARC role policy: contract end]
@@ -3,6 +3,6 @@
3
3
 
4
4
  Follow the common [managed worktree contract](handoff-worktree.md) only after explicit user selection and verified preparation scope. Preserve the approved source/base, branch candidate, absent destination, unrelated changes and transfer evidence.
5
5
 
6
- Grok native attachment has not been verified. Do not substitute Claude EnterWorktree, invent an attachment call or treat Git registration as attachment evidence. Hold managed worktree creation until Orchestrator has an approved, verified attachment method. The current checkout remains available only after explicit target selection.
6
+ Grok native attachment has not been verified. DO NOT substitute Claude EnterWorktree, invent an attachment call or treat Git registration as attachment evidence. Hold managed worktree creation until Orchestrator has an approved, verified attachment method. The current checkout remains available only after explicit target selection.
7
7
 
8
- On failure or partial completion, stop dependent work, preserve actual state and return paths, branch/HEAD, registration, completed steps and required resolution. Never retry with a different name, remove a worktree, change permissions or bypass the sandbox.
8
+ On failure or partial completion, stop dependent work, preserve actual state and return paths, branch/HEAD, registration, completed steps and required resolution. NEVER retry with a different name, remove a worktree, change permissions or bypass the sandbox.
@@ -1,4 +1,4 @@
1
1
  export async function runPostinstall({output=process.stdout}={}){
2
- output.write('Run arc to install or manage the ARC harness.\n');
2
+ output.write('🎉 ARC installed successfully! Run arc to set up the harness.\n');
3
3
  return 0;
4
4
  }
package/lib/cli/root.mjs CHANGED
@@ -2,7 +2,7 @@ import fs from 'node:fs';
2
2
  const usage='Usage: arc\n arc watch [options]\n arc --help\n arc --version';
3
3
  export async function runRoot(args=process.argv.slice(2),io={}){
4
4
  const input=io.input??process.stdin,output=io.output??process.stdout,error=io.error??process.stderr;
5
- if(args.length===1&&args[0]==='--help'){output.write(usage+'\n\nOpen ARC Management in an interactive terminal to install or manage the harness.\nRun arc watch to follow Claude Code and Codex session activity.\n');return 0;}
5
+ if(args.length===1&&args[0]==='--help'){output.write(usage+'\n\nOpen ARC Management in an interactive terminal to install or manage the harness.\nRun arc watch in an interactive terminal to choose platforms and follow session activity in the current worktree.\n');return 0;}
6
6
  if(args.length===1&&args[0]==='--version'){output.write(JSON.parse(fs.readFileSync(new URL('../../package.json',import.meta.url))).version+'\n');return 0;}
7
7
  if(args[0]==='watch'){const {runWatch}=await import('../watch/index.mjs');return runWatch(args.slice(1),io);}
8
8
  if(args.length){error.write('Error: Unsupported arguments. Open arc to manage the harness.\n'+usage+'\n');return 2;}
@@ -13,6 +13,7 @@ export const RUNTIME_MODULE_PATHS = Object.freeze([
13
13
  'lib/runtime/cooperative.mjs',
14
14
  'lib/runtime/evaluate.mjs',
15
15
  'lib/runtime/external.mjs',
16
+ 'lib/runtime/final-verify.mjs',
16
17
  'lib/runtime/gate.mjs',
17
18
  'lib/runtime/gemini-stream.mjs',
18
19
  'lib/runtime/git-evidence.mjs',
@@ -21,6 +22,7 @@ export const RUNTIME_MODULE_PATHS = Object.freeze([
21
22
  'lib/runtime/grok-stream.mjs',
22
23
  'lib/runtime/identity.mjs',
23
24
  'lib/runtime/local-cli.mjs',
25
+ 'lib/runtime/node-test-reporter.mjs',
24
26
  'lib/runtime/operations.mjs',
25
27
  'lib/runtime/platform-registry.mjs',
26
28
  'lib/runtime/role-bridge-args.mjs',
@@ -35,5 +37,7 @@ export const RUNTIME_MODULE_PATHS = Object.freeze([
35
37
  'lib/runtime/scope.mjs',
36
38
  'lib/runtime/store.mjs',
37
39
  'lib/runtime/target-preparation.mjs',
38
- 'lib/runtime/verification.mjs'
40
+ 'lib/runtime/test-results.mjs',
41
+ 'lib/runtime/verification.mjs',
42
+ 'lib/runtime/verify-cli.mjs'
39
43
  ]);
@@ -0,0 +1,117 @@
1
+ import path from 'node:path';
2
+ import {isDeepStrictEqual} from 'node:util';
3
+ import {TargetConfigurationError} from '../installer/targets.mjs';
4
+ import {assertPlanSnapshot} from '../installer/transaction.mjs';
5
+ import {loadStaticModelCatalog} from '../models/static-catalog.mjs';
6
+ import {installerRegistryOf,platformLabel} from '../platforms/index.mjs';
7
+ import {deriveInstallPlan} from '../tui/derive-install-plan.mjs';
8
+ import {initializeInstallDraft,installPrepareOptions,installSettingsDraft,loadInstallCatalog,loadRoleDefaults} from '../tui/setup.mjs';
9
+ import {createManagementContext,currentInstallState,executeOperation,prepareOperation,readCompositeConfig} from './operations.mjs';
10
+ import {collectStatus} from './status.mjs';
11
+
12
+ export async function buildReapplyRequest({context,installState,statuses,target,currentConfig,loadCatalog}){
13
+ const registry=installerRegistryOf(context),draft={registry};
14
+ if(installState.mode==='composite'&&!currentConfig)throw new TargetConfigurationError('Mixed routing configuration is missing');
15
+ await initializeInstallDraft({
16
+ draft,installState,currentConfig,registry,initialTarget:()=>target,
17
+ loadRoleDefaults:id=>loadRoleDefaults({context,statuses,target:id}),
18
+ });
19
+ const plan=deriveInstallPlan({roles:draft.roles,hosts:draft.hosts,current:installState,registry});
20
+ if(plan.rule!==(target===undefined?'D1-d':'D1-a'))throw new TargetConfigurationError('Configure Apply requires confirmation');
21
+ draft.settings=installSettingsDraft(statuses,plan.platforms);
22
+ const loader=loadCatalog??(id=>loadStaticModelCatalog(id,{signal:context.signal,platforms:registry}));
23
+ const catalogs={};
24
+ for(const id of plan.platforms){
25
+ const result=await loadInstallCatalog(id,{loadCatalog:loader,registry});
26
+ context.signal?.throwIfAborted();
27
+ if(result.status!=='ready')throw new TargetConfigurationError('Model catalog unavailable for '+platformLabel(id,registry));
28
+ catalogs[id]=result.catalog;
29
+ }
30
+ return installPrepareOptions(plan,draft,catalogs);
31
+ }
32
+
33
+ function assertDraftSnapshot(context,statuses,platforms){
34
+ const snapshot=new Map();
35
+ for(const {platform,target,snapshot:source} of statuses){
36
+ if(!source||!platforms.includes(platform))continue;
37
+ for(const name of ['models.toml','settings.toml','limits.toml']){
38
+ const filename=path.join(target.home,'skills/arc',name);
39
+ snapshot.set(filename,source.get(filename));
40
+ }
41
+ }
42
+ assertPlanSnapshot({snapshot},{safeFs:context.safeFs});
43
+ }
44
+
45
+ async function applyConfiguration(context,options){
46
+ const {installState,statuses,target,currentConfig}=options;
47
+ try{
48
+ context.signal?.throwIfAborted();
49
+ const request=await buildReapplyRequest({context,...options});
50
+ const prepared=await prepareOperation(context,request);
51
+ if(prepared.kind!==(target===undefined?'composite':'install'))throw new TargetConfigurationError('Configure Apply requires confirmation');
52
+ // Catalog and auth checks can yield before the installer takes its own snapshots.
53
+ if(target===undefined?!isDeepStrictEqual(readCompositeConfig(context),currentConfig):currentInstallState(context).mode!==installState.mode){
54
+ throw new TargetConfigurationError('Installed ARC configuration changed during re-apply');
55
+ }
56
+ assertDraftSnapshot(context,statuses,target===undefined?request.platforms:[target]);
57
+ context.signal?.throwIfAborted();
58
+ const result=await executeOperation(context,prepared);
59
+ const error=result.error??result.results.find(item=>item.error)?.error;
60
+ return {
61
+ code:result.code,error,
62
+ unknown:result.activation==='unknown'||result.results.some(item=>item.rollback==='failed'),
63
+ messages:result.messages?.filter(message=>result.activation==='unknown'
64
+ ?!message.startsWith('Residual path: '):message.startsWith('Dispatch history stays in ')),
65
+ published:target===undefined?result.activation==='published':result.results.some(item=>item.status==='installed'),
66
+ residualPaths:[...(result.publication?.residualPaths??[]),...(error?.residualPaths??[]),...result.results.flatMap(item=>item.residualPaths??[])],
67
+ };
68
+ }catch(error){return {code:context.signal?.aborted?130:1,error,residualPaths:error.residualPaths??[]};}
69
+ }
70
+
71
+ export async function reapplyConfiguration(options={}){
72
+ const {signal,loadCatalog}=options;
73
+ const residualPaths=new Set(),applied=[],failures=[],messages=[];
74
+ let mode,unknown;
75
+ const incomplete=(error,code=signal?.aborted?130:1)=>({
76
+ status:unknown?'unknown':'held',mode,code,error:unknown?.error??error,residualPaths:[...residualPaths],
77
+ ...(unknown?{messages:unknown.messages}:error.activeDispatches?{activeDispatches:error.activeDispatches}:{}),
78
+ ...(applied.length?{applied}:{}),
79
+ });
80
+ const completed=(code,error)=>({status:'applied',mode,platforms:applied,residualPaths:[...residualPaths],code,...(messages.length?{messages}:{}),...(error?{error}:{})});
81
+ try{
82
+ signal?.throwIfAborted();
83
+ const context=await createManagementContext(options),installState=currentInstallState(context);
84
+ mode=installState.mode;
85
+ if(mode!=='composite'&&mode!=='standalone')return {status:'skipped'};
86
+ const currentConfig=mode==='composite'?readCompositeConfig(context):undefined;
87
+ const statuses=await collectStatus(context);
88
+ signal?.throwIfAborted();
89
+ const targets=mode==='composite'?[undefined]:installerRegistryOf(context).byDisplayOrder()
90
+ .map(({runtime})=>runtime.id).filter(id=>statuses.some(status=>status.platform===id&&status.state==='installed'));
91
+ if(!targets.length)return {status:'skipped'};
92
+ const expected=mode==='composite'?installState.platforms.length:targets.length;
93
+ for(const target of targets){
94
+ const result=await applyConfiguration(context,{installState,statuses,target,currentConfig,loadCatalog});
95
+ for(const filename of result.residualPaths)residualPaths.add(filename);
96
+ const error=result.error??new TargetConfigurationError('Configure Apply did not complete');
97
+ if(result.unknown){
98
+ unknown={error,messages:result.messages};
99
+ return incomplete(error,result.code===130||signal?.aborted?130:1);
100
+ }
101
+ if(result.published){
102
+ applied.push(...(target===undefined?installState.platforms:[target]));
103
+ messages.push(...(result.messages??[]));
104
+ }
105
+ if(result.code===130||signal?.aborted){
106
+ return applied.length===expected?completed(130,result.error??failures[0]):incomplete(error,130);
107
+ }
108
+ if(!result.published||result.code!==0)failures.push(error);
109
+ }
110
+ const error=failures.length>1?new AggregateError(failures,failures.map(failure=>failure.message).join(', ')):failures[0];
111
+ if(applied.length!==expected)return incomplete(error);
112
+ return completed(error?1:0,error);
113
+ }catch(error){
114
+ for(const filename of error.residualPaths??[])residualPaths.add(filename);
115
+ return incomplete(error);
116
+ }
117
+ }
@@ -2,15 +2,15 @@ import fs from 'node:fs';
2
2
  import os from 'node:os';
3
3
  import path from 'node:path';
4
4
  import {fileURLToPath} from 'node:url';
5
- import {installerRegistryOf,platformLabel} from '../platforms/index.mjs';
5
+ import {installerRegistryOf,platformLabel,sortByDisplay} from '../platforms/index.mjs';
6
6
  const packageRoot=path.resolve(fileURLToPath(new URL('../../',import.meta.url)));
7
7
  const inputError=message=>Object.assign(Error(message),{code:'ARC_CLI_INPUT'});
8
8
  const configurationError=message=>Object.assign(Error(message),{code:'ARC_TARGET_CONFIGURATION'});
9
9
  function identity(root){const pkg=JSON.parse(fs.readFileSync(path.join(root,'package.json'),'utf8'));if(pkg.name!=='@yunhozz/arc'||!/^\d+\.\d+\.\d+$/.test(pkg.version))throw configurationError('Invalid ARC package identity');return pkg;}
10
10
  export async function runtime(deps){
11
- const [context,state,upgrade,npm]=await Promise.all([import('../npm/context.mjs'),import('../installer/upgrade-state.mjs'),import('../installer/upgrade.mjs'),import('../npm/upgrade.mjs')]);
11
+ const [context,state,upgrade,npm,reapply]=await Promise.all([import('../npm/context.mjs'),import('../installer/upgrade-state.mjs'),import('../installer/upgrade.mjs'),import('../npm/upgrade.mjs'),import('./reapply.mjs')]);
12
12
  let safeFs=deps.safeFs;if(!safeFs){const[{loadNative},{openRoot}]=await Promise.all([import('../safe-fs/native.mjs'),import('../safe-fs/index.mjs')]);const native=loadNative();safeFs={openRoot:root=>openRoot(root,{native})};}
13
- return{...context,...state,...upgrade,...npm,...deps,safeFs};
13
+ return{...context,...state,...upgrade,...npm,...reapply,...deps,safeFs};
14
14
  }
15
15
  export function report(result,output,error){
16
16
  const residualPaths=new Set(),writeResidual=filename=>{if(residualPaths.has(filename))return;residualPaths.add(filename);output.write('Residual path: '+filename+'\n');};
@@ -21,6 +21,60 @@ export function report(result,output,error){
21
21
  error.write('Harness update did not complete. Run arc again and choose Configure to retry the harness update.\n');return 1;
22
22
  }
23
23
  export function failure(cause,error){error.write('Error: '+cause.message+'\n');return ['ARC_CANCELLED','ARC_NPM_CANCELLED'].includes(cause.code)?130:['ARC_CLI_INPUT','ARC_TARGET_CONFIGURATION','ARC_UNSUPPORTED_RUNTIME','ARC_NATIVE_UNAVAILABLE'].includes(cause.code)?2:1;}
24
+ export async function upgradeAndReapply({api,root,state,output,error,signal,env,cwd,userHome}){
25
+ const platforms=api.platforms??state.registry;
26
+ const code=report(await api.upgradeInstalledTargets({packageRoot:root,state,safeFs:api.safeFs,signal,registry:platforms}),output,error);
27
+ if(signal?.aborted){
28
+ if(code===0){
29
+ error.write('Configuration was not re-applied.\n');
30
+ error.write('Run arc → Configure → Apply to re-apply the configuration.\n');
31
+ }
32
+ return 130;
33
+ }
34
+ if(code!==0)return code;
35
+ let result;
36
+ try{
37
+ result=await api.reapplyConfiguration({packageRoot:root,userHome,cwd,env,safeFs:api.safeFs,signal,platforms,runtimePlatforms:api.runtimePlatforms,loadCatalog:api.loadCatalog});
38
+ }catch(cause){result={status:'held',code:1,error:cause,activeDispatches:cause.activeDispatches,residualPaths:cause.residualPaths};}
39
+ if(result.status==='skipped')return signal?.aborted?130:0;
40
+ const interrupted=signal?.aborted||result.code===130;
41
+ const registry=installerRegistryOf({platforms});
42
+ const labels=ids=>sortByDisplay(ids,registry).map(id=>platformLabel(id,registry));
43
+ if(result.status==='unknown'){
44
+ error.write('Configuration re-apply state is unknown.\n');
45
+ const notices=result.messages?.length?result.messages:['Configuration publication state is unknown; inspect the reported paths before retrying.'];
46
+ for(const notice of notices)error.write(notice+'\n');
47
+ if(result.applied?.length)error.write('Configuration re-applied for: '+labels(result.applied).join(', ')+'.\n');
48
+ if(result.error)error.write('Error: '+result.error.message+'\n');
49
+ for(const filename of new Set(result.residualPaths))error.write('Residual path: '+filename+'\n');
50
+ return interrupted?130:result.code;
51
+ }
52
+ if(result.status==='applied'){
53
+ const names=labels(result.platforms);
54
+ const label=result.mode==='composite'?'Mixed routing ('+names.join(' + ')+')':names.join(', ');
55
+ output.write('Configuration re-applied: '+label+'.\n');
56
+ for(const message of result.messages??[])output.write(message+'\n');
57
+ if(interrupted)error.write('Interrupted after the configuration was re-applied.\n');
58
+ if(result.error)error.write('Error: '+result.error.message+'\n');
59
+ }else if(interrupted&&result.applied?.length){
60
+ error.write('Configuration was re-applied only for: '+labels(result.applied).join(', ')+'.\n');
61
+ error.write('Interrupted before the remaining platforms were re-applied.\n');
62
+ error.write('Run arc → Configure → Apply to re-apply the configuration.\n');
63
+ }else{
64
+ if(result.applied?.length)error.write('Configuration was re-applied only for: '+labels(result.applied).join(', ')+'.\n');
65
+ error.write('Configuration was not re-applied.\n');
66
+ if(result.activeDispatches?.length){
67
+ error.write('Active bridge dispatches ('+result.activeDispatches.length+'): '+result.activeDispatches.join(', ')+'\n');
68
+ error.write('After they finish, run arc → Configure → Apply.\n');
69
+ }else{
70
+ error.write('Error: '+result.error.message+'\n');
71
+ error.write('Run arc → Configure → Apply to re-apply the configuration.\n');
72
+ }
73
+ }
74
+ for(const filename of new Set(result.residualPaths))output.write('Residual path: '+filename+'\n');
75
+ return interrupted?130:result.code;
76
+ }
77
+
24
78
  export async function runChild(request,io={},deps={}){
25
79
  const output=io.output??process.stdout,error=io.error??process.stderr;let onInterrupt;
26
80
  try{
@@ -28,10 +82,10 @@ export async function runChild(request,io={},deps={}){
28
82
  const root=deps.packageRoot??packageRoot,pkg=identity(root);if(pkg.version!==request.expectedVersion)throw configurationError('The new ARC package version does not match the requested upgrade');
29
83
  const api=await runtime(deps),env=io.env??process.env,cwd=request.invocationCwd,context=await api.inspectNpmContext({packageRoot:root,entryPath:path.join(root,'bin/arc-upgrade.mjs'),env,cwd});
30
84
  if(context.kind!=='global'||context.packageRoot!==root)throw configurationError('Cannot verify the replaced global ARC package');
31
- const state=api.collectInstalledState({safeFs:api.safeFs,userHome:deps.userHome??os.homedir(),env,cwd,platforms:api.platforms,runtimePlatforms:api.runtimePlatforms});if(state.stateToken!==request.expectedStateToken)throw configurationError('Installed ARC settings changed during CLI replacement; retry upgrade');
85
+ const userHome=deps.userHome??os.homedir(),state=api.collectInstalledState({safeFs:api.safeFs,userHome,env,cwd,platforms:api.platforms,runtimePlatforms:api.runtimePlatforms});if(state.stateToken!==request.expectedStateToken)throw configurationError('Installed ARC settings changed during CLI replacement; retry upgrade');
32
86
  if(!state.targets.length)throw configurationError('No installed ARC harness found');
33
87
  const controller=new AbortController();onInterrupt=()=>controller.abort();process.once('SIGINT',onInterrupt);process.once('SIGTERM',onInterrupt);
34
- return report(await api.upgradeInstalledTargets({packageRoot:root,state,safeFs:api.safeFs,signal:controller.signal,registry:api.platforms}),output,error);
88
+ return await upgradeAndReapply({api,root,state,output,error,signal:controller.signal,env,cwd,userHome});
35
89
  }catch(cause){return failure(cause,error);}finally{if(onInterrupt){process.removeListener('SIGINT',onInterrupt);process.removeListener('SIGTERM',onInterrupt);}}
36
90
  }
37
91
 
@@ -2,7 +2,10 @@ export const GEMINI_MODELS_API = 'https://generativelanguage.googleapis.com/v1be
2
2
  const unavailable = (code, message) => ({status: 'unavailable', code, message});
3
3
 
4
4
  export function selectGeminiCatalogModels(ids) {
5
- return [...new Set(ids.filter(id => typeof id === 'string' && id === id.trim() && /^gemini-(\d+(?:\.\d+)?)-(pro|flash|flash-lite)$/.test(id)))];
5
+ return [...new Set(ids.filter(id => typeof id === 'string' && id === id.trim() && (
6
+ /^gemini-(\d+(?:\.\d+)?)-(pro|flash|flash-lite)$/.test(id)
7
+ || /^gemini-(\d+)-(neon|hydrogen|carbon|argon)$/.test(id)
8
+ )))];
6
9
  }
7
10
 
8
11
  export async function discoverGeminiCatalog({apiKey, fetchImpl = globalThis.fetch, signal} = {}) {
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "platform": "gemini",
3
3
  "pairs": [
4
+ {"model": "gemini-4-neon", "effort": "default"},
5
+ {"model": "gemini-4-hydrogen", "effort": "default"},
6
+ {"model": "gemini-4-carbon", "effort": "default"},
7
+ {"model": "gemini-4-argon", "effort": "default"},
4
8
  {"model": "gemini-3.8-flash", "effort": "default"},
5
9
  {"model": "gemini-3.7-flash", "effort": "default"},
6
10
  {"model": "gemini-3.6-flash", "effort": "default"},
@@ -45,10 +45,14 @@ export async function runNpxUpgrade({context,expectedVersion,expectedStateToken,
45
45
  if(typeof api.inspectNpmContext!=='function'||typeof api.collectInstalledState!=='function'||typeof api.upgradeInstalledTargets!=='function')throw Error('Pinned ARC management API is unavailable');
46
46
  const context=await api.inspectNpmContext({packageRoot:root,entryPath:entry,env:process.env,cwd});
47
47
  if(context.kind!=='npx'||context.packageRoot!==root)throw Error('Cannot verify pinned npm exec context');
48
- const state=api.collectInstalledState({safeFs:api.safeFs,userHome:os.homedir(),env:process.env,cwd,platforms:api.platforms,runtimePlatforms:api.runtimePlatforms});
48
+ const userHome=os.homedir(),state=api.collectInstalledState({safeFs:api.safeFs,userHome,env:process.env,cwd,platforms:api.platforms,runtimePlatforms:api.runtimePlatforms});
49
49
  if(state.stateToken!==expectedStateToken||!state.targets.length)throw Error('Installed ARC settings changed before pinned upgrade');
50
50
  const controller=new AbortController(),abort=()=>controller.abort();process.once('SIGINT',abort);process.once('SIGTERM',abort);
51
- try{process.exitCode=management.report(await api.upgradeInstalledTargets({packageRoot:root,state,safeFs:api.safeFs,signal:controller.signal,registry:api.platforms}),process.stdout,process.stderr);}finally{process.removeListener('SIGINT',abort);process.removeListener('SIGTERM',abort);}
51
+ try{
52
+ process.exitCode=typeof management.upgradeAndReapply==='function'
53
+ ?await management.upgradeAndReapply({api,root,state,output:process.stdout,error:process.stderr,signal:controller.signal,env:process.env,cwd,userHome})
54
+ :management.report(await api.upgradeInstalledTargets({packageRoot:root,state,safeFs:api.safeFs,signal:controller.signal,registry:api.platforms}),process.stdout,process.stderr);
55
+ }finally{process.removeListener('SIGINT',abort);process.removeListener('SIGTERM',abort);}
52
56
  }catch(error){console.error('Error: '+error.message);process.exitCode=2;}`;
53
57
  return runNpm(context.npmCli,['exec','--yes','--package','@yunhozz/arc@'+expectedVersion,'--',process.execPath,'--input-type=module','-e',bootstrap],{env,cwd,signal});
54
58
  }
@@ -379,7 +379,7 @@
379
379
  "reviewer-findings"
380
380
  ],
381
381
  "authority": "orchestrator",
382
- "text": "Complete required QA and QA failure rechecks before the initial final overall Reviewer review. Once that review begins on plan work, every final Reviewer finding, including behavior, follows Implementer → Reviewer without QA reassignment until resolved. Keep corrections uncommitted through Reviewer rechecks, then accept and create one focused follow-up commit. Separate QA findings follow Implementer → QA. Preserve required QA outside this final Reviewer exception.",
382
+ "text": "Complete required QA and QA failure rechecks before the initial final overall Reviewer review. Once that review begins on plan work, every final Reviewer finding, including behavior, follows Implementer → Reviewer without QA reassignment until resolved. Keep corrections uncommitted through Reviewer rechecks, then accept and create one focused follow-up commit. Separate QA findings and new failures from final verification, which may run concurrently with the final Reviewer, follow Implementer → QA; Reviewer evidence for affected files then needs a refreshed-diff recheck. Preserve required QA outside this final Reviewer exception.",
383
383
  "controls": {
384
384
  "codex": "prompt",
385
385
  "claude": "prompt",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  {
45
45
  "id": "implementer.execution-steps",
46
- "text": "1. Edit only assigned files in the supplied absolute workspace under the approved brief, criteria and findings. Accommodate others' edits without reverting them. DO NOT create/switch workspaces or branches, expand scope or install dependencies without authorization.\n2. Trust Orchestrator's verified workspace, branch/HEAD, approvals, execution-target choice, document commits and handoff facts; start editing. Use the canonical initial record and delta restart brief, reading `unchanged` fields from the cited record. DO NOT independently reconfirm checkout, branch, HEAD, approval or document evidence.\n3. Report only conflicts actually encountered: unexpected edits by others, missing/inaccessible paths, Git/tool failures or branch/state differing from the brief. Stop dependent work and return observed state and needed action. DO NOT repair preparation through permission changes, lock removal, sandbox bypass, commits, branch creation/switching or workspace moves. Resume after resolution. Expected TDD RED is evidence, not an operational failure.\n4. DO NOT recreate, clean up or archive worktrees. Wait once for long commands with the longest yield or report them to Orchestrator. DO NOT repeat `sleep` or short status checks.\n5. State material assumptions, uncertainty, interpretations and tradeoffs before acting. Return unresolved decisions to Orchestrator.\n6. Make the simplest change meeting approved requirements and criteria. Add no speculative features, abstractions or settings. Edit surgically in local style without unrelated refactoring. Clean up only artifacts you created.\n7. Connect criteria to verifiable checks. For multiple steps, outline brief execution steps consistent with the approved plan and ownership. Run approved checks or report the precise blocker. Support success claims with evidence.\n8. Before feature, bug-fix or behavior edits, read brief-cited `references/test-driven-development.md` unless waived. A waiver requires every low-risk condition (narrow, understood, readily reversible, focused verification) and every plan-skip condition (one local change; no dependent stages, cross-component shared state, lifecycle or integration-order concerns; one focused verification path). Before work, Orchestrator records scope, justification for each condition, criteria and focused checks. Explicit user/task-specific TDD requirements override the waiver. Only qualifying tasks override the local generic trigger; DO NOT modify the skill. Ordinary multistep and significant/high-risk work are ineligible.\n9. A waiver skips only failure-first/RED-GREEN steps. Focused checks, evidence/limits reporting and risk-appropriate QA/Reviewer remain. DO NOT claim TDD was followed. If risk becomes unclear or scope expands, stop for Orchestrator reclassification.\n10. Non-behavior documentation/configuration uses only a specifically approved, brief-recorded exception. Run approved structural checks and state limits. NEVER generalize the exception to behavior work or claim TDD under it.\n11. 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 evidence to Orchestrator. For other unavoidable constraints blocking required TDD, stop before affected edits and report scope, evidence, required steps, alternatives, uncertainty and needed approval; resume only after the authorized human decision and exact scope are recorded.\n12. Implement assigned changes and report only. DO NOT plan, design, QA or review your own work. Report changed files, focused checks/evidence, unresolved issues and exact QA/Reviewer follow-up."
46
+ "text": "1. Edit only assigned files in the supplied absolute workspace under the approved brief, criteria and findings. Accommodate others' edits without reverting them. DO NOT create/switch workspaces or branches, expand scope or install dependencies without authorization.\n2. Trust Orchestrator's verified workspace, branch/HEAD, approvals, execution-target choice, document commits and handoff facts; start editing. Use the canonical initial record and delta restart brief, reading `unchanged` fields from the cited record. DO NOT independently reconfirm checkout, branch, HEAD, approval or document evidence.\n3. Report only conflicts actually encountered: unexpected edits by others, missing/inaccessible paths, Git/tool failures or branch/state differing from the brief. Stop dependent work and return observed state and needed action. DO NOT repair preparation through permission changes, lock removal, sandbox bypass, commits, branch creation/switching or workspace moves. Resume after resolution. Expected TDD RED is evidence, not an operational failure.\n4. DO NOT recreate, clean up or archive worktrees. Wait once for long commands with the longest yield or report them to Orchestrator. DO NOT repeat `sleep` or short status checks.\n5. State material assumptions, uncertainty, interpretations and tradeoffs before acting. Return unresolved decisions to Orchestrator.\n6. Make the simplest change meeting approved requirements and criteria. Add no speculative features, abstractions or settings. Edit surgically in local style without unrelated refactoring. Clean up only artifacts you created.\n7. Connect criteria to verifiable checks. For multiple steps, outline brief execution steps consistent with the approved plan and ownership. Run approved checks or report the precise blocker. Run only related tests per installed ARC `references/verification.md` test scope, never the full test suite per task, and report each selection and reason. Support success claims with evidence.\n8. Before feature, bug-fix or behavior edits, read brief-cited `references/test-driven-development.md` unless waived. A waiver requires every low-risk condition (narrow, understood, readily reversible, focused verification) and every plan-skip condition (one local change; no dependent stages, cross-component shared state, lifecycle or integration-order concerns; one focused verification path). Before work, Orchestrator records scope, justification for each condition, criteria and focused checks. Explicit user/task-specific TDD requirements override the waiver. Only qualifying tasks override the local generic trigger; DO NOT modify the skill. Ordinary multistep and significant/high-risk work are ineligible.\n9. A waiver skips only failure-first/RED-GREEN steps. Focused checks, evidence/limits reporting and risk-appropriate QA/Reviewer remain. DO NOT claim TDD was followed. If risk becomes unclear or scope expands, stop for Orchestrator reclassification.\n10. Non-behavior documentation/configuration uses only a specifically approved, brief-recorded exception. Run approved structural checks and state limits. NEVER generalize the exception to behavior work or claim TDD under it.\n11. 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 evidence to Orchestrator. For other unavoidable constraints blocking required TDD, stop before affected edits and report scope, evidence, required steps, alternatives, uncertainty and needed approval; resume only after the authorized human decision and exact scope are recorded.\n12. Implement assigned changes and report only. DO NOT plan, design, QA or review your own work. Report changed files, focused checks/evidence, unresolved issues and exact QA/Reviewer follow-up."
47
47
  },
48
48
  {
49
49
  "id": "planner.target-evidence",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  {
53
53
  "id": "planner.task-shape",
54
- "text": "Return one complete plan draft covering all top-level tasks and dependencies; DO NOT split it into a Planner call per implementation task. For each top-level task, include ID/title, implementation goal/scope/files, predecessors/dependencies and criteria. For that task, also include required QA/focused checks/evidence before acceptance and holds. Put inseparable changes in one task from the outset. DO NOT merge distinct approved tasks during execution. Substeps/checkboxes track progress, not commit units."
54
+ "text": "Return one complete plan draft covering all top-level tasks and dependencies; DO NOT split it into a Planner call per implementation task. For each top-level task, include ID/title, implementation goal/scope/files, predecessors/dependencies and criteria. For that task, also include required QA/focused checks/evidence before acceptance and holds. List each task's related tests with reasons. In final verification list the union, all contract tests and check scripts, and a provisional full-regression trigger judgment with reason. Put inseparable changes in one task from the outset. DO NOT merge distinct approved tasks during execution. Substeps/checkboxes track progress, not commit units."
55
55
  },
56
56
  {
57
57
  "id": "planner.commit-boundary",
@@ -79,7 +79,7 @@
79
79
  },
80
80
  {
81
81
  "id": "qa.verification-steps",
82
- "text": "1. Use the shared brief, criteria, Implementer summary and relevant prior findings. Independently verify assigned behavior with the smallest relevant existing checks. Use approved structural/consistency checks for policy/configuration.\n2. Run authorized tests and inspect output, but DO NOT edit source, documents, tests or configuration. DO NOT repair failures or broaden verification without authorization.\n3. Report every brief criterion by ID or original wording. Record method/scope, run status, accessible evidence, criterion verdict, unverified reason and remaining scope.\n4. Run status is passed, failed, not run or environment blocked. Verdict is proven, unmet or unverified. Passing alone proves no criterion; connect conditions/expected results to observations. Keep partial checks, out-of-scope criteria, missing checks and environment blocks unverified. Omit no criterion. PASS means run status only.\n5. Structural checks prove structural criteria only, not behavior, installation or live agent compliance. After a fix, rerun reproduction and invalidated checks; report the prior finding resolved, unresolved or unverified with evidence.\n6. Only with assigned UI criteria and a brief citation to installed ARC `references/verification.md`'s `UI browser acceptance checks`, read/follow that section before launching apps or using browser tools. Otherwise DO NOT launch apps/browsers for UI acceptance. Report missing citations/prerequisites and leave criteria unverified.\n7. Report exact commands, results, evidence, unresolved issues and limits. Separate failures from environment problems. Run approved checks and report only; DO NOT edit, repair, plan or decide acceptance."
82
+ "text": "1. Use the shared brief, criteria, Implementer summary and relevant prior findings. Independently verify assigned behavior with related tests only: test files directly exercising changed modules, contract tests the change requires updating and matching check scripts; additions within these categories with reasons are authorized; report each selection and reason. Final verification is run by Orchestrator, not QA. Use approved structural/consistency checks for policy/configuration.\n2. Run authorized tests and inspect output, but DO NOT edit source, documents, tests or configuration. DO NOT repair failures or broaden verification without authorization.\n3. Report every brief criterion by ID or original wording. Record method/scope, run status, accessible evidence, criterion verdict, unverified reason and remaining scope.\n4. Run status is passed, failed, not run or environment blocked. Verdict is proven, unmet or unverified. Passing alone proves no criterion; connect conditions/expected results to observations. Keep partial checks, out-of-scope criteria, missing checks and environment blocks unverified. Omit no criterion. PASS means run status only.\n5. Structural checks prove structural criteria only, not behavior, installation or live agent compliance. After a fix, rerun reproduction and invalidated checks; report the prior finding resolved, unresolved or unverified with evidence. Compare failures with the brief's baseline by test name; only new failures are findings. Rerun a suspected intermittent test alone, up to the brief's limit (default three), as diagnosis rather than retry; report passes-in-isolation and rerun count.\n6. Only with assigned UI criteria and a brief citation to installed ARC `references/verification.md`'s `UI browser acceptance checks`, read/follow that section before launching apps or using browser tools. Otherwise DO NOT launch apps/browsers for UI acceptance. Report missing citations/prerequisites and leave criteria unverified.\n7. Report exact commands, results, evidence, unresolved issues and limits. Separate failures from environment problems. Run approved checks and report only; DO NOT edit, repair, plan or decide acceptance."
83
83
  },
84
84
  {
85
85
  "id": "reviewer.contract-intro",
@@ -87,11 +87,11 @@
87
87
  },
88
88
  {
89
89
  "id": "reviewer.review-steps",
90
- "text": "- Use goal, criteria, assigned diff/source scope and relevant QA evidence. Independently review only that scope for substantive correctness, factual accuracy and security.\n- Return actionable findings, relevant questions, next actions and workspace/path issues with file/page/source references. State when no substantive findings exist.\n- For acceptance-linked behavior findings, report criterion, expected behavior, observed problem, source, reproduction conditions/steps and evidence. Separate source inference from execution observation. DO NOT run QA tests to obtain observations.\n- Outside the final plan Reviewer exception, Orchestrator routes corrections to Implementer and post-fix QA. Continue reviewing structure/design/factual/security issues execution cannot settle.\n- For significant/high-risk work, review the final full change after required QA/focused checks and QA rechecks. QA owns functional/test verification; Orchestrator owns overall completion and acceptance.\n- DO NOT run QA, plan or decide acceptance. "
90
+ "text": "- Use goal, criteria, assigned diff/source scope and relevant QA evidence. Independently review only that scope for substantive correctness, factual accuracy and security.\n- Return actionable findings, relevant questions, next actions and workspace/path issues with file/page/source references. State when no substantive findings exist.\n- For acceptance-linked behavior findings, report criterion, expected behavior, observed problem, source, reproduction conditions/steps and evidence. Separate source inference from execution observation. DO NOT run QA tests to obtain observations.\n- Outside the final plan Reviewer exception, Orchestrator routes corrections to Implementer and post-fix QA. Continue reviewing structure/design/factual/security issues execution cannot settle.\n- For significant/high-risk work, review the final full change after required QA/focused checks and QA rechecks. QA owns task functional/test verification; Orchestrator runs final verification and owns overall completion and acceptance.\n- DO NOT run QA, plan or decide acceptance. "
91
91
  },
92
92
  {
93
93
  "id": "reviewer.final-plan-findings",
94
- "text": "Final overall Reviewer findings on plan work, including behavior findings, follow Implementer → Reviewer without QA reassignment until resolved, including repeat findings. Review the latest committed/uncommitted correction diff supplied by Orchestrator. Remain read-only. Earlier QA is not post-fix verification. Preserve required QA and QA failure rechecks before this final stage."
94
+ "text": "Final overall Reviewer findings on plan work, including behavior findings, follow Implementer → Reviewer without QA reassignment until resolved, including repeat findings. Review the latest committed/uncommitted correction diff supplied by Orchestrator. Remain read-only. Earlier QA is not post-fix verification. Preserve required QA and QA failure rechecks before this final stage. New failures from final verification follow Implementer → QA; affected evidence needs a refreshed-diff recheck."
95
95
  },
96
96
  {
97
97
  "id": "scouter.research-brief",