@event4u/agent-config 9.35.0 → 10.0.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 (117) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +95 -142
  3. package/agents/templates/.ai-council.yml.example +31 -51
  4. package/dist/agent-src/commands/analyze/conformance.md +15 -4
  5. package/dist/agent-src/commands/analyze/reference-repo.md +135 -42
  6. package/dist/agent-src/contexts/augment-infrastructure.md +1 -1
  7. package/dist/agent-src/rules/design-review-after-ui-write.md +53 -6
  8. package/dist/agent-src/rules/improve-before-implement.md +1 -1
  9. package/dist/agent-src/rules/session-canary.md +28 -0
  10. package/dist/agent-src/rules/ui-audit-gate.md +35 -0
  11. package/dist/agent-src/skills/design-system-capture/SKILL.md +2 -2
  12. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +1 -1
  13. package/dist/agent-src/skills/fe-design/SKILL.md +84 -12
  14. package/dist/agent-src/skills/fe-design/evals/triggers.json +11 -3
  15. package/dist/agent-src/skills/prediction-pool-optimizer/SKILL.md +5 -5
  16. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +1 -1
  17. package/dist/agent-src/skills/skill-writing/SKILL.md +24 -0
  18. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +29 -0
  19. package/dist/agent-src/templates/AGENTS.md +1 -1
  20. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  21. package/dist/cli-delegate/{chunk-2TGMGLBL.js → chunk-2H5SE7DU.js} +35 -5
  22. package/dist/cli-delegate/{chunk-DS6BLDMG.js → chunk-3JUTT26I.js} +8 -3
  23. package/dist/cli-delegate/{chunk-ZAXH3ZWU.js → chunk-HJSKTMIF.js} +14 -13
  24. package/dist/cli-delegate/{chunk-QEEB4LHO.js → chunk-LRXJK6GN.js} +1 -1
  25. package/dist/cli-delegate/{chunk-736JCWLM.js → chunk-M2DPGFZ4.js} +10 -0
  26. package/dist/cli-delegate/{chunk-H6F2CQFI.js → chunk-NX5AXSLD.js} +3 -3
  27. package/dist/cli-delegate/{chunk-AG47LAGQ.js → chunk-TVGXH7VA.js} +1 -1
  28. package/dist/cli-delegate/{chunk-55RI5UXK.js → chunk-XT2YTJCZ.js} +22 -18
  29. package/dist/cli-delegate/{chunk-JEJABGKB.js → chunk-XTC5ARB6.js} +16 -12
  30. package/dist/cli-delegate/cmd_analyze_session.js +1 -1
  31. package/dist/cli-delegate/cmd_brand_status.js +1 -1
  32. package/dist/cli-delegate/cmd_conformance.js +1038 -197
  33. package/dist/cli-delegate/cmd_doctor.js +4 -4
  34. package/dist/cli-delegate/cmd_explain.js +2 -2
  35. package/dist/cli-delegate/cmd_export.js +4 -4
  36. package/dist/cli-delegate/cmd_handoff.js +3 -3
  37. package/dist/cli-delegate/cmd_mcp_available.js +1 -1
  38. package/dist/cli-delegate/cmd_migrate.js +2 -2
  39. package/dist/cli-delegate/cmd_packs_active.js +2 -2
  40. package/dist/cli-delegate/cmd_prune.js +4 -4
  41. package/dist/cli-delegate/cmd_refresh.js +1 -1
  42. package/dist/cli-delegate/cmd_route_audit.js +2 -2
  43. package/dist/cli-delegate/cmd_route_explain.js +1 -1
  44. package/dist/cli-delegate/cmd_session_recycle.js +9 -2
  45. package/dist/cli-delegate/cmd_settings_get.js +1 -1
  46. package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
  47. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  48. package/dist/cli-delegate/cmd_sync.js +4 -4
  49. package/dist/cli-delegate/cmd_uninstall.js +4 -4
  50. package/dist/cli-delegate/cmd_update.js +1 -1
  51. package/dist/cli-delegate/cmd_upgrade.js +2 -2
  52. package/dist/cli-delegate/cmd_validate.js +4 -4
  53. package/dist/cli-delegate/cmd_versions.js +1 -1
  54. package/dist/discovery/deprecation-report.md +1 -1
  55. package/dist/discovery/discovery-manifest.json +14 -14
  56. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  57. package/dist/discovery/discovery-manifest.summary.md +1 -1
  58. package/dist/discovery/dormancy-report.md +1 -1
  59. package/dist/discovery/orphan-report.md +1 -1
  60. package/dist/discovery/packs.json +2 -2
  61. package/dist/discovery/trust-report.md +1 -1
  62. package/dist/discovery/workspaces.json +2 -2
  63. package/dist/hooks/dispatch.js +654 -411
  64. package/dist/install/install.mjs +39 -29
  65. package/dist/mcp/registry-manifest.json +1 -1
  66. package/dist/mcp/server.json +2 -2
  67. package/dist/mcp/server.mjs +1580 -617
  68. package/dist/router.json +1 -1
  69. package/dist/scripts/_lib/agent_settings.js +39 -25
  70. package/dist/scripts/_lib/agent_settings.js.map +1 -1
  71. package/dist/scripts/condense.js +15 -2
  72. package/dist/scripts/condense.js.map +1 -1
  73. package/dist/server/routes/wizard.js +23 -3
  74. package/dist/server/routes/wizard.js.map +1 -1
  75. package/dist/server/schemas/settings.js +11 -6
  76. package/dist/server/schemas/settings.js.map +1 -1
  77. package/docs/contracts/settings-classes.md +16 -9
  78. package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +46 -4
  79. package/package.json +2 -2
  80. package/src/agent-src/templates/AGENTS.md +1 -1
  81. package/src/config/agent-settings.template.yml +38 -36
  82. package/src/config/ci-local-parity.yml +44 -0
  83. package/src/config/gate-coverage.yml +12 -0
  84. package/src/scripts/_cli/cmd_doctor.ts +32 -0
  85. package/src/scripts/_cli/cmd_migrate.ts +26 -3
  86. package/src/scripts/_cli/cmd_refresh.ts +29 -0
  87. package/src/scripts/_cli/cmd_session_recycle.ts +40 -2
  88. package/src/scripts/_lib/agent_settings.ts +39 -25
  89. package/src/scripts/_lib/environment_detector.ts +52 -1
  90. package/src/scripts/_lib/hook_settings.ts +79 -0
  91. package/src/scripts/_lib/ui_surface.ts +97 -0
  92. package/src/scripts/ai_council/config.ts +62 -24
  93. package/src/scripts/before_complete_hook.ts +39 -0
  94. package/src/scripts/capture_skill_catalogue.ts +483 -0
  95. package/src/scripts/check_bridge_derivation.ts +89 -3
  96. package/src/scripts/check_ci_local_parity.ts +74 -0
  97. package/src/scripts/check_references.ts +15 -1
  98. package/src/scripts/condense.ts +16 -2
  99. package/src/scripts/conformance_scan.ts +200 -9
  100. package/src/scripts/council_cli.ts +95 -3
  101. package/src/scripts/hook_manifest.yaml +30 -9
  102. package/src/scripts/hooks/block_no_verify.ts +82 -9
  103. package/src/scripts/hooks/concern_registry.ts +2 -0
  104. package/src/scripts/hooks/design_slop_hook.ts +1 -1
  105. package/src/scripts/hooks/turn_end_gate_hook.ts +138 -105
  106. package/src/scripts/hooks/ui_route_nudge_hook.ts +250 -0
  107. package/src/scripts/lint_roadmap_complexity.ts +60 -0
  108. package/src/scripts/lint_rule_skill_pack_reach.ts +263 -0
  109. package/src/scripts/probe_promissory_closing.ts +180 -0
  110. package/src/scripts/probe_session_canary.ts +180 -0
  111. package/src/scripts/report_consultation_rate.ts +358 -0
  112. package/src/scripts/report_skill_activation.ts +5 -1
  113. package/src/server/schemas/settings.ts +14 -13
  114. /package/dist/agent-src/skills/design-system-capture/{reference → references}/design-system-json.md +0 -0
  115. /package/dist/agent-src/skills/prediction-pool-optimizer/{reference → references}/ev-fixtures.md +0 -0
  116. /package/dist/agent-src/skills/prediction-pool-optimizer/{reference → references}/odds-and-bonus.md +0 -0
  117. /package/dist/agent-src/skills/react-shadcn-ui/{reference → references}/registry.md +0 -0
