Repository navigation
perf(read): symmetric 80/80 cap + passthrough allowlist + escape-hatch marker + stdin coverage - #15
Merged
Merged
Conversation
…h marker + stdin coverage (#12) The upstream rebase (#14) implemented the unknown-extension cap and the JSON-like extension routing for `.xcstrings`/`.geojson`/`.ipynb`/etc., so those parts of #12 are now resolved upstream. This commit closes the remaining gaps: 1. **Symmetric defaults**: `tail_lines` 20 → 80. Final assertions, imports-at-bottom patterns, and result lines deserve the same surface area as the file's opening. 2. **Passthrough allowlist**: new `passthrough_extensions: Vec<String>` on `ReadConfig`. Users can list source-code extensions that contextcrawler doesn't yet filter (e.g. `[".svelte", ".astro", ".zig"]`) so the cap never truncates an editable source file mid-function. Accepts entries with or without the leading dot. 3. **Two-line marker with escape hatch**: replaces the single dense info-line with a visually-unmissable divider plus an info line that tells the reader how to recover full content (`contextcrawler proxy cat <path>`). An LLM seeing the marker can self-recover without needing prior knowledge of the cap. Threaded `display_path` through `render_output` and the cap helper. 4. **Stdin coverage**: `run_stdin()` now passes `allow_unknown_cap=true` with `"(stdin)"` as the display path. `cat huge.xcstrings | rtk read -` gets the same protection as direct reads. (Addresses the codex review comment on the earlier draft of this PR.) 5. **`.workspace` extension**: JetBrains/Theia project workspace files are also JSON-structured; added to `Language::Data` alongside the upstream `.code-workspace` entry. Tests: 5 new (default values, allowlist with/without dot, stdin cap, `workspace` extension, two-line marker structure). Existing `test_render_output_unknown_extension_cap` rewritten to assert structural properties (head verbatim, divider line, info line with escape hatch, tail verbatim) rather than a brittle exact-string match. All 1993 binary tests pass. Closes #12 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Co-Authored-By: Codex review <[email protected]>
thehoff
force-pushed
the
fix/read-unknown-ext-token-cap
branch
from
May 18, 2026 05:35
56743b9 to
9a034d0
Compare
thehoff
added a commit
that referenced
this pull request
May 18, 2026
…/MD reports (#29) First tier of the three-tier bench harness scoped in #29. Standalone test that invokes the built contextcrawler binary as a subprocess with `RTK_DB_PATH` pointed at a fresh tempfile, so the user's real tracking DB (`~/Library/Application Support/rtk/history.db`) is never touched. Verified isolation: live DB row count stayed at 4202 across two harness runs that internally invoked the binary four times each. **Cases (against `tests/fixtures/bench/*`):** - `read_short_passthrough` — small file, exercises the no-cap-fires path - `read_large_unknownext_cap_fires` — 500-line .unknownext, exercises the #15 symmetric 80/80 cap. Empirical: 7000 → 2262 tokens, 67.7% savings. Assertion floor 50%. - `read_xcstrings_json_route` — synthetic Xcode strings file, exercises JSON-like extension routing through the JSON compactor (NOT the unknown-ext cap). Empirical: 1807 → 389 tokens, 78.5% savings. Assertion floor >0%. - `read_rust_minimal_filter` — code file with comments. Currently reports 0% (default FilterLevel doesn't strip on this case); kept as a baseline so a future change that enables aggressive filtering can measure the lift. **Aggregate first run on develop tip 5cc6da3: 69.1% weighted savings across 8912 input tokens.** This is the baseline future runs compare against. **Output:** - `bench/results-<git-sha>.json` — machine-readable, for pre/post diff - `bench/results-<git-sha>.md` — human-readable, PR-diff-friendly - Both gitignored under `bench/results-*.{json,md}` so accumulating reports don't pollute the tree **Reproducibility:** same fixtures → same numbers within tolerance. Bisectable across binary commits. Hard regression gates: - Every case must exit 0 - Cap case savings must stay ≥50% (currently 67.7% — 17pp headroom) - xcstrings case must save tokens (currently 78.5% — far above floor) Softer gates (delta against `bench/baseline.json`) deferred to a follow-up so this PR stays focused on the harness scaffolding. **Tier 2 (Claude Code) + Tier 3 (Codex) deferred** to follow-up PRs per the #29 build order. Tier 3 will subsume issue #28's `codex-compliance` measurement. Tests: 1 new harness + 2 branding-lint + 2027 bin = all pass. Refs #29
This was referenced May 18, 2026
Merged
noogalabs
pushed a commit
to noogalabs/contextcrawler
that referenced
this pull request
Jun 4, 2026
… branding-lint extension **Version bump 0.39.0 → 0.1.7.** The upstream rebase pulled in rtk's `0.39.0` version; restoring the downstream `0.1.x` numbering line per the maintainer's call. `.release-please-manifest.json` updated to match. Last downstream tag was `v0.1.6` (2026-05-15); this is the next in the sequence. **release-please-config.json `package-name: "rtk"` → "contextcrawler".** Caught by manual audit during release prep. Same regression-family as thehoff#19 / thehoff#20 / thehoff#22: a rebrand gap the prior branding-lint (src/-scoped) didn't catch because release-please-config.json lives at repo root. Without this fix, release-please would have produced `rtk-vX.Y.Z` tags and release-PR titles. **Cargo.toml `extended-description` rebrand.** Line 77 still read "rtk filters and compresses..." — same upstream-leak family. Fixed. **Extended `tests/branding_lint.rs`** with a third test — `branding_lint_config_files_pin_canonical_package_name` — that: - Parses Cargo.toml and asserts `[package].name == "contextcrawler"` - Parses release-please-config.json and asserts `packages["."]["package-name"] == "contextcrawler"` This closes the gap that let release-please-config.json silently drift to `"rtk"` post-rebase. Any future rebase that re-introduces an upstream package-name fails `cargo test --test branding_lint` with an explicit error pointing at issues thehoff#19/thehoff#20/thehoff#22 history. **CHANGELOG.md** entry for v0.1.7 added, summarizing all PRs merged today (thehoff#10 thehoff#15 thehoff#16 thehoff#21 thehoff#24 thehoff#25 thehoff#30) plus the deferred follow-ups (thehoff#26 thehoff#27 thehoff#28 thehoff#29). Tests: 2027 bin + 3 branding-lint (1 new) + 1 harness = all pass. Verified: `contextcrawler --version` now prints `contextcrawler 0.1.7`. Refs thehoff#19 thehoff#20 thehoff#22 thehoff#29
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.
Summary
The upstream rebase (#14) implemented the unknown-extension cap and JSON-like routing for
.xcstrings/.geojson/.ipynb/.webmanifest/.code-workspace. This PR closes the remaining gaps to fully resolve #12:passthrough_extensions: Vec<String>onReadConfig— users list source-code extensions contextcrawler doesn't yet filter (e.g.[".svelte", ".astro", ".zig"]) so the cap never truncates an editable source file mid-function. Accepts entries with or without leading dot.contextcrawler proxy cat <path>.run_stdin()now applies the cap with"(stdin)"as display path.cat huge.xcstrings | rtk read -gets the same protection..workspaceextension added alongside upstream's.code-workspace(JetBrains/Theia workspace files are also JSON).Reviewed by Codex (earlier draft)
.code-workspaceextension matching → codex was technically wrong (Path::extension()does returncode-workspaceforsettings.code-workspace), but added.workspacealias for completenessTest plan
cargo test --bin contextcrawler— 1993 passed, 0 failed (+5 new)workspaceextension, two-line marker structuretest_render_output_unknown_extension_capto assert structural properties (head verbatim, divider line, info line with escape hatch, tail verbatim) rather than brittle exact-string matchCloses #12