Skip to content

Repo review: oxlint, review fixes, and the safe-sinks rule - #129

Merged
bmjcoding merged 15 commits into
mainfrom
chore/oxlint-and-repo-review
Nov 24, 2026
Merged

bmjcoding merged 15 commits into
mainfrom
chore/oxlint-and-repo-review

Conversation

@bmjcoding

Copy link
Copy Markdown
Owner

What changed

A repo-wide code and design review of main at 7db20640 (five read-only slices: tokens and CSS, React core, diagrams/charts/motion, HTML skill/sites/brand, Swift/CI/tooling), the engineering fixes it found, type-aware oxlint, and a new safe-sinks rule with its checks. No pixel changes: every fix restores documented behaviour.

Lint. oxlint --type-aware runs beside Stylelint (correctness plus the typescript, react, unicorn, oxc, import and jsx-a11y plugins; rules with existing debt are off in .oxlintrc.json to ratchet later). Stylelint now refuses ex, cap, ic and the root units, and container units and lh in type properties.

Security fixes. Notification links and viewAllHref were written after HTML-escaping only (a javascript: URL survived); side/align went into innerHTML as written; LinkTabs' narrow Select sent any string to location.assign (React and skill); a site include could read through a symlink outside its folder; diagram marks took any URL.

Behaviour fixes.

  • Chart scale: extreme values hung the page in React and the skill. Old code was killed by a 15 s timeout; the new code returns in 21 ms.
  • Press guard: a composed press freed itself on the first rejection.
  • MenuItem: a render element's promise wasn't guarded, so it could send twice.
  • Field required didn't reach Textarea, Select or Combobox.
  • Modal guard: lost when the forwarded ref changed, and missed controls added later outside the modal.
  • CommandList: stole focus under Strict Mode.
  • Scroll stops: a hidden button counted as focusable.
  • Empty numeric Select: threw.
  • Tooltip: closed while the pointer crossed the gap onto it, and pointer exit closed it under keyboard focus.
  • Disabled skill combobox: still submitted its value.
  • Mod: palette item keys refused it, and toast actions wrote it literally into aria-keyshortcuts.
  • "Pause animations": a stored hold was ignored on pages with a ring, braille or sparkline but no toggle.
  • Site header: wired twice by a second init().
  • srcset diagnostics: a data URL was misreported as external.
  • TextMorph: split emoji and combining marks.
  • DiagramFigure: re-measured on every parent render.
  • Diagram motion: a NaN delay without the stylesheet.

Tooling, CI and docs. CI cancels superseded PR runs and times jobs out; verify-packages prints assertion messages; the README says how a layered (Tailwind v4) app orders @layer basalt; tests tie the wash percentages to the state tokens and viewport queries to 720/1024.

Budgets moved (soft, owner's word; each recorded in modules.json or bundle.test.mjs with its measurement). The merge with PR #127 added both sides' raises.

Decisions

  • Design panel review: not a visual change.
  • Owner approval: the owner asked for the fixes and the merge in the conversation ("go ahead and run it and open the pr and merge - the rest of the items will just be outstanding followups"). He also asked for the safe-sinks rule ("needs to be a rule inside this repo so agents leveraging this design system don't create any potential vulnerabilities"). He had Fable and Astra 6.2 go back and forth on it (two rounds), settled three splits himself (a syntax-tree check, a count per file for the skill's sinks, a fixed base for safeHref), and named Muse Wonder Full tie-breaker for the rest.
  • The rule's final positions, as each wrote them:
    • Fable (round 2): "Agreed with Astra: data is drawn as text, a destination passes one safeHref (relative, http, https, mailto) before render or navigation, options come from a fixed list. Also agreed: the same five oxlint rules, a custom lint step, planted-violation fixtures, and no innerHTML rewrite or sanitiser." Held: "The custom check reads text, not a syntax tree." "safeHref parses against a fixed base." "No linting of authored page bodies." "Whether tel: passes the check is the owner's call; I recommend yes."
    • Astra (round 2): "Fable and I agree on rendering data as text, validating destinations before navigation, and testing each reviewed HTML builder. I recommend identifying each exceptional write individually so replacing one write with another triggers review." "Use syntax nodes for writes … Fail closed on a parse error." "Resolve using the consuming document's base or the caller's explicit base for server rendering." "Include review tooling with reasoned exceptions."
    • Muse Wonder Full (tie-break): "1. tel: passes safeHref — Yes (tel only, not sms). 2. Lint authored page bodies in compose.mjs — No (keep Fable's javascript: reporting instead). 3. Include tools/review in the sink check — Yes, with reasoned exceptions."
  • Skipped review:
    • The fixes are engineering and had no panel. They were found by the five review slices, and the diagram/chart/motion slice was interrupted before writing a report, so its notes were checked by hand. The code itself has not been re-reviewed after the fixes.
    • The CommandList Strict Mode fix has no test: fixtures are production builds, where React replays no effects.

New runtime dependencies

None. New dev dependencies: oxlint 1.95.0, oxlint-tsgolint 7.0.2008, and oxc-parser 0.160.0 (the sink check's parser; the owner chose the syntax-tree check).

Outstanding follow-ups (not in this PR)

Needing a decision:

  • the shadcn bridge maps destructive to a red fill;
  • a status callout's rim under more contrast;
  • hover washes that stick on touch;
  • dark-theme print ink;
  • the command menu input's missing focus ring;
  • hovering the current page link drops its plate;
  • Button and Tab hover-in duration;
  • Blacksand's two-state theme toggle in the header;
  • the skill's palette opener taking Meta or Ctrl (DECISIONS 244 says one modifier);
  • Geist Fallback in standalone pages;
  • Swift depth levels and type scaling.

Engineering:

  • NodeNext-safe declarations, and the RSC chunk boundary;
  • a sequence message to an unknown participant (diagram batch B);
  • Terminal's handlerless Pause;
  • per-component CSS;
  • iOS and visionOS build steps;
  • sleeps in tests and test concurrency;
  • a .node-version;
  • the remaining oxlint debt;
  • tools/review round registries;
  • the kitchen-sink fixture lacking an animated diagram, so pixel.test.mjs's "picks every module" fails on main too.

Checks

  • npm run lint
  • npm run ci:local on the PR's head: result posted below

🤖 Generated with Claude Code

bmjcoding and others added 15 commits November 23, 2026 19:03
oxlint 1.95.0 with oxlint-tsgolint runs the correctness category plus the
typescript, react, unicorn, oxc, import and jsx-a11y plugins. Rules with
pre-existing debt are off in .oxlintrc.json for now, to be ratcheted on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the repo-wide review (slices B and D). Engineering only: each restores
documented behaviour and changes no pixel.

- HTML skill: one safeHref in core, shared by the palette and notifications;
  a notification link that is not relative, http, https or mailto is not
  written (the row is a button, warned once), and side/align are checked
  against the popover's values before they reach the markup.
- LinkTabs: the narrow Select checks the destination before
  window.location.assign (React already refuses script URLs in the anchor).
- Sites: an include must be inside its folder once links are followed;
  diagram marks resolve from the body's folder; buildPage returns external.
- compose: srcset is read the way HTML reads it, so a data: URL's comma
  no longer lists its base64 as an external reference.
- Charts (React and HTML): the step search runs five powers whatever the
  exponent, and ticks are capped, so values that overflow no longer hang.
- takeClick: when both handlers return promises the press waits for both
  to settle, then raises the first failure.
- MenuItem: a render element's onClick is taken into the menu's wait.
- Field required: Textarea, Select and Combobox carry required too.
- numeric Select with no options renders (no repeat(-Infinity)).
- CommandList: focus moves only on a real view change (Strict Mode).
- Scroll stops: a hidden control does not count as focusable.
- Modals: the outside guard survives a changed forwarded ref, and controls
  that mount outside later are made inert too.
- Contexts are /* @__PURE__ */ throughout.
- oxlint: import/namespace off in tests (it depended on dist existing).

Browser tests are written but not yet run (the machine was busy).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tchet

- DiagramFigure: options depend on whether there is a source, not the
  source node, so a parent's render no longer measures the figure again.
- Diagram motion: a stagger step of 0 (tokens unread, no stylesheet) no
  longer hands animate() a NaN delay.
- TextMorph: strings are split into grapheme clusters (Intl.Segmenter,
  made on first use), so an emoji with its modifier or a letter with its
  accent moves as one glyph; code points remain the fallback.
- oxlint: typescript/no-misused-spread is on outside tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- verify-packages: an assertion's own message is printed, and kept as the
  cause, instead of a bare "see the output above" with nothing above.
- test-react: the main-module check is isMain, as the other scripts' are.
- PR template: the gate is npm run ci:local while Actions minutes are out.
- AGENTS: npm run check omits the generated-Swift drift check on purpose.
- React README: an app with layered CSS (Tailwind v4) names basalt first
  in its @layer order, or Basalt can beat its utilities.
- Stylelint: ex, cap, ic, rlh and the root forms are raw; container units
  and lh are refused in type properties. 1lh stays allowed as a line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- combobox: a disabled field's hidden input is disabled too, from the start
  and when the field is disabled or enabled later, so it submits nothing.
- tooltip: the 6px gap to the opener is the tooltip's own (an unseen
  ::before), so a slow move onto it never crosses the page; hover and
  keyboard focus each hold it open (WCAG 1.4.13).
- notifications: the scheme check is the module's own, against a fixed
  base (core is every page's cost and stays as it was; the palette keeps
  its own); no warning.
- Budgets raised, recorded in modules.json: notifications 12700,
  combobox 11350, tooltip 3550, chart 34800 (budgets are soft).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stored-hold bootstrap came only with the loops module (the toggle), so
a page with a ring, braille, a loading sparkline or ambient art and no
toggle ignored a hold the reader set on another page. compose now adds it
for every looping module, and the ring's and braille's held rules moved
from loops.css into their own modules. Spinner budget 650 to 720.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… actions

The chips drew Mod as the platform's modifier, but the palette's binding
refused it (the item got no chip and no key), and a toast action wrote the
literal word Mod into aria-keyshortcuts. Both now resolve Mod through the
kbd module, as the chips do. The palette opener's Meta-or-Ctrl rule is
unchanged (it is the skill's documented rule; DECISIONS 244 differs, which
is a ruling, not a fix). Budgets: kbd 2950, palette 11500, toast 16150.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A second Basalt.init() appended a second narrow menu and a second set of
document-level handlers on the same trigger. The header is marked when it
is wired and skipped after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ons are current

The duration-loop tokens now hold the ring, braille, fade and ambient
periods; the skeleton pulse and the indeterminate bar still have none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…kens' alphas

Slice A: a media query anywhere in React's sheet, the skill or the sites
may name only size-breakpoint-md or -lg (other widths are a container's),
and every white or black wash percentage in React's sheet must be
state-hover's or state-selected's own alpha in that theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Slice E: a hung browser test used the six-hour default and a newer push
did not cancel the run it replaced. ci:local's drift check is unaffected
(no run step changed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…toast Mod without kbd

- bundle.test.mjs: the limits the fixes need, measured and rounded up to
  the next 50 as before (Promise.allSettled in every button's press, the
  modal guard, the required field in Select, LinkTabs' check); the size
  table regenerated. safeHref lives in its own module, not utils.
- tooltip: the unseen strip is 8px from the padding box (the 6px gap, the
  rim and the .98 entrance), so the first pixel under the opener is
  inside it.
- toast: Mod resolves without the kbd module (a toast-only page has none).
- Budgets: toast 16200, palette's usage text 1400.
- The CommandList Strict Mode test is removed: fixtures are production
  builds, where React does not replay effects, so it passed on the old
  code too. The fix stands on its reasoning, untested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Decided by the owner with Fable and Astra (two rounds) and Muse Wonder Full
as tie-breaker, 23 Nov 2026: a syntax-tree check, a per-file ledger for the
HTML skill, a fixed base for safeHref, tel allowed, tools/review in scope,
composed page bodies not linted.

- AGENTS.md rule and Checks row; SKILL.md line; core usage; React README.
- safeHref (relative, http, https, mailto, tel; the string or null; a fixed
  base) exported from the React package and published as Basalt.safeHref,
  with _.pick; esc escapes the apostrophe. Palette and notifications use
  core's; LinkTabs (React and skill) checks before onNavigate or the
  navigate event hears of a link.
- Diagram marks are a relative path, https or a data: image; cssUrl escapes
  \r and \f. compose lists a javascript: link in a body.
- scripts/check-sinks.mjs (oxc-parser, a new dev dependency the owner
  chose): HTML sinks, unchecked navigation and postMessage to any origin;
  reasons in sink: comments or tools/html-skill/src/sinks.allowed.json.
  A lint step.
- oxlint: no-new-func, no-script-url, react/jsx-no-script-url,
  react/no-danger, react/jsx-no-target-blank, react/iframe-missing-sandbox,
  unicorn/require-post-message-target-origin; every hit reasoned or fixed.
- The modal guard looks only at nodes added later and never at a portal or
  the toasts (it had made a second modal's controls inert).
- Tests: one URL table for both runtimes, planted failures and passing
  twins for every sink kind and oxlint rule, the ledger's data-taking files
  in the hostile probe (a diagram added to it), both LinkTabs refusing.
- Budgets (soft, recorded): skillMd 12900, core 35650, core usage 3200,
  link-tabs 5900, diagram 93000; React limits LinkTabs 142150, SearchDialog
  89550; size table regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts were budgets both sides raised: each limit is now the merged
tree's measurement rounded up as before (recorded in bundle.test.mjs and
modules.json); generated parts and the size table rebuilt. Main's new
sinks (runs.js, diagram-motion.js, terminal.js's stage line) are in the
ledger, and react/globals joins the React Compiler rules kept off for
existing debt (main's Button warn-once flag).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The skill's $comment keeps both sides' budget notes; budgets hold on the
merged tree. ReleaseNotes 67,650 (the press guard in every button); the
size table rebuilt; safeHref listed among the plain values.
react/static-components joins the React Compiler rules kept off
(VersionLink's RailTooltip comes from context, not from render), and
the changelog config drops a no-op ?? {} in a spread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bmjcoding

Copy link
Copy Markdown
Owner Author

npm run ci:local on 2bec052d (the head, with main merged through #128; Node 26 locally, CI pins 22): 7 of 8 steps passed.

  • ✔ npm run lint, npm run artifact, npm run typecheck:review, npm run test:packages, the generated-Swift drift check, swift build, swift test
  • ✖ npm test

I ran every failing file again on a clean checkout of origin/main (e396decf). Every failure but one also fails on main as it stands, from #127 and #128:

  • run-stage parts draw tertiary ink in the bar
  • an axe contrast failure in a run stage
  • runs.css uses round() above the skill's floor
  • exports missing from the README (RunAnnouncer and others)
  • the import file count (1,067 on main, limit 1,041; this branch adds 2)
  • the Terminal, NotificationCentre and Pagination icon-plugin limits
  • the release-notes and release layout and touch tests
  • audit-fix-c5's runner list (the new changelog step)
  • the loops usage line and the Prohibit icon in the skill tests
  • pixel.test.mjs's "picks every module" (the kitchen sink has no animated diagram)

The one that doesn't: diagram-motion.test.mjs's "animated under reduced motion draws the same pixels as still" timed out at 126 s during the full run. It passed when the file was run alone on this branch (153 pass, and its 3 failures are main's stage-list ones above), and its first ci:local failure was the same timeout under load.

main's failures are left as follow-ups for the stages and versioning threads. They aren't changed here.

@bmjcoding
bmjcoding marked this pull request as ready for review November 24, 2026 03:06
@bmjcoding
bmjcoding merged commit cbab8c4 into main Nov 24, 2026
1 of 2 checks passed
@bmjcoding
bmjcoding deleted the chore/oxlint-and-repo-review branch November 24, 2026 03:06
bmjcoding added a commit that referenced this pull request Nov 24, 2026
…-edge

bundle.test.mjs keeps both raises: main's 41,850 and the top edge's fade,
measured 42,569 on the merged tree, so the RunTimeline limit is 42,600.
export-sizes.json is regenerated on the merged tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bmjcoding added a commit that referenced this pull request Nov 24, 2026
…nks rule) into diagram batch B

diagram-figure.tsx keeps both: batch B's touch trace and viewer keys, and #129's fix that keys the figure's options on whether there is a
source, not the node (a new node each render measured the figure again). The same fix's intent is applied to the viewer's keys: the options
key on the string, not the viewer object. #129's sink: comment on the ink is kept.

What #129's rules flagged in batch B, and the fix:
- oxlint unicorn/no-new-array: diagram-text.js's glyph probe built its run with new Array(41).join; it is '─'.repeat(40).
- oxlint react/no-danger and the sink check: the viewer's list and key (diagram-viewer.tsx) are dangerouslySetInnerHTML with no reason.
  Each now has its sink: comment (the engine's figureList and figureKey through toHtml, which escapes every text and attribute) and the
  oxlint exception beside it, as brand-svg.tsx does; diagram-recheck.test.mjs (node, run) passes hostile words through the list, the key,
  the transcript and the text art and finds them only as text.
- The sink check in the skill: diagram-export.js's button words are set with textContent, so it has no sink; diagram-text.js (1) and
  diagram-zoom.js (2) are in sinks.allowed.json with what they take and why it is safe; diagram.js's count is 4 (batch B's key hint,
  its keys and words through escapeHtml). A text sequence with export on joins the hostile-input page (support-hostile.mjs), so
  diagram-text, diagram-export and diagram-zoom are in the probe.

modules.json keeps both sides' caps and notes: diagram 145450 (batch B's 145100 plus #129's mark check; measured 145427), usage 4600.
SKILL.md fits main's 13050 with one index line tightened. Generated files regenerated: the skill's parts and manifest (npm run build),
export-sizes.json (npm run sizes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bmjcoding added a commit that referenced this pull request Nov 24, 2026
Both sides kept. Round 69 and round 70 are both registered. The skill's
notifications keep main's checked href and placement and take data-edge.
SKILL.md takes main's wording and the edge line, trimmed to 13,040 (main's
cap 13,050, no rule dropped); AGENTS.md takes main's diagram card and the
toast and selection column lines. Generated files are rebuilt, the export
table re-measured, and the bundle test's limits and the skill's caps set to
the measured sizes from main's, with the reasons.

Lint's new steps: oxlint and the sink check flagged round 69's skill frame
(a sink comment and the reasoned oxlint exception, as round 47's) and two
new sinks in the skill (copy.js now writes the button once with its glyph
swapped; terminal.js draws its three glyphs once and shows one), so the
ledger is unchanged. The edge rule now reaches #130's diagram viewer: its
Close hangs at the head's end and Zoom out at the foot's start, the foot
declaring its room (the skill's copy maps the insets). #131's timeline has
no ghost control at an edge (its toggle is a TextButton).

Co-Authored-By: Claude Opus 5.5 <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