Skip to content

feat(claims): browser test reports as claim evidence - #449

Merged
jddunn merged 2 commits into
masterfrom
feat/claim-browser-reports
Oct 14, 2026
Merged

jddunn merged 2 commits into
masterfrom
feat/claim-browser-reports

Conversation

@jddunn

@jddunn jddunn commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds src/safety/claims/tooling/BrowserEvidenceReport.ts, which turns Playwright JSON reports into claim evidence. A CI run declares the invocations it expects in an InvocationManifest: each ExpectedInvocation names its commit, its application, harness and configuration digests, whether it is eligible as evidence, and the tests it must pass in each project. Each invocation leaves its exit code, its JSON report and an identity file.

normalizePlaywrightReport reads one report into a flat list of tests: the describe titles and the test's joined by >, the project, the expected and final status, every attempt with its retry, status, start time and duration, and the annotations. A report whose suites, stats, specs, tests or results lack the fields the reporter writes is refused as malformed.

reconcileInvocations matches what each invocation left against the manifest and reports every shortfall under its own code: a missing or malformed report, an invocation the manifest does not name or one reported twice, an identity that is not the expected one, a test seen twice in one project or two tests under one spec id, stats that do not match the tests the report holds, report-level errors, a non-zero exit while every test passed, and a required test that is missing, skipped, failed, flaky or marked as an expected failure. An invocation that was cancelled or crashed before writing its report is a failure, never an empty success. A baseline invocation (not eligible) keeps its tests in the result, cannot carry a required test, and never satisfies one: requiredPassed is true only for a test that passed on every attempt, in every project it names, in an eligible invocation that exited 0.

The module reads only what it is given; it touches no file and no network. This pull request adds no exports entry; #413 tracks the ./safety/claims/tooling entry and its documentation page.

Linked issues

Part of #413

Type of change

  • Bug fix
  • Feature
  • Performance
  • Documentation
  • Refactor
  • Tests
  • Build or CI

How this was verified

Unit tests in CI, in the Test & Lint job (run 38509387110, green on fc4fca4): src/safety/claims/tooling/__tests__/BrowserEvidenceReport.test.ts, 6 tests (normalization of the title path, every attempt and the final status; a required test that passed; a skipped, failed, flaky and expected-failure required test, each refused by its code; a missing report, a missing test, a duplicate test, a conflicting spec id and an unexpected invocation; a wrong identity, a non-zero exit with every test passed, report errors, a stats mismatch and malformed JSON; a baseline invocation kept but never satisfying a requirement). The tests were pushed ahead of the module they cover: run 38509082057 on 8c86f4f failed at the type check, only on the missing ../BrowserEvidenceReport.js and the untyped values that import left, until the module existed. In the green run, Batch-1 gated tests, Browser tests, Release dry run (release type: patch), gate and links pass as well. No local validation commands were run.

Migration notes

None. The change adds files; existing behaviour, dependencies and the package version are unchanged.

Checklist

  • Tests cover the changed behavior.
  • Docs are updated.
  • The title follows Conventional Commits, with ! before the colon for a change that breaks users (feat!: or feat(api)!:).
  • No secrets or private data are included.
  • Every automated review thread is settled (how).
  • I have read this change and can explain every line.

Summary by Sourcery

Add tooling to convert Playwright browser test reports into validated claim evidence across declared CI invocations.

New Features:

  • Add Playwright report normalization and invocation reconciliation for browser test results used as claim evidence.
  • Track cleanly passed tests while distinguishing eligible evidence invocations from baseline invocations.

Enhancements:

  • Validate report structure, identities, test uniqueness, statistics, exit codes, report errors, and required-test outcomes with explicit problem codes.

Tests:

  • Add unit coverage for report normalization, required-test outcomes, invocation reconciliation failures, malformed reports, and baseline behavior.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: framerslab/agentos/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: dd3e2d5b-105c-4762-a8ad-718fee62f615
📥 Commits

Reviewing files that changed from the base of the PR and between 3fbc713 and fc4fca4.

📒 Files selected for processing: 2
  • src/safety/claims/tooling/BrowserEvidenceReport.ts
  • src/safety/claims/tooling/__tests__/BrowserEvidenceReport.test.ts
 ___________________________
< Goodbye, overlooked bugs. >
 ---------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces a pure claims-tooling module that converts Playwright JSON reports into validated test evidence, reconciles invocation artifacts against declared manifests with explicit failure codes, and determines whether required tests passed only under eligible, successful invocations; comprehensive unit tests cover the supported and failure paths.

File-Level Changes

Change Details Files
Add Playwright report normalization into a validated, flat evidence-test representation.
  • Build title paths from nested suites and specs.
  • Capture project identity, expected/final statuses, all retry attempts, timing, and annotations.
  • Reject reports missing reporter-produced structural fields.
src/safety/claims/tooling/BrowserEvidenceReport.ts
src/safety/claims/tooling/__tests__/BrowserEvidenceReport.test.ts
Reconcile observed invocation artifacts against an invocation manifest and classify evidence failures precisely.
  • Match invocation IDs, identities, reports, exit codes, report errors, statistics, test uniqueness, and required tests.
  • Emit distinct problem codes for missing, malformed, duplicate, conflicting, unexpected, incomplete, or invalid evidence.
  • Treat cancellation/crash and non-zero exits as failures, including when tests appear passed.
src/safety/claims/tooling/BrowserEvidenceReport.ts
src/safety/claims/tooling/__tests__/BrowserEvidenceReport.test.ts
Define eligibility-aware required-test evaluation while retaining baseline invocation results.
  • Require every named project to pass all attempts in an eligible zero-exit invocation.
  • Reject skipped, failed, flaky, expected-failure, missing, or ineligible required tests.
  • Keep baseline tests in the reconciled result without allowing them to satisfy requirements.
src/safety/claims/tooling/BrowserEvidenceReport.ts
src/safety/claims/tooling/__tests__/BrowserEvidenceReport.test.ts
Add focused unit coverage for report normalization and invocation reconciliation edge cases.
  • Cover successful evidence, malformed input, identity and statistics mismatches, report errors, duplicate/conflicting tests, missing and unexpected invocations, and baseline behavior.
  • Verify stable problem codes for each required-test and invocation failure mode.
src/safety/claims/tooling/__tests__/BrowserEvidenceReport.test.ts

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

…xpected invocations reconciled, skips and flakes refused
@jddunn
jddunn marked this pull request as ready for review October 14, 2026 11:48
@jddunn
jddunn requested a review from Victor-Evogor as a code owner October 14, 2026 11:48
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sourcery-ai

sourcery-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Sorry @jddunn, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 5 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@jddunn
jddunn merged commit ed46090 into master Oct 14, 2026
10 of 11 checks passed
@jddunn
jddunn deleted the feat/claim-browser-reports branch October 14, 2026 11:49
github-actions Bot pushed a commit that referenced this pull request Oct 14, 2026
## [0.13.118](v0.13.117...v0.13.118) (2026-10-14)

### feat

* **claims:** browser test reports as claim evidence (#449) ([ed46090](ed46090))

### docs

* correct the GMI paper's lines on persona traits and T4 contexts (#448) ([3fbc713](3fbc713))
* fix the claims the cold read of #377 found in its files (#447) ([798ffa2](798ffa2))
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