@yunhozz/arc 0.1.3 → 0.1.5
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 +32 -29
- package/claude/agents/arc-coder.md +1 -1
- package/claude/agents/arc-qa.md +2 -2
- package/claude/skill/SKILL.md +17 -294
- package/claude/skill/references/commit.md +5 -11
- package/claude/skill/references/coordination.md +148 -0
- package/claude/skill/references/git-recovery.md +3 -2
- package/claude/skill/references/handoff-prep.md +4 -11
- package/claude/skill/references/handoff.md +69 -8
- package/claude/skill/references/limits.md +1 -1
- package/claude/skill/references/planning.md +20 -24
- package/claude/skill/references/verification.md +39 -9
- package/claude/skill/references/visual-companion.md +1 -1
- package/codex/agents/arc-coder.toml +1 -0
- package/codex/agents/arc-planner.toml +2 -0
- package/codex/agents/arc-qa.toml +2 -0
- package/codex/agents/arc-reviewer.toml +2 -0
- package/codex/agents/arc-scouter.toml +2 -0
- package/codex/skill/SKILL.md +19 -281
- package/codex/skill/references/commit.md +10 -24
- package/codex/skill/references/coordination.md +129 -0
- package/codex/skill/references/git-recovery.md +21 -18
- package/codex/skill/references/handoff-prep.md +14 -25
- package/codex/skill/references/handoff-worktree.md +10 -12
- package/codex/skill/references/handoff.md +81 -34
- package/codex/skill/references/limits.md +1 -1
- package/codex/skill/references/planning.md +36 -46
- package/codex/skill/references/verification.md +73 -53
- package/codex/skill/references/visual-companion.md +6 -8
- package/lib/installer/global-config.mjs +1 -2
- package/lib/policy/placement.mjs +25 -0
- package/lib/policy/render.mjs +12 -4
- package/package.json +1 -1
|
@@ -29,11 +29,12 @@ a well-supported infeasibility result can complete it. Probe-only authorization
|
|
|
29
29
|
or subsequent implementation. Record question, method/scope, criteria, and constraints; a sufficiently specific probe
|
|
30
30
|
request can supply that approval. Match checks to probe purpose/risk and do not report probe evidence as product proof.
|
|
31
31
|
|
|
32
|
-
If the user explicitly requests both a probe and implementation and the whole scope is sufficiently specified,
|
|
33
|
-
|
|
34
|
-
with no new approval boundary at its report. Unknown implementation is not blanket authorization:
|
|
35
|
-
implementation if findings materially change scope, method, or risk, or leave a new material decision.
|
|
36
|
-
and obtain any required design/spec/plan approvals before that implementation. A probe-only request
|
|
32
|
+
If the user explicitly requests both a probe and implementation and the whole scope is sufficiently specified, classify
|
|
33
|
+
the entire scope. When the entire scope meets the Bounded path criteria in Design path and plan depth, the probe is an
|
|
34
|
+
internal investigation with no new approval boundary at its report. Unknown implementation is not blanket authorization:
|
|
35
|
+
hold affected implementation if findings materially change scope, method, or risk, or leave a new material decision.
|
|
36
|
+
Reassess depth and obtain any required design/spec/plan approvals before that implementation. A probe-only request
|
|
37
|
+
remains separate.
|
|
37
38
|
|
|
38
39
|
## Formal drafting boundary
|
|
39
40
|
|
|
@@ -69,7 +70,7 @@ call cap; never accept an incomplete draft to minimize calls. Do not add call-co
|
|
|
69
70
|
|
|
70
71
|
`brainstorming` and `writing-plans` are instructions for existing roles, not extra agents. This ARC controls
|
|
71
72
|
routing/approval gates even if a called skill names another executor. Follow local ARC reference instructions and user
|
|
72
|
-
constraints; report missing required local
|
|
73
|
+
constraints; report a missing required skill or local reference before that stage; it blocks that stage. Integrate means save, route, and obtain approval;
|
|
73
74
|
never author.
|
|
74
75
|
|
|
75
76
|
When the request or task brief is in Korean, Planner writes spec and plan titles and explanatory prose in Korean unless
|
|
@@ -83,15 +84,15 @@ approved obligations separately.
|
|
|
83
84
|
|
|
84
85
|
1. Before software feature, design, or behavior changes, Orchestrator assigns Planner the local `brainstorming`
|
|
85
86
|
skill with
|
|
86
|
-
the brief/evidence. Planner explores context
|
|
87
|
-
|
|
87
|
+
the brief/evidence. Planner explores context. Planner proposes, Orchestrator decides the spike/bounded/architectural path; Planner also
|
|
88
|
+
proposes design/options,
|
|
88
89
|
trade-offs, acceptance criteria, assumptions, and focused questions. Orchestrator integrates, announces scope,
|
|
89
90
|
routes user
|
|
90
91
|
answers/revisions back, and obtains approvals; Orchestrator never runs brainstorming or writing-plans itself
|
|
91
92
|
(SKILL.md Role gate);
|
|
92
93
|
the direct path uses only a scope record.
|
|
93
94
|
2. Spike: apply Probe scope above; distinguish probe-only authorization from a sufficiently specified combined scope.
|
|
94
|
-
Bounded: approve a short design before Coder or
|
|
95
|
+
Bounded: approve a short design before Coder or an Orchestrator direct edit (Planner's design
|
|
95
96
|
before Coder; a direct edit uses only an approved scope record). Architectural: approve
|
|
96
97
|
design, then Planner returns complete spec draft and self-review findings; Orchestrator integrates, saves,
|
|
97
98
|
self-reviews, and obtains written-spec approval
|
|
@@ -110,17 +111,15 @@ approved obligations separately.
|
|
|
110
111
|
self-reviews,
|
|
111
112
|
then obtains plan approval before Coder.
|
|
112
113
|
5. Every Coder first start and restart requires all applicable design/spec/plan approvals and passing
|
|
113
|
-
the
|
|
114
|
+
the Common handoff gate in SKILL.md and handoff.md, with approved artifacts, brief, and relevant findings.
|
|
114
115
|
Non-behavior
|
|
115
116
|
configuration/documentation may skip inapplicable design/planning stages, but still requires the handoff gate.
|
|
116
|
-
|
|
117
|
+
An Orchestrator direct edit requires its approved scope record and the same gate conditions before the first edit.
|
|
117
118
|
|
|
118
119
|
When a Bounded written spec is required by Orchestrator's recorded plan-depth judgment, record that necessity and scope
|
|
119
|
-
and
|
|
120
|
-
use the approved short design as its basis. Planner returns a proportional complete spec draft and self-review;
|
|
120
|
+
and use the approved short design as its basis. Planner returns a proportional complete spec draft and self-review;
|
|
121
121
|
Orchestrator integrates, saves, self-reviews, and obtains individual written-spec approval before dependent plan
|
|
122
|
-
drafting
|
|
123
|
-
and execution preparation. This applies that judgment, not a new spec-necessity rule.
|
|
122
|
+
drafting and execution preparation. This applies that judgment, not a new spec-necessity rule.
|
|
124
123
|
|
|
125
124
|
Design, spec, plan, and brainstorming drafts are authored only by Planner.
|
|
126
125
|
Orchestrator must not substitute an independently authored spec or plan for Planner's complete draft.
|
|
@@ -134,13 +133,11 @@ implementation goal/scope and target files, preceding tasks and dependencies, ac
|
|
|
134
133
|
checks and evidence before acceptance, and hold conditions; each task independently implementable, verifiable and
|
|
135
134
|
acceptable, with changes that cannot be independently verified (including policy/profile/tests/manifest sharing one
|
|
136
135
|
contract) in one task from the outset; and final overall plan verification stated separately from task acceptance
|
|
137
|
-
prerequisites, with scope and timing. Never list Reviewer as a per-task required check (Reviewer timing:
|
|
138
|
-
Risk-scaled execution). RED/GREEN and individual
|
|
136
|
+
prerequisites, with scope and timing. Never list Reviewer as a per-task required check (Reviewer timing: [Risk-scaled execution](verification.md#risk-scaled-execution)). RED/GREEN and individual
|
|
139
137
|
commands do not create commit units; one task is one focused commit under commit.md, which also covers no-change, hold
|
|
140
138
|
and resume. Do not combine different approved tasks into one commit during execution; if inseparability appears later,
|
|
141
139
|
stop affected work and have Orchestrator handle revised scope, planning and applicable approvals.
|
|
142
|
-
These requirements apply to
|
|
143
|
-
required plans; existing plan-omission paths gain no new plan obligation.
|
|
140
|
+
These requirements apply to required plans; existing plan-omission paths gain no new plan obligation.
|
|
144
141
|
|
|
145
142
|
### Dependency and readiness record
|
|
146
143
|
|
|
@@ -156,13 +153,16 @@ A task is ready only when all applicable approvals and execution preparation are
|
|
|
156
153
|
are available and settled, predecessors have required evidence and Orchestrator acceptance plus verified focused
|
|
157
154
|
commits (or accepted no-change records), ownership/resources do not conflict, its required check/QA path is available,
|
|
158
155
|
and a subagent slot exists under both the configured ARC full-tree cap shared by all roles and any lower actual runtime
|
|
159
|
-
limit. Report runtime limits
|
|
160
|
-
record each hold or serialization reason instead of
|
|
156
|
+
limit (see [limits](limits.md)). Report runtime limits; ARC's cap is not a claim of runtime capability. Start all ready
|
|
157
|
+
independent tasks with fresh Coders concurrently within capacity; record each hold or serialization reason instead of
|
|
158
|
+
silently following list order. Preserve existing risk gates, risk-scaled QA/Reviewer timing and execution-target
|
|
159
|
+
restrictions.
|
|
161
160
|
|
|
162
161
|
Update the map on completion, check evidence, acceptance, commit, slot return and new conflicts. Completion reports
|
|
163
162
|
alone do not release dependents. Reevaluate newly ready tasks immediately without waiting for unrelated batch members;
|
|
164
163
|
failed or ambiguous predecessors hold their dependent chain, while unaffected ready tasks may proceed. Dispatch still
|
|
165
|
-
passes handoff.md for each task; commits
|
|
164
|
+
passes [handoff](handoff.md) for each task, refreshing assignment evidence there; commits, shared-checkout Git
|
|
165
|
+
coordination and shared Git mutations follow [commit](commit.md). This record does not authorize
|
|
166
166
|
Orchestrator to rewrite Planner's approved task boundaries or waive approvals.
|
|
167
167
|
|
|
168
168
|
For example, with A → B → C and independent D and two slots, start A and D. After A's required checks,
|
|
@@ -194,14 +194,12 @@ If evidence is missing or mismatched in either gate, stop the affected save and
|
|
|
194
194
|
|
|
195
195
|
The applicable document set means all specs and plans required for the current approved execution scope, not future
|
|
196
196
|
project work. Orchestrator records scope, design/plan depth, absolute document paths and coverage, approved
|
|
197
|
-
versions/status,
|
|
198
|
-
plan dependencies and execution order, skipped stages with rationale, and documents still awaiting writing or approval
|
|
197
|
+
versions/status, plan dependencies and execution order, skipped stages with rationale, and documents still awaiting writing or approval
|
|
199
198
|
in the shared brief. The set is complete only when every required document is written and individually approved and
|
|
200
199
|
no unresolved scope or dependency decision requires another document. Do not omit required documents from the list.
|
|
201
200
|
|
|
202
201
|
A required plan does not itself require a written spec. Bounded uses Orchestrator's recorded plan-depth judgment to
|
|
203
|
-
determine
|
|
204
|
-
whether a written spec is required; do not infer one from plan necessity. Spec steps apply only to Architectural and
|
|
202
|
+
determine whether a written spec is required; do not infer one from plan necessity. Spec steps apply only to Architectural and
|
|
205
203
|
required Bounded specs, and plan steps only to required plans. These gates add no new spec obligation to Spike,
|
|
206
204
|
Bounded plan-skip, or non-behavior documentation/configuration paths; preserve existing omission rationales.
|
|
207
205
|
|
|
@@ -225,17 +223,16 @@ are not permission for document commits during planning or for starting Coder.
|
|
|
225
223
|
|
|
226
224
|
| Path | Applicable approvals and preparation |
|
|
227
225
|
|------|--------------------------------------|
|
|
228
|
-
| Spike probe | Approve the feasibility question, probe method/scope, acceptance criteria, and constraints. Do not force specs/plans for still-unknown implementation; no new spec obligation is added by this gate. If Coder executes the probe, pass the
|
|
229
|
-
| Bounded, plan skipped | Approve the short design and record the existing plan-skip criteria/rationale; this gate adds no new spec obligation. Complete applicable approvals, select the target, prepare any actual approved documents, or record valid document absence, then pass the
|
|
230
|
-
| Bounded, plan required | Approve the short design and every required plan; write a spec only when Orchestrator's recorded plan-depth judgment requires it, then obtain its individual written-spec approval before dependent plan drafting. Select and prepare the target before formal drafting; complete all applicable artifacts before one docs batch and the
|
|
231
|
-
| Architectural | Approve design, then written spec, then every required plan using `writing-plans`; select and prepare the target before formal drafting; complete the document set before batch preparation, final verification, and the
|
|
232
|
-
| Non-behavior documentation/configuration | Record scope, acceptance criteria, and why design/planning stages are inapplicable; this gate adds no new spec obligation. Still select the target, verify Git state, prepare actual approved documents or record absence, and pass the
|
|
226
|
+
| Spike probe | Approve the feasibility question, probe method/scope, acceptance criteria, and constraints. Do not force specs/plans for still-unknown implementation; no new spec obligation is added by this gate. If Coder executes the probe, pass the Common handoff gate after probe approval. Read-only Orchestrator/Planner investigation without Coder does not trigger that gate. |
|
|
227
|
+
| Bounded, plan skipped | Approve the short design and record the existing plan-skip criteria/rationale; this gate adds no new spec obligation. Complete applicable approvals, select the target, prepare any actual approved documents, or record valid document absence, then pass the Common handoff gate. |
|
|
228
|
+
| Bounded, plan required | Approve the short design and every required plan; write a spec only when Orchestrator's recorded plan-depth judgment requires it, then obtain its individual written-spec approval before dependent plan drafting. Select and prepare the target before formal drafting; complete all applicable artifacts before one docs batch and the Common handoff gate. |
|
|
229
|
+
| Architectural | Approve design, then written spec, then every required plan using `writing-plans`; select and prepare the target before formal drafting; complete the document set before batch preparation, final verification, and the Common handoff gate. |
|
|
230
|
+
| Non-behavior documentation/configuration | Record scope, acceptance criteria, and why design/planning stages are inapplicable; this gate adds no new spec obligation. Still select the target, verify Git state, prepare actual approved documents or record absence, and pass the Common handoff gate. |
|
|
233
231
|
|
|
234
232
|
Apply Authorization and scope above to probe-only and combined requests; preserve required design/spec/plan gates.
|
|
235
233
|
These gates add no new spec obligation for Spike, Bounded plan-skip, or non-behavior documentation/configuration paths.
|
|
236
234
|
Document omission skips only document obligations, never explicit
|
|
237
|
-
execution-target
|
|
238
|
-
choice, Git state/ownership checks, or handoff evidence.
|
|
235
|
+
execution-target choice, Git state/ownership checks, or handoff evidence.
|
|
239
236
|
|
|
240
237
|
If planning reveals new scope, reassess the list, depth, and dependencies and obtain additional required approvals
|
|
241
238
|
before dependent drafting or commit. Changed approved documents require approval of the revised version. If implementation reveals new
|
|
@@ -248,9 +245,9 @@ lifetime and restart record in [handoff.md](handoff.md).
|
|
|
248
245
|
|
|
249
246
|
Missing or mismatched evidence, unfinished approvals, unclear ownership, or unresolved failure blocks the affected
|
|
250
247
|
save, execution-target request, Git mutation, or Coder handoff: stop and report to Orchestrator.
|
|
251
|
-
Orchestrator resolves the issue and
|
|
252
|
-
|
|
253
|
-
|
|
248
|
+
Orchestrator resolves the issue and reverifies affected evidence before resumption. Reverify evidence when scope,
|
|
249
|
+
approved versions, paths, target, or relevant Git state changes. Preserve unrelated changes under handoff rules;
|
|
250
|
+
read-only investigation remains allowed.
|
|
254
251
|
|
|
255
252
|
Do not retroactively treat an early save or commit as satisfying these gates or as user approval. Record the actual
|
|
256
253
|
order and any evidence gap. Structural checks prove only the repository's written policy contract, not consuming-agent
|
|
@@ -259,7 +256,7 @@ compliance unverified. Do not add runtime infrastructure or modify external skil
|
|
|
259
256
|
|
|
260
257
|
### Managed worktree preparation
|
|
261
258
|
|
|
262
|
-
See [handoff-worktree.md](handoff-worktree.md) for the
|
|
259
|
+
See [handoff-worktree.md](handoff-worktree.md) for the managed worktree contract.
|
|
263
260
|
|
|
264
261
|
## Local planning references
|
|
265
262
|
|
|
@@ -267,18 +264,11 @@ Orchestrator briefs absolute ARC paths `references/superpowers/brainstorming/SKI
|
|
|
267
264
|
`references/superpowers/writing-plans/SKILL.md`. Planner reads them directly; resolve relative references within each
|
|
268
265
|
skill. Missing files stop the stage; report paths without global fallback. Keep ARC approval and ownership gates.
|
|
269
266
|
|
|
267
|
+
|
|
268
|
+
|
|
270
269
|
[ARC role policy: contract begin]
|
|
271
270
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
272
|
-
- [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.
|
|
273
|
-
- [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.
|
|
274
271
|
- [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.
|
|
275
|
-
- [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.
|
|
276
|
-
- [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.
|
|
277
|
-
- [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.
|
|
278
|
-
- [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.
|
|
279
|
-
- [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.
|
|
280
|
-
- [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.
|
|
281
|
-
- [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.
|
|
282
272
|
- [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.
|
|
283
273
|
- [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.
|
|
284
274
|
- [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.
|
|
@@ -5,30 +5,81 @@ QA and
|
|
|
5
5
|
Reviewer contracts are in their profiles; they read this file only for sections the brief explicitly cites.
|
|
6
6
|
Visual companion design discussion is distinct from QA UI acceptance.
|
|
7
7
|
|
|
8
|
+
For Orchestrator, **Evidence verdict**: each criterion is proven, unmet, or unverified; passing runs, reports, or disposition never turn unverified into proven; reports keep unverified scope visible.
|
|
9
|
+
|
|
8
10
|
## Risk-scaled execution
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
Orchestrator assigns edits exclusively to Coder except under the Orchestrator direct path in [handoff](handoff.md#orchestrator-direct-path-for-small-tasks), and determines affected
|
|
13
|
+
behavior, risk, and smallest meaningful verification.
|
|
14
|
+
|
|
15
|
+
| Risk | Minimum flow |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Small, low risk | Coder, or Orchestrator direct path → Orchestrator's focused checks → acceptance |
|
|
18
|
+
| Ordinary behavior | Coder → independent QA → acceptance |
|
|
19
|
+
| Significant/high risk | Coder → QA → independent Reviewer of the final full change → acceptance; with a plan, each plan task Coder → FRESH QA → acceptance/commit satisfies the QA step, then independent Reviewer once on the final full change after all plan tasks |
|
|
20
|
+
|
|
21
|
+
Ordinary and significant plan tasks need a FRESH QA before acceptance; only small, low-risk tasks may be accepted on
|
|
22
|
+
Orchestrator focused checks. Small, low risk means narrow, understood, readily reversible, and verifiable by focused
|
|
23
|
+
checks. Ordinary behavior fails those conditions without a significant-risk trigger. Significant risk includes shared
|
|
24
|
+
role/behavior contracts, shared state, lifecycle/integration order, security/permissions, data loss/migration, public interfaces, or costly
|
|
25
|
+
installation/deployment/rollback. Substantial behavior or contract changes are significant regardless of file count.
|
|
26
|
+
When risk is unclear, investigate or use the higher flow. Environment failure does not waive checks or determine design depth.
|
|
27
|
+
|
|
28
|
+
Do not add per-task QA or review gates solely because a task boundary exists. Reviewer is never a plan-task acceptance
|
|
29
|
+
prerequisite; for significant work with a plan, it reviews the final full change once after all plan tasks are accepted
|
|
30
|
+
with their risk-scaled checks, following the last plan task's required checks and any QA recheck at the final relevant
|
|
31
|
+
state; significant work without a plan keeps Reviewer after QA before acceptance. Preserve specific approved
|
|
32
|
+
obligations. If the next task depends on a still-unverified risky contract, complete applicable QA at that dependency
|
|
33
|
+
boundary and resolve or explicitly disposition findings before dependent implementation.
|
|
34
|
+
Reuse evidence only when scope, relevant state, independence, freshness, and flow
|
|
35
|
+
position satisfy each covered requirement; changes, failures, or missing/conflicting evidence invalidate affected reuse.
|
|
36
|
+
QA checks independently without edits; Reviewer reviews without QA, planning, edits, delegation, or completion
|
|
37
|
+
decisions. Orchestrator routes fixes to Coder (a failed direct-path check returns to the normal flow),
|
|
38
|
+
obtains affected QA rechecks outside the final plan Reviewer correction exception and required final review, and accepts after findings/evidence gaps are resolved or
|
|
39
|
+
explicitly dispositioned.
|
|
40
|
+
|
|
41
|
+
Criterion verdicts follow the Evidence verdict.
|
|
42
|
+
|
|
43
|
+
### Final plan Reviewer correction loop
|
|
44
|
+
|
|
45
|
+
For a plan's final overall Reviewer findings, including behavior findings, Orchestrator assigns
|
|
46
|
+
Coder → Reviewer recheck with no QA reassignment. Repeat corrections and Reviewer rechecks until findings are resolved;
|
|
47
|
+
the initial single full review does not prohibit necessary rechecks. Before the initial final overall Reviewer,
|
|
48
|
+
risk-required checks and QA execution failures or unmet criteria still require Coder correction → QA recheck.
|
|
49
|
+
This exception applies only to findings from the final overall Reviewer of work with a plan.
|
|
50
|
+
Work without a plan retains its existing verification flow. Scope expansion, separate mandatory obligations,
|
|
51
|
+
or unresolved evidence gaps hold affected work for Orchestrator to resolve and obtain required approvals.
|
|
52
|
+
Orchestrator assigns corrections/rechecks and decides acceptance. Reviewer remains read-only, must not run QA
|
|
53
|
+
checks or decide acceptance. Previous QA evidence must not be presented as post-fix execution evidence;
|
|
54
|
+
report only checks actually performed, their actor, target state, results and remaining limits.
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
Authorization evidence and probe/combined scope are owned by [planning](planning.md#authorization-and-scope);
|
|
59
|
+
valid reuse and actual-state refresh by [handoff](handoff.md#authorization-continuity).
|
|
60
|
+
After gates hold, continue approved scope without saved documents through required checks and Orchestrator acceptance under
|
|
61
|
+
Completion continuity below; a role report alone does not complete the work.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
The Risk-scaled execution section above holds the risk table, risk definitions, evidence-reuse rule, and role order,
|
|
11
66
|
including Reviewer timing. Product/test edits belong exclusively to Coder except under the Orchestrator direct path;
|
|
12
|
-
Orchestrator may inspect/run checks but
|
|
13
|
-
routes code corrections to Coder. Determine the minimum
|
|
67
|
+
Orchestrator may inspect/run checks but routes code corrections to Coder. Determine the minimum
|
|
14
68
|
flow from risk and any specific instruction or approved commitment, and record which requirements each check or review
|
|
15
69
|
satisfies. For small, low-risk work with clear scope and acceptance evidence and no such requirement,
|
|
16
|
-
Orchestrator's focused
|
|
17
|
-
|
|
18
|
-
full change at the final relevant state after the required QA/focused checks and any QA recheck.
|
|
70
|
+
Orchestrator's focused checks suffice; do not call QA or Reviewer automatically. Significant/high-risk work requires
|
|
71
|
+
independent review of the full change at the final relevant state after the required QA/focused checks and any QA recheck.
|
|
19
72
|
|
|
20
73
|
Many known metadata files are not significant solely because there are many, and a one-file permission or data-loss
|
|
21
74
|
rule may be. A vague request to delete unnecessary files does not establish low risk; reclassify when installer,
|
|
22
75
|
manifest, or other contracts are affected. For a verified ignore-pattern or metadata cleanup, confirm the targets are
|
|
23
76
|
unused, required project materials are unaffected, ignore patterns cover only intended paths, and the diff matches the
|
|
24
77
|
approved scope; Orchestrator's focused checks then suffice without automatically calling QA or Reviewer.
|
|
25
|
-
An environment failure
|
|
26
|
-
is distinct from a code failure; report the exact limitation and any remaining evidence gap to Orchestrator.
|
|
78
|
+
An environment failure is distinct from a code failure; report the exact limitation and any remaining evidence gap to Orchestrator.
|
|
27
79
|
|
|
28
80
|
Use additional Planner/Scouter only for unresolved planning/discovery questions. Reviewer covers substantial changes and
|
|
29
81
|
correctness, factual, security, data, or interface risks. Orchestrator may use Planner/Scouter/Reviewer when justified
|
|
30
|
-
and assigns
|
|
31
|
-
all Coder/QA work. Specialists report unresolved questions to Orchestrator, who assigns support only when needed.
|
|
82
|
+
and assigns all Coder/QA work. Specialists report unresolved questions to Orchestrator, who assigns support only when needed.
|
|
32
83
|
|
|
33
84
|
QA runs applicable existing functional/test checks, or approved structural/consistency checks for policy and
|
|
34
85
|
configuration changes. Reviewer reads the assigned diff/source for correctness, factual accuracy, and security. Outside the final plan Reviewer correction exception, after a
|
|
@@ -45,14 +96,13 @@ completion, a Coder report or passing commands alone do not establish acceptance
|
|
|
45
96
|
|
|
46
97
|
Task acceptance and its focused commit require only the task's risk-scaled evidence: a FRESH QA instance per task that
|
|
47
98
|
needs QA (same-task rechecks may reuse), or Orchestrator focused checks for small, low-risk tasks;
|
|
48
|
-
Reviewer timing and task-boundary gates follow
|
|
99
|
+
Reviewer timing and task-boundary gates follow the Risk-scaled execution section above. For an independently acceptable task,
|
|
49
100
|
do not delay its acceptance/commit solely for later final plan verification. Currently required task checks must not
|
|
50
101
|
be deferred to final verification to accept early. State the scope and timing of final-only integration criteria in
|
|
51
102
|
the plan; with a plan, the required final whole-change review is final plan verification.
|
|
52
103
|
|
|
53
104
|
A task commit record does not mark unperformed final verification complete. Orchestrator still decides final plan
|
|
54
|
-
acceptance
|
|
55
|
-
using final QA/Reviewer/integration evidence and findings, preserving unverified scope and explicit dispositions.
|
|
105
|
+
acceptance using final QA/Reviewer/integration evidence and findings, preserving unverified scope and explicit dispositions.
|
|
56
106
|
Valid evidence may cover both task and plan requirements only under the existing scope/state/independence/freshness/flow
|
|
57
107
|
rules. For final Reviewer findings on already committed plan work, Orchestrator defines a follow-up task and required
|
|
58
108
|
planning/approvals. Coder leaves corrections uncommitted during rechecks. Orchestrator refreshes the latest committed
|
|
@@ -70,10 +120,8 @@ required account and test-data scope, and permitted interactions, QA may use the
|
|
|
70
120
|
to launch the app or open the URL with available approved browser tools. Follow tool instructions and any applicable
|
|
71
121
|
installed browser skill. This permission does not authorize source/document/test/configuration editing, installing
|
|
72
122
|
dependencies, or changing environment configuration. Report missing prerequisites to Orchestrator and leave affected
|
|
73
|
-
criteria
|
|
74
|
-
|
|
75
|
-
interaction steps,
|
|
76
|
-
expected and observed results, and accessible evidence. App startup, page load, and static checks alone do not prove
|
|
123
|
+
criteria unverified. For each criterion record the command or URL, test state and viewport (or not applicable),
|
|
124
|
+
interaction steps, expected and observed results, and accessible evidence. App startup, page load, and static checks alone do not prove
|
|
77
125
|
complete UI behavior. For unavailable test environment or browser tools, report the exact limitation and affected
|
|
78
126
|
unverified criteria. Clean up only QA-created processes and sessions; preserve existing shared services and sessions.
|
|
79
127
|
When assigning UI acceptance criteria, Orchestrator cites this section with its accessible path in the QA brief.
|
|
@@ -90,23 +138,17 @@ verdicts.
|
|
|
90
138
|
Structural checks prove structural criteria only; they do not prove actual behavior, installation, or live agent runtime
|
|
91
139
|
compliance.
|
|
92
140
|
|
|
93
|
-
For QA execution failure or an unmet criterion, Orchestrator assigns Coder correction and
|
|
94
|
-
Reviewer
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
criteria
|
|
99
|
-
are evidence gaps, not presumed code defects; Orchestrator handles those gaps under the existing disposition policy
|
|
100
|
-
without
|
|
101
|
-
substituting Reviewer review for QA evidence.
|
|
141
|
+
For QA execution failure or an unmet criterion, Orchestrator assigns Coder correction and a QA recheck of the
|
|
142
|
+
reproduction path and invalidated related checks before Reviewer; QA reports the prior finding resolved, unresolved, or
|
|
143
|
+
unverified with evidence. An unresolved finding returns to Coder correction and another QA recheck before Reviewer.
|
|
144
|
+
Environment blocks, missing checks, and out-of-scope criteria are evidence gaps, not presumed code defects; Orchestrator
|
|
145
|
+
handles those gaps under the existing disposition policy without substituting Reviewer review for QA evidence.
|
|
102
146
|
|
|
103
147
|
For an acceptance-linked behavior finding, Reviewer reports the criterion, expected behavior, observed problem, related
|
|
104
148
|
source, reproduction conditions and steps, and evidence to Orchestrator, distinguishing source-inferred reproduction
|
|
105
|
-
from
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
rechecks the same scope after a fix), or, for already committed
|
|
109
|
-
plan work, rechecks only the affected findings when warranted. Reviewer continues handling
|
|
149
|
+
from execution-observed results without running QA tests. Outside the final plan Reviewer correction exception,
|
|
150
|
+
Orchestrator routes it to Coder correction and QA post-fix recheck. Outside the required final plan correction loop,
|
|
151
|
+
Orchestrator decides when a Reviewer recheck is warranted by the changed scope and independence. Reviewer continues handling
|
|
110
152
|
structure, design, factual, and security findings that execution checks cannot settle; observable security/interface
|
|
111
153
|
issues may require both QA verification and Reviewer source review.
|
|
112
154
|
|
|
@@ -119,19 +161,6 @@ For low-risk work without QA, Orchestrator's focused checks likewise connect eac
|
|
|
119
161
|
Read brief-cited `references/superpowers/test-driven-development/SKILL.md`; retain ARC exceptions.
|
|
120
162
|
|
|
121
163
|
|
|
122
|
-
### Final plan Reviewer correction loop
|
|
123
|
-
|
|
124
|
-
For a plan's final overall Reviewer findings, including behavior findings, Orchestrator assigns
|
|
125
|
-
Coder → Reviewer recheck with no QA reassignment. Repeat corrections and Reviewer rechecks until findings are resolved;
|
|
126
|
-
the initial single full review does not prohibit necessary rechecks. Before the initial final overall Reviewer,
|
|
127
|
-
risk-required checks and QA execution failures or unmet criteria still require Coder correction → QA recheck.
|
|
128
|
-
This exception applies only to findings from the final overall Reviewer of work with a plan.
|
|
129
|
-
Work without a plan retains its existing verification flow. Scope expansion, separate mandatory obligations,
|
|
130
|
-
or unresolved evidence gaps hold affected work for Orchestrator to resolve and obtain required approvals.
|
|
131
|
-
Orchestrator assigns corrections/rechecks and decides acceptance. Reviewer remains read-only, must not run QA
|
|
132
|
-
checks or decide acceptance. Previous QA evidence must not be presented as post-fix execution evidence;
|
|
133
|
-
report only checks actually performed, their actor, target state, results and remaining limits.
|
|
134
|
-
|
|
135
164
|
## Completion continuity
|
|
136
165
|
|
|
137
166
|
Once applicable authorization, document-depth, execution-target, and handoff conditions hold for the approved scope,
|
|
@@ -145,16 +174,7 @@ actual unmet condition and report what is needed to resume. Structural evidence
|
|
|
145
174
|
|
|
146
175
|
[ARC role policy: contract begin]
|
|
147
176
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
148
|
-
- [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.
|
|
149
|
-
- [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.
|
|
150
177
|
- [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.
|
|
151
|
-
- [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.
|
|
152
|
-
- [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.
|
|
153
|
-
- [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.
|
|
154
|
-
- [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.
|
|
155
|
-
- [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.
|
|
156
|
-
- [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.
|
|
157
|
-
- [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.
|
|
158
178
|
- [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.
|
|
159
179
|
- [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.
|
|
160
180
|
- [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.
|
|
@@ -8,14 +8,12 @@ Visual companion design discussion is distinct from QA UI acceptance checks unde
|
|
|
8
8
|
|
|
9
9
|
Planner identifies a genuinely visual question, explains why a visual helps, and returns options, the user decision,
|
|
10
10
|
and a complete content draft; Planner does not write screens, start a server, operate a browser, or request approval.
|
|
11
|
-
Orchestrator makes a just-in-time
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
after the user's reply, treat terminal text as primary and events as supplemental. A UI topic or accepted companion
|
|
18
|
-
alone does not route every question through a browser.
|
|
11
|
+
Orchestrator makes a just-in-time offer as its own message only when a question is clearer visually, then waits for
|
|
12
|
+
acceptance. If declined, continue in text and do not offer again unless the user raises it. If accepted, decide per
|
|
13
|
+
question whether to use the companion. Orchestrator owns its guide, server/browser, workspace paths, live-session
|
|
14
|
+
checks, complete keyed URL, screens, session state, feedback/events, stale-screen clearing when returning to text, and
|
|
15
|
+
cleanup. Check the server before showing a screen; after the user's reply, treat terminal text as primary and events as
|
|
16
|
+
supplemental. A UI topic or accepted companion alone does not route every question through a browser.
|
|
19
17
|
|
|
20
18
|
|
|
21
19
|
Upstream guide/scripts: `<installed ARC>/references/superpowers/brainstorming/visual-companion.md` and adjacent `scripts/`.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import{defaultRolePolicy,renderPolicySection}from'../policy/render.mjs';
|
|
2
1
|
import{languagePolicy}from'./language.mjs';
|
|
3
2
|
import{isDeepStrictEqual}from'node:util';import{parseToml}from'../models/config.mjs';
|
|
4
3
|
export class GlobalConfigurationError extends Error{constructor(message,options){super(message,options);this.name='GlobalConfigurationError';this.code='ARC_GLOBAL_CONFIGURATION';}}
|
|
@@ -40,4 +39,4 @@ export function renderWaitSettings(original){
|
|
|
40
39
|
return{content:Buffer.from(updated),action:'set ARC wait settings'};
|
|
41
40
|
}
|
|
42
41
|
export function agentsBlockBody(home,userHome,language='en',platform='codex'){const skill=home+'/skills/arc/SKILL.md',within=skill.startsWith(userHome+'/'),shown=within?'~/'+skill.slice(userHome.length+1):skill;return '- '+languagePolicy(language)+'\n'+'- For requests requiring substantive multi-step research, analysis, or implementation, configuration, or test work, and for design, spec, plan, and brainstorming requests (these are NOT standalone document writing), load and follow `'+shown+'`; keep following it in relevant follow-up turns of the same chat without re-reading it unless it changed.'+(within?" Resolve `~` to the current user's home directory.":'')+' ARC subagents (depth 2) follow their role profile and brief instead and do not load `SKILL.md`.\n'+'- Design, spec, plan, and brainstorming drafts are authored ONLY by the Planner. Orchestrator MUST NEVER author them; route drafting skills to the Planner.\n'+
|
|
43
|
-
'- For repository implementation, configuration, or test work, Orchestrator owns coordination and acceptance; assign file edits and other work to the other roles according to their defined responsibilities. Orchestrator must not edit implementation, configuration, or test-code files directly, except under the ARC Orchestrator direct path for small, low-risk tasks.\n'
|
|
42
|
+
'- For repository implementation, configuration, or test work, Orchestrator owns coordination and acceptance; assign file edits and other work to the other roles according to their defined responsibilities. Orchestrator must not edit implementation, configuration, or test-code files directly, except under the ARC Orchestrator direct path for small, low-risk tasks.\n';}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Instruction placement only; runtime policy and role authority remain canonical.
|
|
2
|
+
const reviews = ['review.significant-no-plan', 'review.significant-plan', 'review.final-plan-recheck'];
|
|
3
|
+
export const POLICY_PROJECTIONS = Object.freeze(Object.fromEntries(Object.entries({
|
|
4
|
+
core: ['scope.non-escalation', 'external.explicit-user-authority', 'role.orchestrator-boundary'],
|
|
5
|
+
assignment: ['git.specialists-deny', 'role.scouter-read-only', 'role.planner-draft-only', 'role.coder-implementation', 'role.qa-verification', 'role.reviewer-independent'],
|
|
6
|
+
planning: ['git.orchestrator-accept-commit', ...reviews],
|
|
7
|
+
handoff: ['git.specialists-deny', 'role.coder-implementation', ...reviews],
|
|
8
|
+
preparation: ['scope.non-escalation', 'git.specialists-deny', 'git.orchestrator-accept-commit', 'external.explicit-user-authority'],
|
|
9
|
+
verification: ['git.orchestrator-accept-commit', ...reviews],
|
|
10
|
+
commit: ['scope.non-escalation', 'git.orchestrator-accept-commit', 'external.explicit-user-authority'],
|
|
11
|
+
}).map(([name, ids]) => [name, Object.freeze(ids)])));
|
|
12
|
+
|
|
13
|
+
export function validatePolicyProjections(policy, projections = POLICY_PROJECTIONS) {
|
|
14
|
+
const canonical = new Set(policy.rules.map(rule => rule.id));
|
|
15
|
+
const covered = new Set();
|
|
16
|
+
for (const [name, ids] of Object.entries(projections)) {
|
|
17
|
+
const seen = new Set();
|
|
18
|
+
for (const id of ids) {
|
|
19
|
+
if (!canonical.has(id)) throw new Error(`Role policy: unknown projection rule ${id} in ${name}`);
|
|
20
|
+
if (seen.has(id)) throw new Error(`Role policy: duplicate projection rule ${id} in ${name}`);
|
|
21
|
+
seen.add(id); covered.add(id);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
for (const id of canonical) if (!covered.has(id)) throw new Error(`Role policy: uncovered projection rule ${id}`);
|
|
25
|
+
}
|
package/lib/policy/render.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {renderSourceClaudeHook} from './claude-hook.mjs';
|
|
2
|
+
import {POLICY_PROJECTIONS, validatePolicyProjections} from './placement.mjs';
|
|
2
3
|
import {validateGitPolicy} from '../../claude/skill/hooks/role-git-guard.mjs';
|
|
3
4
|
import source from './role-policy.json' with {type: 'json'};
|
|
4
5
|
const ROLES = ['orchestrator','scouter','planner','coder','qa','reviewer'];
|
|
@@ -28,15 +29,22 @@ export function validateRolePolicy(input) {
|
|
|
28
29
|
}
|
|
29
30
|
export const defaultRolePolicy = source;
|
|
30
31
|
export const POLICY_TARGETS = ['codex','claude'].flatMap(platform => [
|
|
31
|
-
{path:`${platform}/skill/SKILL.md`,platform,audience:'orchestrator'},
|
|
32
|
+
{path:`${platform}/skill/SKILL.md`,platform,audience:'orchestrator',projection:'core'},
|
|
32
33
|
...ROLES.slice(1).map(audience=>({path:`${platform}/agents/arc-${audience}.${platform==='codex'?'toml':'md'}`,platform,audience})),
|
|
33
|
-
...
|
|
34
|
+
...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})),
|
|
34
35
|
]);
|
|
35
36
|
POLICY_TARGETS.splice(POLICY_TARGETS.length-1,0,{path:'claude/skill/hooks/git-policy.json',platform:'claude',audience:'specialists',asset:'git'});
|
|
36
|
-
export function renderPolicySection(policy, {platform, audience, section = 'contract', skillPath} = {}) {
|
|
37
|
+
export function renderPolicySection(policy, {platform, audience, section = 'contract', skillPath, projection = 'full'} = {}) {
|
|
37
38
|
validateRolePolicy(policy);
|
|
38
39
|
if (!['codex','claude'].includes(platform) || !ROLES.includes(audience) || !['contract','global'].includes(section)) fail('unknown render target');
|
|
39
|
-
|
|
40
|
+
let selected;
|
|
41
|
+
if (projection !== 'full') {
|
|
42
|
+
if (!Object.hasOwn(POLICY_PROJECTIONS, projection)) fail('unknown policy projection');
|
|
43
|
+
if (audience !== 'orchestrator') fail('specialist rendering requires full projection');
|
|
44
|
+
validatePolicyProjections(policy);
|
|
45
|
+
selected = new Set(POLICY_PROJECTIONS[projection]);
|
|
46
|
+
}
|
|
47
|
+
const rules = policy.rules.filter(rule=>selected ? selected.has(rule.id) : section === 'global' || audience === 'orchestrator' || rule.roles.includes(audience));
|
|
40
48
|
const lines = ['Generated from lib/policy/role-policy.json; do not edit this managed section manually.', ...rules.map(rule=>`- [${rule.id}] ${rule.text}`), ...(section === 'global' ? [] : [`- [platform.${platform}] ${policy.platforms[platform].notice}`])];
|
|
41
49
|
if (skillPath !== undefined) { if(typeof skillPath !== 'string' || !skillPath || /[\r\n]/.test(skillPath)) fail('invalid skill path'); lines.push(`- Policy details: \`${skillPath}\`.`); }
|
|
42
50
|
return lines.join('\n');
|