Factory completeness: completion gate, docs subsystem, planner factory stories, frontend design skill, security hardening#89
Merged
Conversation
added 2 commits
July 2, 2026 13:20
…n-intent planning + a distinctive-design brief UI-facing stories are detected (owned-file extensions + whole-word UI vocabulary) and their agents receive agent.FrontendDesignBrief: token-first two-pass planning with a self-critique step, one signature element, named banned defaults (Inter/Roboto, purple-gradient-on-white, cream #F4F1EA + serif + terracotta, acid-green-on-black, the template feature-card page, scattered animation), a WCAG accessibility floor (responsive to 360px, visible keyboard focus, prefers-reduced-motion, 44px targets, designed empty/loading/error states), and copy-as-design-material rules. - detectFrontend (engine/detect.go): extensions are the strongest signal; keyword regex uses word boundaries so pagination/performance/review never false-positive; 'html' and 'responsive' deliberately excluded (server-side HTML emails and 'responsive API gateway' are backend work). 24 table cases. - IsFrontend threads through BOTH dispatch paths (CLI runtime + native) and the retry TemplateContext; TestExecutor_WiresFrontendDetection guards the wires. - Planner decomposition prompt now requires the first UI story to establish a design-token foundation consumed by later UI stories, with the accessibility floor in UI acceptance criteria (TestPlanner_PromptIncludesFactoryStandards pins security + design blocks). - Brief size budget pinned at ≤6 KB (rides on every UI dispatch).
…, planner factory stories, frontend skill, security deltas Five features, offline-first, with tests: 1. Requirement-completion verification gate (engine/completion_gate.go + verification_loop.go + monitor_pull.go): REQ_COMPLETED only after the composed mainline verifies green (deps, build, tests, hallucination + conflict-marker scan). Red mainline → bounded auto-fix cycles (qa.completion_fix_cycles, default 2) → REQ_BLOCKED (new event, projects status 'blocked') with gaps in .nxd-fix-gaps.md. Nil client ⇒ hard gate: silently completing on a red build is impossible regardless of wiring. The local checkout is pulled to the composed mainline before verification. 2. Docs subsystem (doc_generator.go + svg_docs.go + factory_docs.go + factory_docs_adr.go): README generate/update + real-SVG architecture and sequence diagrams (validated, Mermaid rejected, retry-with-feedback), training guide + ADRs backstopped only when the agent didn't supply them, deterministic docs/README.md index. Best-effort, never blocks completion. 3. Planner factory stories (default ON): integration story (wire everything into the real entry point + boot-the-app smoke test — closes the compose gap) and scribe story (README + training + SVGs + ADRs + docs index, greenfield-aware via nxd:scribe markers). Ephemeral estimates skip both; count-asserting tests set the flags false. 4. Frontend design skill (agent/frontend.go + engine/detect.go): UI stories detected via owned-file extensions + word-boundary keyword regex get the distinctive-design brief (token-first planning, signature element, banned AI-default looks, WCAG floor); threaded through CLI-runtime, native-runtime and retry prompt paths; planner requires a design-token foundation story. 5. Security deltas: RunScanners gains the failed-scanner classification (a tool that errored is coverage LOST, never a clean run) + Report.Failed; KnownScanners/InstallHint registry exports; fake-scanner harness tests drive RunScanners end-to-end (internal/security to 98.3% coverage); gate LLM paths tested via ReplayClient. All GitHub Actions pinned to commit SHAs (supply-chain, public repo). Also scrubbed stray sibling-project references from source comments.
a1bb690 to
0dfec53
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the remaining factory-completeness feature set, adapted offline-first:
REQ_COMPLETEDis only emitted after the composed mainline verifies green (deps install, build, tests, hallucination + conflict-marker scans). A red mainline gets up toqa.completion_fix_cycles(default 2) auto-fix agent cycles; still red → newREQ_BLOCKEDevent (requirement statusblocked) with gaps written to.nxd-fix-gaps.md. A nil LLM client degrades to a hard gate — completing on a red build is impossible regardless of wiring. The local checkout is pulled to the composed mainline before verification so the gate checks the true merged tree.docs/architecture.svg+docs/sequence.svgas real validated SVG (Mermaid rejected, retry-with-feedback up to 3 attempts), training guide + ADRs backstopped only when the scribe agent didn't supply them, and a deterministicdocs/README.mdindex. Best-effort — never blocks completion.nxd:scribemarkers. Ephemeral estimates skip both.RunScannersgains the failed-scanner classification (a tool that ran but errored is reported as coverage LOST, never counted as a clean run) +Report.Failed;KnownScanners/InstallHintregistry exports; fake-scanner-harness tests driveRunScannersend-to-end (internal/securityto 98.3% coverage); gate LLM paths tested viaReplayClient. All GitHub Actions across the three workflows pinned to full commit SHAs. Stray sibling-project references scrubbed from source comments.Test plan
go build ./...+go vet ./...clean; binary at~/.local/bin/nxdgo test ./... -count=1— all packages passgolangci-lint run— 0 issuesnxd.config.example.yamlregenerated (newqa+planningfields)