@ryuenn3123/agentic-senior-core 3.0.17 → 3.0.20

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 (85) hide show
  1. package/.agent-context/prompts/bootstrap-design.md +84 -94
  2. package/.agent-context/prompts/init-project.md +32 -100
  3. package/.agent-context/prompts/refactor.md +22 -44
  4. package/.agent-context/prompts/review-code.md +28 -52
  5. package/.agent-context/review-checklists/architecture-review.md +31 -62
  6. package/.agent-context/review-checklists/pr-checklist.md +74 -108
  7. package/.agent-context/rules/api-docs.md +18 -206
  8. package/.agent-context/rules/architecture.md +40 -207
  9. package/.agent-context/rules/database-design.md +10 -199
  10. package/.agent-context/rules/docker-runtime.md +5 -5
  11. package/.agent-context/rules/efficiency-vs-hype.md +11 -149
  12. package/.agent-context/rules/error-handling.md +9 -231
  13. package/.agent-context/rules/event-driven.md +17 -221
  14. package/.agent-context/rules/frontend-architecture.md +66 -119
  15. package/.agent-context/rules/git-workflow.md +1 -1
  16. package/.agent-context/rules/microservices.md +28 -161
  17. package/.agent-context/rules/naming-conv.md +8 -138
  18. package/.agent-context/rules/performance.md +9 -175
  19. package/.agent-context/rules/realtime.md +11 -44
  20. package/.agent-context/rules/security.md +11 -295
  21. package/.agent-context/rules/testing.md +9 -174
  22. package/.agent-context/state/benchmark-analysis.json +3 -3
  23. package/.agent-context/state/memory-continuity-benchmark.json +1 -1
  24. package/.agent-context/state/onboarding-report.json +71 -11
  25. package/.agents/workflows/init-project.md +7 -24
  26. package/.agents/workflows/refactor.md +7 -24
  27. package/.agents/workflows/review-code.md +7 -24
  28. package/.cursorrules +22 -21
  29. package/.gemini/instructions.md +2 -2
  30. package/.github/copilot-instructions.md +2 -2
  31. package/.instructions.md +112 -213
  32. package/.windsurfrules +22 -21
  33. package/AGENTS.md +4 -4
  34. package/CONTRIBUTING.md +13 -22
  35. package/README.md +6 -20
  36. package/lib/cli/commands/init.mjs +102 -148
  37. package/lib/cli/commands/launch.mjs +3 -3
  38. package/lib/cli/commands/optimize.mjs +14 -4
  39. package/lib/cli/commands/upgrade.mjs +25 -23
  40. package/lib/cli/compiler.mjs +96 -62
  41. package/lib/cli/constants.mjs +28 -136
  42. package/lib/cli/detector/design-evidence.mjs +189 -6
  43. package/lib/cli/detector.mjs +6 -7
  44. package/lib/cli/init-detection-flow.mjs +10 -93
  45. package/lib/cli/init-selection.mjs +2 -68
  46. package/lib/cli/project-scaffolder/constants.mjs +1 -1
  47. package/lib/cli/project-scaffolder/design-contract.mjs +438 -335
  48. package/lib/cli/project-scaffolder/discovery.mjs +36 -82
  49. package/lib/cli/project-scaffolder/prompt-builders.mjs +55 -63
  50. package/lib/cli/project-scaffolder/storage.mjs +0 -4
  51. package/lib/cli/token-optimization.mjs +1 -1
  52. package/lib/cli/utils.mjs +75 -9
  53. package/package.json +2 -2
  54. package/scripts/detection-benchmark.mjs +4 -15
  55. package/scripts/documentation-boundary-audit.mjs +9 -9
  56. package/scripts/explain-on-demand-audit.mjs +11 -11
  57. package/scripts/forbidden-content-check.mjs +9 -9
  58. package/scripts/frontend-usability-audit.mjs +57 -36
  59. package/scripts/llm-judge.mjs +1 -1
  60. package/scripts/mcp-server/constants.mjs +60 -0
  61. package/scripts/mcp-server/tool-registry.mjs +149 -0
  62. package/scripts/mcp-server/tools.mjs +446 -0
  63. package/scripts/mcp-server.mjs +23 -661
  64. package/scripts/release-gate/audit-checks.mjs +426 -0
  65. package/scripts/release-gate/constants.mjs +53 -0
  66. package/scripts/release-gate/runtime.mjs +63 -0
  67. package/scripts/release-gate/static-checks.mjs +182 -0
  68. package/scripts/release-gate.mjs +13 -794
  69. package/scripts/rules-guardian-audit.mjs +14 -13
  70. package/scripts/single-source-lazy-loading-audit.mjs +3 -3
  71. package/scripts/sync-thin-adapters.mjs +5 -5
  72. package/scripts/ui-design-judge/constants.mjs +24 -0
  73. package/scripts/ui-design-judge/design-execution-summary.mjs +259 -0
  74. package/scripts/ui-design-judge/git-input.mjs +131 -0
  75. package/scripts/ui-design-judge/prompting.mjs +73 -0
  76. package/scripts/ui-design-judge/providers.mjs +102 -0
  77. package/scripts/ui-design-judge/reporting.mjs +182 -0
  78. package/scripts/ui-design-judge/rubric-calibration.mjs +214 -0
  79. package/scripts/ui-design-judge/rubric-goldset.json +188 -0
  80. package/scripts/ui-design-judge.mjs +166 -771
  81. package/scripts/ui-rubric-calibration.mjs +35 -0
  82. package/scripts/validate/config.mjs +198 -55
  83. package/scripts/validate/coverage-checks.mjs +32 -7
  84. package/scripts/validate.mjs +8 -4
  85. package/lib/cli/architect.mjs +0 -431
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ // @ts-check
3
+
4
+ import { readFileSync } from 'node:fs';
5
+ import { dirname, resolve } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import { buildRubricCalibrationReport } from './ui-design-judge/rubric-calibration.mjs';
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+ const GOLDSET_PATH = resolve(__dirname, 'ui-design-judge', 'rubric-goldset.json');
12
+ const REPORT_NAME = 'ui-rubric-calibration';
13
+
14
+ function loadGoldset() {
15
+ return JSON.parse(readFileSync(GOLDSET_PATH, 'utf8'));
16
+ }
17
+
18
+ function main() {
19
+ const goldset = loadGoldset();
20
+ const report = buildRubricCalibrationReport({
21
+ cases: goldset.cases,
22
+ reviewRubricSummary: goldset.reviewRubric,
23
+ });
24
+ report.reportName = REPORT_NAME;
25
+ // Keep the report surface explicit so static validation can detect the machine-readable payload contract.
26
+ report.accuracyPercent = report.accuracyPercent;
27
+
28
+ console.log(JSON.stringify(report, null, 2));
29
+
30
+ if (!report.passed) {
31
+ process.exitCode = 1;
32
+ }
33
+ }
34
+
35
+ main();
@@ -84,18 +84,18 @@ export const REQUIRED_DEVELOPER_FIRST_MENTION_PATTERNS = [
84
84
  },
