@event4u/agent-config 9.10.0 → 9.12.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 (142) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +111 -0
  3. package/README.md +20 -16
  4. package/agents/templates/.ai-council.yml.example +481 -0
  5. package/agents/templates/.ai-video.xml.example +247 -0
  6. package/dist/agent-src/commands/fix/ci.md +29 -0
  7. package/dist/agent-src/commands/pr/create.md +60 -0
  8. package/dist/agent-src/contexts/authority/kernel-rule-edits.md +18 -2
  9. package/dist/agent-src/rules/design-fidelity.md +2 -2
  10. package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +1 -0
  11. package/dist/agent-src/skills/design-intelligence/SKILL.md +27 -1
  12. package/dist/agent-src/skills/design-intelligence/data/font-pairings-reference.csv +74 -74
  13. package/dist/agent-src/skills/design-intelligence/data/manifest.json +2 -0
  14. package/dist/agent-src/skills/design-tokens/scripts/tokens.ts +0 -7
  15. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +15 -2
  16. package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
  17. package/dist/agent-src/skills/typography-system/SKILL.md +55 -11
  18. package/dist/agent-src/skills/ui-apply-generic/SKILL.md +180 -0
  19. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  20. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +34 -30
  21. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
  22. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +23 -0
  23. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +24 -1
  24. package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +332 -0
  25. package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +449 -11
  26. package/dist/agent-src/templates/scripts/work_engine/state.ts +21 -4
  27. package/dist/cli/initRouting.js +74 -11
  28. package/dist/cli/initRouting.js.map +1 -1
  29. package/dist/cli/main.js +14 -3
  30. package/dist/cli/main.js.map +1 -1
  31. package/dist/cli-delegate/chunk-523HCFYO.js +90 -0
  32. package/dist/cli-delegate/chunk-736JCWLM.js +1104 -0
  33. package/dist/cli-delegate/chunk-7HQ52DHU.js +74 -0
  34. package/dist/cli-delegate/chunk-A3HJ6NTI.js +1084 -0
  35. package/dist/cli-delegate/chunk-EJYIGZ3T.js +125 -0
  36. package/dist/cli-delegate/chunk-FTAISGDQ.js +117 -0
  37. package/dist/cli-delegate/chunk-GME3Q44L.js +82 -0
  38. package/dist/cli-delegate/chunk-GRRPEPRN.js +336 -0
  39. package/dist/cli-delegate/chunk-HJ6DAJHR.js +502 -0
  40. package/dist/cli-delegate/chunk-HYWSRNUX.js +179 -0
  41. package/dist/cli-delegate/chunk-J55WI3RR.js +47 -0
  42. package/dist/cli-delegate/chunk-MCJYCQPF.js +35 -0
  43. package/dist/cli-delegate/chunk-NDJLNC6Q.js +169 -0
  44. package/dist/cli-delegate/chunk-OMIVVCG2.js +26 -0
  45. package/dist/cli-delegate/chunk-OY53J6II.js +7336 -0
  46. package/dist/cli-delegate/chunk-QFKQLQ7X.js +10835 -0
  47. package/dist/cli-delegate/chunk-TEGJU2JX.js +6908 -0
  48. package/dist/cli-delegate/chunk-TJIAM5FW.js +133 -0
  49. package/dist/cli-delegate/chunk-XX6TOPD7.js +715 -0
  50. package/dist/cli-delegate/cmd_analyze_session.js +294 -0
  51. package/dist/cli-delegate/cmd_conformance.js +643 -0
  52. package/dist/cli-delegate/cmd_converge.js +326 -0
  53. package/dist/cli-delegate/cmd_doctor.js +142 -0
  54. package/dist/cli-delegate/cmd_explain.js +2576 -0
  55. package/dist/cli-delegate/cmd_export.js +298 -0
  56. package/dist/cli-delegate/cmd_fleet.js +333 -0
  57. package/dist/cli-delegate/cmd_memory_get.js +3878 -0
  58. package/dist/cli-delegate/cmd_migrate.js +11 -0
  59. package/dist/cli-delegate/cmd_preflight.js +153 -0
  60. package/dist/cli-delegate/cmd_prune.js +446 -0
  61. package/dist/cli-delegate/cmd_refresh.js +28 -0
  62. package/dist/cli-delegate/cmd_settings_check.js +574 -0
  63. package/dist/cli-delegate/cmd_settings_migrate.js +225 -0
  64. package/dist/cli-delegate/cmd_sync.js +266 -0
  65. package/dist/cli-delegate/cmd_uninstall.js +657 -0
  66. package/dist/cli-delegate/cmd_update.js +425 -0
  67. package/dist/cli-delegate/cmd_upgrade.js +444 -0
  68. package/dist/cli-delegate/cmd_validate.js +307 -0
  69. package/dist/cli-delegate/cmd_versions.js +370 -0
  70. package/dist/discovery/deprecation-report.md +1 -1
  71. package/dist/discovery/discovery-manifest.json +45 -16
  72. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  73. package/dist/discovery/discovery-manifest.summary.md +3 -3
  74. package/dist/discovery/orphan-report.md +1 -1
  75. package/dist/discovery/packs.json +13 -7
  76. package/dist/discovery/trust-report.md +2 -2
  77. package/dist/discovery/workspaces.json +6 -4
  78. package/dist/install/emit_host_rules_cli.js +2 -1
  79. package/dist/install/emit_host_rules_cli.js.map +1 -1
  80. package/dist/install/install.mjs +634 -409
  81. package/dist/install/ruleInScope.js +123 -0
  82. package/dist/install/ruleInScope.js.map +1 -0
  83. package/dist/install/rule_scope.js +7 -3
  84. package/dist/install/rule_scope.js.map +1 -1
  85. package/dist/install/toolDetection.js +40 -12
  86. package/dist/install/toolDetection.js.map +1 -1
  87. package/dist/install/wizard-plan.js +12 -3
  88. package/dist/install/wizard-plan.js.map +1 -1
  89. package/dist/mcp/registry-manifest.json +3 -3
  90. package/dist/mcp/server.json +2 -2
  91. package/dist/mcp/server.mjs +1553 -2728
  92. package/dist/router.json +1 -1
  93. package/dist/scripts/condense.js +6 -22
  94. package/dist/scripts/condense.js.map +1 -1
  95. package/docs/guidelines/design-fidelity-mechanics.md +14 -0
  96. package/package.json +4 -2
  97. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +34 -30
  98. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
  99. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +23 -0
  100. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +24 -1
  101. package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +332 -0
  102. package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +449 -11
  103. package/src/agent-src/templates/scripts/work_engine/state.ts +21 -4
  104. package/src/config/discovery/packs.yml +7 -0
  105. package/src/config/evaluator-budgets.json +1 -1
  106. package/src/config/pack-size-budget.json +27 -0
  107. package/src/install/emit_host_rules_cli.ts +2 -1
  108. package/src/install/ruleInScope.ts +133 -0
  109. package/src/install/rule_scope.ts +7 -3
  110. package/src/install/toolDetection.ts +39 -8
  111. package/src/install/wizard-plan.ts +13 -3
  112. package/src/scripts/_cli/cmd_conformance.ts +2 -1
  113. package/src/scripts/_cli/cmd_converge.ts +2 -1
  114. package/src/scripts/_cli/cmd_doctor.ts +214 -13
  115. package/src/scripts/_cli/cmd_export.ts +2 -1
  116. package/src/scripts/_cli/cmd_fleet.ts +2 -1
  117. package/src/scripts/_cli/cmd_migrate.ts +2 -1
  118. package/src/scripts/_cli/cmd_preflight.ts +2 -1
  119. package/src/scripts/_cli/cmd_refresh.ts +2 -1
  120. package/src/scripts/_cli/cmd_update.ts +2 -1
  121. package/src/scripts/_cli/cmd_upgrade.ts +2 -1
  122. package/src/scripts/_cli/cmd_versions.ts +2 -1
  123. package/src/scripts/_cli/detection_report.ts +480 -0
  124. package/src/scripts/_dispatch.bash +52 -14
  125. package/src/scripts/_lib/changelog_eras.ts +103 -9
  126. package/src/scripts/_lib/environment_detector.ts +441 -0
  127. package/src/scripts/_lib/global_deploy_inventory.ts +38 -2
  128. package/src/scripts/_lib/package_root.ts +72 -0
  129. package/src/scripts/ai_council/config.ts +15 -7
  130. package/src/scripts/ai_council/modes.ts +68 -2
  131. package/src/scripts/ai_council/transport_resolver.ts +331 -0
  132. package/src/scripts/check_bundle_path_leakage.ts +10 -4
  133. package/src/scripts/check_dependency_floors.ts +153 -0
  134. package/src/scripts/check_installer_import_purity.ts +295 -0
  135. package/src/scripts/check_pack_size.ts +188 -0
  136. package/src/scripts/condense.ts +7 -28
  137. package/src/scripts/council_cli.ts +6 -2
  138. package/src/scripts/evaluator_umbrella.sh +34 -1
  139. package/src/scripts/install-hooks.sh +36 -4
  140. package/src/scripts/install.ts +210 -5
  141. package/src/scripts/lint_eval_fixture_citations.ts +113 -0
  142. package/src/scripts/lint_ui_stack_bundles.ts +201 -0
