Skip to content

chore(ship): disable biome useLiteralKeys + clear lint errors - #451

Open
sarath-soman wants to merge 1 commit into
mainfrom
chore/clear-biome-baseline
Open

chore(ship): disable biome useLiteralKeys + clear lint errors#451
sarath-soman wants to merge 1 commit into
mainfrom
chore/clear-biome-baseline

Conversation

@sarath-soman

Copy link
Copy Markdown
Contributor

Summary

  • Disable complexity.useLiteralKeys in biome.json — the rule rewrites process.env[\"X\"]process.env.X but tsconfig has noPropertyAccessFromIndexSignature: true, which requires bracket notation. The rules directly conflict; tsc strict config wins as project truth.
  • Hand-fix the 6 error-level lint findings biome was reporting (see commit message for the per-file breakdown).
  • 5 trivial import-sort auto-fixes from biome check --write.

Surfaced while triaging the V-2 (#429) SWE-run halt on am-i-done.ts. The biome layer was the noisiest; clearing it makes future SWE runs less likely to halt on pre-existing baseline noise.

What this does NOT do

Two further baseline layers exist and are out of scope:

  • no-throw-in-source violations in src/lib/capability-cleanup.ts (2 throws) — needs proper neverthrow refactor of the function + callers
  • tsc errors in docs/capabilities/observe-a-run/design/prototype/*.tsx reachable via src/gallery/entries.ts — the prototypes live outside src/ so their imports don't resolve. The fix (per discussion) is relocating prototypes into src/gallery/ rather than reaching out to docs/.

Both will land as separate tracked work.

Test plan

  • bun scripts/am-i-done.ts — biome layer now passes (no errors, no warnings)
  • bun test src/web/ui/NowBar.test.tsx — updated to query <section> shape instead of [role=\"region\"]; 8/8 pass
  • bun tsc --noEmit — no new errors introduced
  • Full sweep: 244 pass, 1 pre-existing Happy-DOM-global-registration flake (unrelated to this diff)

🤖 Generated with Claude Code

Biome's `useLiteralKeys` rule (auto-enabled via "recommended": true) rewrites
`process.env["X"]` → `process.env.X`. This directly conflicts with the
project's tsconfig flag `noPropertyAccessFromIndexSignature: true`, which
requires bracket notation on index-signature types. The conflict was causing
`bun scripts/am-i-done.ts` to block on ~150 mechanical lint findings that
can't actually be auto-fixed without breaking tsc.

Resolution:
- Disable `complexity.useLiteralKeys` in biome.json (incompatible with our
  tsc strict config — the project's choice on tsc side is the source of truth)
- Hand-fix the 6 error-level lint findings biome was reporting:
  - `server-sse.test.ts:203` — replace `!` non-null assertions with `as string`
  - `topology-evolve.ts:279` — replace `eslint-disable` with `biome-ignore` for
    the intentional yield-less async generator
  - `RealiseDagGraph.tsx:66,73` — wrap `forEach((id, i) => Map.set(...))` in
    braces (Map.set returns the map; forEach callbacks shouldn't return)
  - `NowBar.tsx:34` — replace `<div role="region">` with `<section>` (per
    a11y/useSemanticElements); update NowBar.test.tsx to query the new shape
  - `JsonView.tsx:82` — `// biome-ignore lint/suspicious/noArrayIndexKey` (JSON
    array order is stable; index is the only stable key)
- 5 import-sort auto-fixes applied by `biome check --write` (mechanical)
- `runs-root.test.ts:41` — escape literal `${HOME}` in test description so
  biome doesn't read it as an unintended template literal

Unblocks the `am-i-done.ts` biome layer. Two remaining baseline layers
(no-throw violations in `capability-cleanup.ts`; tsc prototype-reach via
`gallery/entries.ts`) are out of scope here — separate concerns to be tracked.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
sarath-soman added a commit that referenced this pull request May 26, 2026
…header

Productionises the OutcomeHeader prototype (per design.md sub-flow 2) and
swaps it in for the legacy state-strip + MetaGrid block in RunDetail at
lines 131-194. Three render branches (complete / failed / running):

- complete → state pill, output-links row (PR anchors), aggregate
  `{duration} · ${cost} · {tokens}` in mono muted-text
- failed → pill `failed · <phase>` (failing phase prominent per V-2
  acceptance), alert block with errorSummary line
- running → pill `running · <phase>`, no output line, Rerun disabled

Source: `docs/capabilities/observe-a-run/design/prototype/OutcomeHeader.tsx`
(prototype shape preserved verbatim; imports rewired to in-package paths).

Phase / errorSummary / aggregates derived from the existing RunDetail
payload + telemetry:
- headerPhase: r.current_phase ∥ r.failed_at_stage ∥ r.halted_at_stage
- errorSummary: r.failed_reason ∥ r.halted_reason
- aggregates: sum of per-stage telemetry (existing data path)

Conflict + rerunError banners remain outside the header.

Test coverage:
- new OutcomeHeader.test.tsx — claims 1 (three branches mount), 2 (complete
  shape), 3 (failed shape), 4 (running shape), 5 (onRerun fires), 9 (static
  no-hex source scan)
- extended RunDetail.test.tsx — claims 7+8 (failed-run integration);
  GlobalRegistrator.register() now guarded behind a document-presence check
  so it composes with NowBar.test.tsx in a single bun test run

Closes #429.

This PR was produced by the SWE-pipeline implementer agent (run
`2026-05-25-232338-issue-429`) but the pipeline halted at impl on Claim 10
(`bun scripts/am-i-done.ts`) because of pre-existing baseline lint/throw
violations in unrelated files. All 9 in-scope claims (1-9) passed:
- bun test src/web/lib/OutcomeHeader.test.tsx → green (claims 1-5, 9)
- bun tsc --noEmit → no new errors
- bun test src/web/pages/RunDetail.test.tsx → green (claims 7-8)
- biome check on the four touched files → clean (claim 6 spirit)

Committing manually so the work ships while baseline cleanup proceeds
separately. Related cleanup tickets:
- #451 (chore: biome useLiteralKeys conflict cleared) — first layer
- #452 (refactor: relocate prototypes into src/gallery/) — second layer (tsc)
- #450 (feat: impl emits session-id so --resume continues in-context) —
  prevents the next round of cheap-halt-recovery from costing $8 in tokens

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
sarath-soman added a commit that referenced this pull request May 26, 2026
…header (#453)

## Summary

- Productionises the `OutcomeHeader` prototype from
`docs/capabilities/observe-a-run/design/prototype/OutcomeHeader.tsx`
into `ship/src/web/lib/OutcomeHeader.tsx`. Three render branches
(complete / failed / running) with explicit failing-phase prominence and
aggregate cost/tokens/duration row.
- Swaps it in for the legacy state-strip + `MetaGrid` block in
`RunDetail.tsx` (lines 131-194).
- Extends `RunDetail.test.tsx` with failed-run integration coverage
(claims 7+8); guards `GlobalRegistrator.register()` so happy-dom tests
compose in one `bun test` run.

Closes #429.

## Why manual

Produced by the SWE-pipeline implementer agent (run
`2026-05-25-232338-issue-429`), which halted at impl on `bun
scripts/am-i-done.ts` Claim 10 due to **pre-existing baseline lint/throw
violations in unrelated files** — not caused by this change. All 9
in-scope claims passed. Committing manually so V-2 ships while the
baseline-cleanup tickets proceed in parallel.

Companion tickets that came out of the halt diagnosis:
- #451 — chore: biome useLiteralKeys conflict cleared (biome rule vs
tsconfig strict)
- #452 — refactor: relocate design prototypes into \`src/gallery/\`
(kills the tsc-prototype-reach noise; pairs with a Designer-character
update for future runs)
- #450 — feat: impl emits Claude session-id so \`ship run --resume\`
continues in-context (turns cheap baseline-induced halts into actual
resumes instead of \$8 re-runs)

## Test plan

- [x] \`bun test src/web/lib/OutcomeHeader.test.tsx\` — claims 1-5, 9
(three branches mount, complete shape, failed shape with errorSummary,
running shape with disabled Rerun, onRerun fires, static no-hex source
scan)
- [x] \`bun test src/web/pages/RunDetail.test.tsx\` — claims 7-8
(failed-run integration; failing-phase prominent)
- [x] \`bun tsc --noEmit\` — no new errors (pre-existing prototype-reach
errors unchanged; #452 will address them)
- [x] Local dashboard at http://127.0.0.1:8080 — render verification
once #451 merges (so the dev server's biome layer is clean)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant