Skip to content

Add a field-test harness for the AI-agent install prompt#47

Open
ejntaylor wants to merge 1 commit into
mainfrom
field-test-harness
Open

Add a field-test harness for the AI-agent install prompt#47
ejntaylor wants to merge 1 commit into
mainfrom
field-test-harness

Conversation

@ejntaylor

Copy link
Copy Markdown
Contributor

Summary

Turns the ad-hoc setup that found the prompt's four refusal modes into a repeatable dev harness under field-test/ (dev-only, not shipped in the npm package): it runs a real AI agent through the full install flow in a throwaway Lovable-style fixture against a mocked Patchstack API, and scores the outcome on 8 deterministic checks (install, provisioned exactly once, build hooks, widget present + userToken matches, claim URL surfaced to the user, no production leak).

  • run.mjs orchestrates fixture + mock + agent CLI (default headless Claude Code, pluggable via --agent-cmd), supports --rounds for stochastic agents and --prompt for testing variants, and exits non-zero unless every round is fully green; agent reports, request logs, and scorecards land in gitignored field-test/results/.
  • The mock endpoint is pinned via PATCHSTACK_ENDPOINT on the agent's environment rather than a planted rc file — in earlier runs every agent flagged the rc override as the top trust concern, and one deleted it and provisioned a real production site.
  • Two personas: standard (Lovable-style platform agent) and hostile, which encodes the real Bolt/WebContainer refusal pressure so that refusal mode stays a regression test; prompt.txt carries the harness-validated one-line prompt and the improve-and-retest loop is documented in field-test/README.md.
  • stub-compliant.mjs is a scripted non-AI agent for ~1-minute harness self-tests.

Test plan

  • Self-test with the scripted stub: 8/8 checks green against the real published 0.3.5 (real npm install, mock provisioning, hooks, widget, claim URL).
  • Refusal path: a refusing agent-cmd scores 2/8, is flagged REFUSED, and the run exits non-zero.
  • npm test untouched (no src/ changes in this PR).

🤖 Generated with Claude Code

@coderbuds

coderbuds Bot commented Jul 13, 2026

Copy link
Copy Markdown

Introduces a comprehensive AI-agent field-test harness with clear docs and modular code.

🎯 Quality: 75% Good · 📦 Size: Large — consider splitting if possible

🛡️ Standards: no pre-flight fit check ran for this change — wire assess-change-fit into your coding agents to catch size before opening.

📈 This month: Your 218th PR — above team average · Averaging Good

See how your team is trending →

Institutionalizes the ad-hoc setup used to find and fix the prompt's refusal
modes and the guide's UX gaps: run a real agent through the full install in a
throwaway vibe-platform fixture against a mocked Patchstack API, then score
the outcome on 8 deterministic checks (install, single provisioning, hooks,
widget + token match, claim URL surfaced, no production leak).

- field-test/run.mjs — orchestrator: fixture + in-process mock + agent CLI
  (default headless Claude Code, pluggable via --agent-cmd) + scorecard;
  --rounds for stochastic agents, --prompt for variants, non-zero exit unless
  all rounds are fully green. Results (agent report, request log, scorecards)
  land in gitignored field-test/results/.
- Mock endpoint is pinned via PATCHSTACK_ENDPOINT on the agent process, not a
  project file: every agent flagged a planted rc override as the top trust
  concern, and one deleted it and provisioned a real production site. Env
  pinning survives project edits and reads as platform plumbing.
- personas/standard.md + personas/hostile.md — the second encodes the
  WebContainer/Bolt refusal pressure (supply-chain framing, no-authorization-
  URLs policy, sandboxed verification distrust) so that refusal mode stays a
  regression test. prompt.txt carries the harness-validated one-line prompt.
- stub-compliant.mjs — scripted non-AI agent that self-tests the harness in
  ~1 min (verified 8/8 green; refusal path verified detected and non-green).
- README points prompt editors at the harness before shipping changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ejntaylor ejntaylor force-pushed the field-test-harness branch from 707160b to 8a00dd8 Compare July 13, 2026 22:27
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