Gate 5: Build
Acceptance: whoever will own the change accepts the build plan, recorded as **Accepted:** {who} · {ISO timestamp} in PLAN.md, before any code (gate 5.6; SKILL.md, Acceptance).
Conditions
- 5.1script
Every acceptance criterion maps to ≥1 test, or was tried by hand with a capture
Explicit mapping table, with an existing regular test file under the project root for every criterion. Use a literal path or a backticked path alongside the test name, with optional :line or #fragment; preserve spaces and route punctuation. No language extension whitelist. A criterion a break would not damage may map to
by hand: {capture}instead: a screenshot or video file that exists, or anhttps://link to it (5.20 judges the choice) - 5.2script
Those tests pass
Test output names a valid
RunJSON record with exit 0 and matching output digest, no known failed-runner summary; model verifies the command/output covers all mapped tests and current code. A suite that was already red: see Pre-existing failures below - 5.3script
Instrumentation verified firing
Each event seen arriving in a real environment: a
datatag or a captured run. Acodetag shows the call exists, not that it fired - 5.4script
No scope creep
Nothing from the Gate 4 out-of-scope list was built. On the change track, a slice whose files edit a screen (
.tsx,.vue,.css, …) or a schema (migrations,.sql) that**Touches:**does not declare fails - 5.5script
The eval set passes
Eval results names
RunandResultsfiles. The captured run binds dataset/results digests, every case has one boolean result, computed pass rate reaches threshold, every must-pass passes; model verifies execution/rubric correspondence - 5.6script
The plan was accepted before the build, and could be understood
## Planhas**In plain words:**and**Accepted:**with who (quoting their words where the person log exists) and an actual ISO timestamp;## Seamshas at least one row, each with its interface, where tests sit and a plain-words line; the Slices table has a Files column;## Riskshas at least one row - 5.7model
The build followed the plan
Model confirms acceptance preceded implementation, and the final diff matches the plan or the plan records each deviation with its reason
- 5.8script
A guardrail runs Verify
TECH.mdhas**Guardrail:**naming the file of the CI job or pre-commit hook that runs Verify on every change, not "none"; the file exists and holds a Verify command.**Guardrail:** declined by {person} ({why}), {date}is a warning, not a pass: on a repository whose CI belongs to someone else, adding it is their decision - 5.9script
The built interface was looked at
PLAN.md→## Interface review:**Widths:**naming two widths (the widest and the narrowest the ICP uses), and a table (State / Screenshot or route / Matches the chosen direction) with a row for each of the six states of the primary flow (empty, loading, partial, error, success, permission), each with screenshot files that hold a real image (one capture per state, at a width the review names) or routes, ornot applicable, {reason}for a state the flow does not have, each answering yes (a deviation is fixed, or recorded inSPEC.md→ Design and then yes); whenSPEC.md→ Design → Messages has rows,**Messages received:**says how each was received from the built product, with its capture. On the change track, empty and error at one width. Skipped when the visual direction is not applicable;**Interface review:** not applicable, {reason}passes - 5.10script
Quality a machine can check runs every time
TECH.md→**Quality checks:**names accessibility, end-to-end on the primary flow, dependency audit, secret scan and static analysis, and the guardrail file named in 5.8 runs each one (its tool or its name appears there); with an interface, a token check (raw colours and spacing outside the token file fail); onceTECH.md→## Design systemhas a kit, visual regression on the primary flow.declined by {person} ({why})is a warning, as in 5.8 - 5.12script
Someone who did not build it reviewed the craft
## Craft critique:**Run by:**(a separate agent given onlySPEC.md→ Design, the voice, the captures and the reference screens, or a person who did not build it) and a table (Aspect / Finding / What happened) with a row each for hierarchy, spacing rhythm, typography, copy against the voice, focus states, motion with reduced motion, interaction states, and next to the references; every row has a finding and what happened to it (fixed, or recorded inSPEC.md→ Design); "none found" counts on a row, and a table where every row is a bare "none found" fails: say what was looked at. Skipped with 5.9 - 5.13script
Someone who did not write it reviewed the security
## Security review:**Run by:**(a separate agent given the diff, the threat model andTECH.md, or a person who did not build it) and a table (Area / Finding / What happened) with a row each for access control, input handling, secrets and configuration, abuse limits and data exposure; every row has a finding and what happened to it; a table of bare "none found" fails, as in 5.12. Skipped when the threat model is not applicable - 5.14script
The performance budget was measured
## Performance: a table (Measure / Budget / Measured / Within budget / Evidence), each row with numbers in budget and measured, "yes" within budget, and a captured run whose command measures something (notecho) and whose output holds the measured number, or adatatag; with an interface, a page-load row (largest contentful paint, interaction to next paint or layout shift). Skipped when the spec's quality bar says performance does not apply - 5.11script
The next session can find its way in the code
TECH.mdhas## Map(where the entry points, modules, tests and generated files are, one row each) or "not applicable, {reason}", and every path named in the map, inAGENTS.mdand inCLAUDE.mdexists - 5.15script
The feature was seen working
PLAN.md→## Demo(delivery-discipline(demo)):**Test:**names the end-to-end test that walks the flow, a file with content;**Run:**a captured passing run of that test (the command or its output names it) (or, on the floor,**Recorded by:**the person who recorded the screen); a table (Flow / Recording / Shows) with the primary flow, andFirst dayon the product track, each recording anhttps://link, a video file that exists, or at least two step screenshots that hold real images, each with what it shows; a recording git would commit fails, because media stays out of the codebase (.builderos/media/is git-ignored). Skipped when the visual direction is not applicable, and on the change track when it is inherited;**Demo:** not applicable, {reason}passes - 5.16script
Production exists before the release
TECH.md→## Environmentshas a production row with anhttps://URL, how it deploys and who can see it, and**Production check:**: a passingrun-checkcapture whose command calls the production host (a request, notecho), or the person's observation with adataordoctag. On the product track also**Domain:**,**Secrets:**,**Email sender:**,**Live keys:**and**Legal pages:**(each may say not applicable with why). On the feature and change tracks a missing record is a warning (release-ops(production)) - 5.17script
A person tried what was built
TECH.md→ Verify has aRunrow;## Triedhas**Link:**(a preview URL or the Run command in backticks),**Tried by:**naming a person, not the agent, with the date and their words in quotes, and a table (What they tried / What they found / What happened) with at least one row, each with what they found and what happened to it. Skipped with 5.9 when there is no interface. A warning on the build track: the users try it at the release stop - 5.18script
Every finished slice was reported
LOG.md→## Reportshas one### {slice}per slice marked done inPLAN.md→ Slices, each with**Did:**in plain words,**Try:**naming something to open (a URL, a file, a command in backticks) and**Seen:**, a screenshot or short video of it working in the running app (a file that exists, or anhttps://link such as the pull request carrying it) ornothing to see: {why}. A warning while no slice is marked done - 5.19model
The code stayed maintainable
Model-judged on the diff against
SPEC.md→## Maintainability: code where Structure: puts it, no dependency outside Dependencies:, what Simple to change: names still changes in one place, no dead code or copy-paste left behind - 5.20model
What was tried by hand had nothing to damage
Model-judged, only when 5.1 has
by hand:rows: none of those criteria touches one customer's data reaching another, money, an action leaving the product or its approval, a migration, or outside text reaching a model. One that does needs a test
Details
Read when running gate 5. E.1, E.2 and the procedure in SKILL.md apply too. Acceptance: whoever will own the change accepts the build plan, recorded as **Accepted:** {who} · {ISO timestamp} in PLAN.md, before any code (gate 5.6; SKILL.md, Acceptance).
Attested (the script checks the record, not the event): 5.16 with an observation, 5.17, 5.18.
A captured run whose command only prints or exits (echo, true, printf, cat, …) checks nothing and fails wherever a run is evidence.
Build track. The build runs the way a small team ships: each slice seen working (5.18 → Seen), tests where a break does damage (5.1, 5.20), the people try it at the release stop (5.17 warns). The machine checks stay (5.8, 5.10: they run in CI on every change, with an end-to-end test per primary flow, the net against regressions a screenshot cannot be), and 5.9 looks at empty and error at one width. 5.12, 5.14 and 5.15 are skipped, and 5.13 unless SPEC.md → **Touches:** names personal data, permissions or money (or says nothing). 5.6 asks for the person's go on the slices (**Accepted:**) and a Files column; seams, risks and the plain-words summary are written where they help.
Change track. The change always owes 5.1, 5.2, 5.4, 5.6, 5.7 and 5.18 (and 5.3 and 5.5 when its spec tracks events or has model output). From SPEC.md → **Touches:**: interface 5.9, 5.12, 5.15, 5.17; copy 5.17; personal data, permissions or money 5.13. 5.8, 5.10, 5.11, 5.14 and 5.16 are skipped: the product already runs, and its guardrail is the feature track's concern.
Script-decided: 5.1, 5.3, 5.4, 5.6, 5.8, 5.9, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18. 5.2 and 5.5 fail deterministic prechecks when execution records/results are missing or failed, then become model-judged for coverage and provenance. Model-judged: 5.7, 5.19, 5.20. The emitted checked_by split is authoritative.
Pre-existing Failures
A product with history often has a suite that was red before this initiative touched it. Fixing those tests is scope creep (5.4); pretending they pass is fiction. Gate 5.2 then reads the final run against the baseline instead of demanding exit 0:
## Test baselinenames a captured**Run:**from before any change, and that run failed;## Pre-existing failureslists each failing test by the name the baseline log prints, one row each;- the final run fails no more often than the baseline, and every listed name was in the baseline log;
## Test outputadds**Mapped run:**, a captured run of the mapped tests alone, exiting 0.
Then 5.2 becomes a judgment: confirm no new failure hides among the old ones. A green baseline turns every failure into a new one. Repairing a pre-existing failure is its own change initiative, or a recorded deviation in the plan.
Execution Evidence
Run checks only when the user has authorized the underlying command; checking the gate never runs them.
node scripts/bos.mjs run-check --label unit-tests -- pnpm test
node scripts/bos.mjs run-check --label evals --dataset evals/cases.jsonl --results evals/results.json -- node evals/run.mjsThe script prints **Run:** .builderos/initiatives/{slug}/evidence/runs/{label}-{timestamp}.json. Put that line under ## Test output, or under ## Eval results with **Results:** evals/results.json. Result JSON is an array such as [{"id":"1","pass":true}], one result per dataset case. The check records argv, cwd, timestamps, exit code, log and digest; eval captures also record dataset and result digests. Any failed precheck blocks advancement without an explicit logged override. These editable local records detect drift, not adversarial fabrication; coverage and provenance remain model judgments. External runner evidence is unverified by this recorder: retain its raw source and explain the gap; never fabricate a bos-run-check record or rerun unauthorized work to close it.
skills/gate-checks/references/gate-5-build.mdView on GitHub