@@ -94,7 +94,7 @@ biggest publicly-viewable books**, not a single portal:
94
94
  each special/award market a bonus question needs) from several books.
95
95
  Odds-comparison aggregators (Oddschecker, Oddsportal / Betexplorer) show
96
96
  many books at once; supplement with named books. Concrete book list and
97
- the weighting recipe live in [`reference/odds-and-bonus.md`](reference/odds-and-bonus.md).
97
+ the weighting recipe live in [`references/odds-and-bonus.md`](references/odds-and-bonus.md).
98
98
  2. **De-vig each book** independently (remove its margin) → per-book implied
99
99
  probabilities. Raw odds sum to >100%; never treat them as probabilities.
100
100
  3. **Aggregate with a healthy weighting**, not a blind average: weight
@@ -203,7 +203,7 @@ Respect all strategy limits from step 1 (max identical tips, etc.).
203
203
 
204
204
  Walk the **step-1 checklist** and answer **each** entry. Pick the method by
205
205
  question type — full taxonomy + per-type method in
206
- [`reference/odds-and-bonus.md`](reference/odds-and-bonus.md):
206
+ [`references/odds-and-bonus.md`](references/odds-and-bonus.md):
207
207
 
208
208
  - **Tournament structure** (group winners, KO rounds, finalists, champion):
