fix(state-root): completion-status telemetry prose names $GSTACK_STATE_ROOT/analytics

gstack-skill-end writes analytics under the resolved state root ($_GH), so the
PLAN MODE EXCEPTION note now names $GSTACK_STATE_ROOT/analytics/ instead of
the ~/.gstack default.

Allowlist: drops the generate-completion-status.ts PENDING row.
Pin (W7a): gen-skill-docs 'render documents the analytics sink' now checks
that the render names the state-root analytics dir.
This commit is contained in:
garrytan committed 2026-10-03 02:19:26 +00:00
1 parent fc0aacd080
commit d7e9f0b501
3 files changed
+2 -3

No files matched your search

@@ -69,7 +69,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue
(the former skill-end sync step — do not run gstack-brain-sync separately).
**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to
\`~/.gstack/analytics/\`, matching preamble analytics writes.
\`$GSTACK_STATE_ROOT/analytics/\`, matching preamble analytics writes.
\`\`\`bash
${ctx.paths.binDir}/gstack-skill-end --skill "${ctx.skillName}" --outcome OUTCOME \\
+1 -1
View File
@@ -441,7 +441,7 @@ describe('gen-skill-docs', () => {
expect(SKILL_END_SCRIPT).toContain('analytics/skill-usage.jsonl');
// The render still tells the model where telemetry lands.
const content = fs.readFileSync(path.join(ROOT, 'SKILL.md'), 'utf-8');
expect(content).toContain('~/.gstack/analytics');
expect(content).toContain('$GSTACK_STATE_ROOT/analytics/');
});
test('plan-review generated preambles stay under the Option A budget', () => {
-1
View File
@@ -193,7 +193,6 @@ const STATE_ROOT_ALLOWLIST: Array<{ file: string; match: string; reason: string
{ file: 'retro/SKILL.md.tmpl', match: 'glob: "~/.gstack/projects/{repo_slug}/learnings.jsonl"', reason: MANIFEST_GLOB },
{ file: 'scripts/resolvers/learnings.ts', match: '* Learnings are stored per-project at ~/.gstack/projects/{slug}/learnings.jsonl', reason: SOURCE_COMMENT },
{ file: 'scripts/resolvers/preamble.ts', match: 'local JSONL append to ~/.gstack/analytics/ (inline, inspectable)', reason: SOURCE_COMMENT },
{ file: 'scripts/resolvers/preamble/generate-completion-status.ts', match: '\\`~/.gstack/analytics/\\`, matching preamble analytics writes', reason: PENDING },
];
describe('templates and resolvers name gstack state only through allowlisted literals', () => {