@yunhozz/arc 0.4.4 → 0.4.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 +53 -51
- package/claude/skill/SKILL.md +1 -1
- package/claude/skill/references/commit.md +6 -4
- package/claude/skill/references/coordination.md +84 -9
- package/claude/skill/references/handoff-prep.md +4 -4
- package/claude/skill/references/handoff.md +1 -1
- package/claude/skill/references/planning.md +5 -4
- package/claude/skill/references/verification.md +4 -4
- package/codex/skill/SKILL.md +1 -1
- package/codex/skill/references/commit.md +6 -4
- package/codex/skill/references/coordination.md +84 -9
- package/codex/skill/references/handoff-prep.md +4 -4
- package/codex/skill/references/handoff.md +1 -1
- package/codex/skill/references/planning.md +5 -4
- package/codex/skill/references/verification.md +4 -4
- package/gemini/skill/SKILL.md +1 -1
- package/gemini/skill/references/commit.md +6 -4
- package/gemini/skill/references/coordination.md +85 -10
- package/gemini/skill/references/handoff-prep.md +4 -4
- package/gemini/skill/references/handoff.md +1 -1
- package/gemini/skill/references/planning.md +5 -4
- package/gemini/skill/references/verification.md +4 -4
- package/grok/skill/SKILL.md +1 -1
- package/grok/skill/references/commit.md +6 -4
- package/grok/skill/references/coordination.md +88 -13
- package/grok/skill/references/handoff-prep.md +4 -4
- package/grok/skill/references/handoff.md +1 -1
- package/grok/skill/references/planning.md +5 -4
- package/grok/skill/references/verification.md +4 -4
- package/lib/installer/role-routing.mjs +2 -2
- package/lib/installer/runtime-assets.mjs +1 -0
- package/lib/management/operations.mjs +2 -2
- package/lib/platforms/claude.mjs +1 -0
- package/lib/platforms/codex.mjs +1 -0
- package/lib/platforms/index.mjs +7 -0
- package/lib/policy/role-policy.json +2 -2
- package/lib/runtime/bootstrap.mjs +1 -1
- package/lib/runtime/grok-sandbox.mjs +234 -0
- package/lib/runtime/platform-registry.mjs +2 -2
- package/lib/runtime/role-bridge-args.mjs +6 -4
- package/lib/runtime/role-bridge.mjs +14 -6
- package/lib/runtime/role-dispatch-policy.mjs +30 -5
- package/lib/runtime/role-routing.mjs +31 -4
- package/lib/runtime/role-supervisor.mjs +77 -16
- package/package.json +1 -1
- package/shared/skill/runtime/bootstrap.mjs +1 -1
- package/shared/skill/runtime/grok-sandbox.mjs +234 -0
- package/shared/skill/runtime/platform-registry.mjs +2 -2
- package/shared/skill/runtime/role-bridge-args.mjs +6 -4
- package/shared/skill/runtime/role-bridge.mjs +14 -6
- package/shared/skill/runtime/role-dispatch-policy.mjs +30 -5
- package/shared/skill/runtime/role-policy.json +2 -2
- package/shared/skill/runtime/role-routing.mjs +31 -4
- package/shared/skill/runtime/role-supervisor.mjs +77 -16
|
@@ -86,8 +86,8 @@ After initial document batching, follow [planning](planning.md#plan-updates-duri
|
|
|
86
86
|
1. Classify progress records versus contract/mechanical plan revisions. Verify applicable approvals, actual approval time, ordered written-spec/dependent-plan approval, preparation and holds; contract revisions require a fresh Implementer for remaining work. NEVER authorize past work retroactively.
|
|
87
87
|
2. After approval edit the same document, append its revision-history row and leave it uncommitted. Record each pending revision with its approved content hash and approval in the canonical `.git/arc/handoff/<workflow>/` record: `gitPath`, `fromVersion`, `toVersion`, `contentHash` (approved content SHA-256), `approvalRef`, `approvedAt` (actual time), `classification` (`contract|mechanical`), `reason`, `affectedTaskIds`, `status` (`pending|committed`). Preserve each full approved version at `.git/arc/handoff/<workflow>/plan-revisions/<flattened-gitPath>.v<N>.md`; NEVER overwrite prior approvals or copies.
|
|
88
88
|
3. In every role brief identify the Orchestrator-owned pending revision, working-tree version and `contentHash`. If another task's progress records were committed after approval, also include in the brief the SHA-256 of the working-tree document content, which is the approved content plus those progress records. Implementer and QA preserve it untouched as neither their own work nor unrelated user changes.
|
|
89
|
-
4. Include all pending revisions in the accepted commit of the first top-level task executed or reconfirmed against the revised version, otherwise a current task or final Reviewer follow-up commit. Only before overall completion, a standalone `docs(plan)` closing commit MAY include all pending revisions/trailers and no implementation files when no implementation work remains; keep canonical supporting evidence. Exclude pending revision hunks from independent prior-version task commits; hold the commit if separation is unsafe. Add `Plan-Revision: <gitPath> v<from> -> v<to>`, `Plan-Approved-At: <gitPath> v<N> <actual ISO 8601 approval time>` and `Plan-Reason: <gitPath> v<N> <reason>`: one revision trailer per document, approval/reason trailers per version after from through to; repeat keys as needed and preserve existing Git trailers. Use ASCII `->`.
|
|
90
|
-
5. After commit verify the SHA-256 of each committed document's content (not the Git blob OID) equals the latest approved `contentHash` if no progress records have been committed since approval. Otherwise compare against the latest approved copy and allow only classified progress records of this commit's task or committed for other tasks after approval (including R-8 separation). Record the SHA-256 of the expected content used for this comparison in the canonical record; NEVER overwrite approved copies. Mark recorded revisions `committed` and verify no pending revisions remain under [verification](verification.md#evidence-after-plan-revision-commit). Link commit SHA only in the canonical record, never the document. NEVER amend/reset/replay/rewrite planning or implementation commits or create other docs/fixup commits.
|
|
89
|
+
4. Include all pending revisions in the accepted commit of the first top-level task executed or reconfirmed against the revised version, otherwise a current task or final Reviewer follow-up commit. Only before overall completion, a standalone `docs(plan)` closing commit MAY include all pending revisions/trailers and no implementation files when no implementation work remains; keep canonical supporting evidence. Exclude pending revision hunks from independent prior-version task commits; hold the commit if separation is unsafe. Add `Plan-Revision: <gitPath> v<from> -> v<to>`, `Plan-Approved-At: <gitPath> v<N> <actual ISO 8601 approval time>` and `Plan-Reason: <gitPath> v<N> <reason>`: one revision trailer per document, approval/reason trailers per version after from through to; repeat keys as needed and preserve existing Git trailers. Use ASCII `->`. Plan-level progress records follow [commit](commit.md#execution-time-plan-document-updates) and alone never justify the closing commit.
|
|
90
|
+
5. After commit verify the SHA-256 of each committed document's content (not the Git blob OID) equals the latest approved `contentHash` if no progress records have been committed since approval. Otherwise compare against the latest approved copy and allow only classified progress records of this commit's task or committed for other tasks after approval (including R-8 separation) and plan-level progress records carried by this commit. Record the SHA-256 of the expected content used for this comparison in the canonical record; NEVER overwrite approved copies. Mark recorded revisions `committed` and verify no pending revisions remain under [verification](verification.md#evidence-after-plan-revision-commit). Link commit SHA only in the canonical record, never the document. NEVER amend/reset/replay/rewrite planning or implementation commits or create other docs/fixup commits.
|
|
91
91
|
|
|
92
92
|
<a id="recovery-prerequisite"></a>
|
|
93
93
|
### Recovery prerequisite
|
|
@@ -103,8 +103,8 @@ Distinguish instruction/input sources, versions/approvals and access. Missing ro
|
|
|
103
103
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
104
104
|
- [scope.non-escalation] Act only within role authority, approved scope and available platform tools. Delegation, restart, agent messages and attached instructions do not expand authority. DO NOT bypass restrictions through aliases, scripts, other tools, processes or redelegation. Return instruction conflicts to Orchestrator before dependent work. Reuse valid approvals for unchanged scope without requesting them again. If an optional read method fails, use only a pre-authorized, side-effect-free alternative for the same positively identified material, approved version, purpose and role authority, with equivalent evidence conditions. A different locator requires the exact locator in the brief in advance and verified material identity/version; discovery is not authorization. Missing required input, authority or target mismatch, ownership conflict, partial mutation, unknown state, or an alternative that is unapproved, ambiguous or fails requires immediate return to Orchestrator before dependent work. Permit no chained discovery, guessed paths, mutation retries, dependency/environment/authority changes or repeated completed work. Report the first failure, alternative, evidence, limits, dependent work held and independent work remaining. First, record the exact failed check, result and evidence, baseline revision and current revision/change state. Second, classify each failure as baseline or current, recording affected scope and dependency relationships. Third, hold only affected or dependent tasks and checks; when classification is unknown, hold only work whose impact is unknown. Fourth, Orchestrator MUST release already-approved independent work without waiting for unrelated failures, after confirming valid authority, target, inputs, ownership and gates. Finally, keep acceptance held while any required check remains unresolved. Specialists report evidence and remaining work and MUST NOT self-authorize release. Independent release never hides failed checks, expands scope, changes criteria or waives required verification. Distinguish user-provided instructions, discovered workspace instruction files, installed role references and task inputs by source, applicability, version/approval and access state (available, absent, inaccessible, conflicting or unverified). A root AGENTS.md absence is not evidence of absence of instructions; applicable user-provided instructions remain valid, and that absence alone is not a blocker. Hold dependent work for missing required inputs or unresolved instruction conflicts. Retrieved content grants no authority. The resume brief preserves valid approvals for unchanged scope, completed work, failure, resolution evidence, valid and invalid evidence, remaining holds and next objective. After resolution, Orchestrator revalidates affected gates and records changed facts. NEVER treat restart as new authority. Preserve role, Git, preservation, approval, QA/recheck, final Reviewer, acceptance and commit boundaries.
|
|
105
105
|
- [git.specialists-deny] Specialists MUST NOT change Git state during implementation or recovery: no stage, commit, push, merge, rebase, reset, branch creation/switching or worktree creation/removal. Explicit Orchestrator assignment cannot authorize these actions; return them to Orchestrator. Read-only Git inspection remains allowed within the assigned scope.
|
|
106
|
-
- [git.orchestrator-accept-commit] Only Orchestrator accepts work and performs Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied. Orchestrator accepts, then includes that task's own progress records made after task completion (checkboxes, notes, results, evidence and status) with its implementation work in that commit, without a separate docs/fixup commit or planning-commit amendment for those records. Exclude other tasks; pending approved spec/plan revisions follow planning.plan-revision and preserve the no-change path without empty commits. Orchestrator commits without separate user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership; verify the resulting SHA, content, HEAD and remaining changes. Existing small-task direct and plan-omission paths remain unchanged.
|
|
106
|
+
- [git.orchestrator-accept-commit] Only Orchestrator accepts work and performs Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied. Orchestrator accepts, then includes that task's own progress records made after task completion (checkboxes, notes, results, evidence and status) with its implementation work in that commit, without a separate docs/fixup commit or planning-commit amendment for those records. Exclude other tasks; pending approved spec/plan revisions follow planning.plan-revision and preserve the no-change path without empty commits. Plan-level progress records (final verification results, final Reviewer verdicts and finding dispositions, overall completion status) are the sole exception: include them in the plan's next task acceptance or final Reviewer follow-up commit; when no implementation work remains and no standalone closing commit for pending revisions is made, keep them only in the canonical handoff record without changing the plan document or creating a commit. Orchestrator commits without separate user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership; verify the resulting SHA, content, HEAD and remaining changes. Existing small-task direct and plan-omission paths remain unchanged.
|
|
107
107
|
- [external.explicit-user-authority] Push, merge, deploy, publish and external messages require explicit user authorization for the action, scope and target. Local commit authority grants no external authority. Orchestrator performs authorized external actions; specialists return them without execution.
|
|
108
|
-
- [planning.plan-revision] 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. 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 with Plan-Revision, Plan-Approved-At and Plan-Reason trailers 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, and that no pending revision remains. Follow planning, handoff-prep, commit and verification for the full contract.
|
|
108
|
+
- [planning.plan-revision] 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 with Plan-Revision, Plan-Approved-At and Plan-Reason trailers 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.
|
|
109
109
|
- [platform.grok] Role restrictions are prompt-level contracts, not a filesystem sandbox. Grok sandboxing, native tool restriction fields, observer hooks and Git guards are unverified, and Grok may continue without its sandbox. Use only available authorized tools; ARC disables Grok Claude compatibility (agents, skills, rules in config.toml; also MCPs and hooks for bridge children), but whether Grok sessions honor these settings is unverified.
|
|
110
110
|
[ARC role policy: contract end]
|
|
@@ -167,7 +167,7 @@ Evaluate target choice validity separately from evidence validity. Approved HEAD
|
|
|
167
167
|
|
|
168
168
|
Supported spec+plan handoffs include registered task contract, exact check descriptor, task/final scope, `status.changeFingerprints`, independent actor attestations, intent ID/result messageRef/verdict. Authorized roles execute after `prepare` and record through `result`; CLI records prove no identity/compliance.
|
|
169
169
|
|
|
170
|
-
Include spec/plan paths in cooperative `task.paths` to commit task progress records and pending revisions; missing paths hold the commit until an approved scope revision, and the cooperative CLI does not support the standalone `docs(plan)` closing commit, so include pending revisions in task or follow-up commits. When `task.paths` includes the plan path, the cooperative CLI holds R-8 separation commits (staging progress records without revision hunks) at both preflight and result verification; while revisions are pending, prior-version tasks cannot be committed through the CLI.
|
|
170
|
+
Include spec/plan paths in cooperative `task.paths` to commit task progress records and pending revisions; missing paths hold the commit until an approved scope revision, and the cooperative CLI does not support the standalone `docs(plan)` closing commit, so include pending revisions in task or follow-up commits. When `task.paths` includes the plan path, the cooperative CLI holds R-8 separation commits (staging progress records without revision hunks) at both preflight and result verification; while revisions are pending, prior-version tasks cannot be committed through the CLI. Plan-level progress records follow the same `task.paths` rule; when no task or follow-up commit follows, they stay only in the canonical record, and the cooperative CLI adds no support for them.
|
|
171
171
|
|
|
172
172
|
On scope/docs/approval changes inspect `affectedTaskIds`/dependencies, preserve history and supply current approval/contracts. NEVER reuse checks across fingerprints. Link findings to same-version Implementer resolution/QA rechecks; only plan-final Reviewer findings use Implementer→Reviewer. No task-level Reviewer prerequisite. Detailed fields/holds follow [verification](verification.md#verification-lifecycle-in-the-cooperative-cli); unsupported omission is no policy violation/document obligation.
|
|
173
173
|
|
|
@@ -115,13 +115,13 @@ New planning scope requires list/depth/dependency reassessment and approvals bef
|
|
|
115
115
|
<a id="plan-updates-during-execution"></a>
|
|
116
116
|
## Plan updates during execution
|
|
117
117
|
|
|
118
|
-
Task progress records (checkboxes, notes, results, evidence and completion status) preserving the approved contract need no new approval; record classification/reason/actual time. After task completion Orchestrator includes that task's own records with its accepted implementation work in the same focused commit, excluding other tasks. DO NOT amend the original planning commit or create a separate docs/fixup commit for those records. Accepted no-change tasks follow the no-change path without empty commits. Removing checks, invented success, unsupported acceptance or mixed scope changes are not progress records.
|
|
118
|
+
Task progress records (checkboxes, notes, results, evidence and completion status) preserving the approved contract need no new approval; record classification/reason/actual time. Plan-level progress records (final verification results, final Reviewer round verdicts and finding dispositions with user-decision references, and overall completion status) follow [commit](commit.md#execution-time-plan-document-updates): they ride the plan's next task acceptance or final Reviewer follow-up commit, or a standalone closing commit made for pending revisions; otherwise they stay only in the canonical record. After task completion Orchestrator includes that task's own records with its accepted implementation work in the same focused commit, excluding other tasks. DO NOT amend the original planning commit or create a separate docs/fixup commit for those records. Accepted no-change tasks follow the no-change path without empty commits. Removing checks, invented success, unsupported acceptance or mixed scope changes are not progress records.
|
|
119
119
|
|
|
120
120
|
Changes to goals, task boundaries, scope, criteria, method, risk, dependencies or checks require revised approval before affected work. Hold, obtain ordered design/spec/plan approvals and prepare target/ownership/checks/handoff. Other body corrections follow version approval; classify typos/paths/commands/explanations by semantic effect. Every non-progress content change, including a mechanical correction, is a plan revision requiring applicable approval/preparation. A contract revision requires a fresh Implementer for remaining work; obtain written-spec approval before a dependent plan revision.
|
|
121
121
|
|
|
122
122
|
After approval Orchestrator edits the same file, appends a revision-history row and leaves the revision uncommitted. Apply cumulative revisions to that file and append another row. At document end use `Version | Approval time | Classification | Affected tasks | Reason`; keep rows append-only, with no SHA. Add v1 at the first revision using the actual initial approval time. Preserve actual approval chronology, not retroactive authorization; later committed content proves no earlier approval.
|
|
123
123
|
|
|
124
|
-
Keep all approved spec/plan revisions pending for the accepted commit of the first top-level task executed or reconfirmed against the revised version. Otherwise include them in a current task acceptance or final Reviewer follow-up commit. Only when no implementation work remains before overall completion MAY Orchestrator make one standalone `docs(plan)` closing commit: record that evidence canonically, include all pending revisions/trailers and no implementation files. No separate docs/fixup commit is allowed outside this sole closing exception. Overall completion requires no pending revisions. Exclude revision hunks from independent tasks accepted on a prior version; hold that commit if safe separation is impossible.
|
|
124
|
+
Keep all approved spec/plan revisions pending for the accepted commit of the first top-level task executed or reconfirmed against the revised version. Otherwise include them in a current task acceptance or final Reviewer follow-up commit. Only when no implementation work remains before overall completion MAY Orchestrator make one standalone `docs(plan)` closing commit: record that evidence canonically, include all pending revisions/trailers and no implementation files. No separate docs/fixup commit is allowed outside this sole closing exception. Plan-level progress records alone never trigger it. Overall completion requires no pending revisions. Exclude revision hunks from independent tasks accepted on a prior version; hold that commit if safe separation is impossible.
|
|
125
125
|
|
|
126
126
|
NEVER amend planning or implementation commits, reset, replay or rewrite their history. Preserve canonical pending revisions, approved content copies, versions/hashes, approval references/actual times, classification/reason, affected tasks and hold/preparation/resume evidence under [preparation](handoff-prep.md#execution-time-plan-revision). NEVER overwrite old approvals/content. Follow [commit](commit.md#execution-time-plan-document-updates) and [verification](verification.md#evidence-after-plan-revision-commit). Add no Git automation/runtime enforcement/authority/check exemptions.
|
|
127
127
|
|
|
@@ -149,12 +149,12 @@ Follow [handoff-worktree](handoff-worktree.md).
|
|
|
149
149
|
|
|
150
150
|
[ARC role policy: contract begin]
|
|
151
151
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
152
|
-
- [git.orchestrator-accept-commit] Only Orchestrator accepts work and performs Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied. Orchestrator accepts, then includes that task's own progress records made after task completion (checkboxes, notes, results, evidence and status) with its implementation work in that commit, without a separate docs/fixup commit or planning-commit amendment for those records. Exclude other tasks; pending approved spec/plan revisions follow planning.plan-revision and preserve the no-change path without empty commits. Orchestrator commits without separate user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership; verify the resulting SHA, content, HEAD and remaining changes. Existing small-task direct and plan-omission paths remain unchanged.
|
|
152
|
+
- [git.orchestrator-accept-commit] Only Orchestrator accepts work and performs Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied. Orchestrator accepts, then includes that task's own progress records made after task completion (checkboxes, notes, results, evidence and status) with its implementation work in that commit, without a separate docs/fixup commit or planning-commit amendment for those records. Exclude other tasks; pending approved spec/plan revisions follow planning.plan-revision and preserve the no-change path without empty commits. Plan-level progress records (final verification results, final Reviewer verdicts and finding dispositions, overall completion status) are the sole exception: include them in the plan's next task acceptance or final Reviewer follow-up commit; when no implementation work remains and no standalone closing commit for pending revisions is made, keep them only in the canonical handoff record without changing the plan document or creating a commit. Orchestrator commits without separate user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership; verify the resulting SHA, content, HEAD and remaining changes. Existing small-task direct and plan-omission paths remain unchanged.
|
|
153
153
|
- [approval.run-mode] The installed ARC Run mode is Supervised unless the installed skill states Full Auto. In Full Auto, an Orchestrator decision recorded as `auto-decided (Full Auto)` with gate, choice, reason and evidence counts as the explicit choice or approval for that listed gate only; briefs cite it as `full-auto:<doc>@<version>` or the recorded decision. It never authorizes new product decisions outside the original request, external actions, resolution of failures, holds, unknown state or ownership conflicts, preservation-rule Git actions, permission or sandbox changes, or unknown slots and exhausted capacity, and it changes no plan-depth, commit, QA, Reviewer or acceptance rule. A user request to stop or use Supervised applies from the next gate.
|
|
154
154
|
- [review.significant-no-plan] Significant/high-risk work without a plan follows Implementer → QA and required QA rechecks → Reviewer of the final full change → Orchestrator acceptance. DO NOT omit Reviewer because no plan exists. This adds no plan obligation.
|
|
155
155
|
- [review.significant-plan] Significant/high-risk plan work follows Implementer → required fresh QA → Orchestrator acceptance and focused commit for each task. 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 gate. Preserve required checks and necessary finding rechecks.
|
|
156
156
|
- [review.final-plan-recheck] Complete required QA and QA failure rechecks before the initial final overall Reviewer review. Once that review begins on plan work, every final Reviewer finding, including behavior, follows Implementer → Reviewer without QA reassignment until resolved. Keep corrections uncommitted through Reviewer rechecks, then accept and create one focused follow-up commit. Separate QA findings follow Implementer → QA. Preserve required QA outside this final Reviewer exception.
|
|
157
|
-
- [planning.plan-revision] 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. 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 with Plan-Revision, Plan-Approved-At and Plan-Reason trailers 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, and that no pending revision remains. Follow planning, handoff-prep, commit and verification for the full contract.
|
|
157
|
+
- [planning.plan-revision] 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 with Plan-Revision, Plan-Approved-At and Plan-Reason trailers 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.
|
|
158
158
|
- [planning.planner-brief] Follow planning.md's Planner drafting preparation and review procedure, including preflight, ledger, evidence classification, target preparation, preceding approvals, provenance and reference gates. Before Planner 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 Planner instance only within the design/brainstorming stage while its role, context and source remain valid; after design approval, use a fresh Planner instance for each spec and plan stage, whose initial brief contains every required field, saved document paths and approved versions. 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. When source, target or scope changed, reconfirm affected inputs. Planner 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, allow the initial draft and one consolidated correction. Orchestrator reviews once with the fixed checklist and sends one consolidated correction using changed fields only. 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 Planner only for reformatting, re-expression, save errors or patch-application errors; Orchestrator handles these. Evaluate separate substantive work under the normal Planner gate. Preserve separate sequential design/spec/plan approvals. Add no fixed call cap or profile call-count conditions, and NEVER accept an incomplete draft. Keep user progress brief and based on Planner status without relaying draft content. At approval, present the integrated, saved and reviewed Markdown without repeating its body in chat.
|
|
159
159
|
- [platform.grok] Role restrictions are prompt-level contracts, not a filesystem sandbox. Grok sandboxing, native tool restriction fields, observer hooks and Git guards are unverified, and Grok may continue without its sandbox. Use only available authorized tools; ARC disables Grok Claude compatibility (agents, skills, rules in config.toml; also MCPs and hooks for bridge children), but whether Grok sessions honor these settings is unverified.
|
|
160
160
|
[ARC role policy: contract end]
|
|
@@ -182,6 +182,7 @@ Applies only when the installed SKILL.md contains `**Run mode:** Full Auto.` and
|
|
|
182
182
|
| Written spec approval | auto | After Orchestrator review |
|
|
183
183
|
| Plan approval | auto | Only with zero open decisions; otherwise user |
|
|
184
184
|
| Spec/plan revision within the original scope | auto | Scope-expanding revisions → user |
|
|
185
|
+
| Non-blocking final Reviewer finding disposition | auto | Fix or no-fix decision only: recommended disposition within approved scope; scope-expanding fixes → user; Reviewer recheck and acceptance stay unchanged |
|
|
185
186
|
| Direct-path F1–F8 scope approval | auto | All F1–F8 still proven; otherwise user |
|
|
186
187
|
| `AskUserQuestion` | auto | Recommended option |
|
|
187
188
|
| Visual companion offer | skipped | Not offered |
|
|
@@ -50,7 +50,7 @@ Expanded scope/separate obligations/gaps hold affected work for resolution/appro
|
|
|
50
50
|
<a id="evidence-after-plan-revision-commit"></a>
|
|
51
51
|
## Evidence after plan revision commit
|
|
52
52
|
|
|
53
|
-
Verify every committed document blob against its latest approved content hash and full approved copy. If no progress records have been committed since approval, the SHA-256 of the committed document content (not the Git blob OID) MUST equal the latest approved `contentHash`. Otherwise the diff from the latest approved copy MUST contain only classified progress records belonging to that commit's task or committed for other tasks after approval (including R-8 separation). Record the SHA-256 of the expected content used for this comparison in the canonical record; NEVER overwrite approved copies. Verify each pending revision's status is `committed` and no pending revision remains before overall completion. Link commit SHA in the canonical record only, not the document. Preserve actual approval chronology; later committed content proves no earlier approval.
|
|
53
|
+
Verify every committed document blob against its latest approved content hash and full approved copy. If no progress records have been committed since approval, the SHA-256 of the committed document content (not the Git blob OID) MUST equal the latest approved `contentHash`. Otherwise the diff from the latest approved copy MUST contain only classified progress records belonging to that commit's task or committed for other tasks after approval (including R-8 separation), or classified plan-level progress records carried by that commit. Record the SHA-256 of the expected content used for this comparison in the canonical record; NEVER overwrite approved copies. Verify each pending revision's status is `committed` and no pending revision remains before overall completion. Link commit SHA in the canonical record only, not the document. Preserve actual approval chronology; later committed content proves no earlier approval.
|
|
54
54
|
|
|
55
55
|
Existing commit evidence links remain valid because history is unchanged. For a contract revision, affected checks and rechecks MUST be rerun against the revised version. Stale evidence from plan-file changes requires refresh under existing rules. Preserve exact-HEAD/document/policy/fingerprint requirements; NEVER rewrite old fingerprints to suggest execution at a new state. Refresh briefs/gates before dependencies. Structure proves no live compliance.
|
|
56
56
|
|
|
@@ -60,7 +60,7 @@ Existing commit evidence links remain valid because history is unchanged. For a
|
|
|
60
60
|
|
|
61
61
|
Task acceptance differs from final verification/acceptance. Connect criteria/observations/current checks/findings, not checkboxes/reports/passing commands alone. Use fresh QA where required or low-risk focused checks. For same-task QA findings and required QA rechecks, reuse the current QA while scope/workspace/ownership/context remain valid. Final overall Reviewer findings on plan work follow Implementer → Reviewer without QA reassignment; see the [final plan Reviewer correction loop](#final-plan-reviewer-correction-loop).
|
|
62
62
|
|
|
63
|
-
DO NOT delay independently acceptable tasks solely for final-only checks or defer currently required checks to accept early. State final integration scope/timing separately. Whole-plan Reviewer is final verification; task commits prove no unperformed final checks. Orchestrator decides final acceptance with QA/Reviewer/integration evidence/findings and unverified/disposition records. Shared evidence MUST satisfy all reuse rules.
|
|
63
|
+
DO NOT delay independently acceptable tasks solely for final-only checks or defer currently required checks to accept early. State final integration scope/timing separately. Whole-plan Reviewer is final verification; task commits prove no unperformed final checks. Orchestrator decides final acceptance with QA/Reviewer/integration evidence/findings and unverified/disposition records. Shared evidence MUST satisfy all reuse rules. Before the overall completion report and any push, PR or merge authorization request, Orchestrator verifies that plan-level progress records are carried by the verified next commit of the plan or, when none follows, recorded only in the canonical handoff record with the plan document unchanged and a clean working tree. While a user decision on a non-blocking final Reviewer finding is pending, hold overall completion; a fix decision follows plan revision and a new task whose accepted commit carries the records, and a no-fix disposition stays canonical only when no later commit follows.
|
|
64
64
|
|
|
65
65
|
Committed-plan final Reviewer findings need a follow-up task/planning/approvals. Keep corrections uncommitted; refresh committed state plus uncommitted diff/files in Reviewer artifacts/briefs. Reuse/assign independent Reviewer and repeat Implementer → Reviewer until resolved, then accept/commit one focused follow-up. Final QA findings still use Implementer → QA. No automatic amend/reset/duplicate originals; scope growth retains planning/approvals.
|
|
66
66
|
|
|
@@ -122,11 +122,11 @@ NEVER rewrite QA fingerprints after commit. Separate post-commit observations de
|
|
|
122
122
|
|
|
123
123
|
[ARC role policy: contract begin]
|
|
124
124
|
Generated from lib/policy/role-policy.json; do not edit this managed section manually.
|
|
125
|
-
- [git.orchestrator-accept-commit] Only Orchestrator accepts work and performs Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied. Orchestrator accepts, then includes that task's own progress records made after task completion (checkboxes, notes, results, evidence and status) with its implementation work in that commit, without a separate docs/fixup commit or planning-commit amendment for those records. Exclude other tasks; pending approved spec/plan revisions follow planning.plan-revision and preserve the no-change path without empty commits. Orchestrator commits without separate user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership; verify the resulting SHA, content, HEAD and remaining changes. Existing small-task direct and plan-omission paths remain unchanged.
|
|
125
|
+
- [git.orchestrator-accept-commit] Only Orchestrator accepts work and performs Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied. Orchestrator accepts, then includes that task's own progress records made after task completion (checkboxes, notes, results, evidence and status) with its implementation work in that commit, without a separate docs/fixup commit or planning-commit amendment for those records. Exclude other tasks; pending approved spec/plan revisions follow planning.plan-revision and preserve the no-change path without empty commits. Plan-level progress records (final verification results, final Reviewer verdicts and finding dispositions, overall completion status) are the sole exception: include them in the plan's next task acceptance or final Reviewer follow-up commit; when no implementation work remains and no standalone closing commit for pending revisions is made, keep them only in the canonical handoff record without changing the plan document or creating a commit. Orchestrator commits without separate user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership; verify the resulting SHA, content, HEAD and remaining changes. Existing small-task direct and plan-omission paths remain unchanged.
|
|
126
126
|
- [review.significant-no-plan] Significant/high-risk work without a plan follows Implementer → QA and required QA rechecks → Reviewer of the final full change → Orchestrator acceptance. DO NOT omit Reviewer because no plan exists. This adds no plan obligation.
|
|
127
127
|
- [review.significant-plan] Significant/high-risk plan work follows Implementer → required fresh QA → Orchestrator acceptance and focused commit for each task. 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 gate. Preserve required checks and necessary finding rechecks.
|
|
128
128
|
- [review.final-plan-recheck] Complete required QA and QA failure rechecks before the initial final overall Reviewer review. Once that review begins on plan work, every final Reviewer finding, including behavior, follows Implementer → Reviewer without QA reassignment until resolved. Keep corrections uncommitted through Reviewer rechecks, then accept and create one focused follow-up commit. Separate QA findings follow Implementer → QA. Preserve required QA outside this final Reviewer exception.
|
|
129
|
-
- [planning.plan-revision] 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. 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 with Plan-Revision, Plan-Approved-At and Plan-Reason trailers 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, and that no pending revision remains. Follow planning, handoff-prep, commit and verification for the full contract.
|
|
129
|
+
- [planning.plan-revision] 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 with Plan-Revision, Plan-Approved-At and Plan-Reason trailers 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.
|
|
130
130
|
- [platform.grok] Role restrictions are prompt-level contracts, not a filesystem sandbox. Grok sandboxing, native tool restriction fields, observer hooks and Git guards are unverified, and Grok may continue without its sandbox. Use only available authorized tools; ARC disables Grok Claude compatibility (agents, skills, rules in config.toml; also MCPs and hooks for bridge children), but whether Grok sessions honor these settings is unverified.
|
|
131
131
|
[ARC role policy: contract end]
|
|
132
132
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {installerRegistryOf,sortByAnchor} from '../platforms/index.mjs';
|
|
1
|
+
import {defaultCompositePlatformIds,installerRegistryOf,sortByAnchor} from '../platforms/index.mjs';
|
|
2
2
|
import {renderStandaloneProfiles} from './plan.mjs';
|
|
3
3
|
import {verifyPayload} from './manifest.mjs';
|
|
4
4
|
import {loadModelConfig} from '../models/index.mjs';
|
|
@@ -40,7 +40,7 @@ export function renameCompositeProfile(bytes,platform,role,revision,context={}){
|
|
|
40
40
|
return installerRegistryOf(context).getPlatform(platform).profiles.renameForRouting(bytes,role,revision);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const defaultCompositePlatforms=context=>installerRegistryOf(context)
|
|
43
|
+
const defaultCompositePlatforms=context=>defaultCompositePlatformIds(installerRegistryOf(context));
|
|
44
44
|
|
|
45
45
|
/** Inspect only ARC-owned composite paths; existing unknown files are never replaced. */
|
|
46
46
|
export function prepareCompositeFiles({context,targets,config,platforms=config.platforms??defaultCompositePlatforms(context),anchor=sortByAnchor(platforms,installerRegistryOf(context))[0],profileInputs,modelConfigs,previous}){
|
|
@@ -17,6 +17,7 @@ export const RUNTIME_MODULE_PATHS = Object.freeze([
|
|
|
17
17
|
'lib/runtime/gemini-stream.mjs',
|
|
18
18
|
'lib/runtime/git-evidence.mjs',
|
|
19
19
|
'lib/runtime/git-query.mjs',
|
|
20
|
+
'lib/runtime/grok-sandbox.mjs',
|
|
20
21
|
'lib/runtime/grok-stream.mjs',
|
|
21
22
|
'lib/runtime/identity.mjs',
|
|
22
23
|
'lib/runtime/local-cli.mjs',
|
|
@@ -2,7 +2,7 @@ import {readInstallMode,assertVerifiedInstallMode} from '../installer/install-mo
|
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import {fileURLToPath} from 'node:url';
|
|
4
4
|
import {resolveTarget,resolveTargets} from '../installer/targets.mjs';
|
|
5
|
-
import {installerRegistryOf,sortByAnchor,sortByDisplay,platformLabel} from '../platforms/index.mjs';
|
|
5
|
+
import {defaultCompositePlatformIds,installerRegistryOf,sortByAnchor,sortByDisplay,platformLabel} from '../platforms/index.mjs';
|
|
6
6
|
import {platformAvailability} from '../platforms/availability.mjs';
|
|
7
7
|
import {buildInstallPlan,renderStandaloneProfiles,validatePlanSet} from '../installer/plan.mjs';
|
|
8
8
|
import {verifyPayload} from '../installer/manifest.mjs';
|
|
@@ -79,7 +79,7 @@ export function readCompositeConfig(context){return readCompositeRoutingConfig(c
|
|
|
79
79
|
export async function prepareCompositeOperation(context,options){
|
|
80
80
|
if(!['install','preset'].includes(options.kind))throw new TargetConfigurationError('Unsupported composite operation');
|
|
81
81
|
const registry=installerRegistryOf(context),resolved=resolveTargets(context),targets=resolved.targets,mode=assertVerifiedInstallMode({safeFs:context.safeFs,...resolved,platforms:registry});
|
|
82
|
-
const ids=[...new Set([...(options.platforms??(mode.mode==='composite'?mode.platforms:registry
|
|
82
|
+
const ids=[...new Set([...(options.platforms??(mode.mode==='composite'?mode.platforms:defaultCompositePlatformIds(registry))),...Object.values(options.config.roles).map(role=>role.platform)])];
|
|
83
83
|
for(const id of ids)if(!registry.isPlatformId(id))throw new TargetConfigurationError(`Unknown platform: ${id}`);
|
|
84
84
|
if(ids.length<2)throw new TargetConfigurationError('Mixed routing requires at least two platforms');
|
|
85
85
|
const platforms=sortByAnchor(ids,registry),anchor=platforms[0],config=buildRoleRoutingConfig({revision:options.config.revision,platforms,roles:options.config.roles},context);
|
package/lib/platforms/claude.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import {discoverAnthropicCatalog} from '../models/catalog-anthropic.mjs';
|
|
|
4
4
|
|
|
5
5
|
export const CLAUDE_INSTALLER = Object.freeze({
|
|
6
6
|
runtime: getPlatform('claude'),
|
|
7
|
+
defaultComposite: true,
|
|
7
8
|
payloadPrefix: 'claude', instructionFile: 'CLAUDE.md', runtimeConfigFile: 'settings.json',
|
|
8
9
|
globalPaths: Object.freeze(['CLAUDE.md', 'settings.json']),
|
|
9
10
|
models: Object.freeze({staticCatalog: new URL('../models/claude-models.json', import.meta.url), effortField: getPlatform('claude').models.effortField, discover: discoverAnthropicCatalog}),
|
package/lib/platforms/codex.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import {listCodexModelCapabilities} from '../models/codex-catalog.mjs';
|
|
|
6
6
|
|
|
7
7
|
export const CODEX_INSTALLER = Object.freeze({
|
|
8
8
|
runtime: getPlatform('codex'),
|
|
9
|
+
defaultComposite: true,
|
|
9
10
|
payloadPrefix: 'codex', instructionFile: 'AGENTS.md', runtimeConfigFile: 'config.toml',
|
|
10
11
|
globalPaths: Object.freeze(['AGENTS.md', 'config.toml']),
|
|
11
12
|
models: Object.freeze({staticCatalog: new URL('../models/codex-models.json', import.meta.url), effortField: getPlatform('codex').models.effortField, discover: listCodexModelCapabilities}),
|
package/lib/platforms/index.mjs
CHANGED
|
@@ -21,6 +21,13 @@ export function createInstallerRegistry({runtime, descriptors}) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export const DEFAULT_INSTALLER_REGISTRY = createInstallerRegistry({runtime: DEFAULT_PLATFORM_REGISTRY, descriptors: [CLAUDE_INSTALLER, CODEX_INSTALLER, GEMINI_INSTALLER, GROK_INSTALLER]});
|
|
24
|
+
|
|
25
|
+
export function defaultCompositePlatformIds(registry = DEFAULT_INSTALLER_REGISTRY) {
|
|
26
|
+
return registry.byAnchorOrder()
|
|
27
|
+
.filter(descriptor => descriptor.defaultComposite === true && descriptor.runtime.capabilities.compositeHost.state === 'verified')
|
|
28
|
+
.map(descriptor => descriptor.runtime.id);
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
export const installerRegistryOf = context => context?.platforms ?? DEFAULT_INSTALLER_REGISTRY;
|
|
25
32
|
export const platformLabel = (id, registry = DEFAULT_INSTALLER_REGISTRY) => registry.getPlatform(id)?.runtime.label ?? id;
|
|
26
33
|
export const sortByDisplay = (ids, registry = DEFAULT_INSTALLER_REGISTRY) => [...ids].sort((a, b) => registry.getPlatform(a).runtime.displayOrder - registry.getPlatform(b).runtime.displayOrder);
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"task-progress-classification-reason-time"
|
|
109
109
|
],
|
|
110
110
|
"authority": "orchestrator",
|
|
111
|
-
"text": "Only Orchestrator accepts work and performs Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied. Orchestrator accepts, then includes that task's own progress records made after task completion (checkboxes, notes, results, evidence and status) with its implementation work in that commit, without a separate docs/fixup commit or planning-commit amendment for those records. Exclude other tasks; pending approved spec/plan revisions follow planning.plan-revision and preserve the no-change path without empty commits. Orchestrator commits without separate user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership; verify the resulting SHA, content, HEAD and remaining changes. Existing small-task direct and plan-omission paths remain unchanged.",
|
|
111
|
+
"text": "Only Orchestrator accepts work and performs Git mutations. One approved top-level plan task becomes one focused implementation commit after criteria, required checks and findings are satisfied. Orchestrator accepts, then includes that task's own progress records made after task completion (checkboxes, notes, results, evidence and status) with its implementation work in that commit, without a separate docs/fixup commit or planning-commit amendment for those records. Exclude other tasks; pending approved spec/plan revisions follow planning.plan-revision and preserve the no-change path without empty commits. Plan-level progress records (final verification results, final Reviewer verdicts and finding dispositions, overall completion status) are the sole exception: include them in the plan's next task acceptance or final Reviewer follow-up commit; when no implementation work remains and no standalone closing commit for pending revisions is made, keep them only in the canonical handoff record without changing the plan document or creating a commit. Orchestrator commits without separate user commit approval. Reports, passing checks and Reviewer opinions do not replace acceptance. Preserve unrelated changes and ownership; verify the resulting SHA, content, HEAD and remaining changes. Existing small-task direct and plan-omission paths remain unchanged.",
|
|
112
112
|
"controls": {
|
|
113
113
|
"codex": "prompt",
|
|
114
114
|
"claude": "prompt",
|
|
@@ -404,7 +404,7 @@
|
|
|
404
404
|
"plan-revision-trailers"
|
|
405
405
|
],
|
|
406
406
|
"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. 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 with Plan-Revision, Plan-Approved-At and Plan-Reason trailers 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, and that no pending revision remains. Follow planning, handoff-prep, commit and verification for the full contract.",
|
|
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 with Plan-Revision, Plan-Approved-At and Plan-Reason trailers 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
408
|
"controls": {
|
|
409
409
|
"codex": "prompt",
|
|
410
410
|
"claude": "prompt",
|
|
@@ -8,7 +8,7 @@ export const COOPERATIVE_RUNTIME_MODULES=Object.freeze([
|
|
|
8
8
|
'cli.mjs','command.mjs','bootstrap.mjs','cooperative-schema.mjs','cooperative.mjs','evaluate.mjs',
|
|
9
9
|
'scope.mjs','store.mjs','git-evidence.mjs','assignment.mjs','verification.mjs','acceptance.mjs','external.mjs','schema.mjs','operations.mjs','gate.mjs','adapters/codex.mjs','adapters/claude.mjs','capabilities.mjs','identity.mjs','git-query.mjs','target-preparation.mjs',
|
|
10
10
|
'local-cli.mjs','role-routing-config.mjs','role-routing.mjs','role-bridge.mjs',
|
|
11
|
-
'role-dispatch-policy.mjs','role-dispatch-store.mjs','role-bridge-args.mjs','role-observe.mjs','role-supervisor.mjs','platform-registry.mjs','gemini-stream.mjs','grok-stream.mjs'
|
|
11
|
+
'role-dispatch-policy.mjs','role-dispatch-store.mjs','role-bridge-args.mjs','role-observe.mjs','role-supervisor.mjs','platform-registry.mjs','gemini-stream.mjs','grok-stream.mjs','grok-sandbox.mjs'
|
|
12
12
|
]);
|
|
13
13
|
export const cooperativeCoverage=()=>({enforcement:'cooperative',provenance:'operator-attested',nativeVerified:false});
|
|
14
14
|
export function commandResult({workflowId,state,input,decision='allow',ruleId='cooperative.recorded',persisted=false,...extra}){
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import crypto from 'node:crypto';
|
|
4
|
+
import {EVENTS_MAX_BYTES} from './role-dispatch-policy.mjs';
|
|
5
|
+
|
|
6
|
+
export const GROK_SANDBOX_RELATIVE = '.grok/sandbox.toml';
|
|
7
|
+
export const GROK_SANDBOX_DENY = Object.freeze([
|
|
8
|
+
'.grok/sandbox.toml', '~/.grok/skills', '~/.grok/agents', '~/.grok/rules',
|
|
9
|
+
'~/.grok/workflows', '~/.grok/plugins', '~/.grok/installed-plugins', '~/.grok/plugin-data',
|
|
10
|
+
'~/.grok/personas', '~/.grok/memory', '~/.grok/memory-v2', '~/.grok/AGENTS.md',
|
|
11
|
+
'~/.grok/statusline.sh', '~/.grok/lsp.json', '~/.grok/bin', '~/.grok/downloads',
|
|
12
|
+
'~/.grok/bundled', '~/.grok/bundles', '~/.grok/settings.json', '~/.grok/pager.toml',
|
|
13
|
+
'~/.grok/mcp_credentials.json', '~/.grok/worktrees', '~/.grok/workspaces', '~/.grok/daemon',
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
const digest = bytes => 'sha256:' + crypto.createHash('sha256').update(bytes).digest('hex');
|
|
17
|
+
const scopeError = (message, cause) => Object.assign(Error(message, {cause}), {reasonCode: 'permission_scope_unverified'});
|
|
18
|
+
const sameEntry = (first, second) => first.dev === second.dev && first.ino === second.ino;
|
|
19
|
+
const identityOf = ({dev, ino}) => ({dev, ino});
|
|
20
|
+
const sandboxEventsPath = grokHome => path.join(grokHome, 'sessions', 'sandbox-events.jsonl');
|
|
21
|
+
|
|
22
|
+
export function grokSandboxProfileName(dispatchId) {
|
|
23
|
+
const prefix = typeof dispatchId === 'string' ? dispatchId.slice(0, 8) : '';
|
|
24
|
+
return /^[0-9a-f]{8}$/.test(prefix) ? 'arc-bridge-' + prefix : null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function renderGrokSandboxProfile(name) {
|
|
28
|
+
if (typeof name !== 'string' || !/^arc-bridge-[0-9a-f]{8}$/.test(name)) throw Error('Invalid Grok profile name');
|
|
29
|
+
const deny = GROK_SANDBOX_DENY.map(entry => JSON.stringify(entry)).join(', ');
|
|
30
|
+
return Buffer.from(`[profiles.${name}]\nextends = "workspace"\ndeny = [${deny}]\n`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function grokProfileCovered(allowedPaths) {
|
|
34
|
+
return allowedPaths.some(entry => (entry.endsWith('/') ? GROK_SANDBOX_RELATIVE.startsWith(entry) : entry === GROK_SANDBOX_RELATIVE)
|
|
35
|
+
|| entry === '.grok' || entry.startsWith('.grok/'));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function inspectGrokProfileSlot(worktree) {
|
|
39
|
+
const file = path.join(worktree, GROK_SANDBOX_RELATIVE), directory = path.dirname(file);
|
|
40
|
+
try {
|
|
41
|
+
const parent = fs.lstatSync(directory, {throwIfNoEntry: false});
|
|
42
|
+
if (parent && !parent.isDirectory()) throw Error('.grok is not a real directory');
|
|
43
|
+
if (fs.lstatSync(file, {throwIfNoEntry: false})) throw Error('Sandbox profile slot is occupied');
|
|
44
|
+
} catch (cause) {
|
|
45
|
+
throw scopeError('Grok sandbox profile slot unavailable', cause);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function checkGrokHome({grokHome, userHome, childEnv}) {
|
|
50
|
+
if (typeof grokHome !== 'string' || childEnv?.GROK_HOME !== grokHome) return false;
|
|
51
|
+
try {
|
|
52
|
+
if (Object.hasOwn(childEnv, 'HOME') && fs.realpathSync(childEnv.HOME) !== fs.realpathSync(userHome)) return false;
|
|
53
|
+
return !fs.lstatSync(grokHome, {throwIfNoEntry: false})?.isSymbolicLink();
|
|
54
|
+
} catch {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function createGrokSandboxProfile({worktree, bytes}) {
|
|
60
|
+
const file = path.join(worktree, GROK_SANDBOX_RELATIVE), directory = path.dirname(file);
|
|
61
|
+
const profile = {path: file, sha256: digest(bytes), dirCreated: false};
|
|
62
|
+
let fd;
|
|
63
|
+
try {
|
|
64
|
+
try {
|
|
65
|
+
fs.mkdirSync(directory, 0o700);
|
|
66
|
+
profile.dirCreated = true;
|
|
67
|
+
} catch (error) {
|
|
68
|
+
if (error.code !== 'EEXIST') throw error;
|
|
69
|
+
}
|
|
70
|
+
const parent = fs.lstatSync(directory);
|
|
71
|
+
if (!parent.isDirectory()) throw Error('.grok is not a real directory');
|
|
72
|
+
profile.directoryIdentity = identityOf(parent);
|
|
73
|
+
// During creation, the parent .grok can become a symlink between its identity lstat and open.
|
|
74
|
+
fd = fs.openSync(file, fs.constants.O_WRONLY | fs.constants.O_CREAT | fs.constants.O_EXCL | fs.constants.O_NOFOLLOW, 0o444);
|
|
75
|
+
try {
|
|
76
|
+
const opened = fs.fstatSync(fd);
|
|
77
|
+
if (!opened.isFile()) throw Error('Grok sandbox profile is not a regular file');
|
|
78
|
+
profile.fileIdentity = identityOf(opened);
|
|
79
|
+
checkProfileEntries(profile);
|
|
80
|
+
fs.writeFileSync(fd, bytes);
|
|
81
|
+
fs.fchmodSync(fd, 0o444);
|
|
82
|
+
} finally {
|
|
83
|
+
fs.closeSync(fd);
|
|
84
|
+
}
|
|
85
|
+
checkProfileEntries(profile);
|
|
86
|
+
return profile;
|
|
87
|
+
} catch (cause) {
|
|
88
|
+
const error = scopeError('Grok sandbox profile creation failed', cause);
|
|
89
|
+
if (fd !== undefined) {
|
|
90
|
+
const {removed, dirRemoved, violation} = profile.fileIdentity
|
|
91
|
+
? removeGrokSandboxProfile(profile)
|
|
92
|
+
: {removed: false, dirRemoved: false, violation: true};
|
|
93
|
+
error.cleanup = {path: file, retained: !removed, violation, dirRemoved};
|
|
94
|
+
} else if (profile.dirCreated && profile.directoryIdentity) {
|
|
95
|
+
try {
|
|
96
|
+
checkProfileDirectory(profile);
|
|
97
|
+
fs.rmdirSync(directory);
|
|
98
|
+
} catch { /* retain a concurrently occupied or replaced directory */ }
|
|
99
|
+
}
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function checkProfileDirectory({path: file, directoryIdentity}) {
|
|
105
|
+
const parent = fs.lstatSync(path.dirname(file));
|
|
106
|
+
if (!parent.isDirectory() || !sameEntry(parent, directoryIdentity)) throw Error('Grok sandbox directory changed');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function checkProfileEntries(profile) {
|
|
110
|
+
checkProfileDirectory(profile);
|
|
111
|
+
const stat = fs.lstatSync(profile.path);
|
|
112
|
+
if (!stat.isFile() || !sameEntry(stat, profile.fileIdentity)) throw Error('Grok sandbox profile was replaced');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function verifyGrokSandboxProfile(profile) {
|
|
116
|
+
const {path: file, sha256, fileIdentity} = profile;
|
|
117
|
+
try {
|
|
118
|
+
checkProfileEntries(profile);
|
|
119
|
+
const fd = fs.openSync(file, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW | fs.constants.O_NONBLOCK);
|
|
120
|
+
try {
|
|
121
|
+
const opened = fs.fstatSync(fd);
|
|
122
|
+
if (!opened.isFile() || !sameEntry(opened, fileIdentity) || digest(fs.readFileSync(fd)) !== sha256) return false;
|
|
123
|
+
} finally {
|
|
124
|
+
fs.closeSync(fd);
|
|
125
|
+
}
|
|
126
|
+
checkProfileEntries(profile);
|
|
127
|
+
return true;
|
|
128
|
+
} catch {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function removeGrokSandboxProfile(profile) {
|
|
134
|
+
const {path: file, dirCreated} = profile;
|
|
135
|
+
const result = {removed: false, dirRemoved: false, violation: false};
|
|
136
|
+
if (!verifyGrokSandboxProfile(profile)) return {...result, violation: true};
|
|
137
|
+
try {
|
|
138
|
+
// Node has no unlinkat, so a race remains between the final identity check and unlink.
|
|
139
|
+
fs.unlinkSync(file);
|
|
140
|
+
result.removed = true;
|
|
141
|
+
if (dirCreated) {
|
|
142
|
+
try {
|
|
143
|
+
checkProfileDirectory(profile);
|
|
144
|
+
fs.rmdirSync(path.dirname(file));
|
|
145
|
+
result.dirRemoved = true;
|
|
146
|
+
} catch (error) {
|
|
147
|
+
if (error.code !== 'ENOTEMPTY') throw error;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
} catch {
|
|
151
|
+
result.violation = true;
|
|
152
|
+
}
|
|
153
|
+
return result;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function grokEventsBaseline(grokHome) {
|
|
157
|
+
const stat = fs.lstatSync(sandboxEventsPath(grokHome), {throwIfNoEntry: false});
|
|
158
|
+
if (!stat) return {exists: false, size: 0};
|
|
159
|
+
if (!stat.isFile()) throw Error('Grok sandbox events are not a regular file');
|
|
160
|
+
return {exists: true, dev: stat.dev, ino: stat.ino, size: stat.size};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const unapplied = (reason, candidates = 0) => ({ok: false, reason, candidates, applied: null});
|
|
164
|
+
|
|
165
|
+
function eventsFileIssue(baseline, current, maxBytes) {
|
|
166
|
+
if (!current.exists) return baseline.exists ? 'rotated' : 'no_candidate';
|
|
167
|
+
if (!current.regular) return 'not_regular';
|
|
168
|
+
if (baseline.exists && !sameEntry(baseline, current)) return 'rotated';
|
|
169
|
+
if (current.size < baseline.size) return 'truncated';
|
|
170
|
+
if (current.size - baseline.size > maxBytes) return 'too_large';
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function evaluateGrokProfileApplied({text, baseline, current, spawnAtMs, name, worktreeRealpath, maxBytes = EVENTS_MAX_BYTES}) {
|
|
175
|
+
const issue = eventsFileIssue(baseline, current, maxBytes);
|
|
176
|
+
if (issue) return unapplied(issue);
|
|
177
|
+
|
|
178
|
+
const lines = text.split('\n');
|
|
179
|
+
lines.pop(); // The last entry is empty or an unfinished append.
|
|
180
|
+
let candidate = null, candidates = 0, invalidTimestamp = false;
|
|
181
|
+
for (const line of lines) {
|
|
182
|
+
let event;
|
|
183
|
+
try { event = JSON.parse(line); } catch { continue; }
|
|
184
|
+
if (event?.event_type !== 'ProfileApplied' || event.profile !== name || event.workspace !== worktreeRealpath) continue;
|
|
185
|
+
const timestamp = typeof event.timestamp === 'string' ? Date.parse(event.timestamp) : NaN;
|
|
186
|
+
if (Number.isNaN(timestamp)) {
|
|
187
|
+
invalidTimestamp = true;
|
|
188
|
+
candidates++;
|
|
189
|
+
} else if (timestamp >= spawnAtMs) {
|
|
190
|
+
candidate = event;
|
|
191
|
+
candidates++;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (invalidTimestamp) return unapplied('timestamp_invalid', candidates);
|
|
195
|
+
if (!candidates) return unapplied('no_candidate');
|
|
196
|
+
if (candidates > 1) return unapplied('multiple_candidates', candidates);
|
|
197
|
+
if (candidate.enforced !== true) return unapplied('not_enforced', candidates);
|
|
198
|
+
if (candidate.inherited === true) return unapplied('inherited', candidates);
|
|
199
|
+
const expectedDeny = path.join(worktreeRealpath, GROK_SANDBOX_RELATIVE);
|
|
200
|
+
if (!Array.isArray(candidate.deny_paths) || !candidate.deny_paths.includes(expectedDeny)) return unapplied('deny_missing', candidates);
|
|
201
|
+
const applied = {timestamp: candidate.timestamp, enforced: true, inherited: false, denyOk: true};
|
|
202
|
+
return {ok: true, reason: null, candidates, applied};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export function readGrokProfileApplied({grokHome, baseline, spawnAtMs, name, worktreeRealpath}) {
|
|
206
|
+
const file = sandboxEventsPath(grokHome);
|
|
207
|
+
try {
|
|
208
|
+
const stat = fs.lstatSync(file, {throwIfNoEntry: false});
|
|
209
|
+
const current = stat ? {exists: true, regular: stat.isFile(), dev: stat.dev, ino: stat.ino, size: stat.size} : {exists: false};
|
|
210
|
+
const issue = eventsFileIssue(baseline, current, EVENTS_MAX_BYTES);
|
|
211
|
+
if (issue) return unapplied(issue);
|
|
212
|
+
|
|
213
|
+
const fd = fs.openSync(file, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW | fs.constants.O_NONBLOCK);
|
|
214
|
+
try {
|
|
215
|
+
const opened = fs.fstatSync(fd);
|
|
216
|
+
if (!sameEntry(opened, stat)) return unapplied('rotated');
|
|
217
|
+
if (!opened.isFile()) return unapplied('not_regular');
|
|
218
|
+
if (opened.size < stat.size) return unapplied('truncated');
|
|
219
|
+
|
|
220
|
+
const bytes = Buffer.alloc(stat.size - baseline.size);
|
|
221
|
+
let offset = 0;
|
|
222
|
+
while (offset < bytes.length) {
|
|
223
|
+
const read = fs.readSync(fd, bytes, offset, bytes.length - offset, baseline.size + offset);
|
|
224
|
+
if (read === 0) return unapplied('truncated');
|
|
225
|
+
offset += read;
|
|
226
|
+
}
|
|
227
|
+
return evaluateGrokProfileApplied({text: bytes.toString('utf8'), baseline, current, spawnAtMs, name, worktreeRealpath});
|
|
228
|
+
} finally {
|
|
229
|
+
fs.closeSync(fd);
|
|
230
|
+
}
|
|
231
|
+
} catch (error) {
|
|
232
|
+
return unapplied(error.code === 'ENOENT' || error.code === 'ELOOP' ? 'rotated' : 'not_regular');
|
|
233
|
+
}
|
|
234
|
+
}
|
|
@@ -137,8 +137,8 @@ export const DEFAULT_PLATFORM_REGISTRY = createPlatformRegistry([
|
|
|
137
137
|
},
|
|
138
138
|
executionEnvironments: ['grok-cli'],
|
|
139
139
|
routing: {validatePair: (model, effort) => validText(model) && /^[A-Za-z0-9][A-Za-z0-9._:/@+\-]*$/.test(model) && effort === 'default'},
|
|
140
|
-
capabilities: {install: {state: 'verified'}, nativeProfile: {state: 'verified'}, catalog: {state: 'verified'}, standalone: {state: 'verified'}, bridge: {state: 'verified'}, compositeRole: {state: 'verified'}, ...Object.fromEntries(Object.entries({
|
|
141
|
-
|
|
140
|
+
capabilities: {install: {state: 'verified'}, nativeProfile: {state: 'verified'}, catalog: {state: 'verified'}, standalone: {state: 'verified'}, bridge: {state: 'verified'}, compositeRole: {state: 'verified'}, compositeHost: {state: 'verified'}, ...Object.fromEntries(Object.entries({
|
|
141
|
+
authProbe: 'no official auth status command',
|
|
142
142
|
watch: 'watch support out of scope',
|
|
143
143
|
}).map(([key, reason]) => [key, {state: 'off', reason}]))},
|
|
144
144
|
},
|
|
@@ -20,8 +20,8 @@ export const ROLE_BRIDGE_PERMISSIONS = deepFreeze({
|
|
|
20
20
|
arc_scouter: {permissionMode: 'plan', sandbox: 'read-only', deny: GROK_CONTRACT.readOnlyDeny},
|
|
21
21
|
arc_planner: {permissionMode: 'plan', sandbox: 'read-only', deny: GROK_CONTRACT.readOnlyDeny},
|
|
22
22
|
arc_reviewer: {permissionMode: 'plan', sandbox: 'read-only', deny: GROK_CONTRACT.readOnlyDeny},
|
|
23
|
-
arc_implementer: {permissionMode: 'acceptEdits', sandbox: '
|
|
24
|
-
arc_qa: {permissionMode: 'acceptEdits', sandbox: '
|
|
23
|
+
arc_implementer: {permissionMode: 'acceptEdits', sandbox: 'custom', deny: []},
|
|
24
|
+
arc_qa: {permissionMode: 'acceptEdits', sandbox: 'custom', deny: []},
|
|
25
25
|
},
|
|
26
26
|
codex: {
|
|
27
27
|
arc_scouter: {sandboxMode: 'read-only', search: true}, arc_planner: {sandboxMode: 'read-only', search: false},
|
|
@@ -231,13 +231,15 @@ export function buildGeminiArgs({role, model, profile, sessionId, policyFile, pr
|
|
|
231
231
|
return args;
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
export function buildGrokArgs({role, profile, sessionId, promptFile}) {
|
|
234
|
+
export function buildGrokArgs({role, profile, sessionId, promptFile, sandboxProfile}) {
|
|
235
235
|
const permissions = permissionsFor('grok', role);
|
|
236
236
|
if (typeof promptFile !== 'string' || !path.isAbsolute(promptFile)) throw Error('Absolute promptFile required');
|
|
237
237
|
if (typeof sessionId !== 'string' || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(sessionId)) throw Error('Grok sessionId must be a UUID');
|
|
238
238
|
const model = requireText(profile?.model, 'model');
|
|
239
239
|
if (!/^[A-Za-z0-9][A-Za-z0-9._:/@+\-]*$/.test(model)) throw Error('Invalid Grok model');
|
|
240
|
+
const sandbox = permissions.sandbox === 'custom' ? sandboxProfile : permissions.sandbox;
|
|
241
|
+
if (permissions.sandbox === 'custom' && (typeof sandbox !== 'string' || !/^arc-bridge-[0-9a-f]{8}$/.test(sandbox))) throw Error('Invalid Grok sandbox profile');
|
|
240
242
|
return ['--prompt-file', promptFile, '--output-format', GROK_CONTRACT.outputFormat, '-m', model, '--session-id', sessionId,
|
|
241
|
-
'--permission-mode', permissions.permissionMode, '--sandbox',
|
|
243
|
+
'--permission-mode', permissions.permissionMode, '--sandbox', sandbox,
|
|
242
244
|
...permissions.deny.flatMap(rule => ['--deny', rule]), ...GROK_CONTRACT.isolationArgs];
|
|
243
245
|
}
|