@event4u/agent-config 9.27.0 → 9.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/AGENTS.md +13 -12
  3. package/CHANGELOG.md +165 -0
  4. package/README.md +1 -1
  5. package/agents/templates/.ai-council.yml.example +55 -24
  6. package/dist/agent-src/commands/analyze/conformance.md +24 -0
  7. package/dist/agent-src/commands/cost/report.md +2 -2
  8. package/dist/agent-src/commands/team/adversarial.md +8 -7
  9. package/dist/agent-src/commands/team/delegate.md +13 -12
  10. package/dist/agent-src/commands/team/review.md +9 -8
  11. package/dist/agent-src/commands/team/status.md +9 -8
  12. package/dist/agent-src/commands/team.md +29 -19
  13. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +88 -2
  14. package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +29 -21
  15. package/dist/agent-src/contexts/execution/host-capability-manifest.md +26 -15
  16. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +28 -3
  17. package/dist/agent-src/contexts/execution/subagent-response-contract.md +54 -0
  18. package/dist/agent-src/contexts/execution/subagent-routing.md +13 -11
  19. package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +25 -0
  20. package/dist/agent-src/contexts/execution/subagent-steering.md +6 -3
  21. package/dist/agent-src/rules/artifact-engagement-recording.md +4 -1
  22. package/dist/agent-src/rules/autonomous-execution.md +1 -1
  23. package/dist/agent-src/rules/brand-source-of-truth.md +33 -6
  24. package/dist/agent-src/rules/context-hygiene.md +3 -1
  25. package/dist/agent-src/rules/council-availability.md +93 -0
  26. package/dist/agent-src/rules/cross-source-consistency.md +3 -0
  27. package/dist/agent-src/rules/delegation-policy.md +38 -10
  28. package/dist/agent-src/rules/design-fidelity.md +3 -0
  29. package/dist/agent-src/rules/evaluator-independence.md +2 -1
  30. package/dist/agent-src/rules/external-code-graph-interop.md +2 -1
  31. package/dist/agent-src/rules/finance-safety-floor.md +1 -1
  32. package/dist/agent-src/rules/git-history-discipline.md +1 -1
  33. package/dist/agent-src/rules/history-discipline.md +3 -1
  34. package/dist/agent-src/rules/legal-safety-floor.md +1 -1
  35. package/dist/agent-src/rules/no-pr-progress-comments.md +3 -1
  36. package/dist/agent-src/rules/onboarding-gate.md +3 -1
  37. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +4 -1
  38. package/dist/agent-src/rules/role-mode-adherence.md +1 -1
  39. package/dist/agent-src/rules/scale-discipline.md +3 -1
  40. package/dist/agent-src/rules/self-repair-loop.md +103 -0
  41. package/dist/agent-src/rules/session-canary.md +2 -1
  42. package/dist/agent-src/rules/settings-ask-protocol.md +8 -7
  43. package/dist/agent-src/rules/strategy-safety-floor.md +1 -1
  44. package/dist/agent-src/rules/token-budget-discipline.md +4 -2
  45. package/dist/agent-src/rules/tool-safety.md +5 -1
  46. package/dist/agent-src/skills/adversarial-review/SKILL.md +1 -1
  47. package/dist/agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
  48. package/dist/agent-src/skills/forensics-report/SKILL.md +114 -0
  49. package/dist/agent-src/skills/forensics-report/evals/triggers.json +17 -0
  50. package/dist/agent-src/skills/performance-analysis/SKILL.md +1 -1
  51. package/dist/agent-src/skills/persona-improvement/SKILL.md +1 -1
  52. package/dist/agent-src/skills/premortem/SKILL.md +30 -1
  53. package/dist/agent-src/skills/project-analyzer/SKILL.md +1 -1
  54. package/dist/agent-src/skills/reasoning-orchestrator/SKILL.md +2 -1
  55. package/dist/agent-src/skills/security-audit/SKILL.md +1 -1
  56. package/dist/agent-src/skills/sequential-thinking/SKILL.md +1 -1
  57. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +1 -1
  58. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +7 -5
  59. package/dist/agent-src/skills/subagent-orchestration/schemas/subagent-status.json +61 -3
  60. package/dist/agent-src/skills/test-case-discovery/SKILL.md +1 -1
  61. package/dist/agent-src/skills/universal-project-analysis/SKILL.md +1 -1
  62. package/dist/agent-src/templates/AGENTS.md +8 -12
  63. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  64. package/dist/agent-src/templates/roadmaps.md +23 -0
  65. package/dist/cli/registry.js +7 -0
  66. package/dist/cli/registry.js.map +1 -1
  67. package/dist/cli-delegate/chunk-66OVWGB5.js +270 -0
  68. package/dist/cli-delegate/{chunk-HJ6DAJHR.js → chunk-LCFJIQ4J.js} +89 -7
  69. package/dist/cli-delegate/{chunk-VSYT7OHO.js → chunk-LVRYBKTI.js} +31 -2
  70. package/dist/cli-delegate/{chunk-DVRS2KVR.js → chunk-MMXA5GY7.js} +10 -17
  71. package/dist/cli-delegate/{chunk-WR6GTRHJ.js → chunk-MP3JT3IU.js} +3 -3
  72. package/dist/cli-delegate/{chunk-3KJIMFTB.js → chunk-NZ5N2XQL.js} +467 -305
  73. package/dist/cli-delegate/{chunk-AIIUU73N.js → chunk-OJM3MBJM.js} +1 -1
  74. package/dist/cli-delegate/{chunk-BCPIOAGV.js → chunk-RCIA67XN.js} +117 -96
  75. package/dist/cli-delegate/chunk-REKCMYOU.js +2991 -0
  76. package/dist/cli-delegate/cmd_analyze_session.js +1 -1
  77. package/dist/cli-delegate/cmd_brand_status.js +134 -0
  78. package/dist/cli-delegate/cmd_conformance.js +10 -47
  79. package/dist/cli-delegate/cmd_converge.js +3 -3
  80. package/dist/cli-delegate/cmd_doctor.js +10 -6
  81. package/dist/cli-delegate/cmd_explain.js +80 -330
  82. package/dist/cli-delegate/cmd_export.js +6 -6
  83. package/dist/cli-delegate/cmd_fleet.js +3 -3
  84. package/dist/cli-delegate/cmd_handoff.js +3 -3
  85. package/dist/cli-delegate/cmd_mcp_available.js +433 -0
  86. package/dist/cli-delegate/cmd_migrate.js +3 -3
  87. package/dist/cli-delegate/cmd_packs_active.js +153 -0
  88. package/dist/cli-delegate/cmd_preflight.js +1 -1
  89. package/dist/cli-delegate/cmd_prune.js +6 -6
  90. package/dist/cli-delegate/cmd_route_audit.js +8 -8
  91. package/dist/cli-delegate/cmd_route_explain.js +4 -4
  92. package/dist/cli-delegate/cmd_settings_get.js +266 -0
  93. package/dist/cli-delegate/cmd_settings_migrate.js +6 -6
  94. package/dist/cli-delegate/cmd_settings_set.js +8 -2968
  95. package/dist/cli-delegate/cmd_sync.js +6 -6
  96. package/dist/cli-delegate/cmd_uninstall.js +6 -6
  97. package/dist/cli-delegate/cmd_update.js +4 -4
  98. package/dist/cli-delegate/cmd_upgrade.js +4 -4
  99. package/dist/cli-delegate/cmd_validate.js +6 -6
  100. package/dist/cli-delegate/cmd_versions.js +4 -4
  101. package/dist/discovery/deprecation-report.md +1 -1
  102. package/dist/discovery/discovery-manifest.json +164 -55
  103. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  104. package/dist/discovery/discovery-manifest.summary.md +4 -3
  105. package/dist/discovery/orphan-report.md +1 -1
  106. package/dist/discovery/packs.json +44 -5
  107. package/dist/discovery/trust-report.md +11 -11
  108. package/dist/discovery/workspaces.json +16 -6
  109. package/dist/hooks/dispatch.js +9341 -6131
  110. package/dist/install/install.mjs +739 -524
  111. package/dist/mcp/registry-manifest.json +3 -3
  112. package/dist/mcp/server.json +2 -2
  113. package/dist/mcp/server.mjs +777 -281
  114. package/dist/router.json +1 -1
  115. package/dist/scripts/_lib/agent_settings.js +134 -15
  116. package/dist/scripts/_lib/agent_settings.js.map +1 -1
  117. package/dist/scripts/condense.js +147 -2
  118. package/dist/scripts/condense.js.map +1 -1
  119. package/dist/server/schemas/settings.js +6 -7
  120. package/dist/server/schemas/settings.js.map +1 -1
  121. package/dist/shared/settingsCarveOut.js +0 -9
  122. package/dist/shared/settingsCarveOut.js.map +1 -1
  123. package/dist/shared/settingsClasses.js +11 -9
  124. package/dist/shared/settingsClasses.js.map +1 -1
  125. package/dist/ui/assets/{index-DmR0mbk4.js → index-JDAF00bC.js} +2 -2
  126. package/dist/ui/assets/{index-DmR0mbk4.js.map → index-JDAF00bC.js.map} +1 -1
  127. package/dist/ui/index.html +1 -1
  128. package/docs/contracts/settings-classes.md +68 -17
  129. package/docs/guidelines/agent-infra/memory-access.md +14 -3
  130. package/package.json +1 -1
  131. package/src/agent-src/templates/AGENTS.md +8 -12
  132. package/src/config/agent-settings.template.yml +52 -66
  133. package/src/config/budgets.yml +29 -0
  134. package/src/config/discovery/packs.yml +11 -0
  135. package/src/config/discovery/workspaces.yml +1 -1
  136. package/src/config/evaluator-budgets.json +4 -4
  137. package/src/config/gate-coverage.yml +26 -0
  138. package/src/config/gate-violation-baselines.json +3 -3
  139. package/src/scripts/_cli/cmd_brand_status.ts +174 -0
  140. package/src/scripts/_cli/cmd_conformance.ts +14 -42
  141. package/src/scripts/_cli/cmd_doctor.ts +65 -48
  142. package/src/scripts/_cli/cmd_mcp_available.ts +266 -0
  143. package/src/scripts/_cli/cmd_packs_active.ts +225 -0
  144. package/src/scripts/_cli/cmd_settings_get.ts +324 -0
  145. package/src/scripts/_dispatch.bash +57 -0
  146. package/src/scripts/_lib/agent_settings.ts +140 -16
  147. package/src/scripts/_lib/auto_dispatch.corpus.test.ts +1 -1
  148. package/src/scripts/_lib/auto_dispatch.ts +23 -18
  149. package/src/scripts/_lib/capsule_trigger.ts +124 -0
  150. package/src/scripts/_lib/carrier_divergence.ts +135 -0
  151. package/src/scripts/_lib/host_capability.ts +144 -4
  152. package/src/scripts/_lib/judgment_ladder.ts +382 -0
  153. package/src/scripts/_lib/orchestration_gate.ts +8 -0
  154. package/src/scripts/_lib/orchestration_record.ts +37 -0
  155. package/src/scripts/_lib/orchestration_savings.ts +1 -1
  156. package/src/scripts/_lib/prompt_shape.ts +88 -0
  157. package/src/scripts/_lib/review_skipped_record.ts +102 -0
  158. package/src/scripts/_lib/rule_layer_overlap.ts +254 -0
  159. package/src/scripts/_lib/self_repair.ts +489 -0
  160. package/src/scripts/_lib/self_repair_store.ts +128 -0
  161. package/src/scripts/_lib/subagent_capsule.ts +182 -0
  162. package/src/scripts/_lib/subagent_response.ts +19 -0
  163. package/src/scripts/_lib/subagent_spawn.ts +13 -0
  164. package/src/scripts/_lib/subagent_steering.ts +9 -4
  165. package/src/scripts/_lib/tier_budget_routing.ts +6 -1
  166. package/src/scripts/_lib/transcript_entry.ts +80 -0
  167. package/src/scripts/_lib/worker_budget.ts +37 -2
  168. package/src/scripts/ai_council/clients.ts +76 -54
  169. package/src/scripts/ai_council/config.ts +94 -6
  170. package/src/scripts/ai_council/handoff.ts +113 -0
  171. package/src/scripts/ai_council/modes.ts +19 -4
  172. package/src/scripts/ai_council/orchestrator.ts +105 -0
  173. package/src/scripts/ai_council/quorum.ts +84 -0
  174. package/src/scripts/ai_council/session.ts +44 -0
  175. package/src/scripts/ai_council/transport_resolver.ts +127 -1
  176. package/src/scripts/ai_team/availability.ts +110 -0
  177. package/src/scripts/ai_team/config.ts +34 -14
  178. package/src/scripts/ai_team/team_dispatch.ts +71 -29
  179. package/src/scripts/bench_critic_protocol.ts +396 -0
  180. package/src/scripts/check_branch_freshness.ts +255 -0
  181. package/src/scripts/check_council_config_location.ts +125 -1
  182. package/src/scripts/check_detector_corpus.ts +202 -0
  183. package/src/scripts/check_hook_bundle_freshness.ts +4 -1
  184. package/src/scripts/check_standing_rule_delivery.ts +314 -0
  185. package/src/scripts/condense.ts +162 -2
  186. package/src/scripts/config/profiles.ts +13 -3
  187. package/src/scripts/conformance_scan.ts +272 -24
  188. package/src/scripts/council_availability_hook.ts +188 -0
  189. package/src/scripts/council_cli.ts +527 -32
  190. package/src/scripts/forensics_report.ts +333 -0
  191. package/src/scripts/hook_manifest.yaml +107 -26
  192. package/src/scripts/hooks/block_no_verify.ts +39 -2
  193. package/src/scripts/hooks/block_unauthorized_git.ts +156 -7
  194. package/src/scripts/hooks/concern_registry.ts +10 -0
  195. package/src/scripts/hooks/delegation_nudge_hook.ts +484 -0
  196. package/src/scripts/hooks/end_review_nudge_hook.ts +726 -0
  197. package/src/scripts/hooks/orchestration_record_hook.ts +342 -0
  198. package/src/scripts/install.ts +151 -0
  199. package/src/scripts/language_mirror_hook.ts +30 -37
  200. package/src/scripts/lint_discovery_vocabulary.ts +2 -0
  201. package/src/scripts/lint_never_silent.ts +276 -0
  202. package/src/scripts/lint_no_activation_gates.ts +271 -0
  203. package/src/scripts/measure_scope_dedup.ts +19 -13
  204. package/src/scripts/onboarding_gate_hook.ts +40 -1
  205. package/src/scripts/orchestration_record.ts +12 -1
  206. package/src/scripts/preamble_byte_census.ts +9 -20
  207. package/src/scripts/rebuild_hook_bundle.ts +177 -0
  208. package/src/scripts/release.ts +74 -2
  209. package/src/scripts/report_carrier_divergence.ts +364 -0
  210. package/src/scripts/report_skill_activation.ts +257 -0
  211. package/src/scripts/report_skill_obligation_violations.ts +579 -0
  212. package/src/scripts/routing_doctor.ts +95 -39
  213. package/src/scripts/score_skill_selection.ts +19 -5
  214. package/src/scripts/self_repair_cli.ts +470 -0
  215. package/src/scripts/self_repair_hook.ts +241 -0
  216. package/src/scripts/team_events_spike.ts +271 -0
  217. package/src/scripts/team_review_gate_hook.ts +31 -9
  218. package/src/server/schemas/settings.ts +10 -17
  219. package/src/shared/settingsCarveOut.ts +0 -10
  220. package/src/shared/settingsClasses.ts +11 -9
