nitsuah/stash · agent/prompts/JOURNEYS.md

QA before you have users.

An AI uses the app once, like a new user, and files every defect it can prove. Then it writes the happy paths down as Playwright journeys, and from there a plain script walks them every night: no model, no tokens. Failures become issues, repeats update the same issue, and fixes are verified by the bot, not by whoever merged them.

11issues from one review pass on fire
7journeys, written once
19visual baselines, Linux/Docker
0tokens per nightly run
3green nights before auto-close
19 seconds: the review pass on fire, the nightly run, and an issue's life from first failure to auto-close.
How it works

AI at two points. Code everywhere else.

Think of an OSRS essence-mining bot: deterministic, repeatable, close to free. The bot that uses the product every night is a Playwright script on a cron. AI writes it, and AI fixes what it finds. Everything between is GitHub Actions.

Review pass AI · onceAn agent tours the app, Pages site and promo at 1440×900 and 390×844 on the demo seed, reads every screenshot, and files one bot:review issue per defect it can back with a file:line cause or two reproductions.
Write the journeys AI · once per featureEach confirmed happy path becomes tests/journeys/*.spec.js: 2–4 step()s in the user's words, real seeded numbers in the assertions, and a screenshot baseline after every step.
Nightly run 0 tokensA reusable workflow runs the journeys in the Playwright Docker image: fictional seed, mocked prices, frozen clock, chart animations off.
Reporter 0 tokensreporter.mjs fingerprints each failure, opens or updates a bot:journey issue with pinned screenshots, rebuilds BUGS.md, and appends the night to metrics/<month>.jsonl.
Fix AI · once per bugDelivery routines take bot:journey issues before other backlog and open a PR that says Refs #N, never Fixes. The bot decides when it's fixed.
Monthly RSI 0 tokens + one short readmetrics.mjs prints flaky rate, reopen rate, time-to-fix and feature coverage. One AI pass turns outliers into rules.
Step 2 · nightly journeys

A journey is one thing a user wants done

Named in the user's words, tagged with the feature ids from promo/spots.json (so coverage counts itself), and asserted on numbers a user would notice. This is fire's, abridged:

test('reseller prices an eBay sale and logs it',
    { tag: ['@feature:fee-calculator', '@feature:income-logs'] }, async ({ page }) => {
  await step(page, 'open Side Hustle Hub', async () => {
    await openApp(page);
    await openTab(page, 'sidegig');
  });
  await step(page, 'price an eBay sale', async () => {
    await page.fill('#ebay-price', '100');
    await page.fill('#ebay-cost', '30');
    await page.fill('#ebay-shipping-actual', '8.50');
    await expect(page.locator('#ebay-res-profit')).toHaveText('$45.50');
  }, { docs: 'fee-calculator' });   // also writes docs/screenshots/fee-calculator.png
});

Every step() ends in a screenshot baseline with a fixed tolerance of 1,000 px: above the ~650 px of canvas font noise, and far below the 6,029 px a renamed wallet produced (a 1% ratio let that through). The same steps write the docs screenshots, so the README images can't go stale either.

fire's eBay fee calculator showing a $45.50 profit on a $100 sale
price an eBay sale: the $45.50 is asserted, not just pictured.
fire at 390 by 844 phone width with the retirement chart and asset allocation
The phone journey runs at 390×844 on its own.
Step 3 · no AI in the loop

Bugs file, dedup and close themselves

The fingerprint is repo | spec | journey | failing step | error class. The error class is coarse (expect:toHaveText, visual-diff, timeout:locator.click) so the same bug on a different night lands on the same issue.

WhenThe reporter
New fingerprintOpens a bot:journey issue: the step, the error, actual/diff/expected screenshots pinned to a commit, the repro command, the trace. At most 5 new per night.
Same fingerprint, issue openUpdates last seen and the occurrence count in the body. No comment, no noise.
Same fingerprint, issue closedReopens it and counts the reopen.
Journey passesCounts a green night. At 3 in a row, closes the issue with a link to the run. This is the fix verification.
Failed, then passed on retryNo issue. Counted as flaky in the metrics.
No report at allOne (harness) issue, which closes when journeys run again.
Every night it also rebuilds BUGS.md on the bot/journeys branch from the open bot:journey and bot:review issues, grouped by area: label. Nobody writes it by hand.