@ryuenn3123/agentic-senior-core 2.5.11 → 2.5.13
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/prompts/review-code.md +2 -0
- package/.agent-context/review-checklists/performance-audit.md +6 -0
- package/.agent-context/review-checklists/pr-checklist.md +9 -0
- package/.agent-context/review-checklists/security-audit.md +6 -0
- package/.agent-context/rules/api-docs.md +19 -0
- package/.agent-context/rules/performance.md +10 -0
- package/.agent-context/rules/security.md +10 -0
- package/.agent-context/state/memory-continuity-benchmark.json +1 -1
- package/.cursorrules +1 -1
- package/.windsurfrules +1 -1
- package/package.json +3 -1
- package/scripts/context-triggered-audit.mjs +395 -0
- package/scripts/documentation-boundary-audit.mjs +201 -0
- package/scripts/release-gate.mjs +96 -2
- package/scripts/validate.mjs +2 -0
|
@@ -15,6 +15,8 @@ Use these checklists:
|
|
|
15
15
|
2. Read .agent-context/review-checklists/security-audit.md — apply every item.
|
|
16
16
|
3. Apply documentation scope rules exactly: This applies to documentation, release notes, onboarding text, review summaries, and agent-facing explanations.
|
|
17
17
|
4. Treat scope-style findings as advisory unless they hide factual errors, contract mismatches, or non-negotiable violations.
|
|
18
|
+
5. Enforce documentation hard blockers on changed boundaries: public surface changes, API contract changes, and database structure changes must include synchronized documentation updates.
|
|
19
|
+
6. Enforce context-triggered strict audits: review requests, PR-intent workflows, and major feature completion must run strict security and performance audits; small edits stay lightweight unless strict mode is explicitly forced.
|
|
18
20
|
|
|
19
21
|
For EVERY violation found:
|
|
20
22
|
- State the exact file and line
|
|
@@ -11,6 +11,12 @@ Evaluate every item below. For each finding, rate impact:
|
|
|
11
11
|
- **MEDIUM** — Wasted resources, fix in this sprint
|
|
12
12
|
- **LOW** — Optimization opportunity, track for later
|
|
13
13
|
|
|
14
|
+
## Context Trigger Policy
|
|
15
|
+
|
|
16
|
+
- Strict performance audit auto-runs for review requests, PR-intent workflows, and major feature completion.
|
|
17
|
+
- Small edits default to lightweight mode unless strict mode is explicitly forced.
|
|
18
|
+
- User can force strict mode manually at any time.
|
|
19
|
+
|
|
14
20
|
---
|
|
15
21
|
|
|
16
22
|
## Database & Queries
|
|
@@ -96,6 +96,10 @@ VERDICT: PASS / FAIL (X/Y items passed)
|
|
|
96
96
|
### 10. Documentation
|
|
97
97
|
- [ ] Scope applied: This applies to documentation, release notes, onboarding text, review summaries, and agent-facing explanations
|
|
98
98
|
- [ ] Style scope review is advisory and does not block merge when API docs are synced in the same commit and contract details are correct
|
|
99
|
+
- [ ] Public surface changes fail review if documentation updates are missing or stale in the same scope
|
|
100
|
+
- [ ] API endpoint/contract changes include synchronized API/OpenAPI documentation updates
|
|
101
|
+
- [ ] Database structure changes include synchronized schema or migration documentation updates
|
|
102
|
+
- [ ] Documentation checks stay boundary-aware and only enforce touched scopes
|
|
99
103
|
- [ ] API endpoints have OpenAPI/Swagger documentation
|
|
100
104
|
- [ ] Complex business logic has comments explaining WHY
|
|
101
105
|
- [ ] Public functions/methods have JSDoc/docstrings
|
|
@@ -105,3 +109,8 @@ VERDICT: PASS / FAIL (X/Y items passed)
|
|
|
105
109
|
- [ ] Performance/quality claims include source and timestamp
|
|
106
110
|
- [ ] Acronyms are expanded on first use
|
|
107
111
|
- [ ] Facts and assumptions are explicitly separated
|
|
112
|
+
|
|
113
|
+
### 11. Context-Triggered Audit Mode
|
|
114
|
+
- [ ] Strict audit mode activates automatically on review and PR-intent workflows
|
|
115
|
+
- [ ] Small edits avoid heavy checks by default unless strict mode is explicitly requested
|
|
116
|
+
- [ ] User can always force strict audit mode manually
|
|
@@ -24,6 +24,12 @@ Output format:
|
|
|
24
24
|
VERDICT: X findings (🔴 N critical, 🟠 N high, 🟡 N medium, 🟢 N low)
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
## Context Trigger Policy
|
|
28
|
+
|
|
29
|
+
- Strict security audit auto-runs for review requests, PR-intent workflows, and major feature completion.
|
|
30
|
+
- Small edits default to lightweight mode unless strict mode is explicitly forced.
|
|
31
|
+
- User can force strict mode manually at any time.
|
|
32
|
+
|
|
27
33
|
---
|
|
28
34
|
|
|
29
35
|
## A1: Injection (SQL, NoSQL, OS, LDAP)
|
|
@@ -211,6 +211,25 @@ The spec is a contract. If the contract is wrong, consumers will break.
|
|
|
211
211
|
"I'll update the docs later" means "the docs will never be updated."
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
+
## Documentation as Hard Rule (Boundary-Aware)
|
|
215
|
+
|
|
216
|
+
Documentation checks are hard-blocking for contract accuracy, but scope-aware to avoid unnecessary overhead.
|
|
217
|
+
|
|
218
|
+
### Boundary Triggers
|
|
219
|
+
1. Public surface boundary: exported/public behavior changes in CLI, library, or runtime scripts.
|
|
220
|
+
2. API contract boundary: endpoint, route, controller, or OpenAPI contract changes.
|
|
221
|
+
3. Database structure boundary: schema, migration, repository contract, or persistence model changes.
|
|
222
|
+
|
|
223
|
+
### Boundary-Aware Enforcement
|
|
224
|
+
1. Only triggered boundaries require synchronized documentation updates.
|
|
225
|
+
2. Untouched boundaries are ignored during the same review run.
|
|
226
|
+
3. Missing docs for a triggered boundary is a blocking failure.
|
|
227
|
+
|
|
228
|
+
### Required Same-Scope Sync
|
|
229
|
+
1. Public surface changes must update user-facing docs (`README.md`, `CHANGELOG.md`, or `docs/*`).
|
|
230
|
+
2. API contract changes must update API/OpenAPI docs in the same scope.
|
|
231
|
+
3. Database structure changes must update schema/migration documentation in the same scope.
|
|
232
|
+
|
|
214
233
|
### Enforcement
|
|
215
234
|
1. API docs live next to the code (same module, same directory)
|
|
216
235
|
2. Docs update in the SAME commit as the endpoint change
|
|
@@ -7,6 +7,16 @@
|
|
|
7
7
|
|
|
8
8
|
**Do NOT optimize without evidence.** CPU time is cheap. Developer time is expensive.
|
|
9
9
|
|
|
10
|
+
## Context-Triggered Strict Audit Mode
|
|
11
|
+
|
|
12
|
+
Strict performance audits must activate automatically for:
|
|
13
|
+
- review requests
|
|
14
|
+
- PR-intent workflows (pull request preparation and merge readiness)
|
|
15
|
+
- major feature completion
|
|
16
|
+
|
|
17
|
+
Small edits stay in lightweight mode by default to avoid unnecessary heavy checks.
|
|
18
|
+
Users can always force strict performance mode manually.
|
|
19
|
+
|
|
10
20
|
BUT — there are patterns so obviously bad that they don't need benchmarks to reject.
|
|
11
21
|
Those are listed below as **Death Penalties**.
|
|
12
22
|
|
|
@@ -7,6 +7,16 @@
|
|
|
7
7
|
|
|
8
8
|
**ALL data crossing a system boundary is untrusted until validated.**
|
|
9
9
|
|
|
10
|
+
## Context-Triggered Strict Audit Mode
|
|
11
|
+
|
|
12
|
+
Strict security audits must activate automatically for:
|
|
13
|
+
- review requests
|
|
14
|
+
- PR-intent workflows (pull request preparation and merge readiness)
|
|
15
|
+
- major feature completion
|
|
16
|
+
|
|
17
|
+
Small edits stay in lightweight mode by default to avoid unnecessary heavy checks.
|
|
18
|
+
Users can always force strict security mode manually.
|
|
19
|
+
|
|
10
20
|
System boundaries include:
|
|
11
21
|
- HTTP request bodies, query params, headers, cookies
|
|
12
22
|
- URL path parameters
|
package/.cursorrules
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
|
|
2
2
|
|
|
3
|
-
Generated by Agentic-Senior-Core CLI v2.5.
|
|
3
|
+
Generated by Agentic-Senior-Core CLI v2.5.13
|
|
4
4
|
Timestamp: 2026-04-15T00:14:51.184Z
|
|
5
5
|
Selected profile: beginner
|
|
6
6
|
Selected policy file: .agent-context/policies/llm-judge-threshold.json
|
package/.windsurfrules
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
|
|
2
2
|
|
|
3
|
-
Generated by Agentic-Senior-Core CLI v2.5.
|
|
3
|
+
Generated by Agentic-Senior-Core CLI v2.5.13
|
|
4
4
|
Timestamp: 2026-04-15T00:14:51.184Z
|
|
5
5
|
Selected profile: beginner
|
|
6
6
|
Selected policy file: .agent-context/policies/llm-judge-threshold.json
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryuenn3123/agentic-senior-core",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
|
|
6
6
|
"bin": {
|
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
"scripts": {
|
|
44
44
|
"init": "node ./bin/agentic-senior-core.js init",
|
|
45
45
|
"audit:frontend-usability": "node ./scripts/frontend-usability-audit.mjs",
|
|
46
|
+
"audit:documentation-boundary": "node ./scripts/documentation-boundary-audit.mjs",
|
|
47
|
+
"audit:context-triggered": "node ./scripts/context-triggered-audit.mjs",
|
|
46
48
|
"gate:release": "node ./scripts/release-gate.mjs && node ./scripts/forbidden-content-check.mjs",
|
|
47
49
|
"prepublishOnly": "npm run gate:release",
|
|
48
50
|
"sbom:generate": "node ./scripts/generate-sbom.mjs",
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* context-triggered-audit.mjs
|
|
5
|
+
*
|
|
6
|
+
* Determines whether strict security/performance audits should run based on
|
|
7
|
+
* workflow context, changed scope size, and explicit user override.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
11
|
+
import { execFileSync } from 'node:child_process';
|
|
12
|
+
import { dirname, resolve } from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = dirname(__filename);
|
|
17
|
+
const REPOSITORY_ROOT = resolve(__dirname, '..');
|
|
18
|
+
|
|
19
|
+
const SECURITY_CHECKLIST_PATH = '.agent-context/review-checklists/security-audit.md';
|
|
20
|
+
const PERFORMANCE_CHECKLIST_PATH = '.agent-context/review-checklists/performance-audit.md';
|
|
21
|
+
const DEFAULT_WORKFLOW = 'auto';
|
|
22
|
+
const SMALL_EDIT_MAX_FILES = 3;
|
|
23
|
+
const MAJOR_FEATURE_MIN_SIGNIFICANT_FILES = 4;
|
|
24
|
+
|
|
25
|
+
const STRICT_WORKFLOWS = new Set([
|
|
26
|
+
'review-request',
|
|
27
|
+
'pr-intent',
|
|
28
|
+
'pr-preparation',
|
|
29
|
+
'major-feature-completion',
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
const SUPPORTED_WORKFLOWS = new Set([
|
|
33
|
+
DEFAULT_WORKFLOW,
|
|
34
|
+
...STRICT_WORKFLOWS,
|
|
35
|
+
'small-edit',
|
|
36
|
+
'standard',
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
const REQUIRED_SECURITY_CHECKLIST_SNIPPETS = [
|
|
40
|
+
'## Context Trigger Policy',
|
|
41
|
+
'Strict security audit auto-runs for review requests, PR-intent workflows, and major feature completion.',
|
|
42
|
+
'Small edits default to lightweight mode unless strict mode is explicitly forced.',
|
|
43
|
+
'User can force strict mode manually at any time.',
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const REQUIRED_PERFORMANCE_CHECKLIST_SNIPPETS = [
|
|
47
|
+
'## Context Trigger Policy',
|
|
48
|
+
'Strict performance audit auto-runs for review requests, PR-intent workflows, and major feature completion.',
|
|
49
|
+
'Small edits default to lightweight mode unless strict mode is explicitly forced.',
|
|
50
|
+
'User can force strict mode manually at any time.',
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
function pushResult(results, isPassed, checkName, details) {
|
|
54
|
+
results.push({
|
|
55
|
+
checkName,
|
|
56
|
+
passed: isPassed,
|
|
57
|
+
details,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function normalizeFilePath(filePath) {
|
|
62
|
+
return filePath.replace(/\\/g, '/').replace(/^\.\//, '');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function parseGitFileList(rawOutput) {
|
|
66
|
+
if (typeof rawOutput !== 'string' || rawOutput.trim().length === 0) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return rawOutput
|
|
71
|
+
.split(/\r?\n/)
|
|
72
|
+
.map((filePath) => filePath.trim())
|
|
73
|
+
.filter((filePath) => filePath.length > 0)
|
|
74
|
+
.map(normalizeFilePath);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function runGitFileQuery(commandArguments) {
|
|
78
|
+
try {
|
|
79
|
+
const rawOutput = execFileSync('git', commandArguments, {
|
|
80
|
+
cwd: REPOSITORY_ROOT,
|
|
81
|
+
encoding: 'utf8',
|
|
82
|
+
maxBuffer: 1024 * 1024,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
return parseGitFileList(rawOutput);
|
|
86
|
+
} catch {
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function uniqueSorted(filePaths) {
|
|
92
|
+
return Array.from(new Set(filePaths)).sort((leftPath, rightPath) => leftPath.localeCompare(rightPath));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function collectChangedFiles() {
|
|
96
|
+
const workingTreeFiles = runGitFileQuery(['diff', '--name-only']);
|
|
97
|
+
const stagedFiles = runGitFileQuery(['diff', '--name-only', '--cached']);
|
|
98
|
+
const workingScopeFiles = uniqueSorted([...workingTreeFiles, ...stagedFiles]);
|
|
99
|
+
|
|
100
|
+
if (workingScopeFiles.length > 0) {
|
|
101
|
+
return {
|
|
102
|
+
source: 'working-tree-and-index',
|
|
103
|
+
files: workingScopeFiles,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const latestCommitRangeFiles = runGitFileQuery(['diff', '--name-only', 'HEAD~1..HEAD']);
|
|
108
|
+
if (latestCommitRangeFiles.length > 0) {
|
|
109
|
+
return {
|
|
110
|
+
source: 'latest-commit-range',
|
|
111
|
+
files: uniqueSorted(latestCommitRangeFiles),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const headCommitFiles = runGitFileQuery(['show', '--pretty=format:', '--name-only', 'HEAD']);
|
|
116
|
+
if (headCommitFiles.length > 0) {
|
|
117
|
+
return {
|
|
118
|
+
source: 'head-commit',
|
|
119
|
+
files: uniqueSorted(headCommitFiles),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
source: 'none',
|
|
125
|
+
files: [],
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function parseCliArguments(argumentList) {
|
|
130
|
+
let workflow = DEFAULT_WORKFLOW;
|
|
131
|
+
let strict = false;
|
|
132
|
+
|
|
133
|
+
for (let argumentIndex = 0; argumentIndex < argumentList.length; argumentIndex += 1) {
|
|
134
|
+
const argumentValue = argumentList[argumentIndex];
|
|
135
|
+
|
|
136
|
+
if (argumentValue === '--strict') {
|
|
137
|
+
strict = true;
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (argumentValue === '--workflow') {
|
|
142
|
+
const nextArgumentValue = argumentList[argumentIndex + 1];
|
|
143
|
+
if (nextArgumentValue && !nextArgumentValue.startsWith('--')) {
|
|
144
|
+
workflow = nextArgumentValue;
|
|
145
|
+
argumentIndex += 1;
|
|
146
|
+
}
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (argumentValue.startsWith('--workflow=')) {
|
|
151
|
+
workflow = argumentValue.slice('--workflow='.length);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const normalizedWorkflow = String(workflow).trim().toLowerCase() || DEFAULT_WORKFLOW;
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
workflow: SUPPORTED_WORKFLOWS.has(normalizedWorkflow) ? normalizedWorkflow : DEFAULT_WORKFLOW,
|
|
159
|
+
strict,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function isLightweightFilePath(filePath) {
|
|
164
|
+
return filePath.endsWith('.md')
|
|
165
|
+
|| filePath.startsWith('docs/')
|
|
166
|
+
|| filePath.startsWith('.agent-context/review-checklists/')
|
|
167
|
+
|| filePath.startsWith('.agent-context/rules/')
|
|
168
|
+
|| filePath.startsWith('.agent-context/prompts/')
|
|
169
|
+
|| filePath === 'CHANGELOG.md'
|
|
170
|
+
|| filePath === 'README.md';
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function countSignificantChangedFiles(changedFiles) {
|
|
174
|
+
return changedFiles.filter((filePath) => (
|
|
175
|
+
filePath.startsWith('bin/')
|
|
176
|
+
|| filePath.startsWith('lib/')
|
|
177
|
+
|| filePath.startsWith('scripts/')
|
|
178
|
+
|| filePath.startsWith('tests/')
|
|
179
|
+
)).length;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function detectSmallEdit(changedFiles) {
|
|
183
|
+
const nonLightweightChangedFiles = changedFiles.filter((filePath) => !isLightweightFilePath(filePath));
|
|
184
|
+
return nonLightweightChangedFiles.length <= 1 && changedFiles.length <= SMALL_EDIT_MAX_FILES;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function detectMajorFeatureCompletion(changedFiles) {
|
|
188
|
+
const significantChangedFileCount = countSignificantChangedFiles(changedFiles);
|
|
189
|
+
return significantChangedFileCount >= MAJOR_FEATURE_MIN_SIGNIFICANT_FILES;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function detectReviewIntentFromEnvironment() {
|
|
193
|
+
const githubEventName = String(process.env.GITHUB_EVENT_NAME || '').toLowerCase();
|
|
194
|
+
const githubEventAction = String(process.env.GITHUB_EVENT_ACTION || '').toLowerCase();
|
|
195
|
+
const gitlabMergeRequestId = String(process.env.CI_MERGE_REQUEST_IID || '').trim();
|
|
196
|
+
const ciPullRequestMarker = String(process.env.CI_PULL_REQUEST || '').toLowerCase();
|
|
197
|
+
const auditWorkflowHint = String(process.env.AUDIT_WORKFLOW || '').toLowerCase();
|
|
198
|
+
|
|
199
|
+
if (githubEventName.includes('pull_request') || githubEventAction.includes('pull_request')) {
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (gitlabMergeRequestId.length > 0) {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (ciPullRequestMarker === 'true' || ciPullRequestMarker === '1') {
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return auditWorkflowHint.includes('review') || auditWorkflowHint.includes('pr');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function resolveAuditMode(options) {
|
|
215
|
+
const {
|
|
216
|
+
workflow,
|
|
217
|
+
manualForceStrict,
|
|
218
|
+
changedFiles,
|
|
219
|
+
} = options;
|
|
220
|
+
|
|
221
|
+
const smallEditDetected = detectSmallEdit(changedFiles);
|
|
222
|
+
const majorFeatureDetected = detectMajorFeatureCompletion(changedFiles);
|
|
223
|
+
|
|
224
|
+
if (manualForceStrict) {
|
|
225
|
+
return {
|
|
226
|
+
strictAuditMode: true,
|
|
227
|
+
triggerReason: 'manual-force-strict',
|
|
228
|
+
smallEditDetected,
|
|
229
|
+
majorFeatureDetected,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (STRICT_WORKFLOWS.has(workflow)) {
|
|
234
|
+
return {
|
|
235
|
+
strictAuditMode: true,
|
|
236
|
+
triggerReason: `workflow-${workflow}`,
|
|
237
|
+
smallEditDetected,
|
|
238
|
+
majorFeatureDetected,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (workflow === 'small-edit') {
|
|
243
|
+
return {
|
|
244
|
+
strictAuditMode: false,
|
|
245
|
+
triggerReason: 'workflow-small-edit-lightweight',
|
|
246
|
+
smallEditDetected: true,
|
|
247
|
+
majorFeatureDetected,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (workflow === 'standard') {
|
|
252
|
+
return {
|
|
253
|
+
strictAuditMode: false,
|
|
254
|
+
triggerReason: 'workflow-standard-lightweight',
|
|
255
|
+
smallEditDetected,
|
|
256
|
+
majorFeatureDetected,
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (detectReviewIntentFromEnvironment()) {
|
|
261
|
+
return {
|
|
262
|
+
strictAuditMode: true,
|
|
263
|
+
triggerReason: 'auto-review-or-pr-intent',
|
|
264
|
+
smallEditDetected,
|
|
265
|
+
majorFeatureDetected,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (majorFeatureDetected) {
|
|
270
|
+
return {
|
|
271
|
+
strictAuditMode: true,
|
|
272
|
+
triggerReason: 'auto-major-feature-completion',
|
|
273
|
+
smallEditDetected,
|
|
274
|
+
majorFeatureDetected,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (smallEditDetected) {
|
|
279
|
+
return {
|
|
280
|
+
strictAuditMode: false,
|
|
281
|
+
triggerReason: 'auto-small-edit-lightweight',
|
|
282
|
+
smallEditDetected,
|
|
283
|
+
majorFeatureDetected,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return {
|
|
288
|
+
strictAuditMode: false,
|
|
289
|
+
triggerReason: 'auto-standard-lightweight',
|
|
290
|
+
smallEditDetected,
|
|
291
|
+
majorFeatureDetected,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function assertChecklist(checklistLabel, checklistPath, requiredSnippets, failures, results) {
|
|
296
|
+
const absoluteChecklistPath = resolve(REPOSITORY_ROOT, checklistPath);
|
|
297
|
+
|
|
298
|
+
if (!existsSync(absoluteChecklistPath)) {
|
|
299
|
+
failures.push(`Missing ${checklistLabel} checklist: ${checklistPath}`);
|
|
300
|
+
pushResult(results, false, `${checklistLabel}-checklist-exists`, `Missing ${checklistPath}`);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
pushResult(results, true, `${checklistLabel}-checklist-exists`, `${checklistPath} is present`);
|
|
305
|
+
|
|
306
|
+
const checklistContent = readFileSync(absoluteChecklistPath, 'utf8');
|
|
307
|
+
const missingChecklistSnippets = requiredSnippets.filter(
|
|
308
|
+
(requiredSnippet) => !checklistContent.includes(requiredSnippet)
|
|
309
|
+
);
|
|
310
|
+
|
|
311
|
+
if (missingChecklistSnippets.length > 0) {
|
|
312
|
+
failures.push(`Missing ${checklistLabel} checklist snippets: ${missingChecklistSnippets.join(', ')}`);
|
|
313
|
+
pushResult(
|
|
314
|
+
results,
|
|
315
|
+
false,
|
|
316
|
+
`${checklistLabel}-checklist-coverage`,
|
|
317
|
+
`Missing snippets in ${checklistPath}: ${missingChecklistSnippets.join(', ')}`
|
|
318
|
+
);
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
pushResult(results, true, `${checklistLabel}-checklist-coverage`, `${checklistLabel} checklist snippets are complete`);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function runAudit() {
|
|
326
|
+
const parsedArguments = parseCliArguments(process.argv.slice(2));
|
|
327
|
+
const changedScope = collectChangedFiles();
|
|
328
|
+
const changedFiles = changedScope.files;
|
|
329
|
+
|
|
330
|
+
const auditMode = resolveAuditMode({
|
|
331
|
+
workflow: parsedArguments.workflow,
|
|
332
|
+
manualForceStrict: parsedArguments.strict,
|
|
333
|
+
changedFiles,
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
const results = [];
|
|
337
|
+
const failures = [];
|
|
338
|
+
|
|
339
|
+
pushResult(results, true, 'context-workflow', `workflow=${parsedArguments.workflow}`);
|
|
340
|
+
pushResult(
|
|
341
|
+
results,
|
|
342
|
+
true,
|
|
343
|
+
'manual-force-strict-flag',
|
|
344
|
+
parsedArguments.strict ? 'Manual strict mode requested' : 'Manual strict mode not requested'
|
|
345
|
+
);
|
|
346
|
+
|
|
347
|
+
if (auditMode.strictAuditMode) {
|
|
348
|
+
pushResult(results, true, 'strict-audit-activation', `Strict audit mode activated (${auditMode.triggerReason})`);
|
|
349
|
+
|
|
350
|
+
assertChecklist(
|
|
351
|
+
'security',
|
|
352
|
+
SECURITY_CHECKLIST_PATH,
|
|
353
|
+
REQUIRED_SECURITY_CHECKLIST_SNIPPETS,
|
|
354
|
+
failures,
|
|
355
|
+
results
|
|
356
|
+
);
|
|
357
|
+
assertChecklist(
|
|
358
|
+
'performance',
|
|
359
|
+
PERFORMANCE_CHECKLIST_PATH,
|
|
360
|
+
REQUIRED_PERFORMANCE_CHECKLIST_SNIPPETS,
|
|
361
|
+
failures,
|
|
362
|
+
results
|
|
363
|
+
);
|
|
364
|
+
} else {
|
|
365
|
+
pushResult(
|
|
366
|
+
results,
|
|
367
|
+
true,
|
|
368
|
+
'strict-audit-lightweight-mode',
|
|
369
|
+
`Strict audits skipped to avoid heavy mode (${auditMode.triggerReason})`
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
const reportPayload = {
|
|
374
|
+
generatedAt: new Date().toISOString(),
|
|
375
|
+
auditName: 'context-triggered-audit',
|
|
376
|
+
workflow: parsedArguments.workflow,
|
|
377
|
+
source: changedScope.source,
|
|
378
|
+
changedFileCount: changedFiles.length,
|
|
379
|
+
changedFiles,
|
|
380
|
+
userForcedStrictMode: parsedArguments.strict,
|
|
381
|
+
strictAuditMode: auditMode.strictAuditMode,
|
|
382
|
+
triggerReason: auditMode.triggerReason,
|
|
383
|
+
smallEditDetected: auditMode.smallEditDetected,
|
|
384
|
+
majorFeatureDetected: auditMode.majorFeatureDetected,
|
|
385
|
+
passed: failures.length === 0,
|
|
386
|
+
failureCount: failures.length,
|
|
387
|
+
failures,
|
|
388
|
+
results,
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
console.log(JSON.stringify(reportPayload, null, 2));
|
|
392
|
+
process.exit(reportPayload.passed ? 0 : 1);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
runAudit();
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* documentation-boundary-audit.mjs
|
|
5
|
+
*
|
|
6
|
+
* Enforces documentation sync only on changed scope boundaries.
|
|
7
|
+
* If public surface, API contract, or database structure files change,
|
|
8
|
+
* matching documentation updates must be present in the same change scope.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { execFileSync } from 'node:child_process';
|
|
12
|
+
import { dirname, resolve } from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = dirname(__filename);
|
|
17
|
+
const REPOSITORY_ROOT = resolve(__dirname, '..');
|
|
18
|
+
|
|
19
|
+
const CORE_DOCUMENTATION_FILES = new Set(['README.md', 'CHANGELOG.md']);
|
|
20
|
+
|
|
21
|
+
const BOUNDARY_RULES = [
|
|
22
|
+
{
|
|
23
|
+
boundaryName: 'public-surface',
|
|
24
|
+
requirement: 'Public surface changes must update README.md, CHANGELOG.md, or docs/* in the same scope.',
|
|
25
|
+
trigger(filePath) {
|
|
26
|
+
return /^(bin\/|lib\/|scripts\/)/.test(filePath) && !isDocumentationFilePath(filePath);
|
|
27
|
+
},
|
|
28
|
+
docsMatcher(filePath) {
|
|
29
|
+
return filePath === 'README.md' || filePath === 'CHANGELOG.md' || filePath.startsWith('docs/');
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
boundaryName: 'api-contract',
|
|
34
|
+
requirement: 'API endpoint or contract changes must update API/OpenAPI documentation in the same scope.',
|
|
35
|
+
trigger(filePath) {
|
|
36
|
+
return !isDocumentationFilePath(filePath)
|
|
37
|
+
&& /(api|openapi|contract|controller|route|endpoint)/i.test(filePath);
|
|
38
|
+
},
|
|
39
|
+
docsMatcher(filePath) {
|
|
40
|
+
return filePath === '.agent-context/rules/api-docs.md'
|
|
41
|
+
|| /^(docs\/.*(api|contract|openapi))/i.test(filePath)
|
|
42
|
+
|| filePath === 'README.md';
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
boundaryName: 'database-structure',
|
|
47
|
+
requirement: 'Database structure changes must update schema or migration documentation in the same scope.',
|
|
48
|
+
trigger(filePath) {
|
|
49
|
+
return !isDocumentationFilePath(filePath)
|
|
50
|
+
&& /(database|schema|migration|repository|sql|prisma|typeorm|knex)/i.test(filePath);
|
|
51
|
+
},
|
|
52
|
+
docsMatcher(filePath) {
|
|
53
|
+
return filePath === '.agent-context/rules/database-design.md'
|
|
54
|
+
|| /^(docs\/.*(database|schema|migration))/i.test(filePath)
|
|
55
|
+
|| filePath === 'README.md';
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
function normalizeFilePath(filePath) {
|
|
61
|
+
return filePath.replace(/\\/g, '/').replace(/^\.\//, '');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function parseGitFileList(rawOutput) {
|
|
65
|
+
if (typeof rawOutput !== 'string' || rawOutput.trim().length === 0) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return rawOutput
|
|
70
|
+
.split(/\r?\n/)
|
|
71
|
+
.map((filePath) => filePath.trim())
|
|
72
|
+
.filter((filePath) => filePath.length > 0)
|
|
73
|
+
.map(normalizeFilePath);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function runGitFileQuery(commandArguments) {
|
|
77
|
+
try {
|
|
78
|
+
const rawOutput = execFileSync('git', commandArguments, {
|
|
79
|
+
cwd: REPOSITORY_ROOT,
|
|
80
|
+
encoding: 'utf8',
|
|
81
|
+
maxBuffer: 1024 * 1024,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
return parseGitFileList(rawOutput);
|
|
85
|
+
} catch {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function uniqueSorted(filePaths) {
|
|
91
|
+
return Array.from(new Set(filePaths)).sort((leftPath, rightPath) => leftPath.localeCompare(rightPath));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function collectChangedFiles() {
|
|
95
|
+
const workingTreeFiles = runGitFileQuery(['diff', '--name-only']);
|
|
96
|
+
const stagedFiles = runGitFileQuery(['diff', '--name-only', '--cached']);
|
|
97
|
+
const workingScopeFiles = uniqueSorted([...workingTreeFiles, ...stagedFiles]);
|
|
98
|
+
|
|
99
|
+
if (workingScopeFiles.length > 0) {
|
|
100
|
+
return {
|
|
101
|
+
source: 'working-tree-and-index',
|
|
102
|
+
files: workingScopeFiles,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const latestCommitRangeFiles = runGitFileQuery(['diff', '--name-only', 'HEAD~1..HEAD']);
|
|
107
|
+
if (latestCommitRangeFiles.length > 0) {
|
|
108
|
+
return {
|
|
109
|
+
source: 'latest-commit-range',
|
|
110
|
+
files: uniqueSorted(latestCommitRangeFiles),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const headCommitFiles = runGitFileQuery(['show', '--pretty=format:', '--name-only', 'HEAD']);
|
|
115
|
+
if (headCommitFiles.length > 0) {
|
|
116
|
+
return {
|
|
117
|
+
source: 'head-commit',
|
|
118
|
+
files: uniqueSorted(headCommitFiles),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
source: 'none',
|
|
124
|
+
files: [],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function isDocumentationFilePath(filePath) {
|
|
129
|
+
return CORE_DOCUMENTATION_FILES.has(filePath)
|
|
130
|
+
|| filePath.startsWith('docs/')
|
|
131
|
+
|| filePath.startsWith('.agent-context/review-checklists/')
|
|
132
|
+
|| filePath === '.agent-context/rules/api-docs.md'
|
|
133
|
+
|| filePath === '.agent-context/rules/database-design.md';
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function evaluateBoundary(boundaryRule, changedFiles, changedDocumentationFiles) {
|
|
137
|
+
const boundaryChangedFiles = changedFiles.filter((filePath) => boundaryRule.trigger(filePath));
|
|
138
|
+
|
|
139
|
+
if (boundaryChangedFiles.length === 0) {
|
|
140
|
+
return {
|
|
141
|
+
boundaryName: boundaryRule.boundaryName,
|
|
142
|
+
requirement: boundaryRule.requirement,
|
|
143
|
+
triggered: false,
|
|
144
|
+
passed: true,
|
|
145
|
+
changedFiles: [],
|
|
146
|
+
documentationFiles: [],
|
|
147
|
+
details: 'Boundary not triggered by changed scope.',
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const matchingDocumentationFiles = changedDocumentationFiles.filter((filePath) => boundaryRule.docsMatcher(filePath));
|
|
152
|
+
const boundaryPassed = matchingDocumentationFiles.length > 0;
|
|
153
|
+
|
|
154
|
+
const details = boundaryPassed
|
|
155
|
+
? `Boundary triggered and synchronized with documentation updates: ${matchingDocumentationFiles.join(', ')}`
|
|
156
|
+
: 'Boundary triggered without required documentation updates.';
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
boundaryName: boundaryRule.boundaryName,
|
|
160
|
+
requirement: boundaryRule.requirement,
|
|
161
|
+
triggered: true,
|
|
162
|
+
passed: boundaryPassed,
|
|
163
|
+
changedFiles: boundaryChangedFiles,
|
|
164
|
+
documentationFiles: matchingDocumentationFiles,
|
|
165
|
+
details,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function runDocumentationBoundaryAudit() {
|
|
170
|
+
const changedScope = collectChangedFiles();
|
|
171
|
+
const changedFiles = changedScope.files;
|
|
172
|
+
const changedDocumentationFiles = changedFiles.filter(isDocumentationFilePath);
|
|
173
|
+
|
|
174
|
+
const boundaryResults = BOUNDARY_RULES.map((boundaryRule) => (
|
|
175
|
+
evaluateBoundary(boundaryRule, changedFiles, changedDocumentationFiles)
|
|
176
|
+
));
|
|
177
|
+
|
|
178
|
+
const failures = boundaryResults
|
|
179
|
+
.filter((boundaryResult) => boundaryResult.triggered && !boundaryResult.passed)
|
|
180
|
+
.map((boundaryResult) => {
|
|
181
|
+
const affectedFiles = boundaryResult.changedFiles.join(', ');
|
|
182
|
+
return `${boundaryResult.boundaryName}: ${boundaryResult.requirement} Changed files: ${affectedFiles}`;
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
const reportPayload = {
|
|
186
|
+
generatedAt: new Date().toISOString(),
|
|
187
|
+
auditName: 'documentation-boundary-audit',
|
|
188
|
+
source: changedScope.source,
|
|
189
|
+
changedFileCount: changedFiles.length,
|
|
190
|
+
changedFiles,
|
|
191
|
+
boundaryResults,
|
|
192
|
+
passed: failures.length === 0,
|
|
193
|
+
failureCount: failures.length,
|
|
194
|
+
failures,
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
console.log(JSON.stringify(reportPayload, null, 2));
|
|
198
|
+
process.exit(reportPayload.passed ? 0 : 1);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
runDocumentationBoundaryAudit();
|
package/scripts/release-gate.mjs
CHANGED
|
@@ -30,6 +30,8 @@ const REQUIRED_SKILL_DOMAINS = [
|
|
|
30
30
|
const FRONTEND_PARITY_CHECKLIST_PATH = '.agent-context/review-checklists/frontend-skill-parity.md';
|
|
31
31
|
const FRONTEND_EXCELLENCE_RUBRIC_PATH = '.agent-context/review-checklists/frontend-excellence-rubric.md';
|
|
32
32
|
const FRONTEND_AUDIT_SCRIPT_PATH = 'scripts/frontend-usability-audit.mjs';
|
|
33
|
+
const DOCUMENTATION_BOUNDARY_AUDIT_SCRIPT_PATH = 'scripts/documentation-boundary-audit.mjs';
|
|
34
|
+
const CONTEXT_TRIGGERED_AUDIT_SCRIPT_PATH = 'scripts/context-triggered-audit.mjs';
|
|
33
35
|
const BACKEND_ARCHITECTURE_RULE_PATH = '.agent-context/rules/architecture.md';
|
|
34
36
|
const BACKEND_REVIEW_CHECKLIST_PATH = '.agent-context/review-checklists/pr-checklist.md';
|
|
35
37
|
const REFACTOR_PROMPT_PATH = '.agent-context/prompts/refactor.md';
|
|
@@ -96,9 +98,9 @@ function parseMachineReadableReport(rawOutput) {
|
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
100
|
|
|
99
|
-
function runMachineReadableScript(scriptRelativePath) {
|
|
101
|
+
function runMachineReadableScript(scriptRelativePath, scriptArguments = []) {
|
|
100
102
|
try {
|
|
101
|
-
const rawOutput = execFileSync('node', [scriptRelativePath], {
|
|
103
|
+
const rawOutput = execFileSync('node', [scriptRelativePath, ...scriptArguments], {
|
|
102
104
|
cwd: REPOSITORY_ROOT,
|
|
103
105
|
encoding: 'utf8',
|
|
104
106
|
maxBuffer: 1024 * 1024,
|
|
@@ -337,6 +339,98 @@ function runReleaseGate() {
|
|
|
337
339
|
}
|
|
338
340
|
}
|
|
339
341
|
|
|
342
|
+
const documentationBoundaryAuditExecution = runMachineReadableScript(DOCUMENTATION_BOUNDARY_AUDIT_SCRIPT_PATH);
|
|
343
|
+
if (!documentationBoundaryAuditExecution.report) {
|
|
344
|
+
const failureDetails = documentationBoundaryAuditExecution.executionErrorMessage
|
|
345
|
+
? `Documentation boundary audit execution failed before producing a machine-readable report: ${documentationBoundaryAuditExecution.executionErrorMessage}`
|
|
346
|
+
: 'Documentation boundary audit did not produce machine-readable JSON output';
|
|
347
|
+
pushResult(results, false, 'documentation-boundary-audit', failureDetails);
|
|
348
|
+
} else {
|
|
349
|
+
diagnostics.documentationBoundaryAudit = documentationBoundaryAuditExecution.report;
|
|
350
|
+
pushResult(
|
|
351
|
+
results,
|
|
352
|
+
true,
|
|
353
|
+
'documentation-boundary-audit',
|
|
354
|
+
`documentation-boundary-audit executed (passed=${documentationBoundaryAuditExecution.report.passed}, failures=${documentationBoundaryAuditExecution.report.failureCount})`
|
|
355
|
+
);
|
|
356
|
+
|
|
357
|
+
if (documentationBoundaryAuditExecution.report.passed === true) {
|
|
358
|
+
pushResult(
|
|
359
|
+
results,
|
|
360
|
+
true,
|
|
361
|
+
'documentation-boundary-hard-rule',
|
|
362
|
+
'Documentation hard-rule passed for all triggered boundaries'
|
|
363
|
+
);
|
|
364
|
+
} else {
|
|
365
|
+
const failedDocumentationBoundaries = Array.isArray(documentationBoundaryAuditExecution.report.failures)
|
|
366
|
+
? documentationBoundaryAuditExecution.report.failures
|
|
367
|
+
: [];
|
|
368
|
+
const failureSummary = failedDocumentationBoundaries.length > 0
|
|
369
|
+
? failedDocumentationBoundaries.join('; ')
|
|
370
|
+
: 'Documentation boundary audit failed without boundary failure details';
|
|
371
|
+
pushResult(
|
|
372
|
+
results,
|
|
373
|
+
false,
|
|
374
|
+
'documentation-boundary-hard-rule',
|
|
375
|
+
`Documentation hard-rule failed: ${failureSummary}`
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
const contextTriggeredAuditExecution = runMachineReadableScript(
|
|
381
|
+
CONTEXT_TRIGGERED_AUDIT_SCRIPT_PATH,
|
|
382
|
+
['--workflow', 'pr-preparation']
|
|
383
|
+
);
|
|
384
|
+
if (!contextTriggeredAuditExecution.report) {
|
|
385
|
+
const failureDetails = contextTriggeredAuditExecution.executionErrorMessage
|
|
386
|
+
? `Context-triggered audit execution failed before producing a machine-readable report: ${contextTriggeredAuditExecution.executionErrorMessage}`
|
|
387
|
+
: 'Context-triggered audit did not produce machine-readable JSON output';
|
|
388
|
+
pushResult(results, false, 'context-triggered-audit', failureDetails);
|
|
389
|
+
} else {
|
|
390
|
+
diagnostics.contextTriggeredAudit = contextTriggeredAuditExecution.report;
|
|
391
|
+
pushResult(
|
|
392
|
+
results,
|
|
393
|
+
true,
|
|
394
|
+
'context-triggered-audit',
|
|
395
|
+
`context-triggered-audit executed (passed=${contextTriggeredAuditExecution.report.passed}, strict=${contextTriggeredAuditExecution.report.strictAuditMode}, failures=${contextTriggeredAuditExecution.report.failureCount})`
|
|
396
|
+
);
|
|
397
|
+
|
|
398
|
+
if (contextTriggeredAuditExecution.report.strictAuditMode === true) {
|
|
399
|
+
pushResult(
|
|
400
|
+
results,
|
|
401
|
+
true,
|
|
402
|
+
'context-triggered-strict-mode-auto',
|
|
403
|
+
`Strict audit mode activated automatically for workflow=${contextTriggeredAuditExecution.report.workflow}`
|
|
404
|
+
);
|
|
405
|
+
} else {
|
|
406
|
+
pushResult(
|
|
407
|
+
results,
|
|
408
|
+
false,
|
|
409
|
+
'context-triggered-strict-mode-auto',
|
|
410
|
+
`Strict audit mode was not activated for workflow=${contextTriggeredAuditExecution.report.workflow}`
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (contextTriggeredAuditExecution.report.passed === true) {
|
|
415
|
+
pushResult(
|
|
416
|
+
results,
|
|
417
|
+
true,
|
|
418
|
+
'context-triggered-security-performance-hard-rule',
|
|
419
|
+
'Context-triggered security and performance audit hard-rule passed'
|
|
420
|
+
);
|
|
421
|
+
} else {
|
|
422
|
+
const failedAuditDetails = Array.isArray(contextTriggeredAuditExecution.report.failures)
|
|
423
|
+
? contextTriggeredAuditExecution.report.failures.join('; ')
|
|
424
|
+
: 'Unknown context-triggered audit failures';
|
|
425
|
+
pushResult(
|
|
426
|
+
results,
|
|
427
|
+
false,
|
|
428
|
+
'context-triggered-security-performance-hard-rule',
|
|
429
|
+
`Context-triggered audit failed: ${failedAuditDetails}`
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
340
434
|
const frontendParityChecklistContent = readText(FRONTEND_PARITY_CHECKLIST_PATH);
|
|
341
435
|
if (!frontendParityChecklistContent) {
|
|
342
436
|
pushResult(results, false, 'frontend-parity-checklist-exists', `Missing ${FRONTEND_PARITY_CHECKLIST_PATH}`);
|
package/scripts/validate.mjs
CHANGED
|
@@ -171,6 +171,8 @@ async function validateRequiredFiles() {
|
|
|
171
171
|
'scripts/governance-weekly-report.mjs',
|
|
172
172
|
'scripts/mcp-server.mjs',
|
|
173
173
|
'scripts/frontend-usability-audit.mjs',
|
|
174
|
+
'scripts/documentation-boundary-audit.mjs',
|
|
175
|
+
'scripts/context-triggered-audit.mjs',
|
|
174
176
|
'scripts/release-gate.mjs',
|
|
175
177
|
'scripts/generate-sbom.mjs',
|
|
176
178
|
'scripts/init-project.sh',
|