@yunhozz/arc 0.3.2 → 0.3.4
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.
- package/MANIFEST.sha256 +105 -147
- package/README.md +3 -3
- package/claude/agents/arc-implementer.md +4 -4
- package/claude/agents/arc-planner.md +5 -5
- package/claude/agents/arc-qa.md +4 -4
- package/claude/agents/arc-reviewer.md +4 -4
- package/claude/agents/arc-scouter.md +5 -5
- package/claude/skill/SKILL.md +13 -8
- package/claude/skill/references/arc-visual-companion.md +5 -5
- package/claude/skill/references/commit.md +8 -8
- package/claude/skill/references/coordination.md +23 -21
- package/claude/skill/references/git-recovery.md +9 -4
- package/claude/skill/references/handoff-prep.md +13 -15
- package/claude/skill/references/handoff.md +22 -22
- package/claude/skill/references/limits.md +2 -2
- package/claude/skill/references/planning.md +20 -15
- package/claude/skill/references/verification.md +9 -9
- package/claude/skill/references/worktree-creation.md +14 -0
- package/codex/agents/arc-implementer.toml +4 -4
- package/codex/agents/arc-planner.toml +4 -4
- package/codex/agents/arc-qa.toml +4 -4
- package/codex/agents/arc-reviewer.toml +4 -4
- package/codex/agents/arc-scouter.toml +4 -4
- package/codex/skill/SKILL.md +12 -8
- package/codex/skill/references/arc-visual-companion.md +2 -2
- package/codex/skill/references/commit.md +8 -8
- package/codex/skill/references/coordination.md +22 -20
- package/codex/skill/references/git-recovery.md +5 -9
- package/codex/skill/references/handoff-prep.md +9 -9
- package/codex/skill/references/handoff.md +20 -20
- package/codex/skill/references/limits.md +2 -2
- package/codex/skill/references/planning.md +15 -15
- package/codex/skill/references/verification.md +10 -10
- package/codex/skill/references/worktree-creation.md +20 -0
- package/lib/installer/global-config.mjs +2 -2
- package/lib/installer/manifest.mjs +10 -9
- package/lib/installer/package-references.mjs +2 -2
- package/lib/installer/plan.mjs +3 -1
- package/lib/installer/skill-sources.mjs +23 -0
- package/lib/installer/superpowers.mjs +5 -5
- package/lib/policy/role-policy.json +10 -10
- package/lib/prompts/agent-fragments.json +16 -16
- package/lib/runtime/bootstrap.mjs +1 -1
- package/lib/runtime/local-cli.mjs +10 -20
- package/lib/runtime/role-bridge.mjs +2 -4
- package/lib/runtime/role-dispatch-policy.mjs +4 -9
- package/lib/runtime/role-routing.mjs +1 -2
- package/lib/watch/dispatch.mjs +10 -2
- package/lib/watch/git.mjs +4 -2
- package/lib/watch/index.mjs +16 -8
- package/lib/watch/model.mjs +8 -4
- package/lib/watch/normalize-claude.mjs +89 -7
- package/lib/watch/normalize-codex.mjs +15 -11
- package/lib/watch/render.mjs +73 -19
- package/lib/watch/scope.mjs +5 -5
- package/lib/watch/watcher.mjs +110 -10
- package/package.json +2 -1
- package/scripts/check-installer-parity.mjs +3 -1
- package/scripts/update-manifest.mjs +1 -1
- package/scripts/update-runtime-assets.mjs +1 -1
- package/{codex → shared}/skill/references/handoff-worktree.md +21 -20
- package/{codex → shared}/skill/runtime/bootstrap.mjs +1 -1
- package/{codex → shared}/skill/runtime/local-cli.mjs +10 -20
- package/{codex → shared}/skill/runtime/role-bridge.mjs +2 -4
- package/{claude → shared}/skill/runtime/role-dispatch-policy.mjs +4 -9
- package/{claude → shared}/skill/runtime/role-policy.json +10 -10
- package/{claude → shared}/skill/runtime/role-routing.mjs +1 -2
- package/claude/skill/runtime/bootstrap.mjs +0 -38
- package/claude/skill/runtime/local-cli.mjs +0 -248
- package/claude/skill/runtime/role-bridge.mjs +0 -227
- package/codex/skill/references/brainstorming.md +0 -316
- package/codex/skill/references/builder-check-prompt.md +0 -23
- package/codex/skill/references/scripts/frame-template.html +0 -213
- package/codex/skill/references/scripts/helper.js +0 -167
- package/codex/skill/references/scripts/server.cjs +0 -723
- package/codex/skill/references/scripts/start-server.sh +0 -216
- package/codex/skill/references/scripts/stop-server.sh +0 -120
- package/codex/skill/references/superpowers-LICENSE +0 -21
- package/codex/skill/references/superpowers-provenance.json +0 -26
- package/codex/skill/references/test-driven-development.md +0 -330
- package/codex/skill/references/visual-companion.md +0 -299
- package/codex/skill/references/writing-good-tests.md +0 -198
- package/codex/skill/references/writing-plans.md +0 -204
- package/codex/skill/runtime/acceptance.mjs +0 -68
- package/codex/skill/runtime/adapters/claude.mjs +0 -86
- package/codex/skill/runtime/adapters/codex.mjs +0 -65
- package/codex/skill/runtime/assignment.mjs +0 -42
- package/codex/skill/runtime/capabilities.mjs +0 -44
- package/codex/skill/runtime/cli.mjs +0 -8
- package/codex/skill/runtime/command.mjs +0 -38
- package/codex/skill/runtime/cooperative-schema.mjs +0 -87
- package/codex/skill/runtime/cooperative.mjs +0 -239
- package/codex/skill/runtime/evaluate.mjs +0 -331
- package/codex/skill/runtime/external.mjs +0 -51
- package/codex/skill/runtime/gate.mjs +0 -71
- package/codex/skill/runtime/git-evidence.mjs +0 -258
- package/codex/skill/runtime/git-query.mjs +0 -88
- package/codex/skill/runtime/identity.mjs +0 -49
- package/codex/skill/runtime/operations.mjs +0 -6
- package/codex/skill/runtime/role-bridge-args.mjs +0 -148
- package/codex/skill/runtime/role-dispatch-policy.mjs +0 -110
- package/codex/skill/runtime/role-dispatch-store.mjs +0 -134
- package/codex/skill/runtime/role-observe.mjs +0 -299
- package/codex/skill/runtime/role-policy.json +0 -654
- package/codex/skill/runtime/role-routing-config.mjs +0 -19
- package/codex/skill/runtime/role-routing.mjs +0 -233
- package/codex/skill/runtime/role-supervisor.mjs +0 -356
- package/codex/skill/runtime/schema.mjs +0 -98
- package/codex/skill/runtime/scope.mjs +0 -36
- package/codex/skill/runtime/store.mjs +0 -94
- package/codex/skill/runtime/target-preparation.mjs +0 -110
- package/codex/skill/runtime/verification.mjs +0 -125
- /package/{claude → shared}/skill/references/brainstorming.md +0 -0
- /package/{claude → shared}/skill/references/builder-check-prompt.md +0 -0
- /package/{claude → shared}/skill/references/scripts/frame-template.html +0 -0
- /package/{claude → shared}/skill/references/scripts/helper.js +0 -0
- /package/{claude → shared}/skill/references/scripts/server.cjs +0 -0
- /package/{claude → shared}/skill/references/scripts/start-server.sh +0 -0
- /package/{claude → shared}/skill/references/scripts/stop-server.sh +0 -0
- /package/{claude → shared}/skill/references/superpowers-LICENSE +0 -0
- /package/{claude → shared}/skill/references/superpowers-provenance.json +0 -0
- /package/{claude → shared}/skill/references/test-driven-development.md +0 -0
- /package/{claude → shared}/skill/references/visual-companion.md +0 -0
- /package/{claude → shared}/skill/references/writing-good-tests.md +0 -0
- /package/{claude → shared}/skill/references/writing-plans.md +0 -0
- /package/{claude → shared}/skill/runtime/acceptance.mjs +0 -0
- /package/{claude → shared}/skill/runtime/adapters/claude.mjs +0 -0
- /package/{claude → shared}/skill/runtime/adapters/codex.mjs +0 -0
- /package/{claude → shared}/skill/runtime/assignment.mjs +0 -0
- /package/{claude → shared}/skill/runtime/capabilities.mjs +0 -0
- /package/{claude → shared}/skill/runtime/cli.mjs +0 -0
- /package/{claude → shared}/skill/runtime/command.mjs +0 -0
- /package/{claude → shared}/skill/runtime/cooperative-schema.mjs +0 -0
- /package/{claude → shared}/skill/runtime/cooperative.mjs +0 -0
- /package/{claude → shared}/skill/runtime/evaluate.mjs +0 -0
- /package/{claude → shared}/skill/runtime/external.mjs +0 -0
- /package/{claude → shared}/skill/runtime/gate.mjs +0 -0
- /package/{claude → shared}/skill/runtime/git-evidence.mjs +0 -0
- /package/{claude → shared}/skill/runtime/git-query.mjs +0 -0
- /package/{claude → shared}/skill/runtime/identity.mjs +0 -0
- /package/{claude → shared}/skill/runtime/operations.mjs +0 -0
- /package/{claude → shared}/skill/runtime/role-bridge-args.mjs +0 -0
- /package/{claude → shared}/skill/runtime/role-dispatch-store.mjs +0 -0
- /package/{claude → shared}/skill/runtime/role-observe.mjs +0 -0
- /package/{claude → shared}/skill/runtime/role-routing-config.mjs +0 -0
- /package/{claude → shared}/skill/runtime/role-supervisor.mjs +0 -0
- /package/{claude → shared}/skill/runtime/schema.mjs +0 -0
- /package/{claude → shared}/skill/runtime/scope.mjs +0 -0
- /package/{claude → shared}/skill/runtime/store.mjs +0 -0
- /package/{claude → shared}/skill/runtime/target-preparation.mjs +0 -0
- /package/{claude → shared}/skill/runtime/verification.mjs +0 -0
|
@@ -20,11 +20,11 @@ Resume briefs preserve valid approval for unchanged scope, completed work, failu
|
|
|
20
20
|
<a id="checkout-approval"></a>
|
|
21
21
|
### Checkout approval
|
|
22
22
|
|
|
23
|
-
Before every Implementer start or restart, verify access to the supplied absolute workspace and its intended repository. Record the actual path, branch or detached HEAD, HEAD, and staged, unstaged and untracked state. An inaccessible or wrong repository or unresolved HEAD stops work;
|
|
23
|
+
Before every Implementer start or restart, verify access to the supplied absolute workspace and its intended repository. Record the actual path, branch or detached HEAD, HEAD, and staged, unstaged and untracked state. An inaccessible or wrong repository or unresolved HEAD stops work; DO NOT automatically initialize Git or switch repositories.
|
|
24
24
|
|
|
25
|
-
The first required spec/plan draft follows choice and verified source evidence and precedes actual preparation; saving follows verified preparation. Initial design
|
|
25
|
+
The first required spec/plan draft follows choice and verified source evidence and precedes actual preparation; saving follows verified preparation. Initial design MAY precede choice. Preparation alone authorizes no Implementer. All approvals/full documents/verified batch or valid absence/final Git checks remain. Separate planned scope/paths, actual preparation and drafting/save/approval/commit, recording chronology/gaps.
|
|
26
26
|
|
|
27
|
-
After initial design approval record explicit selection: current checkout, new task branch from verified base there, or managed worktree/task branch. Without choice/valid reuse, wait. Reuse through unchanged-scope/target drafting/implementation. Authorized HEAD/dirty changes alone do not invalidate choice; verify preservation/ownership. Changed scope/target requires fresh choice before dependent drafting/preparation without waiting for full documents.
|
|
27
|
+
After initial design approval record explicit selection: current checkout, new task branch from verified base there, or managed worktree/task branch. Without choice/valid reuse, wait. Reuse through unchanged-scope/target drafting/implementation. Authorized HEAD/dirty changes alone do not invalidate choice; verify preservation/ownership. Changed scope/target requires fresh choice before dependent drafting/preparation without waiting for full documents. NEVER fall back automatically.
|
|
28
28
|
|
|
29
29
|
<a id="implementer-handoff-gate"></a>
|
|
30
30
|
### Implementer handoff gate
|
|
@@ -55,7 +55,7 @@ One canonical record includes:
|
|
|
55
55
|
- Each plan task ID and current Implementer conversation ID, status, last result and reuse/replacement decision. Before same-task replacement, record the prior ID and status, allowed reason and supporting evidence; hold if the reason is not established. Record the returned ID after a successful initial or replacement call, and reconcile an uncertain call result before another assignment.
|
|
56
56
|
- Worktree source/target paths/common directory/base/branch/name/returned path/app attachment/operationId/registration/source preservation/transfer evidence. No automatic recreation/cleanup/archive.
|
|
57
57
|
|
|
58
|
-
Give all five roles the same actual workspace/selected checkout, preparation evidence and absolute artifacts. Roles stay there and report missing/inaccessible/conflicting paths/unexpected branches before dependent work,
|
|
58
|
+
Give all five roles the same actual workspace/selected checkout, preparation evidence and absolute artifacts. Roles stay there and report missing/inaccessible/conflicting paths/unexpected branches before dependent work, NEVER create/switch workspaces/branches. Tell Implementer others share the repository and unrelated work MUST be preserved.
|
|
59
59
|
|
|
60
60
|
<a id="task-readiness-at-every-assignment"></a>
|
|
61
61
|
## Task readiness at every assignment
|
|
@@ -70,15 +70,15 @@ Apply all [planning](planning.md#dependency-and-readiness-record) conditions: pr
|
|
|
70
70
|
|
|
71
71
|
Reuse only for unchanged approved scope/workspace/repository/target with accessible valid evidence. Every start/restart compares actual identity/branch/detached HEAD/HEAD/changes/preservation/ownership, approvals/artifacts, document SHA/message/paths/content or absence and final state with the brief. Reuse waives none of gates 1–7.
|
|
72
72
|
|
|
73
|
-
Unchanged-document restarts reuse valid commits/choice with fresh state checks. Accepted task/docs commits and authorized implementation/dirty changes alone invalidate no choice; record matching work/ownership/target. Authorized worktree transfers also preserve reuse. Creation base remains evidence, not a permanent target HEAD constraint; source-preservation/unexpected-state checks remain. Link plan version/task ID/commit content-validity/current Git/ownership in restart brief.
|
|
73
|
+
Unchanged-document restarts reuse valid commits/choice with fresh state checks. Accepted task/docs commits and authorized implementation/dirty changes alone invalidate no choice; record matching work/ownership/target. Authorized worktree transfers also preserve reuse. Creation base remains evidence, not a permanent target HEAD constraint; source-preservation/unexpected-state checks remain. Link plan version/task ID/commit content-validity/current Git/ownership in restart brief. NEVER duplicate successful commits or confuse task commits with document preparation; DO NOT repeat valid docs preparation.
|
|
74
74
|
|
|
75
|
-
Changed scope/workspace/repository/target/candidate needs fresh choice before dependent work. Failures invalidating target trust need new choice after resolution. Resolution alone needs none if choice remains valid. Mismatches/unresolved failures hold edits through full revalidation;
|
|
75
|
+
Changed scope/workspace/repository/target/candidate needs fresh choice before dependent work. Failures invalidating target trust need new choice after resolution. Resolution alone needs none if choice remains valid. Mismatches/unresolved failures hold edits through full revalidation; NEVER fallback.
|
|
76
76
|
|
|
77
|
-
Maintain one accessible initial canonical record, not a separate service. Resolve `git rev-parse --path-format=absolute --git-common-dir`; write `<git-common-dir>/arc/handoff/<plan-or-task-slug>.md` with scope/version/identity/evidence. Use a unique dated-plan stem or no-plan spec/task slug;
|
|
77
|
+
Maintain one accessible initial canonical record, not a separate service. Resolve `git rev-parse --path-format=absolute --git-common-dir`; write `<git-common-dir>/arc/handoff/<plan-or-task-slug>.md` with scope/version/identity/evidence. Use a unique dated-plan stem or no-plan spec/task slug; NEVER overwrite another record. It is outside working tree, shared by linked worktrees, not a Git mutation, never staged/committed, secret-free. Give every brief its absolute path; update task ID/SHA/state after accepted commits. NEVER delete automatically.
|
|
78
78
|
|
|
79
79
|
Unavailable/denied record writes require reason/full inline record in every Implementer brief, without deltas or record-file `unchanged`; inline satisfies accessibility.
|
|
80
80
|
|
|
81
|
-
Restart briefs send verified deltas and record-relative `unchanged`; fresh Implementer reads it and gets other fields fully. Include record location, next goal/ownership, changed decisions/approvals/docs/scope or no-change, current Git/differences, choice/reuse validation, refreshed commit/artifact checks, final verification/issues. Inaccessible records, missing evidence or unclear ownership block edits. Prior conversation/inaccessible links are no substitute. Revalidate revised docs/approvals/state;
|
|
81
|
+
Restart briefs send verified deltas and record-relative `unchanged`; fresh Implementer reads it and gets other fields fully. Include record location, next goal/ownership, changed decisions/approvals/docs/scope or no-change, current Git/differences, choice/reuse validation, refreshed commit/artifact checks, final verification/issues. Inaccessible records, missing evidence or unclear ownership block edits. Prior conversation/inaccessible links are no substitute. Revalidate revised docs/approvals/state; NEVER backdate pre-gate preparation.
|
|
82
82
|
|
|
83
83
|
<a id="authorization-continuity"></a>
|
|
84
84
|
## Authorization continuity
|
|
@@ -88,7 +88,7 @@ Use [planning](planning.md#authorization-and-scope), recording scope/criteria/co
|
|
|
88
88
|
<a id="common-handoff-gate"></a>
|
|
89
89
|
## Common handoff gate
|
|
90
90
|
|
|
91
|
-
Before every start/restart verify approvals/artifacts or omissions, explicit target/reuse, accessible intended repository/workspace, actual Git identity/state, preservation/ownership, docs commits or absence and no unresolved failure/partial completion. Missing/mismatched/unclear evidence blocks until resolution/full revalidation. This reference owns records/restarts/lifetime. Implementer uses self-contained guards, not mandatory Orchestrator-procedure loading. Depth 2
|
|
91
|
+
Before every start/restart verify approvals/artifacts or omissions, explicit target/reuse, accessible intended repository/workspace, actual Git identity/state, preservation/ownership, docs commits or absence and no unresolved failure/partial completion. Missing/mismatched/unclear evidence blocks until resolution/full revalidation. This reference owns records/restarts/lifetime. Implementer uses self-contained guards, not mandatory Orchestrator-procedure loading. Depth 2 NEVER creates/switches workspace/branches. Direct edits require the same.
|
|
92
92
|
Selected worktrees require common directory, registration, app-managed current-chat attachment, approved branch and source preservation through [managed preparation](handoff-worktree.md) only.
|
|
93
93
|
|
|
94
94
|
<a id="implementer-tdd-and-constraints"></a>
|
|
@@ -96,7 +96,7 @@ Selected worktrees require common directory, registration, app-managed current-c
|
|
|
96
96
|
|
|
97
97
|
Before feature/bug/behavior edits use local `test-driven-development` except explicit ARC exceptions. Full rules live in the profile. Waiver requires all low-risk and plan-skip/direct conditions, recorded scope/justification/criteria/checks before work. User/task-specific TDD overrides it; only qualifying tasks override local generic triggers without changing skills. Ordinary multistep/significant/high-risk work is ineligible.
|
|
98
98
|
|
|
99
|
-
Waiver skips RED-GREEN only, preserving focused checks/risk-scaled QA/Reviewer;
|
|
99
|
+
Waiver skips RED-GREEN only, preserving focused checks/risk-scaled QA/Reviewer; NEVER claim TDD. Follow an applicable higher-priority prohibition on adding or running tests; when precedence and scope are clear, DO NOT report a conflict on that basis or ask permission to violate it. TDD remains applicable to permitted test work. Record unperformed verification and its limits; if precedence or scope is genuinely unclear, or required verification is blocked, hold only affected work and acceptance and report the evidence. Other blocked required steps need recorded decision/required human approval, not internal substitutes. Non-behavior docs/config use specifically approved exceptions only, NEVER generalize to behavior.
|
|
100
100
|
|
|
101
101
|
<a id="orchestrator-direct-path-for-small-tasks"></a>
|
|
102
102
|
## Orchestrator direct path for small tasks
|
|
@@ -128,11 +128,11 @@ Security/permissions and public-interface changes are never eligible under the e
|
|
|
128
128
|
|
|
129
129
|
### Instruction fingerprint
|
|
130
130
|
|
|
131
|
-
Record the actual applicable source-set: platform ARC SKILL, these initial reference sections, applicable workspace instructions, and triggered references/skills; record user/platform messages by message and approval reference, not invented file hashes. Record native role profile source/version when assigned; a new role receives actual instructions, profile, needed paths and criteria, not merely a hash.
|
|
131
|
+
Record the actual applicable source-set: platform ARC SKILL, these initial reference sections, applicable workspace instructions, and triggered references/skills; record user/platform messages by message and approval reference, not invented file hashes. Record native role profile source/version when assigned; a new role receives actual instructions, profile, needed paths and criteria, not merely a hash. DO NOT assume disk profile changes updated an active role.
|
|
132
132
|
|
|
133
|
-
Distinguish user-provided instructions, workspace instructions, installed references and task inputs by source, applicability and access state: available, absent, inaccessible, conflicting or unverified. For every file record source kind, absolute and resolved path, read sections, available revision, SHA-256 of entire file bytes, access state, observation and read-context references. Neither HEAD nor installer manifest substitutes for actual installed-source hash. Use only already identified source paths;
|
|
133
|
+
Distinguish user-provided instructions, workspace instructions, installed references and task inputs by source, applicability and access state: available, absent, inaccessible, conflicting or unverified. For every file record source kind, absolute and resolved path, read sections, available revision, SHA-256 of entire file bytes, access state, observation and read-context references. Neither HEAD nor installer manifest substitutes for actual installed-source hash. Use only already identified source paths; DO NOT search or guess. An uncertain source-set makes F8 `unverified`.
|
|
134
134
|
|
|
135
|
-
Reuse read content only for the same source-set, absolute source locators, resolved paths, hashes, scope and same conversation context with meaning still available. Different absolute locators cannot be reused even if they resolve to the same path. New context, inaccessible record or context loss requires rereading; changed source/hash requires rereading and reassessing affected judgments. Verify the current source-set/hash at a new fast judgment, first-edit or assignment/restart/resumption gate, before acceptance, and on known source changes; reuse observations within the same gate. If hashing fails,
|
|
135
|
+
Reuse read content only for the same source-set, absolute source locators, resolved paths, hashes, scope and same conversation context with meaning still available. Different absolute locators cannot be reused even if they resolve to the same path. New context, inaccessible record or context loss requires rereading; changed source/hash requires rereading and reassessing affected judgments. Verify the current source-set/hash at a new fast judgment, first-edit or assignment/restart/resumption gate, before acceptance, and on known source changes; reuse observations within the same gate. If hashing fails, DO NOT reuse; follow existing read recovery and hold required inaccessible inputs. When Node is already available, batch identified absolute paths with built-in `node:fs` realpath/readFileSync and `node:crypto` SHA-256; install nothing and print no source content.
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
For identified absolute sources only, when Node is already available, this read-only example prints paths and hashes, not contents:
|
|
@@ -167,13 +167,13 @@ Evaluate target choice validity separately from evidence validity. Approved HEAD
|
|
|
167
167
|
|
|
168
168
|
Supported spec+plan handoffs include registered task contract, exact check descriptor, task/final scope, `status.changeFingerprints`, independent actor attestations, intent ID/result messageRef/verdict. Authorized roles execute after `prepare` and record through `result`; CLI records prove no identity/compliance.
|
|
169
169
|
|
|
170
|
-
On scope/docs/approval changes inspect `affectedTaskIds`/dependencies, preserve history and supply current approval/contracts.
|
|
170
|
+
On scope/docs/approval changes inspect `affectedTaskIds`/dependencies, preserve history and supply current approval/contracts. NEVER reuse checks across fingerprints. Link findings to same-version Implementer resolution/QA rechecks; only plan-final Reviewer findings use Implementer→Reviewer. No task-level Reviewer prerequisite. Detailed fields/holds follow [verification](verification.md#verification-lifecycle-in-the-cooperative-cli); unsupported omission is no policy violation/document obligation.
|
|
171
171
|
|
|
172
172
|
[ARC role policy: contract begin]
|
|
173
173
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
174
|
-
- [git.specialists-deny] Specialists MUST
|
|
175
|
-
- [role.implementer-implementation] Edit only assigned, approved files and run focused checks under the existing TDD contract. Report changed files, RED/GREEN or approved exception evidence, results, limits and follow-up.
|
|
176
|
-
- [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.
|
|
174
|
+
- [git.specialists-deny] Specialists MUST NOT change Git state during implementation or recovery: no stage, commit, push, merge, rebase, reset, branch creation/switching or worktree creation/removal. Explicit Orchestrator assignment cannot authorize these actions; return them to Orchestrator. Read-only Git inspection remains allowed within the assigned scope.
|
|
175
|
+
- [role.implementer-implementation] Edit only assigned, approved files and run focused checks under the existing TDD contract. Report changed files, RED/GREEN or approved exception evidence, results, limits and follow-up. DO NOT plan, independently QA/review your own work, accept the task or declare overall completion. Git mutations remain forbidden after successful implementation. Implementer and fresh QA handoffs include the exact approved visual source, version, approval and access state; criterion IDs, required properties and comparison method; and actual-output identity, revision and comparison basis. Record pass, mismatch or unverified with accessible evidence and limits. Implementer self-report does not replace fresh QA and its actual comparison. A missing output-to-revision link is unverified; record a visible difference separately as mismatch without inferring current branch UI state. Missing source/output, inaccessible evidence or unapproved interpretation holds the affected visual claim for Orchestrator. DO NOT silently substitute or redesign.
|
|
176
|
+
- [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.
|
|
177
177
|
- [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.
|
|
178
178
|
- [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.
|
|
179
179
|
- [platform.codex] Role restrictions are prompt-level contracts, not a filesystem sandbox. ARC supplies no native observer hook or role-specific Git guard. Existing shell capabilities are retained because static read access after shell reduction has not been verified; Implementer and QA need shell for approved checks.
|
|
@@ -182,7 +182,7 @@ Generated from lib/policy/role-policy.json; do not edit this managed section man
|
|
|
182
182
|
<a id="initial-implementer-assignment-through-the-cooperative-cli"></a>
|
|
183
183
|
## Initial Implementer assignment through the cooperative CLI
|
|
184
184
|
|
|
185
|
-
In approved plan mode all mutations pass stdin JSON through `node "$ARC_RUNTIME_ENTRY" <command> --cwd "$ARC_CHECKOUT" --workflow "$ARC_WORKFLOW_ID" --input -`. Resolve `ARC_RUNTIME_ENTRY` as `<target-home>/skills/arc/runtime/cli.mjs` from the actual installer-selected loaded skill, including custom homes, never guessed home/package/checkout/cache entries. Use separate argv for path/checkout/workflow. Safely assign/double-quote shell variables;
|
|
185
|
+
In approved plan mode all mutations pass stdin JSON through `node "$ARC_RUNTIME_ENTRY" <command> --cwd "$ARC_CHECKOUT" --workflow "$ARC_WORKFLOW_ID" --input -`. Resolve `ARC_RUNTIME_ENTRY` as `<target-home>/skills/arc/runtime/cli.mjs` from the actual installer-selected loaded skill, including custom homes, never guessed home/package/checkout/cache entries. Use separate argv for path/checkout/workflow. Safely assign/double-quote shell variables; NEVER interpolate executable paths or `eval`. Query `status` without `--input`.
|
|
186
186
|
|
|
187
187
|
Entry installation/update migrates no common-directory state or approvals. Preserve runtime/hash/target/actor/revision gates; drift holds evidence for current recovery/approval. New workflows prove no historical compliance.
|
|
188
188
|
|
|
@@ -217,9 +217,9 @@ Git OIDs are full lowercase 40/64-character hex; artifactHash is `sha256:<64-hex
|
|
|
217
217
|
|
|
218
218
|
`result`/`reconcile` accept `{requestId, expectedRevision, actor, intentId, result: {status, messageRef, data: {operation, scope, descriptor}}}`, with prepare requestId as intentId. Mismatch/unknown/stale outcomes hold while preserving attestations. After interruption inspect intent/`state.requests`/`state.audit`/`state.results` through `status` and investigate actual effects. Reconcile that same intent, not fresh preparation or replayed approvals.
|
|
219
219
|
|
|
220
|
-
Cancellation also requires `notExecutedEvidence: {messageRef}`; approval remains consumed. No automatic update/migration/renewed permission to fix drift. Report holds. Succeeded results remain attestations, not remote proof. `audit` links request→decision→intent→result→resolution but is locally editable, not tamper-proof.
|
|
220
|
+
Cancellation also requires `notExecutedEvidence: {messageRef}`; approval remains consumed. No automatic update/migration/renewed permission to fix drift. Report holds. Succeeded results remain attestations, not remote proof. `audit` links request→decision→intent→result→resolution but is locally editable, not tamper-proof. NEVER retry uncertain external outcomes.
|
|
221
221
|
|
|
222
222
|
<a id="composite-bridge-results-and-briefs"></a>
|
|
223
223
|
## Composite bridge results and briefs
|
|
224
224
|
|
|
225
|
-
For a bridge dispatch the result is the child's final message, saved at the `resultPath` returned by `run-dispatch` and `observe`; read it from there and treat it as `operator-attested` text, not as acceptance. The brief sent to `run-dispatch` or `resume` keeps the fixed brief order from [coordination](coordination.md#token-discipline-and-handoffs) and is delivered on stdin only:
|
|
225
|
+
For a bridge dispatch the result is the child's final message, saved at the `resultPath` returned by `run-dispatch` and `observe`; read it from there and treat it as `operator-attested` text, not as acceptance. The brief sent to `run-dispatch` or `resume` keeps the fixed brief order from [coordination](coordination.md#token-discipline-and-handoffs) and is delivered on stdin only: NEVER put it in argv, environment variables or a positional prompt, and keep it at most 256 KiB. For audit ARC also stores the brief in `<gitCommonDir>/arc/workflows/<workflowId>/dispatches/<dispatchId>/brief.md` (mode 0600); the child still receives it on stdin only. DO NOT include secrets or raw CLI output.
|
|
@@ -15,12 +15,12 @@ Reserve the full proposed parallel batch before dispatch, satisfying both:
|
|
|
15
15
|
1. `created + pending reservations + proposed <= max_total_subagents`
|
|
16
16
|
2. `active + pending reservations + proposed <= max_concurrent_subagents`, within actual available runtime capacity.
|
|
17
17
|
|
|
18
|
-
Reserve before each call. Confirmed creation becomes a created/active ID. Release only when failure proves no instance was created. Uncertain results retain capacity until reconciled;
|
|
18
|
+
Reserve before each call. Confirmed creation becomes a created/active ID. Release only when failure proves no instance was created. Uncertain results retain capacity until reconciled; NEVER retry blindly. Serialize batches that do not fit. No role has reserved slots.
|
|
19
19
|
|
|
20
20
|
<a id="continuation-and-exhaustion"></a>
|
|
21
21
|
## Continuation and exhaustion
|
|
22
22
|
|
|
23
|
-
Preserve the ledger across continuation, resume and compaction, and reconcile actual IDs before dispatch.
|
|
23
|
+
Preserve the ledger across continuation, resume and compaction, and reconcile actual IDs before dispatch. NEVER reset lost counters to zero. Incomplete reconstruction holds creation and reports unknown budget; use a conservative upper bound only when records support it.
|
|
24
24
|
|
|
25
25
|
Confirmed completion or termination frees active capacity. Exhaustion holds creation and reports remaining work/budget; it never waives QA/Reviewer, role freshness, approval, ownership, dependency or same-file edit gates.
|
|
26
26
|
|
|
@@ -8,7 +8,7 @@ Read before depth judgments, spec or plan drafting and approval, and first saves
|
|
|
8
8
|
|
|
9
9
|
Use the [fast gate and envelope](handoff.md#orchestrator-direct-path-for-small-tasks) alongside these existing scope and approval rules; reuse valid approvals and hold changed scope under these rules.
|
|
10
10
|
|
|
11
|
-
An explicit execution request authorizes only sufficiently specified scope from that request or a description the user explicitly references. Confirm intent/outcome/constraints/document depth/verification risk and no unresolved material behavior/method/risk decision. Record approval evidence, scope, criteria, constraints and depth. Orchestrator
|
|
11
|
+
An explicit execution request authorizes only sufficiently specified scope from that request or a description the user explicitly references. Confirm intent/outcome/constraints/document depth/verification risk and no unresolved material behavior/method/risk decision. Record approval evidence, scope, criteria, constraints and depth. Orchestrator MAY choose routine execution/check details, not unapproved product behavior/material scope. Restating/handoff/restart of unchanged scope needs no new approval.
|
|
12
12
|
|
|
13
13
|
Silence, ambiguous assent, other-work approval and vague blanket improvements are insufficient. Planner's new material choices are not automatically approved. Request missing decisions through Orchestrator. Required specs/plans retain separate ordered approval.
|
|
14
14
|
|
|
@@ -24,7 +24,7 @@ If explicitly requested probe+implementation is fully specified, classify the wh
|
|
|
24
24
|
<a id="formal-drafting-boundary"></a>
|
|
25
25
|
## Formal drafting boundary
|
|
26
26
|
|
|
27
|
-
Initial design/brainstorming
|
|
27
|
+
Initial design/brainstorming MAY precede target choice. Before the first required spec/plan draft, record verified source workspace/repository, branch/HEAD, changes/ownership, explicit choice, approved scope/depth/document set and planned relative paths. Planner returns the complete first draft and self-review in chat before target preparation. Revalidate source and selected target at the focused preparation gate, prepare the chosen target, compare actual target and preservation, then review and save in the verified prepared target. Planned paths prove no preparation. Missing or mismatched evidence holds affected work; preparation alone never starts Implementer.
|
|
28
28
|
|
|
29
29
|
Small-task direct edits follow only [handoff](handoff.md#orchestrator-direct-path-for-small-tasks), stopping/reclassifying changed scope/risk. Otherwise follow this reference. `brainstorming`/`writing-plans` instruct existing roles, not extra agents; ARC routing/approval overrides alternate executors. Missing required skills block their stage. Integration includes saving, reviewing and directly revising the same spec or plan after the complete Planner first draft; design/brainstorming retain their Planner drafting path.
|
|
30
30
|
|
|
@@ -39,9 +39,9 @@ Before Planner dispatch, evaluate F1–F8 direct-path eligibility and Bounded pl
|
|
|
39
39
|
|
|
40
40
|
1. Preflight relevant policy/references/profiles/tests/parity/manifest/conflicts. Apply formal-target and coordination provenance/input/local-skill gates, including required paths, approved bounded read alternatives and return conditions. Missing inputs/conflicts hold drafting. Read recovery grants no preparation/check/write/approval authority.
|
|
41
41
|
2. Maintain a compact ledger of original requirements/IDs, approved/open decisions, exclusions and scope deltas. Consolidate intervening user changes into one brief delta. Separate approvals, path/line-verified facts, assumptions and open decisions.
|
|
42
|
-
3.
|
|
43
|
-
4. Planner returns the complete proportional first draft and self-review. Bounded plan density follows the Planner profile's ARC adaptation (per task ID/title, goal/scope/files, predecessors, criteria and required checks; short self-review checklist), while Architectural plans keep full writing-plans.md density. Briefs carry the Read/Grep exploration budget and
|
|
44
|
-
5. For design and brainstorming, finish the checklist before one consolidated correction covering every substantive omission with criterion/defect/evidence/expected fix. Use deltas/`unchanged`;
|
|
42
|
+
3. NEVER reuse a Planner instance across stages. Within the design/brainstorming stage, reuse one Planner instance for the initial draft, its consolidated correction and any eligible further call while role, context and source remain valid; within a spec or plan stage, reuse that stage's Planner only for a budget-hold delta. After design approval, the spec stage and the plan stage each use a fresh Planner; its initial brief contains every required field plus saved document paths and approved versions, and cites a prior brief only when that brief is an accessible file. Send one complete stage-specific initial brief. Include verified source/HEAD/ownership, selected target intent and planned paths (or prepared target for later stages), and scope/exclusions/depth/dependencies/shared contracts/criteria/checks/evidence/holds. Include preceding approved versions and paths, current behavior and connected source/generated/runtime/installer/docs, policy conflicts/resolution direction and exact deliverable. Visual work includes approved sources/versions/criteria/open interpretations. Follow-up briefs send changed fields and cite an accessible prior brief for unchanged fields; inaccessible conversations or hashes alone cannot replace required inputs. Reuse evidence only for the same source set, absolute locator, resolved path, content fingerprint, purpose, approval scope and accessible context. When source, target or scope changed, reconfirm affected inputs.
|
|
43
|
+
4. Planner returns the complete proportional first draft and self-review. Bounded plan density follows the Planner profile's ARC adaptation (per task ID/title, goal/scope/files, predecessors, criteria and required checks; short self-review checklist), while Architectural plans keep full writing-plans.md density. Briefs carry the Read/Grep exploration budget and MAY set a handback size limit. A return that stops at the exploration budget with a Scouter request is an input hold, not a missing or failed first draft; resend the stage brief as a delta with the Scouter evidence to the same stage Planner. In the design stage, a resend after a return without a draft uses the consolidated-correction opportunity. Orchestrator saves and reviews it against the fixed checklist: scope/evidence; targets/ownership/paths; policy/conflicts; task boundaries/dependencies/criteria; checks/evidence/holds; roles/approval/commit boundaries; completeness. For spec or plan, Orchestrator directly revises the same document, including substantive omissions, before requesting approval. New product decisions outside approved scope require user input first; Orchestrator then revises the document. Missing or failed first drafts stop the stage and do not transfer initial authorship.
|
|
44
|
+
5. For design and brainstorming, finish the checklist before one consolidated correction covering every substantive omission with criterion/defect/evidence/expected fix. Use deltas/`unchanged`; NEVER split by omission. Further calls after correction need approved material scope/evidence changes or concrete unmet checklist items plus meaningful new input/criterion progress. State changed input/target criterion/expected artifact/progress. Existing-scope omissions need no renewed scope approval. Repeated unmet criteria without new input/evidence/progress hold the stage; report criterion/observation/exact unblock decision. DO NOT repeat resolved questions or count rewording/agent replacement as progress.
|
|
45
45
|
|
|
46
46
|
For design and brainstorming, allow initial draft and one consolidated correction. Orchestrator handles reformatting, re-expression, save and patch errors without Planner calls. Separate substantive work uses normal gates. Design/spec/plan stages remain separately ordered; spec approval precedes dependent planning. Add no fixed call cap/profile count condition or incomplete-draft acceptance.
|
|
47
47
|
|
|
@@ -51,10 +51,10 @@ For design and brainstorming, allow initial draft and one consolidated correctio
|
|
|
51
51
|
|
|
52
52
|
Record depth separately from risk. Risk controls checks/review, not design paths/plan approval. Bounded/omission is not low risk; Architectural adds no QA/Reviewer at every stage. Apply risk rules and specific obligations.
|
|
53
53
|
|
|
54
|
-
1. Before feature/design/behavior work, assign brief/evidence/local `brainstorming` to Planner. Planner proposes context/path/options/tradeoffs/criteria/assumptions/questions; Orchestrator selects path, integrates, announces scope, routes revisions and obtains approval.
|
|
54
|
+
1. Before feature/design/behavior work, assign brief/evidence/local `brainstorming` to Planner. Planner proposes context/path/options/tradeoffs/criteria/assumptions/questions; Orchestrator selects path, integrates, announces scope, routes revisions and obtains approval. NEVER run drafting skills itself. Direct path uses scope record only.
|
|
55
55
|
2. Spike distinguishes probe-only from specific combined scope. Bounded approves short design before Implementer; direct edits use approved scope record. Architectural approves design, then complete Planner spec/self-review, Orchestrator save/review and written-spec approval before planning. Planner is read-only and requests no approval.
|
|
56
56
|
3. Assess plan depth after design/spec approval and before Implementer, separately from files/LOC/Bounded label. Architectural always uses `writing-plans` and written-plan approval regardless of size/locality/risk. Bounded skips only for one local change, no dependent stages/cross-component shared state/lifecycle/integration-order concerns and one verification path. Otherwise require a plan. Labels/no-plan requests do not bypass judgment, which also records Bounded spec necessity.
|
|
57
|
-
4. Record dependencies/depth reasons. Planner returns complete plan/assumptions/open decisions/checks/self-review. Orchestrator saves/reviews/obtains approval before Implementer at user path or `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`. Default spec path is `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`.
|
|
57
|
+
4. Record dependencies/depth reasons; also post the design path, depth and risk judgments in the SKILL.md Pre-action gate record. Planner returns complete plan/assumptions/open decisions/checks/self-review. Orchestrator saves/reviews/obtains approval before Implementer at user path or `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`. Default spec path is `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`.
|
|
58
58
|
5. Every Implementer first start/restart needs applicable approvals/artifacts/brief/findings and full handoff. Non-behavior docs/config omit only inapplicable stages. Direct edits need approved scope record and same first-edit gates.
|
|
59
59
|
|
|
60
60
|
If Bounded requires written spec, record necessity/scope using approved short design as basis. Planner returns proportional full spec/self-review; After actual preparation, Orchestrator saves/reviews/obtains individual approval in the prepared target before the dependent plan. Short design approval never substitutes. This applies recorded judgment, not new spec necessity. Required plans alone imply no written spec.
|
|
@@ -66,7 +66,7 @@ For initial fast judgment apply the [fast gate](handoff.md#orchestrator-direct-p
|
|
|
66
66
|
<a id="top-level-plan-tasks"></a>
|
|
67
67
|
## Top-level plan tasks
|
|
68
68
|
|
|
69
|
-
Apply Planner rules: ID/title, goal/scope/files, predecessors/dependencies, criteria, required pre-acceptance QA/checks/evidence and holds. Tasks MUST be independently implementable/verifiable/acceptable. Inseparable policy/profile/tests/manifest contracts start in one task. If inseparability appears later, stop for revised scope/planning/approvals;
|
|
69
|
+
Apply Planner rules: ID/title, goal/scope/files, predecessors/dependencies, criteria, required pre-acceptance QA/checks/evidence and holds. Tasks MUST be independently implementable/verifiable/acceptable. Inseparable policy/profile/tests/manifest contracts start in one task. If inseparability appears later, stop for revised scope/planning/approvals; NEVER merge distinct approved tasks during execution.
|
|
70
70
|
|
|
71
71
|
Substeps/checkboxes/RED-GREEN/commands are not commits. One top-level task becomes one focused commit after acceptance; [commit](commit.md) governs no-change/hold/resume. Reviewer is never a per-task check. Final whole verification has separate scope/timing; significant work lists one Reviewer after all task acceptances/risk checks. Task boundaries alone add no QA. Apply only to required plans; omission paths gain no plan obligation.
|
|
72
72
|
|
|
@@ -91,7 +91,7 @@ Before first Architectural spec, required Bounded spec or plan save, read this a
|
|
|
91
91
|
| Spec | Approved design scope/evidence, complete Planner draft/self-review, Orchestrator integration/save/review ownership and absolute path. Required Bounded specs also need depth judgment, short design, necessity/scope |
|
|
92
92
|
| Plan | Approved design and required approved spec/version/evidence, depth judgment, plan list/dependencies, complete Planner draft/self-review, ownership and absolute path |
|
|
93
93
|
|
|
94
|
-
Saving for review does not require prior written-spec approval, but does require valid target choice/actual preparation. Individually approved specs enter the document set before dependent planning.
|
|
94
|
+
Saving for review does not require prior written-spec approval, but does require valid target choice/actual preparation. Individually approved specs enter the document set before dependent planning. NEVER call uncommitted files committed. Missing or mismatched evidence stops the affected save.
|
|
95
95
|
|
|
96
96
|
<a id="complete-planning-document-set"></a>
|
|
97
97
|
## Complete planning-document set
|
|
@@ -117,13 +117,13 @@ New planning scope requires list/depth/dependency reassessment and approvals bef
|
|
|
117
117
|
<a id="plan-updates-during-execution"></a>
|
|
118
118
|
## Plan updates during execution
|
|
119
119
|
|
|
120
|
-
Task progress records (checkboxes, notes, results, evidence and completion status) preserving the approved contract need no new approval; record classification/reason/actual time. After task completion Orchestrator includes that task's own records with its accepted implementation work in the same focused commit, excluding other tasks.
|
|
120
|
+
Task progress records (checkboxes, notes, results, evidence and completion status) preserving the approved contract need no new approval; record classification/reason/actual time. After task completion Orchestrator includes that task's own records with its accepted implementation work in the same focused commit, excluding other tasks. DO NOT amend the original planning commit or create a separate docs/fixup commit for those records. Accepted no-change tasks follow the no-change path without empty commits. Removing checks, invented success, unsupported acceptance or mixed scope changes are not mechanical.
|
|
121
121
|
|
|
122
122
|
Changes to goals, task boundaries, scope, criteria, method, risk, dependencies or checks require revised approval before affected work. Hold, obtain ordered design/spec/plan approvals and prepare target/ownership/checks/handoff. Other body corrections follow version approval; classify typos/paths/commands/explanations by semantic effect.
|
|
123
123
|
|
|
124
124
|
Spec/plan content changes other than task progress records amend the original planning commit at safe boundaries after applicable approval and preparation, never separate docs/fixup commits, including new scope. Preserve implementation commits. Rewriting does not backdate approval; latest content in an old commit proves no earlier authorization.
|
|
125
125
|
|
|
126
|
-
For non-progress content amendments, preserve absolute/Git plan paths, old/new hashes/versions, prior/revised approval refs/actual times, reason/classification, affected tasks and hold/preparation/resume evidence. Keep recoverable old/new contents, not hashes only, and old→new SHA mappings for original/descendant commits.
|
|
126
|
+
For non-progress content amendments, preserve absolute/Git plan paths, old/new hashes/versions, prior/revised approval refs/actual times, reason/classification, affected tasks and hold/preparation/resume evidence. Keep recoverable old/new contents, not hashes only, and old→new SHA mappings for original/descendant commits. NEVER overwrite old approvals/content. Task progress records retain their classification, reason and actual time as applicable; they do not trigger original-plan history mappings or amendment.
|
|
127
127
|
|
|
128
128
|
For non-progress content amendments, Orchestrator alone rewrites under [preparation](handoff-prep.md#execution-time-plan-amendment)/[commit](commit.md#execution-time-plan-document-updates). Shared/published/unknown history, merges, unclear ownership, unexpected HEAD/dirty state/replay conflicts stop work. No force push/fallback docs commit. Reconnect evidence under [verification](verification.md#evidence-after-plan-history-rewrite). Add no Git automation/runtime enforcement/authority/check exemptions.
|
|
129
129
|
|
|
@@ -132,7 +132,7 @@ For non-progress content amendments, Orchestrator alone rewrites under [preparat
|
|
|
132
132
|
|
|
133
133
|
Missing/mismatched evidence, unfinished approvals, unclear ownership or unresolved failures block affected save/choice request/Git mutation/handoff. Resolve/reverify before resume and on changed scope/version/path/target/Git state. Preserve unrelated changes; read-only investigation remains allowed.
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
NEVER retroactively call early saves/commits compliant or approved. Record actual order/gaps. Structure proves authored contracts only; absent role/approval/save/Git execution records leave runtime compliance unverified. Add no runtime infrastructure or external-skill changes for checks. Only the narrow cooperative exception below applies.
|
|
136
136
|
|
|
137
137
|
<a id="local-planning-references"></a>
|
|
138
138
|
## Local planning references
|
|
@@ -153,11 +153,11 @@ Follow [handoff-worktree](handoff-worktree.md).
|
|
|
153
153
|
[ARC role policy: contract begin]
|
|
154
154
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
155
155
|
- [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 and preserve the no-change path without empty commits. 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.
|
|
156
|
-
- [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.
|
|
156
|
+
- [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.
|
|
157
157
|
- [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.
|
|
158
158
|
- [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.
|
|
159
|
-
- [planning.plan-amend] Task progress records preserving the approved contract need no new user approval; Orchestrator includes the completed task's own records in its accepted implementation commit, without amending the original planning-document commit, creating history mappings or making a separate docs/fixup commit for them; record classification, reason and actual time as applicable. Spec/plan content changes other than task progress records require applicable approval and preparation; changes to goals, scope, criteria, method, risk, dependencies or required verification need revised-version approval and preparation before affected work. For these content changes Orchestrator MUST amend the original planning-document commit at a safe boundary;
|
|
160
|
-
- [planning.planner-brief] Follow planning.md's Planner drafting preparation and review procedure, including preflight, ledger, evidence classification, target preparation, preceding approvals, provenance and reference gates. Before Planner dispatch, evaluate F1–F8 direct-path eligibility and Bounded plan-omission eligibility independently. Enter each path only when all of that path's existing conditions are proven; if neither path qualifies, use normal full evaluation. Send one complete stage-specific initial brief. Reuse the same Planner instance only within the design/brainstorming stage while its role, context and source remain valid; after design approval, use a fresh Planner instance for each spec and plan stage, whose initial brief contains every required field, saved document paths and approved versions. Follow-up briefs send changed fields and cite an accessible prior brief for unchanged fields. Reuse evidence only for the same source set, absolute locator, resolved path, content fingerprint, purpose and approval scope in an accessible matching context. When source, target or scope changed, reconfirm affected inputs. Planner returns a complete proportional first draft and self-review. Orchestrator reviews and directly revises the same spec or plan when needed. A missing or failed first draft does not transfer initial authorship to Orchestrator. New product decisions outside approved scope require user input before Orchestrator revises the document. For design and brainstorming, allow the initial draft and one consolidated correction. Orchestrator reviews once with the fixed checklist and sends one consolidated correction using changed fields only. Further calls require user-approved material scope/evidence changes or concrete unmet checklist items after correction, plus meaningful new input or criterion-state progress. State changed input, target criterion, expected artifact and expected progress. Repeated unmet criteria without new input, evidence or progress hold the stage; report the criterion, observed evidence and exact unblock input/decision.
|
|
159
|
+
- [planning.plan-amend] Task progress records preserving the approved contract need no new user approval; Orchestrator includes the completed task's own records in its accepted implementation commit, without amending the original planning-document commit, creating history mappings or making a separate docs/fixup commit for them; record classification, reason and actual time as applicable. Spec/plan content changes other than task progress records require applicable approval and preparation; changes to goals, scope, criteria, method, risk, dependencies or required verification need revised-version approval and preparation before affected work. For these content changes Orchestrator MUST amend the original planning-document commit at a safe boundary; NEVER create a separate docs or fixup commit. For these non-progress content amendments, preserve actual approval chronology, recoverable old/new content, hashes, versions and old→new SHA mappings; NEVER authorize past work retroactively. For these amendments rewrite only unpublished, unshared local linear history with clear ownership and no merges. Unknown publication/ownership, unexpected state or replay conflicts stop rewriting; no force push or fallback document commit. Preserve implementation task boundaries and revalidate affected evidence. This obligation does not authorize amending implementation commits or rewriting history generally. Follow planning, handoff-prep, commit and verification for the full contract.
|
|
160
|
+
- [planning.planner-brief] Follow planning.md's Planner drafting preparation and review procedure, including preflight, ledger, evidence classification, target preparation, preceding approvals, provenance and reference gates. Before Planner dispatch, evaluate F1–F8 direct-path eligibility and Bounded plan-omission eligibility independently. Enter each path only when all of that path's existing conditions are proven; if neither path qualifies, use normal full evaluation. Send one complete stage-specific initial brief. Reuse the same Planner instance only within the design/brainstorming stage while its role, context and source remain valid; after design approval, use a fresh Planner instance for each spec and plan stage, whose initial brief contains every required field, saved document paths and approved versions. Follow-up briefs send changed fields and cite an accessible prior brief for unchanged fields. Reuse evidence only for the same source set, absolute locator, resolved path, content fingerprint, purpose and approval scope in an accessible matching context. When source, target or scope changed, reconfirm affected inputs. Planner returns a complete proportional first draft and self-review. Orchestrator reviews and directly revises the same spec or plan when needed. A missing or failed first draft does not transfer initial authorship to Orchestrator. New product decisions outside approved scope require user input before Orchestrator revises the document. For design and brainstorming, allow the initial draft and one consolidated correction. Orchestrator reviews once with the fixed checklist and sends one consolidated correction using changed fields only. Further calls require user-approved material scope/evidence changes or concrete unmet checklist items after correction, plus meaningful new input or criterion-state progress. State changed input, target criterion, expected artifact and expected progress. Repeated unmet criteria without new input, evidence or progress hold the stage; report the criterion, observed evidence and exact unblock input/decision. DO NOT split omissions, repeat resolved items or count rewording/agent replacement as progress. DO NOT invoke Planner only for reformatting, re-expression, save errors or patch-application errors; Orchestrator handles these. Evaluate separate substantive work under the normal Planner gate. Preserve separate sequential design/spec/plan approvals. Add no fixed call cap or profile call-count conditions, and NEVER accept an incomplete draft. Keep user progress brief and based on Planner status without relaying draft content. At approval, present the integrated, saved and reviewed Markdown without repeating its body in chat.
|
|
161
161
|
- [platform.codex] Role restrictions are prompt-level contracts, not a filesystem sandbox. ARC supplies no native observer hook or role-specific Git guard. Existing shell capabilities are retained because static read access after shell reduction has not been verified; Implementer and QA need shell for approved checks.
|
|
162
162
|
[ARC role policy: contract end]
|
|
163
163
|
|
|
@@ -34,7 +34,7 @@ Ordinary/significant tasks need fresh QA before acceptance. Low risk requires na
|
|
|
34
34
|
- QA independently checks without edits. Reviewer performs no QA/planning/editing/delegation/completion decisions. Orchestrator routes fixes to Implementer and required QA rechecks; direct-check failures return to normal flow. Accept after findings/gaps resolved or dispositioned.
|
|
35
35
|
- Fresh-per-task applies to Implementer/QA, not Reviewer. Reuse Reviewer only with independence, valid context and refreshed scope/target/evidence, never an old verdict or waived timing/coverage.
|
|
36
36
|
|
|
37
|
-
Record which risk/instruction/approved obligations each check satisfies.
|
|
37
|
+
Record which risk/instruction/approved obligations each check satisfies. DO NOT automatically assign QA/Reviewer for clear low-risk scope with sufficient evidence and no requirement. Metadata counts alone prove no significance; one permission/loss rule may. Vague file deletion is not low-risk evidence; reclassify installer/manifest impacts. Confirm cleanup targets unused, required materials intact, ignore patterns scoped and diff approved before focused-check-only acceptance.
|
|
38
38
|
|
|
39
39
|
Distinguish environment failures from code failures and report exact limits and gaps. Use Planner/Scouter only for unresolved planning/discovery. Reviewer covers substantial correctness/factual/security/data/interface risks. Orchestrator assigns support as needed. Claim only verified outputs. Read cited `references/test-driven-development.md`, preserving exceptions.
|
|
40
40
|
|
|
@@ -43,14 +43,14 @@ Distinguish environment failures from code failures and report exact limits and
|
|
|
43
43
|
|
|
44
44
|
Only final overall Reviewer findings on plan work, including behavior, follow Implementer → Reviewer without QA reassignment until resolved. One initial full review permits necessary rechecks. Before it, risk checks/QA failures/unmet criteria still need Implementer → QA. No-plan flow remains unchanged.
|
|
45
45
|
|
|
46
|
-
Expanded scope/separate obligations/gaps hold affected work for resolution/approval. Orchestrator assigns/accepts; Reviewer stays read-only without QA/acceptance.
|
|
46
|
+
Expanded scope/separate obligations/gaps hold affected work for resolution/approval. Orchestrator assigns/accepts; Reviewer stays read-only without QA/acceptance. NEVER present old QA as post-fix execution. Report actual actor/target/check/result/limits only.
|
|
47
47
|
|
|
48
48
|
<a id="evidence-after-plan-history-rewrite"></a>
|
|
49
49
|
## Evidence after plan history rewrite
|
|
50
50
|
|
|
51
51
|
Verify new HEAD/approved plan content-version/old→new SHAs, descendant implementation/task boundaries and remaining staged/unstaged/untracked state. Preserve chronology/recoverable contents. New content in old commits proves no early approval.
|
|
52
52
|
|
|
53
|
-
SHA change alone invalidates no entire evidence set. Determine whether exact-HEAD/document/policy evidence links to new state. If not or semantically affected, repeat affected checks/rechecks. Preserve runtime/exact-state rules;
|
|
53
|
+
SHA change alone invalidates no entire evidence set. Determine whether exact-HEAD/document/policy evidence links to new state. If not or semantically affected, repeat affected checks/rechecks. Preserve runtime/exact-state rules; NEVER rewrite old fingerprints to suggest execution at new HEAD. Refresh briefs/gates before dependencies. Structure proves neither live compliance nor successful replay.
|
|
54
54
|
|
|
55
55
|
<a id="task-acceptance-and-final-plan-acceptance"></a>
|
|
56
56
|
<a id="reviewer-timing-and-task-acceptance"></a>
|
|
@@ -58,7 +58,7 @@ SHA change alone invalidates no entire evidence set. Determine whether exact-HEA
|
|
|
58
58
|
|
|
59
59
|
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).
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
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.
|
|
62
62
|
|
|
63
63
|
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.
|
|
64
64
|
|
|
@@ -67,7 +67,7 @@ Committed-plan final Reviewer findings need a follow-up task/planning/approvals.
|
|
|
67
67
|
<a id="ui-browser-acceptance-checks"></a>
|
|
68
68
|
### UI browser acceptance checks
|
|
69
69
|
|
|
70
|
-
With assigned criteria/cited prerequisites, QA
|
|
70
|
+
With assigned criteria/cited prerequisites, QA MAY use available approved browser tools for apps/URLs.
|
|
71
71
|
|
|
72
72
|
Briefs MUST supply workspace, existing launch command/URL, account/test-data scope, allowed interactions and this section's accessible citation. Use existing approved environment/tool/browser-skill instructions. No source/docs/tests/config edits, dependencies or environment changes. Missing prerequisites/tools/environment leave exact reported limits/unverified criteria.
|
|
73
73
|
|
|
@@ -87,7 +87,7 @@ Accept from criterion verdicts/findings/rechecks/gaps, not overall run status. D
|
|
|
87
87
|
<a id="completion-continuity"></a>
|
|
88
88
|
## Completion continuity
|
|
89
89
|
|
|
90
|
-
Once approval/depth/target/handoff hold, continue execution/correction/reverification/required QA-Reviewer/disposition/acceptance/report. Preserve timing without new task-level gates. Reports/probes/commands never complete remaining approved scope.
|
|
90
|
+
Once approval/depth/target/handoff hold, continue execution/correction/reverification/required QA-Reviewer/disposition/acceptance/report. Preserve timing without new task-level gates. Reports/probes/commands never complete remaining approved scope. DO NOT make authorized execution an optional offer awaiting response. Probe-only ends at question/evidence/limits; combined work follows planning. Omission changes neither risk nor acceptance. Hold only actual affected conditions and report resume requirements. Structure proves no live compliance.
|
|
91
91
|
|
|
92
92
|
<a id="verification-lifecycle-in-the-cooperative-cli"></a>
|
|
93
93
|
## Verification lifecycle in the cooperative CLI
|
|
@@ -116,15 +116,15 @@ Commit preparation references `arguments: {"acceptanceId": "acceptance requestId
|
|
|
116
116
|
|
|
117
117
|
Submit intentId/`actor.role: "orchestrator"` and `result: {"status": "succeeded", "messageRef": "actual result evidence", "data": {"commit": "full OID"}}` through reconcile/result. CLI rereads local object/parent/tree/paths/HEAD/index/residual changes. Only complete match updates target HEAD/committed. Preserve failed/unknown/mismatch/history; never arbitrary target updates. Same request/completed intent permits no repeated effect. Inspect/resolve/reconcile existing intent after failure.
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
NEVER rewrite QA fingerprints after commit. Separate post-commit observations detect changes. Final review needs current task evidence/final fingerprint. RuntimeHash drift keeps existing stale/hold without automatic version update.
|
|
120
120
|
|
|
121
121
|
[ARC role policy: contract begin]
|
|
122
122
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
123
123
|
- [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 and preserve the no-change path without empty commits. 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.
|
|
124
|
-
- [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.
|
|
124
|
+
- [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.
|
|
125
125
|
- [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.
|
|
126
126
|
- [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.
|
|
127
|
-
- [planning.plan-amend] Task progress records preserving the approved contract need no new user approval; Orchestrator includes the completed task's own records in its accepted implementation commit, without amending the original planning-document commit, creating history mappings or making a separate docs/fixup commit for them; record classification, reason and actual time as applicable. Spec/plan content changes other than task progress records require applicable approval and preparation; changes to goals, scope, criteria, method, risk, dependencies or required verification need revised-version approval and preparation before affected work. For these content changes Orchestrator MUST amend the original planning-document commit at a safe boundary;
|
|
127
|
+
- [planning.plan-amend] Task progress records preserving the approved contract need no new user approval; Orchestrator includes the completed task's own records in its accepted implementation commit, without amending the original planning-document commit, creating history mappings or making a separate docs/fixup commit for them; record classification, reason and actual time as applicable. Spec/plan content changes other than task progress records require applicable approval and preparation; changes to goals, scope, criteria, method, risk, dependencies or required verification need revised-version approval and preparation before affected work. For these content changes Orchestrator MUST amend the original planning-document commit at a safe boundary; NEVER create a separate docs or fixup commit. For these non-progress content amendments, preserve actual approval chronology, recoverable old/new content, hashes, versions and old→new SHA mappings; NEVER authorize past work retroactively. For these amendments rewrite only unpublished, unshared local linear history with clear ownership and no merges. Unknown publication/ownership, unexpected state or replay conflicts stop rewriting; no force push or fallback document commit. Preserve implementation task boundaries and revalidate affected evidence. This obligation does not authorize amending implementation commits or rewriting history generally. Follow planning, handoff-prep, commit and verification for the full contract.
|
|
128
128
|
- [platform.codex] Role restrictions are prompt-level contracts, not a filesystem sandbox. ARC supplies no native observer hook or role-specific Git guard. Existing shell capabilities are retained because static read access after shell reduction has not been verified; Implementer and QA need shell for approved checks.
|
|
129
129
|
[ARC role policy: contract end]
|
|
130
130
|
|
|
@@ -150,4 +150,4 @@ Git OIDs are full lowercase 40/64-character hex; artifactHash is `sha256:<64-hex
|
|
|
150
150
|
|
|
151
151
|
`result`/`reconcile` accept `{requestId, expectedRevision, actor, intentId, result: {status, messageRef, data: {operation, scope, descriptor}}}`, with prepare requestId as intentId. Mismatch/unknown/stale outcomes hold while preserving attestations. After interruption inspect intent/`state.requests`/`state.audit`/`state.results` through `status` and investigate actual effects. Reconcile that same intent, not fresh preparation or replayed approvals.
|
|
152
152
|
|
|
153
|
-
Cancellation also requires `notExecutedEvidence: {messageRef}`; approval remains consumed. No automatic update/migration/renewed permission to fix drift. Report holds. Succeeded results remain attestations, not remote proof. `audit` links request→decision→intent→result→resolution but is locally editable, not tamper-proof.
|
|
153
|
+
Cancellation also requires `notExecutedEvidence: {messageRef}`; approval remains consumed. No automatic update/migration/renewed permission to fix drift. Report holds. Succeeded results remain attestations, not remote proof. `audit` links request→decision→intent→result→resolution but is locally editable, not tamper-proof. NEVER retry uncertain external outcomes.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<a id="codex-managed-worktree-creation"></a>
|
|
2
|
+
# Codex managed worktree creation
|
|
3
|
+
|
|
4
|
+
Use this procedure only under the [managed-worktree handoff contract](handoff-worktree.md) after explicit new-managed-worktree selection. The app chooses the actual path; DO NOT propose siblings or require user-specified paths.
|
|
5
|
+
|
|
6
|
+
Use only the app tool:
|
|
7
|
+
|
|
8
|
+
mcp__codex_app__create_worktree({
|
|
9
|
+
allowAsync: true,
|
|
10
|
+
name: "<approved-descriptive-name>",
|
|
11
|
+
ref: "<verified-source-head-full-sha>"
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
The descriptive name does not guarantee a path or branch. There are no destination-path/branch arguments. Pass full SHA `ref` explicitly; NEVER omit or rely on remote defaults. For `operationId`, use `mcp__codex_app__get_worktree_creation_status` until completed. Preparing/creating/registering is not success.
|
|
15
|
+
|
|
16
|
+
Only registration failure permits reattachment of the returned workspace with `mcp__codex_app__attach_worktree`. Missing tools, failed reattachment or mismatched results stop with actual-state reporting. No raw Git worktree fallback, alternate name/ref/path/branch retries or automatic cleanup/deletion/prune/archive.
|
|
17
|
+
|
|
18
|
+
Platform attachment evidence for Codex means app-artifact management/current-chat attachment of the returned absolute path. Verify that evidence in the creation checks required by handoff-worktree. The tool copies no uncommitted changes.
|
|
19
|
+
|
|
20
|
+
For failure evidence, include tool inputs/operationId/results/returned path and app management/current-chat attachment. Preserve completion/attach-retry/no-fallback limits. Recheck completion/current-chat attachment after attach retry; failure or unverifiable results stop with actual-state reporting. Directory existence does not prove app management.
|
|
@@ -39,5 +39,5 @@ export function renderWaitSettings(original){
|
|
|
39
39
|
return{content:Buffer.from(updated),action:'set ARC wait settings'};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export function agentsBlockBody(home,userHome,language='en',platform='codex'){const skill=home+'/skills/arc/SKILL.md',within=skill.startsWith(userHome+'/'),shown=within?'~/'+skill.slice(userHome.length+1):skill;return '- '+languagePolicy(language)+'\n'+'- For requests requiring substantive multi-step research, analysis, or implementation, configuration, or test work, and for design, spec, plan, and brainstorming requests (these are NOT standalone document writing), load and follow `'+shown+'`; keep following it in relevant follow-up turns of the same chat without re-reading it unless it changed.'+(within?" Resolve `~` to the current user's home directory.":'')+' ARC subagents (depth 2) follow their role profile and brief instead and
|
|
43
|
-
'- For repository implementation, configuration, or test work, Orchestrator owns coordination and acceptance; assign file edits and other work to the other roles according to their defined responsibilities. Orchestrator
|
|
42
|
+
export function agentsBlockBody(home,userHome,language='en',platform='codex'){const skill=home+'/skills/arc/SKILL.md',within=skill.startsWith(userHome+'/'),shown=within?'~/'+skill.slice(userHome.length+1):skill;return '- '+languagePolicy(language)+'\n'+'- For requests requiring substantive multi-step research, analysis, or implementation, configuration, or test work, and for design, spec, plan, and brainstorming requests (these are NOT standalone document writing), load and follow `'+shown+'`; keep following it in relevant follow-up turns of the same chat without re-reading it unless it changed.'+(within?" Resolve `~` to the current user's home directory.":'')+' ARC subagents (depth 2) follow their role profile and brief instead and DO NOT load `SKILL.md`.\n'+'- Design and brainstorming drafts and first complete spec and plan drafts are authored only by the Planner; route drafting skills to the Planner. Orchestrator reviews and directly revises the same spec or plan when needed; a missing or failed first draft does not transfer initial authorship. New product decisions outside approved scope require user input first.\n'+
|
|
43
|
+
'- For repository implementation, configuration, or test work, Orchestrator owns coordination and acceptance; assign file edits and other work to the other roles according to their defined responsibilities. Orchestrator MUST NOT edit implementation, configuration, or test-code files directly, except under the ARC Orchestrator direct path for small, low-risk tasks.\n';}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {validateAgentTemplates} from '../prompts/render.mjs';
|
|
2
2
|
import {COOPERATIVE_RUNTIME_MODULES} from '../runtime/bootstrap.mjs';
|
|
3
3
|
import {RUNTIME_MODULE_PATHS} from './runtime-assets.mjs';
|
|
4
|
+
import {composeSkillSources} from './skill-sources.mjs';
|
|
4
5
|
import {POLICY_TARGETS,buildPolicyOutputs} from '../policy/render.mjs';
|
|
5
|
-
import {validateFlatReferenceFiles
|
|
6
|
+
import {validateFlatReferenceFiles} from './superpowers.mjs';
|
|
6
7
|
import path from 'node:path';import crypto from 'node:crypto';import{loadModelConfig,resolveModelSettings,renderProfiles}from '../models/index.mjs';import{readCheckedFile,typeOf,sameIdentity,metadataOf}from './targets.mjs';
|
|
7
8
|
export class PayloadValidationError extends Error{constructor(message,options){super(message,options);this.name='PayloadValidationError';this.code='ARC_PAYLOAD_VALIDATION';}}
|
|
8
9
|
const MUTABLE=new Set(['codex/skill/models.toml','claude/skill/models.toml']);
|
|
9
10
|
export const LOCAL_UPDATER_PATH='scripts/update-superpowers-local.sh';
|
|
10
|
-
const ROOTS=['bin','lib','scripts','vendor','prebuilds','codex/skill','codex/agents','claude/skill','claude/agents'];
|
|
11
|
+
const ROOTS=['bin','lib','scripts','vendor','prebuilds','shared/skill','codex/skill','codex/agents','claude/skill','claude/agents'];
|
|
11
12
|
const FIXED=['README.md','install.command','package.json','native/binding.c','native/binding.gyp'];
|
|
12
13
|
function safeName(name){return typeof name==='string'&&name.length>0&&!name.includes('\\')&&!name.includes('\0')&&!name.startsWith('/')&&name.split('/').every(p=>p&&p!=='.'&&p!=='..')&&path.posix.normalize(name)===name;}
|
|
13
14
|
function allowed(name){return FIXED.includes(name)||ROOTS.some(root=>name.startsWith(root+'/'));}
|
|
@@ -27,7 +28,7 @@ export function verifyPayload({packageRoot,safeFs,payloadMode='auto'}){
|
|
|
27
28
|
let root;try{
|
|
28
29
|
root=safeFs.openRoot(packageRoot);const source=sourcePayload(root,payloadMode),manifest=readCheckedFile(root,'MANIFEST.sha256').bytes;let text;try{text=new TextDecoder('utf-8',{fatal:true}).decode(manifest);}catch{throw Error('Manifest is not UTF-8');}
|
|
29
30
|
const listed=new Map();for(const line of text.split(/\r?\n/)){if(!line)continue;const m=/^([a-fA-F0-9]{64}) (.+)$/.exec(line);if(!m||!safeName(m[2]))throw Error('Malformed or escaping manifest path');const name=m[2];if(MUTABLE.has(name)||name===LOCAL_UPDATER_PATH||!allowed(name)||name.split('/').includes('.DS_Store')||listed.has(name))throw Error(`Duplicate, mutable or unexpected manifest entry: ${name}`);listed.set(name,m[1].toLowerCase());}
|
|
30
|
-
const files=new Map(),snapshot=new Map()
|
|
31
|
+
const files=new Map(),snapshot=new Map();
|
|
31
32
|
function walk(directory,prefix){const before=directory.stat();for(const name of directory.readDir()){
|
|
32
33
|
const relative=prefix?prefix+'/'+name:name;const stat=directory.lstat(name),type=typeOf(stat);
|
|
33
34
|
if(relative===LOCAL_UPDATER_PATH){if(!source)throw Error('Local updater wrapper is forbidden in package payload');if(type!==0o100000||!sameIdentity(stat,directory.lstat(name)))throw Error('Local updater wrapper must be a stable regular file');continue;}
|
|
@@ -38,14 +39,14 @@ export function verifyPayload({packageRoot,safeFs,payloadMode='auto'}){
|
|
|
38
39
|
}if(!sameIdentity(before,directory.stat()))throw Error('Payload directory changed while reading');}
|
|
39
40
|
function select(relative,isTree){const parts=relative.split('/');let parent=root;const opened=[];try{for(const component of parts.slice(0,-1)){let st;try{st=parent.lstat(component);}catch(e){if(e.code==='ENOENT')return;throw e;}if(typeOf(st)!==0o040000)throw Error('Unsafe payload parent');const next=parent.openDir(component);if(!sameIdentity(st,next.stat())){next.close();throw Error('Payload parent changed');}opened.push(next);parent=next;}const name=parts.at(-1);let st;try{st=parent.lstat(name);}catch(e){if(e.code==='ENOENT')return;throw e;}if(isTree){if(typeOf(st)!==0o040000)throw Error('Payload root is not a directory');const sub=parent.openDir(name);try{if(!sameIdentity(st,sub.stat()))throw Error('Payload root changed');snapshot.set(relative,{...metadataOf(st),type:'directory'});walk(sub,relative);}finally{sub.close();}}else{if(typeOf(st)!==0o100000)throw Error('Payload file is not regular');const item=readCheckedFile(parent,name,st);if(!listed.has(relative)||crypto.createHash('sha256').update(item.bytes).digest('hex')!==listed.get(relative))throw Error(`Missing entry or hash mismatch: ${relative}`);files.set(relative,item.bytes);snapshot.set(relative,item.metadata);}}finally{for(const h of opened.reverse())h.close();}}
|
|
40
41
|
for(const item of FIXED)select(item,false);for(const item of ROOTS)select(item,true);
|
|
41
|
-
for(const platform of ['codex','claude'])
|
|
42
|
-
|
|
42
|
+
for(const platform of ['codex','claude'])composeSkillSources(files,platform);
|
|
43
|
+
const referenceTree=validateFlatReferenceFiles(files);
|
|
43
44
|
for(const name of listed.keys())if(!files.has(name))throw Error(`Manifest entry is missing: ${name}`);
|
|
44
45
|
const required=['lib/prompts/agent-fragments.json','lib/prompts/render.mjs','lib/policy/role-policy.json','lib/policy/render.mjs','scripts/update-role-policy.mjs','lib/limits.mjs','lib/installer/limits.mjs','lib/installer/runtime-config.mjs','README.md','install.command','package.json','bin/arc.mjs','lib/cli/root.mjs','lib/tui/app.mjs','lib/tui/terminal.mjs','lib/tui/render.mjs','lib/tui/setup.mjs','lib/management/operations.mjs','lib/management/status.mjs','lib/management/update.mjs','lib/management/workflow.mjs','lib/cli/postinstall.mjs','scripts/postinstall.mjs','lib/cli/upgrade.mjs','bin/arc-upgrade.mjs','lib/installer/shell-completion.mjs','lib/installer/manifest.mjs','lib/installer/targets.mjs','lib/installer/global-config.mjs','lib/installer/plan.mjs','lib/safe-fs/index.mjs','lib/safe-fs/native.mjs','lib/models/index.mjs','lib/models/config.mjs','lib/models/profiles.mjs','vendor/toml/LICENSE','vendor/toml/package.json','vendor/toml/provenance.json','vendor/toml/dist/index.js','prebuilds/index.json'];
|
|
45
|
-
required.push('lib/installer/runtime-assets.mjs',...RUNTIME_MODULE_PATHS);
|
|
46
|
-
|
|
46
|
+
required.push('lib/installer/skill-sources.mjs','lib/installer/runtime-assets.mjs',...RUNTIME_MODULE_PATHS);
|
|
47
|
+
required.push('shared/skill/runtime/role-policy.json',...RUNTIME_MODULE_PATHS.map(name=>`shared/skill/runtime/${name.slice('lib/runtime/'.length)}`));
|
|
47
48
|
for(const tuple of ['darwin-arm64','darwin-x64','linux-arm64-gnu','linux-x64-gnu'])required.push(`prebuilds/${tuple}/arc_safe_fs.node`);
|
|
48
|
-
for(const
|
|
49
|
+
for(const name of [...COOPERATIVE_RUNTIME_MODULES,'role-policy.json'])required.push(`shared/skill/runtime/${name}`);
|
|
49
50
|
const modelInputs={};for(const platform of ['codex','claude']){const base=`${platform}/skill`;required.push(`${base}/SKILL.md`,`${base}/models.toml`,`${base}/references/limits.md`);const profiles=new Map();for(const role of ['scouter','planner','implementer','qa','reviewer']){const name=`arc-${role}.${platform==='codex'?'toml':'md'}`,key=`${platform}/agents/${name}`;required.push(key);profiles.set(name,files.get(key));}modelInputs[platform]={models:files.get(`${base}/models.toml`),profiles};}
|
|
50
51
|
for(const name of required)if(!files.has(name))throw Error(`Required runtime asset is missing: ${name}`);
|
|
51
52
|
const agentRegistry=JSON.parse(files.get('lib/prompts/agent-fragments.json').toString('utf8'));
|
|
@@ -56,6 +57,6 @@ export function verifyPayload({packageRoot,safeFs,payloadMode='auto'}){
|
|
|
56
57
|
for(const [name,bytes] of policyOutputs)if(!bytes.equals(files.get(name)))throw Error(`Stale role policy output: ${name}`);
|
|
57
58
|
const vendor=JSON.parse(files.get('vendor/toml/provenance.json'));for(const name of Object.keys(vendor.files??{}))if(!safeName(name)||!files.has('vendor/toml/'+name))throw Error('Vendored runtime asset is missing');
|
|
58
59
|
for(const platform of ['codex','claude']){const input=modelInputs[platform];const config=loadModelConfig(input.models,platform);renderProfiles(input.profiles,resolveModelSettings(config));modelInputs[platform]={models:Buffer.from(input.models),profiles:new Map([...input.profiles].map(([k,v])=>[k,Buffer.from(v)]))};}
|
|
59
|
-
return{packageRoot,files,modelInputs,agentRegistry,snapshot,
|
|
60
|
+
return{packageRoot,files,modelInputs,agentRegistry,snapshot,referenceTree};
|
|
60
61
|
}catch(cause){throw new PayloadValidationError(`Payload verification failed: ${cause.message}`,{cause});}finally{root?.close();}
|
|
61
62
|
}
|
|
@@ -11,7 +11,7 @@ import {applyTransaction} from './transaction.mjs';
|
|
|
11
11
|
|
|
12
12
|
export async function refreshPackageReferences({packageRoot,safeFs,acquisition,signal,hooks={}}){
|
|
13
13
|
if(!safeFs){const native=loadNative({root:packageRoot});safeFs={openRoot:p=>openRoot(p,{native})};}
|
|
14
|
-
const payload=verifyPayload({packageRoot,safeFs,payloadMode:'source'}),paths=
|
|
14
|
+
const payload=verifyPayload({packageRoot,safeFs,payloadMode:'source'}),paths=REFERENCE_PATH_MAP.map(({destination})=>path.join(packageRoot,'shared/skill/references',destination));
|
|
15
15
|
paths.push(path.join(packageRoot,'MANIFEST.sha256'));
|
|
16
16
|
const snapshot=new Map([...payload.snapshot].map(([name,item])=>[path.join(packageRoot,name),item]));
|
|
17
17
|
for(const name of ['MANIFEST.sha256','package-lock.json'])inspectPath(safeFs,path.join(packageRoot,name),{kind:'file',snapshot});
|
|
@@ -24,7 +24,7 @@ export async function refreshPackageReferences({packageRoot,safeFs,acquisition,s
|
|
|
24
24
|
const dispose=acquired.dispose;acquired.dispose=async()=>{await dispose();fs.rmdirSync(work);};
|
|
25
25
|
}
|
|
26
26
|
const flat=flattenReferenceBundle(acquired.references),candidate=new Map(payload.files),specs=[];
|
|
27
|
-
for(const
|
|
27
|
+
for(const[destination,entry]of flat){const name='shared/skill/references/'+destination;candidate.set(name,entry.bytes);specs.push({path:path.join(packageRoot,name),bytes:entry.bytes});}
|
|
28
28
|
specs.push({path:path.join(packageRoot,'MANIFEST.sha256'),bytes:renderManifest(candidate)});
|
|
29
29
|
const plan={target:{home:packageRoot},managedPaths:paths,externalPaths:[],snapshot};
|
|
30
30
|
const result=applyTransaction(plan,{safeFs,signal,hooks,specs});
|
package/lib/installer/plan.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {inspectStandaloneProfile} from './install-mode.mjs';
|
|
2
2
|
import {renderAgentProfile} from '../prompts/render.mjs';
|
|
3
3
|
import {PayloadValidationError} from './manifest.mjs';
|
|
4
|
+
import {composeSkillSources} from './skill-sources.mjs';
|
|
4
5
|
import{parseLanguage,serializeLanguage,renderLanguagePolicy,validateLanguage}from'./language.mjs';
|
|
5
6
|
import{resolveLimits}from'../limits.mjs';import{parseLimits,serializeLimits}from'./limits.mjs';import{readRuntimeConcurrency,renderCodexConcurrency,renderClaudeConcurrency}from'./runtime-config.mjs';import{assertPlanSnapshot}from'./transaction.mjs';
|
|
6
7
|
import{validateModelConfig}from'../models/config.mjs';
|
|
@@ -29,7 +30,8 @@ function renderModelAssets({payload,target,roles,modelConfig,language,verifiedCa
|
|
|
29
30
|
}
|
|
30
31
|
export function renderStandaloneProfiles({payload,target,modelConfig,language}){return renderModelAssets({payload,target,modelConfig,language}).profiles;}
|
|
31
32
|
function renderSkillPayload({payload,target,language,modelBytes,limits}){
|
|
32
|
-
|
|
33
|
+
let skill;try{skill=composeSkillSources(payload.files,target.platform);}catch(cause){throw new PayloadValidationError(`Payload skill composition failed: ${cause.message}`,{cause});}
|
|
34
|
+
skill.set('SKILL.md',renderLanguagePolicy(skill.get('SKILL.md'),language));skill.set('settings.toml',serializeLanguage(language));skill.set('models.toml',modelBytes);skill.set('limits.toml',serializeLimits(limits));
|
|
33
35
|
return skill;
|
|
34
36
|
}
|
|
35
37
|
function renderNativeChanges({target,safeFs,snapshot,skipGlobal,preview,concurrentExplicit,limits,summary,language}){
|