@event4u/agent-config 8.11.0 → 8.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 (67) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/AGENTS.md +1 -0
  3. package/CHANGELOG.md +49 -279
  4. package/README.md +2 -2
  5. package/dist/agent-src/contexts/execution/roadmap-ci-steps-mechanics.md +117 -0
  6. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +106 -94
  7. package/dist/agent-src/rules/architecture.md +6 -51
  8. package/dist/agent-src/rules/code-comment-discipline.md +10 -94
  9. package/dist/agent-src/rules/decision-revisit-gate.md +9 -77
  10. package/dist/agent-src/rules/improve-before-implement.md +7 -66
  11. package/dist/agent-src/rules/no-roadmap-references.md +13 -77
  12. package/dist/agent-src/rules/persona-governance.md +5 -47
  13. package/dist/agent-src/rules/provider-lifecycle-discipline.md +6 -32
  14. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +21 -104
  15. package/dist/agent-src/rules/untrusted-input-defense.md +3 -75
  16. package/dist/agent-src/skills/agent-docs-writing/SKILL.md +83 -0
  17. package/dist/agent-src/skills/decision-review/SKILL.md +86 -0
  18. package/dist/agent-src/skills/module-detect-on-the-fly/SKILL.md +58 -1
  19. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  20. package/dist/agent-src/templates/contexts/knowledge-card.md +12 -0
  21. package/dist/discovery/deprecation-report.md +1 -1
  22. package/dist/discovery/discovery-manifest.json +14 -14
  23. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  24. package/dist/discovery/discovery-manifest.summary.md +1 -1
  25. package/dist/discovery/orphan-report.md +1 -1
  26. package/dist/discovery/packs.json +2 -2
  27. package/dist/discovery/trust-report.md +1 -1
  28. package/dist/discovery/workspaces.json +2 -2
  29. package/dist/mcp/registry-manifest.json +1 -1
  30. package/dist/router.json +1 -1
  31. package/docs/CLAIMS.md +30 -2
  32. package/docs/architecture.md +1 -1
  33. package/docs/archive/CHANGELOG-pre-8.12.0.md +304 -0
  34. package/docs/benchmark.md +39 -0
  35. package/docs/contracts/ai-council-config.md +9 -4
  36. package/docs/contracts/persona-schema.md +49 -0
  37. package/docs/contracts/provider-lifecycle.md +29 -4
  38. package/docs/decisions/ADR-120-council-chairman-mode.md +70 -0
  39. package/docs/decisions/ADR-121-knowledge-sensitivity-classes.md +90 -0
  40. package/docs/decisions/INDEX.md +2 -0
  41. package/docs/design/council-vs-solo-baseline.md +92 -0
  42. package/docs/design/utilization-window-criteria.md +51 -0
  43. package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +68 -0
  44. package/docs/guidelines/agent-infra/rule-body-migration-inventory.md +241 -0
  45. package/docs/guidelines/agent-infra/untrusted-input-spotlighting.md +80 -3
  46. package/docs/guidelines/code-clarity.md +86 -1
  47. package/docs/maintainers/branch-protection.md +87 -0
  48. package/docs/maintainers/system-map.md +85 -0
  49. package/docs/proof.md +14 -3
  50. package/package.json +1 -1
  51. package/src/config/agent-settings.template.yml +9 -0
  52. package/src/scripts/_cli/cmd_doctor.ts +95 -0
  53. package/src/scripts/_lib/knowledge_global.ts +44 -0
  54. package/src/scripts/_lib/knowledge_global_promote.ts +150 -0
  55. package/src/scripts/ai_council/orchestrator.ts +188 -1
  56. package/src/scripts/bench_persona_placebo.ts +308 -0
  57. package/src/scripts/bench_quality_rerun.ts +357 -0
  58. package/src/scripts/build_proof.ts +9 -0
  59. package/src/scripts/check_artefact_count_messaging.ts +56 -0
  60. package/src/scripts/check_knowledge_cards.ts +33 -4
  61. package/src/scripts/check_portability.ts +1 -0
  62. package/src/scripts/complexity_report.ts +776 -0
  63. package/src/scripts/consumer_matrix.ts +251 -12
  64. package/src/scripts/council_cli.ts +56 -1
  65. package/src/scripts/explain_run.ts +593 -0
  66. package/src/scripts/knowledge_global_cli.ts +234 -45
  67. package/src/scripts/rule_backlinks.ts +0 -0
