Repository navigation
Conversation
…olations path
bridge-read-guard.mjs check appends to reservation.violations and takes
`${violations}.lock` on every refusal. A reservation with no violations
field, or a relative one, made those paths the literal `undefined` /
`undefined.lock` (or a file relative to the caller's cwd), so the guard
wrote stray files into whatever directory it ran from.
Refuse such a reservation (exit 13, unchanged) before anything is
written. Add a regression test, and name the violations sidecar in the
existing stale-reservation fixture, which was the source of the stray
files when the suite ran.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
bridge-read-guard.mjs checkappends aread-deniedrow toreservation.violationsand takes${reservation.violations}.lockon every refusal. If the reservation has noviolationsfield, or a relative one, those paths are the literal stringundefined/undefined.lock(or a file relative to the caller's cwd), so the guard writes stray files into whatever directory it was run from.The existing test
the mjs read-guard: a stale reservation is judged on every POSIX hostdoes exactly this: itsread-reservation.fixture__worker.jsonfixture has noviolations, so running it leavesundefinedandundefined.lockin the repository root.Reproduction
On
main(ca587b3f):undefinedis 32 bytes (that one row),undefined.lockis empty. Observed on Linux (Node 22). I did not run it on macOS or Windows.Cause
checkreads the reservation and, when the caller is not authorized, writes the refusal toreservation.violations. Nothing checks first that the field is present and absolute. The two writers of a reservation in this repo (antigravity-bridge.mjsand the TUI supervisor) record an absolute path, so I do not expect this in normal operation; the guard just is not defensive about it, and the test fixture above is a reservation that omits it.Change
scripts/drivers/types/antigravity/bridge-read-guard.mjs: right after reading the reservation, throw ifviolationsis not a string holding an absolute path. The existing blanketcatchturns that into the existing refusal (exit 13, nothing written), so the fail-closed contract and the exit code callers branch on are unchanged.tests/test_antigravity_transport.bats:a reservation without an absolute violations path refuses and writes nothing: runs the guard from an empty directory with (a) noviolationsand (b) a relativeviolations, and asserts exit 13 and that the directory is still empty.violationssidecar like a real reservation, and its guard call gets</dev/null(the guard reads stdin before it decides, so the call blocks when stdin is an open pipe).Tests
mainwithout the source change ([ -z "$(ls -A "$cwd")" ]fails becauseundefinedwas written) and passes with it.bats tests/test_antigravity_transport.bats: 14 passed, 2 skipped (16 cases), exit 0.bats --jobs 4 tests/(3036 tests): 3029 ok (33 skipped), 7 not ok. Six of the seven also fail on unmodifiedmain(ca587b3f) when those files are run there:test_agmsgd_daemon_sh(Node fallback),test_node_resolve(version-manager node),test_registry_lock(mkdir error text),test_remoteset-endpoint feat(remote): set-endpoint moves a connected team's address, identity-checked #739 P1-1,test_terminal_registryset -u canary,test_watch--max-seconds. The seventh,test_sync_cipher"bulk seal fan-out, worker failure, and per-request errors", failed once in the parallel run and passed in 3 of 3 standalone runs on this branch; I have not determined why, and I did not run the full suite onmainfor comparison.node --test tests/antigravity_bridge.test.mjs: 17 of 18 pass, exit 1. The failure,a SIGTERM exit of verify while idle is treated as a normal stop(a wait timeout), is identical on unmodifiedmain(ca587b3f), so it is not caused by this change. I have not determined its cause.undefined/undefined.lockis left in the working tree after the full run (git statusclean).