mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-21 23:51:35 +01:00
W4: transcript consent prose in /setup-gbrain, /sync-gbrain and memory.md
The Step 7.5 gate is rewritten as a consent question (manual merge of s09 H5, with H1b and H6): it checks gstack-config has, asks once with A) recent, B) all history, E) never, names Claude Code and Codex sessions from every repo-policy-allowed project and the destination brain, stores the mode value (never the letter), asks yes/no when no transcripts exist, never asks spawned or headless sessions, and drops the silent no-question bulk paths and the false skill-start-hook claim (s09 H5c). Path 4 no longer stores off on the user's behalf. /sync-gbrain gains Step 1.6 (ask when the key is absent or holds a legacy value). Step 10 and the sync verdict show the mode. setup-gbrain/memory.md gains #transcripts (values, sources, destination, override precedence, one-time restage, held staged pages, already-ingested pages stay). W7a: setup-gbrain-bin-invocation-paths drops the silent-bulk and preamble-hook pins (that prose is gone) for negative checks (no pre-answer --bulk, no skill-start claim), loosens the gstack-config pin (t06 #18) to the command without <choice>, and adds the DX 'gated on has' order check for both skills.
This commit is contained in:
1 parent
26c6bf263f
commit
67bd3d6267
6 files changed
+220
-69
No files matched your search
@@ -74,10 +74,8 @@ describe('setup-gbrain templates (skeleton + sections) — bin invocation paths'
|
||||
);
|
||||
});
|
||||
|
||||
test('the silent-bulk mention uses bun run + .ts (R2, transcript-gate section)', () => {
|
||||
expect(transcriptGate).toContain(
|
||||
'bun run ~/.claude/skills/gstack/bin/gstack-memory-ingest.ts --bulk --quiet'
|
||||
);
|
||||
test('the gate never bulk-ingests before the user answers (transcript-gate section)', () => {
|
||||
expect(transcriptGate).not.toMatch(/gstack-memory-ingest\.ts --bulk/);
|
||||
});
|
||||
|
||||
test('the post-answer full-sync step uses bun run + .ts (R3, transcript-gate section)', () => {
|
||||
@@ -86,19 +84,30 @@ describe('setup-gbrain templates (skeleton + sections) — bin invocation paths'
|
||||
);
|
||||
});
|
||||
|
||||
test('the preamble-hook incremental-sync mention uses bun run + .ts (R4, transcript-gate section)', () => {
|
||||
expect(transcriptGate).toContain(
|
||||
'bun run ~/.claude/skills/gstack/bin/gstack-gbrain-sync.ts --incremental --quiet'
|
||||
);
|
||||
test('no skill-start hook is claimed to ingest transcripts; /sync-gbrain is named (transcript-gate section)', () => {
|
||||
expect(transcriptGate).not.toMatch(/every skill\s+start/i);
|
||||
expect(transcriptGate).toContain('/sync-gbrain');
|
||||
});
|
||||
|
||||
test('the neighboring gstack-config line in the post-answer block is untouched (bash script, no extension)', () => {
|
||||
expect(transcriptGate).toContain(
|
||||
'~/.claude/skills/gstack/bin/gstack-config set transcript_ingest_mode <choice>'
|
||||
);
|
||||
test('the post-answer gstack-config line stores a mode value, not the answer letter (bash script, no extension)', () => {
|
||||
expect(transcriptGate).toContain('~/.claude/skills/gstack/bin/gstack-config set transcript_ingest_mode');
|
||||
expect(transcriptGate).not.toContain('transcript_ingest_mode <choice>');
|
||||
});
|
||||
});
|
||||
|
||||
describe('transcript consent question is gated on `gstack-config has`', () => {
|
||||
const syncTmpl = fs.readFileSync(path.join(ROOT, 'sync-gbrain', 'SKILL.md.tmpl'), 'utf-8');
|
||||
for (const [name, text] of [['setup-gbrain transcript gate', transcriptGate], ['sync-gbrain', syncTmpl]] as const) {
|
||||
test(`${name} checks presence with has before asking, and never asks spawned or headless sessions`, () => {
|
||||
const hasAt = text.indexOf('gstack-config has transcript_ingest_mode');
|
||||
expect(hasAt).toBeGreaterThanOrEqual(0);
|
||||
expect(text.indexOf('AskUserQuestion', hasAt)).toBeGreaterThan(hasAt);
|
||||
for (const v of ['recent', 'all', 'off']) expect(text).toContain(`\`${v}\``);
|
||||
expect(text).toMatch(/spawned[\s\S]{0,40}headless[\s\S]{0,80}do not ask/i);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
describe('setup-gbrain/memory.md — bin invocation paths', () => {
|
||||
test('no bare gstack-memory-ingest invocation remains', () => {
|
||||
expect(memoryDoc).not.toMatch(bareMemoryIngest);
|
||||
|
||||
Reference in new issue
Block a user