@@ -113,6 +113,49 @@ export function scan_text(
113
113
  return { findings, seen };
114
114
  }
115
115
 
116
+ /** Structured-surface totals — generated files whose counts are YAML fields,
117
+ * not prose, so the KIND_PATTERNS prose scan cannot see them. CAPABILITIES.yaml
118
+ * proved this gap: it drifted to 268/177 while every prose surface said
119
+ * 271/178, because only its own `--check` guarded it and a stale commit can
120
+ * land through parallel merges. This scan makes the messaging gate a second,
121
+ * independent net over the same canonical counts. */
122
+ export const STRUCTURED_SURFACES: ReadonlyArray<{
123
+ file: string;
124
+ fields: ReadonlyArray<[kind: string, pattern: RegExp]>;
125
+ }> = [
126
+ {
127
+ file: 'CAPABILITIES.yaml',
128
+ fields: [
129
+ ['skills', /^\s*skills_total:\s*(\d+)\s*$/m],
130
+ ['commands', /^\s*commands_total:\s*(\d+)\s*$/m],
131
+ ],
132
+ },
133
+ ];
134
+
135
+ export function scan_structured(
136
+ rel: string,
137
+ text: string,
138
+ fields: ReadonlyArray<[string, RegExp]>,
139
+ expected: Record<string, number>,
140
+ ): { findings: Finding[]; seen: Record<string, Set<number>> } {
141
+ const findings: Finding[] = [];
142
+ const seen: Record<string, Set<number>> = {};
143
+ for (const [kind, pattern] of fields) {
144
+ const m = text.match(pattern);
145
+ if (m === null) {
146
+ continue; // absent field is the generator's own --check's problem
147
+ }
148
+ const found = Number.parseInt(m[1]!, 10);
149
+ (seen[kind] ??= new Set()).add(found);
150
+ const exp = expected[kind]!;
151
+ if (found !== exp) {
152
+ const line = text.slice(0, m.index ?? 0).split('\n').length;
153
+ findings.push({ file: rel, line, kind, found, expected: exp, approx: false });
154
+ }
155
+ }
156
+ return { findings, seen };
157
+ }
158
+
116
159
  export function main(argv: readonly string[] = process.argv.slice(2)): number {
117
160
  const QUIET = argv.includes('--quiet');
118
161
  const expected: Record<string, number> = {};
@@ -140,6 +183,19 @@ export function main(argv: readonly string[] = process.argv.slice(2)): number {
140
183
  }
141
184
  }
142
185
 
186
+ for (const { file, fields } of STRUCTURED_SURFACES) {
187
+ const p = path.join(ROOT, file);
188
+ if (!fs.existsSync(p)) {
189
+ process.stderr.write(` ⚠️ surface missing (skipped): ${file}\n`);
190
+ continue;
191
+ }
192
+ const { findings, seen } = scan_structured(file, fs.readFileSync(p, 'utf-8'), fields, expected);
193
+ allFindings.push(...findings);
194
+ for (const [kind, nums] of Object.entries(seen)) {
195
+ for (const n of nums) (global_seen[kind] ??= new Set()).add(n);
196
+ }
197
+ }
198
+
143
199
  // Internal-inconsistency check — the regression case this gate exists
144
200
  // for: multiple DIFFERENT numbers for one kind across the surfaces.
145
201
  const inconsistent: string[] = [];
