@ryuenn3123/agentic-senior-core 2.0.4 → 2.0.5
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.
- package/.agent-context/blueprints/mobile-app.md +21 -21
- package/.agent-context/profiles/platform.md +13 -13
- package/.agent-context/profiles/regulated.md +13 -13
- package/.agent-context/profiles/startup.md +13 -13
- package/.agent-context/review-checklists/frontend-skill-parity.md +28 -28
- package/.agent-context/review-checklists/frontend-usability.md +33 -33
- package/.agent-context/review-checklists/release-operations.md +29 -29
- package/.agent-context/skills/README.md +62 -62
- package/.agent-context/skills/backend/README.md +67 -67
- package/.agent-context/skills/backend/architecture.md +360 -360
- package/.agent-context/skills/backend/compatibility-manifest.json +8 -8
- package/.agent-context/skills/backend/data-access.md +230 -230
- package/.agent-context/skills/backend/errors.md +137 -137
- package/.agent-context/skills/backend/validation.md +116 -116
- package/.agent-context/skills/backend.md +28 -28
- package/.agent-context/skills/cli/README.md +49 -49
- package/.agent-context/skills/cli/compatibility-manifest.json +8 -8
- package/.agent-context/skills/cli/init.md +37 -37
- package/.agent-context/skills/cli/output.md +35 -35
- package/.agent-context/skills/cli/upgrade.md +37 -37
- package/.agent-context/skills/cli.md +28 -28
- package/.agent-context/skills/distribution/README.md +18 -18
- package/.agent-context/skills/distribution/compatibility-manifest.json +8 -8
- package/.agent-context/skills/distribution/compatibility.md +31 -31
- package/.agent-context/skills/distribution/publish.md +36 -36
- package/.agent-context/skills/distribution/rollback.md +31 -31
- package/.agent-context/skills/distribution.md +28 -28
- package/.agent-context/skills/frontend/README.md +35 -35
- package/.agent-context/skills/frontend/accessibility.md +107 -107
- package/.agent-context/skills/frontend/compatibility-manifest.json +8 -8
- package/.agent-context/skills/frontend/motion.md +66 -66
- package/.agent-context/skills/frontend/performance.md +62 -62
- package/.agent-context/skills/frontend/ui-architecture.md +128 -128
- package/.agent-context/skills/frontend.md +29 -29
- package/.agent-context/skills/fullstack/README.md +18 -18
- package/.agent-context/skills/fullstack/compatibility-manifest.json +8 -8
- package/.agent-context/skills/fullstack/contracts.md +52 -52
- package/.agent-context/skills/fullstack/end-to-end.md +41 -41
- package/.agent-context/skills/fullstack/feature-slicing.md +64 -64
- package/.agent-context/skills/fullstack.md +26 -26
- package/.agent-context/skills/index.json +107 -107
- package/.agent-context/skills/review-quality/README.md +18 -18
- package/.agent-context/skills/review-quality/benchmark.md +29 -29
- package/.agent-context/skills/review-quality/compatibility-manifest.json +8 -8
- package/.agent-context/skills/review-quality/planning.md +37 -37
- package/.agent-context/skills/review-quality/security.md +33 -33
- package/.agent-context/skills/review-quality.md +27 -27
- package/.agent-context/stacks/flutter.md +16 -16
- package/.agent-context/stacks/react-native.md +16 -16
- package/.agent-context/state/architecture-map.md +25 -25
- package/.agent-context/state/benchmark-analysis.json +431 -431
- package/.agent-context/state/benchmark-thresholds.json +10 -10
- package/.agent-context/state/benchmark-watchlist.json +19 -19
- package/.agent-context/state/dependency-map.md +32 -32
- package/.agent-context/state/quality-trend-report.json +79 -0
- package/.agent-context/state/skill-platform.json +38 -38
- package/.agent-override.md +36 -36
- package/.cursorrules +1 -1
- package/.gemini/instructions.md +21 -97
- package/.github/ISSUE_TEMPLATE/v1.7-frontend-work-item.yml +54 -54
- package/.github/copilot-instructions.md +21 -166
- package/.github/workflows/benchmark-detection.yml +38 -38
- package/.github/workflows/benchmark-intelligence.yml +50 -50
- package/.github/workflows/frontend-usability-gate.yml +36 -36
- package/.github/workflows/release-gate.yml +32 -32
- package/.github/workflows/sbom-compliance.yml +32 -32
- package/.windsurfrules +1 -1
- package/AGENTS.md +28 -181
- package/README.md +368 -368
- package/lib/cli/commands/optimize.mjs +171 -171
- package/lib/cli/compatibility.mjs +124 -124
- package/lib/cli/token-optimization.mjs +275 -275
- package/mcp.json +92 -92
- package/package.json +2 -1
- package/scripts/benchmark-gate.mjs +121 -121
- package/scripts/benchmark-intelligence.mjs +140 -140
- package/scripts/detection-benchmark.mjs +138 -138
- package/scripts/frontend-usability-audit.mjs +87 -87
- package/scripts/generate-sbom.mjs +61 -61
- package/scripts/init-project.ps1 +104 -104
- package/scripts/llm-judge.mjs +664 -664
- package/scripts/quality-trend-report.mjs +289 -0
- package/scripts/release-gate.mjs +259 -204
- package/scripts/skill-tier-policy.mjs +75 -75
- package/scripts/token-optimization-benchmark.mjs +252 -252
- package/scripts/validate.mjs +865 -811
package/scripts/release-gate.mjs
CHANGED
|
@@ -1,204 +1,259 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* release-gate.mjs
|
|
5
|
-
*
|
|
6
|
-
* Enterprise release gate for V1.8.
|
|
7
|
-
* Produces machine-readable output for CI and fails fast on missing release evidence.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
11
|
-
import { resolve, dirname } from 'node:path';
|
|
12
|
-
import { fileURLToPath } from 'node:url';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
'
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
parsedCompatibilityManifest
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
pushResult(results, false, 'compatibility-manifest',
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
results,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* release-gate.mjs
|
|
5
|
+
*
|
|
6
|
+
* Enterprise release gate for V1.8.
|
|
7
|
+
* Produces machine-readable output for CI and fails fast on missing release evidence.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
11
|
+
import { resolve, dirname } from 'node:path';
|
|
12
|
+
import { fileURLToPath } from 'node:url';
|
|
13
|
+
import { execFileSync } from 'node:child_process';
|
|
14
|
+
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = dirname(__filename);
|
|
17
|
+
const REPOSITORY_ROOT = resolve(__dirname, '..');
|
|
18
|
+
|
|
19
|
+
const VERSION_PATTERN = /^\d+\.\d+\.\d+$/;
|
|
20
|
+
const NODE_MIN_PATTERN = /^\d+(\.\d+)?$/;
|
|
21
|
+
const SUPPORTED_COMPATIBILITY_PLATFORMS = new Set(['windows', 'linux', 'macos']);
|
|
22
|
+
const REQUIRED_SKILL_DOMAINS = [
|
|
23
|
+
'backend',
|
|
24
|
+
'frontend',
|
|
25
|
+
'fullstack',
|
|
26
|
+
'cli',
|
|
27
|
+
'distribution',
|
|
28
|
+
'review-quality',
|
|
29
|
+
];
|
|
30
|
+
const FRONTEND_PARITY_CHECKLIST_PATH = '.agent-context/review-checklists/frontend-skill-parity.md';
|
|
31
|
+
const FRONTEND_AUDIT_SCRIPT_PATH = 'scripts/frontend-usability-audit.mjs';
|
|
32
|
+
const REQUIRED_FRONTEND_PARITY_SNIPPETS = [
|
|
33
|
+
'Architecture and Composition',
|
|
34
|
+
'Interaction and Motion',
|
|
35
|
+
'Accessibility and Responsiveness',
|
|
36
|
+
'UX Narrative and Conversion Clarity',
|
|
37
|
+
'Release Evidence',
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
function readText(relativeFilePath) {
|
|
41
|
+
const absolutePath = resolve(REPOSITORY_ROOT, relativeFilePath);
|
|
42
|
+
if (!existsSync(absolutePath)) {
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return readFileSync(absolutePath, 'utf8');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function pushResult(results, isPassed, checkName, details) {
|
|
50
|
+
results.push({
|
|
51
|
+
checkName,
|
|
52
|
+
passed: isPassed,
|
|
53
|
+
details,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function validateCompatibilityManifestShape(parsedManifest, skillDomainName) {
|
|
58
|
+
const validationErrors = [];
|
|
59
|
+
|
|
60
|
+
if (!Array.isArray(parsedManifest.ides) || parsedManifest.ides.length === 0) {
|
|
61
|
+
validationErrors.push(`Domain ${skillDomainName} must define non-empty ides[]`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!Array.isArray(parsedManifest.platforms) || parsedManifest.platforms.length === 0) {
|
|
65
|
+
validationErrors.push(`Domain ${skillDomainName} must define non-empty platforms[]`);
|
|
66
|
+
} else {
|
|
67
|
+
const unsupportedPlatformName = parsedManifest.platforms.find(
|
|
68
|
+
(platformName) => !SUPPORTED_COMPATIBILITY_PLATFORMS.has(platformName)
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
if (unsupportedPlatformName) {
|
|
72
|
+
validationErrors.push(`Domain ${skillDomainName} has unsupported platform: ${unsupportedPlatformName}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (typeof parsedManifest.nodeMin !== 'string' || !NODE_MIN_PATTERN.test(parsedManifest.nodeMin)) {
|
|
77
|
+
validationErrors.push(`Domain ${skillDomainName} must define nodeMin as "18" or "18.0" style string`);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return validationErrors;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function runReleaseGate() {
|
|
84
|
+
const results = [];
|
|
85
|
+
const packageJsonPath = 'package.json';
|
|
86
|
+
const changelogPath = 'CHANGELOG.md';
|
|
87
|
+
const roadmapPath = 'docs/roadmap.md';
|
|
88
|
+
|
|
89
|
+
const packageJsonContent = readText(packageJsonPath);
|
|
90
|
+
if (!packageJsonContent) {
|
|
91
|
+
pushResult(results, false, 'package-json-exists', `Missing ${packageJsonPath}`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
let packageManifest = null;
|
|
95
|
+
if (packageJsonContent) {
|
|
96
|
+
try {
|
|
97
|
+
packageManifest = JSON.parse(packageJsonContent);
|
|
98
|
+
pushResult(results, true, 'package-json-parse', 'package.json is valid JSON');
|
|
99
|
+
} catch (packageParseError) {
|
|
100
|
+
const parseMessage = packageParseError instanceof Error ? packageParseError.message : 'Unknown parse error';
|
|
101
|
+
pushResult(results, false, 'package-json-parse', `Cannot parse package.json: ${parseMessage}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const releaseVersion = packageManifest?.version;
|
|
106
|
+
if (!releaseVersion || !VERSION_PATTERN.test(releaseVersion)) {
|
|
107
|
+
pushResult(results, false, 'version-semver', `Invalid package version: ${String(releaseVersion)}`);
|
|
108
|
+
} else {
|
|
109
|
+
pushResult(results, true, 'version-semver', `Version ${releaseVersion} matches x.y.z format`);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const changelogContent = readText(changelogPath);
|
|
113
|
+
if (!changelogContent) {
|
|
114
|
+
pushResult(results, false, 'changelog-exists', `Missing ${changelogPath}`);
|
|
115
|
+
} else if (!releaseVersion) {
|
|
116
|
+
pushResult(results, false, 'changelog-version-entry', 'Cannot check changelog because version is invalid');
|
|
117
|
+
} else if (!changelogContent.includes(`## ${releaseVersion} - `)) {
|
|
118
|
+
pushResult(results, false, 'changelog-version-entry', `Missing release header for ${releaseVersion} in CHANGELOG.md`);
|
|
119
|
+
} else {
|
|
120
|
+
pushResult(results, true, 'changelog-version-entry', `Found release header for ${releaseVersion}`);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const roadmapContent = readText(roadmapPath);
|
|
124
|
+
if (!roadmapContent) {
|
|
125
|
+
pushResult(results, false, 'roadmap-exists', `Missing ${roadmapPath}`);
|
|
126
|
+
} else if (!roadmapContent.includes('V1.8')) {
|
|
127
|
+
pushResult(results, false, 'roadmap-v18', 'Roadmap does not mention V1.8 release track');
|
|
128
|
+
} else {
|
|
129
|
+
pushResult(results, true, 'roadmap-v18', 'Roadmap includes V1.8 release track');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const requiredEnterpriseFiles = [
|
|
133
|
+
'.agent-context/review-checklists/release-operations.md',
|
|
134
|
+
'docs/v1.8-operations-playbook.md',
|
|
135
|
+
'.github/workflows/release-gate.yml',
|
|
136
|
+
'.github/workflows/sbom-compliance.yml',
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
for (const requiredEnterpriseFile of requiredEnterpriseFiles) {
|
|
140
|
+
const absoluteRequiredPath = resolve(REPOSITORY_ROOT, requiredEnterpriseFile);
|
|
141
|
+
if (!existsSync(absoluteRequiredPath)) {
|
|
142
|
+
pushResult(results, false, 'required-enterprise-file', `Missing ${requiredEnterpriseFile}`);
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
pushResult(results, true, 'required-enterprise-file', `${requiredEnterpriseFile} is present`);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
let validatedCompatibilityManifestCount = 0;
|
|
150
|
+
|
|
151
|
+
for (const skillDomainName of REQUIRED_SKILL_DOMAINS) {
|
|
152
|
+
const compatibilityManifestPath = `.agent-context/skills/${skillDomainName}/compatibility-manifest.json`;
|
|
153
|
+
const compatibilityManifestContent = readText(compatibilityManifestPath);
|
|
154
|
+
|
|
155
|
+
if (!compatibilityManifestContent) {
|
|
156
|
+
pushResult(results, false, 'compatibility-manifest', `Missing ${compatibilityManifestPath}`);
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
let parsedCompatibilityManifest;
|
|
161
|
+
try {
|
|
162
|
+
parsedCompatibilityManifest = JSON.parse(compatibilityManifestContent);
|
|
163
|
+
} catch (compatibilityManifestParseError) {
|
|
164
|
+
const parseErrorMessage = compatibilityManifestParseError instanceof Error
|
|
165
|
+
? compatibilityManifestParseError.message
|
|
166
|
+
: 'Unknown parse error';
|
|
167
|
+
pushResult(results, false, 'compatibility-manifest', `Invalid JSON in ${compatibilityManifestPath}: ${parseErrorMessage}`);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const compatibilityValidationErrors = validateCompatibilityManifestShape(
|
|
172
|
+
parsedCompatibilityManifest,
|
|
173
|
+
skillDomainName
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
if (compatibilityValidationErrors.length > 0) {
|
|
177
|
+
pushResult(results, false, 'compatibility-manifest', compatibilityValidationErrors.join('; '));
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
validatedCompatibilityManifestCount += 1;
|
|
182
|
+
pushResult(results, true, 'compatibility-manifest', `${compatibilityManifestPath} is valid`);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (validatedCompatibilityManifestCount === REQUIRED_SKILL_DOMAINS.length) {
|
|
186
|
+
pushResult(
|
|
187
|
+
results,
|
|
188
|
+
true,
|
|
189
|
+
'compatibility-manifest-coverage',
|
|
190
|
+
`Validated ${validatedCompatibilityManifestCount}/${REQUIRED_SKILL_DOMAINS.length} required skill compatibility manifests`
|
|
191
|
+
);
|
|
192
|
+
} else {
|
|
193
|
+
pushResult(
|
|
194
|
+
results,
|
|
195
|
+
false,
|
|
196
|
+
'compatibility-manifest-coverage',
|
|
197
|
+
`Validated ${validatedCompatibilityManifestCount}/${REQUIRED_SKILL_DOMAINS.length} required skill compatibility manifests`
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const frontendParityChecklistContent = readText(FRONTEND_PARITY_CHECKLIST_PATH);
|
|
202
|
+
if (!frontendParityChecklistContent) {
|
|
203
|
+
pushResult(results, false, 'frontend-parity-checklist-exists', `Missing ${FRONTEND_PARITY_CHECKLIST_PATH}`);
|
|
204
|
+
} else {
|
|
205
|
+
pushResult(results, true, 'frontend-parity-checklist-exists', `${FRONTEND_PARITY_CHECKLIST_PATH} is present`);
|
|
206
|
+
|
|
207
|
+
const missingFrontendParitySnippets = REQUIRED_FRONTEND_PARITY_SNIPPETS.filter(
|
|
208
|
+
(requiredSnippet) => !frontendParityChecklistContent.includes(requiredSnippet)
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
if (missingFrontendParitySnippets.length === 0) {
|
|
212
|
+
pushResult(results, true, 'frontend-parity-checklist-coverage', 'Frontend parity checklist sections are complete');
|
|
213
|
+
} else {
|
|
214
|
+
pushResult(
|
|
215
|
+
results,
|
|
216
|
+
false,
|
|
217
|
+
'frontend-parity-checklist-coverage',
|
|
218
|
+
`Missing frontend parity checklist sections: ${missingFrontendParitySnippets.join(', ')}`
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
try {
|
|
224
|
+
const frontendAuditRawOutput = execFileSync('node', [FRONTEND_AUDIT_SCRIPT_PATH], {
|
|
225
|
+
cwd: REPOSITORY_ROOT,
|
|
226
|
+
encoding: 'utf8',
|
|
227
|
+
maxBuffer: 1024 * 1024,
|
|
228
|
+
});
|
|
229
|
+
const frontendAuditReport = JSON.parse(frontendAuditRawOutput);
|
|
230
|
+
|
|
231
|
+
if (frontendAuditReport.passed === true) {
|
|
232
|
+
pushResult(results, true, 'frontend-usability-audit', 'frontend-usability-audit report passed');
|
|
233
|
+
} else {
|
|
234
|
+
const failureDetails = Array.isArray(frontendAuditReport.failures)
|
|
235
|
+
? frontendAuditReport.failures.join('; ')
|
|
236
|
+
: 'Unknown frontend audit failures';
|
|
237
|
+
pushResult(results, false, 'frontend-usability-audit', `frontend-usability-audit reported failures: ${failureDetails}`);
|
|
238
|
+
}
|
|
239
|
+
} catch (frontendAuditError) {
|
|
240
|
+
const frontendAuditErrorMessage = frontendAuditError instanceof Error
|
|
241
|
+
? frontendAuditError.message
|
|
242
|
+
: 'Unknown frontend audit execution error';
|
|
243
|
+
pushResult(results, false, 'frontend-usability-audit', `Failed to execute frontend usability audit: ${frontendAuditErrorMessage}`);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const failureCount = results.filter((checkResult) => !checkResult.passed).length;
|
|
247
|
+
const releaseGateReport = {
|
|
248
|
+
generatedAt: new Date().toISOString(),
|
|
249
|
+
gateName: 'release-gate',
|
|
250
|
+
passed: failureCount === 0,
|
|
251
|
+
failureCount,
|
|
252
|
+
results,
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
console.log(JSON.stringify(releaseGateReport, null, 2));
|
|
256
|
+
process.exit(releaseGateReport.passed ? 0 : 1);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
runReleaseGate();
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
export const SKILL_TIER_MINIMUMS = {
|
|
2
|
-
standard: { minWords: 60, minHeadings: 1, minChecklistItems: 0, minCodeBlocks: 0 },
|
|
3
|
-
advance: { minWords: 100, minHeadings: 2, minChecklistItems: 1, minCodeBlocks: 0 },
|
|
4
|
-
expert: { minWords: 130, minHeadings: 3, minChecklistItems: 1, minCodeBlocks: 0 },
|
|
5
|
-
above: { minWords: 240, minHeadings: 3, minChecklistItems: 1, minCodeBlocks: 1 },
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export function countWords(markdownContent) {
|
|
9
|
-
return markdownContent
|
|
10
|
-
.replace(/```[\s\S]*?```/g, ' ')
|
|
11
|
-
.replace(/[^A-Za-z0-9_\-\s]/g, ' ')
|
|
12
|
-
.trim()
|
|
13
|
-
.split(/\s+/)
|
|
14
|
-
.filter(Boolean).length;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function countMarkdownHeadings(markdownContent) {
|
|
18
|
-
const headingMatches = markdownContent.match(/^#{2,6}\s+/gm);
|
|
19
|
-
return headingMatches ? headingMatches.length : 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function countChecklistItems(markdownContent) {
|
|
23
|
-
const checklistMatches = markdownContent.match(/^\s*[-*]\s+\[[ xX]\]\s+/gm);
|
|
24
|
-
return checklistMatches ? checklistMatches.length : 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function countCodeBlocks(markdownContent) {
|
|
28
|
-
const fenceMatches = markdownContent.match(/```/g);
|
|
29
|
-
if (!fenceMatches) {
|
|
30
|
-
return 0;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return Math.floor(fenceMatches.length / 2);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function extractSkillTier(markdownContent) {
|
|
37
|
-
const normalizedMarkdownContent = markdownContent.replace(/\*\*/g, '');
|
|
38
|
-
const tierMatch = normalizedMarkdownContent.match(/\bTier\s*:\s*`?(standard|advance|expert|above)`?\b/i);
|
|
39
|
-
return tierMatch ? tierMatch[1].toLowerCase() : null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function validateSkillTopicContent(markdownContent) {
|
|
43
|
-
const detectedTier = extractSkillTier(markdownContent);
|
|
44
|
-
|
|
45
|
-
if (!detectedTier) {
|
|
46
|
-
return { isValid: false, reason: 'missing-tier' };
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const minimumRules = SKILL_TIER_MINIMUMS[detectedTier];
|
|
50
|
-
if (!minimumRules) {
|
|
51
|
-
return { isValid: false, reason: 'unsupported-tier', detectedTier };
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const wordCount = countWords(markdownContent);
|
|
55
|
-
const headingCount = countMarkdownHeadings(markdownContent);
|
|
56
|
-
const checklistCount = countChecklistItems(markdownContent);
|
|
57
|
-
const codeBlockCount = countCodeBlocks(markdownContent);
|
|
58
|
-
|
|
59
|
-
if (wordCount < minimumRules.minWords) {
|
|
60
|
-
return { isValid: false, reason: 'word-count', detectedTier, wordCount, minimumRules };
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (headingCount < minimumRules.minHeadings) {
|
|
64
|
-
return { isValid: false, reason: 'heading-count', detectedTier, headingCount, minimumRules };
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (checklistCount < minimumRules.minChecklistItems) {
|
|
68
|
-
return { isValid: false, reason: 'checklist-count', detectedTier, checklistCount, minimumRules };
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (codeBlockCount < minimumRules.minCodeBlocks) {
|
|
72
|
-
return { isValid: false, reason: 'code-block-count', detectedTier, codeBlockCount, minimumRules };
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return { isValid: true, detectedTier, wordCount, headingCount, checklistCount, codeBlockCount, minimumRules };
|
|
1
|
+
export const SKILL_TIER_MINIMUMS = {
|
|
2
|
+
standard: { minWords: 60, minHeadings: 1, minChecklistItems: 0, minCodeBlocks: 0 },
|
|
3
|
+
advance: { minWords: 100, minHeadings: 2, minChecklistItems: 1, minCodeBlocks: 0 },
|
|
4
|
+
expert: { minWords: 130, minHeadings: 3, minChecklistItems: 1, minCodeBlocks: 0 },
|
|
5
|
+
above: { minWords: 240, minHeadings: 3, minChecklistItems: 1, minCodeBlocks: 1 },
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export function countWords(markdownContent) {
|
|
9
|
+
return markdownContent
|
|
10
|
+
.replace(/```[\s\S]*?```/g, ' ')
|
|
11
|
+
.replace(/[^A-Za-z0-9_\-\s]/g, ' ')
|
|
12
|
+
.trim()
|
|
13
|
+
.split(/\s+/)
|
|
14
|
+
.filter(Boolean).length;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function countMarkdownHeadings(markdownContent) {
|
|
18
|
+
const headingMatches = markdownContent.match(/^#{2,6}\s+/gm);
|
|
19
|
+
return headingMatches ? headingMatches.length : 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function countChecklistItems(markdownContent) {
|
|
23
|
+
const checklistMatches = markdownContent.match(/^\s*[-*]\s+\[[ xX]\]\s+/gm);
|
|
24
|
+
return checklistMatches ? checklistMatches.length : 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function countCodeBlocks(markdownContent) {
|
|
28
|
+
const fenceMatches = markdownContent.match(/```/g);
|
|
29
|
+
if (!fenceMatches) {
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return Math.floor(fenceMatches.length / 2);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function extractSkillTier(markdownContent) {
|
|
37
|
+
const normalizedMarkdownContent = markdownContent.replace(/\*\*/g, '');
|
|
38
|
+
const tierMatch = normalizedMarkdownContent.match(/\bTier\s*:\s*`?(standard|advance|expert|above)`?\b/i);
|
|
39
|
+
return tierMatch ? tierMatch[1].toLowerCase() : null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function validateSkillTopicContent(markdownContent) {
|
|
43
|
+
const detectedTier = extractSkillTier(markdownContent);
|
|
44
|
+
|
|
45
|
+
if (!detectedTier) {
|
|
46
|
+
return { isValid: false, reason: 'missing-tier' };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const minimumRules = SKILL_TIER_MINIMUMS[detectedTier];
|
|
50
|
+
if (!minimumRules) {
|
|
51
|
+
return { isValid: false, reason: 'unsupported-tier', detectedTier };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const wordCount = countWords(markdownContent);
|
|
55
|
+
const headingCount = countMarkdownHeadings(markdownContent);
|
|
56
|
+
const checklistCount = countChecklistItems(markdownContent);
|
|
57
|
+
const codeBlockCount = countCodeBlocks(markdownContent);
|
|
58
|
+
|
|
59
|
+
if (wordCount < minimumRules.minWords) {
|
|
60
|
+
return { isValid: false, reason: 'word-count', detectedTier, wordCount, minimumRules };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (headingCount < minimumRules.minHeadings) {
|
|
64
|
+
return { isValid: false, reason: 'heading-count', detectedTier, headingCount, minimumRules };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (checklistCount < minimumRules.minChecklistItems) {
|
|
68
|
+
return { isValid: false, reason: 'checklist-count', detectedTier, checklistCount, minimumRules };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (codeBlockCount < minimumRules.minCodeBlocks) {
|
|
72
|
+
return { isValid: false, reason: 'code-block-count', detectedTier, codeBlockCount, minimumRules };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return { isValid: true, detectedTier, wordCount, headingCount, checklistCount, codeBlockCount, minimumRules };
|
|
76
76
|
}
|