vibe-coding-master 0.7.50 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/backend/adapters/filesystem.js +6 -0
  2. package/dist/backend/api/task-routes.js +20 -1
  3. package/dist/backend/server.js +4 -2
  4. package/dist/backend/services/auto-memory-service.js +79 -28
  5. package/dist/backend/services/claude-hook-service.js +5 -3
  6. package/dist/backend/services/gate-review-service.js +21 -2
  7. package/dist/backend/services/harness-feedback-service.js +53 -15
  8. package/dist/backend/services/message-service.js +10 -0
  9. package/dist/backend/services/runtime-recovery-service.js +9 -0
  10. package/dist/backend/services/translation-service.js +74 -3
  11. package/dist/backend/services/workflow-control-service.js +436 -75
  12. package/dist/backend/templates/handoff.js +14 -2
  13. package/dist/backend/templates/harness/architect-agent.js +6 -5
  14. package/dist/backend/templates/harness/architect-evidence-worker-agent.js +2 -0
  15. package/dist/backend/templates/harness/architect-validation-worker-agent.js +1 -1
  16. package/dist/backend/templates/harness/claude-root.js +3 -3
  17. package/dist/backend/templates/harness/coder-agent.js +1 -0
  18. package/dist/backend/templates/harness/harness-engineer-agent.js +14 -11
  19. package/dist/backend/templates/harness/project-manager-agent.js +5 -1
  20. package/dist/backend/templates/harness/tester-agent.js +6 -0
  21. package/dist/backend/templates/harness/vcm-workflow-review-skill.js +17 -1
  22. package/dist/shared/validation/artifact-check.js +36 -3
  23. package/dist/shared/validation/artifact-contract.js +7 -0
  24. package/dist/shared/validation/artifact-registry.js +4 -1
  25. package/dist-frontend/assets/{index-DLsIPTvK.js → index-Dh7uVCmk.js} +1 -1
  26. package/dist-frontend/index.html +1 -1
  27. package/package.json +1 -1
  28. package/scripts/harness-tools/vcm-bash-guard +245 -21
@@ -1,4 +1,4 @@
1
- import { ARCHITECT_DEBUG_STATUSES, ARCHITECTURE_BRIEF_STATUSES, ARCHITECTURE_DIAGNOSIS_DISPOSITIONS, ARCHITECTURE_EVIDENCE_STATUSES, ARCHITECTURE_PLAN_RESULTS, CODER_COMPLETION_DECISIONS, DOCS_REPORT_DECISIONS, FINAL_ACCEPTANCE_DECISIONS, L3_ACTIONS, L3_REQUIRED_VALUES, PLANNING_PROGRESS_STATUSES, STRICT_NONE_VALUE, TEST_INFRASTRUCTURE_STATUSES, TEST_RESULTS, renderArtifactOptions } from "../../shared/validation/artifact-contract.js";
1
+ import { ARCHITECT_DEBUG_DISPOSITIONS, ARCHITECT_DEBUG_STATUSES, ARCHITECTURE_BRIEF_STATUSES, ARCHITECTURE_DIAGNOSIS_DISPOSITIONS, ARCHITECTURE_EVIDENCE_STATUSES, ARCHITECTURE_PLAN_RESULTS, CODER_COMPLETION_DECISIONS, DOCS_REPORT_DECISIONS, DOCS_SYNC_CORRECTION_OWNERS, FINAL_ACCEPTANCE_DECISIONS, L3_ACTIONS, L3_REQUIRED_VALUES, PLANNING_PROGRESS_STATUSES, STRICT_NONE_VALUE, TEST_INFRASTRUCTURE_STATUSES, TEST_RESULTS, renderArtifactOptions } from "../../shared/validation/artifact-contract.js";
2
2
  const CURRENT_HANDOFF_NOTICE = "<!-- VCM current handoff: replace this file with one complete, self-contained snapshot of the current result. Restate all still-relevant evidence; do not refer to a prior revision, route message, Session, or transcript as evidence. -->";
3
3
  export function renderArchitectureBriefTemplate(taskSlug) {
4
4
  return `# Architecture Brief: ${taskSlug}
@@ -409,7 +409,7 @@ TBD
409
409
 
410
410
  ## Final Disposition
411
411
 
412
- TBD
412
+ ${renderArtifactOptions(ARCHITECT_DEBUG_DISPOSITIONS)}
413
413
  `;
414
414
  }
