Skip to content

test: make eight omowright assertions able to fail - #30

Merged
code-yeongyu merged 1 commit into
mainfrom
test-audit/w1-assertion-repairs
Sep 30, 2026
Merged

code-yeongyu merged 1 commit into
mainfrom
test-audit/w1-assertion-repairs

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

This PR changes eight omowright tests (lane omowright) so their assertions can fail, and removes the probes that already had stronger owners. Each repair has a mutation proof below.

Candidates (lane omowright)

Title Mark Keeper
Source grep of the MV3 background.js (bridge-transport.test.mjs, "extension protocol errors use a dedicated response name and reconnect indefinitely") F The repaired test runs the real background.js in node:vm against a fake chrome. It checks that an unknown command is answered as protocolError, that the capped backoff keeps reconnecting past six attempts, and that the hello lists equal COMMAND_NAMES/EVENT_NAMES.
protocolError collision check compares two literals F COMMAND_NAMES.includes("protocolError") === false
Un-awaited assert.rejects in agent-tabs F The disposed-create rejection is now awaited.
Test names promise order and timeout behavior that is never asserted F The fake attachPage records itself, so activate-before-attach is asserted. The close test is renamed to what it checks, and its duplicated capability assertion goes; close failure leaves target owned... keeps timeout retention.
normalizeDialogPolicy identity-copier test C A function-policy row in object dialogPolicy can dismiss and supply promptText, next to PipeCdpClient default dialogPolicy auto-accepts
Machine-local install check in skill-docs D skill-docs.test.mjs: the in-repo frontmatter-name and referenced-doc-path tests
typeof probes inside real tests (integration + cloak-profile) D (lines only) frames-snapshot and interaction tests click ref locators for real; cloak-profile calls the function on the next line
Vacuous toast assertion in layers F Only blocking === null remains, with the message of the contract it enforces.

Deferred: none.

Baseline gate (unedited base 13567bbc)

The seven touched files, in both runners: bun 63 pass, 0 fail; node --test 63 tests, 63 pass. After this change: bun 61 pass, 0 fail; node 61 tests, 61 pass.

Mutation proofs

In each case the production owner was mutated, the repaired test was run, and then the owner was restored. git diff --quiet -- src bridge exits 0 afterwards.

  • MUT-R176a responseName falls back to a real command. New test: 0 pass 1 fail. Old test: 1 pass 0 fail
  • MUT-R176b reconnect stops after six attempts. New test: 0 pass 1 fail. Old test: 1 pass 0 fail
  • MUT-R92 protocolError added to COMMAND_NAMES. New test: 0 pass 1 fail
  • MUT-R93 disposed guard removed. New test: 0 pass 1 fail
  • MUT-R94 activation moved after attach. New test: 0 pass 1 fail. Old test: 1 pass 0 fail
  • MUT-R140 function policies not passed through. New test: 0 pass 1 fail. Old test: 1 pass 0 fail

Audit numstat (frozen measurement tool, merge-base..head)

Removed: test 37, support 0, prod 0. Added: test 40, support 0, prod 0. Test files delta: 0.

Validation

Full suites on a clean checkout of this commit on a local macOS arm64 machine:

  • bun run test: 217 pass, 0 fail
  • bun run test:node: 217 tests, 217 pass
  • git diff --check: clean

Refs #28


Summary by cubic

Repairs eight omowright test assertions so they can actually fail, and removes redundant probes that weaker assertions masked.

  • bridge-transport.test.mjs now runs the real background.js in node:vm against a fake chrome, asserting the protocolError response name, reconnects past six attempts, and hello lists matching COMMAND_NAMES/EVENT_NAMES; the collision check now asserts COMMAND_NAMES excludes protocolError instead of comparing two literals.
  • agent-tabs.test.mjs awaits the disposed-create rejection, records the fake attachPage so activation-before-attach is asserted, and narrows the close test to what it checks.
  • dialogs.test.mjs folds the normalizeDialogPolicy identity cases into the object-policy test as a function-policy row.
  • Removes the machine-local install check in skill-docs.test.mjs, two typeof probes (integration, cloak-profile), and a vacuous toast assertion in layers.test.mjs.

Written for commit 03d786f. Summary will update on new commits.

Review in cubic

- bridge-transport: the background.js source grep becomes a node:vm run of the real extension script against a fake chrome (unknown command answered as protocolError, reconnects past six attempts at a capped backoff, hello lists equal COMMAND_NAMES/EVENT_NAMES); the collision check asserts COMMAND_NAMES excludes protocolError instead of comparing two literals.
- agent-tabs: await the disposed-create rejection; the fake attachPage records itself so the activate-before-attach order is asserted; the close test is renamed to what it tests and drops its duplicated capability check.
- dialogs: the normalizeDialogPolicy identity test folds into the object-policy boundary test as a function-policy row.
- skill-docs / integration / cloak-profile / layers: drop the machine-local install check, two typeof probes and a vacuous second toast assertion.
@code-yeongyu
code-yeongyu merged commit de08f48 into main Sep 30, 2026
3 checks passed
@code-yeongyu
code-yeongyu deleted the test-audit/w1-assertion-repairs branch September 30, 2026 22:08
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