vibe-coding-master 0.7.30 → 0.7.31
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/dist/backend/services/gate-review-service.js +25 -7
- package/dist/backend/templates/handoff.js +21 -1
- package/dist/backend/templates/harness/gate-review.js +19 -0
- package/dist/backend/templates/harness/project-manager-agent.js +21 -13
- package/dist/backend/templates/harness/tester-agent.js +35 -4
- package/dist/shared/types/gate-review.js +4 -0
- package/dist/shared/validation/artifact-check.js +55 -1
- package/dist/shared/validation/artifact-contract.js +6 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { CODE_DIFF_SOURCES, GATE_REVIEW_GATES } from "../../shared/types/gate-review.js";
|
|
3
|
+
import { CODE_DIFF_FINDING_SCOPES, CODE_DIFF_SOURCES, GATE_REVIEW_GATES } from "../../shared/types/gate-review.js";
|
|
4
4
|
import { checkMarkdownArtifact } from "../../shared/validation/artifact-check.js";
|
|
5
5
|
import { VcmError } from "../errors.js";
|
|
6
6
|
import { resolveRepoPath } from "../adapters/filesystem.js";
|
|
@@ -38,6 +38,7 @@ const VALIDATION_ANALYSIS_FIELDS = [
|
|
|
38
38
|
"Boundary And Failure Coverage",
|
|
39
39
|
"Public Contract Coverage",
|
|
40
40
|
"Test Integrity",
|
|
41
|
+
"Test Infrastructure",
|
|
41
42
|
"Skips And Gaps",
|
|
42
43
|
"User Approval And Gap Disposition",
|
|
43
44
|
"Validation Readiness"
|
|
@@ -91,6 +92,7 @@ const CORE_INPUT_ARTIFACTS = {
|
|
|
91
92
|
"validation-adequacy": ".ai/vcm/handoffs/test-report.md"
|
|
92
93
|
};
|
|
93
94
|
const VALID_SEVERITIES = new Set(["critical", "high", "medium", "low"]);
|
|
95
|
+
const VALID_CODE_DIFF_FINDING_SCOPES = new Set(CODE_DIFF_FINDING_SCOPES);
|
|
94
96
|
export function createGateReviewService(deps) {
|
|
95
97
|
const now = deps.now ?? (() => new Date().toISOString());
|
|
96
98
|
const reportPollIntervalMs = deps.reportPollIntervalMs ?? DEFAULT_REPORT_POLL_INTERVAL_MS;
|
|
@@ -1067,11 +1069,18 @@ async function readValidationReportError(fs, taskRepoRoot) {
|
|
|
1067
1069
|
const absolutePath = resolveRepoPath(taskRepoRoot, relativePath);
|
|
1068
1070
|
const content = await fs.pathExists(absolutePath) ? await fs.readText(absolutePath) : null;
|
|
1069
1071
|
const check = checkMarkdownArtifact("test-report", relativePath, content);
|
|
1070
|
-
if (check.status
|
|
1071
|
-
return
|
|
1072
|
+
if (check.status !== "ok") {
|
|
1073
|
+
return `${relativePath} is incomplete and cannot start validation-adequacy review. `
|
|
1074
|
+
+ formatValidationArtifactFailure(check, content);
|
|
1075
|
+
}
|
|
1076
|
+
const infrastructureStatus = matchField(extractMarkdownSection(content ?? "", "Test Infrastructure") ?? "", "Status");
|
|
1077
|
+
if (infrastructureStatus === "repair-required") {
|
|
1078
|
+
return `${relativePath} cannot start validation-adequacy review while Test Infrastructure Status is repair-required. Route Tester repair first.`;
|
|
1079
|
+
}
|
|
1080
|
+
if (infrastructureStatus === "production-change-required") {
|
|
1081
|
+
return `${relativePath} cannot start validation-adequacy review while Test Infrastructure Status is production-change-required. Route the active flow's implementation-failure branch first.`;
|
|
1072
1082
|
}
|
|
1073
|
-
return
|
|
1074
|
-
+ formatValidationArtifactFailure(check, content);
|
|
1083
|
+
return undefined;
|
|
1075
1084
|
}
|
|
1076
1085
|
async function readCodeDiffPrerequisiteError(deps, context, index) {
|
|
1077
1086
|
const reportError = await readValidationReportError(deps.fs, context.taskRepoRoot);
|
|
@@ -1367,11 +1376,13 @@ function validateRequestChangeFindings(findings) {
|
|
|
1367
1376
|
}
|
|
1368
1377
|
}
|
|
1369
1378
|
function validateCodeDiffFindings(findings) {
|
|
1370
|
-
const incomplete = findings.find((finding) => !finding.file?.trim()
|
|
1379
|
+
const incomplete = findings.find((finding) => (!finding.file?.trim()
|
|
1380
|
+
|| !finding.location?.trim()
|
|
1381
|
+
|| !finding.scope));
|
|
1371
1382
|
if (incomplete) {
|
|
1372
1383
|
throw new VcmError({
|
|
1373
1384
|
code: "GATE_REVIEW_CODE_DIFF_FINDING_LOCATION_MISSING",
|
|
1374
|
-
message: `Code-diff finding ${incomplete.title} must contain File
|
|
1385
|
+
message: `Code-diff finding ${incomplete.title} must contain File, Line Or Symbol, and Finding Scope.`,
|
|
1375
1386
|
statusCode: 500
|
|
1376
1387
|
});
|
|
1377
1388
|
}
|
|
@@ -1465,6 +1476,7 @@ function extractFindings(content) {
|
|
|
1465
1476
|
file: matchField(block, "file"),
|
|
1466
1477
|
line: parsePositiveInteger(matchField(block, "line")),
|
|
1467
1478
|
location: matchField(block, "line or symbol"),
|
|
1479
|
+
scope: normalizeCodeDiffFindingScope(matchField(block, "finding scope")),
|
|
1468
1480
|
evidence: matchField(block, "evidence") ?? "",
|
|
1469
1481
|
expected: matchField(block, "expected") ?? "",
|
|
1470
1482
|
gap: matchField(block, "gap") ?? "",
|
|
@@ -1527,6 +1539,12 @@ function normalizeSeverity(value) {
|
|
|
1527
1539
|
? normalized
|
|
1528
1540
|
: undefined;
|
|
1529
1541
|
}
|
|
1542
|
+
function normalizeCodeDiffFindingScope(value) {
|
|
1543
|
+
const normalized = typeof value === "string" ? value.toLowerCase() : "";
|
|
1544
|
+
return VALID_CODE_DIFF_FINDING_SCOPES.has(normalized)
|
|
1545
|
+
? normalized
|
|
1546
|
+
: undefined;
|
|
1547
|
+
}
|
|
1530
1548
|
function normalizeCallbackStatus(value) {
|
|
1531
1549
|
return value === "not_sent" || value === "sent" || value === "skipped" || value === "failed"
|
|
1532
1550
|
? value
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ARCHITECTURE_BRIEF_STATUSES, ARCHITECTURE_PLAN_RESULTS, DOCS_SYNC_DECISIONS, FINAL_ACCEPTANCE_DECISIONS, L3_ACTIONS, L3_REQUIRED_VALUES, STRICT_NONE_VALUE, TEST_RESULTS, renderArtifactOptions } from "../../shared/validation/artifact-contract.js";
|
|
1
|
+
import { ARCHITECTURE_BRIEF_STATUSES, ARCHITECTURE_PLAN_RESULTS, DOCS_SYNC_DECISIONS, FINAL_ACCEPTANCE_DECISIONS, L3_ACTIONS, L3_REQUIRED_VALUES, STRICT_NONE_VALUE, TEST_INFRASTRUCTURE_STATUSES, TEST_RESULTS, renderArtifactOptions } from "../../shared/validation/artifact-contract.js";
|
|
2
2
|
export function renderArchitectureBriefTemplate(taskSlug) {
|
|
3
3
|
return `# Architecture Brief: ${taskSlug}
|
|
4
4
|
|
|
@@ -201,6 +201,26 @@ TBD
|
|
|
201
201
|
|
|
202
202
|
TBD
|
|
203
203
|
|
|
204
|
+
## Test Infrastructure
|
|
205
|
+
|
|
206
|
+
Status: ${renderArtifactOptions(TEST_INFRASTRUCTURE_STATUSES)}
|
|
207
|
+
|
|
208
|
+
### Affected Files
|
|
209
|
+
|
|
210
|
+
${STRICT_NONE_VALUE}
|
|
211
|
+
|
|
212
|
+
### Boundary Evidence
|
|
213
|
+
|
|
214
|
+
${STRICT_NONE_VALUE}
|
|
215
|
+
|
|
216
|
+
### Defect-Class Sweep
|
|
217
|
+
|
|
218
|
+
${STRICT_NONE_VALUE}
|
|
219
|
+
|
|
220
|
+
### Repair Commit
|
|
221
|
+
|
|
222
|
+
${STRICT_NONE_VALUE}
|
|
223
|
+
|
|
204
224
|
## Failed Expectations
|
|
205
225
|
|
|
206
226
|
${STRICT_NONE_VALUE}
|
|
@@ -185,6 +185,14 @@ when they are relevant to the changed behavior. Check that tests were not
|
|
|
185
185
|
weakened, over-mocked, tied only to fixture values or implementation details,
|
|
186
186
|
or made green by bypassing the real behavior path.
|
|
187
187
|
|
|
188
|
+
Inspect the \`Test Infrastructure\` section of \`test-report.md\`. A report with
|
|
189
|
+
\`repair-required\` or \`production-change-required\` is not gate-ready. When
|
|
190
|
+
status is \`repaired\`, verify the affected files remain Tester-owned, the
|
|
191
|
+
boundary evidence excludes production or shared changes, the defect-class sweep
|
|
192
|
+
covers the affected test-infrastructure family, the repair commit exists in the
|
|
193
|
+
current range, and required clean-state validation was rerun. Request changes
|
|
194
|
+
for missing, contradictory, incomplete, weakened, or unverified repair evidence.
|
|
195
|
+
|
|
188
196
|
Do not approve only because \`Test Result: pass\` or all recorded commands are
|
|
189
197
|
green. Request changes when the report is incomplete or inconsistent with the
|
|
190
198
|
actual tests, validation level does not match risk, an important behavior has
|
|
@@ -239,6 +247,13 @@ scaffold, and coder completion evidence. Verify that the complete planned
|
|
|
239
247
|
behavior is implemented without changing architect-owned boundaries or
|
|
240
248
|
contracts.
|
|
241
249
|
|
|
250
|
+
When the range contains Tester-authored changes recorded in \`test-report.md\`,
|
|
251
|
+
review those tests, fixtures, test-only helpers, and \`docs/TESTING.md\` against
|
|
252
|
+
the Tester role, the repair or coverage evidence, and
|
|
253
|
+
\`docs/CODING_STANDARDS.md\`. Do not reject a valid Tester-owned change merely
|
|
254
|
+
because it is not a Coder scaffold item. Verify that Tester changes remain
|
|
255
|
+
test-only, preserve real behavior paths, and are committed and validated.
|
|
256
|
+
|
|
242
257
|
For \`architect-debug\`, compare the commits with the current Architect route
|
|
243
258
|
command and \`.ai/vcm/handoffs/architect-debug.md\`. Verify that the confirmed
|
|
244
259
|
root cause is supported by the code, the implementation fixes that cause rather
|
|
@@ -319,6 +334,7 @@ Use this findings structure:
|
|
|
319
334
|
- Boundary And Failure Coverage:
|
|
320
335
|
- Public Contract Coverage:
|
|
321
336
|
- Test Integrity:
|
|
337
|
+
- Test Infrastructure:
|
|
322
338
|
- Skips And Gaps:
|
|
323
339
|
- User Approval And Gap Disposition:
|
|
324
340
|
- Validation Readiness:
|
|
@@ -344,6 +360,8 @@ Use this findings structure:
|
|
|
344
360
|
<!-- File and Line Or Symbol are required for code-diff findings. -->
|
|
345
361
|
- File:
|
|
346
362
|
- Line Or Symbol:
|
|
363
|
+
<!-- Finding Scope is required for code-diff findings. Use test-only only when correction needs no production, runtime, public-contract, dependency, generated-context, architecture, or shared-production change. -->
|
|
364
|
+
- Finding Scope: test-only|implementation
|
|
347
365
|
- Evidence:
|
|
348
366
|
- Expected:
|
|
349
367
|
- Gap:
|
|
@@ -382,6 +400,7 @@ If there are no findings, write:
|
|
|
382
400
|
- Boundary And Failure Coverage:
|
|
383
401
|
- Public Contract Coverage:
|
|
384
402
|
- Test Integrity:
|
|
403
|
+
- Test Infrastructure:
|
|
385
404
|
- Skips And Gaps:
|
|
386
405
|
- User Approval And Gap Disposition:
|
|
387
406
|
- Validation Readiness:
|
|
@@ -93,9 +93,11 @@ PM may leave this path only through the allowed branches below.
|
|
|
93
93
|
- **Coder Continuation:** If Coder returns \`Decision: incomplete\`, lacks the required completion artifact, or has not completed implementation and L0/L1 validation, route Coder again — this is the only route for an in-progress sweep. Problems recorded inside an incomplete report are sweep state, not routable failures; PM routes problems onward only from a post-sweep \`failed\` report carrying the consolidated per-item disposition.
|
|
94
94
|
- **Coder Failure Debug:** If Coder returns \`Decision: failed\` with compile, typecheck, or L0/L1 failure evidence after implementation, suspend the main flow and enter Architect Debug Branch.
|
|
95
95
|
- **Tester Continuation:** If Tester returns \`Test Result: incomplete\`, route Tester again to continue the recorded remaining validation. Do not enter Debug, Diagnosis, or validation-adequacy Gate Review.
|
|
96
|
-
- **Tester
|
|
97
|
-
- **
|
|
98
|
-
- **
|
|
96
|
+
- **Tester Test-Infrastructure Repair:** If Tester returns \`Test Result: fail\` with \`Test Infrastructure Status: repair-required\`, route Tester to repair and commit the confined test-infrastructure defect, rerun required validation, and replace \`test-report.md\`. Do not enter Architect Debug while this Tester-owned repair remains available.
|
|
97
|
+
- **Tester Failure:** If Tester returns \`Test Result: fail\` with \`Test Infrastructure Status: none\`, \`repaired\`, or \`production-change-required\`, suspend the main flow and enter Architect Debug Branch.
|
|
98
|
+
- **Validation Revision:** If the validation-adequacy Gate returns \`request_changes\`, route the complete report to Tester. Tester must correct the tests or evidence, rerun required validation, commit tracked Tester-owned changes, and replace \`test-report.md\` before PM reruns the Gate. If corrected validation returns \`fail\`, apply Tester Test-Infrastructure Repair or Tester Failure from that result.
|
|
99
|
+
- **Tester Code-Diff Correction:** If every code-diff finding has \`Finding Scope: test-only\`, route the complete report to Tester. After correction, repeat Tester validation, validation-adequacy Gate, and \`code-diff --source coder\`.
|
|
100
|
+
- **Code-Diff Correction:** If any code-diff finding has \`Finding Scope: implementation\`, suspend the main flow and enter Architect Debug Branch with the complete Gate report.
|
|
99
101
|
- **Docs Sync Correction:** \`Decision: synced\` or \`unchanged\` continues to Final Acceptance. \`Decision: blocked\` remains at docs sync unless the report identifies an allowed Debug, Diagnosis, or user-decision branch.
|
|
100
102
|
- **Final Acceptance Follow-Up:** Route \`needs-coder-follow-up\` to Coder, \`needs-architect-follow-up\` to Architect, \`needs-docs-sync\` to Architect docs sync, and \`blocked-by-user-decision\` to the user. After follow-up work, resume from the earliest affected Code-Change Flow step and repeat every downstream Gate.
|
|
101
103
|
- **User Decision:** Pause only when the flow requires user intent, external authorization, or an exact user-approved exception. Resume from the suspended step after the user's decision is recorded.
|
|
@@ -116,7 +118,7 @@ The flow completes only when Final Acceptance returns:
|
|
|
116
118
|
- Route user-originated or flow-required architecture, scope, contract, dependency, public surface, durable docs, and implementation-plan questions to Architect.
|
|
117
119
|
- Do not treat Coder architecture doubts, design concerns, scaffold objections, or validation predictions as architecture questions.
|
|
118
120
|
- Route validation strategy, test coverage, test-report, and validation adequacy questions to Tester.
|
|
119
|
-
- Route bugs, build/runtime errors, and
|
|
121
|
+
- Route bugs, build/runtime errors, and production-implementation validation failures from a code-delivery flow to Architect Debug Mode according to the active flow. Route a confined \`repair-required\` test-infrastructure failure back to Tester. Do not route a Validation-Only Flow \`Test Result: fail\` to Debug unless the accepted outcome requires implementation repair.
|
|
120
122
|
- Ask the user only when user intent, priority, approval, external authorization, secrets, real cost, production permission, sensitive data access, or durable-doc conflict requires user decision.
|
|
121
123
|
- Non-PM role results, blockers, findings, and requests must come back to PM. PM decides the next route.
|
|
122
124
|
- Only PM decides the next VCM route, gate, pause, retry, final acceptance, or PR-Preparation Flow step. Non-PM role messages are evidence and status only; any requested next action from a non-PM role is advisory and must be reclassified by PM against the active flow, required artifacts, gate state, and PM routing rules.
|
|
@@ -134,6 +136,7 @@ Every branch must end in exactly one of these outcomes:
|
|
|
134
136
|
|
|
135
137
|
- return to the recorded main-flow resume point
|
|
136
138
|
- repeat the current responsible role
|
|
139
|
+
- route to Tester for an explicitly allowed test-only repair or correction
|
|
137
140
|
- route to Architect Debug Mode
|
|
138
141
|
- route to Architecture Diagnosis Mode
|
|
139
142
|
- pause for user decision
|
|
@@ -152,9 +155,11 @@ The shared path is:
|
|
|
152
155
|
|
|
153
156
|
- **Normal Plan Required:** If Architect returns \`normal architecture plan required\`, enter Code-Change Flow at Architect planning. When Debug is a branch of Code-Change Flow, resume that parent flow at Architect planning.
|
|
154
157
|
- **Tester Continuation:** If Tester returns \`Test Result: incomplete\`, route Tester again to continue the recorded remaining validation.
|
|
155
|
-
- **
|
|
156
|
-
- **
|
|
157
|
-
- **
|
|
158
|
+
- **Tester Test-Infrastructure Repair:** If Tester returns \`Test Result: fail\` with \`Test Infrastructure Status: repair-required\`, route Tester to repair and commit the confined test-infrastructure defect, rerun required validation, and replace \`test-report.md\`.
|
|
159
|
+
- **Architecture Diagnosis:** If Tester returns \`Test Result: fail\` with \`Test Infrastructure Status: none\`, \`repaired\`, or \`production-change-required\`, enter Architecture Diagnosis Branch.
|
|
160
|
+
- **Validation Revision:** If the validation-adequacy Gate returns \`request_changes\`, route the complete report to Tester. After Tester corrects tests or evidence, reruns validation, commits tracked Tester-owned changes, and replaces \`test-report.md\`, rerun the Gate.
|
|
161
|
+
- **Tester Code-Diff Correction:** If every code-diff finding has \`Finding Scope: test-only\`, route the complete report to Tester. After correction, repeat Tester validation, validation-adequacy Gate, and \`code-diff --source architect-debug\`.
|
|
162
|
+
- **Code-Diff Revision:** If any code-diff finding has \`Finding Scope: implementation\`, route the complete report to Architect Debug Mode. After correction, repeat Tester validation, validation-adequacy Gate, and \`code-diff --source architect-debug\`.
|
|
158
163
|
|
|
159
164
|
#### Successful Exit
|
|
160
165
|
|
|
@@ -183,9 +188,11 @@ Architecture Diagnosis Mode must run before another Debug Mode fix or Coder disp
|
|
|
183
188
|
#### Allowed Branches
|
|
184
189
|
|
|
185
190
|
- **Tester Continuation:** If Tester returns \`Test Result: incomplete\`, route Tester again to continue the recorded remaining validation.
|
|
186
|
-
- **Tester
|
|
187
|
-
- **
|
|
188
|
-
- **
|
|
191
|
+
- **Tester Test-Infrastructure Repair:** If Tester returns \`Test Result: fail\` with \`Test Infrastructure Status: repair-required\`, route Tester to repair and commit the confined test-infrastructure defect, rerun required validation, and replace \`test-report.md\`.
|
|
192
|
+
- **Tester Failure:** If Tester returns \`Test Result: fail\` with \`Test Infrastructure Status: none\`, \`repaired\`, or \`production-change-required\`, pause and report to the user. If required validation remains unavailable, ask whether the user explicitly approves retaining that exact Coverage Gap.
|
|
193
|
+
- **Validation Revision:** If the validation-adequacy Gate returns \`request_changes\`, route the complete report to Tester. After Tester corrects tests or evidence, reruns validation, commits tracked Tester-owned changes, and replaces \`test-report.md\`, rerun the Gate.
|
|
194
|
+
- **Tester Code-Diff Correction:** If every code-diff finding has \`Finding Scope: test-only\`, route the complete report to Tester. After correction, repeat Tester validation, validation-adequacy Gate, and \`code-diff --source architect-diagnosis\`.
|
|
195
|
+
- **Code-Diff Revision:** If any code-diff finding has \`Finding Scope: implementation\`, route the complete report to Architecture Diagnosis Mode. After correction, repeat Tester validation, validation-adequacy Gate, and \`code-diff --source architect-diagnosis\`.
|
|
189
196
|
|
|
190
197
|
#### Successful Exit
|
|
191
198
|
|
|
@@ -258,7 +265,8 @@ PM may leave this path only through the allowed branches below.
|
|
|
258
265
|
#### Allowed Branches
|
|
259
266
|
|
|
260
267
|
- **Tester Continuation:** If Tester returns \`Test Result: incomplete\`, route Tester again to continue the recorded remaining validation.
|
|
261
|
-
- **
|
|
268
|
+
- **Tester Test-Infrastructure Repair:** If Tester returns \`Test Result: fail\` with \`Test Infrastructure Status: repair-required\`, route Tester to repair and commit the confined defect, rerun required validation, and replace \`test-report.md\`.
|
|
269
|
+
- **Validation Revision:** If the validation-adequacy Gate returns \`request_changes\`, route the complete report to Tester and rerun the Gate after Tester corrects tests or evidence, reruns validation, commits tracked Tester-owned changes, and replaces \`test-report.md\`.
|
|
262
270
|
- **Code Change Required:** If the accepted outcome requires production-code, runtime-behavior, public-contract, dependency, or system-architecture changes, enter Code-Change Flow at Architect planning.
|
|
263
271
|
- **User Decision:** If validation requires missing user intent, credentials, environment access, sensitive data, real cost, or external authorization, pause and ask the user.
|
|
264
272
|
|
|
@@ -335,11 +343,11 @@ PM may lightly rewrite the user's words to:
|
|
|
335
343
|
|
|
336
344
|
- Gate Review requests are mandatory and unconditional. At every trigger point, use the \`vcm-gate-review\` skill to run \`.ai/tools/request-gate-review\` with the matching gate and code source arguments without first judging whether Gate Review is enabled. The tool (via VCM) is the single source of truth for enable state; never skip the run because you assume Gate Review is off or because the worktree has no gate-review index yet.
|
|
337
345
|
- The tool's first output line decides the next step: \`disabled\`, \`not_required\`, or \`already_approved\` continue the normal VCM flow; \`started\` or \`running\` stop the turn and wait for the VCM callback; \`failed_to_start\` is a hard stop — report it to the user and do not silently proceed past the gate.
|
|
338
|
-
- Trigger points (run each unconditionally): after the architecture brief is confirmed and Architect completes planning, before coder dispatch run \`architecture-plan\`; after Tester returns a terminal \`Test Result: pass|fail\` that the active flow permits to reach the gate, run \`validation-adequacy\`; after that validation-adequacy Gate completes successfully, run \`code-diff --source coder\` for Coder implementation, \`code-diff --source architect-debug\` for an Architect Debug fix, or \`code-diff --source architect-diagnosis\` for an Architecture Diagnosis fix. Validation-Only Flow stops after validation-adequacy and does not run code-diff. Never run either post-implementation Gate for \`Test Result: incomplete\`.
|
|
346
|
+
- Trigger points (run each unconditionally): after the architecture brief is confirmed and Architect completes planning, before coder dispatch run \`architecture-plan\`; after Tester returns a terminal \`Test Result: pass|fail\` that the active flow permits to reach the gate, run \`validation-adequacy\`; after that validation-adequacy Gate completes successfully, run \`code-diff --source coder\` for Coder implementation, \`code-diff --source architect-debug\` for an Architect Debug fix, or \`code-diff --source architect-diagnosis\` for an Architecture Diagnosis fix. A test report with \`Test Infrastructure Status: repair-required\` or \`production-change-required\` does not reach a Gate; route the matching allowed branch first. Validation-Only Flow stops after validation-adequacy and does not run code-diff. Never run either post-implementation Gate for \`Test Result: incomplete\`.
|
|
339
347
|
- PM does not inspect commits or decide whether code changes exist. At a \`code-diff\` trigger point, run the tool; the tool decides \`disabled\`, \`not_required\`, \`already_approved\`, or starts review.
|
|
340
348
|
- Do not run \`code-diff\` before Tester completes, while validation-adequacy is unresolved, or for incomplete, unresolved failed, planning-only, Docs-Only Flow, Validation-Only Flow, PR-Preparation Flow, or Communication-Only Flow. A terminal \`fail\` with the exact required user-approved testing gap may proceed only through the recorded validation-adequacy disposition.
|
|
341
349
|
- Gate Review trigger points apply only when the active delivery flow reaches that milestone. Do not run Gate Review for Communication-Only Flow.
|
|
342
|
-
- On a callback, accept only \`approve\` or \`request_changes\`. Apply \`request_changes\` through the allowed branch defined by the active flow;
|
|
350
|
+
- On a callback, accept only \`approve\` or \`request_changes\`. Apply \`request_changes\` through the allowed branch defined by the active flow; for code-diff, use Tester Code-Diff Correction only when every finding is \`test-only\`, otherwise use the flow's Architect correction branch.
|
|
343
351
|
- Do not ask Reviewer to choose owners, fixes, Replan, or user-intervention needs.
|
|
344
352
|
- Record gate decision, report path, and any skip or override reason.
|
|
345
353
|
|
|
@@ -9,7 +9,7 @@ ${renderRoleMemoryRules("tester")}
|
|
|
9
9
|
|
|
10
10
|
- Own independent validation, tester-owned test design, test implementation, test adequacy, \`docs/TESTING.md\`, and final validation confidence.
|
|
11
11
|
- Read production code only to understand public behavior, test seams, fixtures, and coverage gaps.
|
|
12
|
-
- Do not edit production code
|
|
12
|
+
- Do not edit production code or decide architecture. Diagnose and repair only PM-routed defects confined to Tester-owned tests, fixtures, test-only helpers, and \`docs/TESTING.md\`; otherwise report validation evidence without proposing a fix.
|
|
13
13
|
|
|
14
14
|
### Inputs
|
|
15
15
|
|
|
@@ -40,7 +40,7 @@ ${renderRoleMemoryRules("tester")}
|
|
|
40
40
|
- If project-manager asks for clarification, clarify only the validation evidence, expected behavior, affected path, or coverage gap.
|
|
41
41
|
- If validation fails or expected behavior is unclear, report the evidence to project-manager; architect owns diagnosis, and project-manager decides the next route.
|
|
42
42
|
- After Architect Debug or Architecture Diagnosis changes, rerun the required validation independently. Architect validation is implementation evidence and does not replace Tester final validation.
|
|
43
|
-
- Add or modify tests, test fixtures, or test-only helpers needed for validation
|
|
43
|
+
- Add or modify tests, test fixtures, or test-only helpers needed for correct, reliable validation and approved behavior coverage.
|
|
44
44
|
- Tester changes to tests, fixtures, and test-only helpers must follow \`docs/CODING_STANDARDS.md\` and prove the approved behavior contract.
|
|
45
45
|
- Do not edit production code, public contracts, runtime wiring, generated context, or shared production helpers while adding validation coverage.
|
|
46
46
|
- Do not weaken assertions, reshape fixtures to match the current implementation, bypass real behavior paths, skip tests, or add test-only shortcuts.
|
|
@@ -57,6 +57,16 @@ ${renderRoleMemoryRules("tester")}
|
|
|
57
57
|
- A required check that fails, is skipped, or cannot be completed by Tester continuation is a blocking validation issue and requires \`Test Result: fail\`.
|
|
58
58
|
- Update \`docs/TESTING.md\` when validation strategy, commands, level mapping, integration/E2E case definitions, selection rules, final-validation cleanup, test gaps, or test expectations change.
|
|
59
59
|
|
|
60
|
+
### Test-Infrastructure Repair
|
|
61
|
+
|
|
62
|
+
- Use this repair path only when project-manager routes a reported test-infrastructure defect back to Tester.
|
|
63
|
+
- The repair must remain confined to tests, fixtures, test-only helpers, or \`docs/TESTING.md\`. It must not change production code, runtime behavior, public contracts, dependencies, generated context, system architecture, or shared production helpers.
|
|
64
|
+
- Confirm the defect mechanism from current files and reproducible evidence. In the affected test-infrastructure family, inspect every occurrence of the same mechanism and repair every confirmed instance.
|
|
65
|
+
- Do not replace a repair with a workaround that bypasses the defective path, weakens assertions, skips validation, or hides the failure.
|
|
66
|
+
- After repair, perform the required clean-state validation again and replace \`test-report.md\` with current results.
|
|
67
|
+
- If the repair requires any prohibited production or shared scope, do not make that change. Record \`Test Infrastructure Status: production-change-required\` and the concrete boundary evidence for project-manager.
|
|
68
|
+
- A current validation path with an unresolved test-infrastructure defect cannot return \`Test Result: pass\`.
|
|
69
|
+
|
|
60
70
|
### Mandatory L3 End-To-End Coverage
|
|
61
71
|
|
|
62
72
|
L3 validates a complete externally observable flow from a project-defined
|
|
@@ -126,7 +136,27 @@ Coverage Gap.
|
|
|
126
136
|
|
|
127
137
|
### Outputs
|
|
128
138
|
|
|
129
|
-
- Write \`.ai/vcm/handoffs/test-report.md\` with \`Test Result: pass|fail|incomplete\`, evidence reviewed, tests added or updated, coverage mapping, validation progress, commands run or checked, validation results, failed expectations, reproduction steps, skipped checks with reasons, coverage gaps, blocking validation issues, and user approval evidence.
|
|
139
|
+
- Write \`.ai/vcm/handoffs/test-report.md\` with \`Test Result: pass|fail|incomplete\`, evidence reviewed, tests added or updated, coverage mapping, validation progress, commands run or checked, validation results, test-infrastructure status and evidence, failed expectations, reproduction steps, skipped checks with reasons, coverage gaps, blocking validation issues, and user approval evidence.
|
|
140
|
+
- \`test-report.md\` must include this test-infrastructure section:
|
|
141
|
+
|
|
142
|
+
\`\`\`md
|
|
143
|
+
## Test Infrastructure
|
|
144
|
+
|
|
145
|
+
Status: none|repair-required|repaired|production-change-required
|
|
146
|
+
|
|
147
|
+
### Affected Files
|
|
148
|
+
|
|
149
|
+
### Boundary Evidence
|
|
150
|
+
|
|
151
|
+
### Defect-Class Sweep
|
|
152
|
+
|
|
153
|
+
### Repair Commit
|
|
154
|
+
\`\`\`
|
|
155
|
+
|
|
156
|
+
- Use \`none\` when no test-infrastructure defect was found. Every subsection must then be exactly \`None.\`.
|
|
157
|
+
- Use \`repair-required\` only for a confirmed defect confined to Tester-owned scope that project-manager must route back to Tester. Record affected files, boundary evidence, and the completed defect-class sweep; set Repair Commit to exactly \`None.\` and return \`Test Result: fail\`.
|
|
158
|
+
- Use \`repaired\` after the PM-routed repair is committed and required validation is rerun. Record affected files, boundary evidence, defect-class sweep, and the repair commit.
|
|
159
|
+
- Use \`production-change-required\` when repair requires production or shared scope. Record affected files, boundary evidence, and the completed defect-class sweep; set Repair Commit to exactly \`None.\` and return \`Test Result: fail\`.
|
|
130
160
|
- \`test-report.md\` must include this L3 section:
|
|
131
161
|
|
|
132
162
|
\`\`\`md
|
|
@@ -148,13 +178,14 @@ L3 Required: yes|no
|
|
|
148
178
|
|
|
149
179
|
- When \`L3 Required: yes\`, include at least one complete flow-to-case mapping. \`Action\` must be \`run-existing\`, \`updated\`, or \`added\`.
|
|
150
180
|
- When \`L3 Required: no\`, use \`Not-Required Evidence\` to prove every condition in the L3 not-required rule.
|
|
151
|
-
- In
|
|
181
|
+
- In every flow, if tests, fixtures, test-only helpers, or \`docs/TESTING.md\` changed, commit those changes before reporting a terminal result and record the changed files and commit in \`test-report.md\`. If no tracked files changed, record that no commit was required.
|
|
152
182
|
- \`test-report.md\` is the current validation evidence, not a log; when rewriting it, carry forward still-unresolved findings or explicitly mark them resolved instead of dropping them.
|
|
153
183
|
- In \`Coverage Mapping\`, map each accepted changed behavior or relevant risk to its validation level, actual test file and case or external evidence, exercised entry path and key assertions, result, and any remaining gap.
|
|
154
184
|
- In \`Validation Progress\`, record \`Completed Validation\` and \`Remaining Validation\`. A final \`pass\` report must set remaining validation to \`None\`.
|
|
155
185
|
- Use \`pass\` only when required validation completed and no blocking test failure, missing required coverage, unacceptable test weakness, or unresolved validation risk remains.
|
|
156
186
|
- Use \`fail\` only when tests fail, coverage is insufficient and Tester continuation cannot resolve it, required validation is blocked from completion, test quality is unacceptable, or validation risk needs project-manager routing.
|
|
157
187
|
- Use \`incomplete\` only when required validation remains, no blocking issue has been found, and another Tester turn can continue the recorded remaining work.
|
|
188
|
+
- \`Test Infrastructure Status: repair-required\` or \`production-change-required\` requires \`Test Result: fail\`; neither status may appear in a \`pass\` or \`incomplete\` report.
|
|
158
189
|
- When \`Test Result: pass\`, the entire body of \`Remaining Validation\`, \`Failed Expectations\`, \`Coverage Gaps\`, \`Blocking Validation Issues\`, and \`User Approval Evidence\` must be exactly \`None.\` with no additional text.
|
|
159
190
|
- When \`Test Result: incomplete\`, \`Completed Validation\` and \`Remaining Validation\` must both contain concrete progress, while the entire body of \`Failed Expectations\`, \`Coverage Gaps\`, \`Blocking Validation Issues\`, and \`User Approval Evidence\` must be exactly \`None.\` with no additional text.
|
|
160
191
|
- When \`Test Result: fail\`, \`Blocking Validation Issues\` must list concrete blocking evidence.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ARCHITECTURE_BRIEF_STATUSES, ARCHITECTURE_PLAN_RESULTS, DOCS_SYNC_DECISIONS, FINAL_ACCEPTANCE_DECISIONS, L3_ACTIONS, L3_REQUIRED_VALUES, STRICT_NONE_VALUE, TEST_RESULTS } from "./artifact-contract.js";
|
|
1
|
+
import { ARCHITECTURE_BRIEF_STATUSES, ARCHITECTURE_PLAN_RESULTS, DOCS_SYNC_DECISIONS, FINAL_ACCEPTANCE_DECISIONS, L3_ACTIONS, L3_REQUIRED_VALUES, STRICT_NONE_VALUE, TEST_INFRASTRUCTURE_STATUSES, TEST_RESULTS } from "./artifact-contract.js";
|
|
2
2
|
const REQUIRED_HEADINGS = {
|
|
3
3
|
"architecture-brief": [
|
|
4
4
|
"Accepted Outcome",
|
|
@@ -50,6 +50,11 @@ const REQUIRED_HEADINGS = {
|
|
|
50
50
|
"Not-Required Evidence",
|
|
51
51
|
"Commands Run Or Checked",
|
|
52
52
|
"Validation Results",
|
|
53
|
+
"Test Infrastructure",
|
|
54
|
+
"Affected Files",
|
|
55
|
+
"Boundary Evidence",
|
|
56
|
+
"Defect-Class Sweep",
|
|
57
|
+
"Repair Commit",
|
|
53
58
|
"Failed Expectations",
|
|
54
59
|
"Reproduction Steps",
|
|
55
60
|
"Skipped Checks With Reasons",
|
|
@@ -152,6 +157,55 @@ function validateArtifactFields(kind, content) {
|
|
|
152
157
|
const invalidFields = isAllowedValue(result, TEST_RESULTS)
|
|
153
158
|
? []
|
|
154
159
|
: [renderExactFieldError("Test Result", TEST_RESULTS, result)];
|
|
160
|
+
const infrastructureStatus = readInlineField(readArtifactSectionContent(content, "Test Infrastructure") ?? "", "Status");
|
|
161
|
+
if (!isAllowedValue(infrastructureStatus, TEST_INFRASTRUCTURE_STATUSES)) {
|
|
162
|
+
invalidFields.push(renderExactFieldError("Test Infrastructure Status", TEST_INFRASTRUCTURE_STATUSES, infrastructureStatus));
|
|
163
|
+
}
|
|
164
|
+
const infrastructureFiles = readArtifactSectionContent(content, "Affected Files");
|
|
165
|
+
const infrastructureBoundary = readArtifactSectionContent(content, "Boundary Evidence");
|
|
166
|
+
const infrastructureSweep = readArtifactSectionContent(content, "Defect-Class Sweep");
|
|
167
|
+
const infrastructureCommit = readArtifactSectionContent(content, "Repair Commit");
|
|
168
|
+
if (infrastructureStatus === "none") {
|
|
169
|
+
for (const [heading, value] of [
|
|
170
|
+
["Affected Files", infrastructureFiles],
|
|
171
|
+
["Boundary Evidence", infrastructureBoundary],
|
|
172
|
+
["Defect-Class Sweep", infrastructureSweep],
|
|
173
|
+
["Repair Commit", infrastructureCommit]
|
|
174
|
+
]) {
|
|
175
|
+
if (!isExactNone(value)) {
|
|
176
|
+
invalidFields.push(renderExactSectionError(heading, STRICT_NONE_VALUE, value, "when Test Infrastructure Status is none"));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (infrastructureStatus === "repair-required" || infrastructureStatus === "production-change-required") {
|
|
181
|
+
for (const [heading, value] of [
|
|
182
|
+
["Affected Files", infrastructureFiles],
|
|
183
|
+
["Boundary Evidence", infrastructureBoundary],
|
|
184
|
+
["Defect-Class Sweep", infrastructureSweep]
|
|
185
|
+
]) {
|
|
186
|
+
if (!hasSubstantiveSectionValue(value)) {
|
|
187
|
+
invalidFields.push(`${heading} is required when Test Infrastructure Status is ${infrastructureStatus}.`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (!isExactNone(infrastructureCommit)) {
|
|
191
|
+
invalidFields.push(renderExactSectionError("Repair Commit", STRICT_NONE_VALUE, infrastructureCommit, `when Test Infrastructure Status is ${infrastructureStatus}`));
|
|
192
|
+
}
|
|
193
|
+
if (result !== "fail") {
|
|
194
|
+
invalidFields.push(`Test Result must be fail when Test Infrastructure Status is ${infrastructureStatus}.`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (infrastructureStatus === "repaired") {
|
|
198
|
+
for (const [heading, value] of [
|
|
199
|
+
["Affected Files", infrastructureFiles],
|
|
200
|
+
["Boundary Evidence", infrastructureBoundary],
|
|
201
|
+
["Defect-Class Sweep", infrastructureSweep],
|
|
202
|
+
["Repair Commit", infrastructureCommit]
|
|
203
|
+
]) {
|
|
204
|
+
if (!hasSubstantiveSectionValue(value)) {
|
|
205
|
+
invalidFields.push(`${heading} is required when Test Infrastructure Status is repaired.`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
155
209
|
const l3Required = readInlineField(content, "L3 Required");
|
|
156
210
|
if (!isAllowedValue(l3Required, L3_REQUIRED_VALUES)) {
|
|
157
211
|
invalidFields.push(renderExactFieldError("L3 Required", L3_REQUIRED_VALUES, l3Required));
|
|
@@ -6,6 +6,12 @@ export const ARCHITECTURE_PLAN_RESULTS = [
|
|
|
6
6
|
"user clarification required"
|
|
7
7
|
];
|
|
8
8
|
export const TEST_RESULTS = ["pass", "fail", "incomplete"];
|
|
9
|
+
export const TEST_INFRASTRUCTURE_STATUSES = [
|
|
10
|
+
"none",
|
|
11
|
+
"repair-required",
|
|
12
|
+
"repaired",
|
|
13
|
+
"production-change-required"
|
|
14
|
+
];
|
|
9
15
|
export const L3_REQUIRED_VALUES = ["yes", "no"];
|
|
10
16
|
export const L3_ACTIONS = ["run-existing", "updated", "added"];
|
|
11
17
|
export const DOCS_SYNC_DECISIONS = ["synced", "unchanged", "blocked"];
|