@yunhozz/arc 0.2.2 → 0.2.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 +107 -88
- package/README.md +4 -6
- package/claude/agents/arc-implementer.md +32 -42
- package/claude/agents/arc-planner.md +33 -47
- package/claude/agents/arc-qa.md +28 -44
- package/claude/agents/arc-reviewer.md +28 -41
- package/claude/agents/arc-scouter.md +26 -38
- package/claude/skill/SKILL.md +41 -59
- package/claude/skill/references/arc-visual-companion.md +28 -0
- package/claude/skill/references/commit.md +38 -70
- package/claude/skill/references/coordination.md +77 -126
- package/claude/skill/references/git-recovery.md +17 -35
- package/claude/skill/references/handoff-prep.md +91 -103
- package/claude/skill/references/handoff.md +110 -208
- package/claude/skill/references/limits.md +19 -31
- package/claude/skill/references/planning.md +93 -244
- package/claude/skill/references/verification.md +105 -261
- package/claude/skill/references/visual-companion.md +293 -15
- package/claude/skill/runtime/adapters/claude.mjs +10 -9
- package/claude/skill/runtime/adapters/codex.mjs +7 -8
- package/claude/skill/runtime/bootstrap.mjs +3 -2
- package/claude/skill/runtime/capabilities.mjs +12 -0
- package/claude/skill/runtime/cooperative-schema.mjs +3 -2
- package/claude/skill/runtime/cooperative.mjs +52 -4
- package/claude/skill/runtime/evaluate.mjs +115 -2
- package/claude/skill/runtime/identity.mjs +22 -0
- package/claude/skill/runtime/role-policy.json +18 -18
- package/claude/skill/runtime/schema.mjs +19 -0
- package/claude/skill/scripts/model_config.py +3 -79
- package/codex/agents/arc-implementer.toml +34 -30
- package/codex/agents/arc-planner.toml +27 -23
- package/codex/agents/arc-qa.toml +24 -15
- package/codex/agents/arc-reviewer.toml +25 -16
- package/codex/agents/arc-scouter.toml +20 -26
- package/codex/skill/SKILL.md +42 -57
- package/codex/skill/references/arc-visual-companion.md +33 -0
- package/codex/skill/references/commit.md +35 -81
- package/codex/skill/references/coordination.md +76 -104
- package/codex/skill/references/git-recovery.md +29 -51
- package/codex/skill/references/handoff-prep.md +76 -134
- package/codex/skill/references/handoff-worktree.md +32 -66
- package/codex/skill/references/handoff.md +111 -271
- package/codex/skill/references/limits.md +21 -34
- package/codex/skill/references/planning.md +125 -299
- package/codex/skill/references/verification.md +90 -272
- package/codex/skill/references/visual-companion.md +290 -18
- package/codex/skill/runtime/adapters/claude.mjs +10 -9
- package/codex/skill/runtime/adapters/codex.mjs +7 -8
- package/codex/skill/runtime/bootstrap.mjs +3 -2
- package/codex/skill/runtime/capabilities.mjs +12 -0
- package/codex/skill/runtime/cooperative-schema.mjs +3 -2
- package/codex/skill/runtime/cooperative.mjs +52 -4
- package/codex/skill/runtime/evaluate.mjs +115 -2
- package/codex/skill/runtime/identity.mjs +22 -0
- package/codex/skill/runtime/role-policy.json +18 -18
- package/codex/skill/runtime/schema.mjs +19 -0
- package/lib/installer/global-config.mjs +1 -0
- package/lib/installer/install.mjs +5 -7
- package/lib/installer/manifest.mjs +23 -8
- package/lib/installer/package-references.mjs +10 -5
- package/lib/installer/plan.mjs +1 -4
- package/lib/installer/superpowers.mjs +26 -1
- package/lib/installer/transaction.mjs +3 -3
- package/lib/installer/uninstall.mjs +2 -2
- package/lib/installer/upgrade.mjs +2 -9
- package/lib/management/operations.mjs +6 -8
- package/lib/management/update.mjs +3 -3
- package/lib/models/profiles.mjs +1 -40
- package/lib/policy/render.mjs +1 -5
- package/lib/policy/role-policy.json +18 -18
- package/lib/release/artifact.mjs +6 -4
- package/lib/runtime/adapters/claude.mjs +10 -9
- package/lib/runtime/adapters/codex.mjs +7 -8
- package/lib/runtime/bootstrap.mjs +3 -2
- package/lib/runtime/capabilities.mjs +12 -0
- package/lib/runtime/cooperative-schema.mjs +3 -2
- package/lib/runtime/cooperative.mjs +52 -4
- package/lib/runtime/evaluate.mjs +115 -2
- package/lib/runtime/identity.mjs +22 -0
- package/lib/runtime/schema.mjs +19 -0
- package/lib/tui/app.mjs +12 -8
- package/lib/tui/setup.mjs +5 -8
- package/package.json +11 -2
- package/scripts/update-manifest.mjs +7 -9
- package/claude/skill/hooks/git-policy.json +0 -208
- package/claude/skill/hooks/role-git-guard.mjs +0 -18
- package/claude/skill/hooks/runtime-gate.mjs +0 -12
- package/claude/skill/references/superpowers/brainstorming/visual-companion.md +0 -299
- package/codex/skill/hooks/runtime-gate.mjs +0 -10
- package/codex/skill/references/superpowers/brainstorming/visual-companion.md +0 -299
- package/lib/policy/claude-hook.mjs +0 -80
- package/scripts/probe-runtime-hooks.mjs +0 -55
- package/scripts/update-superpowers-local.sh +0 -4
- /package/claude/skill/references/{superpowers/brainstorming/SKILL.md → brainstorming.md} +0 -0
- /package/claude/skill/references/{superpowers/brainstorming/builder-check-prompt.md → builder-check-prompt.md} +0 -0
- /package/claude/skill/references/{superpowers/brainstorming/scripts → scripts}/frame-template.html +0 -0
- /package/claude/skill/references/{superpowers/brainstorming/scripts → scripts}/helper.js +0 -0
- /package/claude/skill/references/{superpowers/brainstorming/scripts → scripts}/server.cjs +0 -0
- /package/claude/skill/references/{superpowers/brainstorming/scripts → scripts}/start-server.sh +0 -0
- /package/claude/skill/references/{superpowers/brainstorming/scripts → scripts}/stop-server.sh +0 -0
- /package/claude/skill/references/{superpowers/LICENSE → superpowers-LICENSE} +0 -0
- /package/claude/skill/references/{superpowers/provenance.json → superpowers-provenance.json} +0 -0
- /package/claude/skill/references/{superpowers/test-driven-development/SKILL.md → test-driven-development.md} +0 -0
- /package/claude/skill/references/{superpowers/test-driven-development/writing-good-tests.md → writing-good-tests.md} +0 -0
- /package/claude/skill/references/{superpowers/writing-plans/SKILL.md → writing-plans.md} +0 -0
- /package/codex/skill/references/{superpowers/brainstorming/SKILL.md → brainstorming.md} +0 -0
- /package/codex/skill/references/{superpowers/brainstorming/builder-check-prompt.md → builder-check-prompt.md} +0 -0
- /package/codex/skill/references/{superpowers/brainstorming/scripts → scripts}/frame-template.html +0 -0
- /package/codex/skill/references/{superpowers/brainstorming/scripts → scripts}/helper.js +0 -0
- /package/codex/skill/references/{superpowers/brainstorming/scripts → scripts}/server.cjs +0 -0
- /package/codex/skill/references/{superpowers/brainstorming/scripts → scripts}/start-server.sh +0 -0
- /package/codex/skill/references/{superpowers/brainstorming/scripts → scripts}/stop-server.sh +0 -0
- /package/codex/skill/references/{superpowers/LICENSE → superpowers-LICENSE} +0 -0
- /package/codex/skill/references/{superpowers/provenance.json → superpowers-provenance.json} +0 -0
- /package/codex/skill/references/{superpowers/test-driven-development/SKILL.md → test-driven-development.md} +0 -0
- /package/codex/skill/references/{superpowers/test-driven-development/writing-good-tests.md → writing-good-tests.md} +0 -0
- /package/codex/skill/references/{superpowers/writing-plans/SKILL.md → writing-plans.md} +0 -0
|
@@ -1,168 +1,110 @@
|
|
|
1
|
+
<a id="handoff-preparation-contract"></a>
|
|
1
2
|
# Handoff preparation contract
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
staging, commit). The new managed worktree option's selection target is listed in the Execution-target request gate.
|
|
5
|
-
The [Implementer handoff gate](handoff.md#implementer-handoff-gate), handoff evidence and choice lifetime are in [handoff.md](handoff.md).
|
|
4
|
+
Read before choice requests and preparation Git mutations. Full gates/evidence/lifetime follow [handoff](handoff.md#implementer-handoff-gate).
|
|
6
5
|
|
|
6
|
+
<a id="workspace-handoff"></a>
|
|
7
7
|
## Workspace handoff
|
|
8
8
|
|
|
9
|
+
<a id="execution-target-request-gate"></a>
|
|
9
10
|
### Execution-target request gate
|
|
10
11
|
|
|
11
|
-
Before requesting
|
|
12
|
-
absolute paths and scope coverage, design/plan depth and valid omissions, dependencies and intended execution order.
|
|
13
|
-
The request does not require completed documents or individual approvals; unfinished drafts alone do not block it.
|
|
14
|
-
The set contains required artifacts, not a spec on every path. Resolve scope/dependency decisions needed to identify
|
|
15
|
-
the target; do not require choice evidence before asking for that choice.
|
|
16
|
-
For every supported execution-target option, before obtaining the user's choice, present to the user:
|
|
17
|
-
|
|
18
|
-
- Planned document list, each document's scope and coverage, repository-relative expected paths, dependencies and order,
|
|
19
|
-
and pending writing and approval status.
|
|
20
|
-
- Verified absolute workspace, intended repository, current branch or detached HEAD, base HEAD, any validated
|
|
21
|
-
new-branch candidate and collision status when offered, staged/unstaged/untracked changes, preservation and edit ownership.
|
|
22
|
-
|
|
23
|
-
Obtain explicit choice under the Explicit choice rule before preparation.
|
|
24
|
-
When offering the new managed worktree option, Orchestrator first verifies and then presents its selection target
|
|
25
|
-
(source absolute path, intended repository and Git common directory, source branch or detached HEAD, verified full source HEAD SHA,
|
|
26
|
-
approved branch candidate and collision status, descriptive name, planned document scope and any existing approved document transfer/commit scope). Verification
|
|
27
|
-
validates the approved branch candidate and collision status under New task branch naming rules and checks source state
|
|
28
|
-
(unrelated staged changes; existing approved document HEAD/index/working-tree state) before offering. The app chooses the actual
|
|
29
|
-
destination path: do not ask the user for a destination path or propose one, and do not fetch or substitute a remote
|
|
30
|
-
HEAD or default branch for the base. Read [handoff-worktree.md](handoff-worktree.md) only after the user
|
|
31
|
-
explicitly selects that option and before its creation, branch work, or document transfer.
|
|
12
|
+
Before requesting choice, verify/record planned document scope, absolute paths/coverage, design/plan depth/valid omissions, dependencies and order. Completed documents/individual approvals are not yet required; unfinished drafts alone do not block asking. Include required artifacts, not mandatory specs everywhere. Settle scope/dependencies needed to identify the target without requiring choice evidence before asking.
|
|
32
13
|
|
|
14
|
+
Present each supported option with:
|
|
15
|
+
|
|
16
|
+
- Planned documents, coverage, expected relative paths, dependencies/order and pending drafting/approval.
|
|
17
|
+
- Verified absolute workspace/repository, branch or detached HEAD, base HEAD, validated offered branch candidate/collision, staged/unstaged/untracked state, preservation/ownership.
|
|
18
|
+
|
|
19
|
+
Obtain explicit choice before preparation.
|
|
20
|
+
|
|
21
|
+
Before offering managed worktrees, verify/present source absolute path/repository/common directory, source branch/detached HEAD/full SHA, approved candidate/collision, descriptive name, planned documents and existing approved transfer/commit scope. Validate naming/collision and source unrelated staging/approved document HEAD/index/working bytes. The app chooses the path; never ask/propose destinations or substitute/fetch remote/default base. Only after explicit selection read [handoff-worktree](handoff-worktree.md), before creation/branch/transfer.
|
|
22
|
+
|
|
23
|
+
<a id="git-mutation-evidence-gate"></a>
|
|
33
24
|
### Git mutation evidence gate
|
|
34
25
|
|
|
35
|
-
Before
|
|
36
|
-
or commit—read this reference and recheck explicit execution-target choice or verified valid reuse; absolute workspace
|
|
37
|
-
and intended repository; current branch or detached HEAD and HEAD; staged/unstaged/untracked changes, preservation and
|
|
38
|
-
edit ownership; and the exact command, target paths, and approved scope. Confirm no unresolved failure or partial
|
|
39
|
-
completion. Record these facts before the action. Missing or mismatched evidence stops that mutation.
|
|
40
|
-
Initial target preparation does not require the complete approved document set: verify planned scope and target inputs.
|
|
41
|
-
For approved-document staging and commit, also verify the complete approved document set and individual approval
|
|
42
|
-
evidence, approved versions, dependencies, and actual index. Read-only Git checks remain allowed.
|
|
43
|
-
Do not infer execution authority from an external skill's early commit step.
|
|
26
|
+
Before every preparation mutation (branch creation/switch, worktree creation, approved-doc staging/commit), read this and record/recheck:
|
|
44
27
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Reverify affected evidence after changes or failures; do not retroactively approve an action taken before its gate.
|
|
28
|
+
1. Explicit choice or verified valid reuse.
|
|
29
|
+
2. Absolute workspace/intended repository, actual branch or detached HEAD and HEAD.
|
|
30
|
+
3. Staged/unstaged/untracked state, preservation and ownership.
|
|
31
|
+
4. Exact command/paths/approved scope; no unresolved failure or partial completion.
|
|
50
32
|
|
|
51
|
-
|
|
33
|
+
Missing/mismatched evidence blocks mutation. Initial preparation verifies planned scope/inputs without requiring complete approved documents. Document staging/commit also verifies the full set, individual approvals/versions/dependencies and actual index. Read-only Git remains allowed. External skills' early commits grant no authority.
|
|
52
34
|
|
|
53
|
-
|
|
54
|
-
Choose a valid Git branch name in the form `<type>/<short-kebab-case-topic>`. Use a lowercase prefix for the task's
|
|
55
|
-
main purpose and a short, specific lowercase kebab-case topic with no spaces. For mixed tasks, choose the main purpose.
|
|
35
|
+
After branch/commit operations verify path/branch/HEAD/preservation/result before dependent action. After staging verify index paths/diff and finalized message. Unrelated staged paths block changes. Revalidate affected evidence after change/failure; never retroactively authorize pre-gate actions.
|
|
56
36
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
| fix/ | Fix a bug |
|
|
61
|
-
| refactor/ | Improve code structure while preserving behavior |
|
|
62
|
-
| docs/ | Change documentation |
|
|
63
|
-
| test/ | Add or change tests |
|
|
64
|
-
| build/ | Change build, packaging, or dependencies |
|
|
65
|
-
| ci/ | Change CI configuration |
|
|
66
|
-
| perf/ | Improve performance |
|
|
67
|
-
| style/ | Change formatting or style without behavior changes |
|
|
68
|
-
| chore/ | Change operational policy, tools, or maintenance |
|
|
69
|
-
| revert/ | Revert a prior change |
|
|
70
|
-
|
|
71
|
-
Validate the name and check for collisions before creation. If the base name exists, never automatically substitute a
|
|
72
|
-
suffix; present a new candidate for explicit approval. Never reuse, delete, or overwrite an existing branch, except
|
|
73
|
-
that reuse of an approved existing branch on the managed worktree path follows the conditions in
|
|
74
|
-
[handoff-worktree.md](handoff-worktree.md) (Exception for this managed path).
|
|
75
|
-
Distinguish a lookup error from a missing branch.
|
|
76
|
-
Recheck the workspace, current branch or detached HEAD, base HEAD, and candidate before execution. If the approval
|
|
77
|
-
target changes, present the new target and obtain explicit user approval. If the candidate changes because of a new
|
|
78
|
-
collision, obtain approval for that candidate before creating or switching; without that approval, block handoff.
|
|
79
|
-
Use the current checkout only after the user explicitly selects it for this handoff. A failure during creation remains
|
|
80
|
-
an operational failure subject to Stop and inspect (SKILL.md) and Recovery prerequisite below.
|
|
81
|
-
|
|
82
|
-
Create and switch to the approved new branch from the confirmed base HEAD in the current checkout, for example with
|
|
83
|
-
`git switch -c <branch>`. Detached HEAD is acceptable when HEAD is resolved and included in the approval target.
|
|
84
|
-
After success, confirm the actual current branch matches the approved candidate, HEAD matches the recorded base, the
|
|
85
|
-
checkout absolute path is unchanged, and existing changes are preserved. Do not create a worktree or fall back to
|
|
86
|
-
worktree provisioning on failure. Only explicit selection of New managed worktree and task branch permits worktree
|
|
87
|
-
creation.
|
|
37
|
+
<a id="new-task-branch"></a>
|
|
38
|
+
<a id="new-task-branch-naming"></a>
|
|
39
|
+
### New task branch naming
|
|
88
40
|
|
|
41
|
+
Create the explicitly approved candidate from approved base in the current checkout, e.g. `git switch -c <branch>`. Use `<type>/<short-kebab-case-topic>`: lowercase main-purpose prefix and short specific lowercase topic without spaces. Mixed work uses its main purpose.
|
|
42
|
+
|
|
43
|
+
| Prefix | Purpose |
|
|
44
|
+
|---|---|
|
|
45
|
+
| feat/ | Feature |
|
|
46
|
+
| fix/ | Bug fix |
|
|
47
|
+
| refactor/ | Structure, preserving behavior |
|
|
48
|
+
| docs/ | Documentation |
|
|
49
|
+
| test/ | Tests |
|
|
50
|
+
| build/ | Build/packaging/dependencies |
|
|
51
|
+
| ci/ | CI |
|
|
52
|
+
| perf/ | Performance |
|
|
53
|
+
| style/ | Non-behavior formatting/style |
|
|
54
|
+
| chore/ | Policy/tools/maintenance |
|
|
55
|
+
| revert/ | Revert prior change |
|
|
56
|
+
|
|
57
|
+
Validate name/collision before creation. Never add suffixes automatically; approve new candidates. Never reuse/delete/overwrite existing branches. Only the [managed-path exception](handoff-worktree.md) permits narrowly verified approved-branch reuse. Distinguish lookup errors from absence.
|
|
58
|
+
|
|
59
|
+
Immediately recheck workspace, branch/detached HEAD, base and candidate. Changed target/collision candidate requires fresh explicit approval before creation/switch; otherwise block handoff. Detached HEAD is allowed when resolved and approved. After success verify actual branch equals candidate, HEAD equals base, unchanged absolute checkout and preserved changes. Failures follow Stop and inspect, never automatic checkout/worktree fallback.
|
|
60
|
+
|
|
61
|
+
<a id="current-checkout"></a>
|
|
89
62
|
### Current checkout
|
|
90
63
|
|
|
91
|
-
|
|
92
|
-
confirm the absolute workspace, current branch or detached HEAD, HEAD, and existing changes with their preservation and
|
|
93
|
-
edit ownership. Record this state and the choice evidence in the brief. Missing choice, unconfirmed state, or unclear
|
|
94
|
-
ownership blocks handoff.
|
|
64
|
+
After explicit selection or valid reuse, verify absolute workspace, branch/detached HEAD, HEAD and existing changes/preservation/ownership. Record state/choice. Missing choice, uncertain state or unclear ownership blocks handoff.
|
|
95
65
|
|
|
66
|
+
<a id="planning-document-commit"></a>
|
|
96
67
|
### Planning document commit
|
|
97
68
|
|
|
98
|
-
Begin
|
|
99
|
-
|
|
100
|
-
On the new task branch path, verify the successful switch, actual branch, unchanged checkout path, and preserved
|
|
101
|
-
changes first. On the current checkout path, verify the selected branch or detached HEAD, path, and existing changes.
|
|
102
|
-
On the new worktree path, verify the created app-managed worktree, current-chat attachment, identity/base, approved
|
|
103
|
-
branch and direct target documents (or protected pre-existing/restart document transfer) before any target docs commit.
|
|
104
|
-
At the target, commit only remaining approved documents once; do not automatically make a source document commit.
|
|
105
|
-
Record the selected base SHA and post-commit HEAD.
|
|
106
|
-
Orchestrator verifies each approved spec/plan already committed for this task by SHA, actual message, included paths,
|
|
107
|
-
and content matching the approved version and validity in the selected checkout; reuse valid commits without recommitting
|
|
108
|
-
them.
|
|
109
|
-
|
|
110
|
-
For approved documents still uncommitted, Orchestrator records the approved versions and paths, finalizes the specific
|
|
111
|
-
English
|
|
112
|
-
Conventional Commit message before the first commit, and stages only those documents for one focused docs commit
|
|
113
|
-
before handoff. Batch all remaining uncommitted approved documents together in that single commit. If all are
|
|
114
|
-
validly committed, verify only; do not create duplicate or empty commits, or amend, reset, or recommit past commits
|
|
115
|
-
merely to combine them into one SHA. Verify both staged paths and staged diff match exactly the approved
|
|
116
|
-
documents; unrelated staged files stop the commit under the Preservation rule. Never include implementation files.
|
|
117
|
-
MUST NOT commit a generic temporary message and routinely repair it with `git commit --amend`. A separately needed amend requires rechecking its approval scope, current HEAD, and publication state.
|
|
118
|
-
|
|
119
|
-
If the docs commit fails or staged content differs, stop handoff and apply the Stop and inspect rule to the actual
|
|
120
|
-
branch, HEAD, index, and partial completion. Resolve the issue before resuming; do not commit implementation instead.
|
|
121
|
-
After success verify SHA, actual message, included paths/content, post-commit HEAD, final branch, and
|
|
122
|
-
staged/unstaged/untracked state in the brief. A successful command exit alone does not prove complete preparation. This
|
|
123
|
-
commit is not implementation acceptance or push approval; do not push without a separate explicit user request.
|
|
124
|
-
|
|
125
|
-
Skip this commit only when no planning documents were required and none were produced under the design/plan depth
|
|
126
|
-
rules; record that fact and the applicable depth rationale. Uncommitted documents cannot be treated as absent.
|
|
127
|
-
This does not require new documents or bypass checkout choice or any other handoff-gate condition.
|
|
69
|
+
Begin after target preparation and all applicable documents are written/individually approved. Verify full set/evidence/versions before staging/commit. New branches require successful switch, actual branch, unchanged path/preservation. Current checkout requires selected branch/detached HEAD/path/changes.
|
|
70
|
+
For worktrees verify actual app management/current-chat attachment/identity/base/branch and directly written documents or protected legacy/restart transfers before target docs commits. Commit remaining approvals once at target; no automatic source docs commit.
|
|
128
71
|
|
|
129
|
-
|
|
72
|
+
1. Verify already committed approvals by SHA, actual message/paths/content and selected-checkout validity; reuse without recommitting.
|
|
73
|
+
2. Record remaining approved versions/paths. Finalize a specific English Conventional Commit message before the first commit.
|
|
74
|
+
3. Batch all remaining approved documents into one focused docs commit. Staged paths/diff must match exactly; unrelated staging blocks commit. No implementation files.
|
|
75
|
+
4. If all validly committed, verify only. Never duplicate/empty-commit/amend/reset/recommit merely to combine SHAs. Do not use temporary messages followed by routine `git commit --amend`; separate amend needs scope/current HEAD/publication checks.
|
|
76
|
+
5. Failure/staged-content mismatch stops handoff. Inspect branch/HEAD/index/partial completion and resolve before resuming; never commit implementation instead.
|
|
77
|
+
6. Verify SHA/message/paths/content, post-commit HEAD/branch and remaining state in the brief, including selected base and actual order/deviations. Command success alone proves no preparation. Docs commit is neither implementation acceptance nor push approval; no push without separate explicit request.
|
|
130
78
|
|
|
131
|
-
|
|
132
|
-
[planning](planning.md#plan-updates-during-execution), including approved scope revisions. Do not batch these as another
|
|
133
|
-
document commit. This exception does not combine historical document commits or rewrite implementation task contents.
|
|
79
|
+
Skip only when depth rules required no documents and none were created; record why. Uncommitted documents are not absent. This adds neither documents nor gate exceptions. Unchanged authorized target/scope needs no repeated choice.
|
|
134
80
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
role writers and a safe boundary for unfinished changes; complete classification, approval and chronology records.
|
|
138
|
-
Preserve unrelated staged, unstaged and untracked changes under the Preservation rule; unexpected dirty state blocks rewrite.
|
|
139
|
-
Secure recoverable pre-rewrite HEAD, original commits and before/after plan contents before mutation.
|
|
81
|
+
<a id="execution-time-plan-amendment"></a>
|
|
82
|
+
### Execution-time plan amendment
|
|
140
83
|
|
|
141
|
-
|
|
142
|
-
commits, amend the original and reapply descendants in original order preserving task boundaries and implementation contents.
|
|
143
|
-
Create no separate document or intermediate fixup commit. Git changes remain Orchestrator-only.
|
|
84
|
+
After initial document batching, use [planning](planning.md#plan-updates-during-execution), including scope revisions. Never batch another document commit or combine historical commits/rewrite implementation contents under this exception.
|
|
144
85
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
86
|
+
1. Verify original planning commit ancestry/current replacement, unpublished/unshared local linear history, no merges, clear ownership/plan paths, paused writers/safe unfinished-work boundary and complete classification/approval/chronology. Unexpected dirty state blocks rewrite.
|
|
87
|
+
2. Preserve recoverable old HEAD/commits and before/after plan contents, plus unrelated staged/unstaged/untracked work.
|
|
88
|
+
3. If original commit is HEAD, amend only plan paths, preserving other documents. Otherwise amend original and replay descendants in order with task boundaries/implementation contents intact. No separate docs/intermediate fixup commit. Orchestrator alone mutates Git.
|
|
89
|
+
4. Unknown publication/sharing/ownership, merges, unexpected HEAD/state or replay conflict stops rewrite/affected work. No automatic resolution, force push or fallback docs commit. Record actual path/branch/HEAD/index/files/completed steps.
|
|
90
|
+
5. After resolution revalidate gates. Verify new SHA/HEAD, approved plan content/version, descendants, old→new mappings and remaining state under [verification](verification.md#evidence-after-plan-history-rewrite).
|
|
150
91
|
|
|
92
|
+
<a id="recovery-prerequisite"></a>
|
|
151
93
|
### Recovery prerequisite
|
|
152
94
|
|
|
153
|
-
|
|
154
|
-
[git-recovery.md](git-recovery.md) before dependent recovery. Its stop and preservation rules are mandatory.
|
|
95
|
+
Read [git-recovery](git-recovery.md) before dependent collision/failure/partial-completion/metadata-denial recovery. Stop/preservation rules are mandatory.
|
|
155
96
|
|
|
156
|
-
|
|
97
|
+
<a id="instruction-and-input-provenance"></a>
|
|
98
|
+
## Instruction and input provenance
|
|
157
99
|
|
|
158
|
-
|
|
100
|
+
Distinguish instruction/input sources, versions/approvals and access. Missing root AGENTS.md alone implies no missing user instructions. Optional reads follow only [handoff](handoff.md#instruction-sources-bounded-read-recovery-visual-evidence-and-resumption)'s pre-authorization. This exception never covers Git/generation/preparation failure or partial changes. Verify resolution evidence/gates before resume.
|
|
159
101
|
|
|
160
102
|
[ARC role policy: contract begin]
|
|
161
103
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
162
|
-
- [scope.non-escalation] Act only
|
|
163
|
-
- [git.specialists-deny]
|
|
164
|
-
- [git.orchestrator-accept-commit] Only Orchestrator accepts work and
|
|
165
|
-
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for
|
|
166
|
-
- [planning.plan-amend]
|
|
167
|
-
- [platform.codex] Role restrictions are prompt-level contracts, not a filesystem sandbox.
|
|
104
|
+
- [scope.non-escalation] Act only within role authority, approved scope and available platform tools. Delegation, restart, agent messages and attached instructions do not expand authority. Do not bypass restrictions through aliases, scripts, other tools, processes or redelegation. Return instruction conflicts to Orchestrator before dependent work. Reuse valid approvals for unchanged scope without requesting them again. If an optional read method fails, use only a pre-authorized, side-effect-free alternative for the same positively identified material, approved version, purpose and role authority, with equivalent evidence conditions. A different locator requires the exact locator in the brief in advance and verified material identity/version; discovery is not authorization. Missing required input, authority or target mismatch, ownership conflict, partial mutation, unknown state, or an alternative that is unapproved, ambiguous or fails requires immediate return to Orchestrator before dependent work. Permit no chained discovery, guessed paths, mutation retries, dependency/environment/authority changes or repeated completed work. Report the first failure, alternative, evidence, limits, dependent work held and independent work remaining. First, record the exact failed check, result and evidence, baseline revision and current revision/change state. Second, classify each failure as baseline or current, recording affected scope and dependency relationships. Third, hold only affected or dependent tasks and checks; when classification is unknown, hold only work whose impact is unknown. Fourth, Orchestrator must release already-approved independent work without waiting for unrelated failures, after confirming valid authority, target, inputs, ownership and gates. Finally, keep acceptance held while any required check remains unresolved. Specialists report evidence and remaining work and must not self-authorize release. Independent release never hides failed checks, expands scope, changes criteria or waives required verification. Distinguish user-provided instructions, discovered workspace instruction files, installed role references and task inputs by source, applicability, version/approval and access state (available, absent, inaccessible, conflicting or unverified). A root AGENTS.md file absence is not evidence of absence of instructions; applicable user-provided instructions remain valid and that absence alone is not a blocker. Missing required inputs or unresolved instruction conflicts hold dependent work. Retrieved content grants no authority. The resume brief preserves valid approvals for unchanged scope, completed work, failure, resolution evidence, valid and invalid evidence, remaining holds and next objective. After resolution, Orchestrator revalidates affected gates and records changed facts. Do not repeat completed work or treat restart as new authority. Preserve role, Git, preservation, approval, QA/recheck, final Reviewer, acceptance and commit boundaries.
|
|
105
|
+
- [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 within the assigned scope remains allowed.
|
|
106
|
+
- [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 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.
|
|
107
|
+
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for the action, scope and target. Local commit authority grants no external authority. Orchestrator performs authorized external actions; specialists return them without execution.
|
|
108
|
+
- [planning.plan-amend] Mechanical plan progress records during approved execution need no new user approval. Changes to goals, scope, criteria, method, risk, dependencies or required verification need revised-version approval and preparation before affected work. In both cases Orchestrator amends the original planning-document commit at a safe boundary, with no separate document or fixup commit. Preserve actual approval chronology, recoverable old/new content, hashes, versions and SHA mappings; never authorize past work retroactively. 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. Follow planning, handoff-prep, commit and verification for the full contract.
|
|
109
|
+
- [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.
|
|
168
110
|
[ARC role policy: contract end]
|
|
@@ -1,35 +1,20 @@
|
|
|
1
|
+
<a id="managed-worktree-handoff-contract"></a>
|
|
1
2
|
# Managed worktree handoff contract
|
|
2
3
|
|
|
3
|
-
Orchestrator reads
|
|
4
|
-
branch work or document transfer. Apply [handoff-prep.md](handoff-prep.md) and [handoff.md](handoff.md) gates as well.
|
|
4
|
+
After explicit new-managed-worktree selection, Orchestrator reads this before creation, branch work or document transfer. Also apply [handoff-prep](handoff-prep.md) and [handoff](handoff.md).
|
|
5
5
|
|
|
6
|
+
<a id="workspace-handoff"></a>
|
|
6
7
|
## Workspace handoff
|
|
7
8
|
|
|
9
|
+
<a id="new-managed-worktree"></a>
|
|
8
10
|
### New managed worktree
|
|
9
11
|
|
|
10
|
-
Before formal drafting
|
|
11
|
-
repository/common directory and base verification, approved branch verification, and source preservation checks below.
|
|
12
|
-
The normal new-document path drafts and saves directly in the verified target. Planned destination paths are not
|
|
13
|
-
preparation evidence. Initial preparation does not authorize Implementer or a document commit.
|
|
12
|
+
Before formal drafting/saving, verify actual creation, managed registration, current-chat attachment, repository/common directory/base, approved branch and source preservation below. Draft/save new documents directly in the verified target. Planned paths prove no preparation; initial preparation authorizes neither Implementer nor document commits.
|
|
14
13
|
|
|
15
|
-
Only
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Recheck approved source state, base SHA, approved branch candidate/collision status, name and approved document scope
|
|
20
|
-
after choice and immediately before the tool call. After selection and before creation, any changes require
|
|
21
|
-
a fresh explicit choice for the updated inputs. This is the pre-creation candidate rule. After successful creation
|
|
22
|
-
and verification, apply Choice lifetime and restart record in handoff.md.
|
|
23
|
-
|
|
24
|
-
Before calling mcp__codex_app__create_worktree, validate the approved branch candidate and collision state with
|
|
25
|
-
New task branch naming rules in handoff-prep.md. A collision requires a new explicit choice; never automatically
|
|
26
|
-
substitute a suffix.
|
|
27
|
-
Default is the prohibition on reusing an existing branch in handoff-prep.md; only this narrow exception applies.
|
|
28
|
-
Exception for this managed path: an existing approved branch at the same base and not checked out in any worktree
|
|
29
|
-
may be reused; verify both conditions before reuse. An unexpected branch, different base or lookup uncertainty means
|
|
30
|
-
stop.
|
|
31
|
-
|
|
32
|
-
Create using only the app tool:
|
|
14
|
+
1. Only explicit selection of this third path authorizes preparation. Use the selection target verified under handoff-prep's request gate. The app chooses the actual path; do not propose siblings or require user-specified paths. Use verified full source HEAD SHA as base, never remote HEAD/default branch or automatic fetch.
|
|
15
|
+
2. After choice and immediately before the call, recheck source state, base SHA, approved candidate/collision, name and document scope. Changed pre-creation inputs require fresh explicit choice. After successful creation/verification, handoff lifetime/restart rules apply.
|
|
16
|
+
3. Before `mcp__codex_app__create_worktree`, validate candidate/collision under handoff-prep. Collisions require new explicit choice, never automatic suffixes. Existing-branch reuse is forbidden by default. Only this managed path permits an approved existing branch at the same base and not checked out in any worktree, after both checks. Unexpected branch, different base or uncertain lookup stops work.
|
|
17
|
+
4. Use only the app tool:
|
|
33
18
|
|
|
34
19
|
mcp__codex_app__create_worktree({
|
|
35
20
|
allowAsync: true,
|
|
@@ -37,51 +22,32 @@ Create using only the app tool:
|
|
|
37
22
|
ref: "<verified-source-head-full-sha>"
|
|
38
23
|
})
|
|
39
24
|
|
|
40
|
-
The name
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
25
|
+
The descriptive name guarantees no path/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.
|
|
26
|
+
|
|
27
|
+
Only registration failure permits reattachment of the returned workspace with `mcp__codex_app__attach_worktree`. No formal drafting/saving/transfer/staging/commit/Implementer before completed registration, current-chat attachment and branch verification. 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. Read git-recovery before dependent recovery.
|
|
28
|
+
|
|
29
|
+
Verify creation in order:
|
|
30
|
+
|
|
31
|
+
1. Verify returned absolute path and app-artifact management/current-chat attachment.
|
|
32
|
+
2. Record initial branch or detached HEAD, approved candidate, final branch and target HEAD equal to approved ref.
|
|
33
|
+
3. Verify linked registration, source/target common-directory identity, registered path and target dirty state. Verify source branch/HEAD/index/files preservation. Approved-target shared metadata additions are authorized. Linked `.git` may be a file; repository identity requires neither identical top-level path nor a `.git` directory.
|
|
34
|
+
4. After registration/attachment/base checks, create/check out the approved branch: `git switch -c <approved-branch> <ref>` if detached, or `git switch <approved-branch>` under the existing-branch exception. No pointer moves, alternate branches, `--force` or `-B`. If the app already returned the approved branch, verify without repeating completed work.
|
|
35
|
+
5. Unexpected branch/HEAD mismatch stops work. Verify final branch/HEAD before formal drafting, saving, transfer, batch docs commit, final Git checks and handoff.
|
|
49
36
|
|
|
50
|
-
|
|
51
|
-
Record initial branch or detached HEAD, approved branch candidate, final branch, and target HEAD equal to approved ref.
|
|
52
|
-
Verify linked-worktree registration and source/target Git common directory identity, registered path,
|
|
53
|
-
target dirty state, and source branch, HEAD, index and files preservation; shared Git metadata additions for the approved target are
|
|
54
|
-
authorized.
|
|
55
|
-
Linked worktree .git may be a file; do not require the same top-level path or a .git directory for repository identity.
|
|
56
|
-
Verify registration, attachment and base before creating/checking out the approved branch. If initially detached,
|
|
57
|
-
use `git switch -c <approved-branch> <ref>`; if the existing approved branch has the same base and is not checked out
|
|
58
|
-
in any worktree, use `git switch <approved-branch>` (the exception above to the default no-reuse rule in
|
|
59
|
-
handoff-prep.md). Do not move a branch pointer, choose another branch or use --force
|
|
60
|
-
or -B.
|
|
61
|
-
If the app initially returns the approved branch, verify it and its base rather than repeating completed work.
|
|
62
|
-
Unexpected branch or mismatched HEAD means stop. Verify final approved branch and HEAD before formal drafting, saving, document transfer,
|
|
63
|
-
the batch docs commit, final Git verification and Implementer handoff.
|
|
37
|
+
The tool copies no uncommitted changes. Transfer rules below apply only to existing approved documents in legacy/restart/explicit-target-change cases, not normal new documents.
|
|
64
38
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Any mismatch means stop. Unrelated staged changes, required uncommitted implementation/configuration/test changes,
|
|
70
|
-
and unclear ownership block preparation. Clearly unrelated unstaged/untracked changes remain in source.
|
|
71
|
-
Do not automatically stash, commit, reset, clean, or unstage; do not transfer dirty implementation files.
|
|
72
|
-
For those existing approved documents, use Worktree document transfer before target docs preparation.
|
|
39
|
+
- Untracked approved documents must be absent from source HEAD/index, with working-tree bytes matching latest approval.
|
|
40
|
+
- Tracked documents require source index blob/mode equal to HEAD and working-tree bytes equal to latest approval. Approved working revisions may differ from HEAD/index. Do not stage source documents to repair or verify them.
|
|
41
|
+
- Mismatches, unrelated staged changes, required uncommitted implementation/configuration/test changes or unclear ownership block preparation. Clearly unrelated unstaged/untracked changes stay in source.
|
|
42
|
+
- Never automatically stash/commit/reset/clean/unstage or transfer dirty implementation. Transfer existing approved documents below before target document preparation.
|
|
73
43
|
|
|
44
|
+
<a id="worktree-document-transfer"></a>
|
|
74
45
|
### Worktree document transfer
|
|
75
46
|
|
|
76
|
-
|
|
47
|
+
Only for existing approved documents in legacy/pre-existing-document, restart, or explicit-target-change cases; not normal new documents:
|
|
77
48
|
|
|
78
|
-
Verify existing approved
|
|
79
|
-
Copy only uncommitted approved spec/plan documents to the
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
also be absent at the destination. For unexpected changes, do not overwrite; stop.
|
|
84
|
-
For identical content, verify approved bytes before reuse. After transfer verify bytes match the approved version.
|
|
85
|
-
The canonical record includes each document approval/version/evidence, source and target absolute paths and the common
|
|
86
|
-
relative path plus content verification. Changed content or approval scope requires approval of the revised version.
|
|
87
|
-
Transfer no other files. Failure or partial transfer blocks all dependent staging, commit and Implementer handoff.
|
|
49
|
+
1. Verify existing approved commit SHA/message/paths/content and validity at base/target; reuse them.
|
|
50
|
+
2. Copy only uncommitted approved spec/plan documents to the same relative paths. Never move/delete/modify source documents. Stop for destinations escaping the worktree, including symlinks. Target HEAD must equal selected source base SHA before transfer.
|
|
51
|
+
3. Before replacing a destination, prove clean base state: no staged/unstaged changes, index/working bytes equal base. Documents absent from base must also be absent at destination. Never overwrite unexpected changes.
|
|
52
|
+
4. Verify approved bytes before reusing identical content; verify approved bytes after transfer.
|
|
53
|
+
5. Record approvals/versions/evidence, absolute source/target paths, common relative paths and content checks. Changed content/approval scope needs revised approval. Transfer nothing else. Failure/partial transfer blocks dependent staging, commits and Implementer handoff.
|