@ryuenn3123/agentic-senior-core 4.3.15 → 5.1.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 (198) hide show
  1. package/.agents/plugins/marketplace.json +21 -0
  2. package/.agents/rules/agentic-senior-core.md +126 -0
  3. package/.claude-plugin/marketplace.json +17 -0
  4. package/.claude-plugin/plugin.json +17 -0
  5. package/.clinerules/agentic-senior-core.md +94 -0
  6. package/.codex-plugin/plugin.json +24 -0
  7. package/.cursor/rules/agentic-senior-core.mdc +99 -0
  8. package/.devin-plugin/plugin.json +13 -0
  9. package/.github/copilot-instructions.md +94 -0
  10. package/.github/plugin/marketplace.json +20 -0
  11. package/.github/plugin/plugin.json +16 -0
  12. package/.kiro/steering/agentic-senior-core.md +94 -0
  13. package/.openclaw/skills/asc/SKILL.md +23 -0
  14. package/.openclaw/skills/asc-audit/SKILL.md +28 -0
  15. package/.openclaw/skills/asc-review/SKILL.md +54 -0
  16. package/.opencode/plugins/agentic-senior-core.mjs +31 -0
  17. package/.windsurf/rules/agentic-senior-core.md +94 -0
  18. package/AGENTS.md +126 -179
  19. package/CONTRIBUTING.md +93 -63
  20. package/README.md +160 -111
  21. package/__init__.py +61 -0
  22. package/bin/agentic-senior-core.js +41 -43
  23. package/commands/asc-audit.md +1 -0
  24. package/commands/asc-audit.toml +2 -0
  25. package/commands/asc-help.md +9 -0
  26. package/commands/asc-help.toml +2 -0
  27. package/commands/asc-refactor.md +1 -0
  28. package/commands/asc-refactor.toml +2 -0
  29. package/commands/asc-review.md +1 -0
  30. package/commands/asc-review.toml +2 -0
  31. package/gemini-extension.json +10 -0
  32. package/hooks/copilot-hooks.json +21 -0
  33. package/hooks/hooks.json +31 -0
  34. package/hooks/session-start.js +36 -0
  35. package/hooks/subagent-start.js +38 -0
  36. package/lib/cli/commands/adapter.mjs +109 -0
  37. package/lib/cli/commands/clean.mjs +63 -0
  38. package/lib/cli/commands/status.mjs +94 -0
  39. package/package.json +43 -67
  40. package/plugin.yaml +16 -0
  41. package/scripts/uninstall.js +38 -0
  42. package/skills/asc/SKILL.md +16 -0
  43. package/skills/asc-audit/SKILL.md +28 -0
  44. package/skills/asc-refactor/SKILL.md +35 -0
  45. package/skills/asc-review/SKILL.md +54 -0
  46. package/.agent-context/policies/llm-judge-threshold.json +0 -29
  47. package/.agent-context/prompts/bootstrap-design.md +0 -63
  48. package/.agent-context/prompts/compact-natural-mode.md +0 -100
  49. package/.agent-context/prompts/init-project.md +0 -60
  50. package/.agent-context/prompts/refactor.md +0 -38
  51. package/.agent-context/prompts/review-code.md +0 -31
  52. package/.agent-context/review-checklists/architecture-review.md +0 -57
  53. package/.agent-context/review-checklists/pr-checklist.md +0 -136
  54. package/.agent-context/rules/api-docs.md +0 -24
  55. package/.agent-context/rules/api-versioning.md +0 -16
  56. package/.agent-context/rules/architecture.md +0 -33
  57. package/.agent-context/rules/background-jobs.md +0 -17
  58. package/.agent-context/rules/config-and-flags.md +0 -16
  59. package/.agent-context/rules/database-design.md +0 -18
  60. package/.agent-context/rules/docker-runtime.md +0 -17
  61. package/.agent-context/rules/error-handling.md +0 -16
  62. package/.agent-context/rules/event-driven.md +0 -16
  63. package/.agent-context/rules/frontend-architecture.md +0 -54
  64. package/.agent-context/rules/microservices.md +0 -16
  65. package/.agent-context/rules/migrations.md +0 -16
  66. package/.agent-context/rules/observability.md +0 -16
  67. package/.agent-context/rules/performance.md +0 -16
  68. package/.agent-context/rules/realtime.md +0 -16
  69. package/.agent-context/rules/resilience.md +0 -18
  70. package/.agent-context/rules/security.md +0 -18
  71. package/.agent-context/rules/testing.md +0 -16
  72. package/.agent-context/state/README.md +0 -25
  73. package/.agent-context/state/architecture-map.md +0 -40
  74. package/.agent-context/state/benchmark-comparison-schema.json +0 -181
  75. package/.agent-context/state/benchmark-reproducibility.json +0 -87
  76. package/.agent-context/state/benchmark-thresholds.json +0 -10
  77. package/.agent-context/state/benchmark-writer-judge-config.json +0 -58
  78. package/.agent-context/state/dependency-map.md +0 -41
  79. package/.agent-context/state/memory-adapter-contract.json +0 -52
  80. package/.agent-context/state/memory-schema-v1.json +0 -88
  81. package/GEMINI.md +0 -1
  82. package/benchmarks/README.md +0 -60
  83. package/benchmarks/compact-natural-mode/fixtures.mjs +0 -359
  84. package/benchmarks/compact-natural-mode/scorer.mjs +0 -331
  85. package/benchmarks/runtime-token-saver/fixtures.mjs +0 -836
  86. package/lib/cli/adaptive-context/catalog.mjs +0 -390
  87. package/lib/cli/adaptive-context/file-signals.mjs +0 -100
  88. package/lib/cli/adaptive-context/implications.mjs +0 -44
  89. package/lib/cli/adaptive-context.mjs +0 -365
  90. package/lib/cli/audits/typography-palette-anti-repeat/color-utils.mjs +0 -156
  91. package/lib/cli/audits/typography-palette-anti-repeat/file-scanner.mjs +0 -103
  92. package/lib/cli/audits/typography-palette-anti-repeat/typography-utils.mjs +0 -70
  93. package/lib/cli/audits/typography-palette-anti-repeat-audit.mjs +0 -239
  94. package/lib/cli/backup.mjs +0 -210
  95. package/lib/cli/commands/audit-design-anti-repeat.mjs +0 -39
  96. package/lib/cli/commands/context.mjs +0 -140
  97. package/lib/cli/commands/init/project-context.mjs +0 -60
  98. package/lib/cli/commands/init/runtime-environment.mjs +0 -59
  99. package/lib/cli/commands/init/setup-decisions.mjs +0 -83
  100. package/lib/cli/commands/init.mjs +0 -654
  101. package/lib/cli/commands/launch.mjs +0 -76
  102. package/lib/cli/commands/optimize.mjs +0 -284
  103. package/lib/cli/commands/rollback.mjs +0 -64
  104. package/lib/cli/commands/upgrade/token-optimization-state.mjs +0 -51
  105. package/lib/cli/commands/upgrade.mjs +0 -451
  106. package/lib/cli/compiler.mjs +0 -570
  107. package/lib/cli/constants.mjs +0 -136
  108. package/lib/cli/detector/constants.mjs +0 -135
  109. package/lib/cli/detector/design-evidence/collector.mjs +0 -256
  110. package/lib/cli/detector/design-evidence/constants.mjs +0 -39
  111. package/lib/cli/detector/design-evidence/file-traversal.mjs +0 -83
  112. package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +0 -117
  113. package/lib/cli/detector/design-evidence/summary.mjs +0 -109
  114. package/lib/cli/detector/design-evidence/utility-helpers.mjs +0 -122
  115. package/lib/cli/detector/design-evidence.mjs +0 -25
  116. package/lib/cli/detector/stack-detection.mjs +0 -243
  117. package/lib/cli/detector/ui-signals.mjs +0 -150
  118. package/lib/cli/detector/workspace-scan.mjs +0 -177
  119. package/lib/cli/detector.mjs +0 -23
  120. package/lib/cli/init-detection-flow.mjs +0 -48
  121. package/lib/cli/init-options.mjs +0 -237
  122. package/lib/cli/init-selection.mjs +0 -29
  123. package/lib/cli/memory-continuity.mjs +0 -537
  124. package/lib/cli/preflight.mjs +0 -76
  125. package/lib/cli/project-scaffolder/constants.mjs +0 -69
  126. package/lib/cli/project-scaffolder/discovery.mjs +0 -272
  127. package/lib/cli/project-scaffolder/prompt-builders.mjs +0 -171
  128. package/lib/cli/project-scaffolder/storage.mjs +0 -144
  129. package/lib/cli/project-scaffolder/ui-scope-detection.mjs +0 -36
  130. package/lib/cli/project-scaffolder.mjs +0 -29
  131. package/lib/cli/rollback.mjs +0 -66
  132. package/lib/cli/token-optimization.mjs +0 -486
  133. package/lib/cli/utils/filesystem.mjs +0 -81
  134. package/lib/cli/utils/managed-surface.mjs +0 -280
  135. package/lib/cli/utils/prompting.mjs +0 -44
  136. package/lib/cli/utils.mjs +0 -479
  137. package/mcp.json +0 -134
  138. package/scripts/adaptive-context/fixtures.mjs +0 -183
  139. package/scripts/adaptive-context-benchmark.mjs +0 -9
  140. package/scripts/ascx-runtime-token-saver-benchmark.mjs +0 -9
  141. package/scripts/audit-cache-layer-contract.mjs +0 -263
  142. package/scripts/audit-caching-scope-hygiene.mjs +0 -268
  143. package/scripts/audit-file-size.mjs +0 -219
  144. package/scripts/audit-reflection-citations.mjs +0 -163
  145. package/scripts/audit-release-bundle.mjs +0 -170
  146. package/scripts/audit-rule-id-uniqueness.mjs +0 -313
  147. package/scripts/audit-typography-palette-anti-repeat.mjs +0 -120
  148. package/scripts/benchmark-evidence-bundle.mjs +0 -645
  149. package/scripts/benchmark-gate.mjs +0 -121
  150. package/scripts/benchmark-intelligence.mjs +0 -33
  151. package/scripts/benchmark-writer-judge-matrix.mjs +0 -379
  152. package/scripts/build-release-benchmark-bundle.mjs +0 -202
  153. package/scripts/bump-version.mjs +0 -103
  154. package/scripts/clean-local-artifacts.mjs +0 -78
  155. package/scripts/compact-natural-mode-benchmark.mjs +0 -9
  156. package/scripts/context-triggered-audit.mjs +0 -391
  157. package/scripts/detection-benchmark.mjs +0 -127
  158. package/scripts/docs-quality-drift-report.mjs +0 -358
  159. package/scripts/documentation-boundary-audit.mjs +0 -305
  160. package/scripts/explain-on-demand-audit.mjs +0 -427
  161. package/scripts/forbidden-content-check.mjs +0 -123
  162. package/scripts/frontend-usability-audit.mjs +0 -243
  163. package/scripts/generate-sbom.mjs +0 -61
  164. package/scripts/governance-weekly-report.mjs +0 -466
  165. package/scripts/llm-judge/checklist-loader.mjs +0 -45
  166. package/scripts/llm-judge/constants.mjs +0 -66
  167. package/scripts/llm-judge/diff-collection.mjs +0 -74
  168. package/scripts/llm-judge/prompting.mjs +0 -78
  169. package/scripts/llm-judge/providers.mjs +0 -111
  170. package/scripts/llm-judge/verdict.mjs +0 -134
  171. package/scripts/llm-judge.mjs +0 -200
  172. package/scripts/memory-continuity-benchmark.mjs +0 -322
  173. package/scripts/quality-trend-report.mjs +0 -289
  174. package/scripts/release-gate/audit-checks.mjs +0 -441
  175. package/scripts/release-gate/constants.mjs +0 -53
  176. package/scripts/release-gate/runtime.mjs +0 -63
  177. package/scripts/release-gate/static-checks.mjs +0 -182
  178. package/scripts/release-gate.mjs +0 -42
  179. package/scripts/rules-guardian-audit.mjs +0 -580
  180. package/scripts/single-source-lazy-loading-audit.mjs +0 -449
  181. package/scripts/sync-thin-adapters.mjs +0 -72
  182. package/scripts/token-optimization-benchmark.mjs +0 -252
  183. package/scripts/ui-design-judge/constants.mjs +0 -13
  184. package/scripts/ui-design-judge/design-execution-summary.mjs +0 -81
  185. package/scripts/ui-design-judge/git-input.mjs +0 -134
  186. package/scripts/ui-design-judge/prompting.mjs +0 -52
  187. package/scripts/ui-design-judge/providers.mjs +0 -102
  188. package/scripts/ui-design-judge/reporting.mjs +0 -183
  189. package/scripts/ui-design-judge/rubric-calibration.mjs +0 -214
  190. package/scripts/ui-design-judge/rubric-goldset.json +0 -188
  191. package/scripts/ui-design-judge.mjs +0 -319
  192. package/scripts/ui-rubric-calibration.mjs +0 -35
  193. package/scripts/validate/config.mjs +0 -519
  194. package/scripts/validate/coverage-checks.mjs +0 -446
  195. package/scripts/validate/file-structure.mjs +0 -162
  196. package/scripts/validate/markdown-content.mjs +0 -109
  197. package/scripts/validate/project-metadata.mjs +0 -166
  198. package/scripts/validate.mjs +0 -338