85
85
  {
86
86
  path: '.agent-context/prompts/init-project.md',
87
- label: 'Init prompt first mention includes Federated Governance baseline',
88
- pattern: /rules operations context\s*\(Federated Governance baseline\)/iu,
87
+ label: 'Init prompt first mention includes strict AI coding guidance context',
88
+ pattern: /strict AI coding guidance context/iu,
89
89
  },
90
90
  {
91
91
  path: 'lib/cli/commands/init.mjs',
92
- label: 'Init command wording includes Federated Governance baseline',
93
- pattern: /rules operations\s+(assets|pack)[^\n]*\(Federated Governance baseline\)/iu,
92
+ label: 'Init command wording includes project guidance pack',
93
+ pattern: /copy the project guidance pack[^\n]*compile a single rulebook/iu,
94
94
  },
95
95
  {
96
96
  path: 'lib/cli/commands/upgrade.mjs',
97
- label: 'Upgrade command wording includes Federated Governance baseline',
98
- pattern: /rules operations upgrade assistant\s*\(Federated Governance baseline\)/iu,
97
+ label: 'Upgrade command wording includes managed guidance upgrade',
98
+ pattern: /running managed guidance upgrade for an existing repository\./iu,
99
99
  },
100
100
  {
101
101
  path: 'lib/cli/utils.mjs',
@@ -121,10 +121,9 @@ export const REQUIRED_COMPLIANCE_CANONICAL_SNIPPETS = [
121
121
  ];
122
122
  export const REQUIRED_DETECTION_TRANSPARENCY_SNIPPETS = [
123
123
  {
124
- path: 'lib/cli/commands/init.mjs',
124
+ path: 'lib/cli/init-detection-flow.mjs',
125
125
  snippets: [
126
- 'Existing project detection transparency:',
127
- 'Use detected setup for this existing project?',
126
+ 'existing-project-evidence-only',
128
127
  'detectionTransparency',
129
128
  ],
130
129
  },
@@ -144,20 +143,38 @@ export const REQUIRED_DETECTION_TRANSPARENCY_SNIPPETS = [
144
143
  ],
145
144
  },
146
145
  ];
