@event4u/agent-config 8.5.0 → 8.7.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 (66) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +54 -0
  3. package/dist/agent-src/commands/cost/report.md +20 -0
  4. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +30 -0
  5. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +15 -1
  6. package/dist/agent-src/contexts/execution/subagent-steering.md +54 -1
  7. package/dist/agent-src/contexts/model-recommendations.md +19 -0
  8. package/dist/agent-src/contexts/subagent-configuration.md +8 -0
  9. package/dist/agent-src/skills/skill-writing/SKILL.md +4 -0
  10. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  11. package/dist/discovery/deprecation-report.md +1 -1
  12. package/dist/discovery/discovery-manifest.json +4 -4
  13. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  14. package/dist/discovery/discovery-manifest.summary.md +1 -1
  15. package/dist/discovery/orphan-report.md +1 -1
  16. package/dist/discovery/packs.json +2 -2
  17. package/dist/discovery/trust-report.md +1 -1
  18. package/dist/discovery/workspaces.json +2 -2
  19. package/dist/install/emit_host_rules_cli.js +185 -0
  20. package/dist/install/emit_host_rules_cli.js.map +1 -0
  21. package/dist/install/install.mjs +6 -0
  22. package/dist/install/plan.js +4 -1
  23. package/dist/install/plan.js.map +1 -1
  24. package/dist/install/rule_scope.js +109 -0
  25. package/dist/install/rule_scope.js.map +1 -0
  26. package/dist/install/rule_scope_cli.js +77 -0
  27. package/dist/install/rule_scope_cli.js.map +1 -0
  28. package/dist/install/wizard-plan.js +14 -1
  29. package/dist/install/wizard-plan.js.map +1 -1
  30. package/dist/mcp/registry-manifest.json +1 -1
  31. package/dist/scripts/_lib/agent_settings.js +963 -0
  32. package/dist/scripts/_lib/agent_settings.js.map +1 -0
  33. package/dist/scripts/_lib/agent_src.js +607 -0
  34. package/dist/scripts/_lib/agent_src.js.map +1 -0
  35. package/dist/scripts/_lib/claude_settings_hooks.js +209 -0
  36. package/dist/scripts/_lib/claude_settings_hooks.js.map +1 -0
  37. package/dist/scripts/_lib/model_tier.js +64 -0
  38. package/dist/scripts/_lib/model_tier.js.map +1 -0
  39. package/dist/scripts/_lib/script_output.js +140 -0
  40. package/dist/scripts/_lib/script_output.js.map +1 -0
  41. package/dist/scripts/_lib/user_global_paths.js +297 -0
  42. package/dist/scripts/_lib/user_global_paths.js.map +1 -0
  43. package/dist/scripts/condense.js +2181 -0
  44. package/dist/scripts/condense.js.map +1 -0
  45. package/dist/server/routes/install.js +18 -2
  46. package/dist/server/routes/install.js.map +1 -1
  47. package/dist/server/schemas/settings.js +2 -0
  48. package/dist/server/schemas/settings.js.map +1 -1
  49. package/docs/CLAIMS.md +7 -0
  50. package/docs/decisions/ADR-116-memory-tripwire-activation-path.md +125 -0
  51. package/docs/decisions/INDEX.md +1 -0
  52. package/docs/proof.md +2 -1
  53. package/package.json +1 -1
  54. package/src/config/agent-settings.template.yml +4 -2
  55. package/src/install/emit_host_rules_cli.ts +190 -0
  56. package/src/install/plan.ts +11 -1
  57. package/src/install/rule_scope.ts +120 -0
  58. package/src/install/rule_scope_cli.ts +79 -0
  59. package/src/install/wizard-plan.ts +22 -1
  60. package/src/scripts/_lib/auto_dispatch.ts +63 -0
  61. package/src/scripts/_lib/subagent_routing.ts +24 -0
  62. package/src/scripts/_lib/subagent_steering.ts +213 -3
  63. package/src/scripts/check_trigger_eval_presence.ts +171 -0
  64. package/src/scripts/install.sh +118 -4
  65. package/src/scripts/trigger_eval_grandfather.json +226 -0
  66. package/src/server/schemas/settings.ts +6 -0
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Bootstrap shim for the event4u agent-config suite. This plugin ships ONLY the dispatcher hooks plus one install-pointer skill — ALL content (skills, rules, commands) is installed via `npx -y @event4u/agent-config init`, which writes the file projection AND registers the same hooks in ~/.claude/settings.json. DEPRECATED as a content channel; kept so the marketplace listing stays discoverable and existing installs keep working hooks.",
9
- "version": "8.5.0",
9
+ "version": "8.7.0",
10
10
  "keywords": [
11
11
  "agent-config",
12
12
  "skills",
package/CHANGELOG.md CHANGED
@@ -989,6 +989,60 @@ our recommendation order, not its support status.
989
989
  > that forces a new era split (`# Era: 8.2.x`, etc.) — see
990
990
  > [`docs/contracts/CHANGELOG-conventions.md § Era splits`](docs/contracts/CHANGELOG-conventions.md).
991
991
 
992
+ ## [8.7.0](https://github.com/event4u-app/agent-config/compare/8.6.0...8.7.0) (2026-07-08)
993
+
994
+ ### Features
995
+
996
+ * **settings:** validate + surface projection.rule_workspaces/rule_packs ([a27bbf5](https://github.com/event4u-app/agent-config/commit/a27bbf53c7fca206176ed6ddd38b1ec5ee11e357))
997
+ * **install:** consumer Cursor/Windsurf get host-native rule surfaces ([8b68ff5](https://github.com/event4u-app/agent-config/commit/8b68ff58e9c240e41acce1f25faa51bc47f3564b))
998
+ * **install:** consumer rule scoping reaches both install pipelines ([88248e4](https://github.com/event4u-app/agent-config/commit/88248e4d39bd056db133021acc0cc2b0782e78cc))
999
+ * **ci:** trigger-eval presence ratchet with shrink-only grandfather allowlist ([d8f0c0d](https://github.com/event4u-app/agent-config/commit/d8f0c0dd04b3388205becf2cce30c6e0ea09197b))
1000
+
1001
+ ### Bug Fixes
1002
+
1003
+ * **ci:** install repo-root deps in the MCP deploy workflow ([9183c4e](https://github.com/event4u-app/agent-config/commit/9183c4e358e76b344058eb01d7f945f246a44828))
1004
+
1005
+ ### Documentation
1006
+
1007
+ * add frontier quality roadmaps ([bfa9315](https://github.com/event4u-app/agent-config/commit/bfa93157848bf13020a6cb3dcd06381c013fb035))
1008
+ * **skills:** skill-writing names the CI-enforced trigger-eval presence gate ([464722e](https://github.com/event4u-app/agent-config/commit/464722efe83243e3ae480411d59850dac92ca1ac))
1009
+
1010
+ ### Chores
1011
+
1012
+ * **roadmaps:** regenerate progress dashboard ([a8f4178](https://github.com/event4u-app/agent-config/commit/a8f4178a84ef8c66408afe3d5af195ce19ccf5d0))
1013
+ * **gitignore:** ignore Codex CLI interop output (.agents/, .codex/) ([8756d52](https://github.com/event4u-app/agent-config/commit/8756d5226e8760c72d6205e98b9822620d303418))
1014
+ * **dist:** rebuild install bundle after settings-schema extension ([44818d4](https://github.com/event4u-app/agent-config/commit/44818d4c8ad69ec545e99820e3292f0346bb2f20))
1015
+ * **roadmap:** close Phase 1b with pinned consumer-install evidence ([3a2455f](https://github.com/event4u-app/agent-config/commit/3a2455f236279390eb5a8cfe986e6b911493391c))
1016
+ * **condense:** refresh stale hash for commands/upstream-contribute ([c668370](https://github.com/event4u-app/agent-config/commit/c668370663bf7272932c33b5a7874dca4b08a9db))
1017
+ * **roadmaps:** composition-ratchet roadmap executed + archived; adoption roadmap sequenced next ([1bde2ea](https://github.com/event4u-app/agent-config/commit/1bde2ea00478bd1e46c4e9596c8c0cd5962b9ee1))
1018
+
1019
+ Tests: 6949 (+6 since 8.6.0)
1020
+
1021
+ ## [8.6.0](https://github.com/event4u-app/agent-config/compare/8.5.0...8.6.0) (2026-07-08)
1022
+
1023
+ ### Features
1024
+
1025
+ * **cost-routing:** tier-downshift layer — telemetry fields, category defaults, tripwires, slice inference, verify-fail escalation ([e9839f5](https://github.com/event4u-app/agent-config/commit/e9839f5a034c3a0882e8956a2a3f580b3978056a))
1026
+
1027
+ ### Bug Fixes
1028
+
1029
+ * **ci:** install task in the release workflow ([19072d9](https://github.com/event4u-app/agent-config/commit/19072d9bcbb6d30cd943804f287dd79c9c709167))
1030
+
1031
+ ### Documentation
1032
+
1033
+ * **roadmaps:** add four frontier-prompt-harvest roadmaps ([e232e34](https://github.com/event4u-app/agent-config/commit/e232e342401bd6edafda79cd64ce8ed4ff6ddd93))
1034
+ * **proof:** regenerate proof.md with the backed downshift-cost-reduction claim ([6f28604](https://github.com/event4u-app/agent-config/commit/6f286048b609442be81ac60a8c64df544a369df0))
1035
+ * **roadmaps:** unify tripwire engine wording on the ADR-116 path ([f4ee375](https://github.com/event4u-app/agent-config/commit/f4ee37540ea6f9724014c63be05617e4abcdaa1b))
1036
+ * **adr:** pin the memory scale-tripwire activation path (ADR-116) ([7efe88a](https://github.com/event4u-app/agent-config/commit/7efe88a7cda064e659a830a2d6a70e506ab21408))
1037
+ * **claims:** back downshift-cost-reduction with the routing-downshift bench run ([38f3194](https://github.com/event4u-app/agent-config/commit/38f31942b16474fcc5977f0560da435ce84a81dd))
1038
+
1039
+ ### Chores
1040
+
1041
+ * **condense:** recondense cost-routing context/command edits into dist ([33fe1a3](https://github.com/event4u-app/agent-config/commit/33fe1a353a3eef52d024079016b32b9fe02b0531))
1042
+ * **contexts:** durable verdict note for cost-aware model routing ([cbff1bd](https://github.com/event4u-app/agent-config/commit/cbff1bdc7f2b0b87843283443de534c48f5ddd54))
1043
+
1044
+ Tests: 6943 (+7 since 8.5.0)
1045
+
992
1046
  ## [8.5.0](https://github.com/event4u-app/agent-config/compare/8.4.1...8.5.0) (2026-07-08)
993
1047
 
994
1048
  ### Features
@@ -118,6 +118,26 @@ Orchestration telemetry (YYYY-MM, N dispatches):
118
118
  guardrail breaches: [token_blowup | spawn_failure | verify_skip | none]
119
119
  ```
120
120
 
121
+ When orchestration lines carry the routing extension fields
122
+ (`task_class` / `tier_chosen` / `escalated_from` / `verify_result_by_tier` —
123
+ see `orchestration-telemetry.md`), append the per-tier routing view using
124
+ `readTierRoutingMetrics`, `escalationPromotionCandidates`, and
125
+ `verifyPassDrift` from the same module — the per-tier QUALITY view a
126
+ spend-only dashboard misses:
127
+
128
+ ```
129
+ Tier routing (YYYY-MM):
130
+ dispatches by tier: lite N · medium N · high N
131
+ escalation rate by class: <class>: N.N% (promotion tripwire: >40%)
132
+ verify-pass rate by tier: lite N.N% · medium N.N%
133
+ tripwires fired: [promote <class> | verify-pass drift on <tier> | none]
134
+ ```
135
+
136
+ A fired tripwire is a recommendation to surface, never an auto-flip: the
137
+ escalation tripwire suggests promoting the class's static default tier; the
138
+ drift tripwire flags verifier/model drift for investigation (per
139
+ `subagent-steering.md § Cost-routing tripwires`).
140
+
121
141
  If no orchestration lines exist yet (telemetry capture not yet running or
122
142
  no delegated dispatches this month), surface:
123
143
 
@@ -55,6 +55,36 @@ dwarfs the work). Below the floor → in-session.
55
55
  | `parallelizable: files\|independent` / independent slices | `do-in-parallel` |
56
56
  | change needing verification (any of the above) | implementer + cross-model judge per the `subagent-orchestration` Iron Law |
57
57
 
58
+ ## Per-slice tier inference (v1.5 — deterministic, task-TYPE-keyed)
59
+
60
+ Once a slice is classified **delegable**, a second deterministic table infers
61
+ its `model_tier` (road-to-cost-aware-model-routing, council 2026-07-08).
62
+ Keyed **exclusively on the classifier's task-TYPE outputs** — never raw size
63
+ metrics; diff size anti-correlates with difficulty in refactoring domains.
64
+
65
+ ```
66
+ UNKNOWN / AMBIGUOUS → inherit (SESSION TIER). NEVER GUESS DOWN.
67
+ SIZE SIGNALS ARE NEGATIVE GUARDS ONLY — THEY REVOKE A lite CANDIDACY,
68
+ THEY NEVER CREATE ONE.
69
+ ```
70
+
71
+ | Slice type (classifier output) | Inferred tier |
72
+ |---|---|
73
+ | Delegable + read-only fan-out (grep / inventory / discovery targets) | `lite` |
74
+ | Delegable + mechanical / template-driven transform WITH test coverage | `lite` (verify-fail escalates to `medium` per the steering cascade) |
75
+ | Delegable + mutating WITHOUT test coverage | `medium` |
76
+ | Delegable + synthesis / judgment (review, analysis slice) | `medium` — judge one tier up per the orchestration Iron Law |
77
+ | Any other / ambiguous shape | `inherit` — session tier, no downshift |
78
+
79
+ **Negative size guard:** slice scope exceeding the mechanical envelope
80
+ (multi-file mutation, diff surface beyond single responsibility) loses `lite`
81
+ candidacy, resolves one row down — size never argues FOR a downshift, only
82
+ against one.
83
+
84
+ Every inferred decision records `tier_source: "inferred"` in orchestration
85
+ telemetry (static pins record `"static"`; session-tier runs `"inherit"`) so
86
+ the evidence gate scores inferred routing separately from static pinning.
87
+
58
88
  ## v2+ (deferred, gated on Phase 6 evidence)
59
89
 
60
90
  LLM-based classification — only if the deterministic rules prove too coarse
@@ -19,7 +19,12 @@ v1 forward-compat rule on unknown fields).
19
19
  "wall_clock_ms": 0,
20
20
  "outcome": "DONE",
21
21
  "verify_mode": "deterministic",
22
- "verdict_changed_outcome": null
22
+ "verdict_changed_outcome": null,
23
+ "task_class": null,
24
+ "tier_chosen": null,
25
+ "tier_source": null,
26
+ "escalated_from": null,
27
+ "verify_result_by_tier": null
23
28
  }
24
29
  ```
25
30
 
@@ -36,6 +41,15 @@ v1 forward-compat rule on unknown fields).
36
41
  | `outcome` | enum | One of `DONE` · `DONE_WITH_CONCERNS` · `NEEDS_CONTEXT` · `BLOCKED` · `killed`. |
37
42
  | `verify_mode` | enum | How output was verified: `deterministic` · `judge` · `none`. |
38
43
  | `verdict_changed_outcome` | bool \| null | **A3 extension (ADR-109 Track A).** For a review/verdict subagent (e.g. `production-validator`): did the verdict change the outcome vs the in-session baseline? `true` = caught a real issue the baseline missed / flipped a false `READY`→`NOT READY`; `false` = no lift; `null` = not a verdict dispatch / not measured. **Negative-control (clean single-file) tasks MUST record `false`** — a `true` on a control = spurious findings, fails Gate A. Additive field on THIS object, not a second schema. Boolean/counts only, no bodies. |
44
+ | `task_class` | string \| null | **Routing extension (road-to-cost-aware-model-routing Phase 0).** Category id of the dispatched slice (e.g. `read-only-fanout`, `mechanical-edit`, `implementation`, `review-synthesis`). Enum-style id only, never free-form task text. `null` = pre-extension line / unclassified. |
45
+ | `tier_chosen` | string \| null | Tier the slice was dispatched on (`lite` \| `medium` \| `high`). `null` = pre-extension line. |
46
+ | `tier_source` | enum \| null | Where `tier_chosen` came from: `static` (frontmatter/category pin) · `inferred` (deterministic per-slice inference) · `inherit` (session tier — no downshift decision). Lets the evidence gate score inferred routing separately from static pinning. |
47
+ | `escalated_from` | string \| null | When the slice re-dispatched after a verification failure: tier of the FAILED attempt (e.g. `lite` when a lite return failed verify and the slice re-ran on `medium`). `null` = no escalation. |
48
+ | `verify_result_by_tier` | object \| null | Map tier → verification result per attempt of this slice (e.g. `{"lite":"fail","medium":"pass"}`). Values: `pass` \| `fail` \| `skipped`. Feeds the per-tier verify-pass-rate tripwire. Enums only, no verdict bodies. |
49
+
50
+ All five routing fields are additive and optional — a line without them is
51
+ still a valid orchestration line; readers ignore unknown fields per the v1
52
+ forward-compat rule.
39
53
 
40
54
  ## Privacy floor
41
55
 
@@ -42,6 +42,38 @@ Only automatic response to a transient failure; structural/semantic errors (e.g.
42
42
  `BLOCKED` envelope) do **not** trigger a downshift — escalate to the orchestrator
43
43
  immediately.
44
44
 
45
+ ## Verify-fail escalation — the downshift cascade (M3)
46
+
47
+ Cheap-first cascade for DOWNSHIFTED slices only
48
+ (road-to-cost-aware-model-routing, council 2026-07-08). Transient failures
49
+ (above) and verify-fails are distinct: transient retries downward once; a
50
+ **verification failure escalates upward**.
51
+
52
+ ```
53
+ VERIFY-FAIL ON A DOWNSHIFTED RETURN → RE-DISPATCH ONE TIER UP.
54
+ COUNTS AGAINST THE EXISTING N=3 BUDGET — NEVER A NEW BUDGET.
55
+ ATTEMPT 1 lite → ATTEMPT 2 medium → ATTEMPT 3 = SLICE FAILED,
56
+ ORCHESTRATOR REPLANS AT SESSION TIER.
57
+ ESCALATION TRIGGER IS THE JUDGE VERDICT / DETERMINISTIC VERIFY RESULT —
58
+ NEVER THE SUBAGENT'S OWN CONFIDENCE.
59
+ ```
60
+
61
+ - **Scope:** slices with `tier_source: static | inferred` only. `inherit`
62
+ slices keep existing same-tier retry semantics — no behavior change outside
63
+ the downshift path.
64
+ - **Budget accounting:** each escalated attempt consumes one of the slice's
65
+ three attempts (`budgetHalt()` unchanged). Two failed attempts mark the
66
+ slice failed; the orchestrator replans — a slice's verify-fail never
67
+ poisons the orchestrator trajectory, only the final verified return (or
68
+ failure mark) enters its context.
69
+ - **Telemetry:** the re-dispatch records `escalated_from: <failed tier>` and
70
+ appends to `verify_result_by_tier`.
71
+ - **Economics guard:** a class escalating > 40% of the time is cheaper
72
+ started on the higher tier — the escalation-rate tripwire (below) promotes
73
+ its static default; the cascade is for the tail, not the norm.
74
+
75
+ Deterministic reference: `escalateOnVerifyFail()`.
76
+
45
77
  ## Failure-type stop — the N=3 budget applied per subagent type
46
78
 
47
79
  Two consecutive **verification-failed** returns from one subagent type in a
@@ -88,6 +120,26 @@ The guardrail thresholds (`breachedGuardrails()`), read off the
88
120
 
89
121
  A breach is a maintainer/user signal, surfaced — never an automatic flip.
90
122
 
123
+ ## Cost-routing tripwires — steering policy for downshifted dispatch
124
+
125
+ Two tripwires guard the cost-aware downshift path
126
+ (road-to-cost-aware-model-routing, council 2026-07-08). Like the rollback
127
+ guardrails they are **surfaced, never auto-flipped** — steering policy over
128
+ the routing telemetry fields (`task_class`, `tier_chosen`, `escalated_from`,
129
+ `verify_result_by_tier` in [`orchestration-telemetry`](orchestration-telemetry.md)),
130
+ not a new mechanism:
131
+
132
+ | Tripwire | Threshold | Action when fired |
133
+ |---|---|---|
134
+ | **Escalation-rate promotion** | per-class escalation rate > 40% over the rolling window | Class's default tier is wrong — cascading it costs more than starting high (decision-theoretic escalation analysis). Promote the class's static default one tier, log the promotion; do not keep cascading. |
135
+ | **Verify-pass drift** | a tier's verify-pass rate drops below its trailing baseline | Verifier or model drift — a drifting verifier silently escalates everything (cost ~3x). Surface the drift with per-tier numbers; never silently absorb the extra escalations. |
136
+
137
+ Deterministic references: `escalationPromotionCandidates()` and
138
+ `verifyPassDrift()` over `readTierRoutingMetrics()` aggregates. Per-tier
139
+ quality view (spend by tier, escalation count by class, verify-pass rate by
140
+ tier) surfaces via `/cost:report` — the delayed-signal quality guard: cost
141
+ dashboards alone look fine while quality regresses.
142
+
91
143
  ## Kill-switch
92
144
 
93
145
  ```
@@ -101,7 +153,8 @@ This is the canonical disable — no code change, effective on the next run.
101
153
 
102
154
  [`src/scripts/_lib/subagent_steering.ts`](../../../../src/scripts/_lib/subagent_steering.ts)
103
155
  (`isLayerDisabled`, `budgetHalt`, `typeStop`, `sliceDispatchAllowed`,
104
- `breachedGuardrails`), covered by
156
+ `breachedGuardrails`, `readTierRoutingMetrics`,
157
+ `escalationPromotionCandidates`, `verifyPassDrift`), covered by
105
158
  [`tests/scripts/_lib_subagent_steering.test.ts`](../../../../tests/scripts/_lib_subagent_steering.test.ts).
106
159
 
107
160
  ## Related
@@ -39,6 +39,25 @@ tier is the reasoning band; `context: large` is the context-window need.
39
39
  | **Implementation after a `high`-tier plan** | `medium` | Plan is done, execution is mechanical |
40
40
  | **Trivial mechanical** (formatting, one-line config, rote rename) | `lite` | No reasoning required; fastest tier suffices |
41
41
 
42
+ ## Subagent Category → Tier Defaults (dispatch-time downshift)
43
+
44
+ Normative defaults for DISPATCHED subagent slices (road-to-cost-aware-model-routing,
45
+ council 2026-07-08). The orchestrator's own session model is never switched;
46
+ these tiers apply to the sub-task the orchestrator spawns. Category-keyed —
47
+ immune to per-instance misrouting; unknown/ambiguous category → `inherit`.
48
+
49
+ | Subagent category | Tier | Why |
50
+ |---|---|---|
51
+ | Read-only fan-out (grep / inventory / file discovery) | `lite` | Returns get deterministic verification; quality risk ~0 by construction |
52
+ | Mechanical single-file regen / template-driven transform | `lite`→`medium` fallback | Pattern application, no open-ended reasoning; verify-fail escalates one tier |
53
+ | Implementation (bounded, planned slice) | `medium` | Plan exists; execution is pattern work |
54
+ | Review / judge / synthesis / architecture | `medium`\|`high` | Reasoning depth is the product |
55
+
56
+ **Judge asymmetry invariant:** the cross-model judge always runs one tier
57
+ ABOVE the implementer tier (ladder in
58
+ [`subagent-configuration`](subagent-configuration.md)). Downshifting an
59
+ implementer never downshifts its judge.
60
+
42
61
  ## Detection Heuristics
43
62
 
44
63
  | Signal | Task Type | Tier |
@@ -25,6 +25,14 @@ If the session runs on **opus**, judge stays on opus (no higher tier
25
25
  available). If the session runs on **sonnet**, judge defaults to opus.
26
26
  If the session runs on **haiku**, judge defaults to sonnet.
27
27
 
28
+ **Downshift never touches the judge.** When cost-aware routing runs an
29
+ implementer on a downshifted tier (per the category → tier defaults in
30
+ [`model-recommendations § Subagent Category → Tier Defaults`](model-recommendations.md)),
31
+ the judge still resolves one tier above the IMPLEMENTER's resolved tier —
32
+ a `lite` implementer gets at least a `medium` judge. Downshifting an
33
+ implementer never downshifts its judge below what the verify contract
34
+ requires; a judge is never `lite`.
35
+
28
36
  ## Resolution order
29
37
 
30
38
  For both implementer and judge:
@@ -224,6 +224,10 @@ record it in the commit message (`Eval stub: deferred`). Peer examples
224
224
  for the expected format: `php-coder/evals/triggers.json`,
225
225
  `eloquent/evals/triggers.json`, `skill-writing/evals/triggers.json`.
226
226
 
227
+ Presence CI-enforced for new skills: `check_trigger_eval_presence` fails
228
+ any skill outside shrink-only grandfather allowlist lacking
229
+ `evals/triggers.json` — *skip* defers query quality, never the file.
230
+
227
231
  Rules / commands / guidelines do **not** get eval stubs — only skills
228
232
  route through the top-level catalogue.
229
233
 
@@ -39,7 +39,7 @@ schema_version: 1
39
39
  # CI guard: a release bump of `package.json` must update this value
40
40
  # in lockstep — see scripts/check_template_pin_drift.ts (road-to-
41
41
  # portable-runtime-and-update-check P3.3).
42
- agent_config_version: "8.5.0"
42
+ agent_config_version: "8.7.0"
43
43
 
44
44
  # --- Project identity ---
45
45
  project:
@@ -1,6 +1,6 @@
1
1
  # Discovery — Deprecation Report
2
2
 
3
- - Generated: `2026-07-08T12:48:25Z`
3
+ - Generated: `2026-07-08T15:01:19Z`
4
4
  - Deprecated artefacts: **0**
5
5
 
6
6
  _None. Tree is clean._
@@ -2925,7 +2925,7 @@
2925
2925
  },
2926
2926
  {
2927
2927
  "category": "command",
2928
- "checksum": "sha256:1809087ff3860b7d07fb42958e58f73297451a669c57573137b5cf8ea0284236",
2928
+ "checksum": "sha256:90b89f5241ecad5adb6b6de797a2b71e0a87898b8e3f5a0958be4df293246a3a",
2929
2929
  "install": {
2930
2930
  "default": true,
2931
2931
  "removable": false
@@ -11982,7 +11982,7 @@
11982
11982
  },
11983
11983
  {
11984
11984
  "category": "skill",
11985
- "checksum": "sha256:ce7bb5aa334783a058f320faf1dfb41aa70140d0a557be29d942ddc08898b239",
11985
+ "checksum": "sha256:87eaa14cd95565d3c642e6e5a3ba1e26ac3b0ee1904e05f92c28ea9512c5dbc6",
11986
11986
  "install": {
11987
11987
  "default": true,
11988
11988
  "removable": false
@@ -12769,7 +12769,7 @@
12769
12769
  "workspaces": []
12770
12770
  }
12771
12771
  ],
12772
- "checksum": "sha256:4dd1cf9aacb705067e017342c3d7633728bd2822ef8d6d8cacaf8406c7131334",
12772
+ "checksum": "sha256:9902bbcc7fac058b3506979d8233180ef0a52be98f42cec030433ee6781a5cf3",
12773
12773
  "deprecations": [
12774
12774
  {
12775
12775
  "key": "tier",
@@ -12912,7 +12912,7 @@
12912
12912
  "reason": "scaffold template for ticket-bundle tickets (ADR-101); carries no runtime frontmatter — emit-tickets fills it in per ticket"
12913
12913
  }
12914
12914
  ],
12915
- "generated_at": "2026-07-08T12:48:25Z",
12915
+ "generated_at": "2026-07-08T15:01:19Z",
12916
12916
  "packs": [
12917
12917
  {
12918
12918
  "artefact_count": 95,
@@ -1 +1 @@
1
- e6337c8304f42bebf186771bae9266ed3da8f3fc9958279cd316b2d7df0ec25a discovery-manifest.json
1
+ 589017598b9d0eab5bfa36b665f3a6d8407ee34a45aa61d913ae9172f71c3ab3 discovery-manifest.json
@@ -1,6 +1,6 @@
1
1
  # Discovery Manifest — Summary
2
2
 
3
- - Generated: `2026-07-08T12:48:25Z`
3
+ - Generated: `2026-07-08T15:01:19Z`
4
4
  - Scanner: `f36b5a348348`
5
5
  - Artefacts: **533**
6
6
  - Unassigned: **0**
@@ -1,6 +1,6 @@
1
1
  # Discovery — Orphan Report
2
2
 
3
- - Generated: `2026-07-08T12:48:25Z`
3
+ - Generated: `2026-07-08T15:01:19Z`
4
4
  - Orphan artefacts: **0**
5
5
 
6
6
  > An orphan is an artefact whose declared pack has no other members.
@@ -1,6 +1,6 @@
1
1
  {
2
- "checksum": "sha256:4dd1cf9aacb705067e017342c3d7633728bd2822ef8d6d8cacaf8406c7131334",
3
- "generated_at": "2026-07-08T12:48:25Z",
2
+ "checksum": "sha256:9902bbcc7fac058b3506979d8233180ef0a52be98f42cec030433ee6781a5cf3",
3
+ "generated_at": "2026-07-08T15:01:19Z",
4
4
  "packs": [
5
5
  {
6
6
  "always_on": false,
@@ -1,6 +1,6 @@
1
1
  # Discovery — Trust Report
2
2
 
3
- - Generated: `2026-07-08T12:48:25Z`
3
+ - Generated: `2026-07-08T15:01:19Z`
4
4
  - Workspaces tracked: **10**
5
5
  - Human-review-required artefacts: **3**
6
6
 
@@ -1,6 +1,6 @@
1
1
  {
2
- "checksum": "sha256:4dd1cf9aacb705067e017342c3d7633728bd2822ef8d6d8cacaf8406c7131334",
3
- "generated_at": "2026-07-08T12:48:25Z",
2
+ "checksum": "sha256:9902bbcc7fac058b3506979d8233180ef0a52be98f42cec030433ee6781a5cf3",
3
+ "generated_at": "2026-07-08T15:01:19Z",
4
4
  "scanner_version": "f36b5a348348",
5
5
  "workspaces": [
6
6
  {
@@ -0,0 +1,185 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Consumer host-native rule emission
4
+ * (road-to-request-scoped-rule-load Phase 1b Step 3).
5
+ *
6
+ * Before this CLI, consumer Cursor got a symlink farm to raw `.md` (no
7
+ * `.mdc`, no auto-attach globs) and consumer `.windsurfrules` was built by
8
+ * a bash concatenator that STRIPPED all frontmatter — destroying the
9
+ * host-native trigger signal Phase 2 added to the projection path.
10
+ *
11
+ * ## Recorded decision — install-time emission, not dist artifacts
12
+ *
13
+ * Phase 1b Step 3 asked for one recorded choice: pre-built host artifacts
14
+ * in `dist/` vs emission at install time. Decision: INSTALL-TIME EMISSION,
15
+ * re-using the exported condense emitters (`_emit_cursor_mdc`,
16
+ * `_emit_windsurf_rule`, `strip_frontmatter`) verbatim. Rationale:
17
+ * - a new `dist/agent-src/hosts/` tree would cascade through the
18
+ * discovery manifest, artefact checksums, condensation hashes and the
19
+ * always-budget gates for what is derived data;
20
+ * - dist artifacts are scope-agnostic — install-time emission runs AFTER
21
+ * the Phase-1b rule filter, so scoped installs get scoped host files
22
+ * for free;
23
+ * - re-using the exported emitters keeps consumer output byte-identical
24
+ * to the maintainer projection (Pipeline B never drifts from A).
25
+ * The trade-off (node required at install time) matches the rule-scope
26
+ * resolver: no node → install.sh keeps its legacy fallback surfaces.
27
+ *
28
+ * Usage:
29
+ * emit_host_rules_cli.ts --rules-dir <installed rules dir>
30
+ * --project-root <consumer root>
31
+ * --tools cursor,windsurf
32
+ *
33
+ * Exit codes: 0 emitted · 2 usage error · 1 emission failure (caller falls
34
+ * back to the legacy surface).
35
+ */
36
+ import * as fs from 'node:fs';
37
+ import * as path from 'node:path';
38
+ import process from 'node:process';
39
+ import { fileURLToPath, pathToFileURL } from 'node:url';
40
+ import { _emit_cursor_mdc, _emit_windsurf_rule, strip_frontmatter, } from '../scripts/condense.js';
41
+ function _ruleFiles(rulesDir) {
42
+ return fs
43
+ .readdirSync(rulesDir)
44
+ .filter((n) => n.endsWith('.md'))
45
+ .sort()
46
+ .map((n) => path.join(rulesDir, n))
47
+ .filter((p) => {
48
+ try {
49
+ return fs.statSync(p).isFile();
50
+ }
51
+ catch {
52
+ return false;
53
+ }
54
+ });
55
+ }
56
+ /** Remove entries not in `valid` (mirror of condense's `_clean_modern_dir`). */
57
+ function _cleanDir(dir, valid) {
58
+ let entries;
59
+ try {
60
+ entries = fs.readdirSync(dir);
61
+ }
62
+ catch {
63
+ return;
64
+ }
65
+ for (const name of entries) {
66
+ if (name === 'README.md' || valid.has(name)) {
67
+ continue;
68
+ }
69
+ const full = path.join(dir, name);
70
+ try {
71
+ if (fs.lstatSync(full).isDirectory()) {
72
+ fs.rmSync(full, { recursive: true, force: true });
73
+ }
74
+ else {
75
+ fs.unlinkSync(full);
76
+ }
77
+ }
78
+ catch {
79
+ /* best-effort clean */
80
+ }
81
+ }
82
+ }
83
+ export function emitCursor(rulesDir, projectRoot) {
84
+ const targetDir = path.join(projectRoot, '.cursor', 'rules');
85
+ const files = _ruleFiles(rulesDir);
86
+ const valid = new Set();
87
+ for (const src of files) {
88
+ const name = `${path.basename(src, '.md')}.mdc`;
89
+ _emit_cursor_mdc(src, path.join(targetDir, name));
90
+ valid.add(name);
91
+ }
92
+ _cleanDir(targetDir, valid);
93
+ return files.length;
94
+ }
95
+ export function emitWindsurf(rulesDir, projectRoot) {
96
+ const perRuleDir = path.join(projectRoot, '.windsurf', 'rules');
97
+ const files = _ruleFiles(rulesDir);
98
+ const valid = new Set();
99
+ for (const src of files) {
100
+ const name = path.basename(src);
101
+ _emit_windsurf_rule(src, path.join(perRuleDir, name));
102
+ valid.add(name);
103
+ }
104
+ _cleanDir(perRuleDir, valid);
105
+ // Concatenated legacy surface — same format as the projection-path
106
+ // generator (condense.generate_windsurfrules), consumer-sourced header.
107
+ const parts = ['# Auto-generated from .augment/rules/ — do not edit directly\n'];
108
+ for (const src of files) {
109
+ const content = strip_frontmatter(fs.readFileSync(src, 'utf-8'));
110
+ parts.push(`---\n\n${content.trim()}\n`);
111
+ }
112
+ fs.writeFileSync(path.join(projectRoot, '.windsurfrules'), parts.join('\n') + '\n', 'utf-8');
113
+ return files.length;
114
+ }
115
+ export function main(argv = process.argv.slice(2)) {
116
+ let rulesDir = '';
117
+ let projectRoot = '';
118
+ let tools = [];
119
+ for (let i = 0; i < argv.length; i += 1) {
120
+ const arg = argv[i];
121
+ if (arg === '--rules-dir') {
122
+ rulesDir = argv[i + 1] ?? '';
123
+ i += 1;
124
+ }
125
+ else if (arg === '--project-root') {
126
+ projectRoot = argv[i + 1] ?? '';
127
+ i += 1;
128
+ }
129
+ else if (arg === '--tools') {
130
+ tools = (argv[i + 1] ?? '').split(',').filter((t) => t.length > 0);
131
+ i += 1;
132
+ }
133
+ else {
134
+ process.stderr.write(`emit_host_rules_cli: unknown argument: ${arg}\n`);
135
+ return 2;
136
+ }
137
+ }
138
+ if (rulesDir === '' || projectRoot === '' || tools.length === 0) {
139
+ process.stderr.write('usage: emit_host_rules_cli.ts --rules-dir <dir> --project-root <dir> --tools cursor,windsurf\n');
140
+ return 2;
141
+ }
142
+ if (!fs.existsSync(rulesDir)) {
143
+ process.stderr.write(`emit_host_rules_cli: rules dir not found: ${rulesDir}\n`);
144
+ return 1;
145
+ }
146
+ try {
147
+ for (const tool of tools) {
148
+ if (tool === 'cursor') {
149
+ const n = emitCursor(rulesDir, path.resolve(projectRoot));
150
+ process.stdout.write(`cursor: ${n} .mdc rule(s)\n`);
151
+ }
152
+ else if (tool === 'windsurf') {
153
+ const n = emitWindsurf(rulesDir, path.resolve(projectRoot));
154
+ process.stdout.write(`windsurf: ${n} rule(s) + .windsurfrules\n`);
155
+ }
156
+ else {
157
+ process.stderr.write(`emit_host_rules_cli: unknown tool: ${tool}\n`);
158
+ return 2;
159
+ }
160
+ }
161
+ return 0;
162
+ }
163
+ catch (e) {
164
+ process.stderr.write(`emit_host_rules_cli: emission failed: ${e instanceof Error ? e.message : String(e)}\n`);
165
+ return 1;
166
+ }
167
+ }
168
+ function _isCliEntry() {
169
+ if (process.argv[1] === undefined)
170
+ return false;
171
+ const argvUrl = pathToFileURL(path.resolve(process.argv[1])).href;
172
+ if (import.meta.url === argvUrl)
173
+ return true;
174
+ try {
175
+ return (fs.realpathSync(fileURLToPath(import.meta.url)) ===
176
+ fs.realpathSync(path.resolve(process.argv[1])));
177
+ }
178
+ catch {
179
+ return false;
180
+ }
181
+ }
182
+ if (_isCliEntry()) {
183
+ process.exit(main());
184
+ }
185
+ //# sourceMappingURL=emit_host_rules_cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit_host_rules_cli.js","sourceRoot":"","sources":["../../src/install/emit_host_rules_cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,OAAO,MAAM,c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M,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC;AAED,IAAI,WAAW,EAAE,EAAE,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AACzB,CAAC"}
@@ -13877,6 +13877,12 @@ var settingsSchema = external_exports.object({
13877
13877
  projection: external_exports.object({
13878
13878
  mode: projectionMode.default("legacy-all").describe(
13879
13879
  "Whether the per-tool projector writes EVERY artefact into the host-tool trees (.claude/ .cursor/ .windsurf/) or only the active profile + packs' artefacts (ADR-040, docs/contracts/capability-packs.md). legacy-all = (default, non-breaking) project the full surface exactly as 5.x did. scoped = project only the active profile's packs unioned with the runtime.active_packs overlay, expanded over the requires graph \u2014 opt in with `agent-config use --profile=<id>`. A failed scoped projection restores the full tree."
13880
+ ),
13881
+ rule_workspaces: external_exports.array(external_exports.string()).default([]).describe(
13882
+ "Workspace scope for the RULE layer only (road-to-request-scoped-rule-load P1/P1b, opt-in). Absent or empty = legacy-all: every rule projects AND installs. Non-empty = only rules whose workspaces frontmatter intersects this list are projected (condense) and installed (install.sh + global wizard payload). Kernel rules always ship; untagged rules fail safe. The default flip to a scoped value is a HUMAN release gate \u2014 do not set this from automation."
13883
+ ),
13884
+ rule_packs: external_exports.array(external_exports.string()).default([]).describe(
13885
+ "Optional second scoping axis for the RULE layer, per pack ids (src/config/discovery/packs.yml). When set, a non-kernel rule also needs a packs frontmatter intersection to ship \u2014 e.g. deselecting frontend-design drops ui-audit-gate + design-fidelity. Same opt-in / human-gate semantics as rule_workspaces."
13880
13886
  )
13881
13887
  }).default({ mode: "legacy-all" }),
13882
13888
  rule_loading_tier: ruleLoadingTier.default("balanced").describe(
@@ -103,7 +103,10 @@ export function buildInstallPlan(inputs) {
103
103
  const filesByTool = {};
104
104
  for (const source of inputs.sources) {
105
105
  const bucket = filesByTool[source.toolId] ?? [];
106
- const files = walkSourceTree(source.srcDir);
106
+ let files = walkSourceTree(source.srcDir);
107
+ if (source.fileFilter !== undefined) {
108
+ files = files.filter(source.fileFilter);
109
+ }
107
110
  for (const srcFile of files) {
108
111
  const rel = relative(source.srcDir, srcFile);
109
112
  const destPath = resolve(source.destDir, rel);