209
209
  use real **outright market odds** ("to win group", "to reach final",
@@ -253,7 +253,7 @@ deadline is the only hard constraint.
253
253
 
254
254
  3. **Group standings and the full bracket** where the event has them.
255
255
  4. **Self-check note** — (a) confirm the tips reconcile with
256
- [`reference/ev-fixtures.md`](reference/ev-fixtures.md) (known pool rules +
256
+ [`references/ev-fixtures.md`](references/ev-fixtures.md) (known pool rules +
257
257
  market odds → a known-good EV tip); (b) confirm the bonus table has the
258
258
  **same number of rows as the step-1 checklist** — a shorter table means a
259
259
  question was dropped. If your method disagrees with a fixture, your method
@@ -310,10 +310,10 @@ gate — the skill never enters or submits anything.
310
310
 
311
311
  - [`/prediction-pool`](../../commands/prediction-pool.md) — the orchestrator (event,
312
312
  persistence, Playwright entry, gates).
313
- - [`reference/odds-and-bonus.md`](reference/odds-and-bonus.md) — the major-book
313
+ - [`references/odds-and-bonus.md`](references/odds-and-bonus.md) — the major-book
314
314
  list + sharpness-weighted consensus recipe, and the bonus / award / special
315
315
  question taxonomy with a per-type method.
316
- - [`reference/ev-fixtures.md`](reference/ev-fixtures.md) — known-good
316
+ - [`references/ev-fixtures.md`](references/ev-fixtures.md) — known-good
317
317
  rules+odds → EV examples.
318
318
  - `node_modules/@event4u/agent-config/src/scripts/prediction-pool/score_ev.ts` —
319
319
  the executed exact-score EV optimiser (step 4a; λ + rule → EV-max scoreline).
@@ -132,7 +132,7 @@ The default path is the bundled `scripts/shadcn_add.ts` CLI wrapper + reading
132
132
  `components.json` — it works on most shadcn projects and stays the default.
133
133
  The modern registry model is an **opt-in enhancement**; do not add round-trips
134
134
  to every component op. Full JSON-schema + namespace detail is lazy-loaded from
135
- [`reference/registry.md`](reference/registry.md) — read it only on this path,
135
+ [`references/registry.md`](references/registry.md) — read it only on this path,
136
136
  not on the vanilla `add`.
137
137
 
138
138
  **`shadcn info --json` handshake** — run it as the grounding step **when** the
@@ -106,6 +106,30 @@ Do NOT create a skill or rule for:
106
106
  * If two skills overlap heavily → merge
107
107
  * If a skill becomes "read the guideline" → it lost its purpose, restore the workflow
108
108
 
109
+ ### Progressive disclosure — the directory is `references/`, plural
110
+
111
+ When a skill needs depth the workflow does not, the depth goes in a
112
+ **`references/`** subdirectory beside `SKILL.md` — that exact name, plural. It
113
+ was two spellings across nine skills until 2026-08-12 because nothing here
114
+ named one; the split cost a rename, not a decision.
115
+
116
+ * **Body:** the trigger, the workflow, the ownership statement, and every
117
+ heuristic that changes a write decision. A skill whose body is a map to its
118
+ own content is loaded and not applied.
119
+ * **`references/`:** corpora, lookup tables, long schemas, worked examples —
120
+ read on the path that needs them, never on every activation.
121
+
122
+ Splitting is not a size escape hatch. The measured estate (n=289, 2026-08-12):
123
+ median 1,077 words, p90 1,867, **only 6 skills above 2,500 and 4 above 3,000**.
124
+ So a skill at 1,500 words is ordinary, and moving prose out of the body to hit
125
+ a number makes it worse. Split when the material is genuinely
126
+ consulted-on-demand; keep the load-bearing part in the body even when that
127
+ leaves the file long.
128
+
129
+ A `references/` split does not change the gates that already apply: a
130
+ `token_budget_class: rich` skill still meets its 3,500-token ceiling on the
131
+ body alone.
132
+
109
133
  ## Procedure
110
134
 
111
135
  ### 0. Inspect, then run the Drafting Protocol
@@ -23,6 +23,35 @@ Every prompt cites the status taxonomy in
23
23
  ends with the **return-envelope** instruction so the subagent's reply
24
24
  validates against that schema.
25
25
 
26
+ ### UI-shaped slices carry the design context, or name its absence
27
+
28
+ A delegated worker's context is whatever the dispatch prompt carries. For a
29
+ slice that writes UI, that has a specific consequence: the audit findings and
30
+ the design brief live in the orchestrator's context, and nothing moves them
31
+ across the dispatch boundary on its own. A worker that receives "build the
32
+ settings page" and nothing else will build it from priors — the same failure
33
+ the design skills exist to prevent, one layer down.
34
+
35
+ So a UI-shaped dispatch prompt carries, in its `CONTEXT FILES:` section:
36
+
37
+ - the **audit findings** from `existing-ui-audit` (components, tokens, layout
38
+ conventions the project already has), and
39
+ - the **design brief** — `layout`, `components`, `states`, `microcopy`, `a11y`,
40
+ with all five states covered.
41
+
42
+ When either is genuinely absent, **say so in the prompt** rather than omitting
43
+ it silently: `no audit findings available — run existing-ui-audit first`. A
44
+ worker told the context is missing can ask for it; a worker told nothing
45
+ assumes there was nothing to know.
46
+
47
+ **This is model-carried, and the reason is worth stating.** An orchestration
48
+ record carries `ts`, `spawn_count`, `token_delta`, `tier_chosen` and
49
+ `task_class` — it has no field able to hold a prompt, deliberately, for the same
50
+ privacy-by-construction reason the telemetry event has none. So no lint can join
51
+ a dispatch prompt against its record to check this clause: the data a check
52
+ would need does not exist and should not be made to exist. The obligation is
53
+ stated here and carried by the orchestrator, not enforced.
54
+
26
55
  ## Prompt-cache discipline
27
56
 
28
57
  When dispatching sibling subagents (e.g. `do-in-parallel` with N independent
@@ -14,7 +14,7 @@
14
14
  ## Pointers
15
15
 
16
16
  - **Filling out this AGENTS.md** — section templates, capability bullets, multi-agent entry flow, monorepo layout: [`consumer-agents-md-guide`](.augment/contexts/contracts/consumer-agents-md-guide.md).
17
- - **Behavior rules (always active)** — [`.augment/rules/`](.augment/rules/). Kernel rules are **immutable**; tighten only via the override registry.
17
+ - **Behavior rules** (9 always-on; rest routed) — [`.augment/rules/`](.augment/rules/). Kernel rules are **immutable**; tighten only via the override registry.
18
18
  - **Skills (on-demand expertise)** — domain skills surfaced by description, invoked on trigger match: [`.augment/skills/`](.augment/skills/).
19
19
  - **Commands (workflows)** — slash-commands the agent runs end-to-end (`/work`, `/create-pr`, …): [`.augment/commands/`](.augment/commands/).
20
20
  - **Project-specific docs** — your own architecture notes, roadmaps, sessions, contexts: [`agents/`](agents/).
@@ -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: "9.35.0"
42
+ agent_config_version: "10.0.0"
43
43
 
44
44
  # --- Project identity ---
45
45
  project:
@@ -18,7 +18,7 @@ import {
18
18
  hardenedSpawnEnv,
19
19
  scanTranscripts,
20
20
  weightedInputUnits
21
- } from "./chunk-55RI5UXK.js";
21
+ } from "./chunk-XT2YTJCZ.js";
22
22
  import {
23
23
  git_common_dir
24
24
  } from "./chunk-PZWRPRWP.js";
@@ -26,7 +26,7 @@ import {
26
26
  DEFAULT_GITATTRIBUTES,
27
27
  SECTION_HEADER,
28
28
  _is_source_repo
29
- } from "./chunk-736JCWLM.js";
29
+ } from "./chunk-M2DPGFZ4.js";
30
30
  import {
31
31
  DEFAULT_DEPLOY_ROOTS,
32
32
  MANAGED_SIGNATURE,
@@ -52,7 +52,7 @@ import {
52
52
  load_agent_settings,
53
53
  project_settings_path,
54
54
  resolve_project_root
55
- } from "./chunk-JEJABGKB.js";
55
+ } from "./chunk-XTC5ARB6.js";
56
56
  import {
57
57
  event4u_root,
58
58
  resolve_with_fallback,
@@ -3777,6 +3777,22 @@ function homeOf(env) {
3777
3777
  return injected !== "" ? injected : os.homedir();
3778
3778
  }
3779
3779
  var VERSION_PROBE_TIMEOUT_MS = 2e3;
3780
+ var CLAUDE_KEYCHAIN_SERVICE = "Claude Code-credentials";
3781
+ function defaultProbeKeychain(service) {
3782
+ if (process.platform !== "darwin") return false;
3783
+ try {
3784
+ const res = spawnSync2("security", ["find-generic-password", "-s", service], {
3785
+ timeout: VERSION_PROBE_TIMEOUT_MS,
3786
+ encoding: "utf-8",
3787
+ windowsHide: true,
3788
+ env: hardenedSpawnEnv()
3789
+ });
3790
+ if (res.error !== void 0 || res.signal !== null) return false;
3791
+ return res.status === 0;
3792
+ } catch {
3793
+ return false;
3794
+ }
3795
+ }
3780
3796
  function defaultProbeVersion(binary) {
3781
3797
  try {
3782
3798
  const res = spawnSync2(binary, ["--version"], {
@@ -3822,13 +3838,16 @@ function classifyCodexAuth(authPath) {
3822
3838
  if (hasOauth) return "cli-subscription";
3823
3839
  return "cli-api-key";
3824
3840
  }
3825
- function cliSubscriptionEvidence(provider, home, env, claudeConfigDir) {
3841
+ function cliSubscriptionEvidence(provider, home, env, claudeConfigDir, probeKeychain) {
3826
3842
  if (provider === "anthropic") {
3827
3843
  const configDir = claudeConfigDir;
3828
3844
  for (const rel of [".credentials.json", "credentials.json"]) {
3829
3845
  const p = path12.join(configDir, rel);
3830
3846
  if (isFile(p)) return { source: "cli-subscription", evidence: p };
3831
3847
  }
3848
+ if (probeKeychain(CLAUDE_KEYCHAIN_SERVICE)) {
3849
+ return { source: "cli-subscription", evidence: `keychain:${CLAUDE_KEYCHAIN_SERVICE}` };
3850
+ }
3832
3851
  return null;
3833
3852
  }
3834
3853
  if (provider === "openai") {
@@ -3870,10 +3889,11 @@ function detectAuth(opts) {
3870
3889
  const env = opts.env ?? process.env;
3871
3890
  const home = opts.home ?? homeOf(opts.env);
3872
3891
  const claudeConfigDir = opts.home === void 0 && opts.env === void 0 ? claude_config_dir() : (env["CLAUDE_CONFIG_DIR"] ?? "").trim() || path12.join(home, ".claude");
3892
+ const probeKeychain = opts.probeKeychain ?? defaultProbeKeychain;
3873
3893
  const auth = [];
3874
3894
  const keys = [];
3875
3895
  for (const provider of knownProviders()) {
3876
- const cli = cliSubscriptionEvidence(provider, home, env, claudeConfigDir);
3896
+ const cli = cliSubscriptionEvidence(provider, home, env, claudeConfigDir, probeKeychain);
3877
3897
  if (cli !== null) {
3878
3898
  auth.push({ provider, source: cli.source, evidence: cli.evidence });
3879
3899
  }
@@ -7010,9 +7030,19 @@ function main4(argv = null) {
7010
7030
  return drift_present ? 1 : 0;
7011
7031
  }
7012
7032
  function _isCliEntry2() {
7033
+ const bundled = true;
7034
+ const cliDelegate = true;
7035
+ if (bundled && !cliDelegate) {
7036
+ return false;
7037
+ }
7013
7038
  if (process2.argv[1] === void 0) {
7014
7039
  return false;
7015
7040
  }
7041
+ if (cliDelegate) {
7042
+ if (path15.basename(process2.argv[1], ".js") === "cmd_doctor") {
7043
+ return true;
7044
+ }
7045
+ }
7016
7046
  const argvUrl = pathToFileURL4(path15.resolve(process2.argv[1])).href;
7017
7047
  if (import.meta.url === argvUrl) {
7018
7048
  return true;
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
2
  import {
3
3
  resolve_project_root
4
- } from "./chunk-JEJABGKB.js";
4
+ } from "./chunk-XTC5ARB6.js";
5
5
  import {
6
6
  resolvePackageRoot
7
7
  } from "./chunk-MCJYCQPF.js";
@@ -680,12 +680,17 @@ function main(argv = null, options = {}) {
680
680
  }
681
681
  return _apply(project, out, err);
682
682
  }
683
- var _bundled = true;
683
+ var _inForeignBundle = false;
684
684
  var _HERE = fileURLToPath(import.meta.url);
685
685
  function _isCliEntry() {
686
686
  if (process.argv[1] === void 0) {
687
687
  return false;
688
688
  }
689
+ if (true) {
690
+ if (path.basename(process.argv[1], ".js") === "cmd_migrate") {
691
+ return true;
692
+ }
693
+ }
689
694
  const argvUrl = pathToFileURL(path.resolve(process.argv[1])).href;
690
695
  if (import.meta.url === argvUrl) {
691
696
  return true;
@@ -698,7 +703,7 @@ function _isCliEntry() {
698
703
  return false;
699
704
  }
700
705
  }
701
- if (!_bundled && (_isCliEntry() || process.argv[1] === _HERE)) {
706
+ if (!_inForeignBundle && (_isCliEntry() || process.argv[1] === _HERE)) {
702
707
  try {
703
708
  process.exitCode = main(process.argv.slice(2));
704
709
  } catch (exc) {
@@ -4068,6 +4068,7 @@ var modelAutoSwitch = external_exports.enum(["auto", "suggest", "off"]);
4068
4068
  var leanProjectionMode = external_exports.enum(["eager-all", "thin"]);
4069
4069
  var projectionMode = external_exports.enum(["legacy-all", "scoped"]);
4070
4070
  var memoryCadence = external_exports.enum(["auto", "always", "never"]);
4071
+ var projectAudience = external_exports.enum(["self", "internal", "client", "public"]);
4071
4072
  var settingsSchema = external_exports.object({
4072
4073
  agent_config_version: external_exports.string().default("").describe(
4073
4074
  'Pin the package to an exact semver (e.g. "1.4.2") so all teammates load the same skill / rule set. Leave empty to track whatever is installed locally \u2014 useful for the maintainers of this package, risky for production projects.'
@@ -4172,6 +4173,9 @@ var settingsSchema = external_exports.object({
4172
4173
  ),
4173
4174
  improvement_pr_branch_prefix: external_exports.string().default("improve/agent-").describe(
4174
4175
  'Branch-name prefix for improvement PRs the agent opens against project.upstream_repo (e.g. "improve/agent-add-react-skill"). Pick a prefix your repo conventions allow.'
4176
+ ),
4177
+ audience: projectAudience.default("public").describe(
4178
+ 'Who this project is built for \u2014 read by the demand gate (\xA7 8-pre of docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md), whose L0-L4 ladder measures MARKET demand and is meaningless where no market is intended. self = a tool its maintainer builds for themselves; the gate is inert and work is classified L-self (build) instead of being deferred for lack of a user population nobody wants. internal = a team tool; only "what breaks without it?" survives. client = built for a named client, who is the requester rather than a market segment. public (default) = a product with an intended market; full three-question gate, behaviour unchanged from before this key existed.'
4175
4179
  )
4176
4180
  }),
4177
4181
  github: external_exports.object({
@@ -4539,25 +4543,22 @@ var settingsSchema = external_exports.object({
4539
4543
  "PreToolUse anti-slop nudge (road-to-anti-slop-detector Phase 3). Default off. When on, runs the lint_design_slop registry against about-to-be-written UI content and WARNS (never blocks) on P0/P1 aesthetic tells (side-stripe, gradient-text, magic z-index, \u2026). Flags are rebuttable via DESIGN.md / design-slop-disable. Anti-loop: a file::rule signature surfaced 3x goes silent. Host-limited convenience layer; the universal gate is the lint_design_slop linter/CI."
4540
4544
  )
4541
4545
  }).default({}),
4542
- code_graph: external_exports.object({
4546
+ ui_route_nudge: external_exports.object({
4543
4547
  enabled: external_exports.boolean().default(false).describe(
4544
- "PreToolUse code-graph nudge (ADR-124 Phase 4). Default off. When on AND a native code-graph cache or a consumer-shipped graph.json/SCIP index is present, warns once per session (never blocks) as the agent is about to Grep/Glob or Read a source file \u2014 query the graph first for who-calls/where-used/impact questions (or rebuild if stale, build if absent). Source G\u2019s strict block-first-read mode is deliberately un-ported."
4548
+ "PreToolUse UI-route nudge (road-to-frontend-skill-application Phase 4). Default off. When on, a Write/Edit to a UI surface with no design consultation latched this session WARNS (never blocks) naming the route \u2014 run existing-ui-audit, then the fe-design loop. A read or search touching fe-design / existing-ui-audit / design-review / design-intelligence latches consultation and silences it for the session. Anti-loop: at most 2 nudges per session. It does not read the rules: the UI-surface decision comes from _lib/ui_surface.ts and no code parses rule frontmatter, so this runs parallel to the two UI rules rather than consuming their triggers, and a test keeps the sets from drifting. It is a nudge, so their enforced_by: none stays accurate."
4545
4549
  )
4546
4550
  }).default({}),
4547
- turn_end_gate: external_exports.object({
4551
+ code_graph: external_exports.object({
4548
4552
  enabled: external_exports.boolean().default(false).describe(
4549
- "Stop-slot turn-end gate (road-to-conformance-round5 Phase 3). Default off, and it is the only concern that can REFUSE a turn-end rather than a tool call \u2014 so it soaks behind an explicit opt-in before it binds. Round 5 measured the reason: both blocking carriers reached zero violations, neither advisory carrier did, and 19 wrong-language replies survived a pin that had fired 26-35 seconds earlier. A refused turn continues in the SAME turn and is never refused twice."
4550
- ),
4551
- promissory: external_exports.boolean().default(true).describe(
4552
- "Detector A of the turn-end gate: refuse a turn whose closing paragraph promises work not yet performed while asking the user nothing (20 measured occurrences). No fire rate is quoted here on purpose: the measured rate moved twice while the instrument itself was being corrected, so a number in a shipped description would be a moving target. Re-derive it with `measure-turn-end-gate --store <transcript dir>` against your own corpus before arming the gate. Inert while hooks.turn_end_gate.enabled is false."
4553
- ),
4554
- language: external_exports.boolean().default(true).describe(
4555
- "Detector B of the turn-end gate: refuse a turn whose reply is not in the pinned language (19 measured occurrences). Fenced code, inline code, quoted tool output, tables, URLs and paths are stripped first, and the remainder is then scored LEAD-FIRST by the same classifier that sets the pin \u2014 so the verdict usually comes from the reply opening, not from all of it. Sharing that classifier is deliberate: it stops the pin and the detector disagreeing about a turn. Accepted opt-in spellings for the switches below include YAML true/false and yes/no/on/off. Inert while hooks.turn_end_gate.enabled is false."
4556
- ),
4557
- verification: external_exports.boolean().default(true).describe(
4558
- "Detector C of the turn-end gate: refuse a turn that changed a file and then ran nothing that could have checked it \u2014 no test, type-check, lint or build call follows the LAST edit. Ordering is the point: a run before the final edit did not exercise it, which is the freshness clause verify-before-complete states. Read off the turn tool calls, not the prose, because a reply cannot say whether an edit was verified. Deliberately narrow on what counts as verification \u2014 a missed detection costs one unguarded turn, a false refusal teaches you to switch the gate off. No fire rate is quoted: none has been measured yet. Inert while hooks.turn_end_gate.enabled is false."
4553
+ "PreToolUse code-graph nudge (ADR-124 Phase 4). Default off. When on AND a native code-graph cache or a consumer-shipped graph.json/SCIP index is present, warns once per session (never blocks) as the agent is about to Grep/Glob or Read a source file \u2014 query the graph first for who-calls/where-used/impact questions (or rebuild if stale, build if absent). Source G\u2019s strict block-first-read mode is deliberately un-ported."
4559
4554
  )
4560
4555
  }).default({})
4556
+ // `turn_end_gate` is deliberately ABSENT. The stop-slot turn-end gate is
4557
+ // always armed (2026-08-12) and has no settings surface: whether it
4558
+ // fires is decided by each detector's own trigger conditions, not by a
4559
+ // flag. A leftover `hooks.turn_end_gate.*` block from an older install
4560
+ // warns once on stderr and is ignored — see REMOVED_KEYS in
4561
+ // `src/scripts/_lib/agent_settings.ts`.
4561
4562
  }),
4562
4563
  decision_engine: external_exports.object({
4563
4564
  surface_traces: external_exports.boolean().default(false).describe(
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-MMJL4TIX.js";
5
5
  import {
6
6
  load_agent_settings
7
- } from "./chunk-JEJABGKB.js";
7
+ } from "./chunk-XTC5ARB6.js";
8
8
 
9
9
  // src/scripts/chat_history.ts
10
10
  import { createHash } from "node:crypto";
@@ -1059,9 +1059,19 @@ function main3(argv = null, options = {}) {
1059
1059
  return rc;
1060
1060
  }
1061
1061
  function _isCliEntry3() {
1062
+ const bundled = true;
1063
+ const cliDelegate = true;
1064
+ if (bundled && !cliDelegate) {
1065
+ return false;
1066
+ }
1062
1067
  if (process3.argv[1] === void 0) {
1063
1068
  return false;
1064
1069
  }
1070
+ if (cliDelegate) {
1071
+ if (path4.basename(process3.argv[1], ".js") === "cmd_refresh") {
1072
+ return true;
1073
+ }
1074
+ }
1065
1075
  const argvUrl = pathToFileURL3(path4.resolve(process3.argv[1])).href;
1066
1076
  if (import.meta.url === argvUrl) {
1067
1077
  return true;
@@ -2,10 +2,10 @@ import { createRequire as __acCreateRequire } from 'node:module'; const require
2
2
  import {
3
3
  ZodFirstPartyTypeKind,
4
4
  settingsSchema
5
- } from "./chunk-ZAXH3ZWU.js";
5
+ } from "./chunk-HJSKTMIF.js";
6
6
  import {
7
7
  main
8
- } from "./chunk-DS6BLDMG.js";
8
+ } from "./chunk-3JUTT26I.js";
9
9
  import {
10
10
  RULE_SOURCE_REL
11
11
  } from "./chunk-BKO2AZ7Z.js";
@@ -48,7 +48,7 @@ import {
48
48
  import {
49
49
  find_project_root_with_anchor,
50
50
  load_agent_settings
51
- } from "./chunk-JEJABGKB.js";
51
+ } from "./chunk-XTC5ARB6.js";
52
52
  import {
53
53
  event4u_root,
54
54
  legacy_xdg_root,
@@ -2,7 +2,7 @@ import { createRequire as __acCreateRequire } from 'node:module'; const require
2
2
  import {
3
3
  DEFAULT_PROJECT_FILE,
4
4
  logger
5
- } from "./chunk-JEJABGKB.js";
5
+ } from "./chunk-XTC5ARB6.js";
6
6
 
7
7
  // src/scripts/config/profiles.ts
8
8
  import * as fs2 from "node:fs";
@@ -40,7 +40,6 @@ var _VALID_PROVIDERS = /* @__PURE__ */ new Set([
40
40
  "xai",
41
41
  "perplexity"
42
42
  ]);
43
- var _VALID_MODES = /* @__PURE__ */ new Set(["api", "manual", "cli", "auto"]);
44
43
  var _RAW_KEY_PREFIXES = [
45
44
  "sk-",
46
45
  "sk-ant-",
@@ -303,7 +302,11 @@ function _build_config(raw, source_path) {
303
302
  if (!_isBool(enabled)) {
304
303
  throw new CouncilConfigError("`enabled` must be a bool.");
305
304
  }
306
- const defaults = _build_defaults(_asDict(_getOr(raw, "defaults", {})));
305
+ const ignored_transport_keys = [];
306
+ const defaults = _build_defaults(
307
+ _asDict(_getOr(raw, "defaults", {})),
308
+ ignored_transport_keys
309
+ );
307
310
  const cost_budget = _build_cost_budget(
308
311
  _asDict(_getOr(raw, "cost_budget", {}))
309
312
  );
@@ -315,7 +318,12 @@ function _build_config(raw, source_path) {
315
318
  for (const [name, cfg] of Object.entries(members_raw)) {
316
319
  members.set(
317
320
  name,
318
- _build_member(name, _asDict(_orEmpty(cfg)), defaults.mode)
321
+ _build_member(
322
+ name,
323
+ _asDict(_orEmpty(cfg)),
324
+ defaults.mode,
325
+ ignored_transport_keys
326
+ )
319
327
  );
320
328
  }
321
329
  const advisors_raw = _getOr(raw, "advisors", {});
@@ -414,7 +422,8 @@ function _build_config(raw, source_path) {
414
422
  routing,
415
423
  low_impact,
416
424
  lens_overrides,
417
- source_path
425
+ source_path,
426
+ ignored_transport_keys
418
427
  };
419
428
  }
420
429
  function _orEmpty(value) {
@@ -892,16 +901,14 @@ function _build_consensus_scoring(d) {
892
901
  };
893
902
  }
894
903
  var _VALID_MEMBER_MODES = /* @__PURE__ */ new Set(["cli", "api"]);
895
- function _build_defaults(d) {
904
+ function _build_defaults(d, ignored = []) {
896
905
  if (!_isDict(d)) {
897
906
  throw new CouncilConfigError("`defaults` must be a mapping.");
898
907
  }
899
- const mode = _get(d, "mode", "auto");
900
- if (!(_isStr(mode) && _VALID_MODES.has(mode))) {
901
- throw new CouncilConfigError(
902
- `defaults.mode=${_pyRepr(mode)} not in ${_sortedListRepr(_VALID_MODES)}.`
903
- );
908
+ if (_get(d, "mode", null) !== null) {
909
+ ignored.push("defaults.mode");
904
910
  }
911
+ const mode = "auto";
905
912
  const member_mode = _get(d, "member_mode", "cli");
906
913
  if (!(_isStr(member_mode) && _VALID_MEMBER_MODES.has(member_mode))) {
907
914
  throw new CouncilConfigError(
@@ -1058,7 +1065,7 @@ function _build_cost_budget(d) {
1058
1065
  }
1059
1066
  return cb;
1060
1067
  }
1061
- function _build_member(name, cfg, default_mode = "auto") {
1068
+ function _build_member(name, cfg, default_mode = "auto", ignored = []) {
1062
1069
  if (!_VALID_PROVIDERS.has(name)) {
1063
1070
  throw new CouncilConfigError(
1064
1071
  `members.${name}: unknown provider; valid: ${_sortedListRepr(_VALID_PROVIDERS)}.`
@@ -1069,14 +1076,11 @@ function _build_member(name, cfg, default_mode = "auto") {
1069
1076
  const model = _pyTruthy(modelVal) ? modelVal : "";
1070
1077
  const api_key_ref_raw = _get(cfg, "api_key_ref", null);
1071
1078
  const api_key_ref = api_key_ref_raw === void 0 ? null : api_key_ref_raw;
1072
- const member_mode_raw = _get(cfg, "mode", null);
1073
- const member_mode = member_mode_raw === void 0 ? null : member_mode_raw;
1074
- if (member_mode !== null && !(_isStr(member_mode) && _VALID_MODES.has(member_mode))) {
1075
- throw new CouncilConfigError(
1076
- `members.${name}.mode=${_pyRepr(member_mode)} not in ${_sortedListRepr(_VALID_MODES)}.`
1077
- );
1079
+ if (_get(cfg, "mode", null) !== null) {
1080
+ ignored.push(`members.${name}.mode`);
1078
1081
  }
1079
- const effective_mode = member_mode !== null ? member_mode : default_mode;
1082
+ const member_mode = null;
1083
+ const effective_mode = default_mode;
1080
1084
  const binary_raw = _get(cfg, "binary", null);
1081
1085
  const binary = binary_raw === void 0 ? null : binary_raw;
1082
1086
  if (binary !== null) {
@@ -504,14 +504,18 @@ function load_agent_settings(options = {}) {
504
504
  _warn_removed_always_on_keys(merged);
505
505
  return merged;
506
506
  }
507
- var REMOVED_ALWAYS_ON_KEYS = [
508
- "subagents.enabled",
509
- "subagents.auto",
510
- "subagents.host_capabilities",
511
- "subagents.budget_routing",
512
- "ai_team.enabled"
513
- ];
514
- var _warnedRemovedAlwaysOnKeys = /* @__PURE__ */ new Set();
507
+ var REMOVED_KEYS = /* @__PURE__ */ new Map([
508
+ ["subagents.enabled", "always-on orchestration"],
509
+ ["subagents.auto", "always-on orchestration"],
510
+ ["subagents.host_capabilities", "always-on orchestration"],
511
+ ["subagents.budget_routing", "always-on orchestration"],
512
+ ["ai_team.enabled", "always-on orchestration"],
513
+ ["hooks.turn_end_gate.enabled", "the turn-end gate is always armed"],
514
+ ["hooks.turn_end_gate.promissory", "the turn-end gate is always armed"],
515
+ ["hooks.turn_end_gate.language", "the turn-end gate is always armed"],
516
+ ["hooks.turn_end_gate.verification", "the turn-end gate is always armed"]
517
+ ]);
518
+ var _warnedRemovedKeys = /* @__PURE__ */ new Set();
515
519
  function _readDottedSettingsPath(root, dotted) {
516
520
  let node = root;
517
521
  for (const part of dotted.split(".")) {
@@ -523,15 +527,15 @@ function _readDottedSettingsPath(root, dotted) {
523
527
  return node;
524
528
  }
525
529
  function _warn_removed_always_on_keys(merged) {
526
- for (const key of REMOVED_ALWAYS_ON_KEYS) {
527
- if (_warnedRemovedAlwaysOnKeys.has(key)) {
530
+ for (const [key, reason] of REMOVED_KEYS) {
531
+ if (_warnedRemovedKeys.has(key)) {
528
532
  continue;
529
533
  }
530
534
  if (_readDottedSettingsPath(merged, key) === void 0) {
531
535
  continue;
532
536
  }
533
- _warnedRemovedAlwaysOnKeys.add(key);
534
- process.stderr.write(`${key} was removed (always-on orchestration); ignored.
537
+ _warnedRemovedKeys.add(key);
538
+ process.stderr.write(`${key} was removed (${reason}); ignored.
535
539
  `);
536
540
  }
537
541
  }
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  ProjectRootError,
9
9
  resolve_project_root
10
- } from "./chunk-JEJABGKB.js";
10
+ } from "./chunk-XTC5ARB6.js";
11
11
  import "./chunk-NDJLNC6Q.js";
12
12
  import "./chunk-J55WI3RR.js";
13
13
 
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
2
  import {
3
3
  resolve_project_root
4
- } from "./chunk-JEJABGKB.js";
4
+ } from "./chunk-XTC5ARB6.js";
5
5
  import "./chunk-NDJLNC6Q.js";
6
6
  import "./chunk-J55WI3RR.js";
7
7