Skip to content

feat(replay): add stable-selector evidence replay contracts - #17

Merged
alvarohulse merged 40 commits into
mainfrom
codex/replay-evidence-contract
Aug 19, 2026
Merged

alvarohulse merged 40 commits into
mainfrom
codex/replay-evidence-contract

Conversation

@alvarohulse

@alvarohulse alvarohulse commented Aug 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds a production proofshot replay workflow for turning a stabilized browser flow into repeatable reviewer evidence. Versioned replay cases are validated before browser startup, use exact session routing, reject ephemeral @eN references, require an explicit behavioral assertion and screenshot, and succeed only when canonical evidence reports PASS.

This also hardens recording finalization, recovery ownership, evidence verdicts, public redaction, and PR artifact formatting so interrupted or incomplete sessions fail closed without weakening unrelated session isolation.

What Changed

  • Added versioned replay cases, controlled agent-browser command execution, sanitized human-testing instructions, and fresh-session replay orchestration.
  • Preserved the approved verdict contract: assertion or fatal failures are FAIL; nonfatal console/network or evidence-trust problems are INCOMPLETE; clean asserted evidence is PASS.
  • Made recording finalization wait for five seconds of stable positive size, retain recovery ownership for unverified media, and keep physical trimming separate from canonical timeline offsets.
  • Added replay video, screenshot, verdict, and human-testing output to curated PR evidence.
  • Removed unsupported token and cost estimates from reviewer output.

Risk Assessment

Moderate internal-tool risk. The change affects replay, session recovery, verdict generation, and evidence publication, but does not alter a target application's behavior. Lifecycle integration coverage, repeated environment-runtime executions, FFmpeg integration, and a fresh end-to-end replay exercise the changed contracts.

Testing

Static Testing

  • npm run build — passed.
  • npm test — 36 files and 599 tests passed in 165.23 seconds.
  • npm run test:ffmpeg — passed; finalized video was trimmed and converted to MP4.
  • npm test -- src/environment/runtime.test.ts — 20/20 independent retry-disabled processes passed in 123 seconds.
  • GitHub Actions Build and Test — passed at the final PR head.

Reviewer Testing

  1. Create a version 1 replay case with stable CSS selectors, one assertion, one screenshot, and high-level human instructions.
  2. Run proofshot replay <case-file> against a small local page.
  3. Confirm it starts a fresh isolated session, routes every action to that exact session, emits USER_TESTING.md, and finishes with PASS.
  4. Replace a selector with @e1 and confirm validation rejects the case before creating a session.

Evidence

  • Fresh replay verdict: PASS.
  • Recording: 3-second finalized MP4.
  • Screenshots: 1 curated PNG.
  • Errors: 0 console errors and 0 server errors.
  • Isolation: rejected replay input did not disturb concurrent sessions.

Related Work

alvarohulse and others added 30 commits August 19, 2026 09:49
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
…play cleanup

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-luna-low
…propagation

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-luna-low
…recording

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-terra-medium
Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-luna-low
…lures

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-terra-medium
Co-authored-by: Codex <noreply@openai.com>
…replay validation, and publication safety

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-luna-low
…verdicts

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-luna-low
Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-terra-medium
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
…zation, and recorder recovery

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-luna-low
…ing, and capture test mocking

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-luna-low
…mantics

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-terra-medium
Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-terra-medium
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
…t handling

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-luna-low
Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-terra-medium
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>

# Conflicts:
#	src/session/selection.ts
…covery, redaction, and replay

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-luna-low
Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-terra-medium
Track recording attempts before invoking the recorder and require verified finalization before failed-start cleanup can close the owned browser.

Co-authored-by: Codex <noreply@openai.com>
Lock recovery ownership when finalization fails and require finalization to precede browser cleanup.

Co-authored-by: Codex <noreply@openai.com>
alvarohulse and others added 10 commits August 19, 2026 13:49
Allow external launcher setup to retain immutable identity after a fast Linux child has exited without counting zombie processes as live.

Co-authored-by: Codex <noreply@openai.com>
Prove zombie process records remain available for ownership capture while ordinary liveness parsing excludes them.

Co-authored-by: Codex <noreply@openai.com>
Keep the action timeline aligned when physical trimming is clamped for compressed or dropped idle frames.

Co-authored-by: Codex <noreply@openai.com>
A browser-open failure occurs before recording is attempted, so failed-start cleanup should close the browser without issuing recorder commands.

Co-authored-by: Codex <noreply@openai.com>
…ecording cleanup, and redaction

Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-luna-low
Co-authored-by: cursoragent <cursoragent@cursor.com>
No-Mistakes-Model: gpt-5.6-terra-medium
Remove the final gate changes that broadened selector policy, weakened recording recovery, and changed evidence/timeline behavior beyond the approved issues.

Co-authored-by: Codex <noreply@openai.com>
Keep screenshot identities stable, require real assertion outcomes, isolate recovery sessions, preserve non-dispositive media, and sanitize public reviewer text.

Co-authored-by: Codex <noreply@openai.com>
Exercise screenshot flags, assertion truth, recovery isolation, missing duration, failed captures, and public redaction.

Co-authored-by: Codex <noreply@openai.com>
Keep terminal punctuation while removing contextual credential values from generated human-testing instructions.

Co-authored-by: Codex <noreply@openai.com>
@alvarohulse
alvarohulse merged commit 44035a8 into main Aug 19, 2026
1 check passed
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