Skip to content

test(e2e): MCP-only agent E2E harness over nself mcp (P7-SHIP-02) - #1029

Open
acamarata wants to merge 1 commit into
mainfrom
feat/p7-ship-02-agent-e2e
Open

acamarata wants to merge 1 commit into
mainfrom
feat/p7-ship-02-agent-e2e

Conversation

@acamarata

Copy link
Copy Markdown
Collaborator

What

P7-SHIP-02: the MCP-only agent E2E harness (SHIP Epic D7).

  • test/e2e/agent/ (build tag e2eagent): mcp-go stdio client replaying testdata/replay.jsonl against a sandboxed nself mcp; two loopback simharness hosts (qa tier local-servers, prod tier prod) in the inventory v2 fixture; failure-recovery and destructive-gate legs; transcript writer and verifier with bad fixtures.
  • scripts/e2e/agent/run.sh (--replay, --live, --verify-transcript, --self-test, --tools-list) and mcp-sandbox.sh (env -i, temp HOME, loopback-only allowlist, refuses SSH_AUTH_SOCK and a reachable operator ~/.ssh).
  • .github/workflows/agent-e2e.yml (ubuntu-latest, actions pinned by SHA, artifact agent-e2e-transcript).
  • Vendored mcp-go/client and client/transport; go.mod unchanged.
  • Guide section "End-to-end proof" and test/e2e/agent/README.md.

No committed key or token: the only key is the one simharness generates per run. gitleaks 8.21.2 (gate-pinned) with .github/gitleaks.toml: clean.

Verified locally

  • go vet -mod=vendor -tags e2eagent ./test/e2e/agent/...
  • run.sh --self-test (unit tests plus four sandbox refusals and a clean accept)
  • run.sh --verify-transcript exits 1 on all five bad fixtures, 0 on the good one
  • run.sh --tools-list <bin> --env NSELF_V15=1 returns a sorted non-empty array
  • go.mod unchanged; no production address in the diff; diff within the ticket write scope

Not green yet: product gaps the replay hits

The Agent E2E replay drives the real product and stops at the first failing step. Expected to fail until these close (details in the README):

  1. nself mcp (v1.5) will not start outside a project, so init is unreachable over MCP (harness writes an empty .env marker as a stopgap).
  2. nself_build on a fresh project fails E451: the gate runs --plan-id on a build that generates secrets.
  3. MCP tools are fixed at server start, so nself_ci* never appear after nself_add ci in the same session; P7-CI-62 (ci machine surface) is not merged.
  4. nself_deploy_promote accepts one argument only, so qa prod is rejected.
  5. 300 s document timeout with no nself mcp --timeout flag.

(P7-SHIP-02)

Add test/e2e/agent (build tag e2eagent): an mcp-go stdio client replays
testdata/replay.jsonl against `nself mcp` started through
scripts/e2e/agent/mcp-sandbox.sh, with two loopback simharness hosts in
inventory envs qa (tier local-servers) and prod (tier prod). The flow is
init, build (plan, confirm), start, the failure-recovery and
destructive-gate legs, db migrate up, add ci, async CI (detach, runs wait,
evidence), deploy qa, promote dry run, confirmed promote. Every request,
result and harness action goes to a JSONL transcript that verify.go checks;
bad fixtures prove the verifier rejects non-MCP use, a missing step, a
promote apply before its dry run, CI evidence before the wait and a non-v1
envelope.

mcp-sandbox.sh runs the server under env -i with a temp HOME holding only
the per-run sim key and ssh config, and refuses SSH_AUTH_SOCK, a reachable
operator ~/.ssh and any host other than 127.0.0.1. The only key is the one
simharness generates at run time; nothing credential-shaped is committed.

run.sh modes: --replay, --live (headless agent session with only the MCP
server, optional harness-side prod probe), --verify-transcript,
--self-test, --tools-list. The Agent E2E workflow runs the replay on
ubuntu-latest and uploads agent-e2e-transcript. Vendors the mcp-go client
and client/transport packages (go.mod unchanged). The README lists the
product gaps the replay hits today.

(P7-SHIP-02)

This branch has not been deployed

No deployments
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.

1 participant