Repository navigation
feat: standards, rules every change is held to - #92
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… coverage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, checks that fail on main Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing rules Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The prompts design, spec-check, plan, plan-challenge, build, review and done-check send for one change in a repository without standards, rendered by the loop as it is now. Standards must leave them byte for byte the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The standards prompt variable carries the standards that apply to a change,
with what each phase does with them (src/standards-prompt.ts). phasePrompt
puts them where a repository's prompt has {{standards}}, else at the end,
and adds nothing when the repository has no standards, so its prompts stay
byte for byte what they were (the golden test).
The design and spec-check sessions get the spec's view of them
(stageStandards with no files): those for every change and those added,
then the scoped ones apart, then approved exceptions. The spec gate gets a
standards code check: a Standards section, and only labels of real rules.
A spec-check finding may name its rule in standard; the label comes first
in the rewrite's findings and the gate's evidence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build and resolve are given the standards that apply to the plan's files; review the ones that apply to the diff (changedFiles, shared with the merge checks). A finding can name a rule (finding.standard), and review.md then lists it under Findings against the standards. REVIEW.md's template gets a Standards pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…where they say Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…w when no rule was judged Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The protect-tests hook refuses an Edit or Write under loopstra/standards/ in acceptance, build, fix, reconcile, revise and resolve. The standards rule runs before every other rule and is never logged to LOOPSTRA_PROTECTED_LOG. Resolve takes the standards rule only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README gets a Standards section (files, which apply when, each gate, exceptions, per-change scope, the record, fail-closed reading, the commands, setup, the console, checks that fail on main, onboarding, two worked examples, and the limits), and the places it touches (setup's sections, gates, merge checks, the hook, configuration). architecture.md lists the new modules by layer; decisions.md records the user's choices, Claude's calls, the plan's deviations and the rulings made while building; the spec's spec_gate sentence is corrected and a "Changed while building" list added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Files the merge checks' commands rewrote are put back on every exit of the tests check, a failing standard's check included, so a retry's rebase never meets a dirty worktree. A needs_person standard a person added to a change (its patterns matched nothing) brings a person: its risk patterns are every file. The merge pass reads the branch's diff once for the standards and the risk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
loopstra setup standards edits a standard with its questions only when the form keeps the file whole (the same decision the console makes); a file with more text is left as it is, with a sentence saying to edit it by hand or in the console as Markdown. An edit that changes no answer stages nothing, compared by the form's text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
loopstra start no longer refuses when a standard on main cannot be read: it prints the sentence as a warning and starts, since the running loop is what applies a fix sent from the console (its ticks keep requests working and start no step until main reads). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rule judged with no evidence is written with "no detail given", and readOutcomeStandards reads a line with empty evidence and a title holding "): " (the title runs to the last "): " before a result). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… has them Settings › Standards reads git status with -z through statusPaths, so a name with spaces or other alphabets, and both paths of a rename, are listed as they are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Needs attention catches a git failure reading main's standards and lists it as one Standards item instead of failing the whole list. The files of the standards folder are read at the same time, and a read by commit sha is kept (the last eight), so the tick, Needs attention and the requests do not read an unchanged commit again. branchStandards and hasStandardFiles replace the copies in apply, attention and the scheduler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The standards.applied marker's name and zod schema live in src/standards.ts (readAppliedMarker), used by the merge gate, the done step and the console's panel. The console uses fsutil.readText, and text.oneLine (its length now optional) replaces three local copies. checkOnMain resolves main once and runOnMain checks out the commit it is given, so LOOPSTRA_BASE is always the commit checked out. exceptionsToApprove loses its unused gate parameter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A finding against a standard stays on one line in review.md's Findings against the standards, however the reviewer wrapped it. With speed.parallel_checks, the standards' tool checks start only once the configured commands all passed, as the spec has it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scope dialog sends once: Add it / Remove it is off while sending and after the loop said yes (Close only then), and a standard no longer offered is never sent. globProblem reads a class's contents literally ([[] is no unclosed bracket), and a rule bullet with a label but no text has its own sentence. The protect-tests hook resolves . and .. segments before the standards rule. The done-check envelope's comment says what an absent standards list means. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p edits, check order Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Rules a team writes once, checked at every gate, with a record per change of how each rule was kept.
docs/superpowers/specs/2026-10-28-standards-design.md, with a "Changed while building" list at its end.docs/superpowers/plans/2026-10-28-standards.md.docs/decisions.mdunder "Standards (2026-10-28)".Standards
loopstra/standards/<name>.md:## Ruleswritten as- LABEL: text;applies_to(globs),needs_person, andcheck(a command).main's commit, never the checkout.loopstra startwarns rather than refuses.## Standardssection lists only the rules its design decides something about, plus exceptions.spec-checkjudges breaches.plan-challengejudges breaches.review.mdgets a "Findings against the standards" list.loopstra/standards/blocks. The test-protection hook also refuses such edits in every writing session,resolveincluded.needs_personstandard that applies, or that a person added, makes the change wait for a person through the existing risky-change gate.LOOPSTRA_BASE, the merge base, so scanners can report only new findings.## Standardssection tooutcome.mdthat names the standards' commit and lists the rules, exceptions, tool checks and scope changes. Unmet rules block.- LABEL: exception: why. No agent can grant one.spec_gate/plan_gate), even when nobody is on that gate in the config.intent/<slug>/standards.md. Undoing the approval takes it back out.standards-scoperequest, recorded in the same file.Surfaces
loopstra standardslists the standards, their scopes and labels, and any problems.loopstra setup standardsadds, edits and removes standards interactively. It suggests a base-aware scanner that is already installed and tries each new or changed check onmain.setup --checkchecks every standard and warns when a check already fails onmain.agent-filesandstandards-scoperequests that the loop applies and commits. The Origin check covers every POST, and "try" never runs a command the page sends.Review
standardsfield in every repository;/code-review highon the whole branch and fixed all 10 findings, plus 6 smaller ones left from the task reviews, in one wave that was then re-reviewed:needs_personstandard waits for a person;loopstra startwarns instead of refusing, so the console's fix can land;-z);mainis resolved once in "try on main";parallel_checksmode;):before a result word, so evidence shaped like(x): met:could be misread.standardsFilesAtreads one blob per file at a time, which is fine for a handful of standards.Test plan
bun run check: typecheck, lint, dead-code, and 2203 tests pass, 0 fail, up from 1953standards,standards-record,standards-command,setup-standards,console-standardsandui-standards;stages-*,apply,risk,hook,status,envelopesandcontext;tests/integration/standards-tick.test.ts,standards-run.test.tsandgolden-prompts.test.ts.🤖 Generated with Claude Code