Repository navigation
refactor(verify): exclude negated .ok failure branches from completed-abort guard - #11922
Closed
Plastic-time wants to merge 2 commits into
Closed
Plastic-time wants to merge 2 commits into
Plastic-time wants to merge 2 commits into
Conversation
Contributor
[Low impact] The PR appears safe to merge; no blocking issues remain. SummaryReplaces the regex in
Reviews (3) · Last reviewed commit: "refactor(verify): tokenize receiver chai..." · Reviewed by Greptile |
Plastic-time
marked this pull request as ready for review
November 18, 2026 01:17
Codex Review Summary: ✅ CompletedThis 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. |
8 of 11 tasks
Collaborator
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
Tighten the
completed-abort-reclassificationarchitecture guard so negated.okchecks on failed primaries (!outcome.ok && signal?.aborted) are no longer misclassified as completed-result abort reclassifications, shrinkingscripts/verify/baselines/completed-abort-reclassification.jsonfrom17files /18sites to15files /16sites.Fixes #11920.
Problem and expected behavior
scripts/verify/architecture-guards.mjsmatchedcompleted-abort-reclassificationwith:/\.ok\s*&&\s*(?:isAborted\(|[\w.?]*signal\??\.aborted)/guBecause it inspected only
.okwithout checking for a leading!on the receiver expression, it false-matched two failure-branch cancellation attachments:src/application/desktop/DesktopApplicationState.ts:175:if (!outcome.ok && signal?.aborted)attaches the caller cancellation as a secondary failure (analysisErrorWithCancellation(primary, cancelledBy(OPERATION, signal))) whenoutcomealready failed (!outcome.ok); the completed-outcome branch is handled separately above at lines 161–168.src/application/frida/FridaInstrumentationService.ts:164:if (!started.ok && signal?.aborted)attaches the caller cancellation ontostarted.error(analysisErrorWithCancellation(started.error, cancelledBy(operation, signal))) when#provider.startSessionfailed (!started.ok); the completed-session cancellation path follows at lines 171–172.Expected: only positive completed-result checks (
result.ok && ...) are counted, while negated!result.ok && ...failure branches are excluded.Change and scope
scripts/verify/completed-abort-guard.mjsandscripts/verify/completed-abort-guard.d.mts: addedcompletedAbortReclassificationCountusingtokenizefromscripts/verify/source-tokens.mjsto locate.ok && (isAborted( | ...signal?.aborted), walk backward across the full receiver expression (member accesses,#privatenames, calls, indexed reads, and parenthesized groups), and exclude unary!negations (with zero external dependencies).scripts/verify/architecture-guards.mjs: switchedcompleted-abort-reclassificationtocompletedAbortReclassificationCount.tests/evaluation/completedAbortGuard.test.ts: added unit tests covering both true completed-result hits (includingresults[0].ok && signal?.abortedand!ready && outcome.ok && signal?.aborted) and negated failure-branch expressions (!outcome.ok,!started.ok,!results[0].ok,!this.readResult().outcome.ok,! result.ok,!this.#state.outcome.ok,!readResult().ok,!(await readResult()).ok).scripts/verify/baselines/completed-abort-reclassification.json: updated vianode scripts/verify/architecture-guards.mjs --shrink-baselines(17->15files,18->16sites), removing only:src/application/desktop/DesktopApplicationState.ts(1 -> 0)src/application/frida/FridaInstrumentationService.ts(1 -> 0)ac10b2077): replaced the regex lookbehind withsource-tokens.mjstokenizereceiver-chain traversal so indexed and post-call member receivers (!results[0].ok,!this.readResult().outcome.ok) are also excluded, and added those positive/negative cases totests/evaluation/completedAbortGuard.test.ts.Not included: migrating the remaining 15 files / 16 completed-result sites onto
runOwned(each has distinct provider session/retry/cleanup lifecycles and stays tracked by the tightened baseline).Contribution scope: not applicable (internal architecture-guard matcher fix under #11920).
Contract and boundary impact
scripts/verify/completed-abort-guard.mjsowns the pattern matcher consumed byscripts/verify/architecture-guards.mjsandtests/evaluation/completedAbortGuard.test.ts.docs/public/product-catalog.json), package, or installation impact: updatedscripts/verify/baselines/completed-abort-reclassification.jsononly.Expected effects:
Evidence and regression coverage
tests/evaluation/completedAbortGuard.test.ts(2 tests: positive completed-result cases and negated.okfailure-branch cases). Under the previous regex onorigin/main(5cdd7d54b), the negated cases (!outcome.ok && signal?.abortedand!started.ok && signal?.aborted) matched (1each instead of0).completedAbortReclassificationCountacross all2871non-test source files insrc/onorigin/main(5cdd7d54b) changes total hits from18to16, with diffs exclusively insrc/application/desktop/DesktopApplicationState.ts(1 -> 0) andsrc/application/frida/FridaInstrumentationService.ts(1 -> 0), and preserves every remaining completed-result site unchanged.tests/boundary/filesystem/ciChangeScope.test.tson Windows; full Linux CI runs on this draft PR.For evidence-bearing changes:
Validation performed
Ran on Windows 11 (
nodev24.22.1) in the PR worktree after the final edit:.\node_modules\.bin\oxfmt.cmd --check .— passed (8693files).npm run check:fast— passed (typecheck,lint, andArchitecture guards passed across 2871 source files).2871non-testsrc/files (blankComments+ old regex vscompletedAbortReclassificationCount):oldHits: 18,newHits: 16,diffs: [ { rel: 'src/application/desktop/DesktopApplicationState.ts', o: 1, n: 0 }, { rel: 'src/application/frida/FridaInstrumentationService.ts', o: 1, n: 0 } ].npm run test:focused -- tests/evaluation/completedAbortGuard.test.ts tests/evaluation/sourceTokens.test.ts tests/evaluation/ciTestSelection.test.ts tests/boundary/filesystem/ciChangeScope.test.ts tests/boundary/filesystem/typedScriptDeclarationsGuard.test.ts tests/boundary/filesystem/countedBaseline.test.ts:tests/evaluation/completedAbortGuard.test.ts— 2 passed.tests/evaluation/sourceTokens.test.ts— 4 passed.tests/evaluation/ciTestSelection.test.ts— 9 passed.tests/boundary/filesystem/typedScriptDeclarationsGuard.test.ts— 4 passed.tests/boundary/filesystem/countedBaseline.test.ts— 9 passed.tests/boundary/filesystem/ciChangeScope.test.ts— 416 passed, 2 skipped.Compatibility, safety, and release
ciChangeScope.test.tscases.Author readiness
Human owner: @Plastic-time
Before merge
type(scope): outcome.