147
- export const REQUIRED_STACK_RESEARCH_ENGINE_SNIPPETS = [
146
+ export const REQUIRED_STACK_DECISION_BOUNDARY_SNIPPETS = [
147
+ {
148
+ path: '.instructions.md',
149
+ snippets: [
150
+ 'Do not silently choose frameworks or architecture from offline heuristics.',
151
+ 'produce a short recommendation from evidence and live official documentation before coding',
152
+ ],
153
+ },
154
+ {
155
+ path: '.agent-context/prompts/init-project.md',
156
+ snippets: [
157
+ 'If the user already named a stack or framework, treat it as an explicit constraint.',
158
+ 'produce a short evidence-backed recommendation from the brief, repo evidence, and live official documentation before coding',
159
+ ],
160
+ },
148
161
  {
149
- path: 'lib/cli/architect.mjs',
162
+ path: '.agent-context/rules/architecture.md',
150
163
  snippets: [
151
- 'STACK_SIGNAL_WEIGHTS',
152
- 'briefType',
153
- 'recommendArchitecture',
154
- 'formatArchitectureRecommendation',
164
+ 'Do not force a default architecture label before the repo, delivery model, and boundary evidence are clear.',
165
+ ],
166
+ },
167
+ {
168
+ path: '.agent-context/rules/microservices.md',
169
+ snippets: [
170
+ 'Do not start with microservices by fashion, fear, or habit.',
155
171
  ],
156
172
  },
157
173
  {
158
174
  path: 'lib/cli/commands/init.mjs',
159
175
  snippets: [
160
- 'recommendArchitecture',
176
+ 'AGENT_DECISION_STACK_FILE_NAME',
177
+ 'agent recommendation required from current repo/brief evidence',
161
178
  ],
162
179
  },
163
180
  ];
@@ -254,12 +271,13 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
254
271
  {
255
272
  path: '.instructions.md',
256
273
  snippets: [
274
+ 'Resolve the smallest relevant layer set for the current request.',
257
275
  'UI Design Mode',
258
276
  'bootstrap-design.md',
259
277
  'frontend-architecture.md',
260
278
  'do not eagerly load unrelated backend-only rules',
261
279
  'valid style context',
262
- 'explicitly approved reference systems',
280
+ 'External references, prior-chat memory, unrelated-project visuals, and remembered screenshots are tainted',
263
281
  'WCAG 2.2 AA as the hard compliance floor',
264
282
  'APCA as advisory perceptual tuning only',
265
283
  ],
@@ -267,64 +285,118 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
267
285
  {
268
286
  path: '.agent-context/prompts/bootstrap-design.md',
269
287
  snippets: [
270
- 'UI Design Mode is context-isolated by default:',
288
+ 'This contract is a decision scaffold, not a style preset.',
289
+ 'We guide the agent; we do not pick the final style',
271
290
  'Token Architecture and Alias Strategy',
272
- '`tokenSystem`',
273
291
  '`repoEvidence.designEvidenceSummary`',
274
- 'Responsive Strategy and Cross-Viewport Adaptation Matrix',
275
- '`colorTruth.format`',
276
- '`crossViewportAdaptation.mutationRules.mobile/tablet/desktop`',
277
- '`motionSystem`',
278
- '`componentMorphology`',
279
- '`accessibilityPolicy`',
280
- '`visualQaPolicy`',
281
- '`contextHygiene`',
282
- 'Do not reuse a color palette, component skin, or motion signature from prior chats, memories, or unrelated projects',
283
- 'If no approved reference system exists, synthesize the design from zero using current product context, constraints, and content only.',
284
- 'Design continuity is opt-in.',
285
- 'WCAG 2.2 AA as the blocking baseline',
286
- 'APCA only as advisory perceptual tuning',
287
- 'Hybrid visual QA must stay deterministic-first',
288
- 'long-page capture strategy',
289
- 'anchor-based section or tiled-scroll captures',
292
+ 'Responsive Recomposition Plan',
293
+ 'source of truth',
294
+ 'research current official docs',
295
+ 'Responsive design means recomposition, not resizing.',
296
+ 'agent-chosen visual direction',
297
+ 'viewport mutation rules',
298
+ 'WCAG 2.2 AA is the hard floor',
299
+ 'APCA may be used only as advisory perceptual tuning',
300
+ 'unresearched dependency choices',
301
+ 'default component-kit styling without product rationale',
302
+ 'genericity findings that cannot name the exact drift signal',
290
303
  ],
291
304
  },
292
305
  {
293
306
  path: 'scripts/ui-design-judge.mjs',
294
307
  snippets: [
295
- 'Advisory-first UI design contract judge.',
308
+ 'Advisory-default UI design contract judge.',
296
309
  'Repo-internal workflow audit; no user-facing runtime modes.',
297
- 'Runs only in advisory mode for this repository workflow.',
310
+ 'genericityAutoFail',
311
+ 'blocking required actions',
298
312
  'Do not reward generic SaaS defaults or popular template patterns.',
299
313
  'UI design judge only evaluates changed UI surfaces.',
300
- 'Deterministic visual diff reported no meaningful drift, so semantic review was skipped.',
301
- 'UI_VISUAL_DIFF_REPORT_JSON',
302
- 'meaningfulDiffViewportCount',
314
+ 'Structured design execution summary was supplied to semantic review.',
315
+ 'designExecutionSignalCount',
316
+ 'designExecutionPolicy',
317
+ 'designExecutionHandoff',
318
+ 'reviewRubric',
319
+ 'genericityStatus',
320
+ 'handoffReady',
321
+ 'structuredInspectionAvailable',
322
+ 'calibratedStatus',
323
+ 'applyGenericityAutoFail',
324
+ ],
325
+ },
326
+ {
327
+ path: 'scripts/ui-design-judge/rubric-calibration.mjs',
328
+ snippets: [
329
+ 'ui-rubric-calibration-v1',
330
+ 'matchedGenericitySignals',
331
+ 'matchedForbiddenPatterns',
332
+ 'matchedValidBoldSignals',
333
+ 'contractDriftDetected',
334
+ 'Genericity claim was not backed by any named drift signal.',
335
+ ],
336
+ },
337
+ {
338
+ path: 'scripts/ui-rubric-calibration.mjs',
339
+ snippets: [
340
+ 'ui-rubric-calibration',
341
+ 'rubric-goldset.json',
342
+ 'accuracyPercent',
303
343
  ],
304
344
  },
305
345
  {
306
346
  path: 'lib/cli/project-scaffolder/design-contract.mjs',
307
347
  snippets: [
308
348
  'tokenSystem',
349
+ 'seedPolicy',
350
+ 'structure-first-scaffold',
309
351
  'colorTruth',
352
+ 'rolesAreMinimumScaffold',
310
353
  'crossViewportAdaptation',
311
354
  'motionSystem',
355
+ 'seedToneLocked',
312
356
  'componentMorphology',
357
+ 'seedBehaviorsRequireRefinement',
313
358
  'accessibilityPolicy',
314
- 'visualQaPolicy',
315
- 'deterministicFirst',
316
- 'baselineStrategy',
317
- 'requiredViewports',
318
- 'capturePlan',
319
- 'longPageStrategy',
320
- 'tileOverlapRatio',
321
- 'meaningfulDiffRatioThreshold',
359
+ 'designExecutionPolicy',
360
+ 'seedRefinementRequiredBeforeUiImplementation',
361
+ 'requirePerSurfaceMutationOps',
362
+ 'forbidUniformSiblingSurfaceTreatment',
363
+ 'requireStructuredHandoff',
364
+ 'handoffFormatVersion',
365
+ 'designExecutionHandoff',
366
+ 'seedMode',
367
+ 'requiresTaskSpecificRefinement',
368
+ 'representationStrategy',
369
+ 'requireSurfacePlan',
370
+ 'requireComponentGraph',
371
+ 'requireViewportMutationPlan',
372
+ 'requireInteractionStateMatrix',
373
+ 'requireContentPriorityMap',
374
+ 'forbidScreenshotDependency',
375
+ 'semanticReviewFocus',
376
+ 'primaryExperienceGoal',
377
+ 'surfacePlan',
378
+ 'contentPriorityMap',
379
+ 'viewportMutationPlan',
380
+ 'interactionStateMatrix',
381
+ 'taskFlowNarrative',
382
+ 'signatureMoveRationale',
383
+ 'implementationGuardrails',
384
+ 'reviewRubric',
385
+ 'genericityAutoFail',
386
+ 'genericitySignals',
387
+ 'validBoldSignals',
388
+ 'mustExplainGenericity',
389
+ 'mustSeparateTasteFromFailure',
390
+ 'offline-prescribed-style-used-as-final-direction',
391
+ 'unresearched-library-or-framework-choice',
392
+ 'single-safe-typographic-family-without-role-contrast-or-rationale',
322
393
  'hardComplianceFloor',
323
394
  'advisoryContrastModel',
324
395
  'contextHygiene',
325
396
  'repoEvidenceOverridesMemory',
326
397
  'requireExplicitContinuityApproval',
327
398
  'forbidCarryoverWhenUnapproved',
399
+ 'approvedExternalConstraintUsage',
328
400
  'requireViewportMutationRules',
329
401
  'allowHexDerivatives',
330
402
  ],
@@ -345,15 +417,21 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
345
417
  'arbitraryBreakpointCount',
346
418
  'cssVariables',
347
419
  'componentInventory',
420
+ 'structuredInspection',
421
+ 'classAttributeCount',
422
+ 'inlineStyleObjectCount',
348
423
  'tokenBypassSignals',
349
424
  ],
350
425
  },
351
426
  {
352
427
  path: 'lib/cli/compiler.mjs',
353
428
  snippets: [
429
+ 'Resolve the smallest relevant layer set before responding.',
430
+ 'LAYER 1: RULES (SCOPE-RESOLVED)',
354
431
  'LAYER 5: EXECUTION PROMPTS AND UI TRIGGERS',
355
432
  'bootstrap-design.md -> ui, ux, layout, screen, tailwind, frontend, redesign',
356
433
  'Keep UI-only requests context-isolated',
434
+ 'git-workflow.md',
357
435
  'designEvidenceSummary',
358
436
  ],
359
437
  },
@@ -373,9 +451,9 @@ export const REQUIRED_DOCKER_RUNTIME_AUTOMATION_SNIPPETS = [
373
451
  'Docker Compose Quickstart',
374
452
  'Compose file reference',
375
453
  'Dockerfile best practices',
376
- 'Prefer current `docker compose` workflows and `compose.yaml`.',
454
+ 'Use current `docker compose` workflows and `compose.yaml`.',
377
455
  'Do not add the top-level Compose `version` field by default.',
378
- 'Prefer the latest stable compatible Docker base image',
456
+ 'Use the latest stable compatible Docker base image',
379
457
  ],
380
458
  },
