@event4u/agent-config 10.1.0 → 10.3.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 (158) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +110 -167
  3. package/README.md +1 -1
  4. package/dist/agent-src/commands/analyze/reference-repo.md +62 -0
  5. package/dist/agent-src/commands/roadmap/create.md +4 -1
  6. package/dist/agent-src/commands/roadmap/next.md +38 -0
  7. package/dist/agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +22 -1
  8. package/dist/agent-src/contexts/contracts/frugality-charter.md +1 -1
  9. package/dist/agent-src/personas/advisors/first-principles.md +6 -0
  10. package/dist/agent-src/rules/active-remediation.md +53 -2
  11. package/dist/agent-src/rules/code-provenance.md +66 -4
  12. package/dist/agent-src/rules/content-quoting-floor.md +6 -0
  13. package/dist/agent-src/rules/context-hygiene.md +39 -0
  14. package/dist/agent-src/rules/design-fidelity.md +49 -3
  15. package/dist/agent-src/rules/token-budget-discipline.md +3 -2
  16. package/dist/agent-src/rules/token-efficiency.md +22 -0
  17. package/dist/agent-src/skills/ai-council/SKILL.md +28 -6
  18. package/dist/agent-src/skills/condense-memory/SKILL.md +1 -1
  19. package/dist/agent-src/skills/design-review/references/verification-automation.md +23 -1
  20. package/dist/agent-src/skills/fe-design/SKILL.md +27 -3
  21. package/dist/agent-src/skills/judge-synthesis/SKILL.md +30 -0
  22. package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +11 -0
  23. package/dist/agent-src/skills/roadmap-writing/SKILL.md +9 -9
  24. package/dist/agent-src/skills/skill-writing/SKILL.md +4 -0
  25. package/dist/agent-src/skills/token-optimizer/SKILL.md +5 -1
  26. package/dist/agent-src/templates/agent-settings.md +12 -28
  27. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +2 -2
  28. package/dist/agent-src/templates/persona.md +26 -0
  29. package/dist/agent-src/templates/roadmaps.md +27 -7
  30. package/dist/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +0 -1
  31. package/dist/agent-src/templates/skill.md +35 -1
  32. package/dist/cli/commands/commands.candidates.test.js +257 -0
  33. package/dist/cli/commands/commands.candidates.test.js.map +1 -0
  34. package/dist/cli/commands/commands.js +199 -0
  35. package/dist/cli/commands/commands.js.map +1 -1
  36. package/dist/cli/main.js +1 -0
  37. package/dist/cli/main.js.map +1 -1
  38. package/dist/cli/registry.js +2 -2
  39. package/dist/cli/registry.js.map +1 -1
  40. package/dist/cli-delegate/{chunk-3JUTT26I.js → chunk-6ENSXSBW.js} +1 -1
  41. package/dist/cli-delegate/{chunk-TVGXH7VA.js → chunk-6LOPHJLD.js} +1 -1
  42. package/dist/cli-delegate/{chunk-XT2YTJCZ.js → chunk-AYKQGIBG.js} +4 -0
  43. package/dist/cli-delegate/{chunk-HJSKTMIF.js → chunk-BV3WR67D.js} +3 -19
  44. package/dist/cli-delegate/{chunk-HTIU3W56.js → chunk-BWMXLD4B.js} +6 -2
  45. package/dist/cli-delegate/{chunk-2H5SE7DU.js → chunk-FV34EGEX.js} +166 -39
  46. package/dist/cli-delegate/{chunk-XTC5ARB6.js → chunk-IR3IVRVC.js} +7 -2
  47. package/dist/cli-delegate/{chunk-LRXJK6GN.js → chunk-JMQZ7MM5.js} +1 -1
  48. package/dist/cli-delegate/{chunk-NX5AXSLD.js → chunk-X3VOARZD.js} +3 -3
  49. package/dist/cli-delegate/cmd_analyze_session.js +1 -1
  50. package/dist/cli-delegate/cmd_brand_status.js +1 -1
  51. package/dist/cli-delegate/cmd_conformance.js +881 -204
  52. package/dist/cli-delegate/cmd_doctor.js +3 -3
  53. package/dist/cli-delegate/cmd_explain.js +2 -2
  54. package/dist/cli-delegate/cmd_export.js +4 -4
  55. package/dist/cli-delegate/cmd_handoff.js +6 -5
  56. package/dist/cli-delegate/cmd_mcp_available.js +1 -1
  57. package/dist/cli-delegate/cmd_migrate.js +2 -2
  58. package/dist/cli-delegate/cmd_packs_active.js +2 -2
  59. package/dist/cli-delegate/cmd_prune.js +4 -4
  60. package/dist/cli-delegate/cmd_route_audit.js +2 -2
  61. package/dist/cli-delegate/cmd_route_explain.js +1 -1
  62. package/dist/cli-delegate/cmd_session_recycle.js +44 -9
  63. package/dist/cli-delegate/cmd_settings_get.js +2 -2
  64. package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
  65. package/dist/cli-delegate/cmd_settings_set.js +2 -2
  66. package/dist/cli-delegate/cmd_sync.js +4 -4
  67. package/dist/cli-delegate/cmd_uninstall.js +4 -4
  68. package/dist/cli-delegate/cmd_update.js +1 -1
  69. package/dist/cli-delegate/cmd_upgrade.js +1 -1
  70. package/dist/cli-delegate/cmd_validate.js +4 -4
  71. package/dist/cli-delegate/cmd_versions.js +1 -1
  72. package/dist/discovery/deprecation-report.md +1 -1
  73. package/dist/discovery/discovery-manifest.json +21 -21
  74. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  75. package/dist/discovery/discovery-manifest.summary.md +1 -1
  76. package/dist/discovery/dormancy-report.md +1 -1
  77. package/dist/discovery/orphan-report.md +1 -1
  78. package/dist/discovery/packs.json +2 -2
  79. package/dist/discovery/trust-report.md +1 -1
  80. package/dist/discovery/workspaces.json +2 -2
  81. package/dist/hooks/dispatch.js +204 -44
  82. package/dist/install/install.mjs +9 -21
  83. package/dist/mcp/registry-manifest.json +2 -2
  84. package/dist/mcp/server.json +2 -2
  85. package/dist/mcp/server.mjs +1337 -490
  86. package/dist/router.json +1 -1
  87. package/dist/scripts/_lib/agent_settings.js +25 -2
  88. package/dist/scripts/_lib/agent_settings.js.map +1 -1
  89. package/dist/scripts/_lib/compile_time_toggles.js +4 -3
  90. package/dist/scripts/_lib/compile_time_toggles.js.map +1 -1
  91. package/dist/server/io/yamlIO.js +0 -2
  92. package/dist/server/io/yamlIO.js.map +1 -1
  93. package/dist/server/schemas/settings.js +3 -9
  94. package/dist/server/schemas/settings.js.map +1 -1
  95. package/dist/shared/settingsClasses.js +64 -2
  96. package/dist/shared/settingsClasses.js.map +1 -1
  97. package/dist/ui/assets/{index-B5qGYOJo.js → index-5fXOHoVh.js} +2 -2
  98. package/dist/ui/assets/index-5fXOHoVh.js.map +1 -0
  99. package/dist/ui/index.html +1 -1
  100. package/docs/contracts/settings-classes.md +307 -145
  101. package/docs/guidelines/agent-infra/active-remediation-mechanics.md +54 -0
  102. package/docs/guidelines/agent-infra/layered-settings.md +1 -2
  103. package/docs/guidelines/agent-infra/symptom-driven-harvest-loop.md +104 -0
  104. package/docs/guidelines/design-antipatterns.md +79 -10
  105. package/docs/guidelines/design-fidelity-mechanics.md +120 -2
  106. package/package.json +1 -1
  107. package/src/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +0 -1
  108. package/src/config/agent-settings.template.yml +12 -30
  109. package/src/config/gate-coverage.yml +42 -8
  110. package/src/config/gate-violation-baselines.json +15 -3
  111. package/src/config/profiles/balanced.ini +0 -2
  112. package/src/config/profiles/full.ini +1 -3
  113. package/src/config/profiles/minimal.ini +0 -2
  114. package/src/config/review-prompt-binding-baseline.json +19 -0
  115. package/src/config/rule-enforcement-baseline.json +0 -1
  116. package/src/scripts/_cli/cmd_session_recycle.ts +66 -9
  117. package/src/scripts/_cli/handoff_sessions.ts +3 -2
  118. package/src/scripts/_dispatch.bash +1 -0
  119. package/src/scripts/_lib/agent_settings.ts +25 -2
  120. package/src/scripts/_lib/bench_telegraph.ts +1 -1
  121. package/src/scripts/_lib/cc_transcript.ts +25 -0
  122. package/src/scripts/_lib/compile_time_toggles.ts +4 -3
  123. package/src/scripts/ai_council/clients.ts +243 -34
  124. package/src/scripts/cache_realization_report.ts +3 -2
  125. package/src/scripts/check_ci_local_parity.ts +60 -6
  126. package/src/scripts/check_review_prompt_binding.ts +553 -0
  127. package/src/scripts/check_rule_projection_integrity.ts +3 -1
  128. package/src/scripts/check_suppression_hygiene.ts +19 -3
  129. package/src/scripts/conformance_scan.ts +282 -9
  130. package/src/scripts/cost/track.mjs +10 -4
  131. package/src/scripts/council_cli.ts +33 -3
  132. package/src/scripts/design_slop_rules.test.ts +37 -6
  133. package/src/scripts/design_slop_rules.ts +150 -22
  134. package/src/scripts/dispatch_r2_reviewer.ts +15 -1
  135. package/src/scripts/external_sources_denylist.json +3 -1
  136. package/src/scripts/hook_manifest.yaml +17 -6
  137. package/src/scripts/hooks/block_unauthorized_git.ts +54 -8
  138. package/src/scripts/hooks/delegation_nudge_hook.ts +33 -8
  139. package/src/scripts/hooks/evidence_independence.ts +61 -9
  140. package/src/scripts/hooks/session_eol_hook.ts +123 -3
  141. package/src/scripts/hooks/turn_end_gate_hook.ts +31 -0
  142. package/src/scripts/hooks/ui_route_nudge_hook.ts +55 -2
  143. package/src/scripts/lint_design_antipattern_parity.ts +201 -0
  144. package/src/scripts/lint_harvest_provenance.ts +483 -0
  145. package/src/scripts/lint_settings_classes.ts +273 -11
  146. package/src/scripts/lint_skill_router_head.ts +254 -0
  147. package/src/scripts/lint_symptom_intake.ts +241 -0
  148. package/src/scripts/report_consultation_rate.ts +128 -2
  149. package/src/scripts/report_skill_activation.ts +6 -4
  150. package/src/scripts/report_skill_obligation_violations.ts +2 -1
  151. package/src/scripts/run_skill_evals.ts +10 -5
  152. package/src/scripts/schemas/persona.schema.json +8 -0
  153. package/src/scripts/schemas/provenance-harvest.schema.json +39 -0
  154. package/src/scripts/sweep_dead_scan_roots.ts +51 -0
  155. package/src/server/io/yamlIO.ts +0 -2
  156. package/src/server/schemas/settings.ts +3 -19
  157. package/src/shared/settingsClasses.ts +93 -2
  158. package/dist/ui/assets/index-B5qGYOJo.js.map +0 -1
