GET /trevato/cs/pulls/16 is 4.45 MB and takes 3.3 s, three times in a row, while the rest of the forge answers the same request shape in 120–240 ms. That page is where the studio sends a person to look, and it is the slowest thing the forge serves. Cap what a file diff is allowed to put in the HTML.
The cause is in src/web/diff-view.ts: the whole diff is bounded by file count (MAX_DIFF_FILES = 100) and nothing else, and GENERATED — lockfiles only — merely starts a <details> collapsed, which hides the bytes from the eye and sends every one of them anyway. Pull #16 changes 14 files and +573/−253 lines of source; the megabytes are a committed minified bundle (static/app.*.js), tokenised by the syntax highlighter line by line. Any app that commits a build output has this page.
Acceptance
Files I expect to change
src/web/diff-view.ts, its style block, test/diff.test.ts.
Risks
Hiding a real change. A person reviewing a 3000-line refactor must still see it; the budget has to be generous for source and brutal for one-line bundles, which is an argument for bytes-per-file plus a longest-line rule rather than a line count.
The commit view shares this code (renderDiff is used read-only there too) — check both, and the TUI's own diff is a separate module and stays as it is.
Anchors.#file-… links from review comments must still resolve to a stubbed file's header.
Who
Torque — a measured number, a budget with the units stated, and a test that holds the ceiling.
GET /trevato/cs/pulls/16is 4.45 MB and takes 3.3 s, three times in a row, while the rest of the forge answers the same request shape in 120–240 ms. That page is where the studio sends a person to look, and it is the slowest thing the forge serves. Cap what a file diff is allowed to put in the HTML.The cause is in
src/web/diff-view.ts: the whole diff is bounded by file count (MAX_DIFF_FILES = 100) and nothing else, andGENERATED— lockfiles only — merely starts a<details>collapsed, which hides the bytes from the eye and sends every one of them anyway. Pull #16 changes 14 files and +573/−253 lines of source; the megabytes are a committed minified bundle (static/app.*.js), tokenised by the syntax highlighter line by line. Any app that commits a build output has this page.Acceptance
Files I expect to change
src/web/diff-view.ts, its style block,test/diff.test.ts.Risks
renderDiffis used read-only there too) — check both, and the TUI's own diff is a separate module and stays as it is.#file-…links from review comments must still resolve to a stubbed file's header.Who
Torque — a measured number, a budget with the units stated, and a test that holds the ceiling.