Repository navigation
Conversation
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.
The sidecar bind path and the sidecar verify path disagreed on size.
verify-sidecarcaps a sidecar entry atMAX_SIDECAR_ENTRY_BYTES(256 MiB) and fails closed above it, butprotectTarget'scollectSidecarBindingsread every requested sidecar with a plainreadFileSyncand bound it with no ceiling at all. A caller that pointedsidecarEntanglePathsat a sparse file, a mistyped glob or a file that had grown past a few gigabytes got a protect run that succeeded and planted a binding its own verifier would then refuse to read.What changed
collectSidecarBindingsinsrc/engine/protector.tsnow stats each sidecar before reading it and skips, into the existingsidecarEntangleSkippedlist, anything aboveMAX_SIDECAR_ENTRY_BYTES. It reuses the constant the verifier already enforces instead of introducing a second number.sidecarEntangleSkippedrather than discovering the problem later at verify time.tests/sidecar-entangle-skipped-paths.test.tsgains a case that creates a sparse sidecar one byte past the ceiling and asserts it is reported skipped instead of being bound.Why this matters
Write and read should agree. If the verifier refuses to read a sidecar, protect should not plant it, and the failure should surface as a named skip rather than an out-of-memory read or a binding that only breaks on the verify pass. Every other reader in the engine already bounds itself, so this brings the bind path in line.
Tests
npx vitest run tests/sidecar-entangle-skipped-paths.test.ts tests/verify-sidecar.test.ts tests/sidecar-entangle-plan.test.ts tests/sidecar-entangle-protect.test.ts tests/hardening-engine.test.tspasses, 40 tests.Compatibility
A sidecar under 256 MiB binds exactly as before. An oversized sidecar that used to be read whole and bound is now reported in
sidecarEntangleSkipped, which changes a silent success into an explicit skip.