Repository navigation
Rebuild the build pipeline around deterministic checks and repair - #23
Merged
Merged
Conversation
An audit of the four example projects (docs/example-audit.md) found that every "successful" build produced code whose own tests largely fail: code corrupted by JSON escaping, nodes overwriting and duplicating each other's files, agents guessing at import and test layout, and no check besides an LLM review that passed all of it. The pipeline is now, per node: plan -> (implement || test) -> checks -> [repair -> checks]* -> review - Files are returned as <file path="..."> blocks; no code goes through JSON. Repair can also <delete/> files and keep them <unchanged/>. - Every prompt carries project facts (output dir as import root, test and check commands), parent/dependency specs and code, the files other specs own, and the node's previous files with headers stripped. - Deterministic checks run first: path escape, ownership (other specs' files and untracked existing files are off limits), Python syntax, check_command, test_command. Their real output drives repair, up to max_retries. Review runs only after they pass. - Each node commits as soon as it passes; a failing node rolls back on its own and only its dependents are skipped. - One provider layer (gemini, claude, openai, xai) replaces the ADK and custom dual pipelines; unknown model prefixes are an error instead of silently going to Gemini. Token usage is reported per node and build. - Stage prompts ship as built-in skills, overridable per project; `specdiff skill NAME` prints one. init writes a config with a working test command instead of six prompt files. - Fixes a rollback bug the new tests caught: a repair round backed up the node's own earlier output, so rollback restored it. - .gitignore's build/ and dist/ are anchored to the repo root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAykpfqqWA2GFjcC1p6FRy
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.
Why
I installed and ran the four example projects in
examples/, all recorded as successful builds. Their own generated tests largely fail:tscerrors, 32 files no spec ownstest_commandfound no testsschemas.pyandschemas/collidedocs/example-audit.mdtraces each failure to a root cause:What changed
Per node:
plan → (implement ‖ test) → checks → [repair → checks]* → review<file path="…">blocks with verbatim contents. Repair can also<delete/>a file, and any stage can mark a file<unchanged/>.check_command(new, e.g.npx tsc --noEmit);test_command. The real output goes to a repair stage, up tomax_retries. LLM review runs only after the checks pass.providers/hasgemini,claude, andopenai_compat(OpenAI and xAI), replacing the ADK-plus-custom dual pipeline;google-adkis dropped. Unknown model prefixes are now an error instead of silently going to Gemini. The Claude provider streams with a 64K output cap and enables server-side refusal fallback on models that support it.default_skills/and can be overridden per project.specdiff skill NAMEprints the effective version.initnow writes a config with a workingtest_commandinstead of six prompt files.architect,interface,implementation,testing) are ignored with a notice. A legacyreview.skill.mdthat asks for JSON still parses. Headers written by older versions are stripped correctly.syncbacked up the node's own earlier output, so rollback "restored" generated files instead of deleting them. Fixed: a path is backed up only on its first touch..gitignore'sbuild/anddist/rules are anchored to the repo root. They were silently ignoring the newsrc/specdiff/build/package.examples/shared-skillsand the per-example skill copies are removed (built-ins replace them). The example code snapshots are kept as a record.Testing
pytest tests/: 197 passed. The newtests/fake_llm.pyreplies per (spec, stage) at the provider boundary, so the real parsing, checks, file writes and repair loop run.tests/test_runner.pyruns a realpytestsubprocess against the generated files, covering repair from test output, syntax and ownership failures, failure isolation, incremental<unchanged/>, preflight refusals, and interrupts.ruff check/ruff format --check: cleanspecdiff init→build(scripted model, realpytestwith init'stest_command) →statusshows current.Generated by Claude Code