rea-ci-tests-audit
MOmorluto/rea486k8,943 new stars in the last 7 days
Run first-pass automated manual testing for PRs that are reviewed or nearly ready to merge. Use when the user asks to test a PR/branch/worktree, validate product flows, exercise browser or CLI workflows, map changed UI journeys with screenshots, verify analytics/webhooks/payments/email/SMS behavior through connected tools, or produce manual QA notes before human testing.
Validate as much of a PR as possible with local services, browser automation, CLIs, logs, and product connectors before the user does final manual testing. Treat this as a first-pass QA workflow: prove what works with evidence, identify what still needs a human, and preserve a reproducible trail.
Confirm the test target:
git status, current branch, remotes, and whether unrelated local changes exist.Check tools and authentication up front:
gh auth status, stripe --version / active listener state, Docker status, PostHog/GitHub/Gmail connectors, cloud CLIs, or app-specific CLIs.composio search to find candidate inbox, SMS/phone, payment, CRM, support, or provider-log tools, then inspect schemas with --get-schema before executing.Prepare the environment:
Build the automated test path:
agent-e2e-<timestamp>.tmp/pr-<number>-qa/ or tmp/<branch>-qa/. Use ordered filenames that describe the journey step, such as 01-signup-account.png and 02-dropdown-expanded.png.recordVideo) so it is a free byproduct of the drive, not a second pass. Keep the driver's native format (WebM from browser, MP4 from simulator). Videos complement stills, never replace them: per-step captures remain the frame-addressable evidence, the video is the continuity check. Where ffmpeg is available, scan for blank-frame bands (ffprobe -f lavfi "movie=<video>,fps=5,signalstats" -show_entries frame=pts_time -show_entries frame_tags=lavfi.signalstats.YAVG; YAVG ~235 is blank white) and report layout jumps, white flashes, or dead time as findings with timestamp ranges.Verify externally, not just locally:
Report results:
Open with a verdict, then the evidence. The structure:
Verdict: <all-proven | partial | blocked-env | blocked-auth | blocked-timeout | product-bug-found>
| Journey / Check | Result | Evidence |
|-----------------|--------|----------|
| <flow or check> | Pass / Fail / Blocked / Left to human | <quoted output, screenshot ref, connector readback> |
Skipped (with rationale):
- <item>: <why it was skipped, not just "skipped">
Cleanup disposition:
| Created | Marker | System | Disposition |
|---------|--------|--------|-------------|
| <account, org, record> | <run marker> | <staging / analytics / billing> | deleted · registered (<why not safe>) · none created |
Blocked and Left to human count as undetermined, never as a pass.
A pass without quoted evidence is not a pass. "Blocked" is a terminal
verdict: when a check cannot be exercised (missing env, service down,
no credentials), stop trying rather than improvising a workaround.
Try documented Cross-OS Workspaces routes during preflight within the run
bounds. Once setup is blocked, continue independent platforms and report
the gap; evidence must come from the product's real test path.
Terminal states and what the human should do next:
all-proven: every check passed with evidence. Ready for human review.partial: some checks passed, others left to human. List the gaps.blocked-env: environment issue (service down, container missing). Name the blocker.blocked-auth: missing credentials or connector scopes. Name what is needed.blocked-timeout: wall clock expired before all checks completed. List what finished and what remains.product-bug-found: a check failed and the failure is in the product. Describe the bug with evidence.Beyond the verdict, the report must include:
When screenshots are safe to share, publish them on a repository-owned durable asset surface. For GitHub PRs, prefer an existing long-lived release such as pr-assets; do not use an arbitrary temporary host when a suitable repository release is available. For GitHub PR targets where the user asked for PR testing, update the PR description with a concise QA summary where reviewers look first. Use a marked section so reruns replace the latest QA summary without overwriting the author-written description. Use a separate marked QA comment for long evidence, logs, and screenshot galleries when the description would become unwieldy.
PostHog JavaScript drops capture events from likely bots. Headless Playwright can still fetch PostHog config and run identify, while capture events are silently dropped because navigator.webdriver is true, the user agent looks automated, or navigator.userAgentData.brands includes HeadlessChrome.
When the explicit goal is to validate product analytics in local automation:
userAgent is not enough if navigator.userAgentData still exposes headless Chrome:const context = await browser.newContext({
userAgent:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' +
'(KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36',
})
await context.addInitScript(() => {
const brands = [
{ brand: 'Chromium', version: '125' },
{ brand: 'Google Chrome', version: '125' },
{ brand: 'Not.A/Brand', version: '24' },
]
const fullVersionList = brands.map((brand) => ({
...brand,
version: `${brand.version}.0.0.0`,
}))
Object.defineProperty(navigator, 'webdriver', { get: () => undefined })
Object.defineProperty(navigator, 'userAgentData', {
get: () => ({
brands,
mobile: false,
platform: 'Windows',
getHighEntropyValues: async () => ({
brands,
mobile: false,
platform: 'Windows',
architecture: 'x86',
bitness: '64',
model: '',
uaFullVersion: '125.0.0.0',
fullVersionList,
}),
toJSON: () => ({ brands, mobile: false, platform: 'Windows' }),
}),
})
})
await context.addInitScript(() => {
Object.defineProperty(navigator, 'platform', { get: () => 'Win32' })
})
flags or config requests as evidence that capture events were ingested.Some PRs only work when a marketing site, API route, installer, desktop app, or mobile client is tested as one product flow. When attribution or install/download analytics cross those boundaries:
ref, utm, or attribution token.on* or subscribe* APIs can create false crashes that look like product regressions.For payment, email, SMS, analytics, and other third-party integrations:
When testing an open PR, preserve the result where reviewers will look first:
Create a local artifact folder such as tmp/pr-<number>-qa/ containing raw screenshots, scripts, the exact PR Markdown, and pr-assets-manifest.json.
Classify every image before upload. Do not upload PHI, secrets, private customer data, real inbox contents, payment details, MFA codes, production admin data, or anything inappropriate for every person who can read the PR. Keep sensitive images local and redact a copy only when the redaction can be verified visually.
Prefer a repository-owned durable surface. For GitHub PRs, discover and reuse a published, mutable, long-lived release such as pr-assets or the repository's documented equivalent:
repo="$(gh repo view --json nameWithOwner --jq .nameWithOwner)"
default_branch="$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name)"
gh release list -R "$repo" --limit 100 \
--json tagName,name,isDraft,isPrerelease
gh release view pr-assets -R "$repo" \
--json tagName,isDraft,isPrerelease,isImmutable,url,assets
Do not create a release per PR. Do not use an arbitrary temporary host when a suitable repository release exists.
If no suitable release exists, creating one dedicated long-lived pr-assets release is a separate hard stop requiring an exact grant such as {"action":"create_release","repo":"owner/name","tag":"pr-assets"}. Generic GitHub, PR, comment, or asset-upload authorization does not grant creation. Use the default branch as its target and keep it out of Latest-release semantics:
gh release create pr-assets -R "$repo" --title "PR assets" \
--notes "Long-lived image assets for pull requests and QA evidence." \
--latest=false --target "$default_branch"
If release creation or upload is not authorized, do not fall back to a temporary host. Write the intended filenames, manifest, exact gh release create / gh release upload commands, and ready-to-paste marked PR Markdown into the artifact folder; report that durable publication is blocked.
Compute the source SHA-256 before upload. Name every asset with stable context plus content identity, for example pr-<number>-<head-short-sha>-<content-sha12>-<step>.png. Use a branch slug when the PR number does not exist yet. Sanitize names to portable lowercase ASCII.
Make reruns idempotent. Inspect release assets before uploading. If the exact name exists and its GitHub digest (or a downloaded byte-for-byte hash when no digest is present) matches the local file, reuse its URL. If the content differs, do not overwrite or use gh release upload --clobber; extend the hash or add a deterministic suffix and upload a new asset so an older PR never changes underneath reviewers.
Upload with gh release upload <tag> <path> -R "$repo", then read back the release and asset metadata. Require the intended tag, a non-draft release, uploaded asset state, expected filename, size, SHA-256 digest when GitHub supplies it, and browser_download_url.
Perform a direct GET of the uploaded bytes (authenticated through GitHub for private repositories), not only a HEAD request. Compare the downloaded SHA-256 and size with the local source and verify the decoded file type or image magic; an HTML login/error page with a misleading status is a failure. Record the verification timestamp and result.
Maintain pr-assets-manifest.json across reruns. For each asset record the repository, release tag and URL, PR number, head commit, source path, semantic step, asset name, local SHA-256 and size, asset API URL, browser download URL, upload-or-reuse status, timestamp, and content-verification result. Never put tokens, cookies, or sensitive test data in the manifest.
Treat the PR description as the primary review surface. Append or replace only the section between <!-- pr-test-automation-summary:start --> and <!-- pr-test-automation-summary:end --> without rewriting the human-authored PR summary. If a legacy <!-- codex-pr-test-automation-summary --> section exists, migrate that section once instead of duplicating it. Keep the PR description QA section compact and include:
Without a posting grant, render this content as a page (see page) at tmp/pages/<slug>/qa.html, open it for the person, and return its path. With a grant, post or update one PR comment whose owned content is bounded by <!-- pr-test-automation-detail:start --> and <!-- pr-test-automation-detail:end --> when detailed evidence, logs, or screenshot galleries are too large for the PR description. Recognize the legacy <!-- codex-pr-test-automation --> marker so reruns update rather than duplicate an older comment. Include:
Render safe uploaded screenshots inline so reviewers can skim without opening every link. Do not leave the PR description or QA comment as a plain list of screenshot URLs when UI changed.
Prefer grouped preview galleries:
<details open> section per user journey or touched UI surface when there are many screenshots.<img> tags. If using HTML, constrain width around 360-480 pixels so the PR remains readable.Keep unsafe screenshots local only and say why. Examples: payment card entry screens, PHI, secrets, private customer data, real inbox contents, MFA codes, or production admin data. Mention their local paths without rendering or uploading them.
When updating an existing marked QA summary or comment, replace dead, expiring, temporary, or local-only image references with verified durable URLs and inline previews during the same update instead of adding a second comment. Preserve all author-written text outside the markers. If an image URL outside a marker is broken, change only that URL after verifying the intended replacement; do not rewrite the surrounding prose.
Example compact preview block:
<details open>
<summary>Signup journey screenshots</summary>
| Step | Preview |
| --- | --- |
| Account details | Shows the default account form before submission; reviewer should check required fields and spacing.<br><img src="https://example.test/01-account.png" width="420" alt="Account details form"> |
| Validation error | Shows the blocked submit state; reviewer should check copy, focus, and error placement.<br><img src="https://example.test/02-validation.png" width="420" alt="Validation error state"> |
</details>
Stop and ask the user before:
Otherwise, keep going through setup, execution, verification, cleanup, and a concise result summary.
Set a 90-minute wall clock for the entire run. Per-journey, allow at most 2
retry attempts before marking the journey failed or blocked. No combination
of retries extends the wall clock. If the wall clock expires mid-journey,
finalize evidence for what completed, mark in-progress items as
blocked-timeout, and report.
The run's unique marker names real things that now exist in external systems: accounts, organizations, records, subscriptions, analytics events. Disclosure alone is not disposal.
Delete in-run only when all three conditions hold:
If any condition fails or is uncertain, do not delete. Register the item: name the marker, the system, and what remains, precisely enough that a repo-side reaper can find it by marker alone. Production analytics and live-mode billing are register-only by default.
Either way the disposition appears in the report's cleanup table. "None created" is a disposition too, not an excuse to omit the table.
Event ingestion alone is not enough. Verify PERSON STITCHING whenever a PR touches analytics, signup, login, or session handling:
person_id, never by person.properties.*. Event-time
person properties differ per row and can make N merged users each look like "one clean
person". Six merged QA users passed an email-grouped check; a person_id-grouped check
exposed they were all a single person.distinct_id per event when stitching looks wrong. It names the exact
identity that captured the event and usually identifies the merge vector directly.sendBeacon transport. Absence in the warehouse (not the network tab) is the proof.QA evidence is current-head evidence and the Manual tests checklist is the
body's contract, so anything that would change either runs first. On a large
PR (over 10 files or 300 hand-written lines) that has not had a
refactor pass, say so and offer it before driving
anything. A refactor landed after
QA means this whole pass runs again. Likewise cold-read on the PR body
comes before QA, so the checklist you execute is the one the reader will see.
Before spending a long QA pass, verify the PR is in a testable state. Pass
the identified PR number or URL to every gh pr view call (bare gh pr view
defaults to the current branch's PR, which may differ from the test target):
gh pr view <PR> --json mergeable,mergeStateStatus.
A conflicting PR may get no gating CI run at all, and QA evidence against a
conflicting head is evidence against code that will change on merge. If
conflicting, report blocked rather than driving.headRefOid is part of the
tested state (gh pr view <PR> --json headRefOid). When testing companion
PRs together, the local HEAD may be a merge commit that incorporates
multiple PR heads; verify the target PR's head is in the ancestry
(git merge-base --is-ancestor <headRefOid> HEAD) and record the composite
SHA rather than requiring an exact match. A checkout that does not contain
the PR head produces evidence for code the reviewer is not looking at.gh run list --commit <headRefOid>). If the repo has CI
and no run registered, something is wrong (path filters, a conflicting
state, a workflow syntax error). Note it; do not assume the code is healthy.MOmorluto/rea486k8,943 new stars in the last 7 days
MOmorluto/rea486k8,943 new stars in the last 7 days
MAmattpocock/skills337k4,978 new stars in the last 7 days
MAmattpocock/skills337k4,978 new stars in the last 7 days
MAmattpocock/skills337k4,978 new stars in the last 7 days
Block dangerous git commands like push and reset --hard before they execute.
MAmattpocock/skills337k4,978 new stars in the last 7 days