Files
loki/REVIEW.md
T
CatoandClaude 839f35ef6c fix(feedback): one inbox surface, project links by id, a render harness (#961)
Landing from Implement on /feedback?project=<id> printed "Nothing waiting
on you for 5936f8fb-…": the inbox filtered by project NAME and showed the
reader the id, on a page whose chips, stat cards and section heads were
each drawn in a different style. Every check was green; nobody had
rendered it.

- The ?project= filter resolves a name or an id against the data; an
  unknown value filters nothing instead of printing itself.
- A project-scoped view names its subject ("Showing petvity · 1 open ·
  All projects"), scrolls the active chip into view, and drops the
  per-row project chip. An empty project view says what is shipped and
  offers "Show all projects" / "Open <project>".
- One chip primitive (ui-inbox-project) for project and source filters;
  sections use the ui-inbox primitives; the three stat cards are one line
  (metricsLine, pure).
- A failed row has one primary button: the provider switch (or Retry);
  Watch steps down to secondary.
- Any refused feedback run gets one automatic second attempt; only
  commands the runner could not read, dead credentials and a missing
  workspace still stop. Test updated.
- scripts/preview/build-feedback-preview.mjs renders the real inbox with
  fixture rows in headless Chromium at 390 and 1280, dark and light, for
  every ?project= shape, failing on overflow or a console error. REVIEW.md
  records the definition of done this adds; responsive-design.md documents
  the harness.


Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 07:09:06 -07:00

3.4 KiB

REVIEW.md — loki review bar

Judge the DIFF against these gates, in order. Flag correctness and requirement gaps only — lint owns style. Global standards load via CLAUDE.md; this file is ONLY loki's scars.

Fatal invariants (one violation = block)

  1. API envelope is {ok: true|false} — NOT the global {success, data} convention. This repo deliberately overrides it (see CLAUDE.md).
  2. Dispatch/orchestration state has ONE owner — no new /tmp signal files, no new claude-* compat paths, no second writer to dispatch status. The split-authority loop is the repo's #1 historical bug source (13 of 15 recent commits were dispatch reliability fixes). Regression net: scripts/test/ dispatch tests — extend, never bypass.
  3. Design system — only ui-* component classes + tokens from globals.css; no arbitrary hex/radius/shadow. Check check:design passes.
  4. Runner protocol changes need a runner RELEASE — publishing goes through the loki-releases feed (NOT loki); a protocol change without a release strands every installed runner.

Repo gotchas that have bitten before

  • Tailwind v4 silently drops an entire @layer components block if any rule uses a responsive variant inside @apply (e.g. sm:p-6) — no error. If component classes vanish, check this first.
  • bashrc zellij auto-attach can hijack a runner-owned PTY — guard with $BASH_EXECUTION_STRING (already in dotfiles; don't regress it).

Process gates

  • npm run test:unit green (auto-discovers scripts/test/*.ts); CI green on PR.
  • Diff updates CLAUDE.md/docs if it changes documented structure/behavior.
  • Second fix of the same bug class ships the rule/test that ends the class.

Definition of done for a page (a scar, 2026-09-28)

A PR that adds a link to a page is not done until the target page has been RENDERED with what that link carries and LOOKED AT at 390px. Not the source read, not the types checked: the pixels.

What happened: #959 sent an owner from My feedback to /feedback?project=<id>. The inbox filtered by project NAME, so the page printed "Nothing waiting on you for 5936f8fb-7239-…" at the person who had just pressed Implement — on a page whose chips, stat cards and section heads were each drawn in a different style. Every check was green. The owner found it on his phone.

Two rules, both mechanical:

  1. A link carries what the target reads. Before wiring href to ?param=, open the target and read how it consumes that param (name vs id, slug vs uuid). If the two disagree, the target resolves both, and the PR says so. Never trust that a page "takes a project".
  2. Render before claiming. node scripts/preview/build-feedback-preview.mjs renders the real /feedback inbox with fixture rows at phone and desktop widths, in both themes, for every ?project= shape, and fails on horizontal overflow or a console error. Run it and OPEN the PNGs in .tmp/feedback-preview/ — the tool cannot see ugly, only broken. A new surface that has no harness gets one in the same PR (copy that script: esbuild + shims for next/link and next/navigation, globals.css through @tailwindcss/postcss, a mocked fetch); the harness does not need a database or a session, which is exactly why "I could not test it in the sandbox" is not a reason.

The same sentence, from the person who found it: "before you say that something is done, why would you not go through it and test it?"