@@ -0,0 +1,481 @@
1
+ # --- AI Council (external second-opinion network) ---
2
+ #
3
+ # WHERE THIS FILE GOES: copy it to the USER-GLOBAL path
4
+ # ~/.event4u/agent-config/settings/.ai-council.yml
5
+ # and edit it there. This is the ONLY location the council reads (ADR-104,
6
+ # superseding ADR-093) — one global file serves every project, worktree,
7
+ # and CWD. Do NOT place it in a project's `agents/` tree: the project tree
8
+ # is never searched and a `.ai-council.yml` found there is ignored. The
9
+ # only other accepted source is an explicit absolute path in the
10
+ # `$AI_COUNCIL_CONFIG` env var (tests / power users).
11
+ #
12
+ # When enabled, the /council command lets the agent poll independent
13
+ # external models (Anthropic, OpenAI, Gemini, xAI, Perplexity) for a
14
+ # neutral critique of a roadmap, diff, prompt, or file set. Council
15
+ # members never see the host agent's reasoning — only the artefact + a
16
+ # neutral system prompt.
17
+ #
18
+ # Tokens are NEVER stored here. Keys live in 0600 files under
19
+ # ~/.event4u/agent-config/<provider>.key (installed via
20
+ # bash scripts/install_anthropic_key.sh
21
+ # bash scripts/install_openai_key.sh
22
+ # for providers with an installer) or in environment variables. The
23
+ # legacy ~/.config/agent-config/<provider>.key tree is read as a
24
+ # fallback. The `api_key_ref:` field below points at one of those —
25
+ # never at the raw secret. See docs/contracts/ai-council-config.md for
26
+ # the full schema.
27
+ #
28
+ # Cost note: every consultation makes real, paid API calls. The
29
+ # autonomy directive does NOT silently spend tokens — the /council
30
+ # command always asks before invoking, even under autonomy: on.
31
+
32
+ # Master switch (true, false). REQUIRED — the loader has no default for it,
33
+ # so this file's value is the only value.
34
+ #
35
+ # This example ships `true`, and two members below ship `enabled: true`.
36
+ # That is deliberate: the file's job is to be a WORKING starter, and a
37
+ # starter that consults nobody teaches nothing. But be clear about what
38
+ # copying it means — installing a key is not the same as wanting the agent
39
+ # to spend money on it, so review the `members:` block before you copy,
40
+ # and set `enabled: false` on anything you do not want called.
41
+ #
42
+ # `agent-config doctor --check detection` shows, per provider, what this
43
+ # machine detected AND whether it is allowed to spend — so the gap between
44
+ # "could work" and "may spend" is visible rather than mysterious.
45
+ enabled: true
46
+
47
+ # Per-invocation defaults. Each member may override `mode:` below.
48
+ defaults:
49
+ # Default transport mode for every member (overridable per-member
50
+ # below, and per-invocation via `/council mode:<x>`).
51
+ #
52
+ # manual = copy & paste — the human transports prompt + reply
53
+ # between the agent and an external chat surface. Free,
54
+ # no key.
55
+ # api = SDK call against a stored key, per-token billing.
56
+ # cli = shell out to a locally-installed provider CLI under the
57
+ # user's subscription auth (Claude Pro/Max, ChatGPT
58
+ # Plus/Pro, Google Gemini, etc.). Spend is covered by the
59
+ # flat-rate subscription, not per-token. `cost_budget.
60
+ # max_total_usd` does NOT apply; use `cli_call_budget`
61
+ # below to guard subscription quotas.
62
+ # auto = resolve per provider per invocation: the provider's CLI
63
+ # binary resolves AND a credential is present -> cli; else a
64
+ # key resolves -> api; else unavailable with a one-line
65
+ # reason. `manual` is NEVER part of the auto chain (it would
66
+ # always "succeed" and silently turn every call into a
67
+ # copy-paste request) — it stays an explicit opt-in.
68
+ # OPT-IN: `auto` is not the shipped default. Switching to it
69
+ # moves spend from per-token dollars onto your subscription
70
+ # quota, so it is a decision you take, not one you inherit.
71
+ # Set `cli_call_budget` below before you flip it.
72
+ #
73
+ # Precedence: invocation flag > per-member mode > defaults.mode >
74
+ # built-in. Two DIFFERENT defaults sit at the bottom, and they are not
75
+ # the same thing:
76
+ # · omit `defaults.mode` entirely and the loader fills "api" — that is
77
+ # what every real config file observes.
78
+ # · the resolver's built-in fallback, reached only when no layer at all
79
+ # supplies a mode (a settings dict handed straight to the resolver,
80
+ # no config file involved), is "manual" — free, no key. A caller who
81
+ # named no transport has not asked to spend money.
82
+ mode: api
83
+
84
+ # Default number of debate rounds per /council invocation.
85
+ #
86
+ # Round 1 sees the artefact alone. Round 2+ sees the artefact plus
87
+ # anonymised critiques from the previous round (provider/model
88
+ # identity stripped per the neutrality Iron Law). Applies identically
89
+ # to api and manual transports — manual mode runs round 1 across all
90
+ # members, the host agent consolidates, then round 2 starts with the
91
+ # anonymised round-1 critiques folded in.
92
+ #
93
+ # Default is 2 so council members critique each other at least once
94
+ # before convergence. The agent does NOT ask "how many rounds?" when
95
+ # the requested rounds <= min_rounds; pass `rounds:N` on the
96
+ # invocation (or `--rounds N` to the CLI) to override.
97
+ min_rounds: 2
98
+
99
+ # Higher floor for deep-reasoning artefacts (architecture review,
100
+ # refactoring proposals, bug-diagnosis runs). Activated when the
101
+ # consuming rule, skill, or command declares `council_depth: deep`
102
+ # in its frontmatter, or the user passes `--depth deep` to the CLI.
103
+ # Effective rounds = max(deep_min_rounds, min_rounds), so this floor
104
+ # is monotonic — lowering it below `min_rounds` has no effect.
105
+ # Standard tasks keep `min_rounds`; cost rises only when an artefact
106
+ # opts in. Set to `min_rounds` to disable the deep tier.
107
+ deep_min_rounds: 3
108
+
109
+ # Per-member output-token budget passed to every API call. The CLI
110
+ # `--max-tokens` flag overrides this on a single invocation; the
111
+ # cost estimator uses the same value as its worst-case ceiling.
112
+ # `0` means "unlimited" — internally widened to the safe provider
113
+ # ceiling (16384) because Anthropic rejects max_tokens=0. This
114
+ # template ships a right-sized 4096 as a cost lever: council member
115
+ # positions rarely exceed it, and the estimator uses this value as
116
+ # its worst-case ceiling, so a tight default stops the pre-flight
117
+ # gate over-charging. Raise per-run with `--max-tokens`, bump here
118
+ # for consistently long syntheses, or set `0` for the full ceiling.
119
+ max_output_tokens: 4096
120
+
121
+ # Retention for `agents/council-sessions/` audit folders. Sessions
122
+ # older than this are pruned automatically on the next `save()`.
123
+ # `0` disables pruning (keep forever — disk grows unbounded).
124
+ session_retention_days: 7
125
+
126
+ # Reserved by Phase 0, wired in Phase 7 (/council debate). Maximum
127
+ # number of debate rounds before the orchestrator refuses to continue
128
+ # even with --auto-continue. Progressive-disclosure cost gate fires
129
+ # between every round regardless.
130
+ debate_max_rounds: 4
131
+
132
+ # Hard cost ceiling per /council invocation. The orchestrator pauses
133
+ # before any member whose projected spend would breach a cap and asks
134
+ # the user to continue. Each `0` disables that single cap; other caps
135
+ # still apply.
136
+ #
137
+ # Applies to BILLABLE members only. Billing follows the PROVIDER and its
138
+ # credential, never the transport name: `mode: manual` never bills, and
139
+ # `mode: cli` is billable=False for the VENDOR-OFFICIAL CLIs (anthropic,
140
+ # openai, gemini — subscription auth), but stays billable=True for the
141
+ # COMMUNITY wrappers (xai, perplexity), whose CLIs consume the same paid
142
+ # API key as `mode: api`. So `max_total_usd` does NOT gate a vendor CLI
143
+ # member and DOES still gate an xai / perplexity member on any transport.
144
+ # Vendor-CLI subscription quotas are guarded by `cli_call_budget` below.
145
+ #
146
+ # Prices come from agents/.agent-prices.md (gitignored, refreshed weekly
147
+ # by `python3 scripts/update_prices.py`; bootstrapped from
148
+ # scripts/ai_council/_default_prices.py on first run).
149
+ cost_budget:
150
+ max_input_tokens: 500000
151
+ max_output_tokens: 200000
152
+ max_calls: 50
153
+ max_total_usd: 20.0
154
+
155
+ # Phase 8 — Debate cost-visibility + hard refusal cap.
156
+ #
157
+ # `max_cost_usd` is the unconditional refusal cap. When the pre-flight
158
+ # high-end estimate (expected × 1.20 over-run buffer) exceeds the cap,
159
+ # `/council debate` refuses to start — the user must lower `--rounds`,
160
+ # drop members, or raise the cap explicitly. No --proceed-anyway override.
161
+ # Set to 0 to disable the cap (not recommended).
162
+ #
163
+ # `cost_disclosure.mode` ∈ {"always", "above_threshold", "off"}:
164
+ # always — emit the disclosure block before every debate.
165
+ # above_threshold — emit only when expected_usd > threshold_usd.
166
+ # off — power-user opt-out; the refusal cap still fires.
167
+ # `cost_disclosure.show_per_member` toggles the per-member breakdown.
168
+ #
169
+ # Per-lens override for analysis / default (cheap lenses default to off):
170
+ # lenses:
171
+ # analysis:
172
+ # cost_disclosure:
173
+ # mode: above_threshold
174
+ # threshold_usd: 0.50
175
+ debate:
176
+ max_cost_usd: 5.00
177
+ cost_disclosure:
178
+ mode: always
179
+ threshold_usd: 1.00
180
+ show_per_member: true
181
+
182
+ # Per-day call-count guard for `mode: cli` members. The standard
183
+ # `cost_budget` block skips CLI calls because they are billable=False —
184
+ # but provider subscriptions still carry their own quotas (Claude Pro
185
+ # 5h windows, ChatGPT Plus message caps, Gemini free-tier per-day
186
+ # limits). Opt into a per-provider cap; default unset = unlimited from
187
+ # this loader's perspective.
188
+ #
189
+ # Counter state persists at ~/.event4u/agent-config/cli-calls.json
190
+ # with daily UTC reset. Wired by Phase 1 of the CLI-transport roadmap.
191
+ #
192
+ # SHIPPED POPULATED, deliberately: `mode: auto` prefers the cli rung, so
193
+ # shipping that path with no quota guard would miss the point. The caps
194
+ # below are sized from the worst case one invocation can cost — a deep
195
+ # debate is at most `debate_max_rounds` (4) calls per member — so 24
196
+ # permits roughly six full deep debates per provider per day before the
197
+ # guard fires. That is well inside a Pro-tier window while still bounding
198
+ # a runaway loop, and failures count too (a wedged CLI cannot burn the
199
+ # whole budget retrying). Gemini's free tier is the tightest, hence the
200
+ # lower cap. Raise them if you consult heavily; `council:quota` reports
201
+ # usage and `council:quota --reset` clears the day.
202
+ cli_call_budget:
203
+ max_calls_per_day:
204
+ anthropic: 24
205
+ openai: 24
206
+ gemini: 16
207
+ # Warn once usage crosses this fraction of a cap (0..1).
208
+ warn_at: 0.8
209
+
210
+ # Per-member configuration — you decide what may spend; detection tells
211
+ # you what is already here.
212
+ #
213
+ # DON'T hand-audit this block. Run:
214
+ #
215
+ # agent-config doctor --check detection
216
+ #
217
+ # It reports, per provider: detected · authenticated · auth source ·
218
+ # billing class · enabled-in-config, the transport `mode: auto` would
219
+ # pick, and a one-line fix for anything unusable. Everything a comment
220
+ # here used to have to explain — which binary, whether a key resolves,
221
+ # whether the CLI is logged in, whether spend is metered or on your
222
+ # subscription — that command answers against YOUR machine.
223
+ #
224
+ # What stays your call is the last column: `enabled`. Detection reports
225
+ # capability; it never grants permission. A provider can be fully
226
+ # detected and still sit at `enabled: false`, and that is a recorded
227
+ # decision, not a misconfiguration — `doctor` prints the exact one-line
228
+ # edit when you want to change it.
229
+ #
230
+ # The three fields:
231
+ # model: which model receives the query.
232
+ # api_key_ref: a 0600 key file (`file:<name>` — relative paths resolve
233
+ # under ~/.event4u/agent-config/, legacy
234
+ # ~/.config/agent-config/ read as a fallback) or an env
235
+ # var (`env:<VAR>`). Raw keys here are a hard validation
236
+ # error. Required for mode: api; optional for cli /
237
+ # manual / auto (those may authenticate via the CLI).
238
+ # mode: overrides defaults.mode for this member only.
239
+ # binary: absolute path to the provider's CLI — only valid when
240
+ # the effective mode is `cli` or `auto`. Omit it and the
241
+ # default binary name is resolved on $PATH.
242
+ #
243
+ # --- Low-impact fast-path opt-in (Phase 11, default OFF) ---
244
+ # `decision_resolution.classes.low_impact.mode` (see below) defaults
245
+ # to `agent` — low-impact questions resolve on the host and the
246
+ # council never sees them. Routing low-impact to the council is an
247
+ # EXPLICIT TWO-KNOB OPT-IN:
248
+ # 1. flip the class to `mode: council` in `decision_resolution`
249
+ # 2. set `participate_low_impact: true` on each member that should
250
+ # run on the fast-path (default `false`, per-member opt-in)
251
+ # Missing either knob → fast-path stays unavailable; the loader
252
+ # warns and the resolver falls back to `agent` (or escalates to the
253
+ # user when confidence is below the threshold). See
254
+ # docs/contracts/ai-council-config.md § "Low-impact council opt-in"
255
+ # for the worked example, validation behaviour, and transparency
256
+ # markers.
257
+ members:
258
+ anthropic:
259
+ enabled: true
260
+ model: claude-sonnet-4-5
261
+ api_key_ref: file:anthropic.key
262
+ # mode: cli # use subscription auth (Claude Pro/Max) — free, see cli_call_budget above
263
+ # binary: /usr/local/bin/claude # only valid when mode == cli
264
+ # Phase 7 — size-fit downgrade ladder (smallest → largest). The
265
+ # active `model:` above must appear on this list. When the size
266
+ # classifier flags a request as oversized, it suggests the next
267
+ # rung *down*; the top rung is the default for complex prompts.
268
+ model_ladder:
269
+ - claude-haiku-4-5
270
+ - claude-sonnet-4-5
271
+ - claude-opus-4-5
272
+ # Prompt caching (GA — no beta header) is ON by default: the stable
273
+ # system + artefact prefix is sent as a cache-controlled block, so
274
+ # members 2..N in a round (and round-2+ within the 5-min TTL) read
275
+ # it at ~0.1x input cost. Kill-switch — uncomment to disable:
276
+ # prompt_cache: false
277
+ # Phase 4 (road-to-cache-economy) — TTL tier for both breakpoints.
278
+ # '5m' is the permanent default; do NOT set '1h' without first
279
+ # confirming the falsification condition in
280
+ # docs/contracts/ai-council-config.md § prompt_cache.ttl.
281
+ # prompt_cache:
282
+ # ttl: 5m
283
+ # Phase 11 — opt this member in to the lightweight-QA fast-path.
284
+ # Only opted-in members run when a `low_impact` question routes
285
+ # to `council`. Loader default is false, and this example ships
286
+ # false to match: the fast-path bypasses the standard fan-out, so
287
+ # pre-flipping a consent knob on the user's behalf is exactly the
288
+ # thing the master-switch note above warns against. The OTHER knob
289
+ # (`decision_resolution.classes.low_impact.mode`) also defaults to
290
+ # `agent`, so the fast-path stays unavailable until you flip both.
291
+ participate_low_impact: false
292
+
293
+ openai:
294
+ enabled: true
295
+ model: gpt-4o
296
+ api_key_ref: file:openai.key
297
+ # mode: cli # use subscription auth (ChatGPT Plus/Pro via Codex CLI) — free
298
+ # binary: /usr/local/bin/codex # only valid when mode == cli
299
+ # Phase 7 — size-fit downgrade ladder (smallest → largest). The
300
+ # active `model:` above must appear on this list.
301
+ model_ladder:
302
+ - gpt-4o-mini
303
+ - gpt-4o
304
+ - gpt-4.1
305
+ # See the anthropic member above — ships false, loader default false.
306
+ participate_low_impact: false
307
+
308
+ gemini:
309
+ enabled: false
310
+ model: gemini-2.5-pro
311
+ api_key_ref: env:GEMINI_API_KEY
312
+ # mode: cli # use Google account (free-tier limits apply) — free
313
+ # binary: /usr/local/bin/gemini # only valid when mode == cli
314
+
315
+ xai:
316
+ enabled: false
317
+ model: grok-4
318
+ api_key_ref: env:XAI_API_KEY
319
+ # mode: cli # community `grok` CLI (Superagent) — ergonomic shortcut, NOT a billing change.
320
+ # binary: /usr/local/bin/grok # The CLI consumes XAI_API_KEY and remains billable=True;
321
+ # # cost_budget.max_total_usd STILL applies. Opt-in only.
322
+
323
+ perplexity:
324
+ enabled: false
325
+ model: sonar-pro
326
+ api_key_ref: env:PERPLEXITY_API_KEY
327
+ # mode: cli # community `perplexity` CLI — ergonomic shortcut, NOT a billing change.
328
+ # binary: /usr/local/bin/perplexity # The CLI consumes PERPLEXITY_API_KEY and remains billable=True;
329
+ # # cost_budget.max_total_usd STILL applies. Opt-in only.
330
+
331
+ # Thinking-style advisors (replace-mode). When any `advisors.<key>.enabled:
332
+ # true`, the orchestrator REPLACES that advisor's `member:` plain-member
333
+ # call with an advisor-persona call on the same provider. Plain calls
334
+ # fire only for providers whose enabled member is NOT the target of an
335
+ # active advisor.
336
+ #
337
+ # Per-advisor fields:
338
+ # enabled: <bool> — off by default; opt-in per advisor.
339
+ # member: <provider> — required; which enabled provider runs this
340
+ # advisor (validation fails closed if the named
341
+ # member is missing or disabled).
342
+ # model: <string> — optional; overrides the member's plain model
343
+ # for this advisor call only. Falls back to the
344
+ # member's `model:` when omitted.
345
+ #
346
+ # Persona files live under .agent-src.uncondensed/personas/advisors/
347
+ # and ship with the package; the orchestrator loads them from
348
+ # dist/agent-src/personas/advisors/<key>.md (condensed projection) at call
349
+ # time. See personas/advisors/ + docs/contracts/ai-council-config.md.
350
+ advisors:
351
+ contrarian:
352
+ enabled: false
353
+ member: anthropic
354
+ # model: claude-opus-4 # uncomment to pin a specific model
355
+ first-principles:
356
+ enabled: false
357
+ member: anthropic
358
+ expansionist:
359
+ enabled: false
360
+ member: openai
361
+ outsider:
362
+ enabled: false
363
+ member: openai
364
+ executor:
365
+ enabled: false
366
+ member: anthropic
367
+
368
+ # Consensus-scoring round (Phase 4 / F3). After the final deliberation
369
+ # round and before synthesis, members score each other's anonymised
370
+ # findings (1-10 + agree/disagree + one-line reason). The renderer
371
+ # buckets findings by consensus strength:
372
+ #
373
+ # strength > strong_threshold → "Strong Consensus" (top of output)
374
+ # minority < strength ≤ strong → "Findings" (default body)
375
+ # strength ≤ minority_threshold → "Minority Views" (footer, kept)
376
+ #
377
+ # Cost: one extra inference call per member per consultation. The
378
+ # `council:estimate` command accounts for this when `enabled: true` and
379
+ # the active lens is in `lenses`. Default off — opt in deliberately.
380
+ consensus_scoring:
381
+ enabled: false
382
+ strong_threshold: 0.7
383
+ minority_threshold: 0.4
384
+ lenses:
385
+ - analysis
386
+
387
+ # Peer-review pass (Phase 5 / F1, anonymous peer review). After the
388
+ # final deliberation round and before synthesis, each member sees the
389
+ # OTHER members' anonymised outputs (Response-A, Response-B, …) and
390
+ # returns a critique focused on:
391
+ #
392
+ # - Strongest response (and why)
393
+ # - Weakest blind spot
394
+ # - What everyone missed
395
+ #
396
+ # Provider/model identity is stripped (Iron Law of Neutrality); advisor
397
+ # personas (Phase 6) are preserved as signal. The synthesis template
398
+ # gains a "Peer-Review-Surfaced Blind Spots" slot.
399
+ #
400
+ # Cost: one extra inference call per billable member per consultation.
401
+ # Opt-in per R2 verdict — default off. Activated either via this flag
402
+ # or the `--peer-review` CLI flag.
403
+ peer_review:
404
+ enabled: false
405
+
406
+ # Council-necessity classifier (Phase 6). Heuristic pre-flight that
407
+ # decides whether the prompt actually warrants a council deliberation
408
+ # before any member fires. Three verdicts drive three exit paths:
409
+ #
410
+ # necessary / borderline → proceed (council runs)
411
+ # unnecessary → skip (agent) or educate (user_explicit)
412
+ #
413
+ # The classifier is shape-based (word-boundary regex over trigger
414
+ # buckets) — fast, deterministic, no LLM pre-flight cost. False
415
+ # positives on `necessary` are preferable to false negatives; the
416
+ # educate path lets the user override a wrong `unnecessary` verdict
417
+ # via `--proceed-anyway`.
418
+ #
419
+ # Modes:
420
+ # off = classifier disabled entirely (legacy behaviour)
421
+ # educate = unnecessary + user_explicit → educate paragraph + exit 2
422
+ # unnecessary + agent → silent skip + exit 0
423
+ # block = unnecessary → skip on both invocation paths (no override)
424
+ #
425
+ # See docs/contracts/ai-council-config.md for the trigger lists and
426
+ # per-lens override schema (`lenses.<lens>.necessity_classifier.mode`).
427
+ necessity_classifier:
428
+ enabled: true
429
+ mode: educate
430
+
431
+
432
+ # ── Decision resolution by impact (Phase 10) ────────────────────────────────
433
+ # Five-class impact classifier routes pending agent questions:
434
+ # trivial → agent (naming, whitespace, comments)
435
+ # low_impact → agent (local idioms, DTOs, test extensions)
436
+ # medium_impact → council (API shape, contract changes)
437
+ # high_impact → user (LOCKED — security, auth, migrations, billing)
438
+ # user_required → user (LOCKED — explicit "ask me" / "review first")
439
+ #
440
+ # Iron Law: `high_impact` and `user_required` ALWAYS route to the user.
441
+ # Remapping either to `agent` or `council` is rejected at schema load.
442
+ # `confidence_threshold` is the minimum classifier confidence required to
443
+ # keep the configured mode; below it the mode is upgraded one rung
444
+ # (agent → council → user).
445
+ #
446
+ # See docs/contracts/ai-council-config.md for the trigger lists and the
447
+ # Iron-Law clause.
448
+ decision_resolution:
449
+ enabled: true
450
+ classes:
451
+ trivial:
452
+ mode: agent
453
+ confidence_threshold: 0.6
454
+ low_impact:
455
+ mode: agent
456
+ confidence_threshold: 0.6
457
+ medium_impact:
458
+ mode: council
459
+ confidence_threshold: 0.6
460
+ high_impact:
461
+ mode: user # LOCKED — Iron Law
462
+ confidence_threshold: 0.6
463
+ user_required:
464
+ mode: user # LOCKED — Iron Law
465
+ confidence_threshold: 0.6
466
+
467
+ # Phase 11: lightweight-QA fast-path. Hard caps for `low_impact`
468
+ # resolutions that route to `council`. Cuts latency + spend by
469
+ # narrowing the fan-out to opted-in members only and stripping
470
+ # debate. Multi-round is structurally forbidden — `max_rounds`
471
+ # MUST stay 1 (the loader rejects any other value).
472
+ #
473
+ # Opt members in via `members.<name>.participate_low_impact: true`
474
+ # below. With no opt-in, fast-path is unavailable and the caller
475
+ # falls back to the standard council path or escalates to user.
476
+ fast_path:
477
+ max_members: 2 # 1 or 2 only — wider fan-out belongs to standard council
478
+ max_rounds: 1 # LOCKED — Iron Law of the fast-path
479
+ max_tokens: 2500 # combined input + output budget per resolution
480
+ max_cost_usd: 0.05 # USD ceiling per resolution
481
+