Skip to content

Latest commit

 

History

History
21 lines (19 loc) · 5.5 KB

patterns.md

File metadata and controls

21 lines (19 loc) · 5.5 KB

Patterns worth taking home

Each row is an idea this repo uses, the one file where it lives, and a word you can search for in that file. A test reads every row, so a renamed symbol or a moved file fails the gate instead of leaving a stale pointer. Read the row, open the file, find the anchor, then do the lab.

Pattern Problem it solves Where it lives Anchor Lab Module When not to use it
Artifact chain A stage needs what the last stage decided, and a person needs to audit it. factory/engine/artifacts.ts ARTIFACTS factory-01 docs/factory/f0-1-anatomy.md One-shot scripts with no handoff between steps.
Workflows as data Changing the order of stages should not mean changing code. factory/engine/workflow.ts workflowSchema factory-04 docs/factory/f8-workflows.md A flow that never changes and has one caller.
Checks that return evidence A bare pass or fail gives the next round nothing to fix. factory/engine/types.ts CheckResult factory-05 docs/factory/f4-test.md Checks whose output would leak a hidden test.
Red then lock A test written to pass proves nothing, and a builder can rewrite a test that fails. factory/engine/checks/lock.ts export const lock factory-05 docs/factory/f4-test.md Exploratory spikes where the test is not yet known.
Holdouts A builder overfits to tests it can read. factory/engine/checks/holdout.ts WITHHELD - docs/factory/f4-test.md Work with no hidden cases a human can add.
Voting verifiers One reviewer's guess is noise, two agreeing is a finding. factory/engine/review.ts NEEDED factory-06 docs/factory/f5-review.md Cheap changes where a second review costs more than the bug.
Risk from the diff How much review a change needs depends on the paths it touches, not who wrote it. factory/engine/risk.ts classify factory-08 docs/factory/f6-deploy.md A repo where every path carries the same risk.
Approvals bound to a digest An approval must not survive a change to what was approved. factory/engine/approvers.ts digest - docs/factory/f1-plan.md Internal tools where the author is the only user.
Sigma bands write intents A metric drifting out of its range should open a ticket by itself. factory/engine/bands.ts detect factory-07 docs/factory/f7-maintain.md Metrics too noisy to hold a stable mean.
Fakes behind dependency injection A runner that talks to git and a model cannot be tested for free. factory/engine/fake-host.ts fakeHost factory-10 docs/factory/f0-1-anatomy.md Code with no outside effects to replace.
One owner per file A file nobody owns is a file nobody keeps true. tests/structure/levels.test.ts no owner - docs/levels/sharing.md A single-owner repo.
Spend cap A loop with no limit is a bill. factory/engine/interpret.ts spend cap factory-10 docs/factory/f13-spend-and-safety.md Runs on a flat-rate plan with a turn limit already.
Model routing by stage Mechanical steps do not need the strongest model. factory/engine/models.ts resolveModel factory-09 docs/factory/f12-model-routing.md One-model products where routing adds a failure mode.
Hooks as gates A rule in a prompt is a request, a rule in a hook is enforced. .claude/settings.json hooks daily-04 docs/levels/boundary.md Preferences that are fine to ignore once in a while.
Least-privilege agents A reviewer that can edit will fix instead of report. .claude/agents/reviewer.md tools: Read, Grep, Glob, Bash advanced-01 docs/levels/execution.md Agents whose whole job is to write.