381
459
  {
@@ -390,7 +468,7 @@ export const REQUIRED_DEPENDENCY_FRESHNESS_AUTOMATION_SNIPPETS = [
390
468
  {
391
469
  path: '.instructions.md',
392
470
  snippets: [
393
- 'prefer the latest stable compatible dependency set and official setup flow',
471
+ 'use the latest stable compatible dependency set and official setup flow',
394
472
  ],
395
473
  },
396
474
  {
@@ -405,8 +483,8 @@ export const REQUIRED_DEPENDENCY_FRESHNESS_AUTOMATION_SNIPPETS = [
405
483
  {
406
484
  path: '.agent-context/prompts/init-project.md',
407
485
  snippets: [
408
- 'latest stable compatible dependency set and official framework setup flow first',
409
- 'Prefer official framework setup commands or canonical starter flows',
486
+ 'recommend the latest stable compatible dependency set and official framework setup flow from live official documentation before coding',
487
+ 'Use official framework setup commands or canonical starter flows',
410
488
  ],
411
489
  },
412
490
  ];
@@ -418,13 +496,78 @@ export const FORBIDDEN_TEMPLATE_BOOTSTRAP_SNIPPETS = [
418
496
  ],
419
497
  },
420
498
  ];
499
+ export const FORBIDDEN_ACTIVE_BIAS_ANCHOR_SNIPPETS = [
500
+ {
501
+ path: '.instructions.md',
502
+ snippets: [
503
+ 'illustrative, not exhaustive',
504
+ 'explicitly approved reference systems',
505
+ 'Do not auto-recommend frameworks',
506
+ 'prefer the latest stable compatible dependency set',
507
+ ],
508
+ },
509
+ {
510
+ path: '.agent-context/prompts/bootstrap-design.md',
511
+ snippets: [
512
+ 'stylistic inspiration',
513
+ 'famous brand reference',
514
+ 'If no approved reference system exists',
515
+ 'explicitly approved reference systems',
516
+ ],
517
+ },
518
+ {
519
+ path: '.agent-context/prompts/init-project.md',
520
+ snippets: [
521
+ 'Compact User Prompt Patterns',
522
+ 'latest stable compatible dependency set and official framework setup flow first',
523
+ 'Prefer official framework setup commands',
524
+ 'ask for confirmation instead of silently choosing a stack',
525
+ ],
526
+ },
527
+ {
528
+ path: 'lib/cli/project-scaffolder/design-contract.mjs',
529
+ snippets: [
530
+ 'explicitly-approved-reference-systems',
531
+ 'approvedReferenceUsage',
532
+ ],
533
+ },
534
+ {
535
+ path: 'lib/cli/constants.mjs',
536
+ snippets: [
537
+ 'BLUEPRINT_RECOMMENDATIONS',
538
+ `java-${'enter'}${'prise'}-api`,
539
+ `dotnet-${'enter'}${'prise'}-api`,
540
+ ],
541
+ },
542
+ {
543
+ path: 'lib/cli/init-detection-flow.mjs',
544
+ snippets: [
545
+ `Using detected ${'stack'} automatically`,
546
+ `Use detected ${'setup'} for this existing project?`,
547
+ 'Override detected stack',
548
+ ],
549
+ },
550
+ {
551
+ path: 'scripts/ui-design-judge/prompting.mjs',
552
+ snippets: [
553
+ '"recommendation": string',
554
+ ],
555
+ },
556
+ {
557
+ path: 'scripts/documentation-boundary-audit.mjs',
558
+ snippets: [
559
+ 'suggestedActions',
560
+ 'suggestedDocumentationUpdates',
561
+ ],
562
+ },
563
+ ];
421
564
  export const REQUIRED_DETERMINISTIC_BOUNDARY_ENFORCEMENT_SNIPPETS = [
422
565
  {
423
566
  path: 'scripts/documentation-boundary-audit.mjs',
424
567
  snippets: [
425
568
  'reportVersion',
426
569
  'violations',
427
- 'suggestedActions',
570
+ 'requiredActions',
428
571
  'diagnosticCode',
429
572
  'autoDocsSyncScope',
430
573
  'rolloutMetrics',
@@ -440,7 +583,7 @@ export const REQUIRED_DETERMINISTIC_BOUNDARY_ENFORCEMENT_SNIPPETS = [
440
583
  'diagnostics.documentationBoundaryAudit',
441
584
  'auto-docs-sync-scope-phase1',
442
585
  'auto-docs-sync-rollout-metrics',
443
- 'ui-design-judge-hybrid-diagnostics',
586
+ 'ui-design-judge-structured-diagnostics',
444
587
  ],
445
588
  },
446
589
  ];
@@ -3,6 +3,7 @@ import { join, relative } from 'node:path';
3
3
  import {
4
4
  COMPLIANCE_ALIAS_TERMS,
5
5
  COMPLIANCE_TERMINOLOGY_BOUNDARY_PATHS,
6
+ FORBIDDEN_ACTIVE_BIAS_ANCHOR_SNIPPETS,
6
7
  FORMAL_ARTIFACT_PATHS,
7
8
  FORBIDDEN_TEMPLATE_BOOTSTRAP_SNIPPETS,
8
9
  REQUIRED_COMPLIANCE_CANONICAL_SNIPPETS,
@@ -12,7 +13,7 @@ import {
12
13
  REQUIRED_DEVELOPER_FIRST_MENTION_PATTERNS,
13
14
  REQUIRED_DOCKER_RUNTIME_AUTOMATION_SNIPPETS,
14
15
  REQUIRED_HUMAN_WRITING_SNIPPETS,
15
- REQUIRED_STACK_RESEARCH_ENGINE_SNIPPETS,
16
+ REQUIRED_STACK_DECISION_BOUNDARY_SNIPPETS,
16
17
  REQUIRED_TEMPLATE_FREE_BOOTSTRAP_SNIPPETS,
17
18
  REQUIRED_TERMINOLOGY_ROW_PATTERNS,
18
19
  REQUIRED_TERMINOLOGY_RULE_SNIPPET,
@@ -86,7 +87,7 @@ export async function validateTerminologyMapping(context) {
86
87
  fail(`${TERMINOLOGY_REFERENCE_DOCUMENT_PATH} must define first-mention canonical term rule`);
87
88
  }
88
89
 
89
- if (terminologyReferenceContent.includes('Compliance and audit artifacts must keep canonical enterprise terminology')) {
90
+ if (terminologyReferenceContent.includes('Formal policy and audit artifacts must keep canonical terminology')) {
90
91
  pass(`${TERMINOLOGY_REFERENCE_DOCUMENT_PATH} defines compliance terminology boundary`);
91
92
  } else {
92
93
  fail(`${TERMINOLOGY_REFERENCE_DOCUMENT_PATH} must define compliance terminology boundary`);
@@ -191,12 +192,12 @@ export async function validateDetectionTransparencyCoverage(context) {
191
192
  });
192
193
  }
193
194
 
194
- export async function validateStackResearchEngineCoverage(context) {
195
+ export async function validateStackDecisionBoundaryCoverage(context) {
195
196
  await validateSnippetCoverage({
196
- heading: 'Checking stack research engine coverage...',
197
- coverageRules: REQUIRED_STACK_RESEARCH_ENGINE_SNIPPETS,
198
- missingLabel: 'stack research source',
199
- snippetLabel: 'stack research snippet',
197
+ heading: 'Checking stack decision boundary coverage...',
198
+ coverageRules: REQUIRED_STACK_DECISION_BOUNDARY_SNIPPETS,
199
+ missingLabel: 'stack decision boundary source',
200
+ snippetLabel: 'stack decision boundary snippet',
200
201
  context,
201
202
  });
202
203
  }
@@ -303,6 +304,30 @@ export async function validateDeterministicBoundaryEnforcementCoverage(context)
303
304
  });
304
305
  }
305
306
 
307
+ export async function validateRulesOnlyActiveSurfaceCoverage(context) {
308
+ const { ROOT_DIR, fileExists, readTextFile, pass, fail } = context;
309
+
310
+ console.log('\nChecking rules-only active surface cleanup...');
311
+
312
+ for (const forbiddenRule of FORBIDDEN_ACTIVE_BIAS_ANCHOR_SNIPPETS) {
313
+ const absoluteForbiddenPath = join(ROOT_DIR, forbiddenRule.path);
314
+
315
+ if (!(await fileExists(absoluteForbiddenPath))) {
316
+ fail(`Missing rules-only active surface source: ${forbiddenRule.path}`);
317
+ continue;
318
+ }
319
+
320
+ const forbiddenContent = await readTextFile(absoluteForbiddenPath);
321
+ for (const forbiddenSnippet of forbiddenRule.snippets) {
322
+ if (forbiddenContent.includes(forbiddenSnippet)) {
323
+ fail(`${forbiddenRule.path} must not include active bias-anchor snippet: ${forbiddenSnippet}`);
324
+ } else {
325
+ pass(`${forbiddenRule.path} excludes active bias-anchor snippet: ${forbiddenSnippet}`);
326
+ }
327
+ }
328
+ }
329
+ }
330
+
306
331
  export async function validateHumanWritingGovernance(context) {
307
332
  const { ROOT_DIR, fileExists, readTextFile, pass, fail } = context;
308
333
 
@@ -19,7 +19,6 @@ import { fileURLToPath } from 'node:url';
19
19
  import {
20
20
  ALLOWED_SEVERITIES,
21
21
  OVERRIDE_WARNING_WINDOW_DAYS,
22
- REQUIRED_STACK_RESEARCH_ENGINE_SNIPPETS,
23
22
  } from './validate/config.mjs';
24
23
  import {
25
24
  validateDependencyFreshnessAutomationCoverage,
@@ -28,8 +27,9 @@ import {
28
27
  validateDockerRuntimeAutomationCoverage,
29
28
  validateHumanWritingGovernance,
30
29
  validateInstructionAdapters,
30
+ validateRulesOnlyActiveSurfaceCoverage,
31
31
  validateSkillPurgeSurface,
32
- validateStackResearchEngineCoverage,
32
+ validateStackDecisionBoundaryCoverage,
33
33
  validateTemplateFreeBootstrapCoverage,
34
34
  validateTerminologyMapping,
35
35
  validateUiDesignAutomationCoverage,
@@ -137,6 +137,9 @@ async function validateRequiredFiles() {
137
137
  'scripts/docs-quality-drift-report.mjs',
138
138
  'scripts/governance-weekly-report.mjs',
139
139
  'scripts/mcp-server.mjs',
140
+ 'scripts/mcp-server/constants.mjs',
141
+ 'scripts/mcp-server/tool-registry.mjs',
142
+ 'scripts/mcp-server/tools.mjs',
140
143
  'scripts/frontend-usability-audit.mjs',
141
144
  'scripts/ui-design-judge.mjs',
142
145
  'scripts/documentation-boundary-audit.mjs',
@@ -180,7 +183,7 @@ async function validateRequiredFiles() {
180
183
  'tests/cli-smoke.test.mjs',
181
184
  'tests/mcp-server.test.mjs',
182
185
  'tests/llm-judge.test.mjs',
183
- 'tests/enterprise-ops.test.mjs',
186
+ 'tests/operations.test.mjs',
184
187
  'LICENSE',
185
188
  '.gitignore',
186
189
  ];
@@ -700,7 +703,7 @@ async function main() {
700
703
  await validateDocumentationFlow();
701
704
  await validateTerminologyMapping(coverageValidationContext);
702
705
  await validateDetectionTransparencyCoverage(coverageValidationContext);
703
- await validateStackResearchEngineCoverage(coverageValidationContext);
706
+ await validateStackDecisionBoundaryCoverage(coverageValidationContext);
704
707
  await validateUniversalSopConsolidationCoverage(coverageValidationContext);
705
708
  await validateTemplateFreeBootstrapCoverage(coverageValidationContext);
706
709
  await validateUpgradeUiContractWarningCoverage(coverageValidationContext);
@@ -708,6 +711,7 @@ async function main() {
708
711
  await validateDockerRuntimeAutomationCoverage(coverageValidationContext);
709
712
  await validateDependencyFreshnessAutomationCoverage(coverageValidationContext);
710
713
  await validateDeterministicBoundaryEnforcementCoverage(coverageValidationContext);
714
+ await validateRulesOnlyActiveSurfaceCoverage(coverageValidationContext);
711
715
  await validateStackResearchSnapshotState();
712
716
  await validateMcpConfiguration();
713
717
  await validateHumanWritingGovernance(coverageValidationContext);