@yunhozz/arc 0.0.0-stage → 0.1.1
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 +96 -0
- package/README.md +61 -2
- package/bin/arc.mjs +3 -0
- package/claude/agents/arc-coder.md +67 -0
- package/claude/agents/arc-planner.md +74 -0
- package/claude/agents/arc-qa.md +68 -0
- package/claude/agents/arc-reviewer.md +65 -0
- package/claude/agents/arc-scouter.md +63 -0
- package/claude/skill/SKILL.md +370 -0
- package/claude/skill/hooks/git-policy.json +208 -0
- package/claude/skill/hooks/role-git-guard.mjs +98 -0
- package/claude/skill/models.toml +64 -0
- package/claude/skill/references/commit.md +77 -0
- package/claude/skill/references/git-recovery.md +46 -0
- package/claude/skill/references/handoff-prep.md +102 -0
- package/claude/skill/references/handoff.md +100 -0
- package/claude/skill/references/limits.md +42 -0
- package/claude/skill/references/planning.md +250 -0
- package/claude/skill/references/superpowers/LICENSE +21 -0
- package/claude/skill/references/superpowers/brainstorming/SKILL.md +225 -0
- package/claude/skill/references/superpowers/brainstorming/builder-check-prompt.md +23 -0
- package/claude/skill/references/superpowers/brainstorming/scripts/frame-template.html +213 -0
- package/claude/skill/references/superpowers/brainstorming/scripts/helper.js +167 -0
- package/claude/skill/references/superpowers/brainstorming/scripts/server.cjs +723 -0
- package/claude/skill/references/superpowers/brainstorming/scripts/start-server.sh +209 -0
- package/claude/skill/references/superpowers/brainstorming/scripts/stop-server.sh +120 -0
- package/claude/skill/references/superpowers/brainstorming/visual-companion.md +299 -0
- package/claude/skill/references/superpowers/provenance.json +26 -0
- package/claude/skill/references/superpowers/test-driven-development/SKILL.md +330 -0
- package/claude/skill/references/superpowers/test-driven-development/writing-good-tests.md +198 -0
- package/claude/skill/references/superpowers/writing-plans/SKILL.md +204 -0
- package/claude/skill/references/verification.md +125 -0
- package/claude/skill/references/visual-companion.md +16 -0
- package/claude/skill/scripts/apply-models.py +31 -0
- package/claude/skill/scripts/model_config.py +211 -0
- package/codex/agents/arc-coder.toml +37 -0
- package/codex/agents/arc-planner.toml +38 -0
- package/codex/agents/arc-qa.toml +24 -0
- package/codex/agents/arc-reviewer.toml +25 -0
- package/codex/agents/arc-scouter.toml +37 -0
- package/codex/skill/SKILL.md +356 -0
- package/codex/skill/models.toml +64 -0
- package/codex/skill/references/commit.md +100 -0
- package/codex/skill/references/git-recovery.md +64 -0
- package/codex/skill/references/handoff-prep.md +153 -0
- package/codex/skill/references/handoff-worktree.md +93 -0
- package/codex/skill/references/handoff.md +181 -0
- package/codex/skill/references/limits.md +43 -0
- package/codex/skill/references/planning.md +287 -0
- package/codex/skill/references/superpowers/LICENSE +21 -0
- package/codex/skill/references/superpowers/brainstorming/SKILL.md +225 -0
- package/codex/skill/references/superpowers/brainstorming/builder-check-prompt.md +23 -0
- package/codex/skill/references/superpowers/brainstorming/scripts/frame-template.html +213 -0
- package/codex/skill/references/superpowers/brainstorming/scripts/helper.js +167 -0
- package/codex/skill/references/superpowers/brainstorming/scripts/server.cjs +723 -0
- package/codex/skill/references/superpowers/brainstorming/scripts/start-server.sh +209 -0
- package/codex/skill/references/superpowers/brainstorming/scripts/stop-server.sh +120 -0
- package/codex/skill/references/superpowers/brainstorming/visual-companion.md +299 -0
- package/codex/skill/references/superpowers/provenance.json +26 -0
- package/codex/skill/references/superpowers/test-driven-development/SKILL.md +330 -0
- package/codex/skill/references/superpowers/test-driven-development/writing-good-tests.md +198 -0
- package/codex/skill/references/superpowers/writing-plans/SKILL.md +204 -0
- package/codex/skill/references/verification.md +163 -0
- package/codex/skill/references/visual-companion.md +23 -0
- package/codex/skill/scripts/apply-models.py +207 -0
- package/codex/skill/scripts/model_config.py +362 -0
- package/install.command +5 -0
- package/lib/cli/choices.mjs +47 -0
- package/lib/cli/completion.mjs +53 -0
- package/lib/cli/index.mjs +55 -0
- package/lib/cli/preset.mjs +29 -0
- package/lib/cli/progress.mjs +10 -0
- package/lib/cli/root.mjs +20 -0
- package/lib/cli/uninstall.mjs +17 -0
- package/lib/installer/acquisition.mjs +77 -0
- package/lib/installer/global-config.mjs +43 -0
- package/lib/installer/install.mjs +28 -0
- package/lib/installer/language.mjs +13 -0
- package/lib/installer/limits.mjs +21 -0
- package/lib/installer/manifest.mjs +37 -0
- package/lib/installer/package-references.mjs +32 -0
- package/lib/installer/plan.mjs +62 -0
- package/lib/installer/preset.mjs +26 -0
- package/lib/installer/runtime-config.mjs +85 -0
- package/lib/installer/shell-completion.mjs +29 -0
- package/lib/installer/stage-cleanup.mjs +40 -0
- package/lib/installer/superpowers.mjs +113 -0
- package/lib/installer/targets.mjs +55 -0
- package/lib/installer/transaction.mjs +91 -0
- package/lib/installer/uninstall.mjs +32 -0
- package/lib/limits.mjs +13 -0
- package/lib/models/config.mjs +58 -0
- package/lib/models/index.mjs +2 -0
- package/lib/models/profiles.mjs +111 -0
- package/lib/policy/claude-hook.mjs +40 -0
- package/lib/policy/render.mjs +74 -0
- package/lib/policy/role-policy.json +577 -0
- package/lib/safe-fs/index.mjs +67 -0
- package/lib/safe-fs/native.mjs +54 -0
- package/native/binding.c +157 -0
- package/native/binding.gyp +1 -0
- package/package.json +43 -4
- package/prebuilds/darwin-arm64/arc_safe_fs.node +0 -0
- package/prebuilds/darwin-x64/arc_safe_fs.node +0 -0
- package/prebuilds/index.json +64 -0
- package/prebuilds/linux-arm64-gnu/arc_safe_fs.node +0 -0
- package/prebuilds/linux-x64-gnu/arc_safe_fs.node +0 -0
- package/scripts/build-native.mjs +36 -0
- package/scripts/check-installer-parity.mjs +59 -0
- package/scripts/update-manifest.mjs +28 -0
- package/scripts/update-role-policy.mjs +15 -0
- package/scripts/update-superpowers.mjs +4 -0
- package/scripts/vendor-toml.mjs +40 -0
- package/vendor/toml/LICENSE +24 -0
- package/vendor/toml/dist/date.js +156 -0
- package/vendor/toml/dist/error.js +67 -0
- package/vendor/toml/dist/extract.js +293 -0
- package/vendor/toml/dist/index.js +34 -0
- package/vendor/toml/dist/parse.js +164 -0
- package/vendor/toml/dist/primitive.js +151 -0
- package/vendor/toml/dist/stringify.js +219 -0
- package/vendor/toml/dist/struct.js +156 -0
- package/vendor/toml/dist/util.js +57 -0
- package/vendor/toml/package.json +6 -0
- package/vendor/toml/provenance.json +35 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-plans
|
|
3
|
+
description: Use when you have a spec or requirements for a multi-step task, before touching code
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writing Plans
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Write implementation plans for an engineer who has not seen this codebase or this spec. Assume they write idiomatic code in the project's language once they know the exact interface and the exact test, and that they will make a reasonable choice wherever the plan leaves one open. What they cannot know is what you decided: which files, which names and signatures, which values from the spec, which tests prove each task. Document those. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
|
|
11
|
+
|
|
12
|
+
**Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
|
|
13
|
+
|
|
14
|
+
**Context:** If working in an isolated worktree, it should have been created via the `superpowers:using-git-worktrees` skill at execution time.
|
|
15
|
+
|
|
16
|
+
**Save plans to:** `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`
|
|
17
|
+
- (User preferences for plan location override this default)
|
|
18
|
+
|
|
19
|
+
## Scope Check
|
|
20
|
+
|
|
21
|
+
If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
|
|
22
|
+
|
|
23
|
+
## File Structure
|
|
24
|
+
|
|
25
|
+
Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
|
|
26
|
+
|
|
27
|
+
- Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
|
|
28
|
+
- You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
|
|
29
|
+
- Files that change together should live together. Split by responsibility, not by technical layer.
|
|
30
|
+
- In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
|
|
31
|
+
|
|
32
|
+
This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
|
|
33
|
+
|
|
34
|
+
## Task Right-Sizing
|
|
35
|
+
|
|
36
|
+
A task is the smallest unit that carries its own test cycle and is worth a
|
|
37
|
+
fresh reviewer's gate. When drawing task boundaries: fold setup,
|
|
38
|
+
configuration, scaffolding, and documentation steps into the task whose
|
|
39
|
+
deliverable needs them; split only where a reviewer could meaningfully
|
|
40
|
+
reject one task while approving its neighbor. Each task ends with an
|
|
41
|
+
independently testable deliverable.
|
|
42
|
+
|
|
43
|
+
## Step Granularity
|
|
44
|
+
|
|
45
|
+
**Each step is one action with a checkable result:**
|
|
46
|
+
- "Write the failing test" - step
|
|
47
|
+
- "Run it to make sure it fails" - step
|
|
48
|
+
- "Implement the minimal code to make the test pass" - step
|
|
49
|
+
- "Run the tests and make sure they pass" - step
|
|
50
|
+
- "Commit" - step
|
|
51
|
+
|
|
52
|
+
## Plan Document Header
|
|
53
|
+
|
|
54
|
+
**Every plan MUST start with this header:**
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
# [Feature Name] Implementation Plan
|
|
58
|
+
|
|
59
|
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
60
|
+
|
|
61
|
+
**Goal:** [One sentence describing what this builds]
|
|
62
|
+
|
|
63
|
+
**Architecture:** [2-3 sentences about approach]
|
|
64
|
+
|
|
65
|
+
**Tech Stack:** [Key technologies/libraries]
|
|
66
|
+
|
|
67
|
+
**Spec:** [path to the spec/design doc this plan implements — the plan
|
|
68
|
+
argues from the spec, so the spec travels with it; executors read both]
|
|
69
|
+
|
|
70
|
+
## Global Constraints
|
|
71
|
+
|
|
72
|
+
[The spec's project-wide requirements — version floors, dependency limits,
|
|
73
|
+
naming and copy rules, platform requirements — one line each, with exact
|
|
74
|
+
values copied verbatim from the spec. Every task's requirements implicitly
|
|
75
|
+
include this section.]
|
|
76
|
+
|
|
77
|
+
## Review Focus
|
|
78
|
+
|
|
79
|
+
[The five input classes or failure modes the spec implies but no task's
|
|
80
|
+
tests exercise that are most likely to bite a person using this software
|
|
81
|
+
— one line each, naming the input or condition and the behavior a
|
|
82
|
+
reasonable person would expect, most likely first. The spec is a vision
|
|
83
|
+
document: it says what the software must do, not everything it will
|
|
84
|
+
meet, and its silence on an input is not permission for that input to
|
|
85
|
+
break the program. Write the list here, once, with the spec in front of
|
|
86
|
+
you. Then, for each line, add the test that pins it to the task that
|
|
87
|
+
owns the code, in that task's own step style.]
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Task Structure
|
|
93
|
+
|
|
94
|
+
````markdown
|
|
95
|
+
### Task N: [Component Name]
|
|
96
|
+
|
|
97
|
+
**Files:**
|
|
98
|
+
- Create: `exact/path/to/file.py`
|
|
99
|
+
- Modify: `exact/path/to/existing.py:123-145`
|
|
100
|
+
- Test: `tests/exact/path/to/test.py`
|
|
101
|
+
|
|
102
|
+
**Interfaces:**
|
|
103
|
+
- Consumes: [what this task uses from earlier tasks — exact signatures]
|
|
104
|
+
- Produces: [what later tasks rely on — exact function names, parameter
|
|
105
|
+
and return types. A task's implementer sees only their own task; this
|
|
106
|
+
block is how they learn the names and types neighboring tasks use.]
|
|
107
|
+
|
|
108
|
+
- [ ] **Step 1: Write the failing test**
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
def test_specific_behavior():
|
|
112
|
+
result = function(input)
|
|
113
|
+
assert result == expected
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- [ ] **Step 2: Run test to verify it fails**
|
|
117
|
+
|
|
118
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
119
|
+
Expected: FAIL with "function not defined"
|
|
120
|
+
|
|
121
|
+
- [ ] **Step 3: Implement `function(input: InputType) -> ResultType` in `exact/path/to/file.py`**
|
|
122
|
+
|
|
123
|
+
One line on the approach when the signature and the test leave a choice
|
|
124
|
+
(which library call, which data structure); a code block only for an
|
|
125
|
+
algorithm they do not determine.
|
|
126
|
+
|
|
127
|
+
- [ ] **Step 4: Run test to verify it passes**
|
|
128
|
+
|
|
129
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
130
|
+
Expected: PASS
|
|
131
|
+
|
|
132
|
+
- [ ] **Step 5: Commit**
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
git add tests/path/test.py src/path/file.py
|
|
136
|
+
git commit -m "feat: add specific feature"
|
|
137
|
+
```
|
|
138
|
+
````
|
|
139
|
+
|
|
140
|
+
## What a Step Contains
|
|
141
|
+
|
|
142
|
+
A step is done when the implementer can write exactly one reasonable thing
|
|
143
|
+
from it. That is the whole requirement: unambiguous, not complete. Each kind
|
|
144
|
+
of step carries what makes it unambiguous and nothing more:
|
|
145
|
+
|
|
146
|
+
- **A test step:** the test's name and its assertions, as code, with the
|
|
147
|
+
spec's exact values in them.
|
|
148
|
+
- **A code step:** the exact signature (name, parameters, return type), the
|
|
149
|
+
file it lives in, and the specific values the spec pins. The implementer
|
|
150
|
+
writes the body. A body appears only for an algorithm the signature and
|
|
151
|
+
tests do not determine, or for exact copy the spec fixes.
|
|
152
|
+
- **A verification step:** the command to run and the output that means it
|
|
153
|
+
passed.
|
|
154
|
+
- **A reference to another task:** that task's Interfaces block says what
|
|
155
|
+
to use; the plan does not repeat that task's code.
|
|
156
|
+
|
|
157
|
+
A plan is the set of decisions the implementer cannot make alone. A plan
|
|
158
|
+
longer than the code it describes has written the code instead. Lines that
|
|
159
|
+
decide nothing ("TBD", "handle edge cases", "add appropriate validation",
|
|
160
|
+
"write tests for the above", a type or function no task defines) are the
|
|
161
|
+
opposite failure, and the self-review catches both.
|
|
162
|
+
|
|
163
|
+
## Self-Review
|
|
164
|
+
|
|
165
|
+
After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
|
|
166
|
+
|
|
167
|
+
**1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
|
|
168
|
+
|
|
169
|
+
**2. Step scan:** Every step must let the implementer write exactly one reasonable thing, and no step may carry more than that: a line that decides nothing is a gap, a function body the signature and tests already determine is a transcript. Fix both.
|
|
170
|
+
|
|
171
|
+
**3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clearLayers()` in Task 3 but `clearFullLayers()` in Task 7 is a bug.
|
|
172
|
+
|
|
173
|
+
**4. Review Focus:** For each input class or failure mode the spec implies, is there a task whose tests exercise it? The five uncovered ones most likely to bite a person go in the Review Focus section, and each line there gets its test added to the owning task. An empty section means you checked and found none, not that you skipped the check.
|
|
174
|
+
|
|
175
|
+
**5. Proportion:** Compare the plan's length to the spec's. A plan several times longer than the spec it implements is a transcript of the program, not a plan. If code blocks are most of the document, replace bodies with signatures, test names and assertions, and check that each step is still unambiguous.
|
|
176
|
+
|
|
177
|
+
If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
|
|
178
|
+
|
|
179
|
+
## Execution Handoff
|
|
180
|
+
|
|
181
|
+
After saving and self-reviewing the plan, link it for your human partner
|
|
182
|
+
to read. If they have already explicitly supplied an execution method, ask
|
|
183
|
+
them to review the plan and confirm it captures what they want; wait for that
|
|
184
|
+
review before implementation, then use the preserved method. Otherwise, ask
|
|
185
|
+
them to review the plan and choose an execution method before implementation.
|
|
186
|
+
|
|
187
|
+
**When no execution method has already been supplied:**
|
|
188
|
+
|
|
189
|
+
**"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Please review the plan. Which execution approach would you prefer?**
|
|
190
|
+
|
|
191
|
+
- **Subagent-driven** - A fresh subagent implements each task and a fresh reviewer checks it before the next one starts, then a whole-branch review at the end. Most thorough; costs a fresh context per task and per review.
|
|
192
|
+
- **Native** - I implement every task myself in this session, the way this harness runs work, then one fresh reviewer on the most capable model checks the whole branch. Cheapest and fastest; no independent review until the end. Runs well with a mid-tier session model, since the plan carries the design.
|
|
193
|
+
|
|
194
|
+
**For this plan I recommend <one of the two>, because <one sentence from the plan: how much the tasks depend on each other's interfaces, how many there are, what a shipped mistake would cost>. Does the plan capture what you want, and which approach should we use?"**
|
|
195
|
+
|
|
196
|
+
**When an execution method has already been supplied:**
|
|
197
|
+
|
|
198
|
+
**"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Please review the plan. Does it capture what you want?"**
|
|
199
|
+
|
|
200
|
+
**If Subagent-driven chosen:**
|
|
201
|
+
- **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development
|
|
202
|
+
|
|
203
|
+
**If Native chosen:**
|
|
204
|
+
- **REQUIRED SUB-SKILL:** Use superpowers:executing-plans
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Verification contract
|
|
2
|
+
|
|
3
|
+
Orchestrator reads before verification design, QA/Reviewer assignment, correction rechecks, or UI acceptance checks.
|
|
4
|
+
QA and
|
|
5
|
+
Reviewer contracts are in their profiles; they read this file only for sections the brief explicitly cites.
|
|
6
|
+
Visual companion design discussion is distinct from QA UI acceptance.
|
|
7
|
+
|
|
8
|
+
## Risk-scaled execution
|
|
9
|
+
|
|
10
|
+
SKILL.md Risk-scaled execution holds the risk table, risk definitions, evidence-reuse rule, and role order,
|
|
11
|
+
including Reviewer timing. Product/test edits belong exclusively to Coder except under the Orchestrator direct path;
|
|
12
|
+
Orchestrator may inspect/run checks but
|
|
13
|
+
routes code corrections to Coder. Determine the minimum
|
|
14
|
+
flow from risk and any specific instruction or approved commitment, and record which requirements each check or review
|
|
15
|
+
satisfies. For small, low-risk work with clear scope and acceptance evidence and no such requirement,
|
|
16
|
+
Orchestrator's focused
|
|
17
|
+
checks suffice; do not call QA or Reviewer automatically. Significant/high-risk work requires independent review of the
|
|
18
|
+
full change at the final relevant state after the required QA/focused checks and any QA recheck.
|
|
19
|
+
|
|
20
|
+
Many known metadata files are not significant solely because there are many, and a one-file permission or data-loss
|
|
21
|
+
rule may be. A vague request to delete unnecessary files does not establish low risk; reclassify when installer,
|
|
22
|
+
manifest, or other contracts are affected. For a verified ignore-pattern or metadata cleanup, confirm the targets are
|
|
23
|
+
unused, required project materials are unaffected, ignore patterns cover only intended paths, and the diff matches the
|
|
24
|
+
approved scope; Orchestrator's focused checks then suffice without automatically calling QA or Reviewer.
|
|
25
|
+
An environment failure
|
|
26
|
+
is distinct from a code failure; report the exact limitation and any remaining evidence gap to Orchestrator.
|
|
27
|
+
|
|
28
|
+
Use additional Planner/Scouter only for unresolved planning/discovery questions. Reviewer covers substantial changes and
|
|
29
|
+
correctness, factual, security, data, or interface risks. Orchestrator may use Planner/Scouter/Reviewer when justified
|
|
30
|
+
and assigns
|
|
31
|
+
all Coder/QA work. Specialists report unresolved questions to Orchestrator, who assigns support only when needed.
|
|
32
|
+
|
|
33
|
+
QA runs applicable existing functional/test checks, or approved structural/consistency checks for policy and
|
|
34
|
+
configuration changes. Reviewer reads the assigned diff/source for correctness, factual accuracy, and security. Outside the final plan Reviewer correction exception, after a
|
|
35
|
+
behavior fix QA reruns affected checks, and Reviewer rechecks only when warranted. Reuse a Reviewer only when
|
|
36
|
+
independent of the work and self-review and when evidence meets required scope and freshness.
|
|
37
|
+
Resolve or explicitly disposition findings and confirm
|
|
38
|
+
acceptance evidence before completion; claim checks only with verified output.
|
|
39
|
+
|
|
40
|
+
## Task acceptance and final plan acceptance
|
|
41
|
+
|
|
42
|
+
Task-local acceptance is distinct from overall final plan verification and acceptance. Orchestrator connects each task's
|
|
43
|
+
acceptance criteria to actual evidence, currently required checks and findings before accepting it; checkbox
|
|
44
|
+
completion, a Coder report or passing commands alone do not establish acceptance.
|
|
45
|
+
|
|
46
|
+
Task acceptance and its focused commit require only the task's risk-scaled evidence: a FRESH QA instance per task that
|
|
47
|
+
needs QA (same-task rechecks may reuse), or Orchestrator focused checks for small, low-risk tasks;
|
|
48
|
+
Reviewer timing and task-boundary gates follow SKILL.md Risk-scaled execution. For an independently acceptable task,
|
|
49
|
+
do not delay its acceptance/commit solely for later final plan verification. Currently required task checks must not
|
|
50
|
+
be deferred to final verification to accept early. State the scope and timing of final-only integration criteria in
|
|
51
|
+
the plan; with a plan, the required final whole-change review is final plan verification.
|
|
52
|
+
|
|
53
|
+
A task commit record does not mark unperformed final verification complete. Orchestrator still decides final plan
|
|
54
|
+
acceptance
|
|
55
|
+
using final QA/Reviewer/integration evidence and findings, preserving unverified scope and explicit dispositions.
|
|
56
|
+
Valid evidence may cover both task and plan requirements only under the existing scope/state/independence/freshness/flow
|
|
57
|
+
rules. For final Reviewer findings on already committed plan work, Orchestrator defines a follow-up task and required
|
|
58
|
+
planning/approvals. Coder leaves corrections uncommitted during rechecks. Orchestrator refreshes the latest committed
|
|
59
|
+
state plus uncommitted diff and changed-file list in the Reviewer artifact/brief. Reuse an independent Reviewer or
|
|
60
|
+
assign another independent Reviewer as needed. Repeat Coder → Reviewer without QA reassignment until findings are
|
|
61
|
+
resolved; Orchestrator then accepts the corrections and creates one focused follow-up commit.
|
|
62
|
+
Final QA findings retain Coder correction and QA recheck before a new focused commit.
|
|
63
|
+
Do not automatically amend/reset or duplicate the original task commit. Scope expansion keeps existing new
|
|
64
|
+
planning and approval obligations.
|
|
65
|
+
|
|
66
|
+
### UI browser acceptance checks
|
|
67
|
+
|
|
68
|
+
Only when assigned UI acceptance criteria and the brief supplies the workspace, existing launch command or URL,
|
|
69
|
+
required account and test-data scope, and permitted interactions, QA may use the existing approved test environment
|
|
70
|
+
to launch the app or open the URL with available approved browser tools. Follow tool instructions and any applicable
|
|
71
|
+
installed browser skill. This permission does not authorize source/document/test/configuration editing, installing
|
|
72
|
+
dependencies, or changing environment configuration. Report missing prerequisites to Orchestrator and leave affected
|
|
73
|
+
criteria
|
|
74
|
+
unverified. For each criterion record the command or URL, test state and viewport (or not applicable),
|
|
75
|
+
interaction steps,
|
|
76
|
+
expected and observed results, and accessible evidence. App startup, page load, and static checks alone do not prove
|
|
77
|
+
complete UI behavior. For unavailable test environment or browser tools, report the exact limitation and affected
|
|
78
|
+
unverified criteria. Clean up only QA-created processes and sessions; preserve existing shared services and sessions.
|
|
79
|
+
When assigning UI acceptance criteria, Orchestrator cites this section with its accessible path in the QA brief.
|
|
80
|
+
|
|
81
|
+
### Criterion evidence and finding handoff
|
|
82
|
+
|
|
83
|
+
QA reports every acceptance criterion from the brief by identifier, or original wording when no identifier exists.
|
|
84
|
+
Each criterion records method and scope, run status, accessible evidence, criterion verdict, and unverified reason
|
|
85
|
+
and remaining scope. Run status is passed, failed, not run, or environment blocked; criterion verdict is proven,
|
|
86
|
+
unmet, or unverified. Passing a check alone does not prove a criterion: evidence must connect its conditions and
|
|
87
|
+
expected result to actual observations. Preserve partial confirmation and out-of-scope, missing-check, or environment
|
|
88
|
+
blocked gaps as unverified; omit no criteria. PASS, if used, means only run status and cannot replace criterion
|
|
89
|
+
verdicts.
|
|
90
|
+
Structural checks prove structural criteria only; they do not prove actual behavior, installation, or live agent runtime
|
|
91
|
+
compliance.
|
|
92
|
+
|
|
93
|
+
For QA execution failure or an unmet criterion, Orchestrator assigns Coder correction and obtains a QA recheck before
|
|
94
|
+
Reviewer.
|
|
95
|
+
Do not enter Reviewer until QA reports the finding as resolved, unresolved, or unverified with evidence; unresolved
|
|
96
|
+
execution failures or unmet criteria require correction and another QA recheck before that stage. QA rechecks the defect
|
|
97
|
+
reproduction path and related checks invalidated by the fix. Environment blocks, missing checks, and out-of-scope
|
|
98
|
+
criteria
|
|
99
|
+
are evidence gaps, not presumed code defects; Orchestrator handles those gaps under the existing disposition policy
|
|
100
|
+
without
|
|
101
|
+
substituting Reviewer review for QA evidence.
|
|
102
|
+
|
|
103
|
+
For an acceptance-linked behavior finding, Reviewer reports the criterion, expected behavior, observed problem, related
|
|
104
|
+
source, reproduction conditions and steps, and evidence to Orchestrator, distinguishing source-inferred reproduction
|
|
105
|
+
from
|
|
106
|
+
execution-observed results without running QA tests. Outside the final plan Reviewer correction exception, Orchestrator routes it to Coder correction and QA post-fix recheck.
|
|
107
|
+
Outside that exception, for significant/high-risk work, Reviewer then reviews the final full change once after QA recheck (the same Reviewer
|
|
108
|
+
rechecks the same scope after a fix), or, for already committed
|
|
109
|
+
plan work, rechecks only the affected findings when warranted. Reviewer continues handling
|
|
110
|
+
structure, design, factual, and security findings that execution checks cannot settle; observable security/interface
|
|
111
|
+
issues may require both QA verification and Reviewer source review.
|
|
112
|
+
|
|
113
|
+
Orchestrator accepts using criterion verdicts, findings, recheck evidence, and remaining gaps, rather than an overall
|
|
114
|
+
run result.
|
|
115
|
+
Explicit disposition does not convert unverified to proven; completion reports preserve remaining unverified scope.
|
|
116
|
+
For low-risk work without a QA agent, Orchestrator's focused checks likewise
|
|
117
|
+
connect each criterion to evidence.
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
Read brief-cited `references/superpowers/test-driven-development/SKILL.md`; retain ARC exceptions.
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
### Final plan Reviewer correction loop
|
|
124
|
+
|
|
125
|
+
For a plan's final overall Reviewer findings, including behavior findings, Orchestrator assigns
|
|
126
|
+
Coder → Reviewer recheck with no QA reassignment. Repeat corrections and Reviewer rechecks until findings are resolved;
|
|
127
|
+
the initial single full review does not prohibit necessary rechecks. Before the initial final overall Reviewer,
|
|
128
|
+
risk-required checks and QA execution failures or unmet criteria still require Coder correction → QA recheck.
|
|
129
|
+
This exception applies only to findings from the final overall Reviewer of work with a plan.
|
|
130
|
+
Work without a plan retains its existing verification flow. Scope expansion, separate mandatory obligations,
|
|
131
|
+
or unresolved evidence gaps hold affected work for Orchestrator to resolve and obtain required approvals.
|
|
132
|
+
Orchestrator assigns corrections/rechecks and decides acceptance. Reviewer remains read-only, must not run QA
|
|
133
|
+
checks or decide acceptance. Previous QA evidence must not be presented as post-fix execution evidence;
|
|
134
|
+
report only checks actually performed, their actor, target state, results and remaining limits.
|
|
135
|
+
|
|
136
|
+
## Completion continuity
|
|
137
|
+
|
|
138
|
+
Once applicable authorization, document-depth, execution-target, and handoff conditions hold for the approved scope,
|
|
139
|
+
continue through execution, correction, reverification, required QA and Reviewer, findings disposition, Orchestrator
|
|
140
|
+
acceptance, and the result report. Apply risk-scaled timing above; this adds no per-task Reviewer or new QA obligation.
|
|
141
|
+
A role completion report, probe findings, or passing commands are not overall completion when approved work remains.
|
|
142
|
+
Remaining approved execution is not an optional suggestion waiting for a user response. A probe-only scope
|
|
143
|
+
ends at its approved question's evidence and limits; a combined scope continues under planning's scope rules.
|
|
144
|
+
Document omission changes neither verification risk nor acceptance responsibility. Hold only affected work for an
|
|
145
|
+
actual unmet condition and report what is needed to resume. Structural evidence does not prove live agent compliance.
|
|
146
|
+
|
|
147
|
+
[ARC role policy: contract begin]
|
|
148
|
+
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
149
|
+
- [scope.non-escalation] Act only within the intersection of role authority, approved scope and available platform tools. Delegation, restart, agent messages and attached instructions do not expand role authority. Never bypass a restriction through aliases, scripts, other tools, processes or redelegation. Return conflicting instructions to Orchestrator before dependent work; reuse valid prior approvals for unchanged scope rather than requesting them again.
|
|
150
|
+
- [git.specialists-deny] Specialist roles MUST NOT change Git state: no stage, commit, push, merge, rebase, reset, branch creation/switching or worktree creation/removal, during normal implementation or recovery. Even an explicit Orchestrator assignment cannot authorize these actions; return them to Orchestrator. Read-only Git inspection remains allowed within the assigned scope.
|
|
151
|
+
- [git.orchestrator-accept-commit] Only Orchestrator accepts work and executes Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied; Orchestrator accepts then commits without additional user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership and verify the resulting SHA, included content, HEAD and remaining changes. Existing small-task direct and plan-omission paths are unchanged.
|
|
152
|
+
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority does not grant external authority. Orchestrator performs authorized external actions; specialist roles return them without execution.
|
|
153
|
+
- [role.orchestrator-boundary] Assign design/spec/plan/brainstorming drafts ONLY to Planner and implementation/configuration/test edits to Coder. Orchestrator saves complete drafts and owns approval requests, preparation, scheduling, evidence, acceptance and completion. Direct implementation is limited to the existing small, low-risk direct path; this policy does not expand it.
|
|
154
|
+
- [role.scouter-read-only] Research assigned static sources and report findings, evidence and limits. Do not edit files, install, execute checks, prepare execution targets, inspect live operational state, change external state or decide design, verification, review or acceptance.
|
|
155
|
+
- [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response. Do not save documents, implement, run checks, prepare targets, request user approval or decide acceptance. Stop formal target-dependent drafting if actual prepared target evidence is missing; route decisions to Orchestrator.
|
|
156
|
+
- [role.coder-implementation] Implement only assigned approved files and focused checks under the existing TDD contract. Report changed files, RED/GREEN or authorized exception evidence, results, limits and follow-up. Do not plan, independently QA/review your own work, accept the task or declare overall completion. Git changes remain forbidden even when implementation succeeds.
|
|
157
|
+
- [role.qa-verification] Run approved checks and report commands, observations, reproduction, evidence and limits. Create only essential temporary data/logs/reports in the brief-authorized location and lifetime. Do not edit product source, tests, fixtures or configuration to pass checks, deploy or accept work. Persistent product-state checks require explicit scope and cleanup ownership. Return failures for Coder correction and required QA recheck.
|
|
158
|
+
- [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only; do not execute QA tests, edit files, perform Git mutations or decide acceptance.
|
|
159
|
+
- [review.significant-no-plan] For significant/high-risk work without a plan: Coder → QA and required QA rechecks → Reviewer of the final full change → Orchestrator acceptance. Do not omit Reviewer merely because no plan exists. This creates no new plan obligation.
|
|
160
|
+
- [review.significant-plan] For significant/high-risk plan work: each task uses Coder → fresh QA as required → Orchestrator acceptance and focused commit. 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 required gate. Preserve required checks and necessary finding rechecks.
|
|
161
|
+
- [review.final-plan-recheck] For final overall Reviewer findings on plan work, including behavior findings, use Coder → Reviewer without QA reassignment; repeat until resolved. This exception applies only to that final plan stage. Preserve required QA and QA failure rechecks before initial final review and outside this exception.
|
|
162
|
+
- [platform.codex] Role restrictions are prompt-level contracts, not a filesystem sandbox. No documented role-specific Git hook or generic per-agent tool allowlist is assumed. Existing shell capabilities are retained because static read access after shell reduction has not been verified; Coder and QA need shell for approved checks.
|
|
163
|
+
[ARC role policy: contract end]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Visual companion contract
|
|
2
|
+
|
|
3
|
+
Read before offering or operating a visual companion.
|
|
4
|
+
|
|
5
|
+
## Visual companion
|
|
6
|
+
|
|
7
|
+
Visual companion design discussion is distinct from QA UI acceptance checks under the approved test brief.
|
|
8
|
+
|
|
9
|
+
Planner identifies a genuinely visual question, why a visual helps, options, the user decision, and a complete content
|
|
10
|
+
draft; Planner does not write screens, start a server, operate a browser, or request approval.
|
|
11
|
+
Orchestrator makes a just-in-time
|
|
12
|
+
offer as its own message only when a question is clearer visually, then waits for acceptance. If declined, continue in
|
|
13
|
+
text and do not offer again unless the user raises it. If accepted, decide per question whether to use the companion.
|
|
14
|
+
Orchestrator owns its guide, server/browser, workspace paths, live-session checks, complete keyed URL, screens,
|
|
15
|
+
session state,
|
|
16
|
+
feedback/events, stale-screen clearing when returning to text, and cleanup. Check the server before showing a screen;
|
|
17
|
+
after the user's reply, treat terminal text as primary and events as supplemental. A UI topic or accepted companion
|
|
18
|
+
alone does not route every question through a browser.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
Upstream guide/scripts: `<installed ARC>/references/superpowers/brainstorming/visual-companion.md` and adjacent `scripts/`.
|
|
22
|
+
ARC guide: `references/visual-companion.md`; Orchestrator briefs absolute paths and retains approval/server/browser
|
|
23
|
+
ownership. Missing files stop dependent work without global fallback.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Apply the bundled model settings to installed Codex agent profiles."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import importlib.util
|
|
8
|
+
import os
|
|
9
|
+
import stat
|
|
10
|
+
import sys
|
|
11
|
+
import tempfile
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from types import ModuleType
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ValidationError(Exception):
|
|
17
|
+
"""An invalid settings file, profile, or target path."""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def load_model_module() -> ModuleType:
|
|
21
|
+
"""Load the shared implementation from this script's resolved directory."""
|
|
22
|
+
module_path = Path(__file__).resolve().with_name("model_config.py")
|
|
23
|
+
try:
|
|
24
|
+
spec = importlib.util.spec_from_file_location("_arc_model_config", module_path)
|
|
25
|
+
if spec is None or spec.loader is None:
|
|
26
|
+
raise ValidationError(f"cannot load shared model configuration module: {module_path}")
|
|
27
|
+
module = importlib.util.module_from_spec(spec)
|
|
28
|
+
sys.modules[spec.name] = module
|
|
29
|
+
write_bytecode = sys.dont_write_bytecode
|
|
30
|
+
sys.dont_write_bytecode = True
|
|
31
|
+
try:
|
|
32
|
+
try:
|
|
33
|
+
spec.loader.exec_module(module)
|
|
34
|
+
except Exception:
|
|
35
|
+
sys.modules.pop(spec.name, None)
|
|
36
|
+
raise
|
|
37
|
+
finally:
|
|
38
|
+
sys.dont_write_bytecode = write_bytecode
|
|
39
|
+
except ValidationError:
|
|
40
|
+
raise
|
|
41
|
+
except Exception as exc:
|
|
42
|
+
raise ValidationError(f"cannot load shared model configuration module at {module_path}: {exc}") from exc
|
|
43
|
+
return module
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _regular_path_info(path: Path, label: str = "profile") -> tuple[Path, os.stat_result]:
|
|
47
|
+
"""Check every path component without following symlinks."""
|
|
48
|
+
expanded = path.expanduser()
|
|
49
|
+
absolute = expanded if expanded.is_absolute() else Path.cwd() / expanded
|
|
50
|
+
parts = absolute.parts
|
|
51
|
+
current = Path(absolute.anchor)
|
|
52
|
+
info: os.stat_result | None = None
|
|
53
|
+
for index, part in enumerate(parts[1:]):
|
|
54
|
+
if part in ("", "."):
|
|
55
|
+
continue
|
|
56
|
+
current = current / part
|
|
57
|
+
try:
|
|
58
|
+
info = current.lstat()
|
|
59
|
+
except OSError as exc:
|
|
60
|
+
raise ValidationError(f"cannot inspect {label} path {current}: {exc}") from exc
|
|
61
|
+
if stat.S_ISLNK(info.st_mode):
|
|
62
|
+
raise ValidationError(f"{label} path contains a symlink: {current}")
|
|
63
|
+
if index < len(parts[1:]) - 1 and not stat.S_ISDIR(info.st_mode):
|
|
64
|
+
raise ValidationError(f"{label} path component is not a directory: {current}")
|
|
65
|
+
if info is None or not stat.S_ISREG(info.st_mode):
|
|
66
|
+
raise ValidationError(f"{label} must be a regular file: {absolute}")
|
|
67
|
+
return absolute, info
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def read_profile_safely(path: Path) -> bytes:
|
|
71
|
+
"""Read one regular profile after rejecting symlink path components."""
|
|
72
|
+
absolute, _ = _regular_path_info(path)
|
|
73
|
+
try:
|
|
74
|
+
return absolute.read_bytes()
|
|
75
|
+
except OSError as exc:
|
|
76
|
+
raise ValidationError(f"cannot read profile {absolute}: {exc}") from exc
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def resolve_agents_dir(explicit: Path | None) -> Path:
|
|
80
|
+
if explicit is not None:
|
|
81
|
+
return explicit.expanduser()
|
|
82
|
+
codex_home = os.environ.get("CODEX_HOME")
|
|
83
|
+
if codex_home is not None:
|
|
84
|
+
if not codex_home.strip():
|
|
85
|
+
raise ValidationError("CODEX_HOME must not be empty")
|
|
86
|
+
return Path(codex_home).expanduser() / "agents"
|
|
87
|
+
return Path.home() / ".codex" / "agents"
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _load_settings(model_config: ModuleType, config_path: Path) -> dict:
|
|
91
|
+
settings_path, _ = _regular_path_info(config_path, "settings")
|
|
92
|
+
try:
|
|
93
|
+
return model_config.load_settings(settings_path)
|
|
94
|
+
except model_config.ValidationError as exc:
|
|
95
|
+
raise ValidationError(str(exc)) from exc
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def prepare_updates(config_path: Path, agents_dir: Path) -> dict[Path, tuple[bytes, bytes, int]]:
|
|
99
|
+
model_config = load_model_module()
|
|
100
|
+
settings = _load_settings(model_config, config_path)
|
|
101
|
+
updates: dict[Path, tuple[bytes, bytes, int]] = {}
|
|
102
|
+
# Read, parse, and render every profile before the caller can write any file.
|
|
103
|
+
for role, filename in model_config.ROLE_FILES.items():
|
|
104
|
+
path = agents_dir / filename
|
|
105
|
+
original = read_profile_safely(path)
|
|
106
|
+
try:
|
|
107
|
+
updated = model_config.render_profile(original, role, settings[role], path)
|
|
108
|
+
except model_config.ValidationError as exc:
|
|
109
|
+
raise ValidationError(str(exc)) from exc
|
|
110
|
+
_, info = _regular_path_info(path)
|
|
111
|
+
if original != updated:
|
|
112
|
+
updates[path] = (original, updated, info.st_mode)
|
|
113
|
+
return updates
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def stage_file(directory: Path, target: Path, content: bytes, mode: int) -> Path:
|
|
117
|
+
descriptor, temporary_name = tempfile.mkstemp(prefix=f".{target.name}.", suffix=".tmp", dir=directory)
|
|
118
|
+
temporary = Path(temporary_name)
|
|
119
|
+
try:
|
|
120
|
+
os.fchmod(descriptor, stat.S_IMODE(mode))
|
|
121
|
+
with os.fdopen(descriptor, "wb") as handle:
|
|
122
|
+
handle.write(content)
|
|
123
|
+
handle.flush()
|
|
124
|
+
os.fsync(handle.fileno())
|
|
125
|
+
except BaseException:
|
|
126
|
+
try:
|
|
127
|
+
os.close(descriptor)
|
|
128
|
+
except OSError:
|
|
129
|
+
pass
|
|
130
|
+
temporary.unlink(missing_ok=True)
|
|
131
|
+
raise
|
|
132
|
+
return temporary
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def apply_updates(updates: dict[Path, tuple[bytes, bytes, int]]) -> None:
|
|
136
|
+
staged_new: dict[Path, Path] = {}
|
|
137
|
+
staged_old: dict[Path, Path] = {}
|
|
138
|
+
replaced: list[Path] = []
|
|
139
|
+
try:
|
|
140
|
+
for path, (original, updated, mode) in updates.items():
|
|
141
|
+
staged_new[path] = stage_file(path.parent, path, updated, mode)
|
|
142
|
+
staged_old[path] = stage_file(path.parent, path, original, mode)
|
|
143
|
+
for path in updates:
|
|
144
|
+
os.replace(staged_new[path], path)
|
|
145
|
+
replaced.append(path)
|
|
146
|
+
except OSError as exc:
|
|
147
|
+
rollback_errors = []
|
|
148
|
+
for path in reversed(replaced):
|
|
149
|
+
try:
|
|
150
|
+
os.replace(staged_old[path], path)
|
|
151
|
+
except OSError as rollback_exc:
|
|
152
|
+
rollback_errors.append(f"{path}: {rollback_exc}")
|
|
153
|
+
detail = f"failed to update profiles: {exc}"
|
|
154
|
+
if rollback_errors:
|
|
155
|
+
detail += "; rollback errors: " + "; ".join(rollback_errors)
|
|
156
|
+
raise ValidationError(detail) from exc
|
|
157
|
+
finally:
|
|
158
|
+
for temporary in (*staged_new.values(), *staged_old.values()):
|
|
159
|
+
temporary.unlink(missing_ok=True)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
163
|
+
default_config = Path(__file__).resolve().parent.parent / "models.toml"
|
|
164
|
+
parser = argparse.ArgumentParser(description="Validate and apply ARC model settings to Codex agent profiles.")
|
|
165
|
+
parser.add_argument("--config", type=Path, default=default_config, help=f"TOML settings file (default: {default_config})")
|
|
166
|
+
parser.add_argument("--agents-dir", type=Path, help="Codex agent profile directory")
|
|
167
|
+
action = parser.add_mutually_exclusive_group()
|
|
168
|
+
action.add_argument("--dry-run", action="store_true", help="show required changes without writing files")
|
|
169
|
+
action.add_argument("--check", action="store_true", help="exit 1 if agent profiles differ from the settings")
|
|
170
|
+
return parser
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
def main(argv: list[str] | None = None) -> int:
|
|
174
|
+
args = build_parser().parse_args(argv)
|
|
175
|
+
try:
|
|
176
|
+
agents_dir = resolve_agents_dir(args.agents_dir)
|
|
177
|
+
updates = prepare_updates(args.config, agents_dir)
|
|
178
|
+
if args.check:
|
|
179
|
+
if updates:
|
|
180
|
+
for path in updates:
|
|
181
|
+
print(f"out of sync: {path}")
|
|
182
|
+
return 1
|
|
183
|
+
print("all five agent profiles match models.toml")
|
|
184
|
+
return 0
|
|
185
|
+
if args.dry_run:
|
|
186
|
+
if updates:
|
|
187
|
+
print("checking five agent profiles; planned updates:")
|
|
188
|
+
for path in updates:
|
|
189
|
+
print(f"would update: {path}")
|
|
190
|
+
else:
|
|
191
|
+
print("all five agent profiles already match models.toml")
|
|
192
|
+
return 0
|
|
193
|
+
if updates:
|
|
194
|
+
apply_updates(updates)
|
|
195
|
+
print("applied settings across five agent profiles")
|
|
196
|
+
for path in updates:
|
|
197
|
+
print(f"updated: {path}")
|
|
198
|
+
else:
|
|
199
|
+
print("all five agent profiles already match models.toml")
|
|
200
|
+
return 0
|
|
201
|
+
except ValidationError as exc:
|
|
202
|
+
print(f"error: {exc}", file=sys.stderr)
|
|
203
|
+
return 2
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
if __name__ == "__main__":
|
|
207
|
+
raise SystemExit(main())
|