Skip to content

fix: bring two frontend files back under the 2,000-line cap - #36181

Merged
buluoray merged 1 commit into
mainfrom
crew/slack/fix-main-line-cap-two-files
Nov 13, 2026
Merged

buluoray merged 1 commit into
mainfrom
crew/slack/fix-main-line-cap-two-files

Conversation

@buluoray

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: main passes its whole-tree line-cap gate again: no hand-written code file is over 2,000 lines.

Two frontend files on main are over the cap:

FAIL website/src/components/KiroPrerequisiteGate.tsx has 2,002 lines, over the 2,000-line cap.
FAIL website/src/store/dashboardSlice.ts has 2,001 lines, over the 2,000-line cap.

Why it matters

The ratchet-gates lane of the Main Ratchet Audit is red on every main commit, so that audit cannot show a new drift. The next pull request that touches either file fails its own line-cap check for lines it did not add.

Not a goal

  • No behaviour change, and no change to any moved line.
  • Not a full split. Both files stay above the 1,600-line working target; this takes the smallest whole definitions that give real room.
  • No new baseline row and no change to the gate.

What changed (motivation → approach → change)

Whole definitions move into a new sibling module. The original file stays the import path that callers use.

File Before After What moved Where
website/src/components/KiroPrerequisiteGate.tsx 2,002 1,826 The two setup screens for missing and rejected agent specs website/src/components/KiroPrerequisiteAgentSpecs.tsx (186 lines)
website/src/store/dashboardSlice.ts 2,001 1,820 The DashboardState interface website/src/store/dashboard/state.ts (193 lines)

Backwards compatibility

Compatible: every moved line is unchanged, apart from export on the two screen components. Import paths that callers use are the same.

Removes nothing: no key, setting, API or stored data is removed or renamed.

Tests

Proof: not provable -- frontend test (prove.py runs Python only)

No test is added or changed: the gate that was red is the test. Run in the worktree on this head:

Check Before With the change
python3 scripts/check_file_line_cap.py --whole-tree 2 failures, the two lines above (run on a tree where both files equal main's) 0 failures, 0 main-drift warnings
RATCHET_SCOPE_WHOLE_TREE=1 python3 scripts/check_file_line_cap.py (how the audit runs it) not run 0 failures
python3 scripts/check_file_line_cap.py (how a pull request runs it) 2 main-drift warnings 0 failures, 0 warnings

Also run, all passing: python3 scripts/check_file_line_cap.py --test; test/test_file_line_cap.py (134 tests); npx tsc -p tsconfig.app.json; eslint on the four files; the five KiroPrerequisiteGate test files (269 tests); the dashboardSlice tests, the tests under src/store, and the two tests that read the slice's source text (73 files, 1,140 tests).

A script compared the old and new files line by line: every line removed from the two files is in its new file.

Per-file coverage from the KiroPrerequisiteGate tests alone: KiroPrerequisiteAgentSpecs.tsx 100% of statements, KiroPrerequisiteGate.tsx 97.34%. state.ts holds types only.

Manual verification

Not run in a browser. The change moves code without editing it, and the type check and the component tests above cover it.

Screenshots / video

Why no screenshot: the two screens render from the same lines in a new file, and the other move is a type. No pixel changes.

Related Issues

Closes #35295

Sibling sweep

Swept: python3 scripts/check_file_line_cap.py --whole-tree
Sibling: website/src/components/KiroPrerequisiteGate.tsx -- changed here
Sibling: website/src/store/dashboardSlice.ts -- changed here

Pattern harvest

Rule candidate: a pull request's line-cap check judges the merge with main as it was when CI last ran, and nothing re-runs it at merge time. #30587's last CI run started at 11:17Z on 11-11, when its 20 added lines left KiroPrerequisiteGate.tsx under the cap; #35224 and #35258 then added 17 lines to the same file before it merged. #35662's last CI run started 95 seconds before #33825 added one line to dashboardSlice.ts, so its 3 lines landed on 1,998, not 1,997. A merge queue, or a re-run of the cheap whole-tree gates when main moved in a file the pull request touches, would have caught both.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

main failed its whole-tree line-cap gate: KiroPrerequisiteGate.tsx
had 2,002 lines and dashboardSlice.ts had 2,001.

The two agent-spec setup screens move from KiroPrerequisiteGate.tsx
into KiroPrerequisiteAgentSpecs.tsx. The DashboardState interface
moves from dashboardSlice.ts into store/dashboard/state.ts, and the
slice re-exports it, so every caller keeps its import path. The moved
lines are unchanged and nothing behaves differently.
@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 12, 2026 23:12
@buluoray
buluoray requested a review from mbriones98 November 12, 2026 23:12
@buluoray
buluoray enabled auto-merge (squash) November 12, 2026 23:13
@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed fba4236a3123a58b8bbf0a34ec38ea9f26f9e670 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] fba4236

