@yunhozz/arc 0.5.6 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MANIFEST.sha256 +124 -110
- package/README.md +37 -113
- package/claude/agents/arc-architect.md +44 -0
- package/claude/agents/arc-implementer.md +2 -2
- package/claude/agents/arc-planner.md +5 -5
- package/claude/agents/arc-reviewer.md +1 -1
- package/claude/agents/arc-scouter.md +1 -1
- package/claude/agents/arc-tester.md +1 -1
- package/claude/skill/SKILL.md +6 -6
- package/claude/skill/models.toml +5 -1
- package/claude/skill/references/arc-visual-companion.md +2 -21
- package/claude/skill/references/commit.md +5 -32
- package/claude/skill/references/coordination.md +29 -134
- package/claude/skill/references/git-recovery.md +3 -3
- package/claude/skill/references/handoff-prep.md +9 -24
- package/claude/skill/references/handoff.md +19 -108
- package/claude/skill/references/limits.md +4 -15
- package/claude/skill/references/planning.md +32 -119
- package/claude/skill/references/verification.md +17 -119
- package/claude/skill/references/worktree-creation.md +1 -1
- package/claude/skill/scripts/model_config.py +24 -11
- package/codex/agents/arc-architect.md +36 -0
- package/codex/agents/{arc-implementer.toml → arc-implementer.md} +10 -5
- package/codex/agents/{arc-planner.toml → arc-planner.md} +14 -7
- package/codex/agents/{arc-reviewer.toml → arc-reviewer.md} +13 -4
- package/codex/agents/{arc-scouter.toml → arc-scouter.md} +13 -4
- package/codex/agents/{arc-tester.toml → arc-tester.md} +13 -4
- package/codex/skill/SKILL.md +6 -6
- package/codex/skill/models.toml +5 -1
- package/codex/skill/references/arc-visual-companion.md +3 -27
- package/codex/skill/references/commit.md +5 -32
- package/codex/skill/references/coordination.md +25 -131
- package/codex/skill/references/git-recovery.md +2 -7
- package/codex/skill/references/handoff-prep.md +9 -24
- package/codex/skill/references/handoff.md +19 -108
- package/codex/skill/references/limits.md +5 -16
- package/codex/skill/references/planning.md +32 -119
- package/codex/skill/references/verification.md +16 -118
- package/codex/skill/scripts/apply-models.py +5 -5
- package/codex/skill/scripts/model_config.py +23 -12
- package/gemini/GEMINI.md +1 -1
- package/gemini/agents/arc-architect.md +39 -0
- package/gemini/agents/arc-implementer.md +1 -1
- package/gemini/agents/arc-planner.md +4 -4
- package/gemini/instructions.md +1 -1
- package/gemini/skill/SKILL.md +6 -6
- package/gemini/skill/models.toml +5 -1
- package/gemini/skill/references/arc-visual-companion.md +2 -21
- package/gemini/skill/references/commit.md +5 -32
- package/gemini/skill/references/coordination.md +32 -137
- package/gemini/skill/references/git-recovery.md +3 -3
- package/gemini/skill/references/handoff-prep.md +9 -24
- package/gemini/skill/references/handoff.md +19 -108
- package/gemini/skill/references/limits.md +4 -15
- package/gemini/skill/references/planning.md +32 -119
- package/gemini/skill/references/verification.md +17 -119
- package/grok/AGENTS.md +1 -1
- package/grok/agents/arc-architect.md +39 -0
- package/grok/agents/arc-implementer.md +1 -1
- package/grok/agents/arc-planner.md +4 -4
- package/grok/instructions.md +1 -1
- package/grok/skill/SKILL.md +5 -5
- package/grok/skill/models.toml +5 -1
- package/grok/skill/references/arc-visual-companion.md +2 -21
- package/grok/skill/references/commit.md +5 -32
- package/grok/skill/references/coordination.md +30 -135
- package/grok/skill/references/git-recovery.md +3 -3
- package/grok/skill/references/handoff-prep.md +9 -24
- package/grok/skill/references/handoff.md +19 -108
- package/grok/skill/references/limits.md +4 -15
- package/grok/skill/references/planning.md +32 -119
- package/grok/skill/references/verification.md +17 -119
- package/lib/installer/global-config.mjs +1 -1
- package/lib/installer/manifest.mjs +20 -3
- package/lib/installer/role-routing.mjs +6 -3
- package/lib/installer/targets.mjs +1 -1
- package/lib/installer/upgrade-state.mjs +3 -2
- package/lib/models/config.mjs +22 -5
- package/lib/models/profiles.mjs +6 -1
- package/lib/platforms/agent-templates.mjs +1 -0
- package/lib/platforms/codex.mjs +2 -0
- package/lib/platforms/formats/codex-markdown.mjs +58 -0
- package/lib/platforms/formats/gemini-markdown.mjs +3 -2
- package/lib/platforms/formats/grok-markdown.mjs +3 -2
- package/lib/platforms/formats/markdown.mjs +3 -2
- package/lib/platforms/formats/toml.mjs +3 -2
- package/lib/policy/placement.mjs +1 -1
- package/lib/policy/render.mjs +6 -5
- package/lib/policy/role-policy.json +36 -7
- package/lib/prompts/agent-fragments.json +107 -24
- package/lib/prompts/render.mjs +69 -19
- package/lib/runtime/adapters/codex.mjs +1 -1
- package/lib/runtime/evaluate.mjs +4 -3
- package/lib/runtime/identity.mjs +1 -1
- package/lib/runtime/operations.mjs +2 -2
- package/lib/runtime/role-bridge-args.mjs +5 -3
- package/lib/runtime/role-bridge.mjs +24 -2
- package/lib/runtime/role-dispatch-policy.mjs +2 -1
- package/lib/runtime/role-dispatch-store.mjs +44 -1
- package/lib/runtime/role-observe.mjs +12 -4
- package/lib/runtime/role-routing-config.mjs +9 -4
- package/lib/runtime/role-supervisor.mjs +16 -2
- package/lib/tui/diagram.mjs +2 -3
- package/lib/tui/setup.mjs +13 -11
- package/lib/watch/labels.mjs +1 -1
- package/lib/watch/model.mjs +2 -2
- package/lib/watch/render.mjs +2 -2
- package/package.json +1 -1
- package/scripts/update-manifest.mjs +1 -1
- package/shared/skill/references/arc-visual-companion-common.md +39 -0
- package/shared/skill/references/commit-common.md +45 -0
- package/shared/skill/references/coordination-common.md +200 -0
- package/shared/skill/references/git-recovery-common.md +15 -0
- package/shared/skill/references/handoff-common.md +182 -0
- package/shared/skill/references/handoff-prep-common.md +53 -0
- package/shared/skill/references/limits-common.md +34 -0
- package/shared/skill/references/planning-common.md +185 -0
- package/shared/skill/references/verification-common.md +172 -0
- package/shared/skill/runtime/adapters/codex.mjs +1 -1
- package/shared/skill/runtime/evaluate.mjs +4 -3
- package/shared/skill/runtime/identity.mjs +1 -1
- package/shared/skill/runtime/operations.mjs +2 -2
- package/shared/skill/runtime/role-bridge-args.mjs +5 -3
- package/shared/skill/runtime/role-bridge.mjs +24 -2
- package/shared/skill/runtime/role-dispatch-policy.mjs +2 -1
- package/shared/skill/runtime/role-dispatch-store.mjs +44 -1
- package/shared/skill/runtime/role-observe.mjs +12 -4
- package/shared/skill/runtime/role-policy.json +36 -7
- package/shared/skill/runtime/role-routing-config.mjs +9 -4
- package/shared/skill/runtime/role-supervisor.mjs +16 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {parseToml} from '../../models/config.mjs';
|
|
2
|
+
import {TargetConfigurationError} from '../../installer/target-errors.mjs';
|
|
3
|
+
|
|
4
|
+
function frontmatterValue(line, key) {
|
|
5
|
+
const prefix = `${key}: `;
|
|
6
|
+
if (!line?.startsWith(prefix)) {
|
|
7
|
+
throw new TargetConfigurationError(`Expected Codex agent frontmatter key: ${key}`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const value = line.slice(prefix.length);
|
|
11
|
+
if (!value || value !== value.trim() || /[\p{Cc}\u2028\u2029]/u.test(value)
|
|
12
|
+
|| value.includes(': ') || value.includes(' #') || /^["'[\]{},%@`!&*|>]|^[-?:]\s/u.test(value)) {
|
|
13
|
+
throw new TargetConfigurationError(`Invalid Codex agent frontmatter value: ${key}`);
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function compile(bytes, role) {
|
|
19
|
+
let source;
|
|
20
|
+
try {
|
|
21
|
+
source = new TextDecoder('utf-8', {fatal: true, ignoreBOM: true}).decode(bytes);
|
|
22
|
+
} catch (cause) {
|
|
23
|
+
throw new TargetConfigurationError('Codex agent template must be valid UTF-8', {cause});
|
|
24
|
+
}
|
|
25
|
+
if (/[\u0000-\u0008\u000b-\u001f\u007f\ufeff]/u.test(source)) {
|
|
26
|
+
throw new TargetConfigurationError('Codex agent template contains a forbidden character');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const [opening, nameLine, descriptionLine, closing, separator, ...bodyLines] = source.split('\n');
|
|
30
|
+
if (opening !== '---' || closing !== '---' || separator !== '') {
|
|
31
|
+
throw new TargetConfigurationError('Invalid Codex agent frontmatter fences or body separator');
|
|
32
|
+
}
|
|
33
|
+
const name = frontmatterValue(nameLine, 'name');
|
|
34
|
+
const description = frontmatterValue(descriptionLine, 'description');
|
|
35
|
+
if (name !== role || !/^arc_(scouter|architect|planner|implementer|tester|reviewer)$/.test(name)) {
|
|
36
|
+
throw new TargetConfigurationError('Codex agent template name must match a supported role');
|
|
37
|
+
}
|
|
38
|
+
if (!bodyLines[0] || bodyLines.at(-1) !== '') {
|
|
39
|
+
throw new TargetConfigurationError('Codex agent template requires a body after one blank line and a final LF');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const body = bodyLines.join('\n');
|
|
43
|
+
const escapedBody = body.replaceAll('\\', '\\\\').replace(/"{3}/g, '""\\"');
|
|
44
|
+
const output = `name = ${JSON.stringify(name)}\ndescription = ${JSON.stringify(description)}\n`
|
|
45
|
+
+ `developer_instructions = """\n${escapedBody}"""\n`;
|
|
46
|
+
const expected = Object.entries({name, description, developer_instructions: body});
|
|
47
|
+
let parsed;
|
|
48
|
+
try {
|
|
49
|
+
parsed = parseToml(output);
|
|
50
|
+
} catch (cause) {
|
|
51
|
+
throw new TargetConfigurationError('Generated Codex agent TOML could not be parsed', {cause});
|
|
52
|
+
}
|
|
53
|
+
if (Object.keys(parsed).length !== expected.length
|
|
54
|
+
|| expected.some(([key, value]) => !Object.hasOwn(parsed, key) || parsed[key] !== value)) {
|
|
55
|
+
throw new TargetConfigurationError('Generated Codex agent TOML does not match the template');
|
|
56
|
+
}
|
|
57
|
+
return Buffer.from(output);
|
|
58
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import {hasStandaloneOwnershipMarker} from '../../models/profiles.mjs';
|
|
1
2
|
import {TargetConfigurationError} from '../../installer/target-errors.mjs';
|
|
2
3
|
import {getPlatform} from '../../runtime/platform-registry.mjs';
|
|
3
4
|
import {revisionTag} from '../../runtime/role-dispatch-policy.mjs';
|
|
4
5
|
|
|
5
6
|
const fail = message => {throw new TargetConfigurationError(message);};
|
|
6
|
-
const validRole = role => /^arc_(scouter|planner|implementer|tester|reviewer)$/.test(role);
|
|
7
|
+
const validRole = role => /^arc_(scouter|architect|planner|implementer|tester|reviewer)$/.test(role);
|
|
7
8
|
const nonStringScalar = /^(?:~|null|true|false|yes|no|on|off|[-+]?(?:\.inf|\.nan|0[xob][0-9a-f_]+|(?:\d[\d_]*(?:\.[\d_]*)?|\.[\d_]+)(?:e[-+]?\d+)?)|\d{4}-\d{2}-\d{2}(?:[Tt ].*)?)$/i;
|
|
8
9
|
// Inline brackets remain valid text for the ARC routing revision tag.
|
|
9
10
|
const validScalar = value => value === value.trim() && !/[\p{Cc}\u2028\u2029{}#&*!|>"']/u.test(value)
|
|
@@ -34,7 +35,7 @@ export function render(text, role, settings) {
|
|
|
34
35
|
export function isOwnedStandalone(bytes, role, {legacy = false} = {}) {
|
|
35
36
|
try {
|
|
36
37
|
const text = bytes.toString('utf8'), {fields} = parse(text);
|
|
37
|
-
return (validRole(role) || legacy && role === 'arc_qa') && fields.name === role.replace('_', '-') &&
|
|
38
|
+
return (validRole(role) || legacy && role === 'arc_qa') && fields.name === role.replace('_', '-') && hasStandaloneOwnershipMarker(text);
|
|
38
39
|
} catch {return false;}
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import {hasStandaloneOwnershipMarker} from '../../models/profiles.mjs';
|
|
1
2
|
import {TargetConfigurationError} from '../../installer/target-errors.mjs';
|
|
2
3
|
import {getPlatform} from '../../runtime/platform-registry.mjs';
|
|
3
4
|
import {revisionTag} from '../../runtime/role-dispatch-policy.mjs';
|
|
4
5
|
|
|
5
6
|
const fail = message => {throw new TargetConfigurationError(message);};
|
|
6
|
-
const validRole = role => /^arc_(scouter|planner|implementer|tester|reviewer)$/.test(role);
|
|
7
|
+
const validRole = role => /^arc_(scouter|architect|planner|implementer|tester|reviewer)$/.test(role);
|
|
7
8
|
const nonStringScalar = /^(?:~|null|true|false|yes|no|on|off|[-+]?(?:\.inf|\.nan|0[xob][0-9a-f_]+|(?:\d[\d_]*(?:\.[\d_]*)?|\.[\d_]+)(?:e[-+]?\d+)?)|\d{4}-\d{2}-\d{2}(?:[Tt ].*)?)$/i;
|
|
8
9
|
// Inline brackets remain valid text for the ARC routing revision tag.
|
|
9
10
|
const validScalar = value => value === value.trim() && !/[\p{Cc}\u2028\u2029{}#&*!|>"']/u.test(value)
|
|
@@ -35,7 +36,7 @@ export function render(text, role, settings) {
|
|
|
35
36
|
export function isOwnedStandalone(bytes, role, {legacy = false} = {}) {
|
|
36
37
|
try {
|
|
37
38
|
const text = bytes.toString('utf8'), {fields} = parse(text);
|
|
38
|
-
return (validRole(role) || legacy && role === 'arc_qa') && fields.name === role.replace('_', '-') &&
|
|
39
|
+
return (validRole(role) || legacy && role === 'arc_qa') && fields.name === role.replace('_', '-') && hasStandaloneOwnershipMarker(text);
|
|
39
40
|
} catch {return false;}
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {hasStandaloneOwnershipMarker} from '../../models/profiles.mjs';
|
|
1
2
|
import {TargetConfigurationError} from '../../installer/target-errors.mjs';
|
|
2
3
|
import {revisionTag} from '../../runtime/role-dispatch-policy.mjs';
|
|
3
4
|
export {renderClaude as render} from '../../models/profiles.mjs';
|
|
@@ -6,9 +7,9 @@ export {readClaudeConcurrency as readConcurrency, renderClaudeConcurrency as ren
|
|
|
6
7
|
const fail=message=>{throw new TargetConfigurationError(message);};
|
|
7
8
|
export function isOwnedStandalone(bytes,role,{legacy=false}={}){
|
|
8
9
|
const platform='claude';
|
|
9
|
-
if(!/^arc_(scouter|planner|implementer|tester|reviewer)$/.test(role)&&!(legacy&&role==='arc_qa'))return false;
|
|
10
|
+
if(!/^arc_(scouter|architect|planner|implementer|tester|reviewer)$/.test(role)&&!(legacy&&role==='arc_qa'))return false;
|
|
10
11
|
const text=bytes.toString('utf8'),suffix=role.slice(4);
|
|
11
|
-
if(
|
|
12
|
+
if(!hasStandaloneOwnershipMarker(text))return false;
|
|
12
13
|
if(platform==='claude'){
|
|
13
14
|
const front=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(text);if(!front)return false;
|
|
14
15
|
const names=front[1].match(/^name: .*\r?$/gm)??[];return names.length===1&&new RegExp(`^name: arc-${suffix}\\r?$`).test(names[0]);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {hasStandaloneOwnershipMarker} from '../../models/profiles.mjs';
|
|
1
2
|
import {TargetConfigurationError} from '../../installer/target-errors.mjs';
|
|
2
3
|
import {revisionTag} from '../../runtime/role-dispatch-policy.mjs';
|
|
3
4
|
export {renderCodex as render} from '../../models/profiles.mjs';
|
|
@@ -6,9 +7,9 @@ export {readCodexConcurrency as readConcurrency, renderCodexConcurrency as rende
|
|
|
6
7
|
const fail=message=>{throw new TargetConfigurationError(message);};
|
|
7
8
|
export function isOwnedStandalone(bytes,role,{legacy=false}={}){
|
|
8
9
|
const platform='codex';
|
|
9
|
-
if(!/^arc_(scouter|planner|implementer|tester|reviewer)$/.test(role)&&!(legacy&&role==='arc_qa'))return false;
|
|
10
|
+
if(!/^arc_(scouter|architect|planner|implementer|tester|reviewer)$/.test(role)&&!(legacy&&role==='arc_qa'))return false;
|
|
10
11
|
const text=bytes.toString('utf8'),suffix=role.slice(4);
|
|
11
|
-
if(
|
|
12
|
+
if(!hasStandaloneOwnershipMarker(text))return false;
|
|
12
13
|
if(platform==='claude'){
|
|
13
14
|
const front=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(text);if(!front)return false;
|
|
14
15
|
const names=front[1].match(/^name: .*\r?$/gm)??[];return names.length===1&&new RegExp(`^name: arc-${suffix}\\r?$`).test(names[0]);
|
package/lib/policy/placement.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const reviews = ['review.significant-no-plan', 'review.significant-plan', 'review.final-plan-recheck'];
|
|
3
3
|
export const POLICY_PROJECTIONS = Object.freeze(Object.fromEntries(Object.entries({
|
|
4
4
|
core: ['scope.non-escalation', 'external.explicit-user-authority', 'approval.run-mode', 'role.orchestrator-boundary'],
|
|
5
|
-
assignment: ['git.specialists-deny', 'role.scouter-read-only', 'role.planner-draft-only', 'role.implementer-implementation', 'role.tester-verification', 'role.reviewer-independent'],
|
|
5
|
+
assignment: ['git.specialists-deny', 'role.scouter-read-only', 'role.architect-draft-only', 'role.planner-draft-only', 'role.implementer-implementation', 'role.tester-verification', 'role.reviewer-independent'],
|
|
6
6
|
planning: ['git.orchestrator-accept-commit', ...reviews, 'planning.plan-revision', 'planning.planner-brief', 'approval.run-mode'],
|
|
7
7
|
handoff: ['git.specialists-deny', 'role.implementer-implementation', ...reviews],
|
|
8
8
|
preparation: ['scope.non-escalation', 'git.specialists-deny', 'git.orchestrator-accept-commit', 'external.explicit-user-authority', 'planning.plan-revision'],
|
package/lib/policy/render.mjs
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import {POLICY_PROJECTIONS, validatePolicyProjections} from './placement.mjs';
|
|
2
2
|
import {validateGitPolicy} from '../runtime/git-query.mjs';
|
|
3
|
-
import {platformIds,
|
|
3
|
+
import {platformIds, isPlatformId} from '../runtime/platform-registry.mjs';
|
|
4
|
+
import {agentTemplateFile} from '../platforms/agent-templates.mjs';
|
|
4
5
|
import source from './role-policy.json' with {type: 'json'};
|
|
5
6
|
// Payload targets are declared by policy metadata; registered platforms may have no payload yet.
|
|
6
7
|
const POLICY_PLATFORMS = Object.freeze(Object.keys(source.platforms));
|
|
7
|
-
const ROLES = ['orchestrator','scouter','planner','implementer','tester','reviewer'];
|
|
8
|
+
const ROLES = ['orchestrator','scouter','architect','planner','implementer','tester','reviewer'];
|
|
8
9
|
const CONTROLS = ['prompt','capability','hook'];
|
|
9
10
|
const fail = message => { throw new Error(`Role policy: ${message}`); };
|
|
10
11
|
const object = value => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
11
12
|
const strings = value => Array.isArray(value) && value.length > 0 && value.every(x => typeof x === 'string' && x.length > 0) && new Set(value).size === value.length;
|
|
12
13
|
const same = (a,b) => JSON.stringify(a) === JSON.stringify(b);
|
|
13
14
|
export function validateRolePolicy(input) {
|
|
14
|
-
if (!object(input) || input.schemaVersion !== 1 || !Array.isArray(input.roles) || !same(input.roles.map(x=>x?.id),ROLES) || input.roles.some(x=>typeof x.description !== 'string' || !x.description)) fail('expected
|
|
15
|
+
if (!object(input) || input.schemaVersion !== 1 || !Array.isArray(input.roles) || !same(input.roles.map(x=>x?.id),ROLES) || input.roles.some(x=>typeof x.description !== 'string' || !x.description)) fail('expected seven known roles in canonical order');
|
|
15
16
|
if (!Array.isArray(input.rules) || !input.rules.length) fail('rules are required');
|
|
16
17
|
const ids = new Set();
|
|
17
18
|
for (const rule of input.rules) {
|
|
@@ -20,7 +21,7 @@ export function validateRolePolicy(input) {
|
|
|
20
21
|
if (!strings(rule.roles) || rule.roles.some(x=>!ROLES.includes(x)) || !['allow','deny','require'].includes(rule.effect) || !strings(rule.operations) || !strings(rule.evidence) || !['user','orchestrator'].includes(rule.authority) || typeof rule.text !== 'string' || !rule.text || /[\r\n]/.test(rule.text)) fail(`invalid rule ${rule.id}`);
|
|
21
22
|
if (!object(rule.controls) || !same(Object.keys(rule.controls).sort(),[...platformIds()].sort()) || Object.values(rule.controls).some(x=>!CONTROLS.includes(x))) fail(`invalid control level for ${rule.id}`);
|
|
22
23
|
}
|
|
23
|
-
for (const id of ['scope.non-escalation','git.specialists-deny','git.orchestrator-accept-commit','external.explicit-user-authority','approval.run-mode',...ROLES.map(x=>({orchestrator:'role.orchestrator-boundary',scouter:'role.scouter-read-only',planner:'role.planner-draft-only',implementer:'role.implementer-implementation',tester:'role.tester-verification',reviewer:'role.reviewer-independent'})[x]),'review.significant-no-plan','review.significant-plan','review.final-plan-recheck']) if(!ids.has(id)) fail(`missing required rule ${id}`);
|
|
24
|
+
for (const id of ['scope.non-escalation','git.specialists-deny','git.orchestrator-accept-commit','external.explicit-user-authority','approval.run-mode',...ROLES.map(x=>({orchestrator:'role.orchestrator-boundary',scouter:'role.scouter-read-only',architect:'role.architect-draft-only',planner:'role.planner-draft-only',implementer:'role.implementer-implementation',tester:'role.tester-verification',reviewer:'role.reviewer-independent'})[x]),'review.significant-no-plan','review.significant-plan','review.final-plan-recheck']) if(!ids.has(id)) fail(`missing required rule ${id}`);
|
|
24
25
|
for (const platform of POLICY_PLATFORMS) if (!object(input.platforms?.[platform]) || !CONTROLS.includes(input.platforms[platform].level) || typeof input.platforms[platform].notice !== 'string' || !input.platforms[platform].notice) fail(`invalid ${platform} controls`);
|
|
25
26
|
// These are workflow invariants, not customizable scheduling options.
|
|
26
27
|
const routes = {noPlan:['implementer','tester','reviewer','orchestrator-accept'],planTask:['implementer','fresh-tester','orchestrator-accept','orchestrator-commit'],planFinal:['required-tester','reviewer'],planFinding:['implementer','reviewer']};
|
|
@@ -32,7 +33,7 @@ export function validateRolePolicy(input) {
|
|
|
32
33
|
export const defaultRolePolicy = source;
|
|
33
34
|
export const POLICY_TARGETS = POLICY_PLATFORMS.flatMap(platform => [
|
|
34
35
|
{path:`${platform}/skill/SKILL.md`,platform,audience:'orchestrator',projection:'core'},
|
|
35
|
-
...ROLES.slice(1).map(audience=>({path:`${platform}/agents
|
|
36
|
+
...ROLES.slice(1).map(audience=>({path:`${platform}/agents/${agentTemplateFile(`arc_${audience}`)}`,platform,audience})),
|
|
36
37
|
...Object.entries({coordination:'assignment',planning:'planning',handoff:'handoff','handoff-prep':'preparation',commit:'commit',verification:'verification'}).map(([name,projection])=>({path:`${platform}/skill/references/${name}.md`,platform,audience:'orchestrator',projection})),
|
|
37
38
|
]);
|
|
38
39
|
export function renderPolicySection(policy, {platform, audience, section = 'contract', skillPath, projection = 'full'} = {}) {
|
|
@@ -9,9 +9,13 @@
|
|
|
9
9
|
"id": "scouter",
|
|
10
10
|
"description": "Read assigned static material and report sources and limits."
|
|
11
11
|
},
|
|
12
|
+
{
|
|
13
|
+
"id": "architect",
|
|
14
|
+
"description": "Return design, start summary and spec drafts to Orchestrator."
|
|
15
|
+
},
|
|
12
16
|
{
|
|
13
17
|
"id": "planner",
|
|
14
|
-
"description": "Return
|
|
18
|
+
"description": "Return plan drafts to Orchestrator."
|
|
15
19
|
},
|
|
16
20
|
{
|
|
17
21
|
"id": "implementer",
|
|
@@ -32,6 +36,7 @@
|
|
|
32
36
|
"roles": [
|
|
33
37
|
"orchestrator",
|
|
34
38
|
"scouter",
|
|
39
|
+
"architect",
|
|
35
40
|
"planner",
|
|
36
41
|
"implementer",
|
|
37
42
|
"tester",
|
|
@@ -59,6 +64,7 @@
|
|
|
59
64
|
"id": "git.specialists-deny",
|
|
60
65
|
"roles": [
|
|
61
66
|
"scouter",
|
|
67
|
+
"architect",
|
|
62
68
|
"planner",
|
|
63
69
|
"implementer",
|
|
64
70
|
"tester",
|
|
@@ -121,6 +127,7 @@
|
|
|
121
127
|
"roles": [
|
|
122
128
|
"orchestrator",
|
|
123
129
|
"scouter",
|
|
130
|
+
"architect",
|
|
124
131
|
"planner",
|
|
125
132
|
"implementer",
|
|
126
133
|
"tester",
|
|
@@ -151,6 +158,7 @@
|
|
|
151
158
|
"roles": [
|
|
152
159
|
"orchestrator",
|
|
153
160
|
"scouter",
|
|
161
|
+
"architect",
|
|
154
162
|
"planner",
|
|
155
163
|
"implementer",
|
|
156
164
|
"tester",
|
|
@@ -186,7 +194,7 @@
|
|
|
186
194
|
"role-ownership"
|
|
187
195
|
],
|
|
188
196
|
"authority": "orchestrator",
|
|
189
|
-
"text": "Assign design/brainstorming drafts and first complete spec
|
|
197
|
+
"text": "Assign design/brainstorming drafts and first complete spec drafts only to Architect, first complete plan drafts only to Planner, and implementation/configuration/test edits to Implementer. Orchestrator saves and reviews complete spec/plan drafts and directly revises the same document when needed. Missing or failed first drafts do not transfer initial authorship. New product decisions outside approved scope require user input before revision. Orchestrator owns approval requests, preparation, scheduling, evidence, acceptance and completion. Direct implementation remains limited to the existing small, low-risk path. Use a fresh Implementer per top-level task and a fresh Tester per task requiring Tester; Tester findings alone do not create a new task. Record each plan task's current Implementer conversation ID, status, last result and reuse/replacement decision in the canonical handoff record. While approved scope, workspace, ownership and assignment context remain valid, send same-task corrections, rework and rechecks as follow-up work in that conversation; use the current Tester for Tester findings and required Tester rechecks. Once final overall Reviewer review begins on plan work, Reviewer findings, including behavior, repeat Implementer → Reviewer without Tester reassignment until resolved; separate Tester findings remain Implementer → Tester. A completed or idle turn, partial implementation, failed result, missing brief, division by step or file, or Tester/Reviewer finding alone is not a reason to replace the Implementer. Before a same-task replacement, record the prior conversation ID and status, allowed reason and supporting evidence; hold if the reason is not established. Record the new ID after a successful call; reconcile an uncertain result before another assignment. Replace or restart a role only for invalid/unavailable context or a changed task boundary, except that an approved plan or acceptance-criteria amendment requires a fresh Implementer even within the same task. Before Implementer reuse, refresh actual workspace, branch/HEAD and change state. For Tester findings and required Tester rechecks, Tester reruns reproduction and invalidated related checks and reports actor, target state, outcomes and limits. Preserve task-boundary acceptance and the final plan Reviewer correction exception.",
|
|
190
198
|
"controls": {
|
|
191
199
|
"codex": "prompt",
|
|
192
200
|
"claude": "prompt",
|
|
@@ -216,6 +224,27 @@
|
|
|
216
224
|
"grok": "prompt"
|
|
217
225
|
}
|
|
218
226
|
},
|
|
227
|
+
{
|
|
228
|
+
"id": "role.architect-draft-only",
|
|
229
|
+
"roles": [
|
|
230
|
+
"architect"
|
|
231
|
+
],
|
|
232
|
+
"effect": "allow",
|
|
233
|
+
"operations": [
|
|
234
|
+
"draft-response"
|
|
235
|
+
],
|
|
236
|
+
"evidence": [
|
|
237
|
+
"prepared-target-evidence"
|
|
238
|
+
],
|
|
239
|
+
"authority": "orchestrator",
|
|
240
|
+
"text": "Return design/brainstorming drafts, start summaries and complete first spec drafts with dependencies, criteria, holds and verification needs in the response. During initial drafting and revisions, report progress only to Orchestrator: briefly state the stage, feedback being applied, actual blocker or next step, without draft prose or excerpts. Return the complete first draft and self-review for Orchestrator review; Orchestrator directly revises the same spec when needed. Raw responses may appear in app/tool surfaces; prompt policy cannot hide them. DO NOT save documents, implement, run checks, prepare targets, request user approval or decide acceptance. The first required document draft uses the verified source and selected target intent before target preparation. Require a verified prepared target before saving or handoff. Route decisions to Orchestrator.",
|
|
241
|
+
"controls": {
|
|
242
|
+
"codex": "prompt",
|
|
243
|
+
"claude": "prompt",
|
|
244
|
+
"gemini": "prompt",
|
|
245
|
+
"grok": "prompt"
|
|
246
|
+
}
|
|
247
|
+
},
|
|
219
248
|
{
|
|
220
249
|
"id": "role.planner-draft-only",
|
|
221
250
|
"roles": [
|
|
@@ -230,7 +259,7 @@
|
|
|
230
259
|
"approved-spec-before-dependent-plan"
|
|
231
260
|
],
|
|
232
261
|
"authority": "orchestrator",
|
|
233
|
-
"text": "Return
|
|
262
|
+
"text": "Return complete first plan drafts with dependencies, criteria, holds and verification needs in the response. During initial drafting and revisions, report progress only to Orchestrator: briefly state the stage, feedback being applied, actual blocker or next step, without draft prose or excerpts. Return the complete first draft and self-review for Orchestrator review; Orchestrator directly revises the same plan when needed. Raw responses may appear in app/tool surfaces; prompt policy cannot hide them. DO NOT save documents, implement, run checks, prepare targets, request user approval or decide acceptance. The first required document draft uses the verified source and selected target intent before target preparation. Require a verified prepared target before saving or handoff. Route decisions to Orchestrator.",
|
|
234
263
|
"controls": {
|
|
235
264
|
"codex": "prompt",
|
|
236
265
|
"claude": "prompt",
|
|
@@ -400,11 +429,10 @@
|
|
|
400
429
|
"evidence": [
|
|
401
430
|
"non-progress-content-change-classification",
|
|
402
431
|
"actual-approval-chronology",
|
|
403
|
-
"approved-revision-content-hash"
|
|
404
|
-
"plan-revision-trailers"
|
|
432
|
+
"approved-revision-content-hash"
|
|
405
433
|
],
|
|
406
434
|
"authority": "orchestrator",
|
|
407
|
-
"text": "Task progress records (checkboxes, notes, results, evidence and status) preserving the approved contract need no new user approval; Orchestrator includes the completed task's own records in its accepted implementation commit and records classification, reason and actual time as applicable. Plan-level progress records preserving the approved contract also need no new user approval and alone never trigger the standalone docs(plan) closing commit. All other spec/plan content changes, contract or mechanical, require applicable approval and preparation; changes to goals, scope, criteria, method, risk, dependencies or required verification need revised-version approval, preparation and holds on affected work before it continues, with a fresh Implementer for remaining work. After approval Orchestrator edits the same document, appends a revision-history row and leaves it uncommitted as an Orchestrator-owned pending revision, recording version, content hash, approval reference, actual time, classification, reason, affected tasks and the full approved content in the canonical handoff record. Orchestrator includes all pending revisions
|
|
435
|
+
"text": "Task progress records (checkboxes, notes, results, evidence and status) preserving the approved contract need no new user approval; Orchestrator includes the completed task's own records in its accepted implementation commit and records classification, reason and actual time as applicable. Plan-level progress records preserving the approved contract also need no new user approval and alone never trigger the standalone docs(plan) closing commit. All other spec/plan content changes, contract or mechanical, require applicable approval and preparation; changes to goals, scope, criteria, method, risk, dependencies or required verification need revised-version approval, preparation and holds on affected work before it continues, with a fresh Implementer for remaining work. After approval Orchestrator edits the same document, appends a revision-history row and leaves it uncommitted as an Orchestrator-owned pending revision, recording version, content hash, approval reference, actual time, classification, reason, affected tasks and the full approved content in the canonical handoff record. Orchestrator includes all pending revisions in the accepted commit of the first top-level task executed or reconfirmed against the revised version, otherwise in a current task or final Reviewer follow-up commit; only when no implementation work remains before overall completion MAY it make one standalone docs(plan) closing commit without implementation files. Exclude revision hunks from commits of independent tasks accepted on a prior version, or hold that commit when separation is unsafe. NEVER amend or rewrite planning or implementation commits, create any other docs/fixup commit or authorize past work retroactively. After commit verify the committed document content matches the latest approved content apart from classified progress records of that commit's task or committed for other tasks after approval, or plan-level progress records carried by that commit, and that no pending revision remains. Follow planning, handoff-prep, commit and verification for the full contract.",
|
|
408
436
|
"controls": {
|
|
409
437
|
"codex": "prompt",
|
|
410
438
|
"claude": "prompt",
|
|
@@ -428,7 +456,7 @@
|
|
|
428
456
|
"preceding-approval"
|
|
429
457
|
],
|
|
430
458
|
"authority": "orchestrator",
|
|
431
|
-
"text": "Follow planning.md's
|
|
459
|
+
"text": "Follow planning.md's drafting preparation and review procedure for the drafting role (Architect or Planner), including preflight, ledger, evidence classification, target preparation, preceding approvals, provenance and reference gates. Before drafting-role dispatch, evaluate F1–F8 direct-path eligibility and Bounded plan-omission eligibility independently. Enter each path only when all of that path's existing conditions are proven; if neither path qualifies, use normal full evaluation. Send one complete stage-specific initial brief. Reuse the same Architect instance only within the design/brainstorming stage while its role, context and source remain valid, except that on the Architectural path that Architect continues as the spec author after start confirmation through a spec-stage delta brief; use a fresh Planner instance for each plan stage, reusing it only for a budget-hold delta within that stage, and a fresh Architect for an Architectural spec stage when that Architect is unavailable or its role, context or source is no longer valid; each fresh instance's initial brief contains every required field, saved document paths and approved versions (for the Architectural plan stage, the reviewed spec path, version and SHA-256). Follow-up briefs send changed fields and cite an accessible prior brief for unchanged fields. Reuse evidence only for the same source set, absolute locator, resolved path, content fingerprint, purpose and approval scope in an accessible matching context. Reconfirm affected inputs when source, target or scope changed. The drafting role returns a complete proportional first draft and self-review. Orchestrator reviews and directly revises the same spec or plan when needed. A missing or failed first draft does not transfer initial authorship to Orchestrator. New product decisions outside approved scope require user input before Orchestrator revises the document. For design and brainstorming, follow planning.md's design conversation: each Architect response is exactly one of one question, 2–3 approaches with a recommendation and a selection question, one design section with a confirmation question, or the final design (Architectural: the start summary). Ask one question at a time only when the answer changes the outcome and is not already answered; otherwise state the judgment and its reason. Ask an open question about the user's reason before offering options. For a clear request, Architect MAY return a short design for approval at once; when the user says to proceed, stop asking and list the remaining author judgments in the final design or start summary. Relay user answers verbatim and mark added interpretation separately. Every call needs a new user answer or new evidence; without progress, report the blocked criterion, observed facts and needed decision, and hold. Conversation responses use no correction opportunity. Orchestrator reviews the final design once with the fixed checklist, including decision-inventory completeness and no ambiguous scope wording, and sends one consolidated correction using changed fields only. On the Architectural path the start summary receives no consolidated correction; Orchestrator checks its decision inventory and scope notation before presenting it, and the spec draft takes Orchestrator's review and direct revision. Further calls require user-approved material scope/evidence changes or concrete unmet checklist items after correction, plus meaningful new input or criterion-state progress. State changed input, target criterion, expected artifact and expected progress. Repeated unmet criteria without new input, evidence or progress hold the stage; report the criterion, observed evidence and exact unblock input/decision. DO NOT split omissions, repeat resolved items or count rewording/agent replacement as progress. DO NOT invoke Architect or Planner only for reformatting, re-expression, save errors or patch-application errors; Orchestrator handles these. Evaluate separate substantive work under the normal drafting-role gate. For Bounded work, Architect drafts the short design; obtain design approval before a fresh Planner drafts any required plan. For Architectural work, obtain one start confirmation (scope and explicit target; no design document or design approval) before spec drafting, let the design Architect continue as the spec author (a fresh Architect when it is unavailable or invalid), then draft the plan with a fresh Planner, assigning the Planner only after the spec is saved and reviewed and its path, version and SHA-256 are fixed; NEVER draft them concurrently; then obtain one combined spec+plan approval. Bounded work has no spec stage; required plans keep their own approval. Add no fixed call cap or profile call-count conditions, and NEVER accept an incomplete draft. Keep user progress brief and based on drafting-role status without relaying draft content. At approval, present the integrated, saved and reviewed Markdown without repeating its body in chat.",
|
|
432
460
|
"controls": {
|
|
433
461
|
"codex": "prompt",
|
|
434
462
|
"claude": "prompt",
|
|
@@ -690,6 +718,7 @@
|
|
|
690
718
|
"roles": [
|
|
691
719
|
"orchestrator",
|
|
692
720
|
"scouter",
|
|
721
|
+
"architect",
|
|
693
722
|
"planner",
|
|
694
723
|
"implementer",
|
|
695
724
|
"tester",
|