Skip to content

test(persist): interactive run without --ephemeral creates .harness/<agent>/ persistence dir#23

Merged
capotej merged 1 commit intocapotej:mainfrom
hggz:feat/track-d-persist-dir-created
Apr 27, 2026
Merged

test(persist): interactive run without --ephemeral creates .harness/<agent>/ persistence dir#23
capotej merged 1 commit intocapotej:mainfrom
hggz:feat/track-d-persist-dir-created

Conversation

@hggz
Copy link
Copy Markdown
Contributor

@hggz hggz commented Apr 26, 2026

What

Adds an e2e test that locks the boundary in the interactive + non-ephemeral branch of run():

  • TTY (no -p, no piped stdin)
  • no --ephemeral flag

In that branch the CLI is required to materialize the persistence dirs that the active adapter advertises via persistMounts() and pass them as -v mounts. For the pi adapter that means creating <cwd>/.harness/pi/ and emitting a -v <host>:/home/harness/.pi/agent mount.

Why

This is the inverse of the two existing implicit-ephemeral tests (-p and piped stdin) — both assert that .harness/ is not created. Nothing currently asserts the positive case, so a future refactor that flips effectiveEphemeral or drops the fs.mkdirSync() call would slip through CI.

The branch is only reachable when process.stdin.isTTY === true, so the test allocates a PTY via util-linux script (same approach as the existing pi: interactive ... no -p test merged in #5/#22). Self-skips on platforms without script.

How verified

pnpm install --frozen-lockfile && pnpm build && pnpm test:e2e:cli
# 21/21 pass (was 20/20)
pnpm lint:ts
# Checked 6 files. No fixes applied.

Net diff: +1 test in tests/e2e/cli.test.mjs.

@capotej capotej merged commit 4783fa7 into capotej:main Apr 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants