mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-16 17:22:12 +08:00
feat(gbrain-sync): preamble block — privacy gate + boundary sync
scripts/resolvers/preamble/generate-brain-sync-block.ts emits bash that runs at every skill invocation: - Detects ~/.gstack-brain-remote.txt on machines without local .git and surfaces a restore-available hint (does NOT auto-run restore). - Runs gstack-brain-sync --once at skill start to drain any pending writes (and at skill end via prose instruction). - Once-per-day auto-pull (cached via .brain-last-pull) for append-only JSONL files. - Emits BRAIN_SYNC: status line every skill run. Also emits prose for the host LLM to fire the one-time privacy stop-gate (full / artifacts-only / off) when gbrain is detected and gbrain_sync_mode_prompted is false. Wired into preamble.ts composition.
This commit is contained in:
@@ -37,6 +37,9 @@ import { generateWritingStyleMigration } from './preamble/generate-writing-style
|
||||
// Host-specific instructions
|
||||
import { generateBrainHealthInstruction } from './preamble/generate-brain-health-instruction';
|
||||
|
||||
// GBrain cross-machine sync (runs at skill start; end-side handled in completion-status)
|
||||
import { generateBrainSyncBlock } from './preamble/generate-brain-sync-block';
|
||||
|
||||
// Behavioral / voice
|
||||
import { generateVoiceDirective } from './preamble/generate-voice-directive';
|
||||
|
||||
@@ -84,6 +87,7 @@ export function generatePreamble(ctx: TemplateContext): string {
|
||||
generateVendoringDeprecation(ctx),
|
||||
generateSpawnedSessionCheck(),
|
||||
generateBrainHealthInstruction(ctx),
|
||||
generateBrainSyncBlock(ctx),
|
||||
generateModelOverlay(ctx),
|
||||
generateVoiceDirective(tier),
|
||||
...(tier >= 2 ? [
|
||||
|
||||
Reference in New Issue
Block a user