feat(egress): memorable-recall row in gstack-egress grants

`gstack-egress grants` promises every standing consent in force with the
command that revokes it. The Memorable bridge's memorable_recall key is
one, so it gets a row: off by default, granted only when
`gstack-memorable enable` set it, revoked by `gstack-memorable disable`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-09-08 17:53:57 +00:00
co-authored by Claude Fable 5.1
parent ae706a6168
commit 0eaff4b376
2 changed files with 23 additions and 2 deletions
+13 -2
View File
@@ -108,10 +108,10 @@ describe('gstack-egress verify', () => {
});
describe('gstack-egress grants', () => {
test('fresh home shows the four upstream grants off, each naming file and revoke command', () => {
test('fresh home shows the five standing grants off, each naming file and revoke command', () => {
const r = run(['grants']);
expect(r.code).toBe(0);
for (const grant of ['telemetry', 'brain-sync', 'redact_repo_visibility', 'redact_prepush_hook']) {
for (const grant of ['telemetry', 'brain-sync', 'redact_repo_visibility', 'redact_prepush_hook', 'memorable-recall']) {
expect(r.stdout).toContain(grant);
}
expect(r.stdout).not.toContain('[GRANTED]');
@@ -142,6 +142,17 @@ describe('gstack-egress grants', () => {
expect(sync.value).toBe('full');
const hook = grants.find((g: any) => g.grant === 'redact_prepush_hook');
expect(hook.granted).toBe(false);
// the Memorable bridge consent is a standing grant too: off by default, on only via gstack-memorable enable
const memo = grants.find((g: any) => g.grant === 'memorable-recall');
expect(memo.granted).toBe(false);
expect(memo.key).toBe('memorable_recall');
expect(memo.revoke).toContain('gstack-memorable disable');
spawnSync(path.join(ROOT, 'bin', 'gstack-config'), ['set', 'memorable_recall', 'on'], {
encoding: 'utf-8', env: { ...process.env, GSTACK_HOME: home }, timeout: 30_000,
});
const after = JSON.parse(run(['grants', '--json']).stdout).find((g: any) => g.grant === 'memorable-recall');
expect(after.granted).toBe(true);
expect(run(['grants']).stdout).toContain('[GRANTED] memorable-recall: on');
});
});