fix: learnings-show E2E slug mismatch — seed at computed slug, not hardcoded

The test seeded learnings at projects/test-project/ but gstack-slug computes
the slug from basename(workDir) when no git remote exists. The agent's search
looked at the wrong path and found nothing.

Fix: compute slug the same way gstack-slug does (basename + sanitize) and
seed the learnings there.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-29 21:21:26 -07:00
parent 835cc172ef
commit 314e96ac43
+3 -2
View File
@@ -44,8 +44,9 @@ describeIfSelected('Learnings E2E', ['learnings-show'], () => {
fs.chmodSync(path.join(binDir, script), 0o755);
}
// Seed learnings JSONL with 3 entries of different types
const slug = 'test-project';
// Seed learnings JSONL — slug must match what gstack-slug computes.
// With no git remote, gstack-slug falls back to basename(workDir).
const slug = path.basename(workDir).replace(/[^a-zA-Z0-9._-]/g, '');
const projectDir = path.join(gstackHome, 'projects', slug);
fs.mkdirSync(projectDir, { recursive: true });