Repository navigation
Make Definition of Done a script and add a measured learning loop - #1
Merged
Merged
Conversation
Until now, allowed_files, receipts, DoD, and lessons were mostly text the agent was asked to follow. This change turns them into checks: - verify.mjs returns DONE or NOT_DONE from the slice contract, gate results, and receipt. It checks scope (including files hidden by local ignore rules, skip-worktree, and moves), gate freshness via per-file hashes, receipt consistency, a real test gate, and a named human for HIGH-risk work or edits to rule files. --rerun runs the gates itself so stored evidence is not trusted. - learn.mjs reads the verdict ledger, reports first-pass and current DoD rates, and lists checks that keep failing. It never edits governance. - init.mjs writes .buildloop.yml from package scripts; receipt.mjs writes the receipt from gate evidence. - gate-runner records HEAD and file hashes, fails closed on git errors, fails if the commands modify the files they tested, and matches slash-less protected paths at any depth (.env* now catches nested files). - sandbox-run rejects option-like images and host-path volume names, drops capabilities, mounts .git read-only, shadows root .env files, removes timed-out containers, and treats "allowlist" networking as unenforced. - Installers ship the runtime inside the enterprise-ai-dev skill. - New templates: release plan, lessons ledger, PR verify workflow, CLAUDE.md/GEMINI.md adapters. CI actions pinned to commit SHAs. - SECURITY.md no longer claims protected paths are blocked before edits. Found and fixed with adversarial review by Codex (gpt-6.1-sol, gpt-6-astra) and Gemini 4 Argon; each bypass has a regression test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dogfooding verify on this branch failed freshness because the test suite runs gate-runner inside examples/, creating nested .buildloop-runs folders, and verify counted new ignored files that gate-runner does not. Artifacts now match at any depth, and freshness compares the files known at gate time plus non-ignored changes, the same rule gate-runner uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… gaps From Gemini 4 Argon's re-score of this branch: - verify --rerun now runs the contract, approval, governance, and scope checks first and does not execute any gate command if one fails. Before, an edited .buildloop.yml ran its commands before being rejected. package.json joins the rule files because its scripts are the gates. - The committed-diff filter uses the exact artifact matcher, so a force-added .buildloop/payload.js is in scope. - Every receipt must fill "Acceptance criteria -> proof:" and "Rollback:". receipt.mjs now agrees with verify on mutated runs and skipped tests. - Inline YAML lists ([a, b]) parse as lists; quoted "[...]" stays a placeholder. - The sandbox shadows .env files at any depth, skipping dependency folders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- sandbox: cover .env files with a read-only /dev/null bind; a tmpfs mount cannot target a file, so docker run failed in any repo with a .env file. - gate-runner: the mutation check now covers only non-ignored work, so tool caches like .eslintcache or *.tsbuildinfo no longer fail the gates. Ignored work files are hashed after the commands and still feed verify's freshness check. Hashing streams in 1 MB chunks. - verify: only markdown files passed as --contract/--receipt are exempt from scope; rule files match at any depth (nested package.json); a blank receipt field no longer borrows the next field's text; --rerun judges the run it started, not the newest folder by name. - receipt: gate_status mirrors gate-runner; a skipped test gate only lowers status to NO_GO. Built once. - flag() and the latest-run lookup live in gate-runner.mjs and are shared. Each fix has a regression test (verify suite 43, sandbox 30). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Replace the "enterprise-grade on any stack" line with what Buildloop does: a process for the agent plus scripts that check it was followed. - New "What You Get" table separates skills (guidance) from scripts (enforced), with requirements. - New "Try It On Your Repo" section with the installed-runtime commands, run end to end on a fresh repo before writing it down, including committing .buildloop.yml on its own since it is a rule file. - Lifecycle marks which steps are enforced; unreleased work moved to its own section; founders section states the terminal requirement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Buildloop told agents to stay inside
allowed_files, write honest receipts, and not call work done without evidence. Almost none of that was checked by code. Two outside reviews (Codex gpt-6.1-sol and Gemini 4 Argon) independently rated it a NO_GO for enterprise use for that reason. This PR turns the Definition of Done into a script and adds a way to measure how agents actually perform.What changed
Definition of Done as code.
buildloop verify --contract <c> --receipt <r> --rerun --base <ref>returns DONE or NOT_DONE. It fails a slice when:.git/info/exclude, skip-worktree, or agit mv.buildloop.yml,package.json, AGENTS/CLAUDE/GEMINI.md, workflows, CODEOWNERS, or an existing contract changed without a named human approverWith
--rerun, verify runs the gates itself and does not trust stored JSON. It also runs no gate commands until the scope and rule checks pass.Learning loop.
buildloop learnreads the verdict ledger and reports first-pass, eventual, and current DoD rates, plus checks that keep failing. It recommends; a human decides whether a lesson becomes a test, a gate, or a rule (templates/lessons.md). Agents can't edit their own governance through it.Founder path.
buildloop initwrites.buildloop.ymlfrom your package scripts, so there are no placeholders to fill in.buildloop receiptgenerates the receipt from the gate evidence.Installers now ship the runtime (scripts, schemas, templates, references) inside the
enterprise-ai-devskill. Before this, installed agents couldn't run any of the scripts the skill told them to use.Sandbox. Rejects option-like image names (
--privileged) and host-path volume names (/var/run/docker.sock). Drops capabilities, sets no-new-privileges, mounts.gitread-only (hooks run on the host), shadows.env*files at any depth, and removes the container if the client times out. "Allowlist" networking is now labeled as unenforced and needs the same approval as full network.Docs and CI. SECURITY.md no longer says protected paths are blocked before an edit; it now has an "Enforced vs. Advisory" table. CI actions are pinned to commit SHAs, and the DoD suite runs in CI. New templates: release plan with rehearsed rollback, lessons ledger, a PR workflow that runs
verify --rerun, and thin CLAUDE.md/GEMINI.md adapters.How it was tested
.buildloop.yml, and its gate runs every suite.CODEX_HOMEwith bothinstall.shandinstall.ps1, then ran the bundled scripts from the install location.--rerunexecuted gates before checking the rule files. Each one is fixed and has a regression test.verify --rerun --base mainon this branch in a clean worktree passes scope, gates, and freshness. It fails approval and governance, because this PR changes CI and.buildloop.ymland nobody has approved it yet. That's the intended result: the approval is this review.Review follow-ups
A full review of this PR found ten issues, all fixed in 34e1e48 with regression tests. The ones that mattered most:
.envshadowing used a tmpfs mount over a file, which Docker rejects, so the sandbox wouldn't start in any repo with a.env. It now binds/dev/nullread-only.eslint --cacheor incrementaltscwould have failed every run. It now covers only non-ignored work. Ignored files are hashed after the gates for the freshness check.--receiptwas exempt from scope; now only markdown files are.package.jsonfiles now count as rule files.The README was also reworked (19a6e6b): it says plainly which parts are enforced and which are guidance, and it adds a quick start that was run end to end on a fresh repo.
What this does not do
approved_byis a string in the contract. Actual enforcement of human approval needs CODEOWNERS and required reviews on the rule files.--rerun, local evidence can still be edited by an agent with shell access. CI should always use--rerun.node_modules,dist, ...) are not hashed. A fresh install in CI is the defense there.main. Pinning them to a release tag is the next supply-chain step.Before merging
.github/workflows/ci.yml: SHA pins plus the new test step).buildloop.yml,package.json, and.github/workflows/🤖 Generated with Claude Code