github-router 0.3.357 → 0.3.369

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.
Files changed (124) hide show
  1. package/dist/ado-tools-C0sY_rX1.js +1 -0
  2. package/dist/{aic-ledger-BuFrsGur.js → aic-ledger-_mvGW2Ev.js} +42 -7
  3. package/dist/aic-ledger-_mvGW2Ev.js.map +1 -0
  4. package/dist/{aic-statusline-settings-DBS9sEGC.js → aic-statusline-settings-B5EMMSFC.js} +2 -2
  5. package/dist/{aic-statusline-settings-DBS9sEGC.js.map → aic-statusline-settings-B5EMMSFC.js.map} +1 -1
  6. package/dist/{attribution-settings-D9PxJxkL.js → attribution-settings-zoBxw08y.js} +374 -218
  7. package/dist/attribution-settings-zoBxw08y.js.map +1 -0
  8. package/dist/{auth-DFawaLJU.js → auth-B3UvYB2r.js} +3 -3
  9. package/dist/{auth-DFawaLJU.js.map → auth-B3UvYB2r.js.map} +1 -1
  10. package/dist/{balanced-profile-contract-DtnTIBjL.js → balanced-profile-contract-Dm_usmw7.js} +7 -1
  11. package/dist/{balanced-profile-contract-DtnTIBjL.js.map → balanced-profile-contract-Dm_usmw7.js.map} +1 -1
  12. package/dist/browser-ext/manifest.json +1 -1
  13. package/dist/{check-usage-BkVEl-Su.js → check-usage-45vyaLfl.js} +4 -4
  14. package/dist/{check-usage-BkVEl-Su.js.map → check-usage-45vyaLfl.js.map} +1 -1
  15. package/dist/{claude-BTYQjK-K.js → claude-BbIfnWbm.js} +92 -42
  16. package/dist/claude-BbIfnWbm.js.map +1 -0
  17. package/dist/{claude-md-injection-Cpzolxin.js → claude-md-injection-BtBG1RBZ.js} +153 -37
  18. package/dist/claude-md-injection-BtBG1RBZ.js.map +1 -0
  19. package/dist/{codex-TdsG6C9K.js → codex-CZVlP2tB.js} +7 -7
  20. package/dist/{codex-TdsG6C9K.js.map → codex-CZVlP2tB.js.map} +1 -1
  21. package/dist/{copilot-discount-Bsmv_3OX.js → copilot-discount-BuDbQOHq.js} +2 -2
  22. package/dist/{copilot-discount-Bsmv_3OX.js.map → copilot-discount-BuDbQOHq.js.map} +1 -1
  23. package/dist/{debug-DkNTuErv.js → debug-DL2JsRqY.js} +2 -2
  24. package/dist/{debug-DkNTuErv.js.map → debug-DL2JsRqY.js.map} +1 -1
  25. package/dist/engine-DeIo-VIR.js +1 -0
  26. package/dist/{gate-discovery-NNQg0t0H.js → gate-discovery-BYyYeUnn.js} +5 -5
  27. package/dist/{gate-discovery-NNQg0t0H.js.map → gate-discovery-BYyYeUnn.js.map} +1 -1
  28. package/dist/{get-copilot-usage-P9chc-X2.js → get-copilot-usage-BbGmK03C.js} +2 -2
  29. package/dist/{get-copilot-usage-P9chc-X2.js.map → get-copilot-usage-BbGmK03C.js.map} +1 -1
  30. package/dist/hooks.mjs +262 -117
  31. package/dist/hooks.sha256 +1 -1
  32. package/dist/{index-cmd-BkfYr9FH.js → index-cmd-CjRcmYk3.js} +4 -4
  33. package/dist/{index-cmd-BkfYr9FH.js.map → index-cmd-CjRcmYk3.js.map} +1 -1
  34. package/dist/{internal-aic-status-C6L4-ncP.js → internal-aic-status-BAVomi5A.js} +4 -4
  35. package/dist/{internal-aic-status-C6L4-ncP.js.map → internal-aic-status-BAVomi5A.js.map} +1 -1
  36. package/dist/{internal-artifact-open-DgJ3PCtt.js → internal-artifact-open-NAGn9Mgt.js} +2 -2
  37. package/dist/{internal-artifact-open-DgJ3PCtt.js.map → internal-artifact-open-NAGn9Mgt.js.map} +1 -1
  38. package/dist/{internal-fast-dispatch-guard-CicGz6oM.js → internal-fast-dispatch-guard-De_DJOyZ.js} +1 -1
  39. package/dist/{internal-fast-dispatch-guard-CgBtUsQI.js → internal-fast-dispatch-guard-_n-A8hgo.js} +3 -3
  40. package/dist/{internal-fast-dispatch-guard-CgBtUsQI.js.map → internal-fast-dispatch-guard-_n-A8hgo.js.map} +1 -1
  41. package/dist/{internal-first-mate-guard-DTXPT7JW.js → internal-first-mate-guard-C8GwLbaX.js} +1 -1
  42. package/dist/{internal-first-mate-guard-BfWYN6Jb.js → internal-first-mate-guard-GufCUMl3.js} +3 -3
  43. package/dist/{internal-first-mate-guard-BfWYN6Jb.js.map → internal-first-mate-guard-GufCUMl3.js.map} +1 -1
  44. package/dist/{internal-max-dispatch-guard-mNl9CCir.js → internal-max-dispatch-guard-BB0vwiPx.js} +1 -1
  45. package/dist/{internal-max-dispatch-guard-CY8l9SDw.js → internal-max-dispatch-guard-BodVFHRC.js} +2 -2
  46. package/dist/{internal-max-dispatch-guard-CY8l9SDw.js.map → internal-max-dispatch-guard-BodVFHRC.js.map} +1 -1
  47. package/dist/{internal-plan-review-2OHTs8Nk.js → internal-plan-review-ChFx8wTX.js} +3 -3
  48. package/dist/{internal-plan-review-2OHTs8Nk.js.map → internal-plan-review-ChFx8wTX.js.map} +1 -1
  49. package/dist/{internal-prompt-submit-DZ_-2A6a.js → internal-prompt-submit-B-kKTl-8.js} +2 -2
  50. package/dist/{internal-prompt-submit-CkfUcu34.js → internal-prompt-submit-bi7F7pKk.js} +4 -4
  51. package/dist/{internal-prompt-submit-CkfUcu34.js.map → internal-prompt-submit-bi7F7pKk.js.map} +1 -1
  52. package/dist/{internal-rebrief-EhBHAHsz.js → internal-rebrief-B6ZJS6Mp.js} +4 -4
  53. package/dist/{internal-rebrief-EhBHAHsz.js.map → internal-rebrief-B6ZJS6Mp.js.map} +1 -1
  54. package/dist/{internal-session-bind-Bv50ju2n.js → internal-session-bind-dsUOcKxU.js} +2 -2
  55. package/dist/{internal-session-bind-Bv50ju2n.js.map → internal-session-bind-dsUOcKxU.js.map} +1 -1
  56. package/dist/{internal-stop-hook-Iz8XXE07.js → internal-stop-hook-BbyobGUU.js} +5 -5
  57. package/dist/{internal-stop-hook-Iz8XXE07.js.map → internal-stop-hook-BbyobGUU.js.map} +1 -1
  58. package/dist/{internal-stop-review-K6f8xsCh.js → internal-stop-review-D_KEV_04.js} +2 -2
  59. package/dist/{internal-stop-review-K6f8xsCh.js.map → internal-stop-review-D_KEV_04.js.map} +1 -1
  60. package/dist/{internal-worker-guard-GVhTjVlR.js → internal-worker-guard-DB6shBIn.js} +2 -2
  61. package/dist/{internal-worker-guard-GVhTjVlR.js.map → internal-worker-guard-DB6shBIn.js.map} +1 -1
  62. package/dist/{internal-workspace-header-d2hFf9Jy.js → internal-workspace-header-DBg5Y7oN.js} +2 -2
  63. package/dist/{internal-workspace-header-d2hFf9Jy.js.map → internal-workspace-header-DBg5Y7oN.js.map} +1 -1
  64. package/dist/{lifecycle-C6cxM_Nk.js → lifecycle-9nX09dBl.js} +2 -2
  65. package/dist/{lifecycle-C6cxM_Nk.js.map → lifecycle-9nX09dBl.js.map} +1 -1
  66. package/dist/lifecycle-C_CT13c9.js +1 -0
  67. package/dist/lifecycle-DibiH857.js +1 -0
  68. package/dist/{lifecycle-pl9QpvqD.js → lifecycle-Gge2Dadd.js} +2 -2
  69. package/dist/{lifecycle-pl9QpvqD.js.map → lifecycle-Gge2Dadd.js.map} +1 -1
  70. package/dist/main.js +23 -23
  71. package/dist/{mcp-workspace-header-Su8uUxJg.js → mcp-workspace-header-Xw9B1W6T.js} +2 -2
  72. package/dist/{mcp-workspace-header-Su8uUxJg.js.map → mcp-workspace-header-Xw9B1W6T.js.map} +1 -1
  73. package/dist/{models-D8v8OTbN.js → models-BR6i348u.js} +3 -3
  74. package/dist/{models-D8v8OTbN.js.map → models-BR6i348u.js.map} +1 -1
  75. package/dist/{orchestration-Bov4rZEi.js → orchestration-D3-2ulhX.js} +2 -2
  76. package/dist/{orchestration-Bov4rZEi.js.map → orchestration-D3-2ulhX.js.map} +1 -1
  77. package/dist/{paths-BSI_EtDT.js → paths-C5477RGC.js} +48 -4
  78. package/dist/paths-C5477RGC.js.map +1 -0
  79. package/dist/paths-CEswtFj5.js +1 -0
  80. package/dist/{peer-mcp-personas-GANlrtNR.js → peer-mcp-personas-DNtWI2C1.js} +1139 -398
  81. package/dist/peer-mcp-personas-DNtWI2C1.js.map +1 -0
  82. package/dist/{pi-TKFwPyLA.js → pi-Bc-MVgAo.js} +397 -603
  83. package/dist/pi-Bc-MVgAo.js.map +1 -0
  84. package/dist/{plan-review-hook-CHK1wL3-.js → plan-review-hook-C9K-em4D.js} +3 -3
  85. package/dist/{plan-review-hook-CHK1wL3-.js.map → plan-review-hook-C9K-em4D.js.map} +1 -1
  86. package/dist/{provision-BNN6yRk8.js → provision-DUWdcY_a.js} +5 -5
  87. package/dist/{provision-BNN6yRk8.js.map → provision-DUWdcY_a.js.map} +1 -1
  88. package/dist/{self-invocation-Dk_UHD_v.js → self-invocation-BtcGj-lY.js} +2 -2
  89. package/dist/{self-invocation-Dk_UHD_v.js.map → self-invocation-BtcGj-lY.js.map} +1 -1
  90. package/dist/{serve-BaeLm9Um.js → serve-CmWOTR7m.js} +14 -14
  91. package/dist/{serve-BaeLm9Um.js.map → serve-CmWOTR7m.js.map} +1 -1
  92. package/dist/{server-setup-BcUQv5ac.js → server-setup-CIzmDJzT.js} +848 -103
  93. package/dist/server-setup-CIzmDJzT.js.map +1 -0
  94. package/dist/{service-backend-DHyd9vjW.js → service-backend-B6D_DY1Z.js} +3 -3
  95. package/dist/{service-backend-DHyd9vjW.js.map → service-backend-B6D_DY1Z.js.map} +1 -1
  96. package/dist/{start-BdoGJc36.js → start-rlpaeAtx.js} +4 -4
  97. package/dist/{start-BdoGJc36.js.map → start-rlpaeAtx.js.map} +1 -1
  98. package/dist/state-CiwCLVDZ.js.map +1 -1
  99. package/dist/{static-context-pack-dKrzbfIN.js → static-context-pack-DvwLWlbe.js} +371 -64
  100. package/dist/static-context-pack-DvwLWlbe.js.map +1 -0
  101. package/dist/{stop-gate-hook-CC7VWkZM.js → stop-gate-hook-DnLC09Lg.js} +3 -3
  102. package/dist/{stop-gate-hook-CC7VWkZM.js.map → stop-gate-hook-DnLC09Lg.js.map} +1 -1
  103. package/dist/{stop-gate-policy-CoR8xKNQ.js → stop-gate-policy-Dx9c98_d.js} +2 -2
  104. package/dist/{stop-gate-policy-CoR8xKNQ.js.map → stop-gate-policy-Dx9c98_d.js.map} +1 -1
  105. package/dist/{token-CA2s70qj.js → token-OTb61rOC.js} +2 -2
  106. package/dist/{token-CA2s70qj.js.map → token-OTb61rOC.js.map} +1 -1
  107. package/dist/{worker-dispatch-B_rriT7z.js → worker-dispatch-B1w2qfjX.js} +2 -2
  108. package/dist/{worker-dispatch-B_rriT7z.js.map → worker-dispatch-B1w2qfjX.js.map} +1 -1
  109. package/docs/azure-mcp.md +29 -31
  110. package/package.json +1 -1
  111. package/dist/ado-tools-DqLJ-u19.js +0 -1
  112. package/dist/aic-ledger-BuFrsGur.js.map +0 -1
  113. package/dist/attribution-settings-D9PxJxkL.js.map +0 -1
  114. package/dist/claude-BTYQjK-K.js.map +0 -1
  115. package/dist/claude-md-injection-Cpzolxin.js.map +0 -1
  116. package/dist/engine-CmhUwYI5.js +0 -1
  117. package/dist/lifecycle-BU_d2QMs.js +0 -1
  118. package/dist/lifecycle-ByFyew_w.js +0 -1
  119. package/dist/paths-BSI_EtDT.js.map +0 -1
  120. package/dist/paths-BYxX9DfA.js +0 -1
  121. package/dist/peer-mcp-personas-GANlrtNR.js.map +0 -1
  122. package/dist/pi-TKFwPyLA.js.map +0 -1
  123. package/dist/server-setup-BcUQv5ac.js.map +0 -1
  124. package/dist/static-context-pack-dKrzbfIN.js.map +0 -1
