@event4u/agent-config 9.28.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 +6 -6
- package/CHANGELOG.md +66 -0
- package/README.md +1 -1
- package/agents/templates/.ai-council.yml.example +55 -24
- 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 +18 -0
- 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/delegation-policy.md +11 -7
- package/dist/agent-src/rules/settings-ask-protocol.md +8 -7
- package/dist/agent-src/rules/token-budget-discipline.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/premortem/SKILL.md +30 -1
- package/dist/agent-src/skills/reasoning-orchestrator/SKILL.md +2 -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/templates/AGENTS.md +4 -4
- 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-delegate/{chunk-22GCIJ2O.js → chunk-66OVWGB5.js} +1 -1
- package/dist/cli-delegate/{chunk-GB2FSUEE.js → chunk-LCFJIQ4J.js} +32 -0
- 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-JXARCGVN.js → chunk-MP3JT3IU.js} +1 -1
- package/dist/cli-delegate/{chunk-PQSAQKHW.js → chunk-NZ5N2XQL.js} +3 -3
- package/dist/cli-delegate/{chunk-7OMQCH4V.js → chunk-OJM3MBJM.js} +1 -1
- package/dist/cli-delegate/{chunk-2BE5I2MN.js → chunk-RCIA67XN.js} +111 -90
- package/dist/cli-delegate/cmd_analyze_session.js +1 -1
- package/dist/cli-delegate/cmd_brand_status.js +1 -1
- package/dist/cli-delegate/cmd_conformance.js +6 -43
- package/dist/cli-delegate/cmd_doctor.js +9 -5
- package/dist/cli-delegate/cmd_explain.js +2 -2
- package/dist/cli-delegate/cmd_export.js +4 -4
- package/dist/cli-delegate/cmd_handoff.js +3 -3
- package/dist/cli-delegate/cmd_mcp_available.js +1 -1
- package/dist/cli-delegate/cmd_migrate.js +2 -2
- package/dist/cli-delegate/cmd_packs_active.js +2 -2
- package/dist/cli-delegate/cmd_prune.js +4 -4
- package/dist/cli-delegate/cmd_route_audit.js +2 -2
- package/dist/cli-delegate/cmd_route_explain.js +1 -1
- package/dist/cli-delegate/cmd_settings_get.js +1 -7
- package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
- package/dist/cli-delegate/cmd_settings_set.js +1 -1
- package/dist/cli-delegate/cmd_sync.js +4 -4
- package/dist/cli-delegate/cmd_uninstall.js +4 -4
- package/dist/cli-delegate/cmd_update.js +1 -1
- package/dist/cli-delegate/cmd_upgrade.js +1 -1
- package/dist/cli-delegate/cmd_validate.js +4 -4
- package/dist/cli-delegate/cmd_versions.js +1 -1
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +69 -20
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +3 -2
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +39 -2
- package/dist/discovery/trust-report.md +2 -2
- package/dist/discovery/workspaces.json +12 -4
- package/dist/hooks/dispatch.js +373 -35
- package/dist/install/install.mjs +42 -17
- package/dist/mcp/registry-manifest.json +2 -2
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +651 -262
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/agent_settings.js +54 -0
- 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 +39 -9
- package/package.json +1 -1
- package/src/agent-src/templates/AGENTS.md +4 -4
- package/src/config/agent-settings.template.yml +52 -66
- package/src/config/discovery/packs.yml +11 -0
- package/src/config/discovery/workspaces.yml +1 -1
- package/src/config/gate-violation-baselines.json +3 -3
- package/src/scripts/_cli/cmd_conformance.ts +14 -42
- package/src/scripts/_cli/cmd_doctor.ts +65 -48
- package/src/scripts/_lib/agent_settings.ts +58 -0
- 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/host_capability.ts +63 -6
- 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/self_repair.ts +160 -13
- package/src/scripts/_lib/self_repair_store.ts +28 -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/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_detector_corpus.ts +202 -0
- package/src/scripts/check_hook_bundle_freshness.ts +4 -1
- package/src/scripts/condense.ts +162 -2
- package/src/scripts/council_cli.ts +401 -25
- package/src/scripts/forensics_report.ts +333 -0
- package/src/scripts/hooks/delegation_nudge_hook.ts +69 -35
- 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/orchestration_record.ts +8 -0
- package/src/scripts/rebuild_hook_bundle.ts +177 -0
- package/src/scripts/release.ts +74 -2
- package/src/scripts/routing_doctor.ts +21 -36
- package/src/scripts/score_skill_selection.ts +19 -5
- package/src/scripts/self_repair_cli.ts +287 -57
- 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
|
@@ -44,8 +44,10 @@ dwarfs the work). Below the floor → in-session.
|
|
|
44
44
|
|
|
45
45
|
- Trivial / single-step edits below the size floor.
|
|
46
46
|
- Tasks with cross-step shared mutable state that cannot be sliced.
|
|
47
|
-
- Anything that fails to match a signal above
|
|
48
|
-
|
|
47
|
+
- Anything that fails to match a signal above, once past the activation gate
|
|
48
|
+
and the size floor, is **ambiguous** → **ask**, always — a verdict to the
|
|
49
|
+
user, never a speculative spawn (always-on orchestration: there is no more
|
|
50
|
+
`subagents.auto` setting to route this on).
|
|
49
51
|
|
|
50
52
|
## Mode selection summary
|
|
51
53
|
|
|
@@ -55,6 +57,76 @@ dwarfs the work). Below the floor → in-session.
|
|
|
55
57
|
| `parallelizable: files\|independent` / independent slices | `do-in-parallel` |
|
|
56
58
|
| change needing verification (any of the above) | implementer + cross-model judge per the `subagent-orchestration` Iron Law |
|
|
57
59
|
|
|
60
|
+
## Judgment ladder (Phase 2 — road-to-always-on-orchestration)
|
|
61
|
+
|
|
62
|
+
One committed table replacing three scattered classification surfaces
|
|
63
|
+
(the delegable-signal rules above, ad-hoc "should this be a team" calls,
|
|
64
|
+
and the absence of any council-routing signal on the task side). Resolver:
|
|
65
|
+
[`judgment_ladder.ts`](../../../../src/scripts/_lib/judgment_ladder.ts)
|
|
66
|
+
(`classifyLadder`) — a WRAPPER around `classifyTask`, never a replacement:
|
|
67
|
+
rungs 1 and 2 ARE `classifyTask`'s existing dispatch verdict.
|
|
68
|
+
|
|
69
|
+
| Rung | Shape signals | Resolves to |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| 0 | mechanical transform, no semantics (rename / codemod / formatter-run / bulk search-and-replace), OR a lookup-class match (§ Lookup-class rung above) | deterministic script, no spawn |
|
|
72
|
+
| 1 | single bounded read-heavy slice (`classifyTask` structurally cannot see this — it requires ≥2 slices, an ordered plan, or a declared `parallelizable` value) | one subagent, `lite` tier |
|
|
73
|
+
| 2 | enumerable independent slices, or an ordered plan (`classifyTask` dispatch: `do-in-parallel` / `do-in-steps` both land here in this v1 — see the resolver's doc comment for why) | parallel subagents, downshifted |
|
|
74
|
+
| 3 | slices that must communicate (cross-layer work, a review-with-challenge shape, an explicit shared task list) | team — only when the host reports `agent_teams: true`; else degrades to whatever `classifyTask` resolves on the same signals (usually rung 2), with a recorded `degraded_from: 3` line — never a fabricated slice count |
|
|
75
|
+
| 4 | judgment under disagreement (a design decision, a proposed security downgrade, a release-gate escalation) | council |
|
|
76
|
+
| ∅ | interactive-approval-required (caller-stated), trivial (below the size floor), or ambiguous | in-session; ambiguity is an `ask` VERDICT, never a speculative spawn |
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
AMBIGUITY NEVER SPAWNS. RUNG 0 NEVER SPAWNS EITHER — IT NEVER NEEDED TO.
|
|
80
|
+
A MATCHED RUNG-3/4 SIGNAL WITHOUT ITS HOST PRECONDITION DEGRADES,
|
|
81
|
+
RECORDED — IT NEVER SILENTLY DROPS TO ∅.
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Resolution order is fixed and documented on `classifyLadder` itself**:
|
|
85
|
+
interactive-approval-required → rung 0 → recursive-dispatch guard →
|
|
86
|
+
activation gate → rung 4 → rung 3 (+ degrade) → rungs 1/2. Two signals
|
|
87
|
+
matching the same text resolve deterministically on this order, never on
|
|
88
|
+
evaluation-order accident.
|
|
89
|
+
|
|
90
|
+
**Recursive-dispatch guard (2.3) — honest scope.** No verified host
|
|
91
|
+
discriminator exists for "is this classification running inside a
|
|
92
|
+
subagent/teammate session" — this roadmap's own `point-of-action-carrier`
|
|
93
|
+
blocker records the upstream PreToolUse agent-identity request as closed
|
|
94
|
+
NOT_PLANNED, and no field in this repo's hook envelope carries session
|
|
95
|
+
lineage. The guard is therefore a CALLER-SUPPLIED fact
|
|
96
|
+
(`insideSubagentSession`), never a `process.env` probe for an unverified
|
|
97
|
+
variable name — the same "no discriminator is publishable" null the
|
|
98
|
+
`point-of-action-carrier` blocker already names. When set, it resolves ∅
|
|
99
|
+
(in-session) for rungs 1-4; rung 0 is exempt (it never spawns).
|
|
100
|
+
|
|
101
|
+
**Relationship to the council's own necessity gate.** Rung 4's three
|
|
102
|
+
signals (design decision / security downgrade / release-gate escalation)
|
|
103
|
+
are a deliberately narrow, TASK-side vocabulary — NOT an import of
|
|
104
|
+
`ai_council/necessity.ts`'s broader `NECESSARY_TRIGGERS`
|
|
105
|
+
(architecture/tradeoff/ambiguity/strategic). That module stays the
|
|
106
|
+
council's own necessity gate (its `off|educate|block|warn-only` modes are
|
|
107
|
+
the council-side surface); this resolver only decides whether a TASK
|
|
108
|
+
should route to rung 4 in the first place.
|
|
109
|
+
|
|
110
|
+
## Cheapest-sufficient-model table (Phase 2.4 — the ladder's tie-breaker)
|
|
111
|
+
|
|
112
|
+
Once a slice resolves to rung 1 or 2, this table is the tie-breaker
|
|
113
|
+
`classifyLadder`'s caller consults for the concrete tier — `lite` by
|
|
114
|
+
default, escalating only on a named criterion. Consolidates mechanisms that
|
|
115
|
+
already exist elsewhere in this contract set; this table is the ONE place
|
|
116
|
+
that lists them side by side.
|
|
117
|
+
|
|
118
|
+
| Escalation criterion | Tier | Basis |
|
|
119
|
+
|---|---|---|
|
|
120
|
+
| (none — default) | `lite` | the downshift default (`subagent-routing.md`) |
|
|
121
|
+
| Slice failed verification on its current tier | next tier up (`lite`→`medium`→`medium`→`high`) | [`subagent-steering`](subagent-steering.md) § Verify-fail escalation cascade |
|
|
122
|
+
| Slice touches ≥ 5 files (or > 200 lines) | `medium` | the ticket-bundle `lite` size floor (`docs/contracts/ticket-bundle-format.md`) |
|
|
123
|
+
| Architecture-shaped slice (structural/boundary decision — the same shape as rung 4's design-decision signal, one level down in stakes) | `medium` | [`subagent-modes-detail`](subagent-modes-detail.md) § Severity-conditioned team composition |
|
|
124
|
+
| Security-sensitive slice (auth, tenant, secrets, billing — `security-sensitive-stop`'s surface table) | `high` | [`subagent-modes-detail`](subagent-modes-detail.md) § Critical severity row |
|
|
125
|
+
|
|
126
|
+
Criteria are independent and additive in the obvious way (a slice matching
|
|
127
|
+
two rows takes the higher of the two tiers); this table never lowers a
|
|
128
|
+
tier `inferSliceTier` (§ below) already raised.
|
|
129
|
+
|
|
58
130
|
## Per-slice tier inference (v1.5 — deterministic, task-TYPE-keyed)
|
|
59
131
|
|
|
60
132
|
Once a slice is classified **delegable**, a second deterministic table infers
|
|
@@ -174,8 +246,22 @@ and the lookup corpus in
|
|
|
174
246
|
[`src/scripts/_lib/auto_dispatch.corpus.test.ts`](../../../../src/scripts/_lib/auto_dispatch.corpus.test.ts)
|
|
175
247
|
(`LOOKUP_CORPUS` — the four live-observed shapes + negative controls).
|
|
176
248
|
|
|
249
|
+
The judgment ladder (§ above) is encoded in
|
|
250
|
+
[`src/scripts/_lib/judgment_ladder.ts`](../../../../src/scripts/_lib/judgment_ladder.ts)
|
|
251
|
+
(`classifyLadder`, plus the rung-0/1/3/4 signal-detection functions), covered
|
|
252
|
+
by
|
|
253
|
+
[`tests/scripts/_lib_judgment_ladder.test.ts`](../../../../tests/scripts/_lib_judgment_ladder.test.ts)
|
|
254
|
+
(every rung, the rung-3 degrade path, the recursive-dispatch guard, and every
|
|
255
|
+
∅ case). The delegation-nudge hook
|
|
256
|
+
([`delegation_nudge_hook.ts`](../../../../src/scripts/hooks/delegation_nudge_hook.ts))
|
|
257
|
+
is its first production caller — its injected line cites the resolved rung
|
|
258
|
+
(`rung-2: dispatch do-in-parallel …`), scoped to the subagent dispatch rungs
|
|
259
|
+
(1/2); a rung-0/3/4 verdict stays silent on this carrier until Phase 3/4 give
|
|
260
|
+
team/council their own.
|
|
261
|
+
|
|
177
262
|
## Related
|
|
178
263
|
|
|
179
264
|
- [`auto-orchestration-activation`](auto-orchestration-activation.md) — the enable/auto/manifest gate that runs before classification.
|
|
180
265
|
- [`subagent-orchestration`](../../skills/subagent-orchestration/SKILL.md) — the modes this selects.
|
|
181
266
|
- [`autonomous-execution`](../../rules/autonomous-execution.md) — the N=3 budget any LLM-classification v2 must respect.
|
|
267
|
+
- [`orchestration-telemetry`](orchestration-telemetry.md) § Registered always-on metrics — the judgment-ladder precision metric this ladder feeds.
|
|
@@ -1,55 +1,62 @@
|
|
|
1
1
|
# Auto-Orchestration Activation
|
|
2
2
|
|
|
3
|
-
How
|
|
4
|
-
subagent dispatch at runtime. Companion to
|
|
3
|
+
How automatic subagent dispatch resolves at runtime. Companion to
|
|
5
4
|
[`subagent-configuration`](../subagent-configuration.md) (which covers the
|
|
6
5
|
model / parallelism keys) and
|
|
7
6
|
[`host-capability-manifest`](host-capability-manifest.md) (which decides
|
|
8
7
|
whether dispatch is physically possible on the host).
|
|
9
8
|
|
|
9
|
+
Always-on orchestration (road-to-always-on-orchestration, Phase 1): the layer
|
|
10
|
+
carries no per-run on/off setting. `subagents.enabled`, `subagents.auto`, and
|
|
11
|
+
`subagents.host_capabilities` were removed from `.agent-settings.yml` — a
|
|
12
|
+
fresh install with an empty settings file activates on any capable host.
|
|
13
|
+
Activation now reads only two facts: whether the emergency incident switch is
|
|
14
|
+
set, and what the host can physically do.
|
|
15
|
+
|
|
10
16
|
## Settings
|
|
11
17
|
|
|
12
18
|
| Key | Default | Purpose |
|
|
13
19
|
|---|---|---|
|
|
14
|
-
| `subagents.enabled` | `true` | Global master switch. `false` = the whole layer is off — the canonical kill-switch. No auto-dispatch, no routing, everything runs in-session. |
|
|
15
|
-
| `subagents.auto` | `on` | Auto-dispatch mode: `off` \| `ask` \| `on`. Shipped default `on` on subagent-capable hosts (flipped from `ask` 2026-07-09, ADR-117), `off` elsewhere. |
|
|
16
20
|
| `subagents.downshift` | `true` | Route delegable sub-tasks to the lowest-capable tier (Phase 2). |
|
|
17
21
|
| `subagents.quota_arbitrage` | `true` | Prefer a separate-quota-pool model where the host manifest allows it (Phase 2 bonus). |
|
|
18
22
|
| `subagents.model_map` | `{}` | Optional per-tier model override for downshift routing. |
|
|
19
|
-
| `
|
|
23
|
+
| `emergency.orchestration_halt` | `false` | The ONE audited incident switch — see [`settings-classes.md`](../../../../docs/contracts/settings-classes.md) § "The one exception". NOT an activation gate: on-by-default, ceremony-free to arm, requires a non-empty `orchestration_halt_justification` to disarm. |
|
|
20
24
|
|
|
21
25
|
## Activation decision
|
|
22
26
|
|
|
23
27
|
For any task, auto-dispatch is attempted **only when all hold**:
|
|
24
28
|
|
|
25
29
|
```
|
|
26
|
-
|
|
27
|
-
AND subagents.auto != off
|
|
30
|
+
emergency.orchestration_halt != true
|
|
28
31
|
AND host_manifest.subagent_spawn == true
|
|
29
32
|
AND the task is classified delegable (see auto-dispatch-classification.md)
|
|
30
33
|
```
|
|
31
34
|
|
|
32
35
|
If any condition fails → **in-session execution**, no subagent. This is the
|
|
33
|
-
safe path:
|
|
36
|
+
safe path: an unresolved host capability, an active incident halt, or an
|
|
34
37
|
unclassifiable task all degrade silently to single-agent.
|
|
35
38
|
|
|
36
|
-
##
|
|
39
|
+
## Verdict behaviour
|
|
37
40
|
|
|
38
|
-
|
|
|
39
|
-
|
|
40
|
-
| `
|
|
41
|
-
| `ask`
|
|
42
|
-
|
|
|
41
|
+
| Task shape | Verdict |
|
|
42
|
+
|---|---|
|
|
43
|
+
| A matched delegable signal | `dispatch` — surface the chosen mode + per-subtask tiers in one line, never silent |
|
|
44
|
+
| No enumerated signal (ambiguous) | `ask` — a verdict to the user, never a speculative spawn |
|
|
45
|
+
| Below the size floor, halted, or no host primitive | in-session |
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
There is no more `off`/`ask`/`on` MODE setting driving this table — the row a
|
|
48
|
+
task lands on is a property of the task and the host, not a configuration
|
|
49
|
+
choice.
|
|
46
50
|
|
|
47
51
|
## Resolution order
|
|
48
52
|
|
|
49
|
-
1.
|
|
53
|
+
1. Resolve the emergency halt from settings once per run; cache for the run,
|
|
50
54
|
mirroring [`subagent-configuration § When settings change`](../subagent-configuration.md).
|
|
51
|
-
2. Resolve the host-capability manifest once (cached)
|
|
52
|
-
|
|
55
|
+
2. Resolve the host-capability manifest once (cached) via
|
|
56
|
+
`probeHostCapabilities` — the committed registry row merged with
|
|
57
|
+
observable environment facts. Per
|
|
58
|
+
[`host-capability-manifest`](host-capability-manifest.md), a settings
|
|
59
|
+
override no longer participates in production resolution.
|
|
53
60
|
3. Apply the activation decision above per task.
|
|
54
61
|
|
|
55
62
|
## Safety floors are never lifted
|
|
@@ -57,8 +64,9 @@ per-subtask tiers are surfaced before/at dispatch — never silent.
|
|
|
57
64
|
Auto-dispatch never bypasses a floor. The cross-model judge Iron Law
|
|
58
65
|
(`subagent-orchestration`), `verify-before-complete`, the N=3 autonomous
|
|
59
66
|
budget, `scope-control`, and `non-destructive-by-default` all apply to
|
|
60
|
-
auto-delegated work exactly as they do to in-session work.
|
|
61
|
-
disables the layer
|
|
67
|
+
auto-delegated work exactly as they do to in-session work.
|
|
68
|
+
`emergency.orchestration_halt: true` disables the layer for the duration of an
|
|
69
|
+
incident; it never disables a floor.
|
|
62
70
|
|
|
63
71
|
## Related
|
|
64
72
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Host-Capability Manifest
|
|
2
2
|
|
|
3
|
-
Resolved once per session
|
|
4
|
-
cached for the rest of the session. Tells the orchestration
|
|
5
|
-
subagent primitives the current host actually exposes, so
|
|
6
|
-
attempts a primitive the host cannot run.
|
|
3
|
+
Resolved once per session (via `probeHostCapabilities`, not a long-running
|
|
4
|
+
process) and cached for the rest of the session. Tells the orchestration
|
|
5
|
+
layer which subagent primitives the current host actually exposes, so
|
|
6
|
+
auto-dispatch never attempts a primitive the host cannot run.
|
|
7
7
|
|
|
8
8
|
## Schema
|
|
9
9
|
|
|
@@ -15,19 +15,30 @@ A single JSON object, `schema_version: 1`:
|
|
|
15
15
|
"subagent_spawn": false,
|
|
16
16
|
"parallel_spawn": false,
|
|
17
17
|
"status_polling": false,
|
|
18
|
-
"separate_quota_pool": false
|
|
18
|
+
"separate_quota_pool": false,
|
|
19
|
+
"agent_teams": false
|
|
19
20
|
}
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|
## Resolution
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
`probeHostCapabilities(hostId)` (`src/scripts/_lib/host_capability.ts`) fills
|
|
26
|
+
the manifest from OBSERVABLE FACTS ONLY — capability is a fact about the
|
|
27
|
+
host, never a configuration decision (always-on orchestration, Phase 1):
|
|
25
28
|
|
|
26
|
-
1. The
|
|
27
|
-
subagent primitives.
|
|
28
|
-
2.
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
1. The committed `HOST_CAPABILITY_REGISTRY` row for the detected host — the
|
|
30
|
+
agent's own knowledge of documented subagent primitives.
|
|
31
|
+
2. A live environment probe merged on top: `agent_teams` resolves `true`
|
|
32
|
+
when `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` is set in the process
|
|
33
|
+
environment — the one host fact this repo can observe about Claude
|
|
34
|
+
Code's experimental multi-instance Agent Teams feature.
|
|
35
|
+
3. `SAFE_DEFAULT` (all `false`) for an unrecognized host or an unset probe.
|
|
36
|
+
|
|
37
|
+
`resolveHostCapabilities(hostId, override?)` still accepts an optional
|
|
38
|
+
whole-object override for tests and back-compat callers, but no production
|
|
39
|
+
caller passes a settings-derived override into it any more — the former
|
|
40
|
+
`subagents.host_capabilities` settings key was removed. A leftover key in a
|
|
41
|
+
consumer's `.agent-settings.yml` is ignored.
|
|
31
42
|
|
|
32
43
|
The manifest is resolved once and cached — the agent does not re-resolve it
|
|
33
44
|
mid-session.
|
|
@@ -40,10 +51,9 @@ AN UNKNOWN HOST IS ASSUMED TO HAVE NO SUBAGENT PRIMITIVE.
|
|
|
40
51
|
A MISSING OR INVALID FIELD IS false, NEVER true.
|
|
41
52
|
```
|
|
42
53
|
|
|
43
|
-
This is a hard rule. When the host is unrecognized, or a
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
unsupported primitive.
|
|
54
|
+
This is a hard rule. When the host is unrecognized, or a probed fact is
|
|
55
|
+
absent, the field resolves to `false`. The orchestration layer then degrades
|
|
56
|
+
to in-session execution rather than attempting an unsupported primitive.
|
|
47
57
|
|
|
48
58
|
## Fields
|
|
49
59
|
|
|
@@ -53,6 +63,7 @@ unsupported primitive.
|
|
|
53
63
|
| `parallel_spawn` | bool | Concurrent dispatch of multiple subagents. `false` → delegation is serial, one subagent at a time. |
|
|
54
64
|
| `status_polling` | bool | Monitoring running subagents (progress / completion checks). `false` → fire-and-collect only, no mid-run polling. |
|
|
55
65
|
| `separate_quota_pool` | bool | Quota-arbitrage bonus (Phase 2) — subagents draw from a distinct quota pool than the session. `false` → assume shared quota. |
|
|
66
|
+
| `agent_teams` | bool | Claude Code's experimental multi-instance Agent Teams primitive (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS`). `false` → the [judgment ladder](auto-dispatch-classification.md#judgment-ladder-phase-2--road-to-always-on-orchestration)'s rung 3 (team) degrades to parallel subagents, recorded as `degraded_from: 3`. |
|
|
56
67
|
|
|
57
68
|
A field being `true` is a **precondition**, not a mandate: `parallel_spawn:
|
|
58
69
|
true` permits concurrency but the dispatch cap still applies (see
|
|
@@ -216,6 +216,24 @@ condition outright. No consumer of `payload_hash` or `cache_hit` may wire a
|
|
|
216
216
|
measure→adjust step off them — no default flip, no tier change, no dispatch
|
|
217
217
|
throttle. They are read-only diagnostic fields.
|
|
218
218
|
|
|
219
|
+
## Registered always-on metrics and kill criteria (pre-registered 2026-08-09)
|
|
220
|
+
|
|
221
|
+
The always-on orchestration doctrine fixes "the stack is always available"
|
|
222
|
+
and moves falsifiability into its TRIGGERS. Registered before any behaviour
|
|
223
|
+
data existed, so later readings cannot be fitted to a desired outcome:
|
|
224
|
+
|
|
225
|
+
| Metric | Source | Kill/tighten criterion (per layer, applied by evidence-bearing PR, never a settings flag) |
|
|
226
|
+
|---|---|---|
|
|
227
|
+
| Dispatch rate per delegable verdict | `orchestration_record` vs nudge/ladder verdict lines | A layer whose verdicts are measurably ignored gets its trigger set tightened or the injected line removed |
|
|
228
|
+
| Judgment-ladder precision (verdict vs what the session did) | ladder verdict telemetry joined with dispatch/team records | A rung below registered precision at review gets its signal set tightened; a rung nobody hits gets removed |
|
|
229
|
+
| Council fire rate + unactioned-verdict rate | pass artifacts + handoff adoption | Unactioned-verdict rate is the kill criterion for any auto-fire trigger |
|
|
230
|
+
| Per-session quota burn per provider | transport/attendance records | Sustained quota exhaustion tightens `cli_call_budget` defaults, never re-introduces an activation gate |
|
|
231
|
+
| Metered-fallback spend | billing-classified transport records | Target trends to ~0 on CLI hosts; a rising trend is a transport-resolution defect to fix, not a reason to disable |
|
|
232
|
+
|
|
233
|
+
Review discipline: each criterion is evaluated against an accumulation
|
|
234
|
+
window (the gated blockers name their own windows); a reading below the bar
|
|
235
|
+
removes or tightens THE TRIGGER, and the removal PR cites the numbers.
|
|
236
|
+
|
|
219
237
|
## Related
|
|
220
238
|
|
|
221
239
|
- [`audit-log-v1`](../../../../docs/contracts/audit-log-v1.md) — the frozen
|
|
@@ -41,6 +41,60 @@ refs-not-bodies floor as `evidence_refs`. Validator:
|
|
|
41
41
|
`worker_budget.validateWorkerPartialResult` — the orchestrator never adopts an
|
|
42
42
|
invalid partial return.
|
|
43
43
|
|
|
44
|
+
## Stated assumptions — `assumptions[]`
|
|
45
|
+
|
|
46
|
+
Both the result body above and the CHECKPOINT capsule below may carry:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{ "statement": "<one line>", "basis": "<ref token>", "epistemic_state": "verified | assumed | gap" }
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The vocabulary is the **Evidence-Report buckets** from
|
|
53
|
+
[`evidence-discipline`](evidence-discipline.md#evidence-report--the-discovery-output)
|
|
54
|
+
— pinned once, in `subagent_capsule.EPISTEMIC_STATES`, and deliberately not a
|
|
55
|
+
private scale: a capsule that graded its premises differently from the rest of
|
|
56
|
+
the suite would fork the vocabulary every other surface reasons in.
|
|
57
|
+
|
|
58
|
+
Absent `assumptions[]` means **not recorded** — never "no assumptions were
|
|
59
|
+
made". Unstated premises are the first thing compression drops, which is
|
|
60
|
+
exactly why the field exists on the handoff surface.
|
|
61
|
+
|
|
62
|
+
## CHECKPOINT capsule — the generation handoff
|
|
63
|
+
|
|
64
|
+
`CHECKPOINT` is the fifth envelope status. A worker that reaches its budget
|
|
65
|
+
**watermark** (below the stop-loss line, so it still has the headroom to
|
|
66
|
+
summarise itself) returns a capsule instead of running on to be killed:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"status": "CHECKPOINT",
|
|
71
|
+
"summary": "<one or two sentences>",
|
|
72
|
+
"generation": 1,
|
|
73
|
+
"done": ["file:line | id | path"],
|
|
74
|
+
"remaining": ["<one short line each>"],
|
|
75
|
+
"decisions": ["<choices the successor must not silently re-open>"],
|
|
76
|
+
"open_risks": ["<still open at handoff>"],
|
|
77
|
+
"touched_files": ["path | file:line"],
|
|
78
|
+
"assumptions": [{ "statement": "", "basis": "", "epistemic_state": "verified" }]
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Transcript-exclusion by construction.** Every field is a ref token, a single
|
|
83
|
+
short line, or a count; array entries are capped so a transcript cannot be
|
|
84
|
+
reached by accumulation either. There is no field a raw transcript fits in —
|
|
85
|
+
and that is load-bearing, not stylistic: the claim under test is whether a
|
|
86
|
+
successor can work from the *capsule*, which is unmeasurable the moment raw
|
|
87
|
+
context can ride along. Validator:
|
|
88
|
+
[`subagent_capsule.validateCapsule`](../../../../src/scripts/_lib/subagent_capsule.ts);
|
|
89
|
+
the orchestrator never briefs a successor from an invalid capsule.
|
|
90
|
+
|
|
91
|
+
**Status today: additive and off.** Nothing reads a capsule. Emission is
|
|
92
|
+
shadow-only (the worker still runs to stop-loss exactly as before) and the
|
|
93
|
+
synthesis duties below have no `CHECKPOINT` branch, so the measurement is not
|
|
94
|
+
confounded by the mechanism it is measuring. The recycling loop that consumes a
|
|
95
|
+
capsule is gated behind `blocker: host-worker-respawn` and
|
|
96
|
+
`blocker: capsule-quality-near-budget`.
|
|
97
|
+
|
|
44
98
|
## Orchestrator synthesis duties
|
|
45
99
|
|
|
46
100
|
```
|
|
@@ -36,24 +36,26 @@ THE SAME MINUS THE QUOTA WIN.
|
|
|
36
36
|
the tier/model choice is unchanged. This is the only place the
|
|
37
37
|
"Sonnet-has-its-own-allowance" idea lives, and it lives as a runtime-detected
|
|
38
38
|
flag, never as portable prose.
|
|
39
|
-
4. **Budget routing** (
|
|
39
|
+
4. **Budget routing** (design:
|
|
40
40
|
[`budget-routing` contract](../../../../docs/contracts/budget-routing.md)) →
|
|
41
|
-
AFTER the tier resolves per 1–3,
|
|
42
|
-
|
|
41
|
+
AFTER the tier resolves per 1–3, the budget relation via `pickTier`
|
|
42
|
+
(`src/scripts/_lib/tier_budget_routing.ts`) would apply: cheapest
|
|
43
43
|
classifier-adequate tier WITH available budget; that tier exhausted or
|
|
44
44
|
cooling → next tier up with budget; all unavailable → session model +
|
|
45
45
|
surfaced one-line notice. Work is never blocked to save money. Before
|
|
46
46
|
the dispatch is created, acquire the atomic reserve
|
|
47
47
|
(`acquireBudgetPermit`; check state via `node src/scripts/cost/budget.mjs
|
|
48
48
|
tier <t>`); a 429/quota error trips `tripCooldown` for that tier and
|
|
49
|
-
falls back per the relation — never a retry loop.
|
|
50
|
-
`budget_routing
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
falls back per the relation — never a retry loop.
|
|
50
|
+
`subagents.budget_routing` was removed as a settings key (always-on
|
|
51
|
+
orchestration, road-to-always-on-orchestration Phase 1: no per-layer
|
|
52
|
+
on/off switch survives) — `pickTier` has NO production caller today, so
|
|
53
|
+
this point documents the DESIGNED relation, not a currently wired one;
|
|
54
|
+
wiring it is a later phase of that roadmap (council-side
|
|
55
|
+
`cli_call_budget`/`cost_budget` are the caps that replace the settings
|
|
56
|
+
gate). Every budget-routed dispatch, once wired, would emit one
|
|
57
|
+
`orchestration_record` line (tier + provenance-tagged token delta) so
|
|
58
|
+
realized savings are measured, not asserted.
|
|
57
59
|
|
|
58
60
|
**Cache trade-off (road-to-cache-economy Phase 4).** A tier downshift changes
|
|
59
61
|
the sub-task's model, and the prompt cache is keyed by `(model, prefix)` — so
|
|
@@ -64,6 +64,31 @@ ADR-109 response contract — it replaces nothing. Live evidence
|
|
|
64
64
|
(2026-07-28): four lookup-class workers burned 280–327k tokens each on tasks
|
|
65
65
|
a deterministic primitive answers for <1k.
|
|
66
66
|
|
|
67
|
+
### Capsule watermark — the line below the kill line
|
|
68
|
+
|
|
69
|
+
The budget now carries **two** lines. `capsule_watermark` sits at
|
|
70
|
+
`CAPSULE_WATERMARK_FRACTION` (0.8) of `max_tokens_per_worker` and is **derived**
|
|
71
|
+
from it in `composeSpawnBrief`, never set independently — a watermark that could
|
|
72
|
+
drift away from the budget it sits under is a watermark nobody can reason about.
|
|
73
|
+
Reaching it means: emit a `CHECKPOINT` capsule
|
|
74
|
+
([response contract](subagent-response-contract.md#checkpoint-capsule--the-generation-handoff))
|
|
75
|
+
**while there is still headroom to write one**. A worker at 100 % of its budget
|
|
76
|
+
cannot summarise itself; that headroom is the entire mechanism.
|
|
77
|
+
|
|
78
|
+
`evaluateWorkerBudget` reports the band between the two lines as
|
|
79
|
+
`watermark_hit` — the only window in which a capsule can be written at all.
|
|
80
|
+
|
|
81
|
+
**Shadow only, today.** The worker still runs on to the stop-loss and still
|
|
82
|
+
returns the `BLOCKED` partial result exactly as before; the capsule is recorded,
|
|
83
|
+
never acted on. Behaviour is unchanged on purpose, so the Phase-1 measurement is
|
|
84
|
+
not confounded by the mechanism it is measuring. A second candidate trigger —
|
|
85
|
+
novelty-per-step saturation
|
|
86
|
+
([`capsule_trigger.ts`](../../../../src/scripts/_lib/capsule_trigger.ts),
|
|
87
|
+
term-frequency, no embeddings) — is logged alongside it, and the paired
|
|
88
|
+
comparison is pre-registered as `worker-capsule-trigger-arm` in
|
|
89
|
+
[`docs/CLAIMS.md`](../../../../docs/CLAIMS.md) with both arms losing as an
|
|
90
|
+
explicitly publishable outcome.
|
|
91
|
+
|
|
67
92
|
## Bundle resolver — bind to the existing surfaces
|
|
68
93
|
|
|
69
94
|
The brief is **resolved**, not hand-built. `resolveBundle(slice)` maps a task
|
|
@@ -144,11 +144,14 @@ dashboards alone look fine while quality regresses.
|
|
|
144
144
|
## Kill-switch
|
|
145
145
|
|
|
146
146
|
```
|
|
147
|
-
|
|
147
|
+
emergency.orchestration_halt: true
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
-
A single, no-deploy settings flip fully disables the layer (`isLayerDisabled()`)
|
|
151
|
-
|
|
150
|
+
A single, no-deploy settings flip fully disables the layer (`isLayerDisabled()`)
|
|
151
|
+
for the duration of an incident — the one audited switch that survives
|
|
152
|
+
always-on orchestration (road-to-always-on-orchestration Phase 1;
|
|
153
|
+
`docs/contracts/settings-classes.md` § "The one exception"). Disarming it
|
|
154
|
+
requires a non-empty `emergency.orchestration_halt_justification`.
|
|
152
155
|
|
|
153
156
|
## Reference implementation
|
|
154
157
|
|
|
@@ -46,16 +46,18 @@ Only when the activation gate from
|
|
|
46
46
|
[`auto-orchestration-activation`](../contexts/execution/auto-orchestration-activation.md)
|
|
47
47
|
clears — all of:
|
|
48
48
|
|
|
49
|
-
- `
|
|
49
|
+
- `emergency.orchestration_halt` is not set,
|
|
50
50
|
- the host-capability manifest reports `subagent_spawn: true`,
|
|
51
51
|
- the task is classified **delegable** per
|
|
52
52
|
[`auto-dispatch-classification`](../contexts/execution/auto-dispatch-classification.md)
|
|
53
53
|
(≥1 independent, well-specified slice above the size floor).
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
+ per-subtask tiers in one line
|
|
55
|
+
Always-on orchestration (road-to-always-on-orchestration Phase 1) removed the
|
|
56
|
+
`subagents.enabled`/`subagents.auto` settings this used to gate on — there is
|
|
57
|
+
no more per-layer on/off setting. A matched delegable signal → dispatch,
|
|
58
|
+
surfacing the chosen mode + per-subtask tiers in one line, never silent. An
|
|
59
|
+
AMBIGUOUS verdict (no enumerated signal matched) → **ask**, always — a verdict
|
|
60
|
+
to the user, never a speculative spawn. The emergency halt, or no host
|
|
59
61
|
primitive → run in-session (clean no-op).
|
|
60
62
|
|
|
61
63
|
## What it makes binding
|
|
@@ -100,8 +102,10 @@ no-review session — verified; its advisory line reaches the dispatcher
|
|
|
100
102
|
output, but host-side forwarding of stop-slot context to the model is
|
|
101
103
|
unverified, so the model-facing end-review carrier is the AGENTS.md line
|
|
102
104
|
plus this telemetry). The
|
|
103
|
-
capability gate itself resolves from the committed host registry
|
|
104
|
-
`src/scripts/_lib/host_capability.ts`
|
|
105
|
+
capability gate itself resolves from the committed host registry merged with a
|
|
106
|
+
live environment probe in `src/scripts/_lib/host_capability.ts`
|
|
107
|
+
(`probeHostCapabilities` — capability is a fact about the host, never a
|
|
108
|
+
settings override). What stays
|
|
105
109
|
model-carried, honestly: the decomposition itself, the per-return
|
|
106
110
|
verification, and every dispatch on hosts without hook slots. The nudges are
|
|
107
111
|
advisory by design — whether they change behaviour is measured by the
|
|
@@ -7,7 +7,6 @@ triggers:
|
|
|
7
7
|
- keyword: "settings:set"
|
|
8
8
|
- keyword: "canary_name"
|
|
9
9
|
- keyword: "rich_skills"
|
|
10
|
-
- keyword: "budget_routing"
|
|
11
10
|
- keyword: "adversarial_council"
|
|
12
11
|
- keyword: "learn_on_session_end"
|
|
13
12
|
- keyword: "open_edited_files"
|
|
@@ -34,7 +33,7 @@ obligation_frequency: "per-task"
|
|
|
34
33
|
# Settings-Ask Protocol
|
|
35
34
|
|
|
36
35
|
A settings question is the one ask where the agent poses the question *and* owns
|
|
37
|
-
where the answer goes.
|
|
36
|
+
where the answer goes. Seven keys can produce one, in two mechanisms that look
|
|
38
37
|
identical from outside and differ completely underneath.
|
|
39
38
|
|
|
40
39
|
## The Iron Law
|
|
@@ -70,7 +69,7 @@ How long it stays cached in working state is the key's own business, and several
|
|
|
70
69
|
keys state their own scope. Reading the C path as "re-ask every execution" would
|
|
71
70
|
turn a fence against illegal writes into a source of extra questions.
|
|
72
71
|
|
|
73
|
-
## The
|
|
72
|
+
## The seven keys
|
|
74
73
|
|
|
75
74
|
**Class B — persist once**: `personal.canary_name` ·
|
|
76
75
|
`personal.open_edited_files` · `memory.learn_on_session_end`. Each ships a
|
|
@@ -78,10 +77,12 @@ conservative default (`""`, `false`, `false`), so absent is indistinguishable
|
|
|
78
77
|
from *no* and never from *yes*.
|
|
79
78
|
|
|
80
79
|
**Class C carrying an `ask` value in its own enum** — a runtime question whose
|
|
81
|
-
answer dies with the run: `
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
answer dies with the run: `worktrees.mode` (**ships** as `ask`), plus
|
|
81
|
+
`tokens.rich_skills`, `subagents.adversarial_council`, `decision_engine.on_block`
|
|
82
|
+
(which can be set to `ask` by a human but do not ship that way). Always-on
|
|
83
|
+
orchestration (road-to-always-on-orchestration Phase 1) deleted
|
|
84
|
+
`subagents.auto` and `subagents.budget_routing` — the layer no longer carries a
|
|
85
|
+
setting for this protocol to route.
|
|
85
86
|
|
|
86
87
|
## The budget
|
|
87
88
|
|
|
@@ -139,7 +139,7 @@ its obligation on line 300.
|
|
|
139
139
|
|
|
140
140
|
## The size band is measured, and only its ceiling is gated
|
|
141
141
|
|
|
142
|
-
The `rich` band is **2,000–3,500 tokens** (
|
|
142
|
+
The `rich` band is **2,000–3,500 tokens** (ADR-217, `docs/decisions/ADR-217-rich-class-band-measured-and-enforced.md`).
|
|
143
143
|
It was 2,000–5,000 and enforced by nothing until that record: measured with the
|
|
144
144
|
exact BPE tokenizer, the largest rich artifact in the tree is 3,331 tokens, so
|
|
145
145
|
the old ceiling described no artifact that existed. An unused permission costs
|