Verdict parsed from the review's SHA-scoped output markers for commit fba4236a3123a58b8bbf0a34ec38ea9f26f9e670.

False positive or not applicable? A repository writer can comment:
/ai-review override fable fba4236a3123a58b8bbf0a34ec38ea9f26f9e670 false-positive: <reason, 20 to 500 characters>

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider estimates a 5% chance that this change introduces a defect, within the 12% limit for approving on its own, but it changes 744 lines, more than the 400 it may approve on its own.

I recommend approving. This PR only moves code to bring two files back under the 2,000-line cap. The two agent-spec screens move unchanged into KiroPrerequisiteAgentSpecs.tsx; the only edit is an added export on each. The gate file imports them from there, and every import it still needs (AlertTriangle, RefreshCw, ErrorNotice, CopyCommand, SetupShell) is used elsewhere in it. The DashboardState interface moves unchanged to store/dashboard/state.ts, and dashboardSlice.ts re-exports it, so callers keep their current import path. The imports dashboardSlice no longer uses (CloseWatchState, CloseHold) are gone, and the ones it still uses stay. state.ts pulls in OfflineCause and UnlistedMember from dashboardSlice as types only, so nothing at runtime depends on that loop. I checked the tests that read the slice's source text (the row-writer chokepoint and safeStorage adoption tests): they look at reducer code and storage writes, not the interface. The change adds or changes no behaviour, so no new test is expected. The failing CI checks are API rate-limit and infrastructure errors, not code findings.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit fba4236a31 · 744 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of fba4236a3123a58b8bbf0a34ec38ea9f26f9e670 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. This is a move-only split: one file is re-exported and only types moved in the other, so nothing renders differently and every caller imports from the same path.

Notes

  • state.ts imports OfflineCause and UnlistedMember back from dashboardSlice, so the two files now import each other. The imports are type-only and erased at build, but moving those two types into state.ts as well would remove the loop.

[DESIGN-REVIEWED] fba4236

Description read

[DESCRIPTION-READ] 1d13c76a6db021584a861b10097908b483253f7edf0dcada272aaf14f9ee5724

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of fba4236a3123a58b8bbf0a34ec38ea9f26f9e670 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] fba4236

False positive or not applicable? A repository writer can comment:
/ai-review override gpt fba4236a3123a58b8bbf0a34ec38ea9f26f9e670 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of fba4236a3123a58b8bbf0a34ec38ea9f26f9e670 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: both items are verbatim moves of whole definitions, mandated by the AGENTS.md 2,000-line cap, with import paths preserved.

What this change ships

Inventory (2 items) — 2 justified

Intent: get main's whole-tree line-cap gate green again by moving code out of two over-cap files without changing behaviour. FIX.

  1. The setup screens for missing and rejected agent specs now live in KiroPrerequisiteAgentSpecs.tsx; the gate imports them, and they render the same — justified
  2. The DashboardState type moves to store/dashboard/state.ts and is re-exported from dashboardSlice.ts, so callers' imports don't change — justified

[FIRST-PRINCIPLES-REVIEWED] fba4236

Description read

[DESCRIPTION-READ] c1fba2a5e1a2ebc7d8d8875a0d8966bfaf91c89f8b6756e4042336333be524d7

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of fba4236a3123a58b8bbf0a34ec38ea9f26f9e670 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing to check. This PR only moves code: the two setup screens move to a new file with their lines unchanged except for an export, the other change moves a type, and no user-visible control or string changes.

[UX-REVIEWED] fba4236

Description read

[DESCRIPTION-READ] ef7acc3c47724c74668f1b134116b1cf70ea1aed0a541c65f7282ebc1a7fd8a0

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 13, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: code move only: two frontend files are split under the 2,000-line cap; the moved blocks are unchanged apart from imports and exports.

@buluoray
buluoray merged commit 9b32941 into main Nov 13, 2026
93 of 103 checks passed
@buluoray
buluoray deleted the crew/slack/fix-main-line-cap-two-files branch November 13, 2026 02:08
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 13, 2026
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.

Main ratchet drift detected

2 participants