Classification
BAD CODE™ — bounded-memory tooling debt discovered while hardening #838.
Problem
GitMachineLocalPathGuard.findTreePaths() sends every unique tree blob to one git cat-file --batch process and materializes the complete response in one buffer. MAX_INSPECTED_BLOB_BYTES caps that aggregate response at 512 MiB.
The guard fails closed, which is correct, but its memory and success envelope scale with the total bytes in the committed tree. A clean tree can therefore be rejected solely because the aggregate batch crosses the fixed ceiling. That is inconsistent with the repository direction toward streaming and bounded materialization.
Required correction
- Consume
git cat-file --batch incrementally or inspect deterministic bounded object batches.
- Bound memory independently of total committed-tree size.
- Preserve exact object identity, binary-blob inspection, symlink-target inspection, and deterministic offender ordering.
- Detect policy tokens that cross internal read-chunk boundaries.
- Continue to fail closed on malformed or truncated Git output.
- Never print matching content; report only safe repo-relative paths or object identifiers.
Acceptance
- A test forces a deliberately small inspection window and proves a clean aggregate larger than that window completes.
- A test detects a forbidden token split across internal chunks.
- Malformed and truncated batch streams remain hard failures.
- Existing working-tree, staged-index, outgoing-object, and exact-tree guard tests pass.
Related: #838.
Classification
BAD CODE™ — bounded-memory tooling debt discovered while hardening #838.
Problem
GitMachineLocalPathGuard.findTreePaths()sends every unique tree blob to onegit cat-file --batchprocess and materializes the complete response in one buffer.MAX_INSPECTED_BLOB_BYTEScaps that aggregate response at 512 MiB.The guard fails closed, which is correct, but its memory and success envelope scale with the total bytes in the committed tree. A clean tree can therefore be rejected solely because the aggregate batch crosses the fixed ceiling. That is inconsistent with the repository direction toward streaming and bounded materialization.
Required correction
git cat-file --batchincrementally or inspect deterministic bounded object batches.Acceptance
Related: #838.