@yunhozz/arc 0.1.1 → 0.1.3
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 +75 -36
- package/claude/agents/arc-coder.md +10 -9
- package/claude/agents/arc-planner.md +13 -12
- package/claude/agents/arc-qa.md +9 -8
- package/claude/agents/arc-reviewer.md +11 -10
- package/claude/agents/arc-scouter.md +10 -9
- package/claude/skill/SKILL.md +13 -17
- package/claude/skill/hooks/role-git-guard.mjs +3 -83
- package/claude/skill/hooks/runtime-gate.mjs +12 -0
- package/claude/skill/models.toml +11 -11
- package/claude/skill/references/commit.md +8 -9
- package/claude/skill/references/git-recovery.md +1 -1
- package/claude/skill/references/handoff-prep.md +8 -8
- package/claude/skill/references/handoff.md +8 -8
- package/claude/skill/references/limits.md +4 -4
- package/claude/skill/references/planning.md +9 -9
- package/claude/skill/references/verification.md +10 -10
- package/claude/skill/references/visual-companion.md +2 -3
- package/claude/skill/runtime/adapters/claude.mjs +81 -0
- package/claude/skill/runtime/adapters/codex.mjs +63 -0
- package/claude/skill/runtime/capabilities.mjs +32 -0
- package/claude/skill/runtime/evaluate.mjs +103 -0
- package/claude/skill/runtime/gate.mjs +71 -0
- package/claude/skill/runtime/git-evidence.mjs +114 -0
- package/claude/skill/runtime/git-query.mjs +88 -0
- package/claude/skill/runtime/identity.mjs +27 -0
- package/claude/skill/runtime/operations.mjs +6 -0
- package/claude/skill/runtime/role-policy.json +607 -0
- package/claude/skill/runtime/schema.mjs +78 -0
- package/claude/skill/runtime/store.mjs +63 -0
- package/claude/skill/scripts/model_config.py +78 -18
- package/codex/agents/arc-coder.toml +8 -8
- package/codex/agents/arc-planner.toml +9 -9
- package/codex/agents/arc-qa.toml +6 -6
- package/codex/agents/arc-reviewer.toml +7 -7
- package/codex/agents/arc-scouter.toml +6 -6
- package/codex/skill/SKILL.md +15 -19
- package/codex/skill/hooks/runtime-gate.mjs +10 -0
- package/codex/skill/models.toml +11 -11
- package/codex/skill/references/commit.md +9 -9
- package/codex/skill/references/git-recovery.md +1 -1
- package/codex/skill/references/handoff-prep.md +9 -10
- package/codex/skill/references/handoff-worktree.md +1 -1
- package/codex/skill/references/handoff.md +9 -9
- package/codex/skill/references/limits.md +4 -4
- package/codex/skill/references/planning.md +11 -12
- package/codex/skill/references/verification.md +10 -11
- package/codex/skill/references/visual-companion.md +3 -3
- package/codex/skill/runtime/adapters/claude.mjs +81 -0
- package/codex/skill/runtime/adapters/codex.mjs +63 -0
- package/codex/skill/runtime/capabilities.mjs +32 -0
- package/codex/skill/runtime/evaluate.mjs +103 -0
- package/codex/skill/runtime/gate.mjs +71 -0
- package/codex/skill/runtime/git-evidence.mjs +114 -0
- package/codex/skill/runtime/git-query.mjs +88 -0
- package/codex/skill/runtime/identity.mjs +27 -0
- package/codex/skill/runtime/operations.mjs +6 -0
- package/codex/skill/runtime/role-policy.json +607 -0
- package/codex/skill/runtime/schema.mjs +78 -0
- package/codex/skill/runtime/store.mjs +63 -0
- package/lib/models/profiles.mjs +41 -4
- package/lib/policy/claude-hook.mjs +57 -17
- package/lib/policy/render.mjs +1 -0
- package/lib/policy/role-policy.json +38 -8
- package/lib/runtime/adapters/claude.mjs +81 -0
- package/lib/runtime/adapters/codex.mjs +63 -0
- package/lib/runtime/capabilities.mjs +32 -0
- package/lib/runtime/evaluate.mjs +103 -0
- package/lib/runtime/gate.mjs +71 -0
- package/lib/runtime/git-evidence.mjs +114 -0
- package/lib/runtime/git-query.mjs +88 -0
- package/lib/runtime/identity.mjs +27 -0
- package/lib/runtime/operations.mjs +6 -0
- package/lib/runtime/schema.mjs +78 -0
- package/lib/runtime/store.mjs +63 -0
- package/package.json +1 -1
- package/scripts/probe-runtime-hooks.mjs +55 -0
- package/scripts/update-runtime-assets.mjs +19 -0
|
@@ -1,89 +1,9 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import {pathToFileURL} from 'node:url';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (!policy || policy.schemaVersion !== 1 || !Array.isArray(policy.globalValueOptions) || !Array.isArray(policy.globalFlags) || !policy.commands || typeof policy.commands !== 'object' || Array.isArray(policy.commands)) throw Error('Invalid Git policy');
|
|
8
|
-
const strings = list => Array.isArray(list) && list.every(x=>typeof x === 'string' && x.startsWith('-'));
|
|
9
|
-
if (!strings(policy.globalValueOptions) || !strings(policy.globalFlags) || !Object.keys(policy.commands).length) throw Error('Invalid Git policy');
|
|
10
|
-
for (const rule of Object.values(policy.commands)) if (!rule || !strings(rule.flags) || !strings(rule.values) || !['any','none','query','list'].includes(rule.positionals)) throw Error('Invalid Git command policy');
|
|
11
|
-
return policy;
|
|
12
|
-
}
|
|
13
|
-
// This deliberately supports a small shell grammar, rather than executing a shell.
|
|
14
|
-
function tokenize(command) {
|
|
15
|
-
const tokens=[]; let word='', started=false, quote=null;
|
|
16
|
-
for(let i=0;i<command.length;i++) {
|
|
17
|
-
const char=command[i];
|
|
18
|
-
if(char==='\\' && /[\r\n]/.test(command[i+1]??'')) throw Error('Escaped line terminator');
|
|
19
|
-
if(quote) {
|
|
20
|
-
if(char===quote){quote=null;continue;}
|
|
21
|
-
if(quote==='"' && /[$`]/.test(char)) throw Error('Dynamic shell syntax');
|
|
22
|
-
// Preserve Windows paths in quoted executable names.
|
|
23
|
-
if(char==='\\' && quote==='"' && /["\\$`]/.test(command[i+1]??'')){word+=command[++i];continue;}
|
|
24
|
-
word+=char;continue;
|
|
25
|
-
}
|
|
26
|
-
if(char==='"'||char==="'"){quote=char;started=true;continue;}
|
|
27
|
-
if(/[\r\n\x00<>`$(){}&]/.test(char) && !(char==='&'&&command[i+1]==='&')) throw Error('Unsupported shell syntax');
|
|
28
|
-
if(char===';'||char==='|'||char==='&') {
|
|
29
|
-
if(started){tokens.push(word);word='';started=false;}
|
|
30
|
-
const operator=command.slice(i,i+2); if(operator==='&&'||operator==='||')i++;
|
|
31
|
-
tokens.push({operator:operator==='&&'||operator==='||'?operator:char});continue;
|
|
32
|
-
}
|
|
33
|
-
if(/\s/.test(char)){if(started){tokens.push(word);word='';started=false;}continue;}
|
|
34
|
-
if(char==='\\') {if(i+1>=command.length)throw Error('Incomplete escape'); word+=command[++i];started=true;continue;}
|
|
35
|
-
if(char==='#')throw Error('Unsupported shell comment');
|
|
36
|
-
word+=char;started=true;
|
|
37
|
-
}
|
|
38
|
-
if(quote)throw Error('Unclosed quote'); if(started)tokens.push(word);return tokens;
|
|
39
|
-
}
|
|
40
|
-
function classifyWords(words,policy,depth) {
|
|
41
|
-
if(!words.length)return deny('Empty shell segment');
|
|
42
|
-
const executable=words[0].split(/[\\/]/).at(-1).toLowerCase();
|
|
43
|
-
if(['sh','bash','sh.exe','bash.exe'].includes(executable)) {
|
|
44
|
-
if(depth>=4 || words.length!==3 || words[1]!=='-c')return deny('Unsupported shell wrapper');
|
|
45
|
-
return classifyGitCommand(words[2],policy,depth+1);
|
|
46
|
-
}
|
|
47
|
-
if(!isGit(words[0]))return words.some(isGit)?deny('Unsupported indirect Git invocation'):{allowed:true};
|
|
48
|
-
let i=1;
|
|
49
|
-
while(i<words.length && words[i].startsWith('-')) {
|
|
50
|
-
const option=words[i++],equal=option.indexOf('='),key=equal<0?option:option.slice(0,equal);
|
|
51
|
-
if(policy.globalFlags.includes(option))continue;
|
|
52
|
-
if(!policy.globalValueOptions.includes(key))return deny('Unknown Git global option');
|
|
53
|
-
if(equal<0 && (i>=words.length || words[i++].startsWith('-')))return deny('Missing Git option value');
|
|
54
|
-
if(equal>=0 && !option.slice(equal+1))return deny('Missing Git option value');
|
|
55
|
-
}
|
|
56
|
-
const combined=`${words[i]} ${words[i+1]}`;
|
|
57
|
-
const name=Object.hasOwn(policy.commands,combined)?(i+=2,combined):words[i++];
|
|
58
|
-
const rule=Object.hasOwn(policy.commands,name)?policy.commands[name]:null; if(!rule)return deny('Git mutation or unknown subcommand');
|
|
59
|
-
let positions=0,query=false,list=false,paths=false;
|
|
60
|
-
for(;i<words.length;i++) {
|
|
61
|
-
const arg=words[i];
|
|
62
|
-
if(arg==='--' && rule.positionals==='any'){paths=true;continue;}
|
|
63
|
-
if(!paths && arg.startsWith('-')) {
|
|
64
|
-
if(/^-[0-9]+$/.test(arg)&&rule.flags.includes('-<count>'))continue;
|
|
65
|
-
const equal=arg.indexOf('='),key=equal<0?arg:arg.slice(0,equal);
|
|
66
|
-
if(rule.values.includes(key)) {if(equal<0 && (i+1>=words.length||words[++i].startsWith('-')))return deny('Missing query option value'); if(equal>=0&&!arg.slice(equal+1))return deny('Missing query option value');continue;}
|
|
67
|
-
if(!rule.flags.includes(arg))return deny('Unknown or mutating Git option');
|
|
68
|
-
if(['--get','--get-all','--get-regexp','--list','-l'].includes(arg))query=true;
|
|
69
|
-
if(['--list','-l','--show-current'].includes(arg))list=true;
|
|
70
|
-
} else positions++;
|
|
71
|
-
}
|
|
72
|
-
if(rule.positionals==='none'&&positions || rule.positionals==='query'&&(!query||positions>1) || rule.positionals==='list'&&positions&&!list)return deny('Git write or unsupported arguments');
|
|
73
|
-
return {allowed:true};
|
|
74
|
-
}
|
|
75
|
-
export function classifyGitCommand(command,policy,depth=0) {
|
|
76
|
-
try {
|
|
77
|
-
validateGitPolicy(policy);
|
|
78
|
-
if(typeof command!=='string'||!command.trim())return deny('Missing shell command');
|
|
79
|
-
const tokens=tokenize(command); let words=[];
|
|
80
|
-
for(const token of [...tokens,{operator:'end'}]) {
|
|
81
|
-
if(typeof token==='string'){words.push(token);continue;}
|
|
82
|
-
const result=classifyWords(words,policy,depth);if(!result.allowed)return result;words=[];
|
|
83
|
-
}
|
|
84
|
-
return {allowed:true};
|
|
85
|
-
} catch {return deny('Invalid policy or unsupported command syntax');}
|
|
86
|
-
}
|
|
4
|
+
import {validateGitPolicy,classifyGitCommand} from '../runtime/git-query.mjs';
|
|
5
|
+
export {validateGitPolicy,classifyGitCommand};
|
|
6
|
+
const deny=reason=>({allowed:false,reason});
|
|
87
7
|
export function evaluateHookEvent(event,policy) {
|
|
88
8
|
const result=event?.hook_event_name!=='PreToolUse' ? deny('Invalid hook event') : event?.tool_name!=='Bash' ? deny('Missing Bash event') : classifyGitCommand(event?.tool_input?.command,policy);
|
|
89
9
|
return result.allowed?{}:{hookSpecificOutput:{hookEventName:'PreToolUse',permissionDecision:'deny',permissionDecisionReason:`ARC specialist Git guard: ${result.reason}. Return the operation to Orchestrator.`}};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {runClaudeGate,renderClaudeDecision} from '../runtime/adapters/claude.mjs';
|
|
2
|
+
/** Native installation must provide trusted context separately; stdin is only
|
|
3
|
+
* the platform event. Missing provider denies and never trusts event assertions. */
|
|
4
|
+
export async function main(input,context){
|
|
5
|
+
try{return await runClaudeGate(JSON.parse(input),context);}catch{return renderClaudeDecision({decision:'deny',reason:'Malformed runtime hook event'});}
|
|
6
|
+
}
|
|
7
|
+
export async function runHook(){
|
|
8
|
+
let input='';for await(const chunk of process.stdin)input+=chunk;
|
|
9
|
+
process.stdout.write(JSON.stringify(await main(input))+'\n');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if(process.argv[1]&&import.meta.url===new URL(process.argv[1], 'file:').href)await runHook();
|
package/claude/skill/models.toml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Use configured settings
|
|
1
|
+
# Canonical source for every role model and effort preset.
|
|
2
|
+
# Use configured settings as specified. Report unavailable settings.
|
|
3
3
|
version = 1
|
|
4
4
|
preset = "balanced"
|
|
5
5
|
|
|
@@ -8,12 +8,12 @@ model = "haiku"
|
|
|
8
8
|
effort = "high"
|
|
9
9
|
|
|
10
10
|
[roles.arc_scouter.balanced]
|
|
11
|
-
model = "
|
|
12
|
-
effort = "
|
|
11
|
+
model = "haiku"
|
|
12
|
+
effort = "high"
|
|
13
13
|
|
|
14
14
|
[roles.arc_scouter.smart]
|
|
15
|
-
model = "
|
|
16
|
-
effort = "
|
|
15
|
+
model = "haiku"
|
|
16
|
+
effort = "max"
|
|
17
17
|
|
|
18
18
|
[roles.arc_planner.economy]
|
|
19
19
|
model = "sonnet"
|
|
@@ -29,11 +29,11 @@ effort = "high"
|
|
|
29
29
|
|
|
30
30
|
[roles.arc_coder.economy]
|
|
31
31
|
model = "sonnet"
|
|
32
|
-
effort = "
|
|
32
|
+
effort = "medium"
|
|
33
33
|
|
|
34
34
|
[roles.arc_coder.balanced]
|
|
35
35
|
model = "sonnet"
|
|
36
|
-
effort = "
|
|
36
|
+
effort = "high"
|
|
37
37
|
|
|
38
38
|
[roles.arc_coder.smart]
|
|
39
39
|
model = "opus"
|
|
@@ -44,12 +44,12 @@ model = "haiku"
|
|
|
44
44
|
effort = "high"
|
|
45
45
|
|
|
46
46
|
[roles.arc_qa.balanced]
|
|
47
|
-
model = "
|
|
48
|
-
effort = "
|
|
47
|
+
model = "haiku"
|
|
48
|
+
effort = "max"
|
|
49
49
|
|
|
50
50
|
[roles.arc_qa.smart]
|
|
51
51
|
model = "sonnet"
|
|
52
|
-
effort = "
|
|
52
|
+
effort = "medium"
|
|
53
53
|
|
|
54
54
|
[roles.arc_reviewer.economy]
|
|
55
55
|
model = "sonnet"
|
|
@@ -14,8 +14,7 @@ Planning documents have their own batch docs commit before Coder handoff.
|
|
|
14
14
|
|
|
15
15
|
After commit, verify exact SHA, subject, included paths, branch/HEAD and remaining index/worktree state.
|
|
16
16
|
Preserve unrelated changes; never automatically unstage, amend, reset, clean, stash, or delete branches.
|
|
17
|
-
On failure stop dependent work and report actual state and completed steps.
|
|
18
|
-
command. Push, publication and merge require user authorization. Coder must not commit, even when explicitly assigned.
|
|
17
|
+
On failure, stop dependent work and report actual state and completed steps. MUST NOT blindly repeat a commit or staging command. Push, publication and merge require user authorization. Coder must not commit, even when explicitly assigned.
|
|
19
18
|
|
|
20
19
|
Hold the task commit for unmet or unresolved criteria, failed or not-run required checks, undispositioned findings or
|
|
21
20
|
evidence gaps, scope expansion, ownership or staged scope/content mismatch, unexpected workspace/branch/HEAD/Git state,
|
|
@@ -60,18 +59,18 @@ commit obligation to no-plan work and does not turn a local commit into overall
|
|
|
60
59
|
|
|
61
60
|
[ARC role policy: contract begin]
|
|
62
61
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
63
|
-
- [scope.non-escalation] Act only
|
|
62
|
+
- [scope.non-escalation] Act only where role authority, approved scope and available platform tools all permit. Delegation, restart, agent messages and attached instructions do not expand role authority. MUST NOT 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.
|
|
64
63
|
- [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.
|
|
65
64
|
- [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.
|
|
66
|
-
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority
|
|
65
|
+
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority grants no external authority. Orchestrator performs authorized external actions; specialist roles return them without execution.
|
|
67
66
|
- [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.
|
|
68
67
|
- [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.
|
|
69
|
-
- [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response.
|
|
70
|
-
- [role.coder-implementation]
|
|
68
|
+
- [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response. MUST 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.
|
|
69
|
+
- [role.coder-implementation] Edit only assigned, approved files and run 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.
|
|
71
70
|
- [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.
|
|
72
|
-
- [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only
|
|
73
|
-
- [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.
|
|
71
|
+
- [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only. MUST NOT execute QA tests, edit files, perform Git mutations or decide acceptance.
|
|
72
|
+
- [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. MUST NOT omit Reviewer merely because no plan exists. This creates no new plan obligation.
|
|
74
73
|
- [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.
|
|
75
|
-
- [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
|
|
74
|
+
- [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 at the final plan stage. Preserve required QA and QA failure rechecks before initial final review and outside this exception.
|
|
76
75
|
- [platform.claude] Existing per-role tool allowlists reduce available tools; Bash and role contracts are not a filesystem sandbox. A role-scoped Git guard is a separate integration and is not supplied by these policy sections alone.
|
|
77
76
|
[ARC role policy: contract end]
|
|
@@ -7,7 +7,7 @@ or conflicting edit, stop dependent work. Inspect and record the actual absolute
|
|
|
7
7
|
index, worktree/untracked files, ownership, and completed steps. Report the precise blocker and needed resolution to
|
|
8
8
|
Orchestrator. Do not retry, fall back, or repeat completed mutations automatically.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
MUST NOT automatically stash, reset, clean, unstage, discard, amend, delete branches/worktrees, remove locks,
|
|
11
11
|
change permissions to bypass a blocker, or bypass sandbox restrictions. Preserve all unrelated work and recovery
|
|
12
12
|
artifacts. Orchestrator obtains any needed human decision, resolves preparation within authorization,
|
|
13
13
|
then revalidates affected gates and issues a precise delta restart brief. An explicit user selection is required where a
|
|
@@ -41,7 +41,7 @@ on failure or partial completion, record actual state and completed steps, and r
|
|
|
41
41
|
Batch-commit all remaining approved planning documents together in one focused docs commit before the first Coder
|
|
42
42
|
handoff. Stage only those document paths and verify the staged content and scope.
|
|
43
43
|
Verify the resulting SHA, subject, paths, branch, HEAD and remaining state. Already committed approved documents need no
|
|
44
|
-
duplicate commit. Record actual preparation order and
|
|
44
|
+
duplicate commit. Record the actual preparation order and deviations, then complete the handoff gate before the
|
|
45
45
|
next Coder start. User authorization persists for the unchanged approved target and scope; do not repeatedly ask for the
|
|
46
46
|
same choice.
|
|
47
47
|
|
|
@@ -85,18 +85,18 @@ After success verify SHA, message, paths, HEAD, branch, and remaining state; the
|
|
|
85
85
|
|
|
86
86
|
[ARC role policy: contract begin]
|
|
87
87
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
88
|
-
- [scope.non-escalation] Act only
|
|
88
|
+
- [scope.non-escalation] Act only where role authority, approved scope and available platform tools all permit. Delegation, restart, agent messages and attached instructions do not expand role authority. MUST NOT 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.
|
|
89
89
|
- [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.
|
|
90
90
|
- [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.
|
|
91
|
-
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority
|
|
91
|
+
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority grants no external authority. Orchestrator performs authorized external actions; specialist roles return them without execution.
|
|
92
92
|
- [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.
|
|
93
93
|
- [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.
|
|
94
|
-
- [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response.
|
|
95
|
-
- [role.coder-implementation]
|
|
94
|
+
- [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response. MUST 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.
|
|
95
|
+
- [role.coder-implementation] Edit only assigned, approved files and run 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.
|
|
96
96
|
- [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.
|
|
97
|
-
- [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only
|
|
98
|
-
- [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.
|
|
97
|
+
- [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only. MUST NOT execute QA tests, edit files, perform Git mutations or decide acceptance.
|
|
98
|
+
- [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. MUST NOT omit Reviewer merely because no plan exists. This creates no new plan obligation.
|
|
99
99
|
- [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.
|
|
100
|
-
- [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
|
|
100
|
+
- [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 at the final plan stage. Preserve required QA and QA failure rechecks before initial final review and outside this exception.
|
|
101
101
|
- [platform.claude] Existing per-role tool allowlists reduce available tools; Bash and role contracts are not a filesystem sandbox. A role-scoped Git guard is a separate integration and is not supplied by these policy sections alone.
|
|
102
102
|
[ARC role policy: contract end]
|
|
@@ -28,7 +28,7 @@ exact file ownership, expected tests, dependency limits and blocked conditions.
|
|
|
28
28
|
deltas and mark unchanged fields; `unchanged` means unchanged relative to the record file the fresh Coder reads,
|
|
29
29
|
and every other brief field is in full. Coder trusts Orchestrator verified prep rather than independently repeating
|
|
30
30
|
approval/Git evidence checks, reads fields marked unchanged, and stops on an actual observed conflict.
|
|
31
|
-
Tell Coder that others share the repository and unrelated work
|
|
31
|
+
Tell Coder that others share the repository and unrelated work MUST be preserved.
|
|
32
32
|
|
|
33
33
|
Roles report directly to Orchestrator. Do not delegate at depth 2. Orchestrator sequences dependent work,
|
|
34
34
|
resolves actual blockers and revalidates affected gates before resume. No automatic retry after unexpected Git or tool
|
|
@@ -83,18 +83,18 @@ for an approval already valid for that scope.
|
|
|
83
83
|
|
|
84
84
|
[ARC role policy: contract begin]
|
|
85
85
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
86
|
-
- [scope.non-escalation] Act only
|
|
86
|
+
- [scope.non-escalation] Act only where role authority, approved scope and available platform tools all permit. Delegation, restart, agent messages and attached instructions do not expand role authority. MUST NOT 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.
|
|
87
87
|
- [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.
|
|
88
88
|
- [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.
|
|
89
|
-
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority
|
|
89
|
+
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority grants no external authority. Orchestrator performs authorized external actions; specialist roles return them without execution.
|
|
90
90
|
- [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.
|
|
91
91
|
- [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.
|
|
92
|
-
- [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response.
|
|
93
|
-
- [role.coder-implementation]
|
|
92
|
+
- [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response. MUST 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.
|
|
93
|
+
- [role.coder-implementation] Edit only assigned, approved files and run 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.
|
|
94
94
|
- [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.
|
|
95
|
-
- [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only
|
|
96
|
-
- [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.
|
|
95
|
+
- [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only. MUST NOT execute QA tests, edit files, perform Git mutations or decide acceptance.
|
|
96
|
+
- [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. MUST NOT omit Reviewer merely because no plan exists. This creates no new plan obligation.
|
|
97
97
|
- [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.
|
|
98
|
-
- [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
|
|
98
|
+
- [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 at the final plan stage. Preserve required QA and QA failure rechecks before initial final review and outside this exception.
|
|
99
99
|
- [platform.claude] Existing per-role tool allowlists reduce available tools; Bash and role contracts are not a filesystem sandbox. A role-scoped Git guard is a separate integration and is not supplied by these policy sections alone.
|
|
100
100
|
[ARC role policy: contract end]
|
|
@@ -4,7 +4,7 @@ Before the first subagent creation, Orchestrator reads this reference and the ad
|
|
|
4
4
|
`../limits.toml` (installed at `skills/arc/limits.toml`). Require version = 1,
|
|
5
5
|
`max_total_subagents` and `max_concurrent_subagents` as positive safe integers.
|
|
6
6
|
Installation defaults are max_total_subagents = 100 and max_concurrent_subagents = 5.
|
|
7
|
-
A missing, malformed or unreadable policy blocks new creation
|
|
7
|
+
A missing, malformed or unreadable policy blocks new creation. Report it; MUST NOT assume defaults.
|
|
8
8
|
Freeze these settings for one ARC coordination session/tree; reinstalling affects new sessions.
|
|
9
9
|
|
|
10
10
|
## Counting and reservations
|
|
@@ -23,7 +23,7 @@ created + pending reservations + proposed <= max_total_subagents, and
|
|
|
23
23
|
active + pending reservations + proposed <= max_concurrent_subagents and available runtime capacity.
|
|
24
24
|
Record a reservation before each creation call. Confirmed creation converts it into a created,
|
|
25
25
|
active ID. Release a reservation only when failure proves that no instance was created.
|
|
26
|
-
An uncertain result
|
|
26
|
+
An uncertain result retains its reservation and capacity until reconciled. MUST NOT retry blindly.
|
|
27
27
|
Serialize work when a batch does not fit. There are no reserved role slots.
|
|
28
28
|
|
|
29
29
|
## Continuation and exhaustion
|
|
@@ -31,8 +31,8 @@ Serialize work when a batch does not fit. There are no reserved role slots.
|
|
|
31
31
|
Preserve the ledger through continuation, resume and context compaction; reconcile actual instance
|
|
32
32
|
IDs before dispatch. Ledger loss must never reset counters to zero. If reconstruction is incomplete,
|
|
33
33
|
hold creation and report the unknown budget; use a conservative bound only with sufficient evidence.
|
|
34
|
-
Completion frees confirmed active capacity
|
|
35
|
-
creation and requires reporting remaining work and budgets. It
|
|
34
|
+
Completion frees confirmed active capacity; it does not restore the total-created budget. Exhaustion holds new
|
|
35
|
+
creation and requires reporting remaining work and budgets. It does not authorize skipping required
|
|
36
36
|
QA or Reviewer, role freshness, approval, ownership, dependency or same-file edit gates.
|
|
37
37
|
|
|
38
38
|
This cumulative guard and ARC scheduling are prompt-level policy, not hard runtime enforcement.
|
|
@@ -40,7 +40,7 @@ complete draft before saving, even when returned only in chat. Before formal dra
|
|
|
40
40
|
and records the actual absolute workspace/repository, branch or detached HEAD, HEAD, changes and ownership,
|
|
41
41
|
explicit choice and preparation evidence, and absolute document paths inside that target. Planner drafts for that
|
|
42
42
|
verified workspace; Orchestrator saves directly in the selected target. Missing or mismatched evidence stops the
|
|
43
|
-
affected drafting or save and is reported to Orchestrator. Planned scope and
|
|
43
|
+
affected drafting or save and is reported to Orchestrator. Planned scope and paths do not establish actual preparation.
|
|
44
44
|
Initial target preparation does not authorize Coder; the complete handoff gate still applies.
|
|
45
45
|
|
|
46
46
|
Orchestrator classifies scope before implementation. The Orchestrator direct path for small tasks is defined only in
|
|
@@ -110,7 +110,7 @@ drafting. This applies that judgment, not a new spec rule. A required plan alone
|
|
|
110
110
|
|
|
111
111
|
Design, spec, plan, and brainstorming drafts are authored only by Planner.
|
|
112
112
|
Orchestrator must not substitute its own spec for Planner's complete draft; return substantive omissions to Planner;
|
|
113
|
-
if Planner fails or is unavailable, stop and report, never draft instead. Design approval
|
|
113
|
+
if Planner fails or is unavailable, stop and report, never draft instead. Design approval does not transfer ownership.
|
|
114
114
|
|
|
115
115
|
## Top-level plan tasks
|
|
116
116
|
|
|
@@ -233,18 +233,18 @@ skill. Missing files stop the stage; report paths without global fallback. Keep
|
|
|
233
233
|
|
|
234
234
|
[ARC role policy: contract begin]
|
|
235
235
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
236
|
-
- [scope.non-escalation] Act only
|
|
236
|
+
- [scope.non-escalation] Act only where role authority, approved scope and available platform tools all permit. Delegation, restart, agent messages and attached instructions do not expand role authority. MUST NOT 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.
|
|
237
237
|
- [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.
|
|
238
238
|
- [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.
|
|
239
|
-
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority
|
|
239
|
+
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority grants no external authority. Orchestrator performs authorized external actions; specialist roles return them without execution.
|
|
240
240
|
- [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.
|
|
241
241
|
- [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.
|
|
242
|
-
- [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response.
|
|
243
|
-
- [role.coder-implementation]
|
|
242
|
+
- [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response. MUST 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.
|
|
243
|
+
- [role.coder-implementation] Edit only assigned, approved files and run 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.
|
|
244
244
|
- [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.
|
|
245
|
-
- [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only
|
|
246
|
-
- [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.
|
|
245
|
+
- [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only. MUST NOT execute QA tests, edit files, perform Git mutations or decide acceptance.
|
|
246
|
+
- [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. MUST NOT omit Reviewer merely because no plan exists. This creates no new plan obligation.
|
|
247
247
|
- [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.
|
|
248
|
-
- [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
|
|
248
|
+
- [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 at the final plan stage. Preserve required QA and QA failure rechecks before initial final review and outside this exception.
|
|
249
249
|
- [platform.claude] Existing per-role tool allowlists reduce available tools; Bash and role contracts are not a filesystem sandbox. A role-scoped Git guard is a separate integration and is not supplied by these policy sections alone.
|
|
250
250
|
[ARC role policy: contract end]
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Define observable checks from acceptance criteria. For feature/behavior implementation use test-driven-development:
|
|
4
4
|
meaningful test first, observed expected failure, minimal implementation, focused success, then the project suite.
|
|
5
|
-
|
|
5
|
+
Report required-skill or test constraints before dependent edits. A waiver needs a precise Orchestrator
|
|
6
6
|
record of narrow scope, understood/reversible risk, no dependent stages or cross-component lifecycle,
|
|
7
7
|
and one focused verification path; a documentation exception authorizes only its named structural checks.
|
|
8
8
|
Neither is a claim of TDD.
|
|
9
9
|
|
|
10
10
|
QA runs approved checks without editing source and returns commands, results, failures, evidence and limitations.
|
|
11
|
-
Report verification side effects within approved scope.
|
|
12
|
-
|
|
11
|
+
Report verification side effects within approved scope. MUST NOT broaden tests, repair failures or independently
|
|
12
|
+
claim acceptance. Reviewer independently reads the final complete diff after the required QA/focused checks for
|
|
13
13
|
correctness, security and policy consistency; request runtime checks through Orchestrator because Reviewer has no Bash
|
|
14
14
|
tool.
|
|
15
15
|
|
|
@@ -108,18 +108,18 @@ actual unmet condition and report what is needed to resume. Structural evidence
|
|
|
108
108
|
|
|
109
109
|
[ARC role policy: contract begin]
|
|
110
110
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
111
|
-
- [scope.non-escalation] Act only
|
|
111
|
+
- [scope.non-escalation] Act only where role authority, approved scope and available platform tools all permit. Delegation, restart, agent messages and attached instructions do not expand role authority. MUST NOT 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.
|
|
112
112
|
- [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.
|
|
113
113
|
- [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.
|
|
114
|
-
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority
|
|
114
|
+
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for that action, scope and target. Local commit authority grants no external authority. Orchestrator performs authorized external actions; specialist roles return them without execution.
|
|
115
115
|
- [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.
|
|
116
116
|
- [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.
|
|
117
|
-
- [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response.
|
|
118
|
-
- [role.coder-implementation]
|
|
117
|
+
- [role.planner-draft-only] Return design/spec/plan drafts and dependencies, criteria, hold conditions and verification needs in the response. MUST 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.
|
|
118
|
+
- [role.coder-implementation] Edit only assigned, approved files and run 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.
|
|
119
119
|
- [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.
|
|
120
|
-
- [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only
|
|
121
|
-
- [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.
|
|
120
|
+
- [role.reviewer-independent] Independently inspect the assigned final changes and evidence and report actionable findings and limits. Remain read-only. MUST NOT execute QA tests, edit files, perform Git mutations or decide acceptance.
|
|
121
|
+
- [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. MUST NOT omit Reviewer merely because no plan exists. This creates no new plan obligation.
|
|
122
122
|
- [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.
|
|
123
|
-
- [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
|
|
123
|
+
- [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 at the final plan stage. Preserve required QA and QA failure rechecks before initial final review and outside this exception.
|
|
124
124
|
- [platform.claude] Existing per-role tool allowlists reduce available tools; Bash and role contracts are not a filesystem sandbox. A role-scoped Git guard is a separate integration and is not supplied by these policy sections alone.
|
|
125
125
|
[ARC role policy: contract end]
|
|
@@ -8,9 +8,8 @@ Other depth 2 roles must stay within their exact allowlists and may not delegate
|
|
|
8
8
|
Determine actual available browser and preview capabilities before use; do not assume managed preview tools exist.
|
|
9
9
|
Use an available authorized local/browser workflow only when scoped by Orchestrator.
|
|
10
10
|
Keep preview artifacts separate from user files, record generated side effects, preserve unrelated work,
|
|
11
|
-
and report unavailable capabilities without claiming visual verification.
|
|
12
|
-
without authorization.
|
|
11
|
+
and report unavailable capabilities without claiming visual verification. MUST NOT expose secrets or publish a preview without authorization.
|
|
13
12
|
|
|
14
13
|
Upstream guide/scripts: `<installed ARC>/references/superpowers/brainstorming/visual-companion.md` and adjacent `scripts/`.
|
|
15
14
|
ARC guide: `references/visual-companion.md`; Orchestrator briefs absolute paths and retains approval/server/browser
|
|
16
|
-
ownership. Missing files stop dependent work
|
|
15
|
+
ownership. Missing files stop dependent work. MUST NOT use a global fallback.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {evaluate} from '../evaluate.mjs';
|
|
2
|
+
import {evaluateCapability} from '../capabilities.mjs';
|
|
3
|
+
import {registerAgentObservation} from '../identity.mjs';
|
|
4
|
+
import {transactWorkflow, fingerprintRequest} from '../store.mjs';
|
|
5
|
+
import {runGate} from '../gate.mjs';
|
|
6
|
+
import {classifyGitCommand} from '../git-query.mjs';
|
|
7
|
+
|
|
8
|
+
const text=v=>typeof v==='string'&&v.length>0;
|
|
9
|
+
const object=v=>v!==null&&typeof v==='object'&&!Array.isArray(v);
|
|
10
|
+
const supported=new Set(['Read','Glob','Grep','Bash','Write','Edit','MultiEdit','Agent']);
|
|
11
|
+
const deny=reason=>({decision:'deny',reason,ruleIds:['runtime.claude'],proposedTransition:null});
|
|
12
|
+
/** Host-verified support for this installed version is required. A config value
|
|
13
|
+
* alone cannot establish hook failure blocking; provider wiring belongs to T6. */
|
|
14
|
+
export function claudeFailureBlockingReady(support){
|
|
15
|
+
return support?.status==='verified'&&support.onFailure==='block'&&text(support.platformVersion)&&text(support.verificationRef);
|
|
16
|
+
}
|
|
17
|
+
/** Context is a trusted host dependency, never deserialized from stdin/tool_input.
|
|
18
|
+
* describeTool must parse the complete tool invocation conservatively, and supply
|
|
19
|
+
* semantic operation, paths and descriptor. No native provider is assumed here. */
|
|
20
|
+
export function normalizeClaudeEvent(input,context={}){
|
|
21
|
+
if(!object(input)||input.hook_event_name!=='PreToolUse'||!text(input.session_id)||input.session_id!==context.sessionRef||!text(context.actorRef)||!text(context.taskId)||!text(context.requestId)||!text(input.tool_use_id)||input.tool_use_id!==context.toolUseId||!text(input.tool_name)||!object(input.tool_input)||!text(input.cwd))throw Error('Verified session identity and complete PreToolUse event required');
|
|
22
|
+
const toolPath=input.tool_name;
|
|
23
|
+
const coverage={...evaluateCapability({platform:'claude',toolPath,sessionRef:context.sessionRef}),enforcement:'hook-response-only',nativeVerified:false,startupTimeout:'unknown',existingSessionInput:'unsupported',specializedPaths:'unknown',hostedTools:'unsupported'};
|
|
24
|
+
if(!claudeFailureBlockingReady(context.failureBlocking))throw Error('Verified current-version onFailure block contract required');
|
|
25
|
+
if(!supported.has(input.tool_name))return {request:null,coverage};
|
|
26
|
+
if(typeof context.describeTool!=='function')throw Error('Trusted semantic tool provider unavailable');
|
|
27
|
+
const semantic=context.describeTool(structuredClone(input));
|
|
28
|
+
if(!object(semantic)||!text(semantic.operation)||!Array.isArray(semantic.paths)||!object(semantic.descriptor))throw Error('Complete semantic tool descriptor required');
|
|
29
|
+
if(input.tool_name==='Agent'&&semantic.operation!=='assign-agent')throw Error('Agent tool requires assignment validation');
|
|
30
|
+
return {request:{requestId:context.requestId,platform:'claude',actorRef:context.actorRef,taskId:context.taskId,cwd:input.cwd,toolName:input.tool_name,arguments:structuredClone(input.tool_input),operation:semantic.operation,paths:structuredClone(semantic.paths),descriptor:structuredClone(semantic.descriptor)},coverage};
|
|
31
|
+
}
|
|
32
|
+
/** Only documented PreToolUse fields are emitted. hold is a native deny. */
|
|
33
|
+
export function renderClaudeDecision(decision){
|
|
34
|
+
if(decision?.decision==='allow')return {};
|
|
35
|
+
const permissionDecision='deny';
|
|
36
|
+
return {hookSpecificOutput:{hookEventName:'PreToolUse',permissionDecision,permissionDecisionReason:typeof decision?.reason==='string'?decision.reason:'Runtime gate could not verify permission'}};
|
|
37
|
+
}
|
|
38
|
+
/** This returns a response, not proof the host applied it. Startup failures,
|
|
39
|
+
* timeout, hosted/specialized paths and existing write_stdin are outside it. */
|
|
40
|
+
export async function runClaudeGate(input,context={}){
|
|
41
|
+
if(input?.hook_event_name==='PostToolUse'){
|
|
42
|
+
// Result recording cannot authorize assignment/start or prevent a completed call.
|
|
43
|
+
try{if(input.session_id===context.sessionRef&&input.tool_use_id===context.toolUseId&&text(context.actorRef)&&typeof context.recordToolResult==='function')await context.recordToolResult(structuredClone(input));}catch{}
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
46
|
+
if(input?.hook_event_name==='SubagentStart'){
|
|
47
|
+
// SubagentStart cannot prevent startup. Only a trusted provider can correlate
|
|
48
|
+
// agent_id with a pending assignment; tool/event agent_type is not authority.
|
|
49
|
+
try{
|
|
50
|
+
if(input.session_id===context.sessionRef&&text(input.agent_id)&&typeof context.observeAgent==='function'){
|
|
51
|
+
const observation=await context.observeAgent(structuredClone(input));
|
|
52
|
+
if(observation?.actorRef===input.agent_id&&observation.platform==='claude'){
|
|
53
|
+
const decision=registerAgentObservation(context.state,observation);
|
|
54
|
+
if(decision.decision==='allow'&&decision.proposedTransition&&typeof context.persistObservation==='function')await context.persistObservation(decision,observation);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}catch{/* Observation failure never claims startup was blocked. */}
|
|
58
|
+
return {};
|
|
59
|
+
}
|
|
60
|
+
try{
|
|
61
|
+
const {request,coverage}=normalizeClaudeEvent(input,context);
|
|
62
|
+
if(!request)return renderClaudeDecision(deny('Tool path has no verified pre-action coverage'));
|
|
63
|
+
if(!text(context.statePath))return renderClaudeDecision(deny('Trusted durable workflow store unavailable'));
|
|
64
|
+
const result=await transactWorkflow({statePath:context.statePath,expectedRevision:context.state?.revision,requestId:request.requestId,request,requestFingerprint:fingerprintRequest(request),decide:async state=>{
|
|
65
|
+
const decision=evaluate(context.policy,state,request,context.evidence);
|
|
66
|
+
if(decision.decision!=='allow')return {...decision,coverage};
|
|
67
|
+
const actor=state.identities.find(identity=>identity.actorRef===request.actorRef);
|
|
68
|
+
if(request.toolName==='Bash'&&actor?.role!=='orchestrator'){
|
|
69
|
+
const query=classifyGitCommand(request.arguments.command,context.policy.git);
|
|
70
|
+
if(!query.allowed)return {...deny('Specialist Git guard: '+query.reason),coverage};
|
|
71
|
+
}
|
|
72
|
+
if(request.operation==='commit'){
|
|
73
|
+
const git=await runGate({phase:'preflight',state,request,gitEvidence:context.gitEvidence});
|
|
74
|
+
if(git.decision!=='allow')return {...git,coverage};
|
|
75
|
+
return {...decision,expectedCommit:git.expectedCommit,coverage};
|
|
76
|
+
}
|
|
77
|
+
return {...decision,coverage};
|
|
78
|
+
}});
|
|
79
|
+
return renderClaudeDecision(result.decision);
|
|
80
|
+
}catch(error){return renderClaudeDecision(deny('Runtime validation unavailable: '+error.message));}
|
|
81
|
+
}
|