Skip to content

Harden vxd against the compose-gap class: Python integration gate + assembled-app mandate + requirement-completion gate#108

Merged
tzone85 merged 2 commits into
mainfrom
feat/completion-gate
Jun 26, 2026
Merged

Harden vxd against the compose-gap class: Python integration gate + assembled-app mandate + requirement-completion gate#108
tzone85 merged 2 commits into
mainfrom
feat/completion-gate

Conversation

@tzone85

@tzone85 tzone85 commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Closes the defect class where a requirement reaches REQ_COMPLETED with green per-story unit tests but a broken assembled app (routes declared-but-unwired, dependency stubs never overridden, per-route stores). Surfaced live on pulsereview (a Python/FastAPI build that merged with 3 endpoints non-functional).

Two commits, three layers

a38894d — post-merge integration build now covers Python + planner mandates assembled-app tests

  • integration_build.go: detectProjectKind recognizes Python (pyproject.toml/setup.py/setup.cfg/requirements.txt). Before, Python returned projectUnknown so the post-merge integration build was a silent no-op for every Python project — literally why pulsereview merged unverified. Command selection extracted into pure integrationCommand(kind, repoDir); Python runs python3 -m pytest -q when a test suite exists (mirrors the Node "build script must exist" skip).
  • planner.go: ENGINEERING STANDARDS now mandate that endpoint/surface stories carry an integration test that boots the real app factory with no dependency overrides, asserts the route is registered at its spec path (not 404), and asserts cross-endpoint shared state.

284ed02 — requirement-completion gate blocks REQ_COMPLETED on a red composed mainline

  • completion_gate.go: CompletionGate.Run runs in dispatchNextWave after all stories merge — pulls the composed mainline first, then verify→auto-fix→re-verify up to qa.completion_fix_cycles (default 2) godmode cycles. Emits REQ_COMPLETED only when green, else the new REQ_BLOCKED event (resumable via vxd resume --godmode). Previously the verification loop only wrote .vxd-fix-gaps.md and fired REQ_COMPLETED regardless — advisory, not gating.
  • Nil client / negative cycles ⇒ hard gate (verify once, block on red) so silent-complete-on-red is structurally impossible. Config qa.disable_completion_gate (default false = ON).

Verification

  • go build clean; go test ./...31 packages pass; go vet clean; golangci-lint 0 issues.
  • 5 new gate/planner unit tests + 9 completion-gate tests (incl. real go build integration).
  • End-to-end demonstration: dropping the mandated assembled-app test into a fresh pulsereview clone and running exactly what the gate runs (python3 -m pytest -q) exits 1 on the compose gap, while the repo's own 171-test suite (which uses dependency overrides) exits 0 — so the defect now fails the gate and dispatches an integration-fix story instead of merging green.

NXD port pending.

tzone85 added 2 commits June 26, 2026 03:34
…assembled-app endpoint tests

detectProjectKind returned projectUnknown for Python repos (pyproject.toml/
setup.py/setup.cfg/requirements.txt), so the post-merge integration build was a
silent no-op for every Python project — the literal reason pulsereview merged
with an unassembled composition root (/reviews + /digest 404 despite "merged").

- integration_build.go: recognise projectPython; extract pure integrationCommand(kind, repoDir).
  Python runs `python3 -m pytest -q` only when a test suite ships (mirrors the
  Node "build script must exist" skip).
- planner.go: ENGINEERING STANDARDS now mandate that endpoint/surface stories
  carry an integration test booting the REAL app via its factory with NO
  dependency overrides, asserting the route is registered at its spec path and
  cross-endpoint shared state.

Tests: TestIntegrationBuild_DetectsPythonProject, TestIntegrationCommand_Python{RunsTestsWhenPresent,WithoutTestsSkips},
TestIntegrationCommand_GoAndNodeUnchanged, TestPlanner_PromptMandatesAssembledAppEndpointTests.
…sed mainline

Closes the caveat that vxd reported REQ_COMPLETED on code that does not compile.
Per-story QA runs in isolated worktrees and cannot see cross-story drift; the
composed mainline WAS verified but only advisorily — gaps were written to
.vxd-fix-gaps.md and logged, then REQ_COMPLETED fired regardless.

CompletionGate.Run (engine/completion_gate.go), wired in dispatchNextWave:
- Pull the composed mainline FIRST so verification sees the true merged tree.
- verify (real build + tests) -> green: emit REQ_COMPLETED.
- red: run up to qa.completion_fix_cycles (default 2) godmode fix-agent cycles
  (edit + commit + push the reconciliation), pull, re-verify. First green ->
  REQ_COMPLETED. Exhausted -> emit REQ_BLOCKED (new event; projects requirement
  status "blocked"; resumable via `vxd resume --godmode`).
- Nil client / negative cycles -> hard gate (verify once, block on red, no
  auto-fix): silent-complete-on-red is structurally impossible.

Config: qa.disable_completion_gate (default false = ON), qa.completion_fix_cycles.
Wired via Monitor.SetCompletionGate in resume.go.

Tests: completion_gate_test.go (scripted loop: green-first, red->green,
stays-red->block, nil->hard-gate, gaps-file; REAL go-build integration:
RealVerify_{Blocks,Passes}; emitRequirementOutcome->blocked vs real stores),
TestProject_ReqBlocked, TestCompletionFixCycles, TestResume_WiresCompletionGate.
@tzone85 tzone85 merged commit 3d5d8d5 into main Jun 26, 2026
6 checks passed
@tzone85 tzone85 deleted the feat/completion-gate branch June 26, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant