Found by adversarial review of #1821, and confirmed against the tree.
The gap
The indexer admits a file by self.source_file_byte_cap, taken from
SourceIndexPolicy.byte_cap, which source_index_policy_from_env_value
(codestory-cli/src/config.rs:73-78) sets from
CODESTORY_INDEX_SOURCE_FILE_BYTE_CAP with no upper clamp — only > 0.
Three per-file text bounds are compile-time constants:
| Lane |
Constant |
Checked at |
| lexical FTS |
MAX_FILE_BYTES |
codestory-retrieval/src/lexical_index.rs:970 |
| repo-text scan |
REPO_TEXT_MAX_FILE_BYTES |
codestory-runtime/src/repo_text.rs:90,109 |
| semantic doc bodies |
SEMANTIC_FILE_TEXT_MAX_BYTES |
codestory-runtime/src/support.rs:389 |
Set CODESTORY_INDEX_SOURCE_FILE_BYTE_CAP=4000000 and a 3 MB Rust file is
indexed with full symbols, nodes, and dense anchors, while all three lanes drop
it. There is no error row and no retry_required; derive_degraded_mode
discards the component reason and strict readiness still reports Full. The
user gets a file indexed_files calls complete that search cannot find.
What #1821 did and did not do
#1821 made the three constants derive from DEFAULT_SOURCE_FILE_BYTE_CAP and
added a compile-time assertion to each. That closes the default configuration
and stops a future default bump from silently stranding a band of files — which
is what would have happened when the cap went to 2 MB.
It does not close this, and the assertions cannot: they compare two
compile-time constants and are blind to a runtime override. code-review-2026-08.md
has been corrected to say so rather than retiring CR-068's oversized half.
Done when
Note
This is a pre-existing gap — CR-068 described it before #1821 — but it is worth
its own issue now because the surrounding claim changed and the residual would
otherwise be invisible.
Found by adversarial review of #1821, and confirmed against the tree.
The gap
The indexer admits a file by
self.source_file_byte_cap, taken fromSourceIndexPolicy.byte_cap, whichsource_index_policy_from_env_value(
codestory-cli/src/config.rs:73-78) sets fromCODESTORY_INDEX_SOURCE_FILE_BYTE_CAPwith no upper clamp — only> 0.Three per-file text bounds are compile-time constants:
MAX_FILE_BYTEScodestory-retrieval/src/lexical_index.rs:970REPO_TEXT_MAX_FILE_BYTEScodestory-runtime/src/repo_text.rs:90,109SEMANTIC_FILE_TEXT_MAX_BYTEScodestory-runtime/src/support.rs:389Set
CODESTORY_INDEX_SOURCE_FILE_BYTE_CAP=4000000and a 3 MB Rust file isindexed with full symbols, nodes, and dense anchors, while all three lanes drop
it. There is no error row and no
retry_required;derive_degraded_modediscards the component reason and strict readiness still reports Full. The
user gets a file
indexed_filescalls complete thatsearchcannot find.What #1821 did and did not do
#1821 made the three constants derive from
DEFAULT_SOURCE_FILE_BYTE_CAPandadded a compile-time assertion to each. That closes the default configuration
and stops a future default bump from silently stranding a band of files — which
is what would have happened when the cap went to 2 MB.
It does not close this, and the assertions cannot: they compare two
compile-time constants and are blind to a runtime override.
code-review-2026-08.mdhas been corrected to say so rather than retiring CR-068's oversized half.
Done when
SourceIndexPolicy, not by aconstant
CODESTORY_INDEX_SOURCE_FILE_BYTE_CAPabove the default,indexes a file in the widened band, and asserts it is lexically
recallable — a constant-comparison assertion is not sufficient, because
it passes when a lane is bounded by something nobody listed
bound, and the setting's registry description says the cap cannot be
raised past it
Note
This is a pre-existing gap — CR-068 described it before #1821 — but it is worth
its own issue now because the surrounding claim changed and the residual would
otherwise be invisible.