@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.
- package/.claude-plugin/marketplace.json +1 -1
- package/AGENTS.md +13 -12
- package/CHANGELOG.md +165 -0
- package/README.md +1 -1
- package/agents/templates/.ai-council.yml.example +55 -24
- package/dist/agent-src/commands/analyze/conformance.md +24 -0
- package/dist/agent-src/commands/cost/report.md +2 -2
- package/dist/agent-src/commands/team/adversarial.md +8 -7
- package/dist/agent-src/commands/team/delegate.md +13 -12
- package/dist/agent-src/commands/team/review.md +9 -8
- package/dist/agent-src/commands/team/status.md +9 -8
- package/dist/agent-src/commands/team.md +29 -19
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +88 -2
- package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +29 -21
- package/dist/agent-src/contexts/execution/host-capability-manifest.md +26 -15
- package/dist/agent-src/contexts/execution/orchestration-telemetry.md +28 -3
- package/dist/agent-src/contexts/execution/subagent-response-contract.md +54 -0
- package/dist/agent-src/contexts/execution/subagent-routing.md +13 -11
- package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +25 -0
- package/dist/agent-src/contexts/execution/subagent-steering.md +6 -3
- package/dist/agent-src/rules/artifact-engagement-recording.md +4 -1
- package/dist/agent-src/rules/autonomous-execution.md +1 -1
- package/dist/agent-src/rules/brand-source-of-truth.md +33 -6
- package/dist/agent-src/rules/context-hygiene.md +3 -1
- package/dist/agent-src/rules/council-availability.md +93 -0
- package/dist/agent-src/rules/cross-source-consistency.md +3 -0
- package/dist/agent-src/rules/delegation-policy.md +38 -10
- package/dist/agent-src/rules/design-fidelity.md +3 -0
- package/dist/agent-src/rules/evaluator-independence.md +2 -1
- package/dist/agent-src/rules/external-code-graph-interop.md +2 -1
- package/dist/agent-src/rules/finance-safety-floor.md +1 -1
- package/dist/agent-src/rules/git-history-discipline.md +1 -1
- package/dist/agent-src/rules/history-discipline.md +3 -1
- package/dist/agent-src/rules/legal-safety-floor.md +1 -1
- package/dist/agent-src/rules/no-pr-progress-comments.md +3 -1
- package/dist/agent-src/rules/onboarding-gate.md +3 -1
- package/dist/agent-src/rules/roadmap-ci-steps-policy.md +4 -1
- package/dist/agent-src/rules/role-mode-adherence.md +1 -1
- package/dist/agent-src/rules/scale-discipline.md +3 -1
- package/dist/agent-src/rules/self-repair-loop.md +103 -0
- package/dist/agent-src/rules/session-canary.md +2 -1
- package/dist/agent-src/rules/settings-ask-protocol.md +8 -7
- package/dist/agent-src/rules/strategy-safety-floor.md +1 -1
- package/dist/agent-src/rules/token-budget-discipline.md +4 -2
- package/dist/agent-src/rules/tool-safety.md +5 -1
- package/dist/agent-src/skills/adversarial-review/SKILL.md +1 -1
- package/dist/agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
- package/dist/agent-src/skills/forensics-report/SKILL.md +114 -0
- package/dist/agent-src/skills/forensics-report/evals/triggers.json +17 -0
- package/dist/agent-src/skills/performance-analysis/SKILL.md +1 -1
- package/dist/agent-src/skills/persona-improvement/SKILL.md +1 -1
- package/dist/agent-src/skills/premortem/SKILL.md +30 -1
- package/dist/agent-src/skills/project-analyzer/SKILL.md +1 -1
- package/dist/agent-src/skills/reasoning-orchestrator/SKILL.md +2 -1
- package/dist/agent-src/skills/security-audit/SKILL.md +1 -1
- package/dist/agent-src/skills/sequential-thinking/SKILL.md +1 -1
- package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +1 -1
- package/dist/agent-src/skills/subagent-orchestration/SKILL.md +7 -5
- package/dist/agent-src/skills/subagent-orchestration/schemas/subagent-status.json +61 -3
- package/dist/agent-src/skills/test-case-discovery/SKILL.md +1 -1
- package/dist/agent-src/skills/universal-project-analysis/SKILL.md +1 -1
- package/dist/agent-src/templates/AGENTS.md +8 -12
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/roadmaps.md +23 -0
- package/dist/cli/registry.js +7 -0
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli-delegate/chunk-66OVWGB5.js +270 -0
- package/dist/cli-delegate/{chunk-HJ6DAJHR.js → chunk-LCFJIQ4J.js} +89 -7
- package/dist/cli-delegate/{chunk-VSYT7OHO.js → chunk-LVRYBKTI.js} +31 -2
- package/dist/cli-delegate/{chunk-DVRS2KVR.js → chunk-MMXA5GY7.js} +10 -17
- package/dist/cli-delegate/{chunk-WR6GTRHJ.js → chunk-MP3JT3IU.js} +3 -3
- package/dist/cli-delegate/{chunk-3KJIMFTB.js → chunk-NZ5N2XQL.js} +467 -305
- package/dist/cli-delegate/{chunk-AIIUU73N.js → chunk-OJM3MBJM.js} +1 -1
- package/dist/cli-delegate/{chunk-BCPIOAGV.js → chunk-RCIA67XN.js} +117 -96
- package/dist/cli-delegate/chunk-REKCMYOU.js +2991 -0
- package/dist/cli-delegate/cmd_analyze_session.js +1 -1
- package/dist/cli-delegate/cmd_brand_status.js +134 -0
- package/dist/cli-delegate/cmd_conformance.js +10 -47
- package/dist/cli-delegate/cmd_converge.js +3 -3
- package/dist/cli-delegate/cmd_doctor.js +10 -6
- package/dist/cli-delegate/cmd_explain.js +80 -330
- package/dist/cli-delegate/cmd_export.js +6 -6
- package/dist/cli-delegate/cmd_fleet.js +3 -3
- package/dist/cli-delegate/cmd_handoff.js +3 -3
- package/dist/cli-delegate/cmd_mcp_available.js +433 -0
- package/dist/cli-delegate/cmd_migrate.js +3 -3
- package/dist/cli-delegate/cmd_packs_active.js +153 -0
- package/dist/cli-delegate/cmd_preflight.js +1 -1
- package/dist/cli-delegate/cmd_prune.js +6 -6
- package/dist/cli-delegate/cmd_route_audit.js +8 -8
- package/dist/cli-delegate/cmd_route_explain.js +4 -4
- package/dist/cli-delegate/cmd_settings_get.js +266 -0
- package/dist/cli-delegate/cmd_settings_migrate.js +6 -6
- package/dist/cli-delegate/cmd_settings_set.js +8 -2968
- package/dist/cli-delegate/cmd_sync.js +6 -6
- package/dist/cli-delegate/cmd_uninstall.js +6 -6
- package/dist/cli-delegate/cmd_update.js +4 -4
- package/dist/cli-delegate/cmd_upgrade.js +4 -4
- package/dist/cli-delegate/cmd_validate.js +6 -6
- package/dist/cli-delegate/cmd_versions.js +4 -4
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +164 -55
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +4 -3
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +44 -5
- package/dist/discovery/trust-report.md +11 -11
- package/dist/discovery/workspaces.json +16 -6
- package/dist/hooks/dispatch.js +9341 -6131
- package/dist/install/install.mjs +739 -524
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +777 -281
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/agent_settings.js +134 -15
- package/dist/scripts/_lib/agent_settings.js.map +1 -1
- package/dist/scripts/condense.js +147 -2
- package/dist/scripts/condense.js.map +1 -1
- package/dist/server/schemas/settings.js +6 -7
- package/dist/server/schemas/settings.js.map +1 -1
- package/dist/shared/settingsCarveOut.js +0 -9
- package/dist/shared/settingsCarveOut.js.map +1 -1
- package/dist/shared/settingsClasses.js +11 -9
- package/dist/shared/settingsClasses.js.map +1 -1
- package/dist/ui/assets/{index-DmR0mbk4.js → index-JDAF00bC.js} +2 -2
- package/dist/ui/assets/{index-DmR0mbk4.js.map → index-JDAF00bC.js.map} +1 -1
- package/dist/ui/index.html +1 -1
- package/docs/contracts/settings-classes.md +68 -17
- package/docs/guidelines/agent-infra/memory-access.md +14 -3
- package/package.json +1 -1
- package/src/agent-src/templates/AGENTS.md +8 -12
- package/src/config/agent-settings.template.yml +52 -66
- package/src/config/budgets.yml +29 -0
- package/src/config/discovery/packs.yml +11 -0
- package/src/config/discovery/workspaces.yml +1 -1
- package/src/config/evaluator-budgets.json +4 -4
- package/src/config/gate-coverage.yml +26 -0
- package/src/config/gate-violation-baselines.json +3 -3
- package/src/scripts/_cli/cmd_brand_status.ts +174 -0
- package/src/scripts/_cli/cmd_conformance.ts +14 -42
- package/src/scripts/_cli/cmd_doctor.ts +65 -48
- package/src/scripts/_cli/cmd_mcp_available.ts +266 -0
- package/src/scripts/_cli/cmd_packs_active.ts +225 -0
- package/src/scripts/_cli/cmd_settings_get.ts +324 -0
- package/src/scripts/_dispatch.bash +57 -0
- package/src/scripts/_lib/agent_settings.ts +140 -16
- package/src/scripts/_lib/auto_dispatch.corpus.test.ts +1 -1
- package/src/scripts/_lib/auto_dispatch.ts +23 -18
- package/src/scripts/_lib/capsule_trigger.ts +124 -0
- package/src/scripts/_lib/carrier_divergence.ts +135 -0
- package/src/scripts/_lib/host_capability.ts +144 -4
- package/src/scripts/_lib/judgment_ladder.ts +382 -0
- package/src/scripts/_lib/orchestration_gate.ts +8 -0
- package/src/scripts/_lib/orchestration_record.ts +37 -0
- package/src/scripts/_lib/orchestration_savings.ts +1 -1
- package/src/scripts/_lib/prompt_shape.ts +88 -0
- package/src/scripts/_lib/review_skipped_record.ts +102 -0
- package/src/scripts/_lib/rule_layer_overlap.ts +254 -0
- package/src/scripts/_lib/self_repair.ts +489 -0
- package/src/scripts/_lib/self_repair_store.ts +128 -0
- package/src/scripts/_lib/subagent_capsule.ts +182 -0
- package/src/scripts/_lib/subagent_response.ts +19 -0
- package/src/scripts/_lib/subagent_spawn.ts +13 -0
- package/src/scripts/_lib/subagent_steering.ts +9 -4
- package/src/scripts/_lib/tier_budget_routing.ts +6 -1
- package/src/scripts/_lib/transcript_entry.ts +80 -0
- package/src/scripts/_lib/worker_budget.ts +37 -2
- package/src/scripts/ai_council/clients.ts +76 -54
- package/src/scripts/ai_council/config.ts +94 -6
- package/src/scripts/ai_council/handoff.ts +113 -0
- package/src/scripts/ai_council/modes.ts +19 -4
- package/src/scripts/ai_council/orchestrator.ts +105 -0
- package/src/scripts/ai_council/quorum.ts +84 -0
- package/src/scripts/ai_council/session.ts +44 -0
- package/src/scripts/ai_council/transport_resolver.ts +127 -1
- package/src/scripts/ai_team/availability.ts +110 -0
- package/src/scripts/ai_team/config.ts +34 -14
- package/src/scripts/ai_team/team_dispatch.ts +71 -29
- package/src/scripts/bench_critic_protocol.ts +396 -0
- package/src/scripts/check_branch_freshness.ts +255 -0
- package/src/scripts/check_council_config_location.ts +125 -1
- package/src/scripts/check_detector_corpus.ts +202 -0
- package/src/scripts/check_hook_bundle_freshness.ts +4 -1
- package/src/scripts/check_standing_rule_delivery.ts +314 -0
- package/src/scripts/condense.ts +162 -2
- package/src/scripts/config/profiles.ts +13 -3
- package/src/scripts/conformance_scan.ts +272 -24
- package/src/scripts/council_availability_hook.ts +188 -0
- package/src/scripts/council_cli.ts +527 -32
- package/src/scripts/forensics_report.ts +333 -0
- package/src/scripts/hook_manifest.yaml +107 -26
- package/src/scripts/hooks/block_no_verify.ts +39 -2
- package/src/scripts/hooks/block_unauthorized_git.ts +156 -7
- package/src/scripts/hooks/concern_registry.ts +10 -0
- package/src/scripts/hooks/delegation_nudge_hook.ts +484 -0
- package/src/scripts/hooks/end_review_nudge_hook.ts +726 -0
- package/src/scripts/hooks/orchestration_record_hook.ts +342 -0
- package/src/scripts/install.ts +151 -0
- package/src/scripts/language_mirror_hook.ts +30 -37
- package/src/scripts/lint_discovery_vocabulary.ts +2 -0
- package/src/scripts/lint_never_silent.ts +276 -0
- package/src/scripts/lint_no_activation_gates.ts +271 -0
- package/src/scripts/measure_scope_dedup.ts +19 -13
- package/src/scripts/onboarding_gate_hook.ts +40 -1
- package/src/scripts/orchestration_record.ts +12 -1
- package/src/scripts/preamble_byte_census.ts +9 -20
- package/src/scripts/rebuild_hook_bundle.ts +177 -0
- package/src/scripts/release.ts +74 -2
- package/src/scripts/report_carrier_divergence.ts +364 -0
- package/src/scripts/report_skill_activation.ts +257 -0
- package/src/scripts/report_skill_obligation_violations.ts +579 -0
- package/src/scripts/routing_doctor.ts +95 -39
- package/src/scripts/score_skill_selection.ts +19 -5
- package/src/scripts/self_repair_cli.ts +470 -0
- package/src/scripts/self_repair_hook.ts +241 -0
- package/src/scripts/team_events_spike.ts +271 -0
- package/src/scripts/team_review_gate_hook.ts +31 -9
- package/src/server/schemas/settings.ts +10 -17
- package/src/shared/settingsCarveOut.ts +0 -10
- 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
|
-
|
|
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
|
-
|
|
103
|
-
|
|
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
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* exact reason. Read-only over
|
|
136
|
-
* new state. This closes the same
|
|
137
|
-
* incident exposed (policy present,
|
|
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
|
-
`
|
|
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
|
|
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
|
|
206
|
-
const
|
|
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 =
|
|
239
|
+
const host_manifest = probeHostCapabilities(platform);
|
|
209
240
|
const activationInputs: ActivationInputs = {
|
|
210
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
|
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(
|
|
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:
|
|
469
|
-
`
|
|
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({
|
|
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
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
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 =
|
|
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;
|