415
415
  export function renderArchitectureDiagnosisTemplate(taskSlug) {
@@ -516,6 +516,14 @@ TBD
516
516
 
517
517
  TBD
518
518
 
519
+ ## Correction Owner
520
+
521
+ ${renderArtifactOptions(DOCS_SYNC_CORRECTION_OWNERS)}
522
+
523
+ ## Correction Evidence
524
+
525
+ ${STRICT_NONE_VALUE}
526
+
519
527
  ## Decision
520
528
 
521
529
  ${renderArtifactOptions(DOCS_REPORT_DECISIONS)}
@@ -584,6 +592,10 @@ Evidence: none
584
592
 
585
593
  Authorization Text: none
586
594
  Violated Rule: none
595
+
596
+ ## User-Approved Follow-Up
597
+
598
+ Approval Text: none
587
599
  `;
588
600
  }
589
601
  export function renderFinalAcceptanceTemplate(taskSlug) {
@@ -42,13 +42,14 @@ ${renderRoleMemoryRules("architect")}
42
42
 
43
43
  - Architect may invoke only \`vcm-architect-evidence-worker\`, \`vcm-architect-scaffold-worker\`, and \`vcm-architect-validation-worker\`.
44
44
  - Every worker must run in the foreground and return before the current Architect turn continues. Do not run workers in the background or end the turn while a worker is active.
45
- - Give each worker an exact bounded assignment, repo-relative paths, questions or commands, and one report path. Pass paths instead of copying full source, documents, or plans into the worker prompt.
45
+ - Give each worker an exact bounded assignment, repo-relative paths, and one report path. Pass paths instead of copying full source, documents, or plans into the worker prompt.
46
46
  - Worker output is evidence or execution output, never an architecture decision. Architect owns every conclusion, plan, change boundary, validation interpretation, and final claim.
47
47
  - Use \`vcm-architect-evidence-worker\` for bounded bulk reading when relevant evidence spans multiple files or modules. Evidence workers may run in parallel only when their read scopes are disjoint.
48
+ - Give evidence workers only repo-relative paths, symbols, documents, and questions. They have no shell access.
48
49
  - Evidence workers write reports under \`.ai/vcm/architect-workers/evidence/\`. Architect must review every report, verify decision-bearing claims against current code, and consolidate accepted facts into \`architecture-evidence.md\`.
49
50
  - In Planning Code Reading, supporting non-decision-bearing read requirements may be satisfied by an accepted evidence-worker report; requirements that say Architect must personally read or verify may not.
50
51
  - Use \`vcm-architect-scaffold-worker\` after the plan and Scaffold Manifest are complete for exact scaffold execution and mechanical text or configuration changes already fixed by the plan.
51
- - Use \`vcm-architect-validation-worker\` for exact non-interactive commands already selected by Architect. The worker does not select validation scope, modify tests or code, diagnose failures, or decide whether validation is sufficient.
52
+ - Use \`vcm-architect-validation-worker\` for every assignment that requires a shell command, including read-only repository inspection commands. The worker runs only exact non-interactive commands already selected by Architect and does not select validation scope, modify tests or code, diagnose failures, or decide whether validation is sufficient.
52
53
  - Do not rerun a green command already reported by another Architect worker merely to execute it in the main Architect context.
53
54
  - Validation workers write reports under \`.ai/vcm/architect-workers/validation/\`. Architect must interpret the raw results and copy required evidence into the owning Architect artifact.
54
55
 
@@ -352,16 +353,16 @@ Each rewritten \`architecture-diagnosis.md\` must be a complete, self-contained
352
353
 
353
354
  - Compare every durable fact changed by the task across architecture docs, active plans, testing docs, known issues, code, and generated context. Resolve contradictions before reporting \`synced\`.
354
355
  - Verify names, ownership, dependency direction, lifecycle, public contracts, validation commands, current gaps, and active-plan status against their owning source.
355
- - Do not edit tester-owned \`docs/TESTING.md\` during post-validation docs sync. If it contradicts accepted code, generated context, or other durable docs, report the exact conflict to project-manager for Tester correction.
356
+ - Do not edit tester-owned \`docs/TESTING.md\` during post-validation docs sync. If it contradicts accepted code, generated context, or other durable docs, return \`Decision: blocked\`, \`Correction Owner: tester\`, and the exact conflict as Correction Evidence.
356
357
  - Run \`.ai/tools/check-durable-docs\` after durable-doc changes. A failing audit prevents \`Decision: synced\`; fix Architect-owned findings and report Tester-owned findings for routing.
357
358
 
358
359
  #### Docs Sync Report
359
360
 
360
361
  - Write \`.ai/vcm/handoffs/docs-sync-report.md\` for post-validation docs sync in Code-Change Flow, Architect Debug Flow, or a code-producing Architecture Diagnosis Flow. Do not write it for Docs-Only Flow or a Debug/Diagnosis Branch.
361
362
  - In Docs-Only Flow, submit the complete \`.ai/vcm/handoffs/docs-update-report.md\` before returning to PM. It must record the decision, changed and reviewed documents, evidence reviewed, checks performed, commit, and remaining documentation issues.
362
- - The report records decision, evidence reviewed, current-truth reconciliation, generated-context freshness, cross-document consistency, architecture docs, active plans, testing-doc consistency, known-issues disposition, durable-doc audit command and result, docs updated, docs left unchanged, remaining documentation risks, and handoff notes.
363
+ - The report records decision, evidence reviewed, current-truth reconciliation, generated-context freshness, cross-document consistency, architecture docs, active plans, testing-doc consistency, known-issues disposition, durable-doc audit command and result, docs updated, docs left unchanged, remaining documentation risks, correction owner/evidence, and handoff notes.
363
364
  - Each rewritten \`docs-sync-report.md\` must be a complete, self-contained snapshot of the current docs-sync result and must not rely on a prior report revision.
364
- - \`Decision\` must be \`synced\`, \`unchanged\`, or \`blocked\`.
365
+ - \`Decision: synced\` or \`unchanged\` requires \`Correction Owner: none\` and \`Correction Evidence: None.\`. \`Decision: blocked\` requires exactly one \`Correction Owner: architect|coder|tester\` and concrete Correction Evidence.
365
366
 
366
367
  ### Background Jobs
367
368
 
@@ -7,11 +7,13 @@ You are \`vcm-architect-evidence-worker\`, a foreground evidence-collection suba
7
7
  ### Scope
8
8
 
9
9
  - Investigate only the modules, files, documents, and questions assigned by Architect.
10
+ - You have no shell access. Accept only assignments expressed as repo-relative paths, symbols, documents, and questions.
10
11
  - Read the assigned implementation and supporting project artifacts in full where required by the assignment.
11
12
  - Record repository facts with exact repo-relative file paths and symbol or section names.
12
13
  - Separate verified facts, contradictions, and unresolved items.
13
14
  - Do not design architecture, recommend implementation, decide scope, change contracts, edit project files, run validation, or communicate with project-manager or the user.
14
15
  - Do not claim a complete semantic relationship from text matches. Architect owns LSP navigation and verification of definitions, references, callers, callees, implementations, public surfaces, and decision-bearing behavior paths.
16
+ - Do not reconstruct command output. If command output is required, report it as unresolved so Architect can assign it to \`vcm-architect-validation-worker\`.
15
17
 
16
18
  ### Evidence Output
17
19
 
@@ -6,7 +6,7 @@ You are \`vcm-architect-validation-worker\`, a foreground command-execution suba
6
6
 
7
7
  ### Scope
8
8
 
9
- - Run only the exact commands, working directory, and validation targets assigned by Architect.
9
+ - Run only the exact commands, working directory, and assigned targets provided by Architect, including read-only repository inspection commands.
10
10
  - Do not choose validation scope, design or modify tests, edit production code, change configuration, diagnose architecture, repair failures, or decide whether the task passes.
11
11
  - Preserve each command's real exit code and output. Do not add wrappers, pipelines, retries, skips, or fallback commands unless Architect assigned them.
12
12
  - Use \`.ai/tools/run-long-check\` and \`.ai/tools/watch-job\` when the assigned command requires supervised long-running execution. Remain in the foreground until every assigned command reaches a terminal result.
@@ -6,7 +6,7 @@ export function renderRootClaudeHarnessRules() {
6
6
  - \`vcm-route-message\` is the only channel for PM-hub dispatch and reporting among project-manager, architect, coder, and tester. Gate Review and tool-role work use their dedicated VCM skills and controllers. Follow the route skill's write-then-stop rule.
7
7
  - Before every PM dispatch to Architect, Coder, or Tester, project-manager must use \`vcm-workflow-review\`. Only an accepted Workflow Progress transition grants the next route.
8
8
  - \`vcm-task-state\` is recoverable context only. Workflow permission comes only from accepted \`workflow-progress.md\` submissions.
9
- - Use \`vcm-long-running-validation\` for long-running validation. Follow the background job limits below.
9
+ - Workflow roles use \`vcm-long-running-validation\` for long-running validation and follow the background job limits below.
10
10
  - Use \`vcm-report-harness-issue\` when you notice a reusable VCM harness problem. Record feedback; do not contact Harness Engineer directly.
11
11
  - The root \`<VCM-memory>\` block is shared project memory. Treat every \`<VCM-memory>\` block as read-only and use \`vcm-propose-memory\` only when VCM assigns an exact memory proposal or candidate path.
12
12
  - Only the user may approve scope reduction, skipped required validation, Gate Review skip or override, skipped required docs sync, accepted unresolved task-scope risk, or weakening of baseline Harness rules. PM may record and route the user's approval but cannot grant it.
@@ -14,7 +14,7 @@ export function renderRootClaudeHarnessRules() {
14
14
 
15
15
  ## VCM Managed Artifacts
16
16
 
17
- - VCM-managed Markdown under \`.ai/vcm/handoffs/\`, Coder Worker reports, request-scoped Gate Review reports, route messages, memory proposals, and Harness Feedback must be submitted with \`.ai/tools/vcm-artifact\`; never write or edit the authoritative path directly.
17
+ - Workflow roles must submit VCM-managed Markdown under \`.ai/vcm/handoffs/\`, Coder Worker reports, request-scoped Gate Review reports, route messages, memory proposals, and Harness Feedback with \`.ai/tools/vcm-artifact\`; never write or edit the authoritative path directly.
18
18
  - Write the candidate outside \`.ai/vcm/\`, then run \`.ai/tools/vcm-artifact <kind> --file <candidate> --mode <draft|final>\`. Dynamic artifacts also require the exact VCM-assigned \`--path\`.
19
19
  - Use \`draft\` while an allowed lifecycle remains incomplete. Use \`final\` before routing or consuming a terminal artifact. A failed submission leaves the authoritative artifact unchanged; correct every reported violation and submit again.
20
20
  - Do not route, review, or rely on a candidate file. Only the VCM-written authoritative path is workflow evidence.
@@ -27,7 +27,7 @@ If a reusable harness problem is suspected, it is enough to record a concise fee
27
27
 
28
28
  ## VCM Background Jobs
29
29
 
30
- - Never run the Bash tool with \`run_in_background: true\`. Never detach a process with \`nohup\`, \`setsid\`, \`disown\`, or a trailing \`&\`. VCM denies these calls.
30
+ - Workflow roles never run the Bash tool with \`run_in_background: true\` or detach a process with \`nohup\`, \`setsid\`, \`disown\`, or a trailing \`&\`. VCM denies these calls for workflow roles.
31
31
  - The only sanctioned long-running mechanism is the \`vcm-long-running-validation\` skill: \`.ai/tools/run-long-check\` plus \`.ai/tools/watch-job\`. Only one job may run at a time.
32
32
  - The moment a command might run longer than 2 minutes, switch to that skill instead of running the command directly.
33
33
  - While a job is running, stay in the current turn and keep calling \`.ai/tools/watch-job\` until it reports a terminal result; VCM blocks turn-end while a job is running, and a job without a live watcher is killed automatically.
@@ -12,6 +12,7 @@ ${renderRoleMemoryRules("coder")}
12
12
  - Implement assigned file/function-level scaffold items; do not analyze, review, dispute, or redesign architecture, module boundaries, public contracts, dependency direction, durable docs strategy, validation strategy, or final test adequacy.
13
13
  - Treat the architecture plan and scaffold as execution instructions, not review targets. Do not critique, reinterpret, or challenge them during Coder work.
14
14
  - In a PM-routed Docs-Only Flow, update the assigned documentation and related documentation needed for consistency without changing production code or tests.
15
+ - When PM routes a Coder-owned correction from a blocked docs-sync report, update only the assigned documentation, commit it, rerun applicable L0/L1 checks, and replace \`.ai/vcm/handoffs/coder-completion.md\` with current evidence so the delivery flow can return through Tester and both post-implementation Gates.
15
16
 
16
17
  ### Code Navigation
17
18
 
@@ -72,12 +72,13 @@ You are not part of the task workflow round state.
72
72
  - Own VCM-managed project memory in the root and role \`<VCM-memory>\` blocks.
73
73
  - When Auto Memory is disabled, do not request proposals or update memory.
74
74
  - During a Retrospective that includes Auto Memory Review, first inspect every
75
- entry in every current memory snapshot. Verify each entry against current
76
- code, durable documentation, and final task evidence. For every substantive
77
- entry, decide whether to retain, update, remove, or move it to a durable
78
- document; record the decision reason, the impact of removing it, and whether
79
- memory or a durable document is the correct source. Complete this full review
80
- even when every proposal says \`no-change\`.
75
+ entry assigned in the existing-memory entries file. That file is the complete
76
+ decision set: emit exactly one decision for every listed \`itemId\`, copying
77
+ its target and entry exactly. Verify each entry against current code, durable
78
+ documentation, and final task evidence. Decide whether to retain, update,
79
+ remove, or move it to a durable document; record the decision reason, the
80
+ impact of removing it, and whether memory or a durable document is the correct
81
+ source. Complete this full review even when every proposal says \`no-change\`.
81
82
  - After reviewing existing memory, verify every role proposal against task
82
83
  evidence, including any Architect planning-session candidate assigned by VCM.
83
84
  Review every proposal item separately; never accept or reject an entire role
@@ -201,15 +202,17 @@ Issue drafts must include title, problem, reproduction, expected behavior,
201
202
  actual behavior, VCM version when known, affected harness/UI area, impact, and a
202
203
  suggested fix if known.
203
204
 
204
- Before adding a later finding to an issue used in the current conversation,
205
- check that issue's current state.
205
+ Consider an existing issue only when it is already identified in the current
206
+ conversation. Do not search or enumerate the issue tracker to find related or
207
+ duplicate issues.
206
208
 
207
- Do not add actionable work to a closed issue. Create a new issue and reference
208
- the closed issue instead.
209
+ For such a known issue, check its current state before adding a later finding.
210
+ Do not add actionable work to a closed issue; create a new issue and reference
211
+ that known closed issue instead.
209
212
 
210
213
  Add a comment only when the finding updates or corrects the same work. If the
211
214
  finding can be implemented, tested, and closed independently, create a separate
212
- issue and reference the related issue.
215
+ issue and reference the known related issue.
213
216
 
214
217
  Do not submit issues yourself unless the harness owner gives explicit
215
218
  in-session authorization. Do not include private source code, secrets, private
@@ -103,8 +103,9 @@ PM may leave this path only through the allowed branches below.
103
103
  - **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.
104
104
  - **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.
105
105
  - **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\`.
106
+ - **User-Approved Post-Validation Work:** After Tester returns \`pass\` and both post-implementation Gates succeed, route Tester again only when the user explicitly approves additional Tester-owned work in the current task. Submit the user's exact approval through \`User-Approved Follow-Up\`, not Workflow Override. After Tester completes and commits the work, repeat Tester validation, validation-adequacy Gate, and \`code-diff --source coder\`.
106
107
  - **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.
107
- - **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.
108
+ - **Docs Sync Correction:** \`Decision: synced\` or \`unchanged\` continues to Final Acceptance only with \`Correction Owner: none\`. For \`Decision: blocked\`, route the exact \`Correction Owner\`: Architect repeats docs sync; Coder corrects Coder-owned documentation and returns through Tester and both post-implementation Gates; Tester corrects Tester-owned tests or \`docs/TESTING.md\`, reruns validation, and returns through both Gates. Then rerun Architect docs sync.
108
109
  - **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.
109
110
  - **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.
110
111
  - **Gate Runtime:** \`started\` or \`running\` waits for the VCM callback. \`failed_to_start\` stops the flow for VCM retry, skip, or override handling. Other successful tool results continue according to the main flow.
@@ -165,6 +166,7 @@ The shared path is:
165
166
  - **Architecture Diagnosis:** If Tester returns \`Test Result: fail\` with \`Test Infrastructure Status: none\`, \`repaired\`, or \`production-change-required\`, enter Architecture Diagnosis Branch.
166
167
  - **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.
167
168
  - **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\`.
169
+ - **User-Approved Post-Validation Work:** After Tester returns \`pass\` and both Gates succeed, the user may explicitly approve additional Tester-owned work. Route Tester with the exact \`User-Approved Follow-Up\` approval, then repeat Tester validation and both Gates.
168
170
  - **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\`.
169
171
 
170
172
  #### Successful Exit
@@ -198,6 +200,7 @@ Architecture Diagnosis Mode must run before another Debug Mode fix or Coder disp
198
200
  - **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.
199
201
  - **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.
200
202
  - **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\`.
203
+ - **User-Approved Post-Validation Work:** After Tester returns \`pass\` and both Gates succeed, the user may explicitly approve additional Tester-owned work. Route Tester with the exact \`User-Approved Follow-Up\` approval, then repeat Tester validation and both Gates.
201
204
  - **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\`.
202
205
 
203
206
  #### Successful Exit
@@ -370,6 +373,7 @@ PM may lightly rewrite the user's words to:
370
373
  - Use the \`vcm-final-acceptance\` skill only to close a complete code-delivery flow, including Architect Debug Flow or an Architecture Diagnosis Flow that produced code changes.
371
374
  - Do not run Final Acceptance for Docs-Only Flow, Validation-Only Flow, Communication-Only Flow, PR-Preparation Flow, analysis-only Diagnosis, Architect Debug Branch, or Architecture Diagnosis Branch.
372
375
  - Start final acceptance only after Tester, required Gate Reviews, and required docs-sync gates pass, or explicit user approval is recorded for each exact exception. Gate Review skip or override is valid only when recorded by VCM from the user's action.
376
+ - In any complete delivery flow, a blocked docs-sync report routes its exact Correction Owner before Final Acceptance; after that owner completes the correction, repeat every invalidated validation, Gate, and docs-sync step.
373
377
  - Confirm applicable evidence exists: architecture plan or architecture diagnosis when required, test result, required Gate Review decisions, docs-sync decision when required, unresolved risks, known-issues disposition, and cleanup status.
374
378
  - Check evidence presence, ownership, currency, and explicit result only; do not judge technical design quality, code quality, test adequacy, or documentation correctness during final acceptance.
375
379
  - In Code-Change Flow, handle every non-accepted decision through Final Acceptance Follow-Up. In another eligible flow, route missing evidence, unresolved risk, or required user approval to the responsible role or user before closing the task.
@@ -71,6 +71,12 @@ ${renderRoleMemoryRules("tester")}
71
71
  - A required check that fails, is skipped, or cannot be completed by Tester continuation is a blocking validation issue and requires \`Test Result: fail\`.
72
72
  - 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.
73
73
 
74
+ ### User-Approved Post-Validation Work
75
+
76
+ - Use this path only when project-manager routes the user's exact approval after a passing Test Report and successful validation-adequacy and code-diff Gates.
77
+ - Complete only the approved Tester-owned tests, fixtures, test-only helpers, scripts, or \`docs/TESTING.md\` work; do not reinterpret the approval as production scope.
78
+ - Commit the work, rerun all affected validation, and replace \`test-report.md\` with the current complete result. The prior passing report and Gate decisions are no longer current evidence.
79
+
74
80
  ### Test-Infrastructure Repair
75
81
 
76
82
  - Use this repair path only when project-manager routes a reported test-infrastructure defect back to Tester.
@@ -28,6 +28,10 @@ Evidence: <current artifact, Gate result, or user request supporting this dispat
28
28
 
29
29
  Authorization Text: none
30
30
  Violated Rule: none
31
+
32
+ ## User-Approved Follow-Up
33
+
34
+ Approval Text: none
31
35
  \`\`\`
32
36
 
33
37
  Use \`Requested Flow\` only to start a flow, switch a top-level flow, enter or replace a Branch, or return from a Branch. Otherwise use \`none\`.
@@ -53,8 +57,20 @@ Violated Rule: <copy the exact VCM rejection reason>
53
57
 
54
58
  VCM binds that authorization to this exact task state, flow, target role, evidence, and violated rule. It applies once and is consumed by the matching dispatch. Do not infer, broaden, or reuse authorization.
55
59
 
60
+ ## User-Approved Post-Validation Work
61
+
62
+ When Tester has returned \`pass\`, validation-adequacy and code-diff are both successful, and the user explicitly approves additional Tester-owned work in the current task, propose Tester again with:
63
+
64
+ \`\`\`text
65
+ Authorization Text: none
66
+ Violated Rule: none
67
+ Approval Text: <user's exact approval>
68
+ \`\`\`
69
+
70
+ This is a normal one-time follow-up approval, not a Workflow Override. Do not use it before both Gates are successful, for required unresolved coverage, for another owner, or without the user's exact approval. After Tester completes the approved work, rerun Tester validation and every invalidated Gate.
71
+
56
72
  ## Completion
57
73
 
58
- When the active flow has completed without another role dispatch, increment Revision, copy the confirmed history exactly, set \`Status: completed\`, and set every Proposed Dispatch and User Authorization value to \`none\`. VCM accepts completion only when the flow's required final artifact and Gate evidence exists.
74
+ When the active flow has completed without another role dispatch, increment Revision, copy the confirmed history exactly, set \`Status: completed\`, and set every Proposed Dispatch, User Authorization, and User-Approved Follow-Up value to \`none\`. VCM accepts completion only when the flow's required final artifact and Gate evidence exists.
59
75
  `;
60
76
  }
