BuilderOS

Gate 5: Build

20 conditions. 15 decided by the script, 3 judged by the model. Run at the end of /builder-os:bos-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

  1. 5.1

    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 an https:// link to it (5.20 judges the choice)

    script
  2. 5.2

    Those tests pass

    Test output names a valid Run JSON 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

    script
  3. 5.3

    Instrumentation verified firing

    Each event seen arriving in a real environment: a data tag or a captured run. A code tag shows the call exists, not that it fired

    script
  4. 5.4

    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

    script
  5. 5.5

    The eval set passes

    Eval results names Run and Results files. 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

    script
  6. 5.6

    The plan was accepted before the build, and could be understood

    ## Plan has **In plain words:** and **Accepted:** with who (quoting their words where the person log exists) and an actual ISO timestamp; ## Seams has at least one row, each with its interface, where tests sit and a plain-words line; the Slices table has a Files column; ## Risks has at least one row

    script
  7. 5.7

    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

    model
  8. 5.8

    A guardrail runs Verify

    TECH.md has **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

    script
  9. 5.9

    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, or not applicable, {reason} for a state the flow does not have, each answering yes (a deviation is fixed, or recorded in SPEC.md → Design and then yes); when SPEC.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

    script
  10. 5.10

    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); once TECH.md → ## Design system has a kit, visual regression on the primary flow. declined by {person} ({why}) is a warning, as in 5.8

    script
  11. 5.12

    Someone who did not build it reviewed the craft

    ## Craft critique: **Run by:** (a separate agent given only SPEC.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 in SPEC.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

    script
  12. 5.13

    Someone who did not write it reviewed the security

    ## Security review: **Run by:** (a separate agent given the diff, the threat model and TECH.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

    script
  13. 5.14

    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 (not echo) and whose output holds the measured number, or a data tag; 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

    script
  14. 5.11

    The next session can find its way in the code

    TECH.md has ## 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, in AGENTS.md and in CLAUDE.md exists

    script
  15. 5.15

    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, and First day on the product track, each recording an https:// 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

    script
  16. 5.16

    Production exists before the release

    TECH.md → ## Environments has a production row with an https:// URL, how it deploys and who can see it, and **Production check:**: a passing run-check capture whose command calls the production host (a request, not echo), or the person's observation with a data or doc tag. 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))

    script
  17. 5.17

    A person tried what was built

    TECH.md → Verify has a Run row; ## Tried has **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

    script
  18. 5.18

    Every finished slice was reported

    LOG.md → ## Reports has one ### {slice} per slice marked done in PLAN.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 an https:// link such as the pull request carrying it) or nothing to see: {why}. A warning while no slice is marked done

    script
  19. 5.19

    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

    model
  20. 5.20

    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

    model

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 baseline names a captured **Run:** from before any change, and that run failed;
  • ## Pre-existing failures lists 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 output adds **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.

sh
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.mjs

The 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.

Generated from skills/gate-checks/references/gate-5-build.mdView on GitHub