Repository navigation
[obvious-fleet] Anchor sync_breadth.sh mirrors inside backend/ - #265
Conversation
After the port into the BaseScanning monorepo, git rev-parse --show-toplevel returns the monorepo root, so sync_breadth.sh's worktree mirrors anchored at the toplevel and rsync --delete pointed at the app's own top-level recon/, scene/ and criteria/ folders -- the half of Greptile's path-safety finding on PR #247 (comment 4281254460) that #249 left untouched. Copies now anchor at the package root derived from the script's location (PACKAGE, pwd -P, relative to the git toplevel), matching sync_from_store.sh; git operations (fetch, worktrees, push) stay at the repository root, and --no-push, the worktree flow, base selection and the safety scan are unchanged. backend/tests/test_sync_breadth.py builds a temporary monorepo with a fake store and a recording rsync stand-in: both tests fail against the pre-fix script and pass with this change.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Independent review (Obvious, Autobuild + Max) Verdict: ready. Correct, minimal fix for the unaddressed half of the #247 path-safety finding, matching the #249 precedent. All findings below are non-blocking; no regression found. What I verifiedFresh clone at head
Findings (ranked, all low/informational)
Couldn't verify
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note Review skipped Codemetrics is installed on this repository, but it hasn't been added to your team yet. To enable AI code reviews for this repo, go to your dashboard and add BaseScanning to your team's repositories. |
[Medium impact] The PR appears safe to merge; no actionable issues were found.
|
fleet-packet: burst6-bs-sync-breadth
Closes the unaddressed half of the path-safety finding on #247 (Greptile, comment 4281254460): "
sync_breadth.shalso writes outsidebackend/. Keep Git operations at the repository root, but anchor copied files underbackend/." #249 fixedsync_from_store.shand explicitly leftsync_breadth.shuntouched; this PR gives the breadth script the same treatment.What changed and why
Confirmed on the base commit (57f57ff):
git -C backend/scripts rev-parse --show-toplevelreturns the BaseScanning root, notbackend/, and every worktree mirror anchored there —mkdir -p "$wt/$dst"withdstone ofrecon/a1-classical,scene/b1-detection,criteria/c1-rules-3d, … So a real run would have copied store folders into the monorepo's top-levelrecon/(which the app already owns),scene/andcriteria/— all outsidebackend/— withrsync --deletepointed at them.The fix anchors copies at the package root derived from the script's own location, the same pattern #249 used for
sync_from_store.sh(following #248'sssr_overlap_check.py):PACKAGE="$(cd "$(dirname "$0")/.." && pwd -P)"—pwd -PkeepsPACKAGEcomparable to the toplevel across symlinked parents.REPOstaysgit rev-parse --show-toplevel: fetch,worktree add, commit and push are untouched.PACKAGE_RELisPACKAGErelative toREPO(backendin the monorepo; empty when the package still sits at the repo root, i.e. the pre-port layout), with a hard error if the package is not inside the repository.mkdir -p, the rsync destination, the README.md / RESULTS.md copies) now target$wt/$PACKAGE_REL/$dst.Git-root vs script-location anchoring. Git-root anchoring is correct for git operations but wrong for copies after the port: the toplevel moved one level above the package, so copies anchored there land beside the app, and
rsync --deletemakes those app-adjacent folders deletion targets. Script-location anchoring moves with the file, and the port was exactly a relocation — the anchor survives it — while worktrees, branches and pushes stay repo-global at the git root.Everything else is preserved: the worktree-per-branch flow, base selection (
origin/breadth/<id>elseorigin/main),--no-push, and the safety scan (meter numbers, SSR prompt text, keys, >5 MB files) — the scan now seesbackend/-prefixed paths, and its checks are basename/path based, so they are unaffected.Exact deletion boundary tested: for path id
a1-classical,rsync --deleteis confined tobackend/recon/a1-classical/inside the throwaway worktree. Pre-fix that destination was<monorepo-root>/recon/a1-classical/.How I verified it
From
backend/in a fresh clone (~/work/burst6-bs-sync-breadth) on the existing BaseScanning repo sandbox (computers-list route; the sandbox's pre-existing checkout untouched):bash -n scripts/sync_breadth.sh— clean.backend/tests/test_sync_breadth.py(2 tests): a temporary monorepo with a bare origin and a fake store, driving the script through a recording rsync stand-in on PATH.python3 -m pytest tests/test_sync_breadth.py -q→ 2 failed against the pre-fix script (checked out from 57f57ff), 2 passed with the fix.test_mirrors_land_inside_backend: the only rsync call targets…/backend/recon/a1-classical/; every path added tobreadth/a1-classicalvsorigin/mainis underbackend/; a top-levelrecon/a1-classicalis absent; the sentinel blob at the app's top-levelrecon/APP-SENTINEL.txtis unchanged; with--no-pushnothing reaches origin.test_delete_boundary_stays_inside_the_mirrored_folder: second sync withorigin/breadth/a1-classicalas base — a stale file inside the mirror folder and a store-deletedcode.pyare pruned, whilebackend/recon/a0-stray.txt(in the package, outside the mirrored folder), top-levelrecon/cruft.txtand the sentinel all survive;--no-pushkeeps the second sync commit local.make lint(uv run --frozen):ruff check✓,ruff format --check✓,lint-imports✓ (5 contracts kept, 0 broken).What is not verified
--deleteto its destination directory, which is why the git-tree assertions carry the deletion-boundary proof. The script's store detection, scanning and push code paths are unchanged by this diff.make lintcovers the tree. The known-failure windows called out in [obvious-fleet] Backend inventory after the port into backend/: checks run, one post-move path bug fixed #248/fix(backend): reviewer-page form and point cloud, store-sync paths #249 are outside this change.Assumptions
PACKAGE_RELbranch.feat/port-house-scanning-server; no.github/, deploy, or Swift files touched.