@@ -1,4 +1,4 @@
1
- import { ARCHITECT_DEBUG_STATUSES, ARCHITECTURE_BRIEF_STATUSES, ARCHITECTURE_DIAGNOSIS_DISPOSITIONS, ARCHITECTURE_EVIDENCE_STATUSES, ARCHITECTURE_PLAN_RESULTS, CODER_COMPLETION_DECISIONS, DOCS_REPORT_DECISIONS, FINAL_ACCEPTANCE_DECISIONS, L3_ACTIONS, L3_REQUIRED_VALUES, PLANNING_PROGRESS_STATUSES, STRICT_NONE_VALUE, TEST_INFRASTRUCTURE_STATUSES, TEST_RESULTS } from "./artifact-contract.js";
1
+ import { ARCHITECT_DEBUG_DISPOSITIONS, ARCHITECT_DEBUG_STATUSES, ARCHITECTURE_BRIEF_STATUSES, ARCHITECTURE_DIAGNOSIS_DISPOSITIONS, ARCHITECTURE_EVIDENCE_STATUSES, ARCHITECTURE_PLAN_RESULTS, CODER_COMPLETION_DECISIONS, DOCS_REPORT_DECISIONS, DOCS_SYNC_CORRECTION_OWNERS, FINAL_ACCEPTANCE_DECISIONS, L3_ACTIONS, L3_REQUIRED_VALUES, PLANNING_PROGRESS_STATUSES, STRICT_NONE_VALUE, TEST_INFRASTRUCTURE_STATUSES, TEST_RESULTS } from "./artifact-contract.js";
2
2
  import { getArtifactDefinition } from "./artifact-registry.js";
