Ask the parts of long files without a finding whether each does a job of its own - #36
Merged
Merged
Conversation
… and tally part links apart
…ong to ask is left out
This was referenced Sep 27, 2026
…dant tests and comments it composes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JevGate cleared every large file of its own code (
src/units/compose.rsat 1,866 lines,src/analysis/clones.rs,src/units/security.rs), so I checked why, and whether a careful refactor would split them.Where the answer came from.
compose.rs's recheck raised the split to a consider (0.81). Then the kind-of-file Choice cleared it, because the kinds that serve one feature added up to 0.85. On the corpus, the kind cleared 384 outlines, 44 of them non-test files of 800+ lines.Labels. Opus agents labeled 50 large application files blind, from the code. These are files the kind cleared (400+ lines, no Bend). 15 were worth splitting, 8 debatable, 27 to keep.
Command, Flask), one SQL dialect's implementation (shiori's sqlite, mysql and pg), httpx's sync/async mirror, a mailer with one function per template.Story, a diff engine inside a renderer, a JSON parser inside a protocol module.Nothing in the existing answers separated the two: not the split levels, the kind, size, or size relative to the project. Several new questions over the outline didn't either: boundaries between consecutive members, and a per-member "does this do what the file's path names?". The details are in
evaluation/experiments/large-file-parts.md(local).What changed. Following Jev's docs (one atomic question per candidate, and only the state the question needs):
Candidate parts come from a variant of the outline grouping (
groups::parts):Storyinto one group);Against the parts the labelers named (F1 over member lines, 23 files), the best match went from 0.45 to 0.72. Files to split that have a matching part went from 5 to 9 of 15.
The part follow-up. Each part of 100+ lines, in an application file of 400+ lines whose outline, recheck and kind raised no finding, gets one request. It carries the part's source and the rest of the file by signature, and asks two questions:
partdo a job of its own that a reader would look for apart from the rest of the file?"Own ≥ 0.65 with the role leaning to its own job (≥ 0.50) is a consider naming the part's members.
Not asked: benchmark, example,
scriptsanddocsdirectories (5 of 5 such findings were wrong: hash-pinned benchmark drivers, build scripts), or a part holdingmain.A new
partsstage in reports. First-pass requests are unchanged, so nothing already cached is asked again.Measured. Each new consider was labeled blind, a debatable one counting as not right.
WWW-Authenticateparser insideDigestAuth, ripgrep's--hyperlink-formatlanguage)File-organization considers were 63% right before. Parts of 80–99 lines were right 2 times in 4, so 100 is the floor. Cost: about $0.08 on the corpus, plus $0.22 for the fresh projects' whole file-organization rule.
Rechecks that send a whole file near the token limit can flip between two runs of the same binary. Whether they fit depends on each clone's saved
token-budget.jsoncalibration, which every run updates; pi-fabric'ssrc/agents/manager.tsdiffered that way between two release runs. So the comparison restores every clone's calibration from one snapshot before each run (evaluation/pinned_run.sh, local). With that, the release and this branch differ by exactly the 11 considers and one undecided outline resolved: reviews and notes are unchanged, at $0.00 from the cache.What it doesn't do. JevGate's own large files still stay clear: Jev reads their parts as one job (compose.rs's parts get 0.30 to 0.43). What decided
compose.rsfor the labeler was that onlyfollow_ups.rsuses the follow-up selectors. JevGate's callers map misses that, because Rust functions passed by name (follow_ups(plan, files, compose::unconfirmed_units, …)) aren't recorded as calls. Counting those references, and sending a part's users with it, is the next step. #37, stacked on this one, makes thecompose.rssplit by hand.Also: the self-check found that
document_splitand the file-kind weighing repeat the same steps (now one helper), and that two wordings build the same name list.FILE_ORGANIZATIONrule version is now 22.Tests (planning, composition thresholds, an outline with a finding asks nothing, grouping of a large type), clippy (also 1.98) and
cargo +1.90.0 check --lockedpass. The self-check with--rule all --include-testsreports no review or consider.