@@ -21,7 +21,6 @@ const userType = z.enum(['', 'consultant', 'creator', 'developer', 'finance', 'f
21
21
  const profileId = z.enum(['developer', 'content_creator', 'founder', 'agency', 'finance', 'ops']);
22
22
  const accessStyle = z.enum(['getters_setters', 'get_attribute', 'magic_properties']);
23
23
  const chatFreq = z.enum(['per_turn', 'per_phase', 'per_tool']);
24
- const chatOverflow = z.enum(['rotate', 'condense']);
25
24
  const qualityCadence = z.enum(['end_of_roadmap', 'per_phase', 'per_step']);
26
25
  const regenCadence = z.enum(['per_step', 'every_5_steps', 'phase_boundary']);
27
26
  const worktreeMode = z.enum(['off', 'on', 'ask']);
@@ -169,12 +168,6 @@ export const settingsSchema = z.object({
169
168
  frequency: chatFreq.default('per_turn').describe(
170
169
  'How often the chat-history writer flushes to disk. per_turn = after every user / agent exchange (default, lowest data loss on crash). per_phase = at phase boundaries (cheaper I/O). per_tool = after every tool call (highest fidelity, noisiest log).',
171
170
  ),
172
- max_size_kb: z.number().int().min(0).default(2048).describe(
173
- 'Maximum size (KB) of the active chat-history file before chat_history.on_overflow kicks in. Set 0 to disable rotation / condensation entirely (file grows forever).',
174
- ),
175
- on_overflow: chatOverflow.default('rotate').describe(
176
- 'What happens when chat_history.max_size_kb is hit. rotate = move the current log aside and start fresh (default). condense = telegraph-condense the oldest entries in place to keep recent context.',
177
- ),
178
171
  text_limits: z.object({
179
172
  user: z.number().int().min(0).default(0).describe(
180
173
  'Per-message character cap for user inputs in the chat-history log. 0 = log verbatim (default). Raise above 0 only if your prompts contain large pasted artefacts you do not want stored.',
@@ -231,9 +224,6 @@ export const settingsSchema = z.object({
231
224
  local_auto_run: z.boolean().default(false).describe(
232
225
  'Run quality tools (linters, type-checks, formatters) and the local test suite autonomously after edits. Off by default — the agent never runs quality tools proactively and does not ask; the user runs them manually (e.g. /quality-fix) and remote CI is the authoritative gate. The agent only runs a quality tool on an explicit ask, a concrete CI failure, or the new-gate carve-out. Turn on to restore autonomous pipeline runs.',
233
226
  ),
234
- wait_for_remote_ci: z.boolean().default(false).describe(
235
- 'After pushing a branch, poll the remote CI provider (GitHub Actions, GitLab CI) and surface failures inline. Off by default — useful when local CI does not cover everything the remote pipeline runs.',
236
- ),
237
227
  }),
238
228
  design: z.object({
239
229
  fidelity_mode: fidelityMode.default('strict').describe(
@@ -258,12 +248,9 @@ export const settingsSchema = z.object({
258
248
  }).default({ identity_allowlist: [], forbid_terminal_capture: true, data_bearing_gate: 'on' }),
259
249
  telegraph: z.object({
260
250
  speak: z.boolean().default(false).describe(
261
- 'Whether the telegraph-speak rule ships at all. false (default) = DORMANT: compile_router omits the rule from dist/router.json entirely, so its body never reaches a host. This — not speak_scope — is the lever that stops the cost. Set true only after an output-side bench clears the kill-criterion bar (docs/adrs/telegraph/0002).',
251
+ 'Whether the telegraph-speak rule ships at all. false (default) = DORMANT: compile_router omits the rule from dist/router.json entirely, so its body never reaches a host. This is the only lever that stops the cost. Set true only after an output-side bench clears the kill-criterion bar (docs/adrs/telegraph/0002).',
262
252
  ),
263
- speak_scope: z.enum(['off', 'reply', 'all']).default('off').describe(
264
- "Where telegraph condensation applies WHEN speak is true. off (default) = agent reply prose is exempt. compile_router never reads this key: with speak false the rule does not ship, so this setting has no effect on its own. Quote the value in YAML — bare `off` parses as a boolean under YAML 1.1 and is rejected.",
265
- ),
266
- }).default({ speak: false, speak_scope: 'off' }),
253
+ }).default({ speak: false }),
267
254
  tokens: z.object({
268
255
  rich_skills: richSkillsMode.default('on').describe(
269
256
  'Whether skills marked token_budget_class: rich may load in full (exempt from telegraph-speak + thin-projector trimming), consumed by the token-budget-discipline rule. on = allowed (default); off = fall back to standard condensed behavior; ask = surface an estimated token delta (tokens, not dollars) and ask once per session before loading.',
@@ -573,13 +560,10 @@ export const settingsSchema = z.object({
573
560
  acknowledged: z.boolean().default(false).describe(
574
561
  'I understand the legal-review-prep pack provides templates and general information ONLY — it is NOT legal advice, creates no attorney-client relationship, and never replaces a licensed lawyer. Individual cases require an attorney. The pack stays inactive until this is checked.',
575
562
  ),
576
- consented_at: z.string().default('').describe(
577
- 'ISO timestamp recorded when the legal-review-prep acknowledgment was given. Set automatically by the setup wizard; leave empty otherwise.',
578
- ),
579
563
  require_council: z.boolean().default(true).describe(
580
564
  'Gate legal work-product behind a multi-model AI-council / deep-research pass (defense-in-depth: documented multi-stage review + audit trail; fail-closed when no council is configured). Leave on for the safest posture. Turning it off lets single-model legal output through — not recommended for a high-risk pack.',
581
565
  ),
582
- }).default({ acknowledged: false, consented_at: '', require_council: true }),
566
+ }).default({ acknowledged: false, require_council: true }),
583
567
  });
584
568
 
585
569
  export type Settings = z.infer<typeof settingsSchema>;
@@ -24,16 +24,61 @@ export function isSettingsClass(value: string): value is SettingsClass {
24
24
  return (SETTINGS_CLASSES as readonly string[]).includes(value);
25
25
  }
26
26
 
27
+ /**
28
+ * The closed disposition vocabulary — the axis orthogonal to A/B/C.
29
+ *
30
+ * A/B/C answers *who may write a key*. This answers *whether the key should
31
+ * exist at all*, which is a different question with a different action per
32
+ * value. A row outside the vocabulary is a defect, not a new disposition.
33
+ */
34
+ export const SETTINGS_DISPOSITIONS = ['derivable', 'un-inferrable', 'consent', 'policy'] as const;
35
+
36
+ export type SettingsDisposition = (typeof SETTINGS_DISPOSITIONS)[number];
37
+
38
+ export function isSettingsDisposition(value: string): value is SettingsDisposition {
39
+ return (SETTINGS_DISPOSITIONS as readonly string[]).includes(value);
40
+ }
41
+
27
42
  /** One parsed row of the contract's key table. */
28
43
  export interface SettingsClassRow {
29
44
  /** Dotted leaf path, e.g. `personal.autonomy`. */
30
45
  key: string;
31
46
  /** Raw class cell — NOT yet validated, so the lint can report a bad one. */
32
47
  cls: string;
48
+ /**
49
+ * Raw disposition cell, or `null` when the row has no fifth column at all.
50
+ *
51
+ * NOT validated here, for the same reason `cls` is not: the lint has to be
52
+ * able to report a bad value, and a parser that silently drops it would
53
+ * make an unclassified key indistinguishable from a mis-spelled one.
54
+ *
55
+ * `derivable` rows carry their replacement after an em dash — the clause
56
+ * that makes the label falsifiable rather than a synonym for "inconvenient
57
+ * to keep". `dispositionOf` returns the label, `replacementOf` the clause.
58
+ */
59
+ disposition: string | null;
33
60
  /** 1-indexed line in the contract, so a finding points at something. */
34
61
  line: number;
35
62
  }
36
63
 
64
+ /** `derivable — the detector's own trigger condition` → `derivable`. */
65
+ export function dispositionOf(cell: string | null): string | null {
66
+ if (cell === null) {
67
+ return null;
68
+ }
69
+ const [label] = cell.split('—');
70
+ return (label ?? '').trim();
71
+ }
72
+
73
+ /** `derivable — the detector's own trigger condition` → the clause after the dash. */
74
+ export function replacementOf(cell: string | null): string {
75
+ if (cell === null) {
76
+ return '';
77
+ }
78
+ const dash = cell.indexOf('—');
79
+ return dash === -1 ? '' : cell.slice(dash + 1).trim();
80
+ }
81
+
37
82
  /** What the contract's own `## Counts` table claims about itself. */
38
83
  export interface DeclaredClassCounts {
39
84
  A: number | null;
@@ -51,11 +96,20 @@ export interface DeclaredClassCounts {
51
96
  */
52
97
  const ROW_RE = /^\|\s*`([^`]+)`\s*\|\s*([^|]*?)\s*\|/;
53
98
 
99
+ /**
100
+ * The disposition is read as the FIFTH cell, appended after `Why`, so the four
101
+ * cells every existing consumer indexes keep their positions. A row that
102
+ * predates the axis simply has no fifth cell and parses to `null` — an absent
103
+ * disposition, which the lint reports, rather than a shifted `Default`.
104
+ */
105
+ const DISPOSITION_RE = /^\|\s*`[^`]+`\s*\|[^|]*\|[^|]*\|[^|]*\|\s*([^|]*?)\s*\|/;
106
+
54
107
  export function parseSettingsClassRows(markdown: string): SettingsClassRow[] {
55
108
  const rows: SettingsClassRow[] = [];
56
109
  const lines = markdown.split('\n');
57
110
  for (let i = 0; i < lines.length; i++) {
58
- const m = ROW_RE.exec(lines[i] ?? '');
111
+ const line = lines[i] ?? '';
112
+ const m = ROW_RE.exec(line);
59
113
  if (m === null) {
60
114
  continue;
61
115
  }
@@ -64,7 +118,9 @@ export function parseSettingsClassRows(markdown: string): SettingsClassRow[] {
64
118
  if (!/^[A-Za-z]$/.test(cls)) {
65
119
  continue;
66
120
  }
67
- rows.push({ key, cls, line: i + 1 });
121
+ const d = DISPOSITION_RE.exec(line);
122
+ const raw = d?.[1] ?? '';
123
+ rows.push({ key, cls, disposition: raw === '' ? null : raw, line: i + 1 });
68
124
  }
69
125
  return rows;
70
126
  }
@@ -84,6 +140,41 @@ export function parseDeclaredClassCounts(markdown: string): DeclaredClassCounts
84
140
  };
85
141
  }
86
142
 
143
+ /** What the contract's own `## Dispositions` table claims about itself. */
144
+ export interface DeclaredDispositionCounts {
145
+ derivable: number | null;
146
+ 'un-inferrable': number | null;
147
+ consent: number | null;
148
+ policy: number | null;
149
+ total: number | null;
150
+ }
151
+
152
+ /** `| derivable | 12 |` and `| **Total** | **140** |` under `## Dispositions`. */
153
+ export function parseDeclaredDispositionCounts(markdown: string): DeclaredDispositionCounts {
154
+ // Scoped to the section, so the class Counts table's own **Total** row —
155
+ // identical in shape and earlier in the file — cannot be read as this one.
156
+ const start = markdown.indexOf('\n## Dispositions');
157
+ const section = start === -1 ? '' : markdown.slice(start + 1);
158
+ const end = section.indexOf('\n## ', 1);
159
+ const scoped = end === -1 ? section : section.slice(0, end);
160
+ // The value cell is read with optional `**` so the bolded `**Total**` row
161
+ // and the plain per-label rows go through one path — a second regex for the
162
+ // total is a second thing to get wrong.
163
+ const read = (label: string): number | null => {
164
+ const re = new RegExp(String.raw`^\|\s*` + label + String.raw`\s*\|\s*\**(\d+)\**\s*\|`, 'm');
165
+ const m = re.exec(scoped);
166
+ const raw = m?.[1];
167
+ return raw === undefined ? null : Number.parseInt(raw, 10);
168
+ };
169
+ return {
170
+ derivable: read('derivable'),
171
+ 'un-inferrable': read('un-inferrable'),
172
+ consent: read('consent'),
173
+ policy: read('policy'),
174
+ total: read(String.raw`\*\*Total\*\*`),
175
+ };
176
+ }
177
+
87
178
  /**
88
179
  * Dotted key → class, for the rows whose class is valid.
89
180
  *