test: fix operational-learning E2E fixture — copy lib/jsonl-store.ts

Pre-existing breakage, proven on main: gstack-learnings-log has imported
lib/jsonl-store.ts (shared injection patterns) since v1.57.5.0 / #1910, but
the fixture copies only the bin scripts — the bin exits 1 before writing
anything, on main silently (stderr swallowed) and on this branch loudly
(the #1950 error-surfacing made the four-day-old failure visible). A real
install always ships bin/ and lib/ together; the fixture now does too.
Verified: the fixture-shaped invocation writes the learning (exit 0) with
lib present, exits 1 on both main and this branch without it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan 2026-06-12 06:54:17 -07:00
parent 832a148e55
commit 3cbb5c3bbd
No known key found for this signature in database
GPG Key ID: C1F69E85C74EFE1D
1 changed files with 7 additions and 0 deletions

View File

@ -199,6 +199,13 @@ Report the exact output — either "READY: <path>" or "NEEDS_SETUP".`,
fs.copyFileSync(path.join(ROOT, 'bin', script), path.join(binDir, script));
fs.chmodSync(path.join(binDir, script), 0o755);
}
// gstack-learnings-log imports $SCRIPT_DIR/../lib/jsonl-store.ts (shared
// injection patterns, since v1.57.5.0) — a real install always ships bin/
// and lib/ together, so the fixture must too. Without it the bin exits 1
// before writing anything and the test fails on every attempt.
const libDir = path.join(opDir, 'lib');
fs.mkdirSync(libDir, { recursive: true });
fs.copyFileSync(path.join(ROOT, 'lib', 'jsonl-store.ts'), path.join(libDir, 'jsonl-store.ts'));
// gstack-learnings-log will create the project dir automatically via gstack-slug