3
3
  const PLACEHOLDER_PATTERN = /(^|\n)\s*(TBD|Not run yet\.?|status:\s*draft)\s*(\n|$)/i;
4
4
  export function checkMarkdownArtifact(kind, artifactPath, content, options = {}) {
@@ -94,7 +94,14 @@ function validateArtifactFields(kind, content, mode) {
94
94
  return [];
95
95
  }
96
96
  if (kind === "architect-debug") {
97
- return validateLifecycleField(content, "Status", ARCHITECT_DEBUG_STATUSES, "completed", mode);
97
+ const invalidFields = validateLifecycleField(content, "Status", ARCHITECT_DEBUG_STATUSES, "completed", mode);
98
+ if (mode === "final") {
99
+ const disposition = readArtifactSectionContent(content, "Final Disposition")?.trim().toLowerCase();
100
+ if (!isAllowedValue(disposition, ARCHITECT_DEBUG_DISPOSITIONS)) {
101
+ invalidFields.push(renderExactSectionError("Final Disposition", ARCHITECT_DEBUG_DISPOSITIONS.join("|"), disposition));
102
+ }
103
+ }
104
+ return invalidFields;
98
105
  }
99
106
  if (kind === "architecture-diagnosis") {
100
107
  const disposition = readArtifactSectionContent(content, "Final Disposition")?.trim().toLowerCase();
@@ -244,9 +251,35 @@ function validateArtifactFields(kind, content, mode) {
244
251
  }
245
252
  return invalidFields;
246
253
  }
247
- if (kind === "docs-update-report" || kind === "docs-sync-report") {
254
+ if (kind === "docs-update-report") {
248
255
  return validateDecision(content, DOCS_REPORT_DECISIONS);
249
256
  }
257
+ if (kind === "docs-sync-report") {
258
+ const invalidFields = validateDecision(content, DOCS_REPORT_DECISIONS);
259
+ const decision = readArtifactSectionContent(content, "Decision")?.trim().toLowerCase();
260
+ const owner = readArtifactSectionContent(content, "Correction Owner")?.trim().toLowerCase();
261
+ const evidence = readArtifactSectionContent(content, "Correction Evidence");
262
+ if (!isAllowedValue(owner, DOCS_SYNC_CORRECTION_OWNERS)) {
263
+ invalidFields.push(renderExactSectionError("Correction Owner", DOCS_SYNC_CORRECTION_OWNERS.join("|"), owner));
264
+ }
265
+ if (decision === "synced" || decision === "unchanged") {
266
+ if (owner !== "none") {
267
+ invalidFields.push(renderExactSectionError("Correction Owner", "none", owner, `when Decision is ${decision}`));
268
+ }
269
+ if (!isExactNone(evidence)) {
270
+ invalidFields.push(renderExactSectionError("Correction Evidence", STRICT_NONE_VALUE, evidence, `when Decision is ${decision}`));
271
+ }
272
+ }
273
+ if (decision === "blocked") {
274
+ if (!owner || owner === "none") {
275
+ invalidFields.push("Correction Owner must be architect, coder, or tester when Decision is blocked.");
276
+ }
277
+ if (!hasSubstantiveSectionValue(evidence)) {
278
+ invalidFields.push("Correction Evidence must identify the unresolved documentation correction when Decision is blocked.");
279
+ }
280
+ }
281
+ return invalidFields;
282
+ }
250
283
  if (kind === "final-acceptance") {
251
284
  return validateDecision(content, FINAL_ACCEPTANCE_DECISIONS);
252
285
  }
@@ -9,6 +9,12 @@ export const ARCHITECTURE_PLAN_RESULTS = [
9
9
  ];
10
10
  export const CODER_COMPLETION_DECISIONS = ["ready_for_review", "incomplete", "failed"];
11
11
  export const ARCHITECT_DEBUG_STATUSES = ["pending", "completed"];
12
+ export const ARCHITECT_DEBUG_NORMAL_PLAN_DISPOSITION = "normal architecture plan required";
13
+ export const ARCHITECT_DEBUG_DISPOSITIONS = [
14
+ "local fix completed",
15
+ ARCHITECT_DEBUG_NORMAL_PLAN_DISPOSITION,
16
+ "user clarification required"
17
+ ];
12
18
  export const ARCHITECTURE_DIAGNOSIS_DISPOSITIONS = [
13
19
  "analysis completed",
14
20
  "diagnosis implementation completed",
@@ -24,6 +30,7 @@ export const TEST_INFRASTRUCTURE_STATUSES = [
24
30
  export const L3_REQUIRED_VALUES = ["yes", "no"];
25
31
  export const L3_ACTIONS = ["run-existing", "updated", "added"];
26
32
  export const DOCS_REPORT_DECISIONS = ["synced", "unchanged", "blocked"];
33
+ export const DOCS_SYNC_CORRECTION_OWNERS = ["none", "architect", "coder", "tester"];
27
34
  export const FINAL_ACCEPTANCE_DECISIONS = [
28
35
  "accepted",
29
36
  "accepted-with-known-risks",
@@ -184,6 +184,8 @@ export const ARTIFACT_DEFINITIONS = [
184
184
  "Public Contract / Module Boundary Notes",
185
185
  "Remaining Documentation Risks",
186
186
  "Known Issues Disposition",
187
+ "Correction Owner",
188
+ "Correction Evidence",
187
189
  "Decision"
188
190
  ]
189
191
  },
@@ -194,7 +196,8 @@ export const ARTIFACT_DEFINITIONS = [
194
196
  requiredHeadings: [
195
197
  "Dispatch History",
196
198
  "Proposed Dispatch",
197
- "User Authorization"
199
+ "User Authorization",
200
+ "User-Approved Follow-Up"
198
201
  ]
199
202
  },
200
203
  {