Repository navigation
Conversation
…io comparison Record the sorted, de-duplicated capture.events selection as scenario.event_families in normalized scenario captures. Scenario comparison now reports event evidence as unknown when the selections differ, or when a legacy capture omits the field, instead of comparing two quiet captures as unchanged. Fixes morluto#2169
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This was referenced Oct 12, 2026
Merged
Owner
|
Thanks @itsF4LCON. Your selected-family representation, normalization and regression coverage are folded into the earlier active PR #2239 with coauthor credit (head c0de4cc). The original contributor commit remains in history; missing historical selections stay unknown. Standards/spec review is complete, and 29 focused tests plus full source/docs checks pass. Closing this duplicate so #2169 review continues on the original contribution. |
morluto
added a commit
that referenced
this pull request
Oct 12, 2026
…capture comparison (#2239) * fix(browser): report mismatched event family selection as unknown in capture comparison * fix(browser): retain selected event families and unknown coverage Fold the complementary implementation from #2253 into the earlier #2239 proposal, retaining the original contribution history. Co-authored-by: itsF4LCON <[email protected]> --------- Co-authored-by: LouisChen <[email protected]> Co-authored-by: morluto <[email protected]> Co-authored-by: itsF4LCON <[email protected]>
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2169.
compare-web-captures/compare_web_capturesreturnedoverall_status: "unchanged"for two complete launch-mode scenario captures that selected differentcapture.eventsfamilies, when none of the selected families emitted an event (for example[]vs["console"], or["console"]vs["page-errors"]). The normalized capture did not record the selection, so the comparator could not tell "no console messages" apart from "console was not observed".Normalized scenario captures now record the selection as
scenario.event_families. Scenario comparison reports the event artifact asunknown, with a recovery instruction, when the selections differ.#2239 also targets this issue. The main difference: #2239 defaults a missing selection to
[], so a capture saved before the fix that recorded console messages but logged none still comparesunchangedagainst a new capture with nothing selected. Here, a missing selection keeps event evidenceunknown. This PR also accepts only the eight real event families, de-duplicates the selection, and documents the field in the scenario contract.Problem and expected behavior
capture.events: []and once with["console"], then compare the twonormalized_resultobjects.docs/browser-scenario-contract.mdsays mismatched capture coverage remains unknown instead of being treated as equality. A difference in observation coverage was reported as equality.unknownevent evidence and prevent anunchangedoverall result. Matching selections still compareunchangedwhen both sides are quiet, andchangedwhen the retained events differ.Change and scope
browserScenarioCaptureData(the single producer for complete and partial captures) recordsscenario.event_families: the sorted, de-duplicatedcapture.eventsselection.eventFamilyCoverageReasoninbrowserScenarioDiffEvidence.tssits next to the existingnetworkContentCoverageReasonand feeds the sameincomparableReasonpath. Selections are compared as sets. When both the event-family and network-content selections differ, both reasons are returned.browserScenarioCaptureValues.tsasbrowserScenarioEventFamilySchema, so the request schema and the capture schema share one list.event_familiesis optional inbrowserScenarioCaptureSchema, so captures saved by earlier versions still parse as comparison input. If either side omits it, event evidence isunknown("Event family selection is unknown in a legacy capture"), because the selection cannot be established. This follows the precedent feat(browser): capture correlated network content and lifecycle evidence #797 set when it addedscenario.network_content.changed.Follow the contribution scope. Not applicable: ordinary fix within existing boundaries.
Contract and boundary impact
browserScenarioCaptureData), consumed by scenario comparison (browserScenarioDiff).capture_browser_scenarionormalized results gainscenario.event_families.compare_web_capturesaccepts captures with or without it. Thecompare_web_capturesexample capture includes it.unknowninstead ofunchanged. Documented indocs/browser-scenario-contract.md(Scenario comparison).docs/public/product-catalog.json), package, or installation impact: none committed.npm run docs:checkpasses.Expected effects:
Evidence and regression coverage
Tests added or updated:
src/browser/PlaywrightBrowserScenarioProvider.test.ts: captures through the production provider with a fake session, then compares.[]vs["console"]and["console"]vs["page-errors"]giveunknownwith the event-family reason. A duplicated, unordered selection["page-errors", "console", "console"]is recorded as["console", "page-errors"], and reordered selections compareunchanged.src/domain/browserScenarioDiff.test.ts: the mismatch reason names both selections. A reordered selection comparesunchanged. A legacy capture (field omitted) on one or both sides givesunknown. An unknown family name is rejected. Differing events under mismatched selections areunknown, notchanged. Event-family and network-content mismatches report both reasons.event_families.Base reproduction or other evidence: on the base revision, the new provider test fails with
expected 'unchanged' to be 'unknown'. Real Chrome through the public CLI (below) also returnsunchangedfor all three cases on base.User-visible CLI/MCP output: real
google-chrome-stable, launch mode, a quiet local page,capture-browser-scenariothencompare-web-captures:Base (
upstream/main):This branch:
All captures were complete and
equality_eligible: true.Remaining proof gaps: MCP stdio was exercised only by the existing boundary tests (
tests/boundary/mcp/browserScenarioMcp.test.ts), not with a real browser. Connect mode was not run against a real browser; its captures are already event-incomplete.For evidence-bearing changes:
Validation performed
Linux x86_64, Node 24.21.0 (the repo pins 24.18.0), npm 11.19.0.
npm run test:focused --on the 82 test files that touch scenario capture, comparison, or tool contracts: 82 files passed (579 tests, 5 skipped).npm run check:fast: passed.npm run check: passed.npm run docs:check: passed.npm run verify:test-discovery: passed.Compatibility, safety, and release
unknown. Re-capture both sides to get a definite event comparison.Before merge
type(scope): outcome.