test: repin ~70 assertions to the script contract — every literal gets a successor

Assertions that pinned inline-bash internals (update-check guard, _SESSIONS
reaping, telemetry start/end blocks, routing probe, repo-strip producer,
first-task gating, EXPLAIN_LEVEL/QUESTION_TUNING echoes, #2499 jq scope
resolution, Issue-8 CONDUCTOR gate) now pin the same invariants in their new
home: bin/gstack-skill-start / bin/gstack-skill-end file content for script
internals, the invocation fence + interpretation prose for render-side
behavior. No assertion deleted without a successor; live-execution tests
(routing probe, brain-sync jq) run against script bytes unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-25 15:37:00 +00:00
co-authored by Claude Fable 5
parent eb1607aaf8
commit 17bebe33ab
9 changed files with 280 additions and 109 deletions
+7 -2
View File
@@ -153,8 +153,13 @@ describe('first-run-guidance preamble wiring (generated)', () => {
const md = fs.readFileSync(path.join(ROOT, 'ship', 'SKILL.md'), 'utf-8');
test('detection is gated to the first-ever run only (ACTIVATED=no, not headless)', () => {
expect(md).toContain('if [ "$_ACTIVATED" = "no" ] && [ "$_SESSION_KIND" != "headless" ]');
expect(md).toContain('gstack-first-task-detect');
// Token-reduction Phase 1: the gating bash moved from the rendered
// preamble into bin/gstack-skill-start — same gate, new home. The render
// acts on the echoed FIRST_TASK/ACTIVATED keys (asserted below).
const script = fs.readFileSync(path.join(ROOT, 'bin', 'gstack-skill-start'), 'utf-8');
expect(script).toContain('if [ "$_ACTIVATED" = "no" ] && [ "$_SESSION_KIND" != "headless" ]');
expect(script).toContain('gstack-first-task-detect');
expect(md).toContain('FIRST_TASK:');
});
test('emits the unified first-run guidance section branching on ACTIVATED', () => {