diff --git a/lib/state-root.ts b/lib/state-root.ts index a0b178060..34a0fa756 100644 --- a/lib/state-root.ts +++ b/lib/state-root.ts @@ -55,7 +55,7 @@ export const MERGED_CONFIG_KEYS: Record = { }; /** Same parse as `gstack-config get`: last `^key:` line wins, value trimmed, empty = unset. */ -function readKeyFromRoot(root: string, key: string): string | null { +export function readKeyFromRoot(root: string, key: string): string | null { let yaml: string; try { yaml = fs.readFileSync(`${root}/config.yaml`, 'utf-8'); diff --git a/lib/transcript-consent.ts b/lib/transcript-consent.ts new file mode 100644 index 000000000..8f39dd3c5 --- /dev/null +++ b/lib/transcript-consent.ts @@ -0,0 +1,425 @@ +/** + * transcript-consent — the one reader of transcript consent. Reads + * `transcript_ingest_mode` and `transcript_repos` together from every root in + * mergedStateRoots() and returns one policy that gstack-memory-ingest, + * gstack-gbrain-sync and gstack-brain-sync (through this file's CLI) share. + * + * Value grammar: `[@][+repos]`, base recent | all | + * off | new. `@