@@ -1,5 +1,6 @@
1
- import { a as isUnderClaudeConfigMirror, t as PATHS } from "./paths-BSI_EtDT.js";
2
- import { _ as isBalancedFamily, g as displayModelName, m as cheapestContractFor, p as balancedContractFor, v as isCheapestFamily, y as isPinnedLaunchProfile } from "./static-context-pack-dKrzbfIN.js";
1
+ import { a as isUnderClaudeConfigMirror, t as PATHS } from "./paths-C5477RGC.js";
2
+ import { Fn as LOCAL_CONSULT_REDACTION_LINE } from "./peer-mcp-personas-DNtWI2C1.js";
3
+ import { S as localContractFor, _ as isCheapestFamily, b as isPinnedLaunchProfile, f as balancedContractFor, g as isBalancedFamily, h as displayModelName, p as cheapestContractFor, v as isCheaplocalProfile, x as local2AdvisorContract, y as isLocalFamily } from "./static-context-pack-DvwLWlbe.js";
3
4
  import { C as MAX_PARALLELISM_RULE } from "./max-profile-contract-Cx5_Z1Y7.js";
4
5
  import consola from "consola";
5
6
  import path from "node:path";
@@ -110,20 +111,38 @@ const STYLE_DIRECTIVE = "Write concisely without losing detail. Use a natural hu
110
111
  * 200K default window (bare slugs, no 1M accounting) with advisory budgets:
