Repository navigation
feat: replace the greeting with a to-do reference app - #335
BenSheridanEdwards wants to merge 40 commits into
Conversation
Add the PRD for the to-do reference feature and ADR 0123, which records why a to-do app replaces the greeting and recent greetings. The PRD names every visible word, the normalised title form, the 100-character limit, ordering, loading, pending, empty and failure states, the default filter, Clear done with nothing done, and when the page re-reads the list. Each behaviour links to the E2E test that will prove it; the tests follow in the next commit.
Add todos.spec.ts, one test per behaviour in docs/prd/todos.md, and point the accessibility and visual specs at the to-do page. All 38 tests fail on this commit: the api has no todos router and the page has no list. todos.spec.ts is the only spec that writes to the shared in-memory list. It runs its tests in order in one worker and empties the list before each test. The accessibility and visual specs serve their own todos.list answer, so they read and write nothing shared.
Build the to-do app that docs/prd/todos.md specifies, and remove the greeting and recent greetings features with their routes, PRDs, E2E specs and API reports. The api feature keeps the title rules and state changes in domain.ts, the in-memory list in integrations.ts, and maps outcomes to BAD_REQUEST and NOT_FOUND in procedures.ts. The web route holds server state in useTodos (changes wait for the list re-read), forms in useTodoForm with the Effect form schema, and the filter and open edit in their own hooks. The query client no longer refetches on focus or reconnect, and the Button primitive dims when disabled. Every E2E test from the previous commit now passes.
Tests that read the real tree now read the to-do feature: the Oxlint slice-isolation proof uses the real todos route and api application beside a fixture archive slice, blast radius uses the todos importers, the contract gate breaks the todos.add pact, the inclusion copy and the evidence probe use the todos paths, and the PRD check expects docs/prd/todos.md. Synthetic fixtures that named greeting files now name to-do files, and two lint messages give useTodos and ./features/todos/index.ts as their examples. scripts/enforcement-approval.test.ts keeps its synthetic docs/prd/greeting.md paths so this change rewrites no more gate tests.
A change that deletes a whole route or feature slice failed coverage:changed and the confidence label, because no E2E spec named the deleted slice. Only slices whose folder is still in the tree now need a spec; a file deleted from a kept slice still counts.
Pact merges new interactions into an existing web-api.json, so a pact directory left by an earlier run kept interactions the web no longer makes, and the provider check failed on them. The consumer test now removes the file before it records the contract.
State that line-through sits on the element holding the title text, and that todos.rename checks the title before it looks for the id, with an E2E assertion for the second.
Point the README, North Star, glossary, architecture, conventions, PR quality, templates, issue forms, tour and skills at the to-do feature, and record ADR 0123 as amending ADRs 0032 and 0107. AGENTS.md changes only its golden-rule example path, as approved. The verify-agentic-template skill now drives todos, todos-validation, todos-error and accessibility journeys, probes todos.list, and keeps its .claude copy in sync.
The visual spec now captures the to-do page; its Linux baselines follow from the Visual regression job's own captures.
Empty list, blank-title validation, a list with a done to-do, an open edit, the Active filter and a failed add, captured from this branch in Chromium.
Linux Chromium captures from Playwright 1.61.0 of the empty list, the blank-title error and a list with a done to-do, at 390 and 1280 px.
The arm64 capture differed from the runner by anti-aliasing. These are the Visual regression job's own captures, per the screenshots README.
Two rebuilds from the PRD named the group with an aria-label, while the reference used a hidden legend, so the accessibility tree differed. The PRD now says the name comes from the aria-label and the group holds no other text, and the empty-state E2E test checks both.
The group now takes its name from aria-label instead of a hidden legend, as the PRD states. The tour links follow the blank-title test, which moved down five lines.
A rebuild wrapped the card in an unpromised named region. The PRD now says the parts it lists are the only ones in main, and an E2E test compares the whole accessibility tree of main while loading, empty, listing and editing. The test fails on that rebuild and passes on the reference and three other rebuilds.
Playwright reused any api already on :3001, so `pnpm e2e` beside `pnpm dev` (or another checkout's run) tested the wrong code and its beforeEach emptied that api's to-dos. Red: with `pnpm dev` holding a to-do, `pnpm e2e` passed and the dev list came back holding only the spec's leftovers. Playwright now starts every server itself on ports 1000 above the dev ports (6173 and 4001 for the reference) and never reuses one. A busy port fails the run with "already used". With E2E_BASE_URL the api keeps :3001, where a self-managed preview proxies. ADR 0123 records it.
The list re-read after a successful change could fail silently: the api kept the to-do while the page showed nothing and no message. The PRD now treats a failed re-read as a failed list load. It also pins each change's api output, where the title message and a change failure sit in the page, that reopening an edit starts from the title, and that the selected filter shows its border and text in the focus colour, which one rebuild dropped. Behaviours are grouped under headings that match the spec's describe blocks, and sibling behaviours that share a promise are merged: 36 become 31, and every test stays linked. The reference-feature paragraph moves to ADR 0123, and the accessibility behaviour is renamed after the scan it runs.
New tests, each captured red first (receipts in the operations folder, stage2/red-*.log): - says so when the list fails to load after a change: red on the current code; the page showed an empty page and no alert. - the api answers each change with its result: red with clearDone answering its ids newest first. - shows a title message and a failure where the PRD puts them: red with the change failure moved above the add form. - edits one to-do at a time now reopens the first edit: red with a draft kept per to-do. - shows the selected filter in the focus colour: red with the aria-pressed classes removed (colour rgb(230, 233, 242), not the focus token). It resolves --color-focus in the page, so it holds on any operating system. The reload test moves to Loading and empty states, beside the default-filter test it now shares a behaviour with.
toTodoList checked for data before errors, so a re-read that failed after a successful change kept showing the stale list, or an empty page, with no message while the api held the change. It now checks isError first, and a failed read at any time shows "Could not load the to-dos". The refetch-on-focus and refetch-on-reconnect switches move from the shared query client in api-client/trpc.ts (reverted to main) to the list query in useTodos, inside the folders the PRD covers, so a rebuild of the slice carries them. Removing them turns "reads the list only when the page opens and after a successful change" red. ADR 0123 and the verify skill's to-do notes say so.
procedures.ts redefined Outcome and the problem kinds. It now imports Outcome and TodoProblem from domain.ts, and ERROR_CODES is checked with `as const satisfies Record<TodoProblem['kind'], ...>`, so a new problem kind fails the type check until it has a tRPC code. `answer` becomes `unwrapOrThrow`, which says what it does. The domain test no longer asserts TITLE_MAX_LENGTH is 100, a tautology the 100 and 101 character cases already cover, so the constant is no longer exported. clearDoneTodos declares its return type like the other application functions, as a named ClearedTodos contract in the domain (anti-slop rejects an anonymous object type there); the api report names it.
The template told agents to copy Button, TextField, token and test patterns from routes/greeting/, which no longer exists. It now names routes/todos/. The trial prompts stay unchanged as recorded evidence, and ADR 0123's consequence says so.
check-prd-conflicts listed files with `git ls-files`, so in a rebuild the new slice and its spec failed the PRD's Covers globs and proof links until the agent staged them; both rehearsal agents had to. It now lists `--cached --others --exclude-standard`: every file in the working tree that Git tracks or would track. Ignored files still do not count. CI checks out a clean tree, where the sets match, so the gate is unchanged there. The script is not a guarded gate file. Red first: "counts untracked spec and source files, so a rebuild needs no staging" failed with four Covers and proof conflicts. The port is renamed listFiles and the messages say "in the working tree". ADR 0123 records the amendment to ADRs 0045 and 0058.
During the rebuild rehearsals, with a load average of 12 to 15, a full `pnpm verify` failed in two places that pass alone: - server.integration.test.ts gave the api 3 s to log "api listening" and 3 s to bind; one start took longer. Both waits are now 15 s and the tests 30 s. A healthy start takes well under a second. - tooling/trial/review.test.ts runs Oxlint in child processes, and two reviews passed Jest's 5 s default. The file now allows 30 s. Only timeouts change; every assertion stays as it was. scripts/bench/run.test.ts is unchanged. Its failure was not a timeout: pnpm reported ERR_PNPM_TARBALL_INTEGRITY. pnpm caches registry metadata per host and port (~/Library/Caches/pnpm/v11/ metadata/127.0.0.1+<port>, 84 entries here), the test's tarball is gzipped fresh each run, so a reused ephemeral port can serve a cached integrity that no longer matches. A longer timeout would not fix it; an isolated cache dir would, as a follow-up.
check-prd-conflicts and the PR body check read a behaviour's summary from its first line. Three merged behaviours wrapped their bold summary onto a second line, so the checks read them as "**Opens on the All filter, ... Clear done" and so on. Each summary now sits on one line; the wording is unchanged.
ARCHITECTURE.md still showed `answer(addTodo(input))` after the procedures renamed it. Rehearsal r7 copied the stale name and wrote a two-way ternary over the problem kind instead of the reference's lookup. The row now names unwrapOrThrow and the ERROR_CODES map checked with `satisfies Record<TodoProblem['kind'], ...>`.
The Oxlint policy test compared Oxlint's file count with `git ls-files`, so an untracked source (a rebuilt slice before it is staged) made the count disagree and failed `pnpm verify`. Rehearsal r7 had to stage its files for this test, after check-prd-conflicts stopped needing it. The test now counts `--cached --others --exclude-standard`, the files Git tracks or would track, which is what Oxlint lints. Red first: with one untracked .ts file the test failed (expected 192, received 193); it passes with the change. Assertions unchanged.
* feat(test): add present() to unwrap a value a test expects A test that needs a value it cannot prove is there wrote `?? ''` or `x.ok ? x.value.id : ''`, so a missing value turned into a call with an empty string. present() returns a defined value or the value of an ok outcome, and throws otherwise, so the test fails where it read the value. The Jest setup makes it a global, because a unit test in a package imports nothing from outside that package. Refs #337 * test(todos): unwrap values with present() and import the Todo type The api application test and the E2E spec fell back to `''` when an id was missing, so a broken setup sent an empty id on. They now unwrap each id with present(). A showcase copies the reference's e2e folder, so `e2e/fixtures.ts` holds its own present() for defined values rather than reaching into tooling/. The page test restated `Todo`; it imports the type from `./useTodos`, so the fake api follows the real shape. Refs #337 * feat(lint): add six policy rules mined from nine agent rebuilds Every rebuild of the reference feature passed every gate and still carried patterns a reviewer rejects. These six recurred and need no type information, so they fail lint now: - one-status-from-hooks: a hook returns one status union, not a query's data and flags as separate fields. - test-unwraps-values: a test unwraps with present(), not `?? ''` or an `x.ok ? ... : ''` stand-in. It also runs on E2E specs. - test-imports-the-type: a test imports a type its folder exports. - message-uses-its-limit: a message interpolates its limit constant. - import-types-from-their-owner: only a slice's index.ts re-exports. - keep-rejections: a .catch or .then handler keeps the rejection instead of returning a literal. Each rule has failing and passing fixtures taken from the rebuilds, runs in every result root, and states its fix in check:docs phrasing. Refs #337 * docs: record the six rebuild rules in the conventions and ADR 0124 CONVENTIONS.md lists each new rule beside the convention it enforces, and ARCHITECTURE.md adds the slice re-export rule to its rule table. ADR 0124 records why these six, their scopes, the present() helper and the trade-offs that keep their false-positive rate at zero. Refs #337
* feat(test): split present() from unwrap() for outcomes present(value) now fails a test on null or undefined only, and the new unwrap(outcome) takes only a success or failure outcome and fails the test with the failure. The api test unwraps its outcomes with unwrap(), a unit test holds the E2E fixtures copy of present() to the Jest global's behaviour, and policy/test-unwraps-values names the helper that fits. Refs #337 * fix(types): show the test globals to test files alone The web and api programs now exclude test files, and two test programs, tsconfig.test.json and tsconfig.api.test.json, check them with the present() and unwrap() declarations, so a production module that calls either fails pnpm typecheck with TS2304. The showcase inclusion test seeds that call in a web and an api module to prove it. Refs #337 * fix(lint): resolve query reads through scope in one-status-from-hooks one-status-from-hooks now counts only roots bound by a const to useQuery, useSuspenseQuery or useInfiniteQuery, reads the status inside a lookup such as LIST_STATES[list.status] (r7 and r8), and leaves error and isFetching out of the count. It and keep-rejections resolve each name through the scope chain instead of a file-wide map, so a same-named binding in another function no longer decides the result. Fixtures cover r7, r8, the four reviewed false positives and shadowed names. Refs #337 * fix(lint): match only limits written as counts in message-uses-its-limit The rule now considers module constants named as a limit (MAX, MIN, LIMIT, LENGTH and their kin, in snake or camel case) and matches the number only when a word follows it, in plain or grouped form such as 1,000. It skips JSX attribute values and import sources. Fixtures cover a grouped count, JSX text, and the reviewed false positives: COLUMNS with gap-10, ICON_SIZE with a viewBox, MAX_PERCENT with 100%, PORT in a URL and PAGE_SIZE beside "Ages 20 and over". Refs #337 * fix(lint): narrow the two test rules to the shapes they target test-unwraps-values reports an x.ok ternary only when its other branch reads x.value, so response.ok ? 'passed' : 'failed' passes. test-imports-the-type anchors its export pattern to the start of a line, so text in strings and comments no longer counts, and scans each folder once until a module in it changes. Fixtures and a unit test cover both. Refs #337 * refactor(lint): rename the re-export rule to reexport-only-from-index The rule bans every re-export in a slice module, not only types, so its name now says that. It also stops exempting a nested index file: only the slice's own index.ts is a public surface, as no-restricted-imports already holds, so src/routes/todos/components/index.ts fails too. No rebuild had a nested barrel. The ADR, conventions and architecture rows use the new name. Refs #337 * docs(lint): name the sanctioned way to ignore a rejection in ADR 0124 keep-rejections now tells the reader to settle a promise with Promise.allSettled when ignoring its failure is intended, and the ADR and conventions show both forms, which pass lint:policy, lint:anti-slop and Biome. The ADR drops the zero false-positive claim and the note about pre-commit, which PR #340 changes, and records r7 and r8 and the five shapes review found. Refs #337
…pre-commit (#340) * feat(lint): make Oxlint the only linter and run every lint gate at pre-commit Biome now only formats and orders imports. Oxlint runs native equivalents of Biome's lint rules, a naming plugin for package sources, and the React rules that Biome's React domain never ran here. Pre-commit now runs policy lint, the style check, the suppression ban and the architecture gate, as BulletproofRepository does (ADR 0123, ADR 0124). Refs #336 * docs(adr): record pre-commit step timings with Oxlint owning all lint * docs(adr): renumber the pre-commit and Oxlint ADRs to 0125 and 0126 PRs #335 and #341 merge first and keep ADRs 0123 and 0124, so this branch moves its records to 0125 (pre-commit runs every gate) and 0126 (Oxlint owns all lint) and updates every link and comment to match. * feat(lint): restore Biome's React and test domain rules in Oxlint Biome's React domain ran in apps/web and packages/ui, and its test domain ran under the root package. Add react/no-danger, react/no-children-prop and the jest plugin's no-focused-tests, no-export and no-duplicate-hooks. Match Biome's strength: no-unused-vars checks every argument and catch binding, no-sequences rejects parenthesised commas, and no-empty-function, func-style and no-multi-assign cover the rest of noEmptyBlockStatements, useArrowFunction and noAssignInExpressions. Enable oxc/bad-min-max-func, oxc/approx-constant and oxc/misrefactored-assign-op. Drop the nextjs/google-font-display rule, whose plugin never loaded, and the empty import plugin. The repository has no findings under the new rules. * feat(lint): check every name Biome's naming convention checked The naming plugin covered declarations and parameters only. Add object, class and type members, import and export aliases, catch parameters, destructured, defaulted and rest bindings, function and class expression names, index signature parameters and namespaces. Enum members are PascalCase only, a top-level function may be UPPERCASE, static and readonly members may be CONSTANT_CASE, and catch parameters are camelCase. Mirror Biome's exceptions: quoted keys that are not identifiers, shorthand destructured properties, named imports kept under their own name, override members and declarations inside declare module or declare global. A 60-case Oxlint run asserts each visitor against the names Biome 2.5.1 reports on the same source. * docs(adr): correct the Biome rule inventory and record lint losses Biome's React domain ran six rules in apps/web and packages/ui and its test domain ran three rules under the root package, so ADR 0126 now counts 230 Biome rules, maps the domain rules to their Oxlint replacements and drops the claim that none of the lost rules is a correctness check. Record that noThisInStatic, noImplicitAnyLet and noFlatMapIdentity now run in result sources only, and leave duplicate JSON keys and CSS properties as an open question with two options for the maintainer. State the naming convention's real coverage in CONVENTIONS, the empty-function and caught error rules, and the new pre-commit and lint ownership in QUALITY_GATES, the North Star and an amendment note on ADR 0002. * feat(lint): keep Biome's linter for JSON and CSS files Oxlint cannot parse JSON or CSS, so with Biome's linter fully off nothing reported a duplicate JSON key or a duplicate CSS property. The maintainer chose to keep Biome's recommended rules for .json, .jsonc and .css files through one biome.json override; every other file stays formatter only. The staged pre-commit step and pnpm check run the override, and the tree has no finding under it. Tests seed a duplicate JSON, JSONC and CSS key and a TypeScript file that Biome must leave alone. ADR 0126, TECH_STACK, QUALITY_GATES, PR_QUALITY, the North Star and the hook label record the exception.
Bring in #340 (Oxlint owns all code lint; ADRs 0125 and 0126). Conflicts resolved: - oxlint.config.ts: keep the E2E test-unwraps-values override and add the naming and file-name override from main. The six rebuild rules stay in the result-root override; generalRules spreads into the root. - scripts/oxlint-policy.test.ts: take main's policyOnly filter and keep the branch's slop-* fixture prefix. - tooling/trial/inclusion.test.ts: take main's Oxlint file-name test, seeded under routes/todos. - CONVENTIONS.md: take main's naming rows with the to-do examples. - PR_QUALITY.md: keep six typecheck programs; take main's lint wording.
- Add a five-line unwrap to apps/web/e2e/fixtures.ts, hold it to the
Jest global in the test-globals parity table, and point the
test-unwraps-values unwrap message at ./fixtures for E2E specs.
- Reword ADR 0124 so test-imports-the-type ignores export type inside
a string or comment that does not start a line.
- Record in ADR 0124 that a limit not followed by a word, such as
`at most 100.` or `100-character`, passes message-uses-its-limit.
- Key the siblingScans cache on directory and extension mode, store
{ signature, types } and replace the entry when the signature
changes, so a language server cannot grow it without bound.
main's naming override and the branch's E2E test-unwraps-values override both survive the merge, so the config now has five overrides. toEqual ignores trailing undefined items, so only the plugins list caught the change; both lists now name five.
The focus-colour test passed when the style sat on :focus, because the clicked Done button kept focus. Check All before any click, move focus to the title field before the checks and require Active to keep the standard colours. Red against focus:border-focus focus:text-focus: All showed rgb(230, 233, 242) where the focus colour rgb(74, 222, 128) was due.
A second submit could land before the render that disables Add, so a double click or a double Enter stored the to-do twice. addTodo now calls the mutation only while no change is pending, read live from the query client. The PRD gains the behaviour and the E2E test that proves it. Red against a build without the onMutate re-render and without the guard: the list held two copies of Clicked (5 of 5 runs), and with a single click the double Enter alone stored Entered twice (3 of 3).
'says so when the list fails to load after a change' now also checks that Clear done is gone, then lets todos.list through again, adds Third and expects the full list with no alert. The PRD behaviour states the recovery. Red against a sticky-failure mutant that keeps the failed state once the query has ever errored (errorUpdateCount > 0): the list never came back (0 checkboxes where 3 were due).
pnpm e2e now runs its own servers 1000 above the pnpm dev ports (ADR 0123), so a trial's e2e check needs 6173, 4001, 6183 and 4011 as well. Both tasks list them, so the harness refuses to begin when one is busy and stops a server the agent left on one. The task files are live harness config, not frozen evidence: run-trial hashes them into each new record's harness.sha256 and leaves recorded trials as they are. ADR 0034 names the eight ports.
Its worst case is the 15-second log wait, the 15-second socket wait and the 5-second request, 35 seconds in all, so the 30-second test timeout could end a slow start before its own waits reported why. The timeout is now 40 seconds.
pnpm check:docs reads untracked files, so an untracked draft PRD in docs/prd/ fails it locally. Two pnpm e2e runs on one machine no longer share servers; the second fails fast with 'is already used'. One line in QUALITY_GATES says both, so neither reads as a new bug.
Enforcement sign-offRan at Monday, the 9th of November, at 12:05 am on commit This PR changes gated enforcement or product intent, so it needs sign-off.
@BenSheridanEdwards: tick to approve.
|
|
Parking this to-do reference-app PR until the remaining open issues are closed (the six rebuild lint rules and the other outstanding issues). No further work here until then. |
|
Closing as superseded, per Ben's decision on 12 Nov 2026 ("Yes, restart from main and close both"). The to-do reference app will land again from current main as a sequence of PRs of 400 lines or fewer. The decision record is ADR 0123 in #359. The phase-0 fixes this branch carried are already split out: #356 (e2e servers on their own ports), #357 (skip deleted slices in the changed-coverage gate) and #358 (fresh pact runs and integration-test room). This branch is kept as the source for the re-cut PRs. |
Why does this feature exist?
Loading…state that vanished, and list refresh timing. The greeting page also carried a promise from another feature's PRD. The to-do PRD therefore specifies every visible detail, and each detail has an E2E test.What changed?
This is one idea above 400 lines: swapping the reference feature touches its PRD, specs, code, generated reports, docs and the tooling tests that read the real tree, and none of them is consistent without the others.
361d07b):docs/prd/todos.md, each behaviour linked to an E2E test (31 behaviours and 43 linked tests after the review round below; 32 and 44 after the final check), and ADR 0123 (Proposed), which amends ADRs 0032 and 0107.065fb41):apps/web/e2e/todos.spec.ts(34 tests; 39 after the review round, 40 after the final check), a rewrittenaccessibility.spec.ts(4 scans) andvisual.spec.ts. All 38 failed before the feature existed.todos.spec.tsis the only spec that writes to the shared in-memory list; it runs in order in one worker and empties the list before each test. The accessibility and visual specs serve their owntodos.listanswer (serveTodos.ts).eb6423a): apifeatures/todoswith title rules and state changes indomain.ts, the in-memory list inintegrations.ts, outcomes mapped toBAD_REQUEST/NOT_FOUNDinprocedures.ts; webroutes/todoswithuseTodos(changes wait for the list re-read),useTodoForm+todoFormSchema(Effect Schema),useTodoFilter,useTodoEditingand one component per file. The@repo/uiButton dims when disabled. Greeting and recent greetings are deleted with their PRDs, specs and API reports.AppRouternow has only thetodosrouter (list,add,setDone,rename,delete,clearDone);apps/api/etc/*.api.mdandapps/web/etc/*.api.mdare regenerated.02c0621): tests that read the real tree use the to-do files; synthetic fixtures that named greeting files now name to-do files.796980d); the Pact consumer test merged into a staleweb-api.jsonand now starts from a fresh file (a60f859).3f8317d..a26be0c), each new test captured red first:8bad3c2): a list re-read that failed after a successful change left the page empty with no message while the api held the change.toTodoListnow checksisErrorfirst, so any failed read showsCould not load the to-dos. New PRD behaviour "Says so when the list fails to load after a change".8bad3c2):apps/web/src/api-client/trpc.tsis reverted tomain; the list query inuseTodossetsrefetchOnWindowFocus: falseandrefetchOnReconnect: false, so a rebuild of the PRD's Covers folders carries them. ADR 0123 updated.19a5221,9d7c601): "the api answers each change with its result" (setDone and rename outputs,{ id }from delete,{ ids }oldest first from clearDone); ARIA snapshots for the blank-title state and for a failed delete with its alert betweenAddandFilter; reopening Edit on the first to-do reads its title again; "shows the selected filter in the focus colour", a computed-style check against the page's own--color-focus, so it holds on any OS (one rebuild had no visible selection).19a5221,c98007a): behaviours grouped under the spec's describe blocks; blank and over-long titles, the filter behaviours, the Clear done behaviours, the default-filter behaviours and the api answers merged (36 to 31, no test lost); the reference-feature paragraph moved to ADR 0123; "Works for every visitor" renamed "Passes the automated WCAG 2.1 A/AA scan".3f8317d): Playwright starts its own servers on ports 1000 above the dev ports (6173 and 4001) withreuseExistingServer: false. Before,pnpm e2ebesidepnpm devreused the dev api and emptied its to-dos; now three runs besidepnpm devpassed and left the dev list byte-identical, and a busy port fails the run with "already used".check-prd-conflictscounts untracked files (9bd661f): it listsgit ls-files --cached --others --exclude-standard, so a rebuilt slice passes before it is staged; ignored files still do not count. The script is not a guarded gate file. CI checks out a clean tree, so the gate is unchanged there; locally it now also accepts untracked specs and sources. ADR 0123 records the amendment to ADRs 0045 and 0058.procedures.tsimportsOutcomeandTodoProblemfromdomain.ts, checksERROR_CODESwithas const satisfies Record<TodoProblem['kind'], TRPCError['code']>and renamesanswertounwrapOrThrow; the tautologicalTITLE_MAX_LENGTHtest and export are gone;clearDoneTodosreturns a namedClearedTodos(cf7d1ec)..agents/templates/list-route.mdpoints atroutes/todos/; trial prompts are unchanged (dbccf3c).ea14e53,a26be0c):ARCHITECTURE.mdstill named the oldanswerhelper, and r7 copied it with a ternary instead of the lookup map, so the row now namesunwrapOrThrowand theERROR_CODESmap.scripts/oxlint-policy.test.tscompared Oxlint's file count with tracked files only, so r7 had to stage its slice; it now counts untracked, unignored files too (captured red with one untracked file).c5858ee): the integration test's api startup wait goes from 3 s to 15 s andtooling/trial/review.test.tsallows 30 s; only timeouts change.scripts/bench/run.test.tsis unchanged: its failure is a stale pnpm metadata cache keyed by127.0.0.1+<port>, not a timeout (see the commit body).a3c434d): this branch now includes feat(lint): add six policy rules mined from nine agent rebuilds #341 and fix(lint): apply the review fixes to the six rebuild rules #342 (six policy rules mined from the rebuilds, ADR 0124) and main through feat(lint): make Oxlint own all code lint and run every lint gate at pre-commit #340 (Oxlint owns all code lint, Biome formats and lints JSON and CSS, pre-commit runs every gate; ADRs 0125 and 0126). Main was merged in, not rebased, so no shared commit was rewritten. Conflicts resolved:oxlint.config.ts: both overrides kept, the E2Epolicy/test-unwraps-valuesoverride and feat(lint): make Oxlint own all code lint and run every lint gate at pre-commit #340's naming and file-name override. The six rules stay in the result-root override;tooling/oxlint-general-rules.tsspreads into the root rules.scripts/oxlint-policy.test.ts: feat(lint): make Oxlint own all code lint and run every lint gate at pre-commit #340'spolicyOnlyfilter, plus this branch'sslop-*fixture prefix.tooling/trial/inclusion.test.ts: feat(lint): make Oxlint own all code lint and run every lint gate at pre-commit #340's Oxlint file-name test, seeded underroutes/todos.CONVENTIONS.mdandPR_QUALITY.md: feat(lint): make Oxlint own all code lint and run every lint gate at pre-commit #340's naming and lint wording with the to-do examples and the six typecheck programs.scripts/oxlint-rule-set.test.ts(c19faad): the config now has five overrides; the test counted four.pnpm lint:policyreports 0 diagnostics), so no code changed for them.34ce0fb..f2ff9e6), each new or tightened test captured red against a mutant first:aria-pressed, not focus (34ce0fb): "shows the selected filter in the focus colour" passed with the style on:focus, because the clicked Done kept focus. It now checks All before any click, moves focus to the title field before the checks and requires Active to keep the standard colours. Red againstfocus:border-focus focus:text-focus: All showedrgb(230, 233, 242)wherergb(74, 222, 128)was due.a0b55d6): a second submit could land before the render that disables Add, so a double click or a double Enter stored the to-do twice (the r9 rehearsal finding).addTodonow calls the mutation only whilequeryClient.isMutating()is 0. New PRD behaviour "Pressing Add or Enter again while an add waits sends nothing" and E2E test "stores one to-do when Add is pressed twice quickly" (dblclick, then twopress('Enter'), then the api holds exactlyClicked,Entered). Red against a build without theonMutatere-render and without the guard: 5 of 5 runs stored twoClicked; with a single click, the double Enter alone storedEnteredtwice in 3 of 3. The guard alone, withonMutatestill removed, passed 5 of 5.483b2ab): "says so when the list fails to load after a change" also checks Clear done is gone, thenpage.unrouteAll({ behavior: 'wait' }), adds Third and expectsFirst,Second,Thirdwith no alert. The PRD behaviour states the recovery. Red against a sticky-failure mutant (isError || errorUpdateCount > 0): 0 checkboxes where 3 were due.3c574b4):tooling/trial/tasks/todo.jsonandnotes.jsonalso list 6173, 4001, 6183 and 4011, the serverspnpm e2estarts in a trial. The task files are live harness config, not frozen evidence:run-trial.mjshashes them into each new record'sharness.sha256and leaves recorded trials as they are. ADR 0034 names the eight ports.2da7079):TEST_TIMEOUTis 40 s, above the test's own worst case (15 s log wait, 15 s socket wait, 5 s request).f2ff9e6): one line inQUALITY_GATES.md: an untracked draft PRD indocs/prd/now failspnpm check:docslocally, and a secondpnpm e2eon one machine fails fast withis already usedinstead of sharing servers.bf475aa), each test-first:apps/web/e2e/fixtures.tsgains a five-lineunwrap, held to the Jest global in thetest-globals.test.tsparity table, and thepolicy/test-unwraps-valuesunwrap message points E2E specs at./fixtures; thepolicy/test-imports-the-typesibling cache keys on folder and extension mode, stores{ signature, types }and replaces an entry when its folder changes, so it cannot grow without bound in a language server; ADR 0124 states the string-or-comment boundary and records that a limit not followed by a word passespolicy/message-uses-its-limit.run-e2e-tests,write-unit-testsandverify-agentic-templateskills (both copies). AGENTS.md changes one line, the golden-rule example path, as Chief approved.docs/prd/**(addstodos.md, deletesgreeting.mdandrecent-greetings.md; the review round and the final check changedtodos.mdagain, so the sign-off must be ticked on this head),docs/NORTH_STAR.md(two lines name the to-do app),oxlint.config.tsandtooling/oxlint-plugin-policy.js. Against main these now carry the six rebuild rules from feat(lint): add six policy rules mined from nine agent rebuilds #341 and fix(lint): apply the review fixes to the six rebuild rules #342 (ADR 0124), their E2E override and the follow-up below, as well as an example path in one message each. No existing rule, severity or budget is loosened.Behavioural Proof (with video and screenshots)
page.route.Empty list on the All filter, with Clear done disabled:
Blank title rejected with
Enter a title:A list with a done to-do (
Buy milkwas typed and is shown asBuy milk):An open edit:
The Active filter:
A failed add keeps the typed title and says so:
apps/web/src/routes/todos/TodosPage.test.tsx,todoFormSchema.test.ts,todoFilter.test.ts;apps/api/src/features/todos/{domain,application,procedures}.test.ts;router.test.ts,server.integration.test.tsand the Pact contract cover the api over HTTP. Line coverage of both feature folders is 100%.docs/prd/todos.mdlinks to its test inapps/web/e2e/todos.spec.tsorapps/web/e2e/accessibility.spec.ts;pnpm check:docschecks the links.Verification Summary
docs/prd/greeting.mdanddocs/prd/recent-greetings.md, removed with their features. The PR quality check accepts only PRDs tracked at the head underPRDs checked, so they are listed here.a3c434dcf47d2373db530d3e206bd6a15e8b76ebpnpm verify,pnpm e2e):pnpm install --frozen-lockfile,pnpm lint:anti-slop,pnpm verify,pnpm e2e, and the real pre-push hook on every push.pnpm verifypasses at this head, run alone and in the pre-push hook (80 tooling, web and api suites, 3108 Jest tests, contract, integration, changed-file coverage, build and size). JS bundle 108.73 kB of 110 kB; CSS 2.65 kB of 5 kB; coverage 100% in both feature folders.pnpm e2epasses 45 tests (40 intodos.spec.ts) at this head, run alone and in the pre-push hook; the three runs beside a runningpnpm devwere ata26be0c. Budgets unchanged..agents/project/PR_QUALITY.md) satisfied, or each gap named: satisfied locally; the visual baselines come from the hosted runner (see risks).pnpm verifypnpm e2e.agents/project/ARCHITECTURE.mdandCONVENTIONS.md; new decisions recorded as ADRs.tooling/trial/todo-prompt.md,notes-prompt.md) still name the greeting reference. They are recorded evidence and stay unchanged;.agents/templates/list-route.mdnow points atroutes/todos/.Visual regressionis not a required check, so a rebuild can drop the selected filter's style and still merge. The new computed-style E2E test pins that one detail; making the visual lane required is a branch-protection call left to you.pnpm e2enow uses ports 6173 and 4001. WithE2E_BASE_URL, the api still starts on :3001 and fails ifpnpm devholds it.scripts/enforcement-approval.test.tskeeps syntheticdocs/prd/greeting.mdpaths, so this PR rewrites no more gate tests than it must.Could not load the to-dosand logs one failed request; accessibility and layout-shift assertions still apply.a26be0c, before the main merge: two fresh clean runs (git rm -rof both slices, thenclaude -pwith the exercise prompt) passedpnpm verifyandpnpm e2efirst time with no human input (r8: 743 s, $2.70; r9: 699 s, $2.64; my ownpnpm verifyandpnpm e2ere-run on each passed). The behaviour probe matched the original for r8; r9 differed in one unpinned detail (a fast double Enter stored two to-dos), now pinned and fixed ina0b55d6, and in page padding, recorded for a follow-up. Both agents still staged their slice becausescripts/blast-radius.test.tslists tracked files and pins the reference's file names; that is a follow-up, not changed here.PRD Behaviours to Review
docs/prd/todos.md: Shows a loading message until the list arrives. Evidence:todos.spec.tstest "shows a loading message until the list arrives" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Opens on the All filter, with an empty message and a disabled Clear done when there are no to-dos. Evidence:todos.spec.tstest "starts on the All filter with an empty message when there are no to-dos";todos.spec.tstest "returns to the All filter when the page reloads" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Says so when the list fails to load. Evidence:todos.spec.tstest "says so when the list fails to load" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Shows only the parts listed above. Evidence:todos.spec.tstest "shows only the parts the PRD lists";todos.spec.tstest "shows a title message and a failure where the PRD puts them" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Adds a to-do to the end of the list. Evidence:todos.spec.tstest "adds a to-do to the end of the list" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Stores and shows each title normalised. Evidence:todos.spec.tstest "stores and shows a title with its whitespace normalised" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: The api normalises every title it receives. Evidence:todos.spec.tstest "the api normalises a title from any client" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Rejects a blank or over-long title and sends nothing. Evidence:todos.spec.tstest "asks for a title and sends nothing when the title is blank";todos.spec.tstest "rejects a title over 100 characters and sends nothing" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Clears the title message once the title is fixed. Evidence:todos.spec.tstest "clears the title message once the title is fixed" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Accepts a title of exactly 100 characters, counted after normalising. Evidence:todos.spec.tstest "accepts a title of exactly 100 characters after normalising" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: The api rejects an invalid title as a bad request. Evidence:todos.spec.tstest "the api rejects a blank or over-long title as a bad request" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: The api answers each procedure as The api table says. Evidence:todos.spec.tstest "the api lists to-dos oldest first";todos.spec.tstest "the api answers each change with its result";todos.spec.tstest "the api answers not found for an unknown to-do" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Shows an add only once the api has answered and the list is re-read. Evidence:todos.spec.tstest "shows an add only once the api has answered and the list is re-read" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Pressing Add or Enter again while an add waits sends nothing. Evidence:todos.spec.tstest "stores one to-do when Add is pressed twice quickly" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Keeps the typed title and says so when adding fails. Evidence:todos.spec.tstest "keeps the typed title and says so when adding fails" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Marks a to-do done and active again, in place. Evidence:todos.spec.tstest "marks a to-do done and active again in place" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Disables every change control while a change waits. Evidence:todos.spec.tstest "disables every change control while a change waits" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Leaves the to-do unchanged and says so when marking it fails. Evidence:todos.spec.tstest "leaves the to-do unchanged and says so when marking it fails" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Edits a title in place, normalised. Evidence:todos.spec.tstest "edits a title in place and normalises it" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Cancels an edit without saving. Evidence:todos.spec.tstest "cancels an edit without saving" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Checks an edited title like a new one. Evidence:todos.spec.tstest "checks an edited title like a new one" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Edits one to-do at a time. Evidence:todos.spec.tstest "edits one to-do at a time" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Keeps the edit open and says so when saving fails. Evidence:todos.spec.tstest "keeps the edit open with the typed title and says so when saving fails" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Deletes a to-do at once. Evidence:todos.spec.tstest "deletes a to-do at once" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Keeps the to-do and says so when deleting fails. Evidence:todos.spec.tstest "keeps the to-do and says so when deleting fails" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Filters to active or done to-dos and back to all, and shows which filter is selected. Evidence:todos.spec.tstest "filters to active or done to-dos and back to all";todos.spec.tstest "shows the selected filter in the focus colour";todos.spec.tstest "hides a to-do from the Active filter once it is marked done";todos.spec.tstest "shows the empty message when a filter matches nothing" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Clears every done to-do, whatever the filter, and only while one is done. Evidence:todos.spec.tstest "clears every done to-do whatever the filter";todos.spec.tstest "enables Clear done only while a to-do is done" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Keeps the done to-dos and says so when clearing fails. Evidence:todos.spec.tstest "keeps the done to-dos and says so when clearing fails" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Shows only the latest failure, until the next change starts. Evidence:todos.spec.tstest "shows only the latest failure and clears it when the next change starts" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Says so when the list fails to load after a change. Evidence:todos.spec.tstest "says so when the list fails to load after a change" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Reads the list when the page opens and after each successful change. Evidence:todos.spec.tstest "reads the list only when the page opens and after a successful change" passes locally and in the pre-push hook atf2ff9e6(45 passed).docs/prd/todos.md: Passes the automated WCAG 2.1 A/AA scan. Evidence:accessibility.spec.tstest "the empty to-do page has no detectable WCAG A/AA violations";accessibility.spec.tstest "the to-do list has no detectable WCAG A/AA violations";accessibility.spec.tstest "the validation error state has no detectable WCAG A/AA violations";accessibility.spec.tstest "an open edit has no detectable WCAG A/AA violations" passes locally and in the pre-push hook atf2ff9e6(45 passed).PR Proof Law
.agents/project/PR_QUALITY.mdand.agents/skills/pr-quality-contract/SKILL.md; thePR qualitycheck verifies the proof format.