Repository navigation
Conversation
… as absent Comparing retained scenario captures flattened each side's unique step map, so a step_id duplicated on one side vanished from that side's map; the same id arriving uniquely on the other side then landed in before_only/after_only and produced a missing_before_step or missing_after_step failure for a step the duplicate side still retains. The comparison reported both the duplicate and a definite absence for the same id, a stronger claim than the ambiguity supports. Alignment now keeps a duplicated id out of the absence lists on both sides: the id stays unaligned with its duplicate failure, but no capture is described as missing a step it retains. Genuinely missing ids keep their missing_* classification and absence lists. Fixes morluto#7415
[Medium impact] The PR appears safe to merge. SummaryFixes false absence reports for duplicated scenario step IDs at their source,
No actionable correctness, security, or repository-rule issues were found. Tests were inspected, not executed. Supersession could not be checked because GitHub authentication was unavailable. Reviews (1) · Last reviewed commit: "fix(browser): keep duplicated scenario s..." · Reviewed by Greptile |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
TL;DR: I ran
In the Node 24.22.1 red log, the two failures are CI on f08494e:
The head is 830 commits behind main b81da90. GitHub says the PR is mergeable, and its merge state is blocked. Not run
Test setup
Commandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/domain/browserScenarioDiff.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
|
Thanks! This landed on main in #10490 as its own commit, cherry-picked with your authorship kept (rebase merge). Closing in favor of that merge. |
Summary
compare-web-capturesclassified a step_id duplicated in one capture as also missing from that capture: alignment keeps only unique step ids per side, so the same id arriving uniquely on the other side landed inbefore_only/after_onlyand produced amissing_before_step/missing_after_stepfailure beside the correct duplicate failure — a definite absence claim for a step the capture retains. Alignment now keeps a duplicated id out of the absence lists on both sides; the id stays unaligned with its duplicate failure, and genuinely missing ids keep theirmissing_*classification. Fixes #7415.Problem and expected behavior
Smallest trigger: compare a before capture retaining
savetwice against an after capture retaining it once (the reduced CLI fixtures from #7415). The alignment reportedduplicate_before_step_idandmissing_before_stepfor the same id, plusafter_only: ["save"]. Reversing the captures produced the symmetricmissing_after_step.Violated invariant:
docs/browser-scenario-contract.md— duplicate ids make alignment fail — andAGENTS.md: "Unresolved identity or applicability must remain unknown rather than be treated as absent". The duplicated identity is ambiguous, which must keep it unaligned, not turn its presence into an absence claim.Expected: the duplicate failure alone; no
missing_*and no absence-list entry for the duplicated id on either side; a genuinely absent id keeps itsmissing_*classification and absence entry.Change and scope
src/domain/browserScenarioDiff.ts(alignScenarioSteps):beforeOnly/afterOnlyadditionally exclude ids duplicate-classified on the other side. Duplicate failures, aligned-step ordering, and true-absence classification are unchanged.src/domain/browserScenarioDiff.test.ts: two regressions covering both duplicate directions, next to the existing missing-step coverage.overall_status.Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
alignScenarioSteps), the single producer ofbefore_only/after_onlyand alignment failures; no consumer reinterprets them. No superseded path.alignment.before_only/after_onlyno longer contain ids duplicated on the other side, andalignment.failuresno longer carries amissing_*entry for them.duplicate_*_step_idfailures,alignment.statusandoverall_statusare unchanged for these inputs (partial/unknown). No schema or tool-catalog change.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/domain/browserScenarioDiff.test.ts(duplicate in the before capture, duplicate in the after capture), each asserting empty absence lists and the duplicate failure alone.missing_before_stepwithafter_only: ["save"]. After the change, the same fixtures were run through the real CLI in five comparisons: duplicate-before, duplicate-after, unique self-comparison (unchanged), genuinely missing (bothmissing_*retained), and duplicate on both sides (duplicate failures only).before_only: [],after_only: [], failures[duplicate_before_step_id],overall_status: unknown.Boundary regressions covered: duplicate-identity and missing-identity alignment for the comparison projection. Lifecycle regressions: not applicable (no resources).
For evidence-bearing changes:
Validation performed
npm run test:local -- src/domain/browserScenarioDiff.test.ts— 34 passed, including the two new regressions.npm run test:focused -- tests/boundary/cli/browserCompareJsonFiles.test.ts tests/boundary/mcp/browserComparisonInput.test.ts— 5 passed.npm run check:fast— passed.Compatibility, safety, and release
Author readiness
Human owner: @kittimzhe
Before merge
type(scope): outcome.