@@ -53,7 +53,7 @@ import {
53
53
  import * as hooks_status from "./hooks_status.js";
54
54
  import { load_agent_settings } from "./_lib/agent_settings.js";
55
55
  import {
56
- normalizeHostManifest,
56
+ probeHostCapabilities,
57
57
  type HostCapabilityManifest,
58
58
  } from "./_lib/host_capability.js";
59
59
  import {
@@ -99,13 +99,25 @@ export interface FreshnessReport {
99
99
  }
100
100
 
101
101
  export interface OrchestrationReport {
102
- enabled: boolean;
103
- auto: string;
102
+ /** `emergency.orchestration_halt` — the one audited incident switch. */
103
+ halted: boolean;
104
104
  downshift: boolean;
105
- budget_routing: string;
106
105
  /** cost.budgets.per_tier ceilings + live cool-down state per tier. */
107
106
  tier_budgets: Record<string, { ceiling_usd: number | null; cooldown_until_ms: number }>;
108
107
  host_manifest: HostCapabilityManifest;
108
+ /**
109
+ * The host identifier the capability registry was keyed on, and whether it
110
+ * was OBSERVED (given via `--platform`) or merely ASSUMED (the CLI default).
111
+ *
112
+ * The doctor has no host detection: `main()` defaults to `claude`. Once
113
+ * capability resolution keys on that string, an assumed platform produces a
114
+ * confident-looking `subagent_spawn` for a host the user may not be on —
115
+ * so the assumption is reported next to the value it decided, and a reader
116
+ * can falsify it. Without this pair the misdiagnosis is invisible in the
117
+ * output, which is worse than the pre-registry bug it replaced.
118
+ */
119
+ host_platform: string;
120
+ host_platform_assumed: boolean;
109
121
  /** Verdict of the real activation gate for a canonical delegable probe. */
110
122
  activation: { action: string; reason: string };
111
123
  cost_budgets: Record<string, unknown>;
@@ -128,22 +140,19 @@ export interface OrchestrationReport {
128
140
  }
129
141
 
130
142
  /**
131
- * Adherence ≠ delivery: budget routing binds via policy prose, so the
132
- * doctor checks the DELIVERY evidence — orchestration audit lines that
133
- * carry a tier decision. Eligible dispatches recorded while
134
- * `budget_routing != off` but ZERO tier-carrying lines → WARN with the
135
- * exact reason. Read-only over agents/runtime/state/audit/*.jsonl; no
136
- * new state. This closes the same blind-spot class the session-canary
137
- * incident exposed (policy present, delivery silently absent).
143
+ * Adherence ≠ delivery: budget-aware tier routing has no on/off setting any
144
+ * more (always-on orchestration removed `subagents.budget_routing`), so the
145
+ * doctor always checks the DELIVERY evidence — orchestration audit lines
146
+ * that carry a tier decision. Dispatches recorded with ZERO tier-carrying
147
+ * lines → WARN with the exact reason. Read-only over
148
+ * agents/runtime/state/audit/*.jsonl; no new state. This closes the same
149
+ * blind-spot class the session-canary incident exposed (policy present,
150
+ * delivery silently absent).
138
151
  */
139
152
  export function check_budget_delivery(
140
153
  workspace_root: string,
141
- budget_routing: string,
142
154
  ): OrchestrationReport["delivery"] {
143
155
  const out = { eligible_dispatches: 0, budget_evidence_lines: 0, warning: "" };
144
- if (budget_routing === "off") {
145
- return out;
146
- }
147
156
  const auditDir = path.join(workspace_root, "agents", "runtime", "state", "audit");
148
157
  let files: string[] = [];
149
158
  try {
@@ -175,7 +184,7 @@ export function check_budget_delivery(
175
184
  }
176
185
  if (out.eligible_dispatches > 0 && out.budget_evidence_lines === 0) {
177
186
  out.warning =
178
- `budget_routing=${budget_routing} is policy-bound but shows no delivery evidence: ` +
187
+ `budget-aware tier routing shows no delivery evidence: ` +
179
188
  `${out.eligible_dispatches} orchestration dispatch(es) recorded, 0 carry a tier decision — ` +
180
189
  `the relation may not be running (adherence != delivery)`;
181
190
  }
@@ -194,25 +203,46 @@ export interface DoctorReport {
194
203
  /**
195
204
  * Orchestration-routing state: settings gates, host capability, budget
196
205
  * inputs, and (optionally) a dry-run classification for a sample prompt.
197
- * Read-only — mirrors exactly what the delegation layer would resolve.
206
+ * Read-only — it mirrors what the delegation layer resolves FOR `platform`.
207
+ * That qualifier is load-bearing: the hook reads its platform off a real
208
+ * envelope, this function is told one, and the two agree only when the
209
+ * caller was told the truth (see `platform_assumed`).
210
+ *
211
+ * `platform` is the host identifier the committed capability registry is
212
+ * keyed on — the same string a hook envelope's `platform` field carries.
213
+ * It is REQUIRED, not optional: resolving through `normalizeHostManifest`
214
+ * alone (as this function did until the registry landed) skips the registry
215
+ * row entirely, so on a fresh clone with no `subagents.host_capabilities`
216
+ * override the doctor reported `subagent_spawn: false` while
217
+ * `delegation_nudge_hook` — which does call `resolveHostCapabilities` —
218
+ * reported `true`. Two readers of one fact disagreeing is worse than either
219
+ * answer, and the diagnostic is the one a user runs precisely to check the
220
+ * other. A required parameter makes that regression uncompilable; an
221
+ * optional one only discourages it in a comment, and a comment has never
222
+ * failed a build.
223
+ *
224
+ * `platform_assumed` says whether the caller OBSERVED the host or guessed
225
+ * it. It is not decoration: keying the registry on a guessed host is how
226
+ * this function would trade the bug it fixed for a mirrored one.
198
227
  */
199
228
  export function collect_orchestration(
200
229
  workspace_root: string,
201
230
  sample_prompt: string | null,
231
+ platform: string,
232
+ platform_assumed: boolean,
202
233
  ): OrchestrationReport {
203
234
  const settings = load_agent_settings({ cwd: workspace_root });
204
235
  const sub = (settings["subagents"] ?? {}) as Record<string, unknown>;
205
- const enabled = sub["enabled"] !== false;
206
- const auto = typeof sub["auto"] === "string" ? (sub["auto"] as string) : "ask";
236
+ const emergency = (settings["emergency"] ?? {}) as Record<string, unknown>;
237
+ const halted = emergency["orchestration_halt"] === true;
207
238
  const downshift = sub["downshift"] !== false;
208
- const host_manifest = normalizeHostManifest(sub["host_capabilities"]);
239
+ const host_manifest = probeHostCapabilities(platform);
209
240
  const activationInputs: ActivationInputs = {
210
- enabled,
211
- auto: (auto === "on" || auto === "off" ? auto : "ask") as ActivationInputs["auto"],
241
+ halted,
212
242
  subagent_spawn: host_manifest.subagent_spawn,
213
243
  };
214
244
  // Canonical delegable probe: the gate verdict shows which activation
215
- // layer (settings / host primitive) decides on THIS installation.
245
+ // layer (emergency halt / host primitive) decides on THIS installation.
216
246
  const probe = classifyTask(
217
247
  { size_estimate: 5, independent_slices: 3 },
218
248
  activationInputs,
@@ -221,14 +251,6 @@ export function collect_orchestration(
221
251
  const cost_budgets = (cost["budgets"] ?? {}) as Record<string, unknown>;
222
252
  const tracking_dir = path.join(workspace_root, "agents", "cost-tracking");
223
253
  const ledger_present = fs.existsSync(path.join(tracking_dir, "sessions.jsonl"));
224
- // YAML 1.1 trap: an unquoted `off` parses as boolean false — coerce it
225
- // back to the enum string so the check honors the user's intent.
226
- const budget_routing =
227
- sub["budget_routing"] === false
228
- ? "off"
229
- : typeof sub["budget_routing"] === "string"
230
- ? (sub["budget_routing"] as string)
231
- : "ask";
232
254
  const per_tier = (cost_budgets["per_tier"] ?? {}) as Record<string, unknown>;
233
255
  const cooldowns = readCooldowns(tracking_dir);
234
256
  const tier_budgets: OrchestrationReport["tier_budgets"] = {};
@@ -254,17 +276,17 @@ export function collect_orchestration(
254
276
  };
255
277
  }
256
278
  return {
257
- enabled,
258
- auto,
279
+ halted,
259
280
  downshift,
260
- budget_routing,
261
281
  tier_budgets,
262
282
  host_manifest,
283
+ host_platform: platform,
284
+ host_platform_assumed: platform_assumed,
263
285
  activation: { action: probe.action, reason: probe.reason },
264
286
  cost_budgets,
265
287
  ledger_present,
266
288
  sample,
267
- delivery: check_budget_delivery(workspace_root, budget_routing),
289
+ delivery: check_budget_delivery(workspace_root),
268
290
  };
269
291
  }
270
292
 
@@ -410,6 +432,15 @@ function _freshness(no_freshness: boolean): FreshnessReport {
410
432
 
411
433
  export function collect_report(options: {
412
434
  platform: string;
435
+ /**
436
+ * True when `platform` is the CLI's fallback rather than a value the caller
437
+ * observed or passed. Optional so existing callers keep compiling, and
438
+ * defaulting to `true` on purpose: a caller that did not say where the
439
+ * platform came from has not established that it observed one, and the
440
+ * conservative reading is the one that shows the caveat rather than the one
441
+ * that hides it.
442
+ */
443
+ platform_assumed?: boolean;
413
444
  workspace_root: string;
414
445
  no_freshness: boolean;
415
446
  classify?: string | null;
@@ -440,7 +471,12 @@ export function collect_report(options: {
440
471
  chain: chain.map((c) => c.name),
441
472
  gates,
442
473
  freshness: _freshness(options.no_freshness),
443
- orchestration: collect_orchestration(options.workspace_root, options.classify ?? null),
474
+ orchestration: collect_orchestration(
475
+ options.workspace_root,
476
+ options.classify ?? null,
477
+ options.platform,
478
+ options.platform_assumed ?? true,
479
+ ),
444
480
  bridge_table,
445
481
  };
446
482
  }
@@ -465,10 +501,19 @@ function _render(report: DoctorReport): string {
465
501
  lines.push("");
466
502
  const o = report.orchestration;
467
503
  lines.push(
468
- `Orchestration: enabled=${o.enabled} · auto=${o.auto} · downshift=${o.downshift} · ` +
469
- `budget_routing=${o.budget_routing} · subagent_spawn=${o.host_manifest.subagent_spawn} · ` +
504
+ `Orchestration: halted=${o.halted} · downshift=${o.downshift} · ` +
505
+ `subagent_spawn=${o.host_manifest.subagent_spawn} ` +
506
+ `(host=${o.host_platform}${o.host_platform_assumed ? ", ASSUMED" : ", observed"}) · ` +
470
507
  `ledger=${o.ledger_present ? "present" : "absent"}`,
471
508
  );
509
+ if (o.host_platform_assumed) {
510
+ // Without this line the reader cannot tell a measured capability from one
511
+ // the registry produced for a host nobody checked they were on.
512
+ lines.push(
513
+ ` ⚠️ host not detected — '${o.host_platform}' is this command's default, ` +
514
+ `and the capability registry is keyed on it. Pass --platform <host> to check another.`,
515
+ );
516
+ }
472
517
  const tierBits = Object.entries(o.tier_budgets).map(([t, s]) => {
473
518
  const cap = s.ceiling_usd === null ? "no cap" : `$${s.ceiling_usd}`;
474
519
  const cool = s.cooldown_until_ms > 0 ? " COOLING" : "";
@@ -499,7 +544,11 @@ function _render(report: DoctorReport): string {
499
544
 
500
545
  export function main(argv?: string[]): number {
501
546
  const args = argv ?? process.argv.slice(2);
547
+ // The default is a guess, and since the capability registry is keyed on it
548
+ // the guess now decides `subagent_spawn`. Track where the value came from so
549
+ // the report can say so — there is no host detection here to replace it with.
502
550
  let platform = "claude";
551
+ let platform_assumed = true;
503
552
  let workspace_root = process.cwd();
504
553
  let json = false;
505
554
  let strict = false;
@@ -509,6 +558,7 @@ export function main(argv?: string[]): number {
509
558
  const a = args[i];
510
559
  if (a === "--platform" && args[i + 1]) {
511
560
  platform = String(args[(i += 1)]);
561
+ platform_assumed = false;
512
562
  } else if (a === "--workspace" && args[i + 1]) {
513
563
  workspace_root = path.resolve(String(args[(i += 1)]));
514
564
  } else if (a === "--classify" && args[i + 1]) {
@@ -521,7 +571,13 @@ export function main(argv?: string[]): number {
521
571
  no_freshness = true;
522
572
  }
523
573
  }
524
- const report = collect_report({ platform, workspace_root, no_freshness, classify });
574
+ const report = collect_report({
575
+ platform,
576
+ platform_assumed,
577
+ workspace_root,
578
+ no_freshness,
579
+ classify,
580
+ });
525
581
  if (json) {
526
582
  process.stdout.write(`${JSON.stringify(report as unknown as JsonValue, null, 2)}\n`);
527
583
  } else {
@@ -19,10 +19,22 @@
19
19
  * pass = (a) >= 0.90 OR (b) >= 0.95
20
20
  * fail = (a) < 0.80 AND (b) < 0.80 → cluster needs `routes_to`
21
21
  *
22
- * NOTE: the .py reads the legacy `.agent-src.uncondensed/skills` literal;
23
- * this faithful twin replicates it byte-for-byte. When inputs are missing
24
- * the .py raises an uncaught FileNotFoundError → exit 1; this twin mirrors
25
- * that by throwing.
22
+ * REPOINTED 2026-08-09 (P2.2 of road-to-rule-delivery-integrity). The original
23
+ * read the uncondensed legacy skills tree, faithfully replicating a `.py` twin —
24
+ * but ADR-051 retired that tree as dead and it does not exist in this checkout.
25
+ * A scorer pointed at a missing directory does not fail: its glob yields
26
+ * nothing, every fixture scores against an empty skill set, and the output is a
27
+ * baseline of silent zeros. That is worse than an error, because a baseline is
28
+ * exactly what P2.2's pre-registered criteria compare against — the measurement
29
+ * would have been void and would have looked fine.
30
+ *
31
+ * Now reads `SRC_SKILLS()` from the shared resolver. `dist/agent-src/skills`
32
+ * would be equally valid (ADR-201 makes the projection a byte-exact copy, so
33
+ * the frontmatter is identical); `src/` is chosen because it is the source of
34
+ * truth and is present even before a sync.
35
+ *
36
+ * When inputs are missing the original raised an uncaught FileNotFoundError →
37
+ * exit 1; this twin mirrors that by throwing.
26
38
  */
27
39
 
28
40
  import * as fs from 'node:fs';
@@ -30,12 +42,14 @@ import * as path from 'node:path';
30
42
  import { fileURLToPath, pathToFileURL } from 'node:url';
31
43
  import { parse as parseYaml } from 'yaml';
32
44
 
45
+ import { SRC_SKILLS } from './_lib/agent_src.js';
46
+
33
47
  const _HERE = fileURLToPath(import.meta.url);
34
48
  // src/scripts/score_skill_selection.ts → parents[2] is the repo root.
35
49
  const REPO_ROOT = path.resolve(path.dirname(_HERE), '..', '..');
36
50
  const FIXTURES = path.join(REPO_ROOT, 'tests', 'fixtures', 'skill_selection', 'fixtures.yml');
37
51
  const CLUSTERS = path.join(REPO_ROOT, 'agents', 'reports', 'skill-collision-clusters.json');
38
- const SKILLS_DIR = path.join(REPO_ROOT, '.agent-src.uncondensed', 'skills');
52
+ const SKILLS_DIR = SRC_SKILLS();
39
53
  const DEFAULT_OUT = path.join(REPO_ROOT, 'agents', 'reports', 'skill-selection-accuracy.json');
40
54
 
41
55
  const PASS_A = 0.9;