v1.63.0.0 feat(gbrain): make repository indexing verifiable and fail-closed - #2377
v1.63.0.0 feat(gbrain): make repository indexing verifiable and fail-closed#2377mamedov wants to merge 5 commits into
Conversation
|
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 |
|
Superseded by the dependency-ordered split:
The split keeps the security-sensitive identity boundary independently reviewable and gives the docs-aware behavior its own tests and rollout boundary. Closing this combined PR in favor of those replacements. |
|
Scope clarification: the replacement PRs supersede this branch as the active implementation path, not every mechanism explored here. They intentionally do not carry forward the receipt, plan-digest, or |
Summary
Make
/sync-gbrainrepository indexing fail closed and prove exactly which clean repository commit and immutable content plan were applied.auto, trusted.gbrain-source, final source registry state, and one preview/applyplan_digest.--verify-receiptto rebind persisted evidence to the live canonical root, attached source, and current clean HEAD without contacting GBrain.Safety and deterministic behavior
0.42.71.0or newer.state_changed: registry_only; a later invocation syncs after registration is independently observable.--dry-runis a true no-probeORCHESTRATION PREVIEW — unvalidated: it performs no Git, engine, source, lock, path, or content probes and makes no writes.dry_run/validated_index_plan, requires a full lowercase SHA-256plan_digest, passes it through--expected-plan-digest, and accepts success only when apply echoes the same digest.plan_changedpreserves validated observed/required digests and refuses before mutation.auto..gbrain-sourceis replaced by gstack through a same-directory exclusive temporary file and atomic rename, so a raced symlink is not followed.search_readyis true if and only if embedding and extraction are both complete.Review-driven hardening
gstack-gbrain-sync; generated host skills now resolve the same runnable entry point./setup-gbraindelegates repository writes to the safe wrapper instead of raw import/background embedding paths.plan_digestinstead of telling operators to remove--dry-run.Verification
Current reviewed commit:
63308e25115bc48cfb7de093aec257bf9094897abun test test/gbrain-repository-index.test.ts test/gstack-gbrain-sync.test.ts test/gbrain-sync-skip.test.ts test/skill-e2e-memory-pipeline.test.ts test/host-config.test.ts test/gen-skill-docs.test.tsbun run buildpassed and regenerated every supported host artifact.git diff --checkpassed.ALREADY_BUMPED(1.60.1.0→1.63.0.0).Full-suite baseline caveat
An earlier full
bun testrun exited 1 solely because three pre-existingtest/brain-cache-roundtrip.test.tscases time out at the 5-second test limit when a usable local GBrain is installed. A focused reproduction produced 11 passed / 3 failed. The affected brain-cache implementation and test paths are unchanged fromorigin/main. Follow-up: https://3.basecamp.com/4058523/buckets/34718435/card_tables/cards/10141872751Tracking
Basecamp card: https://3.basecamp.com/4058523/buckets/34718435/card_tables/cards/10135180500
Release status
No release, installation, merge, or deployment was performed. This PR prepares the
v1.63.0.0code, documentation, tests, and version metadata for review.