Repository navigation
v1.91.126.0 fix(brain-sync): hold case-colliding artifact paths instead of reporting ok (#3220) - #3254
Merged
Conversation
Refuse missing or unrelated staged paths and stale indexed content without consuming the queue or resetting the index.
Check component prefixes in requested/index and outgoing trees, including retained commits and fetch/merge retries. Preserve historical aliases, local commits, index, and queue on refusal.
#3220) Builds on Kkkkkuro's staged-index and casefold checks (#3245, from #3223). A queued path whose spelling differs only by letter case from another path in the index or the batch is held before staging: it stays queued, every other file keeps syncing, and the status is "collision" rather than "ok". An established spelling keeps syncing; only the new alias waits. Skill start prints one ARTIFACTS_SYNC attention line naming the colliding names and the repair anchor (docs/troubleshooting.md#artifact-case-collision); gstack-doctor warns the same way. The outgoing check is cached by HEAD so the empty-queue drain at every skill boundary stays near main's cost. gstack-slug and skill start's slug path are unchanged. Co-authored-by: Kkkkkuro <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
- Windows: write the held-path list with LF and strip CR from helper output, so CRLF cannot let a held path through or blank case_names. - --publish-removals runs the outgoing case check before it pushes. - The cached outgoing verdict is keyed by every ref, not HEAD alone, so a moved remote baseline is re-checked. - The repair snippet folds only JSONL logs and lists snapshots and other files for a manual decision. Co-authored-by: Kkkkkuro <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
- The repair loop also folds the dropped spelling's untracked (held) files and says to check for leftovers before removing the folder on Linux. - The cached outgoing verdict also keys on HEAD's symbolic target. - The outgoing check no longer needs a temp file, so a failed mktemp can no longer skip it. Co-authored-by: Kkkkkuro <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Contributor
E2E Evals: ✅ PASS121 executed, 0 reused rule/judge records | 0 manual accepted (unscored; no score-cache credit) | $90.94 rule/judge cost | reconcile exit: 0 Profile: pr / mode Derived dependents (scripts/pr-dependencies.ts):
Rule and judge shards
Fail-closed reconciliationSliced lane: planner → duration-packed executors → fail-closed report. Behavior cases run a pre-registered 3-trial panel (PASS at 2/3 with no contract violation); a PASS 2/3 is shown with its failed trial, never as a clean pass. Reused results retain their original provenance and expiry. |
The retry merge commits with the ambient identity. CI and Ubicloud runners have none under the test HOME, so the merge failed before the outgoing case check ran and the drain reported push_failed instead of error. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Oct 17, 2026
garrytan
added a commit
that referenced
this pull request
Oct 19, 2026
… todo; drop host-renders-prune The 2026-10-19 weekly recording put test/brain-sync.test.ts at 89s (#3254's case-collision suite) and test/setup-codex-scope.test.ts at 64s, over the 60s ceiling; test/host-renders-prune.test.ts fell to 57s, so its entry is stale. Both new entries carry the existing TODOS.md split todo. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
capy-ai Bot
added a commit
that referenced
this pull request
Oct 19, 2026
* test(seed): refresh the free-suite duration seeds from the weekly recording * test(seed): allowlist brain-sync and setup-codex-scope with the split todo; drop host-renders-prune The 2026-10-19 weekly recording put test/brain-sync.test.ts at 89s (#3254's case-collision suite) and test/setup-codex-scope.test.ts at 64s, over the 60s ceiling; test/host-renders-prune.test.ts fell to 57s, so its entry is stale. Both new entries carry the existing TODOS.md split todo. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(seed): classify the seed allowlist as free-only so editing it selects no paid case Only test/free-seed-ratchet.test.ts reads scripts/free-test-seed-allowlist.json, but eval selection derived all 246 gate cases from it, so #3289's allowlist repair paid for a full gate. The new free-fixtures case shows seed data and the allowlist select nothing, with a negative control: design/src/evolve.ts still selects its derived dependents. Non-behavioral HARNESS_VERSION decision. Gate integrity: scripts/test-pr-profile.ts FREE_ONLY_PR_FILES gains one entry. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * chore: stamp v1.91.147.0 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: garrytan <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
Fixes #3220. Lands the case-collision detector from #3223 by @Kkkkkuro, as his own narrowed version in #3245 (both of his commits cherry-picked with his authorship), and changes what it does on a collision: brain-sync now holds the colliding paths instead of halting the whole sync. The writer-lease system from #3223 is not part of this PR.
The bug
gstack files per-project state under
projects/<slug>/, and slugs keep letter case. When the artifacts repo tracks two spellings of one project (projects/Example_Workspace/andprojects/Example_workspace/, for example from a case-sensitive Linux producer), a Mac or Windows checkout stores them as one file. Before this PR, a write there was staged under the other spelling, pushed, and the sync reportedok. One spelling then stayed modified forever, and other machines read the wrong bucket. Reproduced on a real case-insensitive mount (ciopfs), main 521fd42:The same scenario on this branch:
What changes
From #3245 (Kkkkkuro), kept as backstops. After
git add, brain-sync checks that exactly the requested paths and bytes reached the index. Before any push (drain start, normal push, merge retry), it refuses a tree that adds a new casefold alias relative toorigin/<branch>. Historical aliases stay historical.Hold, not halt. Before staging,
bin/gstack-brain-sync-index.py --holdcompares each queued path's prefixes (NFC + casefold) with the index and the batch. A colliding path is never staged, and its queue record stays. Everything else syncs, and the status iscollision(orheldwhen the secret scan also holds files), neverok. When exactly one spelling is tracked and the write uses it, that spelling keeps syncing and only the new alias waits. That covers two genuinely different Linux projectsMyAppandmyapponce one of them is synced. When neither spelling is tracked, both wait.Telling the user. The status file gains
case_heldandcase_names, both clamped to[A-Za-z0-9._?,-]because repo paths are untrusted. Skill start prints oneARTIFACTS_SYNC: attention: case-collision ...line (a new row in the sync status table) naming the colliding names and the repair anchor. It never blocks and never prints STOP.gstack-doctorwarns the same way.--publish-removalsnow runs the outgoing check before it pushes.Hot path. The outgoing check's verdict is cached by HEAD's target plus every ref's id (
.brain-case-check, removed bygstack-brain-uninstall). On a 3,000-file artifacts repo, the empty-queue--oncethat skill start runs went from 92 ms to about 110 ms (it was 165 ms uncached).gstack-slugis untouched and still runs about 55 ms on both main and this branch. Nothing new requires python3: without python3 the drain behaves exactly as on main, and slug resolution and skill start never call the helper.Docs.
docs/troubleshooting.md#artifact-case-collisiondocuments the manual repair: pick the spelling, fold the dropped spelling's tracked and held JSONL files (other files are listed for a hand decision),git rm --cachedthe other spelling, then skip the stale records and re-enqueue. I ran it end to end on Linux and on the case-insensitive mount, and it ended with one spelling, all lines kept, a cleangit statusand no attention line.docs/gbrain-sync-errors.mdanddocs/gbrain-sync.mdlist the new row and status. No result code was added: these attention lines use the brain-sync status table contract, not the workflow(CODE)contract.Tests
#3220: a write into a tracked case-colliding project is held...anda tracked spelling keeps syncing while only the new case alias is heldfail on main and on fix(brain-sync): verify staged content and reject new casefold collisions #3245 alone, and pass here.publish-removals refuses...andthe cached outgoing verdict is re-checked when the remote baseline movesfail on the first hold commit and pass here.case-collisionrow. The doctor test coverscollisionand a historical collision.test/brain-sync.test.tsandtest/gstack-skill-start.test.tsare already excluded from the Windows subset (POSIX spawns).test/gstack-doctor.test.tsstays Windows-curated.Out of scope: the writer-lease system, slug normalization or migration, and automatic repair of existing collisions.
Credit: @Kkkkkuro found and fixed the core of this in #3223 and #3245. The follow-up commits carry
Co-authored-byfor him.