@@ -105,13 +105,17 @@ function _frontmatter_get(text: string, ...keys: string[]): string {
105
105
  // ---------------------------------------------------------------------------
106
106
 
107
107
  /**
108
- * Global-store-only checks (ADR-100): tier validity, provenance footer,
109
- * and a redaction-clean assertion (the secret/PII patterns must have been
110
- * halted/cleaned before the card was written — never present in a global card).
108
+ * Global-store-only checks (ADR-100 + Phase 1 sensitivity axis,
109
+ * road-to-feedback-8.11 / successor note to ADR-119): tier validity,
110
+ * sensitivity validity, provenance footer (incl. the promotion audit-trail
111
+ * fields), and a redaction-clean assertion (the secret/PII patterns must
112
+ * have been halted/cleaned before the card was written — never present in a
113
+ * global card).
111
114
  */
112
115
  function _check_global_card(rel: string, text: string, fm: Record<string, string>): string[] {
113
116
  const errors: string[] = [];
114
117
  const valid_tiers = _kg !== null ? _kg.TIERS : ['public', 'vendor', 'proprietary'];
118
+ const valid_sensitivities = _kg !== null ? _kg.SENSITIVITIES : ['prohibited', 'project', 'shareable'];
115
119
 
116
120
  // G1 — tier present and valid
117
121
  const tier = (fm['tier'] ?? '').trim();
@@ -121,7 +125,27 @@ function _check_global_card(rel: string, text: string, fm: Record<string, string
121
125
  errors.push(`${rel}:0 — G1: tier '${tier}' not in ${_pyReprList(_sorted(valid_tiers))}`);
122
126
  }
123
127
 
124
- // G2 — provenance footer present with all fields
128
+ // G4 — sensitivity present and valid
129
+ const sensitivity = (fm['sensitivity'] ?? '').trim();
130
+ if (!sensitivity) {
131
+ errors.push(`${rel}:0 — G4: global card missing 'sensitivity' in frontmatter`);
132
+ } else if (!valid_sensitivities.includes(sensitivity)) {
133
+ errors.push(
134
+ `${rel}:0 — G4: sensitivity '${sensitivity}' not in ${_pyReprList(_sorted(valid_sensitivities))}`,
135
+ );
136
+ }
137
+
138
+ // G6 — a `prohibited` card must never be in the global store at all: it
139
+ // contains redaction-class content and should never have left the
140
+ // project. Hard error regardless of anything else on the card.
141
+ if (sensitivity === 'prohibited') {
142
+ errors.push(
143
+ `${rel}:0 — G6: sensitivity 'prohibited' must never be in the global store ` +
144
+ '(redaction-class content — this card should never have been promoted)',
145
+ );
146
+ }
147
+
148
+ // G2 + G5 — provenance footer present with all promotion audit-trail fields
125
149
  if (_kg !== null) {
126
150
  const prov = _kg.parse_provenance_footer(text);
127
151
  if (!_pyTruthyObj(prov)) {
@@ -132,6 +156,11 @@ function _check_global_card(rel: string, text: string, fm: Record<string, string
132
156
  errors.push(`${rel}:0 — G2: provenance footer missing '${field}'`);
133
157
  }
134
158
  }
159
+ for (const field of ['source_repo', 'owner', 'review_after', 'promotion_reason']) {
160
+ if (!prov[field]) {
161
+ errors.push(`${rel}:0 — G5: provenance footer missing '${field}'`);
162
+ }
163
+ }
135
164
  }
136
165
  }
137
166
 
@@ -468,6 +468,7 @@ const _TASK_DETECTOR_SKIP = [
468
468
  // CI-shaped literals; its mechanics doc and the execution loop +
469
469
  // authoring skill enumerate the same literals to detect them.
470
470
  'rules/roadmap-ci-steps-policy.md',
471
+ 'contexts/execution/roadmap-ci-steps-mechanics.md',
471
472
  'contexts/execution/roadmap-process-loop.md',
472
473
  'skills/roadmap-writing/SKILL.md',
473
474
  ];