Add deterministic CLI E2E smoke layer + CI#47
Draft
posthog[bot] wants to merge 1 commit into
Draft
Conversation
Adds a key-free, deterministic smoke/E2E layer that drives the real commander entrypoint (`src/cli.ts` via tsx) as a subprocess and wires up CI so CLI regressions get caught before shipping. - `POLYAGENT_STATE_PATH` override in config so tests isolate state to a temp file instead of mutating `~/.polyagent/state.json`. - `POLYAGENT_FAKE_ADAPTERS` test seam in the registry returning a deterministic in-memory adapter (no keys, no network). - `test/cli.e2e.test.ts` covering the deterministic validation branches (`--vendor` required, Jules `--repo` required, empty-state status) and a full dispatch → persist → status → followup happy path against fakes. - `.github/workflows/ci.yml` running build + full test suite on push/PR. - README + `test:e2e` script documenting how to run it locally. Why: the only CLI-level checks were live scripts that dispatch real vendor sessions and need API keys, so nobody could safely verify the CLI entrypoint before shipping (Linear PK-282). Generated-By: PostHog Code Task-Id: eae35fc3-1e75-413c-bebb-f140ebc531ae
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The only CLI-level checks were the two live scripts in
scripts/, which dispatch real vendor sessions and needANTHROPIC_API_KEY/JULES_API_KEY— so they can't run in CI and nobody could safely verify thepolyagententrypoint before shipping. There was also no CI at all.This adds a deterministic, key-free smoke/E2E layer that drives the real commander entrypoint (
src/cli.tsviatsx) as a subprocess, plus a CI workflow.POLYAGENT_STATE_PATHoverride (src/config.ts) so tests isolate state to a temp file instead of mutating~/.polyagent/state.json.POLYAGENT_FAKE_ADAPTERStest seam (src/registry.ts+src/adapters/fake.ts) — a deterministic in-memory adapter with no keys or network, so the CLI can run end-to-end.test/cli.e2e.test.ts— covers the deterministic validation branches (--vendorrequired, Jules--reporequired, empty-statestatus) and a fulldispatch → persist → status → followuphappy path against the fakes..github/workflows/ci.yml— runsnpm run build+npm teston every push and PR.test:e2escript documenting how to run it locally.Why
Tracked as Linear PK-282: regressions in CLI wiring, argument validation, and state handling could ship unnoticed because nothing exercised the actual entrypoint without real vendor keys. This gives ongoing regression safety with a check that runs in CI.
Test plan
npm test→ 41 tests pass (35 existing unit + 6 new E2E)npm run build→ cleannpm run test:e2e→ 6 E2E tests passscripts/smoke-*.tsare unchanged and still require keys.Created with PostHog Code from this inbox report.