Skip to content

[🔥AUDIT🔥] review: split the roster concern out of dispatch.ts, which is over its line cap - #304

Merged
jwbron merged 1 commit into
mainfrom
jwies/dispatch-roster-split
Jul 30, 2026
Merged

[🔥AUDIT🔥] review: split the roster concern out of dispatch.ts, which is over its line cap#304
jwbron merged 1 commit into
mainfrom
jwies/dispatch-roster-split

Conversation

@jwbron

@jwbron jwbron commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

🖍 This is an audit! 🖍

Summary:

main is red on lint, and neither PR that caused it could have seen it.
@khanacademy/eslint-config sets max-lines to 1000. #302 took
workflows/review/lib/dispatch.ts to exactly 1000 lines; the single line #299
added to SHED_RANKING took it to 1001. Each PR was green against its own
base, so the violation existed only in the merge, which is invisible to a
per-PR lint run. Every open PR in the repo inherits the failure, including
#300.

Fixed by extracting a concern rather than by reclaiming a line, so the next
addition does not land in the same place, and rather than raising the cap,
which lives in the shared Khan config and would be a house-rule deviation.
DEFAULT_FINDERS, SHED_RANKING, Roster, RosterShed and computeRoster move to
dispatch-roster.ts and are re-exported from dispatch.ts, which already
advertises one import surface for the dispatch machinery. The moved code is
byte-identical; dispatch.ts goes 1001 -> 920 lines and the new module is 108.

Verified: 1573 tests pass unmodified, typecheck clean, and eslint over
everything CI lints (actions, utils, workflows, minus the ignorePatterns
paths) reports zero errors. Worth recording for next time: a plain local
pnpm run lint cannot reproduce CI inside a git worktree under .claude,
because eslint skips dot-directories by default and silently ignores the
whole tree; --resolve-plugins-relative-to . --no-ignore scoped to the CI
paths is what actually reproduces it.

Test plan:

  • pnpm exec vitest run: 1573 tests pass, none modified by this change.
  • pnpm run typecheck: clean.
  • Lint, the check this PR exists to fix: pnpm exec eslint --resolve-plugins-relative-to . --no-ignore --ext .js,.mjs,.ts actions utils workflows, filtered to exclude the ignorePatterns corpus trees, reports 0 errors. Before the change the same command reports the max-lines error on dispatch.ts.
  • git show --stat confirms the move is a move: no line of computeRoster or the ranking changed.

Unblocks every open PR in the repo, #300 included, since they all contain main's dispatch.ts. #300 needs no changes of its own; it goes green once this lands.

… dispatch.ts, which is over its line cap

main is red on lint, and neither PR that caused it could have seen it.
`@khanacademy/eslint-config` sets max-lines to 1000. #302 took
workflows/review/lib/dispatch.ts to exactly 1000 lines; the single line #299
added to SHED_RANKING took it to 1001. Each PR was green against its own
base, so the violation existed only in the merge, which is invisible to a
per-PR lint run. Every open PR in the repo inherits the failure, including
#300.

Fixed by extracting a concern rather than by reclaiming a line, so the next
addition does not land in the same place, and rather than raising the cap,
which lives in the shared Khan config and would be a house-rule deviation.
DEFAULT_FINDERS, SHED_RANKING, Roster, RosterShed and computeRoster move to
dispatch-roster.ts and are re-exported from dispatch.ts, which already
advertises one import surface for the dispatch machinery. The moved code is
byte-identical; dispatch.ts goes 1001 -> 920 lines and the new module is 108.

Verified: 1573 tests pass unmodified, typecheck clean, and eslint over
everything CI lints (actions, utils, workflows, minus the ignorePatterns
paths) reports zero errors. Worth recording for next time: a plain local
`pnpm run lint` cannot reproduce CI inside a git worktree under .claude,
because eslint skips dot-directories by default and silently ignores the
whole tree; `--resolve-plugins-relative-to . --no-ignore` scoped to the CI
paths is what actually reproduces it.
@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f33e674

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
review Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@khan-actions-bot
khan-actions-bot requested review from a team, jaredly and somewhatabstract and removed request for a team July 30, 2026 22:15
@jwbron
jwbron merged commit 5943268 into main Jul 30, 2026
24 of 25 checks passed
@jwbron
jwbron deleted the jwies/dispatch-roster-split branch July 30, 2026 22:18

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved — no blocking issues found.

jwbron added a commit that referenced this pull request Jul 31, 2026
…ing out of dispatch.ts for the line cap

The refusal-fallback additions pushed dispatch.ts to 1002 lines, one over the
max-lines cap that drove the roster split in #304. parseAgentFile/loadAgents
and the DispatchFs shape move to dispatch-agents.ts: self-contained, no
dispatch state, and re-exported so callers keep one import surface.

DispatchFs moves with them rather than staying behind, because leaving it in
dispatch.ts made the two modules import each other and the cycle broke
loadAgents at runtime while tsc stayed clean.
jwbron added a commit that referenced this pull request Jul 31, 2026
…ing out of dispatch.ts for the line cap

The refusal-fallback additions pushed dispatch.ts to 1002 lines, one over the
max-lines cap that drove the roster split in #304. parseAgentFile/loadAgents
and the DispatchFs shape move to dispatch-agents.ts: self-contained, no
dispatch state, and re-exported so callers keep one import surface.

DispatchFs moves with them rather than staying behind, because leaving it in
dispatch.ts made the two modules import each other and the cycle broke
loadAgents at runtime while tsc stayed clean.
jwbron added a commit that referenced this pull request Jul 31, 2026
…ing out of dispatch.ts for the line cap

The refusal-fallback additions pushed dispatch.ts to 1002 lines, one over the
max-lines cap that drove the roster split in #304. parseAgentFile/loadAgents
and the DispatchFs shape move to dispatch-agents.ts: self-contained, no
dispatch state, and re-exported so callers keep one import surface.

DispatchFs moves with them rather than staying behind, because leaving it in
dispatch.ts made the two modules import each other and the cycle broke
loadAgents at runtime while tsc stayed clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant