chore: drop dead code, a fossil manifest comment, and an AGENTS.example.md over its own cap - #223
Merged
Merged
Conversation
…le.md over its own cap - transcript.rs: remove BlockKind::Thinking (never constructed; thinking renders as live-tail meta, not a block), is_following() and scrollbar() (never called), and the allow(dead_code) attributes that hid all three. - doctor.rs: external_names was pushed per tool and then rebuilt wholesale from tools_found (#165); drop the dead push and the allow(unused_assignments) that silenced it, and declare the vector where it is computed. - crates/tui/Cargo.toml: remove the syntect feature notes; syntect is not a dependency (not in Cargo.lock, not in source), so the comment described choices about a crate the binary does not carry. - AGENTS.example.md: 2,854 bytes against a 2,000-byte injection cap (prompt.rs MAX_AGENTS_MD_BYTES), so a verbatim copy lost every rule under Development to the truncation note, mid-sentence, on every request. Trim to 1,930 bytes by dropping the surface list the frozen prompt already carries on every request; a new test measures the file the way agents_md() does and fails on the old size.
…rkspace Review finding (P2): a packaged open-max-core crate carries no copy of the workspace-root template, so the guard hit NotFound there. It now says what it could not measure and returns; in the workspace (development and CI) the file is present and the guard still fails on the old 2,854-byte template.
Review finding (P1): the skip swallowed every read error, so a template that exists but cannot be read passed the guard unmeasured. Only NotFound skips now; any other read error fails the test with the path and the error.
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.
Why
An audit of the tree for accidental bloat, run after #222. The repository itself is clean (68 tracked files, all source; 2.4 MiB pack, no binaries or assets ever committed; the release binary is 7.18 MB on Linux against the 8 MB soft gate, up 0.23 MB across the round-4 stacks with
open_max_coreat 1.2 MiB of a 4.0 MiB.textand no unexpected crate in the breakdown; the frozen prompt measures 5,324 of its 5,360-char cap, 1,218 o200k tokens). Four small things did not belong, and one of them was silently costing every session in this repo.AGENTS.example.mdoverflowed its own cap.agents_md()injects at most 2,000 bytes (MAX_AGENTS_MD_BYTES); the shipped template had grown to 2,854. A verbatim copy was cut mid-sentence atinspect before edit; mfollowed by the truncation note, so every rule under Development (verify commands, "prefer skill/tool/hook/permission file first, always-on costs tokens", "never invent paths", branch and commit rules, and the closing "Token tax?" question) never reached the model. Confirmed on the wire against a scripted endpoint. Each bullet added to "What ships" pushed the rules at the bottom off the end, and most of those bullets duplicate what the frozen prompt already says on every request (extension paths,--check,--spec, PLAN.md, providers).#[allow(dead_code)]items intranscript.rsthat were dead in fact:BlockKind::Thinkingis never constructed (thinking renders as live-tail meta behind ctrl+t, not as a transcript block), andis_following()andscrollbar()have no callers.doctor.rspushed each tool name intoexternal_namesand then rebuilt the vector wholesale fromtools_found(fix(core): --check counts warned tools as live names for rules and filters #165), with an#[allow(unused_assignments)]hiding the dead push.crates/tui/Cargo.tomlcarried feature notes forsyntect(default-syntaxes,default-themes,regex-fancy), a crate that is in neitherCargo.locknor the source.Summary
AGENTS.example.md: 1,930 bytes. Keeps the thesis, the "Not in core / Use instead" table, "Not shipped", the repo map, and every Development rule; the "What ships" list collapses to one paragraph naming what the frozen prompt does not (global~/.openmax/mirrors,--approvefor hooks andallowrules,--trust-project).prompt.rs:agents_example_fits_the_injection_capmeasures the file the wayagents_md()does and names the fix ("trim it rather than raising the cap"). It fails on the old file (2,854 bytes) and passes on the new one.transcript.rs,doctor.rs,crates/tui/Cargo.toml: the removals above. Clippy adjudicated each: zero warnings with the allows gone.SandboxPolicy.ro_root(a documented intent field, feat(core): SandboxPolicy in the process spawn path #204), the ignored perf-measurement tests, and the two "use instead" skills.Test Plan
AGENTS.example.mdrestored the new test fails withAGENTS.example.md is 2854 bytes; agents_md() injects at most 2000; with the trimmed file it passes.cargo test --workspace: 810 passed, 0 failed, 8 ignored.cargo clippy --workspace --all-targets: zero warnings.AGENTS.mdcopies of the old template are also over the cap; this checkout's was refreshed from the trimmed text (1,953 bytes) and now injects whole.Greptile Summary
The prompt-template cap guard now fails when a present template cannot be read, while the focused workspace check confirms the tracked template fits the injection limit. The previous broad read-error behavior is no longer present: placing a directory at the expected template path caused the test to exit with an
Is a directoryerror and panic atcrates/core/src/prompt.rs:679instead of returning successfully.Confidence Score: 5/5
No blocking failure remains.
The non-missing filesystem error path fails the guard as intended, and the focused cap test passes for the tracked template.
What T-Rex did
Reviews (3): Last reviewed commit: "test: only an absent AGENTS.example.md s..." | Re-trigger Greptile