mirror of https://github.com/garrytan/gstack.git
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:
parent
835cc172ef
commit
314e96ac43
|
|
@ -44,8 +44,9 @@ describeIfSelected('Learnings E2E', ['learnings-show'], () => {
|
||||||
fs.chmodSync(path.join(binDir, script), 0o755);
|
fs.chmodSync(path.join(binDir, script), 0o755);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Seed learnings JSONL with 3 entries of different types
|
// Seed learnings JSONL — slug must match what gstack-slug computes.
|
||||||
const slug = 'test-project';
|
// 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);
|
const projectDir = path.join(gstackHome, 'projects', slug);
|
||||||
fs.mkdirSync(projectDir, { recursive: true });
|
fs.mkdirSync(projectDir, { recursive: true });
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue