github-router 0.3.356 → 0.3.367
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/dist/ado-tools-rysFZDws.js +1 -0
- package/dist/{aic-ledger-BuFrsGur.js → aic-ledger-_mvGW2Ev.js} +42 -7
- package/dist/aic-ledger-_mvGW2Ev.js.map +1 -0
- package/dist/{aic-statusline-settings-DBS9sEGC.js → aic-statusline-settings-B5EMMSFC.js} +2 -2
- package/dist/{aic-statusline-settings-DBS9sEGC.js.map → aic-statusline-settings-B5EMMSFC.js.map} +1 -1
- package/dist/{attribution-settings-CnmV9MSv.js → attribution-settings-wVzQvIdL.js} +188 -64
- package/dist/attribution-settings-wVzQvIdL.js.map +1 -0
- package/dist/{auth-DFawaLJU.js → auth-B3UvYB2r.js} +3 -3
- package/dist/{auth-DFawaLJU.js.map → auth-B3UvYB2r.js.map} +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{check-usage-BkVEl-Su.js → check-usage-45vyaLfl.js} +4 -4
- package/dist/{check-usage-BkVEl-Su.js.map → check-usage-45vyaLfl.js.map} +1 -1
- package/dist/{claude-DvR3Y7fu.js → claude-B3pIageM.js} +89 -41
- package/dist/claude-B3pIageM.js.map +1 -0
- package/dist/{claude-md-injection-Cpzolxin.js → claude-md-injection-BV4tPUWo.js} +126 -35
- package/dist/claude-md-injection-BV4tPUWo.js.map +1 -0
- package/dist/{codex-DQpSPjpQ.js → codex-B_AMB6JM.js} +7 -7
- package/dist/{codex-DQpSPjpQ.js.map → codex-B_AMB6JM.js.map} +1 -1
- package/dist/{copilot-discount-Bsmv_3OX.js → copilot-discount-BuDbQOHq.js} +2 -2
- package/dist/{copilot-discount-Bsmv_3OX.js.map → copilot-discount-BuDbQOHq.js.map} +1 -1
- package/dist/{debug-DkNTuErv.js → debug-DL2JsRqY.js} +2 -2
- package/dist/{debug-DkNTuErv.js.map → debug-DL2JsRqY.js.map} +1 -1
- package/dist/engine-D3oNrF6Z.js +1 -0
- package/dist/{gate-discovery-B2x_8hNL.js → gate-discovery-CXE-7VcM.js} +5 -5
- package/dist/{gate-discovery-B2x_8hNL.js.map → gate-discovery-CXE-7VcM.js.map} +1 -1
- package/dist/{get-copilot-usage-P9chc-X2.js → get-copilot-usage-BbGmK03C.js} +2 -2
- package/dist/{get-copilot-usage-P9chc-X2.js.map → get-copilot-usage-BbGmK03C.js.map} +1 -1
- package/dist/hooks.mjs +200 -117
- package/dist/hooks.sha256 +1 -1
- package/dist/{index-cmd-BkfYr9FH.js → index-cmd-CjRcmYk3.js} +4 -4
- package/dist/{index-cmd-BkfYr9FH.js.map → index-cmd-CjRcmYk3.js.map} +1 -1
- package/dist/{internal-aic-status-C6L4-ncP.js → internal-aic-status-BAVomi5A.js} +4 -4
- package/dist/{internal-aic-status-C6L4-ncP.js.map → internal-aic-status-BAVomi5A.js.map} +1 -1
- package/dist/{internal-artifact-open-DgJ3PCtt.js → internal-artifact-open-NAGn9Mgt.js} +2 -2
- package/dist/{internal-artifact-open-DgJ3PCtt.js.map → internal-artifact-open-NAGn9Mgt.js.map} +1 -1
- package/dist/{internal-fast-dispatch-guard-CicGz6oM.js → internal-fast-dispatch-guard-DP25L_Bx.js} +1 -1
- package/dist/{internal-fast-dispatch-guard-CgBtUsQI.js → internal-fast-dispatch-guard-DbrgO9Ab.js} +2 -2
- package/dist/{internal-fast-dispatch-guard-CgBtUsQI.js.map → internal-fast-dispatch-guard-DbrgO9Ab.js.map} +1 -1
- package/dist/{internal-first-mate-guard-DTXPT7JW.js → internal-first-mate-guard-C8GwLbaX.js} +1 -1
- package/dist/{internal-first-mate-guard-BfWYN6Jb.js → internal-first-mate-guard-GufCUMl3.js} +3 -3
- package/dist/{internal-first-mate-guard-BfWYN6Jb.js.map → internal-first-mate-guard-GufCUMl3.js.map} +1 -1
- package/dist/{internal-max-dispatch-guard-mNl9CCir.js → internal-max-dispatch-guard-BB0vwiPx.js} +1 -1
- package/dist/{internal-max-dispatch-guard-CY8l9SDw.js → internal-max-dispatch-guard-BodVFHRC.js} +2 -2
- package/dist/{internal-max-dispatch-guard-CY8l9SDw.js.map → internal-max-dispatch-guard-BodVFHRC.js.map} +1 -1
- package/dist/{internal-plan-review-2OHTs8Nk.js → internal-plan-review-ChFx8wTX.js} +3 -3
- package/dist/{internal-plan-review-2OHTs8Nk.js.map → internal-plan-review-ChFx8wTX.js.map} +1 -1
- package/dist/{internal-prompt-submit-CkfUcu34.js → internal-prompt-submit-BaccW_CC.js} +4 -4
- package/dist/{internal-prompt-submit-CkfUcu34.js.map → internal-prompt-submit-BaccW_CC.js.map} +1 -1
- package/dist/{internal-prompt-submit-DZ_-2A6a.js → internal-prompt-submit-DPUBQZtG.js} +2 -2
- package/dist/{internal-rebrief-EhBHAHsz.js → internal-rebrief-NjSlx5QY.js} +4 -4
- package/dist/{internal-rebrief-EhBHAHsz.js.map → internal-rebrief-NjSlx5QY.js.map} +1 -1
- package/dist/{internal-session-bind-Bv50ju2n.js → internal-session-bind-dsUOcKxU.js} +2 -2
- package/dist/{internal-session-bind-Bv50ju2n.js.map → internal-session-bind-dsUOcKxU.js.map} +1 -1
- package/dist/{internal-stop-hook-Dm-m8RoA.js → internal-stop-hook-B2TTl6Zp.js} +5 -5
- package/dist/{internal-stop-hook-Dm-m8RoA.js.map → internal-stop-hook-B2TTl6Zp.js.map} +1 -1
- package/dist/{internal-stop-review-K6f8xsCh.js → internal-stop-review-D_KEV_04.js} +2 -2
- package/dist/{internal-stop-review-K6f8xsCh.js.map → internal-stop-review-D_KEV_04.js.map} +1 -1
- package/dist/{internal-worker-guard-GVhTjVlR.js → internal-worker-guard-DB6shBIn.js} +2 -2
- package/dist/{internal-worker-guard-GVhTjVlR.js.map → internal-worker-guard-DB6shBIn.js.map} +1 -1
- package/dist/{internal-workspace-header-d2hFf9Jy.js → internal-workspace-header-DBg5Y7oN.js} +2 -2
- package/dist/{internal-workspace-header-d2hFf9Jy.js.map → internal-workspace-header-DBg5Y7oN.js.map} +1 -1
- package/dist/{lifecycle-C6cxM_Nk.js → lifecycle-9nX09dBl.js} +2 -2
- package/dist/{lifecycle-C6cxM_Nk.js.map → lifecycle-9nX09dBl.js.map} +1 -1
- package/dist/lifecycle-C_CT13c9.js +1 -0
- package/dist/lifecycle-DibiH857.js +1 -0
- package/dist/{lifecycle-pl9QpvqD.js → lifecycle-Gge2Dadd.js} +2 -2
- package/dist/{lifecycle-pl9QpvqD.js.map → lifecycle-Gge2Dadd.js.map} +1 -1
- package/dist/main.js +23 -23
- package/dist/{mcp-workspace-header-Su8uUxJg.js → mcp-workspace-header-Xw9B1W6T.js} +2 -2
- package/dist/{mcp-workspace-header-Su8uUxJg.js.map → mcp-workspace-header-Xw9B1W6T.js.map} +1 -1
- package/dist/{models-D8v8OTbN.js → models-BR6i348u.js} +3 -3
- package/dist/{models-D8v8OTbN.js.map → models-BR6i348u.js.map} +1 -1
- package/dist/{orchestration-Bov4rZEi.js → orchestration-D3-2ulhX.js} +2 -2
- package/dist/{orchestration-Bov4rZEi.js.map → orchestration-D3-2ulhX.js.map} +1 -1
- package/dist/{paths-BSI_EtDT.js → paths-C5477RGC.js} +48 -4
- package/dist/paths-C5477RGC.js.map +1 -0
- package/dist/paths-CEswtFj5.js +1 -0
- package/dist/{peer-mcp-personas-CVxXq1Q-.js → peer-mcp-personas-BOgR46nM.js} +641 -270
- package/dist/peer-mcp-personas-BOgR46nM.js.map +1 -0
- package/dist/{pi-D-BgxVhx.js → pi-DcWp83mx.js} +377 -602
- package/dist/pi-DcWp83mx.js.map +1 -0
- package/dist/{plan-review-hook-CHK1wL3-.js → plan-review-hook-C9K-em4D.js} +3 -3
- package/dist/{plan-review-hook-CHK1wL3-.js.map → plan-review-hook-C9K-em4D.js.map} +1 -1
- package/dist/{provision-DYmZgZDr.js → provision-DkWR9B6I.js} +5 -5
- package/dist/{provision-DYmZgZDr.js.map → provision-DkWR9B6I.js.map} +1 -1
- package/dist/{self-invocation-Dk_UHD_v.js → self-invocation-BtcGj-lY.js} +2 -2
- package/dist/{self-invocation-Dk_UHD_v.js.map → self-invocation-BtcGj-lY.js.map} +1 -1
- package/dist/{serve-DfxxKLFl.js → serve-BGwEVDdc.js} +14 -14
- package/dist/{serve-DfxxKLFl.js.map → serve-BGwEVDdc.js.map} +1 -1
- package/dist/{server-setup-VYf8ptCH.js → server-setup-DVPL9iph.js} +911 -100
- package/dist/server-setup-DVPL9iph.js.map +1 -0
- package/dist/{service-backend-DHyd9vjW.js → service-backend-B6D_DY1Z.js} +3 -3
- package/dist/{service-backend-DHyd9vjW.js.map → service-backend-B6D_DY1Z.js.map} +1 -1
- package/dist/{start-BsY1d26G.js → start-BUWx3nSr.js} +4 -4
- package/dist/{start-BsY1d26G.js.map → start-BUWx3nSr.js.map} +1 -1
- package/dist/{static-context-pack-dKrzbfIN.js → static-context-pack-ChHuxBpk.js} +232 -61
- package/dist/static-context-pack-ChHuxBpk.js.map +1 -0
- package/dist/{stop-gate-hook-CC7VWkZM.js → stop-gate-hook-DnLC09Lg.js} +3 -3
- package/dist/{stop-gate-hook-CC7VWkZM.js.map → stop-gate-hook-DnLC09Lg.js.map} +1 -1
- package/dist/{stop-gate-policy-CoR8xKNQ.js → stop-gate-policy-Dx9c98_d.js} +2 -2
- package/dist/{stop-gate-policy-CoR8xKNQ.js.map → stop-gate-policy-Dx9c98_d.js.map} +1 -1
- package/dist/{token-CA2s70qj.js → token-OTb61rOC.js} +2 -2
- package/dist/{token-CA2s70qj.js.map → token-OTb61rOC.js.map} +1 -1
- package/dist/{worker-dispatch-B_rriT7z.js → worker-dispatch-B1w2qfjX.js} +2 -2
- package/dist/{worker-dispatch-B_rriT7z.js.map → worker-dispatch-B1w2qfjX.js.map} +1 -1
- package/docs/azure-mcp.md +29 -31
- package/package.json +1 -1
- package/dist/ado-tools-DokE2DbX.js +0 -1
- package/dist/aic-ledger-BuFrsGur.js.map +0 -1
- package/dist/attribution-settings-CnmV9MSv.js.map +0 -1
- package/dist/claude-DvR3Y7fu.js.map +0 -1
- package/dist/claude-md-injection-Cpzolxin.js.map +0 -1
- package/dist/engine-DgmsdkCe.js +0 -1
- package/dist/lifecycle-BU_d2QMs.js +0 -1
- package/dist/lifecycle-ByFyew_w.js +0 -1
- package/dist/paths-BSI_EtDT.js.map +0 -1
- package/dist/paths-BYxX9DfA.js +0 -1
- package/dist/peer-mcp-personas-CVxXq1Q-.js.map +0 -1
- package/dist/pi-D-BgxVhx.js.map +0 -1
- package/dist/server-setup-VYf8ptCH.js.map +0 -1
- package/dist/static-context-pack-dKrzbfIN.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as isUnderClaudeConfigMirror, t as PATHS } from "./paths-
|
|
2
|
-
import { _ as
|
|
1
|
+
import { a as isUnderClaudeConfigMirror, t as PATHS } from "./paths-C5477RGC.js";
|
|
2
|
+
import { _ as isCheapestFamily, b as local2AdvisorContract, f as balancedContractFor, g as isBalancedFamily, h as displayModelName, p as cheapestContractFor, v as isLocalFamily, x as localContractFor, y as isPinnedLaunchProfile } from "./static-context-pack-ChHuxBpk.js";
|
|
3
3
|
import { C as MAX_PARALLELISM_RULE } from "./max-profile-contract-Cx5_Z1Y7.js";
|
|
4
4
|
import consola from "consola";
|
|
5
5
|
import path from "node:path";
|
|
@@ -110,20 +110,38 @@ const STYLE_DIRECTIVE = "Write concisely without losing detail. Use a natural hu
|
|
|
110
110
|
* 200K default window (bare slugs, no 1M accounting) with advisory budgets:
|
|
111
111
|
* gather ~3 min per round (3 rounds max, 6 Explore per round); plan ~5 min
|
|
112
112
|
* via the profile-pinned Plan subagent where the profile provides one
|
|
113
|
-
* (the lead plans directly on cheapest/balanced; trivial asks exit
|
|
113
|
+
* (the lead plans directly on cheapest/balanced/local; trivial asks exit
|
|
114
114
|
* planless);
|
|
115
115
|
* implement ~10 min per task (8 concurrent max, worktree:true only when
|
|
116
116
|
* parallel tasks need isolation); reviewer only on low-confidence or complex
|
|
117
117
|
* and risky changes, plus a General-Purpose fix pass for major reviewer
|
|
118
118
|
* findings.
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
/** One builder for every profile's pipeline-skills block: only the Plan stage
|
|
121
|
+
* wording and the dispatcher contrast vary, so the shared stages cannot drift
|
|
122
|
+
* between the exported constants. */
|
|
123
|
+
function pipelineSkillsAwareness(opts) {
|
|
124
|
+
return `Pipeline skills (all 200K default context${opts.workersAvailable ? ", native subagents only, never worker-*" : ", native subagents only"}). Prefer \`/gh-swe-pipeline\`: strict sequence, each stage completing before the next starts, user approval before implementation. Stages in order: (1) \`/gh-gather-context\` BEFORE planning when grounded context is needed: lexical search plus bounded Explore subagents (~3 min each, 3 rounds max), writes context.md plus context.compact.md; (2) \`/gh-plan\` AFTER context and BEFORE implementation: ${opts.planAgent ? "native Plan subagent plans non-trivial asks (trivial exits planless)" : "the lead plans directly (no separate planning subagent on this profile; trivial exits planless)"}, ordered plan.md (~5 min), open questions, waits for user approval; (3) \`/gh-implement\` AFTER plan approval: bounded parallel General-Purpose subagents ${opts.planAgent ? "(implementer first on max; worktree:true if parallel tasks need isolation)" : "(worktree:true if parallel tasks need isolation)"}, reviewer only on low-confidence or risky changes, plus fix pass for major findings. Skip for trivial work. Never implement without an approved plan. Never overlap stages.`;
|
|
125
|
+
}
|
|
126
|
+
const PIPELINE_SKILLS_AWARENESS = pipelineSkillsAwareness({
|
|
127
|
+
planAgent: true,
|
|
128
|
+
workersAvailable: true
|
|
129
|
+
});
|
|
121
130
|
/**
|
|
122
131
|
* Pipeline-skills awareness for the profiles without a `Plan` role
|
|
123
|
-
* (cheapest, balanced): the lead plans directly, so `/gh-plan` names the
|
|
124
|
-
*
|
|
132
|
+
* (cheapest, balanced): the lead plans directly, so `/gh-plan` names the lead
|
|
133
|
+
* instead of a Plan dispatch. Every other stage is identical.
|
|
125
134
|
*/
|
|
126
|
-
const PIPELINE_SKILLS_AWARENESS_NO_PLAN_AGENT =
|
|
135
|
+
const PIPELINE_SKILLS_AWARENESS_NO_PLAN_AGENT = pipelineSkillsAwareness({
|
|
136
|
+
planAgent: false,
|
|
137
|
+
workersAvailable: true
|
|
138
|
+
});
|
|
139
|
+
/** Local is the no-Plan form without the `worker-*` contrast, which names a
|
|
140
|
+
* dispatcher the profile does not inject. */
|
|
141
|
+
const PIPELINE_SKILLS_AWARENESS_LOCAL = pipelineSkillsAwareness({
|
|
142
|
+
planAgent: false,
|
|
143
|
+
workersAvailable: false
|
|
144
|
+
});
|
|
127
145
|
/** Oxford-comma join: "a", "a and b", "a, b, and c". */
|
|
128
146
|
function joinClauses(parts) {
|
|
129
147
|
if (parts.length <= 1) return parts[0] ?? "";
|
|
@@ -153,21 +171,26 @@ function buildNativeReachClauses(opts) {
|
|
|
153
171
|
"`Explore` (Luna/high, cheap breadth) for discovery, dependency mapping, and convention tracking spanning more than a couple of files",
|
|
154
172
|
"`General-Purpose` (Luna/max, the heavy execution tier) for mixed, iterative, or multi-step execution",
|
|
155
173
|
"`reviewer` (Luna/max, the heavy verification tier) for independent adversarial verification, reproduction, and root-causing"
|
|
156
|
-
]) + ". Delegate by value — cheap breadth to `Explore`, heavy execution to `General-Purpose`, verification to `reviewer
|
|
174
|
+
]) + ". Delegate by value — cheap breadth to `Explore`, heavy execution to `General-Purpose`, verification to `reviewer`";
|
|
175
|
+
if (isLocalFamily(opts.profile)) {
|
|
176
|
+
const models = localContractFor(opts.profile).nativeModels;
|
|
177
|
+
return joinClauses([
|
|
178
|
+
`\`Explore\` (${models.Explore} tier) for discovery, dependency mapping, and convention tracking spanning more than a couple of files`,
|
|
179
|
+
`\`General-Purpose\` (${models["General-Purpose"]} tier) for mixed, iterative, or multi-step execution`,
|
|
180
|
+
`\`reviewer\` (${models.reviewer} tier) for independent adversarial verification, reproduction, and root-causing`
|
|
181
|
+
]) + ". Delegate by value — wide breadth to `Explore`, execution to `General-Purpose`, verification to `reviewer`";
|
|
182
|
+
}
|
|
157
183
|
if (isBalancedFamily(opts.profile)) return joinClauses([
|
|
158
184
|
"`Explore` for broad repository discovery, dependency mapping, and convention tracking (launch in parallel)",
|
|
159
185
|
"`General-Purpose` for mixed, iterative, or multi-step execution tasks (delegate freely)",
|
|
160
186
|
"`reviewer` for independent adversarial verification, reproduction, and root-causing ONLY when genuinely behavior-changing (lead owns verification by default)"
|
|
161
|
-
])
|
|
162
|
-
|
|
187
|
+
]);
|
|
188
|
+
return joinClauses([
|
|
163
189
|
"`Explore` for broad repository discovery, dependency mapping, and convention tracking (launch in parallel)",
|
|
164
190
|
"`Plan` for architectural sequencing, interface contracts, migration risk, and runnable acceptance criteria (delegates discovery to `Explore`)",
|
|
165
191
|
"`General-Purpose` for mixed, iterative, or multi-step execution tasks (follows a Plan handoff when one exists)",
|
|
166
192
|
"`reviewer` for independent adversarial verification, reproduction, and root-causing after non-trivial changes"
|
|
167
193
|
]);
|
|
168
|
-
if (opts.profile === "cheap") return `${shared}. All roles run at a 200K context window — prefer targeted reads (search, Grep, Read specific files) over full file reads`;
|
|
169
|
-
if (opts.profile === "cheap1m") return `${shared}. Subagents run at a 200K context window — brief them with targeted evidence and prefer targeted reads over full file reads`;
|
|
170
|
-
return shared;
|
|
171
194
|
}
|
|
172
195
|
const clauses = [];
|
|
173
196
|
const implementerFast = opts.implementerFastAvailable !== false;
|
|
@@ -207,6 +230,57 @@ function buildNativeReachClauses(opts) {
|
|
|
207
230
|
*/
|
|
208
231
|
const CHEAPEST_CONSULT_CONTRACT = "Consulting `advisor` and `oracle` (a small budget — choose wisely): you have roughly 8-10 advisor calls for this session, and each costs real time and money, so spend them only where direction changes the outcome. Advisor and Oracle give you COUNSEL on HOW — and sometimes WHAT — to do: the shortest path, what to consider or look at, planning, strategy, and direction. They never replace evidence you can gather yourself: anything a search, read, build, test, or run can settle, settle it yourself — never spend a consult on it. Spend a consult on: (1) a pre-commit framing check, after you have oriented but before you lock an approach on a non-trivial task; (2) an unresolvable judgment call — conflicting evidence, or a stale-knowledge / high-consequence risk or severity call; (3) a pre-presentation framing check on the final plan. Do NOT spend one on routine progress, reassurance, completion ritual, or a moment that belongs to `reviewer` (verify/reproduce a change) or `oracle` (a self-contained technical/algorithmic/spec/architectural trade-off). Discriminator: session-trajectory / framing / momentum questions and how-to-approach go to `advisor`; self-contained technical/architectural trade-offs go to `oracle`; verification and reproduction go to `reviewer`; facts go to direct evidence. How to call: Sol reads a curated view of this session — the user's original ask, your most recent message text, and a bounded transcript that keeps your reasoning but truncates raw tool output — so before you call, write a short self-contained brief as your own message: the objective, your current job, what you verified / suspect is missing / ruled irrelevant, your confidence and what being wrong would cost, and one neutral question phrased with any competing hypotheses. Never paste raw tool output or ask it to \"review the whole thing\". State your confidence after you have committed to a position, not before, and weigh the reply against verified repository evidence — counsel is direction, not dictation, and you own the decision.\n\n";
|
|
209
232
|
/**
|
|
233
|
+
* Short, always-resident pointer to the consult contract, injected into the
|
|
234
|
+
* digest (`--append-system-prompt`) instead of the full block. Keeps the
|
|
235
|
+
* trigger + budget visible at top salience without duplicating the ~250-word
|
|
236
|
+
* contract every turn; the full how-to lives in the mirrored CLAUDE.md.
|
|
237
|
+
*/
|
|
238
|
+
const CHEAPEST_CONSULT_CONTRACT_POINTER = "Consulting `advisor`/`oracle` (small budget, ~8-10 calls — choose wisely): use them for how/what — shortest path, what to consider, planning, strategy, direction — never for anything a search, read, or run settles, nor for routine progress, reassurance, or completion ritual; do not spend one where `reviewer` (verification) or `oracle` (a self-contained technical trade-off) owns the moment. Full how-to (when to spend, the call brief, the discriminator) is in your CLAUDE.md project instructions.\n\n";
|
|
239
|
+
/**
|
|
240
|
+
* Transport sibling of `CHEAPEST_CONSULT_CONTRACT` for a front-end whose
|
|
241
|
+
* consultant receives no transcript at all.
|
|
242
|
+
*
|
|
243
|
+
* The body is the cheapest contract's, with the one transport sentence
|
|
244
|
+
* replaced: instead of "Sol reads a curated view of this session", the lead is
|
|
245
|
+
* told to make the brief self-contained because the Advisor reads only what
|
|
246
|
+
* the lead writes. Everything else — budget, anchors, disqualifiers,
|
|
247
|
+
* discriminator — is identical, so the consult policy cannot drift between
|
|
248
|
+
* the two front-ends.
|
|
249
|
+
*
|
|
250
|
+
* Used by the Pi launcher, whose `advisor` subagent is `defaultContext:
|
|
251
|
+
* fresh` with a read-only toolset: it never sees the lead's conversation, so
|
|
252
|
+
* the curated-view sentence would be false there. The Claude launcher keeps
|
|
253
|
+
* `CHEAPEST_CONSULT_CONTRACT`, which describes what its curated path really
|
|
254
|
+
* sends.
|
|
255
|
+
*/
|
|
256
|
+
const FRESH_CONSULT_CONTRACT = "Consulting `advisor` and `oracle` (a small budget — choose wisely): you have roughly 8-10 advisor calls for this session, and each costs real time and money, so spend them only where direction changes the outcome. Advisor and Oracle give you COUNSEL on HOW — and sometimes WHAT — to do: the shortest path, what to consider or look at, planning, strategy, and direction. They never replace evidence you can gather yourself: anything a search, read, build, test, or run can settle, settle it yourself — never spend a consult on it. Spend a consult on: (1) a pre-commit framing check, after you have oriented but before you lock an approach on a non-trivial task; (2) an unresolvable judgment call — conflicting evidence, or a stale-knowledge / high-consequence risk or severity call; (3) a pre-presentation framing check on the final plan. Do NOT spend one on routine progress, reassurance, completion ritual, or a moment that belongs to `reviewer` (verify/reproduce a change) or `oracle` (a self-contained technical/algorithmic/spec/architectural trade-off). Discriminator: session-trajectory / framing / momentum questions and how-to-approach go to `advisor`; self-contained technical/architectural trade-offs go to `oracle`; verification and reproduction go to `reviewer`; facts go to direct evidence. How to call: make the brief self-contained — the Advisor reads only what you write — so state the objective, your current job, what you verified / suspect is missing / ruled irrelevant, your confidence and what being wrong would cost, and one neutral question phrased with any competing hypotheses. Never paste raw tool output or ask it to \"review the whole thing\". State your confidence after you have committed to a position, not before, and weigh the reply against verified repository evidence — counsel is direction, not dictation, and you own the decision.\n\n";
|
|
257
|
+
/**
|
|
258
|
+
* Oracle-only sibling of `CHEAPEST_CONSULT_CONTRACT` for a launch that carries
|
|
259
|
+
* an Oracle but no Advisor: the `balanced` family, whose consultant ladder
|
|
260
|
+
* exposes `oracle` alone.
|
|
261
|
+
*
|
|
262
|
+
* Naming the Advisor there would point the lead at a tool the session cannot
|
|
263
|
+
* reach, so the budget, the anchors and the disqualifiers are restated against
|
|
264
|
+
* `oracle` alone. Everything that is not about the Advisor is the cheapest
|
|
265
|
+
* contract's wording, and a launch that carries both keeps the original.
|
|
266
|
+
*/
|
|
267
|
+
const ORACLE_ONLY_CONSULT_CONTRACT = "Consulting `oracle` (a small budget — choose wisely): you have roughly 8-10 oracle calls for this session, and each costs real time and money, so spend them only where direction changes the outcome. Oracle gives you COUNSEL on HOW — and sometimes WHAT — to do: the shortest path, what to consider or look at, planning, strategy, and direction. It never replaces evidence you can gather yourself: anything a search, read, build, test, or run can settle, settle it yourself — never spend a consult on it. Spend a consult on: (1) a pre-commit framing check, after you have oriented but before you lock an approach on a non-trivial task; (2) an unresolvable judgment call — conflicting evidence, or a stale-knowledge / high-consequence risk or severity call; (3) a pre-presentation framing check on the final plan. Do NOT spend one on routine progress, reassurance, completion ritual, or a moment that belongs to `reviewer` (verify/reproduce a change). Make the brief self-contained: Oracle reads only what you write, so state the objective, your current job, what you verified / suspect is missing / ruled irrelevant, your confidence and what being wrong would cost, and one neutral question phrased with any competing hypotheses. Never paste raw tool output or ask it to \"review the whole thing\". State your confidence after you have committed to a position, not before, and weigh the reply against verified repository evidence — counsel is direction, not dictation, and you own the decision.\n\n";
|
|
268
|
+
/** Short, always-resident pointer to `ORACLE_ONLY_CONSULT_CONTRACT`. */
|
|
269
|
+
const ORACLE_ONLY_CONSULT_CONTRACT_POINTER = "Consulting `oracle` (small budget, ~8-10 calls — choose wisely): use it for how/what — shortest path, what to consider, planning, strategy, direction — never for anything a search, read, or run settles, nor for routine progress, reassurance, or completion ritual; do not spend one where `reviewer` owns the moment. Full how-to (when to spend, the call brief) is in your CLAUDE.md project instructions.\n\n";
|
|
270
|
+
/**
|
|
271
|
+
* Contract for a launch that carries neither consultant.
|
|
272
|
+
*
|
|
273
|
+
* `-m local` exposes no `peers` group at all, so neither the Advisor nor the
|
|
274
|
+
* Oracle exists on its surface. Both siblings above are written around a budget
|
|
275
|
+
* of consults and a discriminator between the two roles, and naming either role
|
|
276
|
+
* here would point the lead at a tool the session cannot reach. What survives
|
|
277
|
+
* is the part that was never about them: settle what evidence can settle, and
|
|
278
|
+
* make the reasoning explicit where it cannot.
|
|
279
|
+
*/
|
|
280
|
+
const DIRECT_EVIDENCE_CONTRACT = "Consultation budget: this launch has no consultant, so every unresolved question is settled by direct evidence: a search, a read, a build, a test, or a run. Where you would otherwise want a second opinion, state the competing hypotheses explicitly, choose the one the evidence supports, and record your confidence and what being wrong would cost so the user can correct course early. Counsel is never a substitute for verification you can perform yourself.\n\n";
|
|
281
|
+
/** Short, always-resident pointer to `DIRECT_EVIDENCE_CONTRACT`. */
|
|
282
|
+
const DIRECT_EVIDENCE_CONTRACT_POINTER = "This launch has no consultant: settle unresolved questions with direct evidence (search, read, build, test, or run) and state competing hypotheses explicitly before choosing. Full how-to is in your CLAUDE.md project instructions.\n\n";
|
|
283
|
+
/**
|
|
210
284
|
* Build the operating-defaults directive for one launch, naming only the
|
|
211
285
|
* natives that launch actually emitted.
|
|
212
286
|
*
|
|
@@ -225,12 +299,18 @@ function buildOperatingDefaultsDirective(opts = {}) {
|
|
|
225
299
|
const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
|
|
226
300
|
const isCheapest = isCheapestFamily(opts.profile);
|
|
227
301
|
const isBalanced = isBalancedFamily(opts.profile);
|
|
228
|
-
const
|
|
229
|
-
const
|
|
302
|
+
const isLocal = isLocalFamily(opts.profile);
|
|
303
|
+
const hasAdvisor = !isBalanced && !(isLocal && opts.profile !== "local2");
|
|
304
|
+
const hasOracle = !(isLocal && opts.profile === "local");
|
|
305
|
+
const advisorReviewerGranted = hasAdvisor && (isCheapest || isLocal);
|
|
306
|
+
const profileLabel = isLocal ? "Local" : isCheapest ? "Cheapest" : isCheap ? "Cheap" : isBalanced ? "Balanced" : "Fast";
|
|
307
|
+
const familyContract = isCheapest ? cheapestContractFor(opts.profile) : isBalanced ? balancedContractFor(opts.profile) : isLocal ? localContractFor(opts.profile) : void 0;
|
|
230
308
|
const oracleDescriptor = familyContract ? `${displayModelName(familyContract.oracleModel)} (200K/${familyContract.oracleEffort})` : isCheap ? "Grok 4.6 (200K/medium)" : "exact Opus 5.5 (1M/high)";
|
|
231
309
|
const astraDescriptor = isCheap && !isCheapest ? "200K/medium" : "200K/high";
|
|
232
|
-
const
|
|
233
|
-
const
|
|
310
|
+
const subsetTail = isLocal && !hasOracle ? "`reviewer` sees only the synthesized subset, never raw search output." : `${isLocal ? "`reviewer` and Oracle" : `expensive models ${isCheapest || isBalanced || isLocal ? "(reviewer, Oracle)" : "(Plan, reviewer, Oracle)"}`} see only the synthesized subset, never raw search output.`;
|
|
311
|
+
const strategyOpener = isLocal ? "Search strategy (most direct first): " : "Search strategy (cheapest first): ";
|
|
312
|
+
const lexicalLabel = isLocal ? "LEXICAL" : "LOCAL LEXICAL";
|
|
313
|
+
const searchGuidance = opts.bluebirdEnabled === true ? "Search strategy: use Bluebird `code` search in `lexical` mode for indexed keyword queries and `semantic` mode for intent/concept questions. Bluebird failures remain visible and never fall back locally; `exact`, `regex`, and `ast` stay on the local live tree. `Explore` subagents read the narrowed files and return file:line conclusions; " + subsetTail + " " : opts.semanticSearchAvailable === true ? strategyOpener + "(1) " + lexicalLabel + " `code` search (mode:\"lexical\"/\"exact\", plus Grep/Glob) for symbols, filenames, errors, routes, flags, and config keys; (2) local ColBERT SEMANTIC `code` search for intent/concept questions where literal keywords may not appear, with lexical fallback while its index is unavailable; (3) `Explore` subagents read the narrowed files and return file:line conclusions — " + subsetTail + " " : strategyOpener + lexicalLabel + " `code` search (mode:\"lexical\"/\"exact\", plus Grep/Glob) for symbols, filenames, errors, routes, flags, and config keys. `Explore` subagents read the narrowed files and return file:line conclusions — " + subsetTail + " ";
|
|
234
314
|
if (opts.fastRuntimeAvailable === false) return `## Operating defaults (these layer with the user's explicit direction and the domain's own standards as addons, not replacements: follow all three together; on a direct conflict the user's direction wins, then the domain standard, then the default below)
|
|
235
315
|
|
|
236
316
|
${profileLabel} profile runtime wiring is unavailable. Work directly, use only tools actually listed in this session, verify with the repository's relevant build/tests before declaring done, report uncertainty, and do not invent unavailable capabilities.`;
|
|
@@ -239,13 +319,20 @@ ${profileLabel} profile runtime wiring is unavailable. Work directly, use only t
|
|
|
239
319
|
const browserKey = opts.groupKeys?.browser ?? "browser";
|
|
240
320
|
const workersKey = opts.groupKeys?.workers ?? "workers";
|
|
241
321
|
const browserClause = opts.browserToolsAvailable ?? opts.browseAvailable ? ` \`mcp__${browserKey}__*\` provides direct browser control.` : "";
|
|
242
|
-
const
|
|
322
|
+
const workerBrowseAvailable = opts.browseAvailable && !isLocal;
|
|
323
|
+
const workerBrowseClause = workerBrowseAvailable ? ` \`worker-browse\` runs delegated autonomous browsing tasks through \`mcp__${workersKey}__browse\`.` : "";
|
|
243
324
|
const artifactClause = opts.artifactAvailable ? ` \`mcp__${peersKey}__artifact_*\` provides human review in the artifact panel with auto-open on plan completion.` : "";
|
|
244
325
|
const astraClause = opts.astraAvailable && (opts.profile === "fast" || opts.profile === "cheap1m") ? ` \`mcp__${peersKey}__astra\` (GPT-6 Astra ${astraDescriptor}) is the terminal escalation consultant for the lead only, reserved strictly for the hardest dead ends when direct evidence, Advisor, and Oracle have all failed to produce a defensible path (consulted at most 1-2 times per decision with concise context and specific questions).` : "";
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
const
|
|
248
|
-
const
|
|
326
|
+
const leadLeaf = workerBrowseAvailable ? "`Explore`, `reviewer`, and `worker-browse`" : "`Explore` and `reviewer`";
|
|
327
|
+
const balancedLeaf = workerBrowseAvailable ? "`Explore` and `worker-browse`" : "`Explore`";
|
|
328
|
+
const disciplineOpener = isLocal ? "Execution discipline: " : "Work to your strengths as a fast, cost-efficient model: ";
|
|
329
|
+
const pipeline = isCheapest || isLocal ? `${profileLabel} launch profile. The lead owns the outcome and handles straightforward work directly. ` + buildNativeReachClauses(opts) + ". Handle trivial, surgical, single-file, or single-command tasks directly; you do not need to justify skipping delegation. `Explore` may be used for discovery spanning more than a couple of files; `General-Purpose` for mixed multi-step execution; `reviewer` for behavior-changing or risk-sensitive changes. In plan mode, produce the plan and acceptance criteria directly and do not edit files" + (hasAdvisor ? "; before presenting the final plan to the user, consult `advisor` once for a framing check. " : ". ") + disciplineOpener + "verify by execution rather than memory; before a non-trivial task, write a short plan (steps, files involved, the check settling each step) and execute it; persist through tool failures with a rephrased attempt before asking the user; stop searching when further results stop changing the answer; tag claims verified, inferred, or unverified — never state that something passes, compiles, or is covered without observed output. Delegation graph: the lead may invoke all three; `General-Purpose` may invoke `reviewer`; " + leadLeaf + " cannot invoke native subagents.\n\n" + (hasAdvisor ? CHEAPEST_CONSULT_CONTRACT : hasOracle ? ORACLE_ONLY_CONSULT_CONTRACT : DIRECT_EVIDENCE_CONTRACT) : isBalanced ? `${profileLabel} launch profile. The lead coordinates execution across specialized native roles: ` + buildNativeReachClauses(opts) + ". Lead owns planning, implementation, and verification by default: in plan mode, produce the plan and acceptance criteria directly and do not edit files. Phase pipeline (budget gather, budget execution, expensive verification). GATHER: narrow scope first with `code` (lexical, then semantic when available) and `web` search to rule out hypotheses — cheapest, always first. Delegate to `Explore` only when search is insufficient: launch one or more `Explore` subagents in parallel with scoped evidence questions and let them return file:line citations; read directly only the small subset you must touch to decide or edit. PLAN: lead owns planning: sequence interfaces, invariants, and acceptance criteria directly. EXECUTE: lead implements directly by default. Delegate to `General-Purpose` FREELY for multi-step work combining investigation, tool workflows, and code changes; brief with outcome, constraints, files in scope, and verification. VERIFY: lead owns verification: run relevant build/tests, read the code, and reproduce before declaring done. Invoke `reviewer` ONLY when the change is genuinely behavior-changing, cross-boundary, or risk-sensitive; `reviewer` narrows scope with search first and may invoke `Explore` for targeted discovery. Handle trivial, surgical, single-file, or single-command tasks directly; you do not need to justify skipping delegation. `Explore` is cheap and may be launched in parallel across independent discovery questions. Send independent subagent calls in parallel within a single turn. Delegation graph: the lead may invoke all three; `General-Purpose` may invoke `reviewer`; `reviewer` may invoke `Explore` for targeted discovery; " + balancedLeaf + " cannot invoke native subagents.\n\n" : `${profileLabel} launch profile. The lead coordinates execution across specialized native roles: ` + buildNativeReachClauses(opts) + ". In plan mode or when designing changes with complex sequencing, interface contracts, or acceptance criteria, delegate architectural planning to `Plan` (in plan mode, produce the plan and acceptance criteria; do not edit files). Phase pipeline (budget gather, expensive plan, budget execution, expensive verification). GATHER: delegate to `Explore` instead of exploring yourself. For any question spanning more than a couple of files, launch one or more `Explore` subagents in parallel with scoped evidence questions and let them return file:line citations; read directly only the small subset you must touch to decide or edit. `Plan` follows the same rule when it needs repository facts. PLAN: `Plan` produces handoff-ready steps (ordered, file:line, done conditions, acceptance criteria) for a `General-Purpose` executor that cannot see its reasoning; `Plan` may consult Oracle on unresolved trade-offs and reports any remaining gap to the lead. EXECUTE: delegate mixed multi-step work and Plan handoffs to `General-Purpose` in a fresh context to preserve lead context; brief with outcome, constraints, files in scope, and verification. VERIFY: after behavior-changing, cross-boundary, or risk-sensitive implementation, run relevant build/tests then invoke `reviewer` before declaring done. Handle trivial, surgical, single-file, or single-command tasks directly; you do not need to justify skipping delegation. `Explore` is cheap and may be launched in parallel across independent discovery questions. Send independent subagent calls in parallel within a single turn. Delegation graph: the lead may invoke all four; `Plan` may invoke `Explore` and `reviewer`; `General-Purpose` may invoke `reviewer`; " + leadLeaf + " cannot invoke native subagents.\n\n";
|
|
330
|
+
const windowNote = isCheapest || isBalanced || isLocal ? "All roles run at a 200K context window — use targeted reads (search, Grep, Read specific files) over full file reads.\n\n" : isCheap ? "The lead runs at a 200K context window on `-m cheap` (1M on `-m cheap1m`) and every subagent runs at 200K — use targeted reads (search, Grep, Read specific files) over full file reads.\n\n" : "";
|
|
331
|
+
const swePipelineClause = opts.sweEnabled === false ? "" : `${isLocal ? PIPELINE_SKILLS_AWARENESS_LOCAL : isCheapest || isBalanced ? PIPELINE_SKILLS_AWARENESS_NO_PLAN_AGENT : PIPELINE_SKILLS_AWARENESS}\n\n`;
|
|
332
|
+
const oracleLeadOnly = isCheapest || isBalanced || isLocal;
|
|
333
|
+
const consultOpener = isLocal ? "Consultation guidance: verify claims against real evidence first. " : "Consultation guidance: funnel unknowns cheapest-first. ";
|
|
334
|
+
const consultCostTail = isLocal ? "Prefer direct evidence over delegation when the question is narrow. " : "Optimize for accuracy, intelligence, and correctness at the lowest cost — prefer direct evidence over delegation when the question is narrow. ";
|
|
335
|
+
const consultation = !hasAdvisor ? consultOpener + "(1) `code` and `web` search narrow scope and rule out hypotheses — always first. (2) `Explore` subagents for targeted breadth only when search is insufficient. " + (hasOracle ? `\`mcp__${peersKey}__oracle\` is ${oracleDescriptor}, a second opinion for precise, self-contained architectural/spec trade-offs that search and \`Explore\` cannot settle; available to the lead; \`reviewer\` and other subagents cannot call Oracle. ` : "") + consultCostTail : "Consultation guidance: Follow an evidence-first escalation ladder. Direct empirical evidence (search, code, tests, builds) settles factual questions first. " + (advisorReviewerGranted ? "Advisor is an optional, non-binding, transcript-aware sounding board available to the lead and `reviewer` (at most 5 rounds per review) for trajectory guidance or framing checks (direction, not dictation), and never use it for routine progress, waiting, directly verifiable facts, or completion ritual. " : "Advisor is an optional, non-binding, lead-only transcript-aware sounding board for trajectory guidance or framing checks (direction, not dictation), and never use it for routine progress, waiting, directly verifiable facts, or completion ritual. ") + `\`mcp__${peersKey}__oracle\` is ${oracleDescriptor}, an expert consultant ${oracleLeadOnly ? "available to the lead" : "available to the lead and `Plan`"}, preferred over advisor for difficult conceptual, algorithmic, spec/protocol, or architectural tradeoffs evaluated in a self-contained brief; \`reviewer\` and other subagents cannot call Oracle. Discriminator: transcript-aware trajectory/framing/momentum → advisor; a self-contained technical/architectural trade-off → Oracle.${isCheapest || isLocal ? "" : " `Plan` may consult Oracle on unresolved trade-offs, and reports any remaining tie-breaking gap to the lead."}${astraClause} `;
|
|
249
336
|
return "## Operating defaults (these layer with the user's explicit direction and the domain's own standards as addons, not replacements: follow all three together; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\n" + pipeline + windowNote + consultation + searchGuidance + `\`mcp__${searchKey}__web\` provides citable sources.${browserClause}${workerBrowseClause}${artifactClause}\n\n` + swePipelineClause + "Verify claims with concrete repository evidence and tests before declaring work done. User instructions outrank delegation triggers. Stop named teammates when finished.";
|
|
250
337
|
}
|
|
251
338
|
return "## Operating defaults (these layer with the user's explicit direction and the domain's own standards as addons, not replacements: follow all three together; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\nOrchestrate. Delegate research, implementation, review, and large reads to the right subagent, worker, or model. Reach for " + buildNativeReachClauses(opts) + "; worker-* agents for background non-blocking runs; Task subagents for parallel work; peer critics for review. That keeps your own context free to reason and collaborate with the user. Launch independent agents concurrently in a single message rather than serially. Delegation pays when the work is WIDE (many files or sources to sweep) or SLOW, and you need only the conclusion: the main thread is where you think with and respond to the user, and its context window is a finite shared resource. It does NOT pay merely because a sub-question is separable. A narrow, deep question whose whole value is file:line fidelity loses exactly that through a summarization layer, and a sub-question you could answer in one command is cheaper done directly than paying a subagent's startup. Do trivial, surgical, and last-mile work yourself. A named teammate persists after it reports so you can send it follow-ups, and nothing reaps it for you: its idle notice means available, not finished. Stop it once you are done with it.\n\nAdversarial review. The peer critics (`codex_critic` and `codex_reviewer`, `gemini_critic` and `gemini_reviewer`, `opus_critic`, and the `peer-review-coordinator` that fans out to several of them) are fresh-context models, so what they add is a blind spot that whoever produced the work cannot reach by thinking harder about it; prefer a critic from a different lab than the producer, since blind spots correlate within a lab. The `advisor` is a complement and not a substitute: it sees your transcript, so it catches your own drift and momentum, but it inherits your framing, which is exactly what a fresh-context critic does not. They earn their keep on consequential design choices, recommendations, and hard-to-reverse decisions: the cases where plausible alternatives remain and the conclusion rests on judgment rather than on something you can verify directly. That is where confabulation hides, so budget the wait even under delivery pressure. Always consult one when the change touches auth, user input, database queries, crypto, or serialization. They do NOT pay for read-only tracing, ordinary repository lookup, or a conclusion that a focused test, a direct reproduction, or unambiguous code evidence already settles. Asking a critic to re-derive a proven fact returns a confident answer either way, which is ritual skepticism rather than review, and skipping them there is the right call and not a shortcut. Match the lens to the artifact: a strategic critic for plans and trade-offs, a code reviewer for a concrete diff, the coordinator only when the risk warrants several independent lenses. Give whichever you pick the artifact and the constraints and not your rationale, since justification anchors the review and dulls it.\n\nAim high. Default to radical simplicity and a relentless focus on the user's real experience: design for the person and the job to be done, not the demo. Reason about the whole system from first principles, anticipating scale and the long arc rather than patching the surface. Work backwards from the outcome the user actually needs. Question every assumption and prefer what you can derive, reproduce, or test.\n\nEngineering excellence. When making technical decisions, give little weight to development cost; prefer quality, simplicity, robustness, scalability, and long-term maintainability. Fix a bug by first reproducing it end to end, as close to how a real user hits it as you can, so you solve the real problem and not a symptom. When testing a product end to end, be picky about the UI and obsessed with pixel perfection: if something clearly looks off, even when it is unrelated to your task, get it fixed along the way. Hold that same bar for the codebase itself: a lint error, a failing test, or a flaky test is worth fixing the moment you see it, whoever introduced it. Fold it into your current work rather than letting it derail the task the user actually asked for.";
|
|
@@ -257,24 +344,28 @@ ${profileLabel} profile runtime wiring is unavailable. Work directly, use only t
|
|
|
257
344
|
const OPERATING_DEFAULTS_DIRECTIVE = buildOperatingDefaultsDirective();
|
|
258
345
|
const STANDARD_OPERATING_DEFAULTS_DIGEST = "## Operating defaults (these layer with the user's direction and the domain's standards as addons: follow all three; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\nDelegate when the work is WIDE (many files or sources to sweep) or SLOW and you need only the conclusion, to protect the main thread's finite context and keep it free for reasoning and interacting with the user; prefer parallel delegation for independent work. Do NOT delegate merely because a sub-question is separable: a narrow, deep question whose value is file:line fidelity loses exactly that through a summarization layer, and one answerable in a single command is cheaper done directly. Do trivial, surgical, and last-mile work yourself. Stop a named teammate once you are done with it: it persists for follow-ups, its idle notice means available rather than finished, and nothing reaps it for you.\n\nVerify, do not assert. Run the code, read the file, check the exit code. A claim in prose is worth nothing against state you did not check, and a check that cannot fail proves nothing. Reproduce a bug end to end, the way a real user hits it, before fixing it. Fix a lint error, failing test, or flake the moment you see it, whoever introduced it, without letting it derail the task at hand. Prefer quality and long-term maintainability over development cost.\n\nVerification has a blind spot: a consequential recommendation, a design or trade-off call, or a hard-to-reverse decision that still turns on judgment among plausible alternatives once the direct evidence is in. That is where confabulation hides, so put it past a peer critic before you ship it and budget the wait even under delivery pressure. When a test, a run, a reproduction, or a search would settle the claim, settle it that way instead; a critic asked to re-derive what you can already prove is ritual, not review.\n\nThe agent roster, the tool surface, and the reasoning behind these defaults are in your CLAUDE.md project instructions. Read them when choosing HOW to work; the rules above apply without a lookup.";
|
|
259
346
|
function buildOperatingDefaultsDigest(opts = {}) {
|
|
260
|
-
const digestPipelineSentence = opts.sweEnabled === false ? "" : isCheapestFamily(opts.profile) || isBalancedFamily(opts.profile) ? "Pipeline skills (all 200K default, native subagents only): `/gh-gather-context` before planning when context is needed, `/gh-plan` before implementation (the lead plans directly on this profile; trivial exits planless, waits for user approval), `/gh-implement` after approval with parallel subagents and conditional reviewer. Skip for trivial work.\n\n" : "Pipeline skills (all 200K default, native subagents only): `/gh-gather-context` before planning when context is needed, `/gh-plan` before implementation (trivial exits planless, waits for user approval), `/gh-implement` after approval with parallel subagents and conditional reviewer. Skip for trivial work.\n\n";
|
|
347
|
+
const digestPipelineSentence = opts.sweEnabled === false ? "" : isCheapestFamily(opts.profile) || isBalancedFamily(opts.profile) || isLocalFamily(opts.profile) ? "Pipeline skills (all 200K default, native subagents only): `/gh-gather-context` before planning when context is needed, `/gh-plan` before implementation (the lead plans directly on this profile; trivial exits planless, waits for user approval), `/gh-implement` after approval with parallel subagents and conditional reviewer. Skip for trivial work.\n\n" : "Pipeline skills (all 200K default, native subagents only): `/gh-gather-context` before planning when context is needed, `/gh-plan` before implementation (trivial exits planless, waits for user approval), `/gh-implement` after approval with parallel subagents and conditional reviewer. Skip for trivial work.\n\n";
|
|
261
348
|
if (opts.profile === "max") return "## Operating defaults (these layer with the user's direction and the domain's standards as addons: follow all three; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\nMax launch profile. The lead owns the outcome. Start with direct repository or runtime evidence. Do narrow, obvious, surgical, and single-command work directly; delegate bounded work that is broad, slow, context-heavy, or independently valuable. " + MAX_PARALLELISM_RULE + " Give delegated workstreams non-overlapping scopes and state the outcome, constraints, evidence, and verification expected.\n\n" + digestPipelineSentence + "Synthesize and verify: run the code, inspect outputs, and check tests. Agent count and agreement are not evidence. Use a fresh-context peer only for consequential judgment that remains after direct checks, and use the coordinator only when several distinct lenses could change the decision. Advisor is optional, non-binding, primary-lead-only counsel for one focused consequential uncertainty; it is not an approval or completion gate.";
|
|
262
349
|
if (isPinnedLaunchProfile(opts.profile)) {
|
|
263
350
|
const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
|
|
264
351
|
const isCheapest = isCheapestFamily(opts.profile);
|
|
265
352
|
const isBalanced = isBalancedFamily(opts.profile);
|
|
266
|
-
const
|
|
267
|
-
const
|
|
268
|
-
const
|
|
269
|
-
const
|
|
353
|
+
const isLocal = isLocalFamily(opts.profile);
|
|
354
|
+
const hasAdvisor = !isBalanced && !(isLocal && opts.profile !== "local2");
|
|
355
|
+
const hasOracle = !(isLocal && opts.profile === "local");
|
|
356
|
+
const advisorReviewerGranted = hasAdvisor && (isCheapest || isLocal);
|
|
357
|
+
const profileLabel = isLocal ? "Local" : isCheapest ? "Cheapest" : isCheap ? "Cheap" : isBalanced ? "Balanced" : "Fast";
|
|
358
|
+
const familyContract = isCheapest ? cheapestContractFor(opts.profile) : isBalanced ? balancedContractFor(opts.profile) : isLocal ? localContractFor(opts.profile) : void 0;
|
|
270
359
|
const oracleDescriptor = familyContract ? `(${displayModelName(familyContract.oracleModel)} 200K/${familyContract.oracleEffort}, lead-only)` : isCheap ? "(Grok 4.6 200K/medium, lead and Plan)" : "(Opus 5 1M/high, lead and Plan)";
|
|
271
|
-
const
|
|
360
|
+
const advisorContract = isCheapest ? cheapestContractFor(opts.profile) : opts.profile === "local2" ? local2AdvisorContract() : void 0;
|
|
361
|
+
const advisorScope = advisorReviewerGranted ? "lead and `reviewer`, capped" : "lead-only";
|
|
362
|
+
const advisorDescriptor = advisorContract ? `(${displayModelName(advisorContract.advisorModel)}/${advisorContract.advisorEffort}, ${advisorScope})` : `(Sol/high, ${advisorScope})`;
|
|
272
363
|
const astraStep = opts.astraAvailable && (opts.profile === "fast" || opts.profile === "cheap1m") ? `; (4) \`astra\` (GPT-6 Astra 200K/${isCheap ? "medium" : "high"}, lead-only) only as a last resort when direct evidence, Advisor, and Oracle cannot produce a defensible path (at most 1-2 calls per decision).` : ".";
|
|
273
|
-
const delegation = isCheapest ? `${profileLabel} launch profile. The lead owns the outcome and handles straightforward work directly: use \`Explore\` for discovery spanning more than a couple of files, \`General-Purpose\` for mixed multi-step execution, and \`reviewer\` for behavior-changing or risk-sensitive changes. In plan mode, produce the plan and acceptance criteria directly; before presenting the final plan to the user, consult
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
const consultationLadder =
|
|
277
|
-
const digestWindowNote = isCheapest || isBalanced ? "All roles run at a 200K context window — use targeted reads over full file reads.\n\n" : isCheap ? "The lead runs at 200K on `-m cheap` (1M on `-m cheap1m`) and every subagent runs at 200K — use targeted reads over full file reads.\n\n" : "";
|
|
364
|
+
const delegation = isCheapest || isLocal ? `${profileLabel} launch profile. The lead owns the outcome and handles straightforward work directly: use \`Explore\` for discovery spanning more than a couple of files, \`General-Purpose\` for mixed multi-step execution, and \`reviewer\` for behavior-changing or risk-sensitive changes. In plan mode, produce the plan and acceptance criteria directly${hasAdvisor ? "; before presenting the final plan to the user, consult `advisor` once for a framing check." : "."} Plan briefly before non-trivial acts, verify by execution, tag unverified claims, and stop searching when results stop changing the answer. Handle trivial and surgical edits directly. Stop named teammates when finished.\n\n` + (hasAdvisor ? CHEAPEST_CONSULT_CONTRACT_POINTER : hasOracle ? ORACLE_ONLY_CONSULT_CONTRACT_POINTER : DIRECT_EVIDENCE_CONTRACT_POINTER) : isBalanced ? `${profileLabel} launch profile. The lead owns planning, implementation, and verification by default: narrow scope first with \`code\` and \`web\` search to rule out hypotheses (cheapest, always first); delegate to \`Explore\` in parallel only when search is insufficient (read directly only files you will act on); delegate to \`General-Purpose\` FREELY for multi-step work combining investigation, tool workflows, and code changes; invoke \`reviewer\` ONLY when the change is genuinely behavior-changing, cross-boundary, or risk-sensitive (\`reviewer\` narrows scope with search first and may invoke \`Explore\` for targeted discovery); handle trivial and surgical edits directly. Send independent subagent calls in parallel within a single turn. Stop named teammates when finished.\n\n` : `${profileLabel} launch profile. The lead coordinates execution across specialized roles: delegate broad discovery to \`Explore\` in parallel and do not sweep the repo yourself (read directly only files you will act on); delegate to \`Plan\` in plan mode or when structuring complex multi-step sequencing (\`Plan\` is an advisory planning capability, not an approval gate, and writes handoff-ready steps for \`General-Purpose\`); delegate mixed multi-step execution and Plan handoffs to \`General-Purpose\` in a fresh context; delegate to \`reviewer\` after behavior-changing or risk-sensitive implementation to verify correctness before declaring done; handle trivial and surgical edits directly. Send independent subagent calls in parallel within a single turn. Stop named teammates when finished.\n\n`;
|
|
365
|
+
const digestLadderOpener = isLocal ? "Verify claims against real evidence: run relevant commands and tests. (1) " : "Verify claims against real evidence: run relevant commands and tests. Funnel unknowns cheapest-first: (1) ";
|
|
366
|
+
const digestLadderTail = isLocal ? "Prefer direct evidence over delegation when the question is narrow." : "Optimize for accuracy, intelligence, and correctness at the lowest cost.";
|
|
367
|
+
const consultationLadder = !hasAdvisor ? !hasOracle ? digestLadderOpener + "`code` + `web` search narrow scope and rule out hypotheses first; (2) `Explore` for targeted breadth when search is insufficient. " + digestLadderTail : digestLadderOpener + "`code` + `web` search narrow scope and rule out hypotheses first; (2) `Explore` for targeted breadth when search is insufficient; (3) `oracle` " + oracleDescriptor + " as a second opinion for precise, self-contained technical/architectural trade-offs that search and `Explore` cannot settle. " + digestLadderTail : "Verify claims against real evidence: run relevant commands and tests. Follow a disciplined consultation ladder for unresolved decisions: (1) direct code inspection, search, builds, and tests settle factual questions; (2) `advisor` " + advisorDescriptor + " for transcript-aware framing checks or trajectory guidance (session momentum/trajectory); (3) `oracle` " + oracleDescriptor + " for self-contained technical/architectural trade-offs" + astraStep;
|
|
368
|
+
const digestWindowNote = isCheapest || isBalanced || isLocal ? "All roles run at a 200K context window — use targeted reads over full file reads.\n\n" : isCheap ? "The lead runs at 200K on `-m cheap` (1M on `-m cheap1m`) and every subagent runs at 200K — use targeted reads over full file reads.\n\n" : "";
|
|
278
369
|
return "## Operating defaults (these layer with the user's direction and the domain's standards as addons: follow all three; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\n" + delegation + digestPipelineSentence + digestWindowNote + consultationLadder;
|
|
279
370
|
}
|
|
280
371
|
return STANDARD_OPERATING_DEFAULTS_DIGEST;
|
|
@@ -669,6 +760,6 @@ async function prependArtifactPanelDirectiveToMirroredClaudeMd(peersKey = "peers
|
|
|
669
760
|
});
|
|
670
761
|
}
|
|
671
762
|
//#endregion
|
|
672
|
-
export { buildOperatingDefaultsDirective as a, prependOperatingDefaultsToMirroredClaudeMd as c, buildOperatingDefaultsDigest as i, prependStyleDirectiveToMirroredClaudeMd as l, appendPeerAwarenessToMirroredClaudeMd as n, isUnderClaudeConfigMirrorRealpath as o, appendToolbeltAwarenessToMirroredClaudeMd as r, prependArtifactPanelDirectiveToMirroredClaudeMd as s,
|
|
763
|
+
export { buildOperatingDefaultsDirective as a, prependOperatingDefaultsToMirroredClaudeMd as c, buildOperatingDefaultsDigest as i, prependStyleDirectiveToMirroredClaudeMd as l, appendPeerAwarenessToMirroredClaudeMd as n, isUnderClaudeConfigMirrorRealpath as o, appendToolbeltAwarenessToMirroredClaudeMd as r, prependArtifactPanelDirectiveToMirroredClaudeMd as s, FRESH_CONSULT_CONTRACT as t, renameWithRetry as u };
|
|
673
764
|
|
|
674
|
-
//# sourceMappingURL=claude-md-injection-
|
|
765
|
+
//# sourceMappingURL=claude-md-injection-BV4tPUWo.js.map
|