111
112
  * gather ~3 min per round (3 rounds max, 6 Explore per round); plan ~5 min
112
113
  * via the profile-pinned Plan subagent where the profile provides one
113
- * (the lead plans directly on cheapest/balanced; trivial asks exit
114
+ * (the lead plans directly on cheapest/balanced/local; trivial asks exit
114
115
  * planless);
115
116
  * implement ~10 min per task (8 concurrent max, worktree:true only when
116
117
  * parallel tasks need isolation); reviewer only on low-confidence or complex
117
118
  * and risky changes, plus a General-Purpose fix pass for major reviewer
118
119
  * findings.
119
120
  */
120
- const PIPELINE_SKILLS_AWARENESS = "Pipeline skills (all 200K default context, native subagents only, never worker-*). 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: native Plan subagent plans non-trivial asks (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 (implementer first on max; 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.";
121
+ /** One builder for every profile's pipeline-skills block: only the Plan stage
122
+ * wording and the dispatcher contrast vary, so the shared stages cannot drift
123
+ * between the exported constants. */
124
+ function pipelineSkillsAwareness(opts) {
125
+ 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.`;
126
+ }
127
+ const PIPELINE_SKILLS_AWARENESS = pipelineSkillsAwareness({
128
+ planAgent: true,
129
+ workersAvailable: true
130
+ });
121
131
  /**
122
132
  * Pipeline-skills awareness for the profiles without a `Plan` role
123
- * (cheapest, balanced): the lead plans directly, so `/gh-plan` names the
124
- * lead instead of a Plan dispatch. Every other stage is identical.
133
+ * (cheapest, balanced): the lead plans directly, so `/gh-plan` names the lead
134
+ * instead of a Plan dispatch. Every other stage is identical.
125
135
  */
126
- const PIPELINE_SKILLS_AWARENESS_NO_PLAN_AGENT = "Pipeline skills (all 200K default context, native subagents only, never worker-*). 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: the lead plans directly (no Plan 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 (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.";
136
+ const PIPELINE_SKILLS_AWARENESS_NO_PLAN_AGENT = pipelineSkillsAwareness({
137
+ planAgent: false,
138
+ workersAvailable: true
139
+ });
140
+ /** Local is the no-Plan form without the `worker-*` contrast, which names a
141
+ * dispatcher the profile does not inject. */
142
+ const PIPELINE_SKILLS_AWARENESS_LOCAL = pipelineSkillsAwareness({
143
+ planAgent: false,
144
+ workersAvailable: false
145
+ });
127
146
  /** Oxford-comma join: "a", "a and b", "a, b, and c". */
128
147
  function joinClauses(parts) {
129
148
  if (parts.length <= 1) return parts[0] ?? "";
@@ -153,21 +172,26 @@ function buildNativeReachClauses(opts) {
153
172
  "`Explore` (Luna/high, cheap breadth) for discovery, dependency mapping, and convention tracking spanning more than a couple of files",
154
173
  "`General-Purpose` (Luna/max, the heavy execution tier) for mixed, iterative, or multi-step execution",
155
174
  "`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`. All roles run at a 200K context window — prefer targeted reads (search, Grep, Read specific files) over full file reads";
175
+ ]) + ". Delegate by value — cheap breadth to `Explore`, heavy execution to `General-Purpose`, verification to `reviewer`";
176
+ if (isLocalFamily(opts.profile)) {
177
+ const models = localContractFor(opts.profile).nativeModels;
178
+ return joinClauses([
179
+ `\`Explore\` (${models.Explore} tier) for discovery, dependency mapping, and convention tracking spanning more than a couple of files`,
180
+ `\`General-Purpose\` (${models["General-Purpose"]} tier) for mixed, iterative, or multi-step execution`,
181
+ `\`reviewer\` (${models.reviewer} tier) for independent adversarial verification, reproduction, and root-causing`
182
+ ]) + ". Delegate by value — wide breadth to `Explore`, execution to `General-Purpose`, verification to `reviewer`";
183
+ }
157
184
  if (isBalancedFamily(opts.profile)) return joinClauses([
158
185
  "`Explore` for broad repository discovery, dependency mapping, and convention tracking (launch in parallel)",
159
186
  "`General-Purpose` for mixed, iterative, or multi-step execution tasks (delegate freely)",
160
187
  "`reviewer` for independent adversarial verification, reproduction, and root-causing ONLY when genuinely behavior-changing (lead owns verification by default)"
161
- ]) + ". All roles run at a 200K context window — prefer targeted reads (search, Grep, Read specific files) over full file reads";
162
- const shared = joinClauses([
188
+ ]);
189
+ return joinClauses([
163
190
  "`Explore` for broad repository discovery, dependency mapping, and convention tracking (launch in parallel)",
164
191
  "`Plan` for architectural sequencing, interface contracts, migration risk, and runnable acceptance criteria (delegates discovery to `Explore`)",
165
192
  "`General-Purpose` for mixed, iterative, or multi-step execution tasks (follows a Plan handoff when one exists)",
166
193
  "`reviewer` for independent adversarial verification, reproduction, and root-causing after non-trivial changes"
167
194
  ]);
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
195
  }
