fix(gbrain): bind source mutations to canonical identity - #2436
Open
mamedov wants to merge 5 commits into
Open
Conversation
Co-Authored-By: OpenAI Codex <noreply@openai.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
This was referenced Aug 2, 2026
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
This is the source-identity and destructive-safety slice split from #2377. The adjacent docs-aware
sync --strategy autowork remains a separate PR.Why the diff is larger than a path helper
The initial equivalence fix exposed two destructive seams during independent correctness and security review: a source row could change between planning and cleanup, and local pin/gitignore writes could follow a replaced filesystem object. Keeping the fix safe required carrying the proven path through orchestration, rereading the authoritative registry around mutations, and making local writes atomic and symlink-safe. The expanded diff stays on one concern: a source operation must act only on the exact filesystem and registry identity it proved.
Verification
Current HEAD:
46ba3aa2412ed399dc2d5645e47f7f20950903adbun test test/gbrain-sources-parse.test.ts test/gbrain-sources.test.ts test/gbrain-guards.test.ts test/gstack-gbrain-sync.test.ts test/gbrain-dream-stage.test.ts test/gbrain-source-gitignore.test.ts test/gbrain-detect-install.test.ts test/gbrain-sync-skip.test.ts test/gbrain-exec-invariant.test.ts test/gbrain-spawn-windows-shell.test.ts— 217 passed, 0 failed, 596 assertionsbun test test/gstack-gbrain-source-wireup.test.ts test/gen-skill-docs.test.ts— 421 passed, 0 failed, 6,464 assertionsbun test test/gbrain-detect-install.test.ts test/gstack-gbrain-sync.test.ts— 63 passed, 0 failed, 239 assertionsbun run build— passed; the existing Factorygstack-shiptoken-ceiling warning remains non-fatalgit diff --check origin/main...HEAD— passedbun run test:evalsselected 11 broad LLM routing scenarios, but this environment has no Claude credentials. Every failure artifact reportsNot logged in, zero tool calls, zero tokens, and $0.00; the failing suites and runners are unchanged fromorigin/main, and the changedsync-gbrainskill is not installed by those journey fixtures. Deterministic branch-owned tests above are green.Documentation
sync-gbrain/SKILL.md.tmpland generatedsync-gbrain/SKILL.md: document canonical identity, fail-closed drift handling, and the hard 0.41.38.0 floorUSING_GBRAIN_WITH_GSTACK.md: add operator recovery, code-stage safety semantics, installer reference, and troubleshootingCoverage: the changed source-identity and minimum-version surfaces have reference, how-to, and explanation coverage. No architecture diagram drift or new documentation debt was found.
Tracking
Basecamp: https://3.basecamp.com/4058523/buckets/34718435/card_tables/cards/10157486137