@@ -1,109 +0,0 @@
1
- import { dirname, join, relative, resolve } from 'node:path';
2
-
3
- export async function validateMarkdownFiles(context) {
4
- const { ROOT_DIR, collectFiles, readTextFile, pass, fail } = context;
5
- console.log('\nChecking markdown content...');
6
-
7
- const markdownFilePaths = await collectFiles(ROOT_DIR, (fileName) => fileName.endsWith('.md'));
8
-
9
- for (const markdownFilePath of markdownFilePaths) {
10
- const markdownContent = await readTextFile(markdownFilePath);
11
- const relativeMarkdownPath = relative(ROOT_DIR, markdownFilePath);
12
-
13
- if (markdownContent.trim().length === 0) {
14
- fail(`Empty markdown file: ${relativeMarkdownPath}`);
15
- continue;
16
- }
17
-
18
- pass(`${relativeMarkdownPath} (${markdownContent.length} chars)`);
19
- }
20
- }
21
-
22
- export async function validateCrossReferences(context) {
23
- const { ROOT_DIR, collectFiles, readTextFile, fileExists, pass, fail, warn } = context;
24
- console.log('\nChecking internal links...');
25
-
26
- const markdownFilePaths = await collectFiles(ROOT_DIR, (fileName) => fileName.endsWith('.md'));
27
- const linkPattern = /\[([^\]]*)\]\((?!https?:\/\/|#)([^)]+)\)/g;
28
- let checkedLinkCount = 0;
29
-
30
- for (const markdownFilePath of markdownFilePaths) {
31
- const markdownContent = await readTextFile(markdownFilePath);
32
- const currentFileDirectory = dirname(markdownFilePath);
33
- const relativeMarkdownPath = relative(ROOT_DIR, markdownFilePath);
34
- let linkMatch = linkPattern.exec(markdownContent);
35
-
36
- while (linkMatch) {
37
- const rawLinkTarget = linkMatch[2].split('#')[0];
38
- if (rawLinkTarget) {
39
- checkedLinkCount += 1;
40
- const resolvedLinkPath = resolve(currentFileDirectory, rawLinkTarget);
41
-
42
- if (await fileExists(resolvedLinkPath)) {
43
- pass(`${relativeMarkdownPath} → ${linkMatch[2]}`);
44
- } else {
45
- fail(`Broken link in ${relativeMarkdownPath}: ${linkMatch[2]}`);
46
- }
47
- }
48
-
49
- linkMatch = linkPattern.exec(markdownContent);
50
- }
51
- }
52
-
53
- if (checkedLinkCount === 0) {
54
- warn('No internal links were found in markdown files');
55
- }
56
- }
57
-
58
- export async function validateAgentsManifest(context) {
59
- const { ROOT_DIR, readTextFile, fileExists, pass, fail, warn } = context;
60
- console.log('\nChecking AGENTS.md manifest links...');
61
-
62
- const agentsContent = await readTextFile(join(ROOT_DIR, 'AGENTS.md'));
63
- const fileReferencePattern = /\[`?([^`\]]+)`?\]\(([^)]+)\)/g;
64
- let manifestLinkCount = 0;
65
- let fileReferenceMatch = fileReferencePattern.exec(agentsContent);
66
-
67
- while (fileReferenceMatch) {
68
- const manifestLinkTarget = fileReferenceMatch[2];
69
-
70
- if (!manifestLinkTarget.startsWith('http')) {
71
- manifestLinkCount += 1;
72
- const resolvedManifestLinkPath = resolve(ROOT_DIR, manifestLinkTarget);
73
-
74
- if (await fileExists(resolvedManifestLinkPath)) {
75
- pass(`AGENTS.md → ${manifestLinkTarget}`);
76
- } else {
77
- fail(`AGENTS.md references missing file: ${manifestLinkTarget}`);
78
- }
79
- }
80
-
81
- fileReferenceMatch = fileReferencePattern.exec(agentsContent);
82
- }
83
-
84
- if (manifestLinkCount === 0) {
85
- warn('AGENTS.md does not contain any local manifest links');
86
- }
87
- }
88
-
89
- export async function validateDocumentationFlow(context) {
90
- const { README_PATH, readTextFile, pass, fail } = context;
91
- console.log('\nChecking documentation flow...');
92
-
93
- const readmeContent = await readTextFile(README_PATH);
94
- const requiredReadmeSnippets = [
95
- 'npx @ryuenn3123/agentic-senior-core init',
96
- 'npm run validate',
97
- 'docs/faq.md',
98
- 'docs/deep-dive.md',
99
- 'docs/archive/HISTORY.md',
100
- ];
101
-
102
- for (const requiredReadmeSnippet of requiredReadmeSnippets) {
103
- if (readmeContent.includes(requiredReadmeSnippet)) {
104
- pass(`README.md mentions ${requiredReadmeSnippet}`);
105
- } else {
106
- fail(`README.md must mention ${requiredReadmeSnippet}`);
107
- }
108
- }
109
- }
@@ -1,166 +0,0 @@
1
- import { join } from 'node:path';
2
- import { ALLOWED_SEVERITIES } from './config.mjs';
3
-
4
- export async function validatePackageMetadata(context) {
5
- const { PACKAGE_JSON_PATH, BUN_LOCK_PATH, readTextFile, fileExists, pass, fail, warn } = context;
6
- console.log('\nChecking package metadata...');
7
-
8
- const packageJson = JSON.parse(await readTextFile(PACKAGE_JSON_PATH));
9
- const versionPattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
10
-
11
- if (typeof packageJson.version !== 'string' || !versionPattern.test(packageJson.version)) {
12
- fail('package.json version must be a semantic version string');
13
- } else {
14
- pass(`package.json version ${packageJson.version}`);
15
- }
16
-
17
- if (packageJson.scripts?.validate === 'node ./scripts/validate.mjs') {
18
- pass('package.json validate script is Node-first');
19
- } else {
20
- fail('package.json validate script must use node ./scripts/validate.mjs');
21
- }
22
-
23
- if (packageJson.scripts?.test) {
24
- pass('package.json test script exists');
25
- } else {
26
- fail('package.json test script is missing');
27
- }
28
-
29
- if (packageJson.devDependencies && Object.keys(packageJson.devDependencies).length > 0) {
30
- warn('package.json still has devDependencies; review whether they are necessary');
31
- } else {
32
- pass('package.json has no unnecessary devDependencies');
33
- }
34
-
35
- if (Array.isArray(packageJson.files) && packageJson.files.includes('AGENTS.md')) {
36
- pass('package.json publishes canonical AGENTS.md');
37
- } else {
38
- fail('package.json must publish AGENTS.md so init and upgrade can copy the canonical root instructions file');
39
- }
40
-
41
- if (await fileExists(BUN_LOCK_PATH)) {
42
- fail('bun.lock must not be tracked while npm is the package manager source of truth');
43
- } else {
44
- pass('No bun.lock drift file present');
45
- }
46
- }
47
-
48
- export async function validatePolicyFile(context) {
49
- const { POLICY_FILE_PATH, readTextFile, pass, fail } = context;
50
- console.log('\nChecking LLM Judge policy...');
51
-
52
- const policyContent = await readTextFile(POLICY_FILE_PATH);
53
- const parsedPolicy = JSON.parse(policyContent);
54
- const selectedProfileName = parsedPolicy.selectedProfile;
55
- const profileThresholds = parsedPolicy.profileThresholds;
56
-
57
- if (typeof selectedProfileName !== 'string') {
58
- fail('Policy file must define selectedProfile as a string');
59
- } else {
60
- pass(`LLM Judge selected profile: ${selectedProfileName}`);
61
- }
62
-
63
- if (!profileThresholds || typeof profileThresholds !== 'object') {
64
- fail('Policy file must define profileThresholds');
65
- return;
66
- }
67
-
68
- for (const [profileName, profileSettings] of Object.entries(profileThresholds)) {
69
- if (!Array.isArray(profileSettings.blockingSeverities)) {
70
- fail(`Policy profile ${profileName} must define blockingSeverities`);
71
- continue;
72
- }
73
-
74
- const invalidSeverity = profileSettings.blockingSeverities.find((severity) => !ALLOWED_SEVERITIES.has(severity));
75
- if (invalidSeverity) {
76
- fail(`Policy profile ${profileName} uses unsupported severity: ${invalidSeverity}`);
77
- continue;
78
- }
79
-
80
- pass(`Policy profile ${profileName} blocking severities are valid`);
81
- }
82
-
83
- if (typeof profileThresholds[selectedProfileName] === 'object') {
84
- pass('Policy selectedProfile points to a valid profile');
85
- } else {
86
- fail('Policy selectedProfile must match one of the configured profileThresholds');
87
- }
88
- }
89
-
90
- export async function validateVersionConsistency(context) {
91
- const { ROOT_DIR, PACKAGE_JSON_PATH, CHANGELOG_PATH, PACKAGE_LOCK_PATH, GENERATED_RULE_FILES, readTextFile, fileExists, pass, fail } = context;
92
- console.log('\nChecking release version consistency...');
93
-
94
- const packageJson = JSON.parse(await readTextFile(PACKAGE_JSON_PATH));
95
- const packageVersion = packageJson.version;
96
- const changelogContent = await readTextFile(CHANGELOG_PATH);
97
-
98
- if (changelogContent.includes(`## ${packageVersion}`)) {
99
- pass(`CHANGELOG.md contains release entry for ${packageVersion}`);
100
- } else {
101
- fail(`CHANGELOG.md is missing a ## ${packageVersion} heading`);
102
- }
103
-
104
- if (await fileExists(PACKAGE_LOCK_PATH)) {
105
- const packageLock = JSON.parse(await readTextFile(PACKAGE_LOCK_PATH));
106
- const rootLockVersion = packageLock.packages?.['']?.version;
107
- if (packageLock.version === packageVersion && rootLockVersion === packageVersion) {
108
- pass(`package-lock.json matches package version ${packageVersion}`);
109
- } else {
110
- fail(`package-lock.json version drift: expected ${packageVersion}, found ${packageLock.version || 'missing'} / ${rootLockVersion || 'missing'}`);
111
- }
112
- } else {
113
- fail('package-lock.json is required for npm release consistency');
114
- }
115
-
116
- for (const generatedRuleFileName of GENERATED_RULE_FILES) {
117
- const generatedRuleContent = await readTextFile(join(ROOT_DIR, generatedRuleFileName));
118
-
119
- if (generatedRuleContent.includes(`Generated by Agentic-Senior-Core CLI v${packageVersion}`)) {
120
- pass(`${generatedRuleFileName} matches package version ${packageVersion}`);
121
- } else {
122
- fail(`${generatedRuleFileName} does not match package version ${packageVersion}`);
123
- }
124
- }
125
- }
126
-
127
- export async function validateMcpConfiguration(context) {
128
- const { ROOT_DIR, readTextFile, pass, fail } = context;
129
- console.log('\nChecking MCP configuration...');
130
-
131
- const mcpConfiguration = JSON.parse(await readTextFile(join(ROOT_DIR, 'mcp.json')));
132
- const workspaceMcpConfiguration = JSON.parse(await readTextFile(join(ROOT_DIR, '.vscode', 'mcp.json')));
133
- const workspaceServerConfig = workspaceMcpConfiguration.servers?.['agentic-senior-core'];
134
-
135
- if (mcpConfiguration.knowledgeLayers?.enabled === true) {
136
- pass('Root MCP config has knowledgeLayers enabled');
137
- } else {
138
- fail('Root MCP config must have knowledgeLayers.enabled: true');
139
- }
140
-
141
- if (typeof workspaceMcpConfiguration.$schema === 'undefined') {
142
- pass('Workspace MCP config omits $schema (supported by current VS Code MCP schema inference)');
143
- } else if (workspaceMcpConfiguration.$schema === 'vscode://schemas/mcp') {
144
- pass('Workspace MCP config uses trusted VS Code schema');
145
- } else {
146
- fail('Workspace MCP config $schema must be omitted or set to vscode://schemas/mcp');
147
- }
148
-
149
- if (workspaceServerConfig?.command === 'node') {
150
- pass('Workspace MCP server command uses Node');
151
- } else {
152
- fail('Workspace MCP server command must use Node');
153
- }
154
-
155
- if (workspaceServerConfig?.cwd === '${workspaceFolder}') {
156
- pass('Workspace MCP server cwd uses ${workspaceFolder}');
157
- } else {
158
- fail('Workspace MCP server cwd must be ${workspaceFolder}');
159
- }
160
-
161
- if (Array.isArray(workspaceServerConfig?.args) && workspaceServerConfig.args.includes('./scripts/mcp-server.mjs')) {
162
- pass('Workspace MCP server points to scripts/mcp-server.mjs');
163
- } else {
164
- fail('Workspace MCP server must include ./scripts/mcp-server.mjs argument');
165
- }
166
- }
@@ -1,338 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // Phase 1 governance refactor completed: monolithic script split into modular sub-files.
4
- /**
5
- * validate.mjs — Repository Integrity Validator
6
- *
7
- * Validates the Agentic-Senior-Core repository:
8
- * - Required files exist
9
- * - Markdown and JSON documents are readable
10
- * - Cross-references resolve from the correct source directory
11
- * - Version references stay consistent for release builds
12
- * - LLM Judge policy configuration is valid
13
- *
14
- * Usage: node scripts/validate.mjs
15
- */
16
-
17
- import { readdir, readFile, stat } from 'node:fs/promises';
18
- import { dirname, join, relative, resolve } from 'node:path';
19
- import { fileURLToPath } from 'node:url';
20
- import { ALLOWED_SEVERITIES } from './validate/config.mjs';
21
- import { runCacheLayerContractAudit } from './audit-cache-layer-contract.mjs';
22
- import { runCachingScopeHygieneAudit } from './audit-caching-scope-hygiene.mjs';
23
- import { runTypographyPaletteAntiRepeatAudit } from '../lib/cli/audits/typography-palette-anti-repeat-audit.mjs';
24
- import { runAuditFileSize } from './audit-file-size.mjs';
25
- import { runReflectionCitationAudit } from './audit-reflection-citations.mjs';
26
- import { runReleaseBundleAudit } from './audit-release-bundle.mjs';
27
- import { runRuleIdUniquenessAudit } from './audit-rule-id-uniqueness.mjs';
28
- import {
29
- validateDependencyFreshnessAutomationCoverage,
30
- validateDetectionTransparencyCoverage,
31
- validateDeterministicBoundaryEnforcementCoverage,
32
- validateDiagramFormatCoverage,
33
- validateDockerRuntimeAutomationCoverage,
34
- validateHumanWritingGovernance,
35
- validateInstructionAdapters,
36
- validateRulesOnlyActiveSurfaceCoverage,
37
- validateSkillPurgeSurface,
38
- validateStackDecisionBoundaryCoverage,
39
- validateTemplateFreeBootstrapCoverage,
40
- validateTerminologyMapping,
41
- validateUiDesignAutomationCoverage,
42
- validateUniversalSopConsolidationCoverage,
43
- validateUpgradeUiContractWarningCoverage,
44
- } from './validate/coverage-checks.mjs';
45
- import {
46
- validateRequiredFiles,
47
- validateRuleFiles,
48
- validateChecklistConsolidation,
49
- } from './validate/file-structure.mjs';
50
- import {
51
- validateMarkdownFiles,
52
- validateCrossReferences,
53
- validateAgentsManifest,
54
- validateDocumentationFlow,
55
- } from './validate/markdown-content.mjs';
56
- import {
57
- validatePackageMetadata,
58
- validatePolicyFile,
59
- validateVersionConsistency,
60
- validateMcpConfiguration,
61
- } from './validate/project-metadata.mjs';
62
-
63
- const SCRIPT_FILE_PATH = fileURLToPath(import.meta.url);
64
- const ROOT_DIR = resolve(dirname(SCRIPT_FILE_PATH), '..');
65
- const AGENT_CONTEXT_DIR = join(ROOT_DIR, '.agent-context');
66
- const CANONICAL_INSTRUCTION_PATH = join(ROOT_DIR, 'AGENTS.md');
67
- const PACKAGE_JSON_PATH = join(ROOT_DIR, 'package.json');
68
- const PACKAGE_LOCK_PATH = join(ROOT_DIR, 'package-lock.json');
69
- const BUN_LOCK_PATH = join(ROOT_DIR, 'bun.lock');
70
- const CHANGELOG_PATH = join(ROOT_DIR, 'CHANGELOG.md');
71
- const README_PATH = join(ROOT_DIR, 'README.md');
72
- const POLICY_FILE_PATH = join(ROOT_DIR, '.agent-context', 'policies', 'llm-judge-threshold.json');
73
- const GENERATED_RULE_FILES = [];
74
-
75
- const validationResult = {
76
- passed: 0,
77
- failed: 0,
78
- errors: [],
79
- warnings: [],
80
- };
81
-
82
- async function fileExists(filePath) {
83
- try {
84
- await stat(filePath);
85
- return true;
86
- } catch {
87
- return false;
88
- }
89
- }
90
-
91
- async function readTextFile(filePath) {
92
- return readFile(filePath, 'utf8');
93
- }
94
-
95
- async function collectFiles(directoryPath, fileExtensionMatcher) {
96
- const matchingFilePaths = [];
97
-
98
- async function walk(currentDirectoryPath) {
99
- const directoryEntries = await readdir(currentDirectoryPath, { withFileTypes: true });
100
-
101
- for (const directoryEntry of directoryEntries) {
102
- if (
103
- directoryEntry.name === '.git'
104
- || directoryEntry.name === 'node_modules'
105
- || directoryEntry.name === '.agentic-backup'
106
- || directoryEntry.name === '.benchmarks'
107
- ) {
108
- continue;
109
- }
110
-
111
- const entryPath = join(currentDirectoryPath, directoryEntry.name);
112
-
113
- if (directoryEntry.isDirectory()) {
114
- await walk(entryPath);
115
- continue;
116
- }
117
-
118
- if (fileExtensionMatcher(directoryEntry.name)) {
119
- matchingFilePaths.push(entryPath);
120
- }
121
- }
122
- }
123
-
124
- await walk(directoryPath);
125
- return matchingFilePaths;
126
- }
127
-
128
- function pass(message) {
129
- validationResult.passed += 1;
130
- console.log(` PASS ${message}`);
131
- }
132
-
133
- function fail(message) {
134
- validationResult.failed += 1;
135
- validationResult.errors.push(message);
136
- console.log(` FAIL ${message}`);
137
- }
138
-
139
- function warn(message) {
140
- validationResult.warnings.push(message);
141
- console.log(` WARN ${message}`);
142
- }
143
-
144
- function normalizeLineEndings(content) {
145
- return content.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
146
- }
147
-
148
-
149
- async function validateFileSizeAudit() {
150
- console.log('\nChecking file size threshold (audit:file-size)...');
151
- const report = runAuditFileSize();
152
-
153
- if (report.passed) {
154
- pass(`File size audit clean: ${report.scannedFileCount} files scanned, ${report.exemptedCount} exempted under @file-size-exception`);
155
- } else {
156
- for (const violation of report.violations) {
157
- fail(`File exceeds ${report.threshold} LOC: ${violation.filePath} (${violation.lineCount} LOC). Split into focused submodules or declare a justified // @file-size-exception: <reason> marker in the first 5 lines.`);
158
- }
159
- }
160
- }
161
-
162
- async function validateCacheLayerContractAudit() {
163
- console.log('\nChecking cache layer contract (audit:cache-layer-contract)...');
164
- const report = runCacheLayerContractAudit();
165
-
166
- if (report.passed) {
167
- pass(`Cache layer contract audit clean: ${report.providerCount} provider(s), ${report.fixtureCount} fixture(s), ${report.resultCount} result row(s)`);
168
- } else {
169
- for (const violation of report.violations) {
170
- fail(`Cache layer contract violation [${violation.kind}]: ${violation.detail}`);
171
- }
172
- }
173
- }
174
-
175
- async function validateRuleIdUniquenessAudit() {
176
- console.log('\nChecking rule ID uniqueness (audit:rule-id-uniqueness)...');
177
- const report = runRuleIdUniquenessAudit();
178
-
179
- if (report.passed) {
180
- pass(`Rule ID audit clean: ${report.migratedFileCount} migrated rule file(s), ${report.skippedFileCount} pre-migration, ${report.knownSectionIdCount} section ID(s), ${report.refMentionCount} [REF:] mention(s) all resolve`);
181
- } else {
182
- for (const violation of report.violations) {
183
- fail(`Rule ID violation [${violation.kind}] in ${violation.file}: ${violation.detail}`);
184
- }
185
- }
186
- }
187
-
188
- async function validateReflectionCitationAudit() {
189
- console.log('\nChecking reflection citations (audit:reflection-citations)...');
190
- const report = runReflectionCitationAudit();
191
-
192
- if (report.passed) {
193
- pass(`Reflection citation audit clean: ${report.surfaceCount} surface(s), ${report.knownRuleIdCount} known rule ID(s)`);
194
- } else {
195
- for (const violation of report.violations) {
196
- fail(`Reflection citation violation [${violation.kind}] in ${violation.file}: ${violation.detail}`);
197
- }
198
- }
199
- }
200
-
201
- async function validateCachingScopeHygieneAudit() {
202
- console.log('\nChecking caching scope hygiene (audit:caching-scope-hygiene)...');
203
- const report = runCachingScopeHygieneAudit();
204
-
205
- if (report.passed) {
206
- pass(`Caching scope hygiene clean: ${report.surfaceCount} public surface(s), ${report.totalClaimCount} caching saving claim(s) all integration-scoped`);
207
- } else {
208
- for (const violation of report.violations) {
209
- fail(`Caching scope hygiene violation [${violation.kind}] in ${violation.file}:${violation.line}: ${violation.detail}`);
210
- }
211
- }
212
- }
213
-
214
- async function validateTypographyPaletteAntiRepeatAudit() {
215
- console.log('\nChecking typography and palette anti-repeat ledger (audit:typography-palette-anti-repeat)...');
216
- const report = runTypographyPaletteAntiRepeatAudit({ repositoryRootPath: ROOT_DIR });
217
-
218
- if (report.skipped) {
219
- pass(`Typography/palette anti-repeat audit skipped: ${report.reason}`);
220
- return;
221
- }
222
-
223
- if (report.passed) {
224
- pass(`Typography/palette anti-repeat audit clean: ${report.filesScanned} CSS/token file(s) scanned, 0 blocking typography violation(s), ${report.paletteFindingCount} palette finding(s) (${report.paletteSeverity})`);
225
- return;
226
- }
227
-
228
- for (const violation of report.typographyViolations) {
229
- fail(`Typography ledger violation [${violation.kind}] in ${violation.file}:${violation.line}: ${violation.detail}`);
230
- }
231
- if (report.paletteSeverity === 'blocking') {
232
- for (const finding of report.paletteFindings) {
233
- fail(`Palette ledger violation [${finding.kind}] in ${finding.file}:${finding.line}: ${finding.detail}`);
234
- }
235
- } else {
236
- for (const finding of report.paletteFindings) {
237
- warn(`Palette ledger advisory [${finding.kind}] in ${finding.file}:${finding.line}: ${finding.detail}`);
238
- }
239
- }
240
- }
241
-
242
- async function validateReleaseBundleAudit() {
243
- console.log('\nChecking release benchmark bundle (audit:release-bundle)...');
244
- const report = runReleaseBundleAudit();
245
-
246
- if (report.passed) {
247
- pass(`Release bundle integrity clean: ${report.artifactCount} artifact(s), release_target=${report.releaseTarget}, release_status=${report.releaseStatus}`);
248
- } else {
249
- for (const violation of report.violations) {
250
- fail(`Release bundle violation [${violation.kind}]: ${violation.detail}`);
251
- }
252
- }
253
- }
254
-
255
-
256
- async function main() {
257
- console.log('===============================================');
258
- console.log(' Agentic-Senior-Core Repository Validator');
259
- console.log('===============================================');
260
-
261
- const coverageValidationContext = {
262
- AGENT_CONTEXT_DIR,
263
- CANONICAL_INSTRUCTION_PATH,
264
- ROOT_DIR,
265
- fail,
266
- fileExists,
267
- normalizeLineEndings,
268
- pass,
269
- readTextFile,
270
- };
271
-
272
- const generalValidationContext = {
273
- ...coverageValidationContext,
274
- PACKAGE_JSON_PATH,
275
- PACKAGE_LOCK_PATH,
276
- BUN_LOCK_PATH,
277
- CHANGELOG_PATH,
278
- README_PATH,
279
- POLICY_FILE_PATH,
280
- GENERATED_RULE_FILES,
281
- collectFiles,
282
- warn,
283
- };
284
-
285
- await validateRequiredFiles(generalValidationContext);
286
- await validateMarkdownFiles(generalValidationContext);
287
- await validateRuleFiles(generalValidationContext);
288
- await validateChecklistConsolidation(generalValidationContext);
289
- await validateAgentsManifest(generalValidationContext);
290
- await validateCrossReferences(generalValidationContext);
291
- await validatePackageMetadata(generalValidationContext);
292
- await validatePolicyFile(generalValidationContext);
293
- await validateVersionConsistency(generalValidationContext);
294
- await validateDocumentationFlow(generalValidationContext);
295
- await validateTerminologyMapping(coverageValidationContext);
296
- await validateDetectionTransparencyCoverage(coverageValidationContext);
297
- await validateStackDecisionBoundaryCoverage(coverageValidationContext);
298
- await validateUniversalSopConsolidationCoverage(coverageValidationContext);
299
- await validateDiagramFormatCoverage(coverageValidationContext);
300
- await validateTemplateFreeBootstrapCoverage(coverageValidationContext);
301
- await validateUpgradeUiContractWarningCoverage(coverageValidationContext);
302
- await validateUiDesignAutomationCoverage(coverageValidationContext);
303
- await validateDockerRuntimeAutomationCoverage(coverageValidationContext);
304
- await validateDependencyFreshnessAutomationCoverage(coverageValidationContext);
305
- await validateDeterministicBoundaryEnforcementCoverage(coverageValidationContext);
306
- await validateRulesOnlyActiveSurfaceCoverage(coverageValidationContext);
307
- await validateMcpConfiguration(generalValidationContext);
308
- await validateHumanWritingGovernance(coverageValidationContext);
309
- await validateInstructionAdapters(coverageValidationContext);
310
- await validateSkillPurgeSurface(coverageValidationContext);
311
- await validateCacheLayerContractAudit();
312
- await validateReflectionCitationAudit();
313
- await validateCachingScopeHygieneAudit();
314
- await validateTypographyPaletteAntiRepeatAudit();
315
- await validateReleaseBundleAudit();
316
- await validateFileSizeAudit();
317
- await validateRuleIdUniquenessAudit();
318
-
319
- console.log('\n===============================================');
320
- console.log(' RESULTS');
321
- console.log('===============================================');
322
- console.log(` Passed: ${validationResult.passed}`);
323
- console.log(` Failed: ${validationResult.failed}`);
324
- console.log(` Warnings: ${validationResult.warnings.length}`);
325
- console.log('===============================================');
326
-
327
- if (validationResult.failed > 0) {
328
- console.log('\nVALIDATION FAILED\n');
329
- process.exit(1);
330
- }
331
-
332
- console.log('\nALL CHECKS PASSED\n');
333
- }
334
-
335
- main().catch((error) => {
336
- console.error('Validator crashed:', error);
337
- process.exit(1);
338
- });