172
196
  const clauses = [];
173
197
  const implementerFast = opts.implementerFastAvailable !== false;
@@ -207,6 +231,79 @@ function buildNativeReachClauses(opts) {
207
231
  */
208
232
  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
233
  /**
234
+ * Short, always-resident pointer to the consult contract, injected into the
235
+ * digest (`--append-system-prompt`) instead of the full block. Keeps the
236
+ * trigger + budget visible at top salience without duplicating the ~250-word
237
+ * contract every turn; the full how-to lives in the mirrored CLAUDE.md.
238
+ */
239
+ 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";
240
+ /**
241
+ * Transport sibling of `CHEAPEST_CONSULT_CONTRACT` for the `cheaplocal`
242
+ * profile, whose Advisor and Oracle answer from the local endpoint.
243
+ *
244
+ * The body is the cheapest contract's, with three consultant-facing claims
245
+ * replaced and one instruction added: the reader is named by role instead of
246
+ * by model, the budget no longer prices the consult in money, the judgment-call
247
+ * anchor no longer asserts that the consultant's knowledge may be stale, and
248
+ * the brief-writing sentence gains the caller half of the redaction contract
249
+ * (`LOCAL_CONSULT_REDACTION_LINE`) because this is the profile whose briefs
250
+ * leave Copilot for an endpoint the operator runs. Those four are the whole
251
+ * difference: the budget count, the anchors, the disqualifiers and the
252
+ * discriminator are all about the WORK and stay verbatim. A name, window,
253
+ * effort, cost or knowledge claim here would be an assumption about an
254
+ * endpoint this profile deliberately knows nothing about.
255
+ *
256
+ * Derived rather than retyped so the two contracts cannot drift: the only
257
+ * sanctioned differences are these four `replace` calls (a test pins that,
258
+ * plus the absence of any model name in the result). The pointer above is
259
+ * reused verbatim — it prices nothing and names no model.
260
+ */
261
+ const CHEAPLOCAL_CONSULT_CONTRACT = CHEAPEST_CONSULT_CONTRACT.replace("Sol reads a curated view of this session", "the Advisor reads a curated view of this session").replace("each costs real time and money", "each costs real time").replace("a stale-knowledge / high-consequence risk or severity call", "a high-consequence risk or severity call").replace("Never paste raw tool output", `${LOCAL_CONSULT_REDACTION_LINE} Never paste raw tool output`);
262
+ /**
263
+ * Transport sibling of `CHEAPEST_CONSULT_CONTRACT` for a front-end whose
264
+ * consultant receives no transcript at all.
265
+ *
266
+ * The body is the cheapest contract's, with the one transport sentence
267
+ * replaced: instead of "Sol reads a curated view of this session", the lead is
268
+ * told to make the brief self-contained because the Advisor reads only what
269
+ * the lead writes. Everything else — budget, anchors, disqualifiers,
270
+ * discriminator — is identical, so the consult policy cannot drift between
271
+ * the two front-ends.
272
+ *
273
+ * Used by the Pi launcher, whose `advisor` subagent is `defaultContext:
274
+ * fresh` with a read-only toolset: it never sees the lead's conversation, so
275
+ * the curated-view sentence would be false there. The Claude launcher keeps
276
+ * `CHEAPEST_CONSULT_CONTRACT`, which describes what its curated path really
277
+ * sends.
278
+ */
279
+ 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";
280
+ /**
281
+ * Oracle-only sibling of `CHEAPEST_CONSULT_CONTRACT` for a launch that carries
282
+ * an Oracle but no Advisor: the `balanced` family, whose consultant ladder
283
+ * exposes `oracle` alone.
284
+ *
285
+ * Naming the Advisor there would point the lead at a tool the session cannot
286
+ * reach, so the budget, the anchors and the disqualifiers are restated against
287
+ * `oracle` alone. Everything that is not about the Advisor is the cheapest
288
+ * contract's wording, and a launch that carries both keeps the original.
289
+ */
290
+ 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";
291
+ /** Short, always-resident pointer to `ORACLE_ONLY_CONSULT_CONTRACT`. */
292
+ 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";
293
+ /**
294
+ * Contract for a launch that carries neither consultant.
295
+ *
296
+ * `-m local` exposes no `peers` group at all, so neither the Advisor nor the
297
+ * Oracle exists on its surface. Both siblings above are written around a budget
298
+ * of consults and a discriminator between the two roles, and naming either role
299
+ * here would point the lead at a tool the session cannot reach. What survives
300
+ * is the part that was never about them: settle what evidence can settle, and
301
+ * make the reasoning explicit where it cannot.
302
+ */
303
+ 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";
304
+ /** Short, always-resident pointer to `DIRECT_EVIDENCE_CONTRACT`. */
305
+ 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";
306
+ /**
210
307
  * Build the operating-defaults directive for one launch, naming only the
211
308
  * natives that launch actually emitted.
212
309
  *
@@ -225,12 +322,19 @@ function buildOperatingDefaultsDirective(opts = {}) {
225
322
  const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
226
323
  const isCheapest = isCheapestFamily(opts.profile);
227
324
  const isBalanced = isBalancedFamily(opts.profile);
228
- const profileLabel = isCheapest ? "Cheapest" : isCheap ? "Cheap" : isBalanced ? "Balanced" : "Fast";
229
- const familyContract = isCheapest ? cheapestContractFor(opts.profile) : isBalanced ? balancedContractFor(opts.profile) : void 0;
230
- const oracleDescriptor = familyContract ? `${displayModelName(familyContract.oracleModel)} (200K/${familyContract.oracleEffort})` : isCheap ? "Grok 4.6 (200K/medium)" : "exact Opus 5.5 (1M/high)";
325
+ const isLocal = isLocalFamily(opts.profile);
326
+ const hasAdvisor = !isBalanced && !(isLocal && opts.profile !== "local2");
327
+ const hasOracle = !(isLocal && opts.profile === "local");
328
+ const advisorReviewerGranted = hasAdvisor && (isCheapest || isLocal);
329
+ const profileLabel = isLocal ? "Local" : isCheaplocalProfile(opts.profile) ? "Cheap local" : isCheapest ? "Cheapest" : isCheap ? "Cheap" : isBalanced ? "Balanced" : "Fast";
330
+ const familyContract = isCheapest ? cheapestContractFor(opts.profile) : isBalanced ? balancedContractFor(opts.profile) : isLocal ? localContractFor(opts.profile) : void 0;
331
+ const consultIsLocal = familyContract?.consultTransport === "local";
332
+ const oracleDescriptor = consultIsLocal ? "the local model" : familyContract ? `${displayModelName(familyContract.oracleModel)} (200K/${familyContract.oracleEffort})` : isCheap ? "Grok 4.6 (200K/medium)" : "exact Opus 5.5 (1M/high)";
231
333
  const astraDescriptor = isCheap && !isCheapest ? "200K/medium" : "200K/high";
232
- const expensiveModels = isCheapest || isBalanced ? "(reviewer, Oracle)" : "(Plan, reviewer, Oracle)";
233
- 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; expensive models " + expensiveModels + " see only the synthesized subset, never raw search output. " : opts.semanticSearchAvailable === true ? "Search strategy (cheapest first): (1) LOCAL LEXICAL `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 — expensive models " + expensiveModels + " see only the synthesized subset, never raw search output. " : "Search strategy (cheapest first): LOCAL LEXICAL `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 — expensive models " + expensiveModels + " see only the synthesized subset, never raw search output. ";
334
+ const subsetTail = isLocal && !hasOracle ? "`reviewer` sees only the synthesized subset, never raw search output." : `${isLocal || consultIsLocal ? "`reviewer` and Oracle" : `expensive models ${isCheapest || isBalanced || isLocal ? "(reviewer, Oracle)" : "(Plan, reviewer, Oracle)"}`} see only the synthesized subset, never raw search output.`;
335
+ const strategyOpener = isLocal ? "Search strategy (most direct first): " : "Search strategy (cheapest first): ";
336
+ const lexicalLabel = isLocal ? "LEXICAL" : "LOCAL LEXICAL";
337
+ 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
338
  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
339
 
236
340
  ${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 +343,20 @@ ${profileLabel} profile runtime wiring is unavailable. Work directly, use only t
239
343
  const browserKey = opts.groupKeys?.browser ?? "browser";
240
344
  const workersKey = opts.groupKeys?.workers ?? "workers";
241
345
  const browserClause = opts.browserToolsAvailable ?? opts.browseAvailable ? ` \`mcp__${browserKey}__*\` provides direct browser control.` : "";
242
- const workerBrowseClause = opts.browseAvailable ? ` \`worker-browse\` runs delegated autonomous browsing tasks through \`mcp__${workersKey}__browse\`.` : "";
346
+ const workerBrowseAvailable = opts.browseAvailable && !isLocal;
347
+ const workerBrowseClause = workerBrowseAvailable ? ` \`worker-browse\` runs delegated autonomous browsing tasks through \`mcp__${workersKey}__browse\`.` : "";
243
348
  const artifactClause = opts.artifactAvailable ? ` \`mcp__${peersKey}__artifact_*\` provides human review in the artifact panel with auto-open on plan completion.` : "";
244
349
  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 pipeline = isCheapest ? `${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; before presenting the final plan to the user, consult `advisor` once for a framing check. Work to your strengths as a fast, cost-efficient model: 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`; `Explore`, `reviewer`, and `worker-browse` cannot invoke native subagents.\n\nConsulting `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" : 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_search` (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; `Explore` and `worker-browse` 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`; `Explore`, `reviewer`, and `worker-browse` cannot invoke native subagents.\n\n";
246
- const windowNote = isCheapest || isBalanced ? "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" : "";
247
- const swePipelineClause = opts.sweEnabled === false ? "" : `${isCheapest || isBalanced ? PIPELINE_SKILLS_AWARENESS_NO_PLAN_AGENT : PIPELINE_SKILLS_AWARENESS}\n\n`;
248
- const consultation = isBalanced ? `Consultation guidance: funnel unknowns cheapest-first. (1) \`code_search\` and \`web\` search narrow scope and rule out hypotheses — always first. (2) \`Explore\` subagents for targeted breadth only when search is insufficient. \`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. Optimize for accuracy, intelligence, and correctness at the lowest cost — prefer direct evidence over delegation when the question is narrow. ` : `Consultation guidance: Follow an evidence-first escalation ladder. Direct empirical evidence (search, code, tests, builds) settles factual questions first. 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 ${isCheapest || isBalanced ? "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 ? "" : " `Plan` may consult Oracle on unresolved trade-offs, and reports any remaining tie-breaking gap to the lead."}${astraClause} `;
350
+ const leadLeaf = workerBrowseAvailable ? "`Explore`, `reviewer`, and `worker-browse`" : "`Explore` and `reviewer`";
351
+ const balancedLeaf = workerBrowseAvailable ? "`Explore` and `worker-browse`" : "`Explore`";
352
+ const disciplineOpener = isLocal ? "Execution discipline: " : "Work to your strengths as a fast, cost-efficient model: ";
353
+ 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 ? consultIsLocal ? CHEAPLOCAL_CONSULT_CONTRACT : 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";
354
+ const windowNote = isCheapest || isBalanced || isLocal ? (isCheaplocalProfile(opts.profile) ? "The lead and every native subagent run at a 200K context window" : "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" : "";
355
+ const swePipelineClause = opts.sweEnabled === false ? "" : `${isLocal ? PIPELINE_SKILLS_AWARENESS_LOCAL : isCheapest || isBalanced ? PIPELINE_SKILLS_AWARENESS_NO_PLAN_AGENT : PIPELINE_SKILLS_AWARENESS}\n\n`;
356
+ const oracleLeadOnly = isCheapest || isBalanced || isLocal;
357
+ const consultOpener = isLocal ? "Consultation guidance: verify claims against real evidence first. " : "Consultation guidance: funnel unknowns cheapest-first. ";
358
+ 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. ";
359
+ 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
360
  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
361
  }
251
362
  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 +368,29 @@ ${profileLabel} profile runtime wiring is unavailable. Work directly, use only t
257
368
  const OPERATING_DEFAULTS_DIRECTIVE = buildOperatingDefaultsDirective();
258
369
  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
370
  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";
371
+ 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
372
  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
373
  if (isPinnedLaunchProfile(opts.profile)) {
263
374
  const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
264
375
  const isCheapest = isCheapestFamily(opts.profile);
265
376
  const isBalanced = isBalancedFamily(opts.profile);
266
- const profileLabel = isCheapest ? "Cheapest" : isCheap ? "Cheap" : isBalanced ? "Balanced" : "Fast";
267
- const cheapestContract = isCheapest ? cheapestContractFor(opts.profile) : void 0;
268
- const balancedContract = isBalanced ? balancedContractFor(opts.profile) : void 0;
269
- const familyContract = cheapestContract ?? balancedContract;
270
- 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 advisorDescriptor = cheapestContract ? `(${displayModelName(cheapestContract.advisorModel)}/${cheapestContract.advisorEffort}, lead-only)` : "(Sol/high, lead-only)";
377
+ const isLocal = isLocalFamily(opts.profile);
378
+ const hasAdvisor = !isBalanced && !(isLocal && opts.profile !== "local2");
379
+ const hasOracle = !(isLocal && opts.profile === "local");
380
+ const advisorReviewerGranted = hasAdvisor && (isCheapest || isLocal);
381
+ const profileLabel = isLocal ? "Local" : isCheaplocalProfile(opts.profile) ? "Cheap local" : isCheapest ? "Cheapest" : isCheap ? "Cheap" : isBalanced ? "Balanced" : "Fast";
382
+ const familyContract = isCheapest ? cheapestContractFor(opts.profile) : isBalanced ? balancedContractFor(opts.profile) : isLocal ? localContractFor(opts.profile) : void 0;
383
+ const consultIsLocal = familyContract?.consultTransport === "local";
384
+ const oracleDescriptor = consultIsLocal ? "(local model, lead-only)" : 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)";
385
+ const advisorContract = isCheapest ? cheapestContractFor(opts.profile) : opts.profile === "local2" ? local2AdvisorContract() : void 0;
386
+ const advisorScope = advisorReviewerGranted ? "lead and `reviewer`, capped" : "lead-only";
387
+ const advisorDescriptor = consultIsLocal ? `(local model, ${advisorScope})` : advisorContract ? `(${displayModelName(advisorContract.advisorModel)}/${advisorContract.advisorEffort}, ${advisorScope})` : `(Sol/high, ${advisorScope})`;
272
388
  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 \`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\nConsulting \`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.
274
-
275
- ` : isBalanced ? `${profileLabel} launch profile. The lead owns planning, implementation, and verification by default: narrow scope first with \`code_search\` 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`;
276
- const consultationLadder = isBalanced ? "Verify claims against real evidence: run relevant commands and tests. Funnel unknowns cheapest-first: (1) `code_search` + `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. Optimize for accuracy, intelligence, and correctness at the lowest cost." : "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;
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" : "";
389
+ 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`;
390
+ 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) ";
391
+ const digestLadderTail = isLocal ? "Prefer direct evidence over delegation when the question is narrow." : "Optimize for accuracy, intelligence, and correctness at the lowest cost.";
392
+ 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;
393
+ const digestWindowNote = isCheapest || isBalanced || isLocal ? (isCheaplocalProfile(opts.profile) ? "The lead and every native subagent run at a 200K context window" : "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
394
  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
395
  }
280
396
  return STANDARD_OPERATING_DEFAULTS_DIGEST;
@@ -669,6 +785,6 @@ async function prependArtifactPanelDirectiveToMirroredClaudeMd(peersKey = "peers
669
785
  });
670
786
  }
671
787
  //#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, CHEAPEST_CONSULT_CONTRACT as t, renameWithRetry as u };
788
+ 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
789
 
674
- //# sourceMappingURL=claude-md-injection-Cpzolxin.js.map
790
+ //# sourceMappingURL=claude-md-injection-BtBG1RBZ.js.map