Skip to content

test: strengthen and prune audited test coverage - #8573

Merged
morluto merged 16 commits into
mainfrom
codex/test-audit-cleanup
Nov 1, 2026
Merged

morluto merged 16 commits into
mainfrom
codex/test-audit-cleanup

Conversation

@morluto

@morluto morluto commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Several tests and verifier checks could pass while dropping cancellation reasons, partial Evidence, cleanup ownership, or expected results. This change strengthens those checks, removes redundant cases with retained boundary coverage, and repairs the concrete verifier and lifecycle defects found during the audit.

The PR contains the independently attributable subset transplanted onto current main; the broader suite and support-fixture audit is still in progress. The original checkout and its pre-existing changes were left intact.

Problem and expected behavior

A test should fail when the behavior it names is absent, and cleanup must retain ownership until the resources it depends on are released. For example, FIT enumeration could complete after its reader closed, and the ADB verifier could install a caller-selected APK while acting on a different hardcoded package.

Change and scope

  • Replace self-confirming expectations with authored format values, exact Evidence/identity checks, and controlled cancellation and cleanup assertions. Remove redundant tests only where the retained public or production-boundary case preserves their behavior.
  • Recheck FIT reader state after the final yield and preserve the caller's cancellation reason in Kuna cache and command paths.
  • Repair false-positive or cleanup checks in the Flutter, Frida, JEB, Cutter, Bun, DeepSeek, Gemini, Qwen, Command Code, Ghidra, HTTP/3 and JavaScript verifiers, and narrow the NativeAOT success message and Ghidra concurrency receipt to the checks actually performed. Bound JavaScript runtime Evidence reads and retain cleanup failures.
  • Refuse the ADB verifier's optional --install-apk lifecycle until exact APK identity and device cleanup ownership can be established. Follow-up: [Bug] ADB verifier cannot prove ownership of the APK lifecycle target #8552.

Contract and boundary impact

  • Semantic owner and earliest changed stage: artifact iteration and Kuna cancellation admission; test fixture producers and verifier result/cleanup boundaries.
  • Contribution scope: ordinary corrections within existing capabilities; no new provider or target execution authority. The unsafe ADB lifecycle is disabled pending [Bug] ADB verifier cannot prove ownership of the APK lifecycle target #8552.
  • CLI/MCP and Evidence: no tool-catalog change. Cancellation errors retain caller reasons; tests assert returned Evidence can be retrieved from the public bundle.
  • Compatibility: the standalone runtime Evidence verifier now requires stable regular files and reads inputs in order. verify:adb --install-apk now refuses before lifecycle work.
  • Generated metadata, package and installation: no authored package metadata change; generated artifacts are not included.

Evidence and regression coverage

Targeted mutations showed previously green tests accepting missing Evidence, wrong reason or format bytes, and omitted verifier actions; the strengthened cases failed those controls. Lifecycle controls exercise late FIT closure, cancellation identity, failed descriptor cleanup and retry, mixed verifier outcomes, and fail-closed ADB admission. Fixtures and injected providers are synthetic unless stated otherwise.

Remaining gaps: the full current suite has not passed locally; Linux-only and Windows-only cases and real Hopper, Ghidra, Cutter, JEB, Frida, Flutter, ADB, and browser providers were not verified by these runs. Issues #8555, #8559, #8561, #8562 and #8564 track separately reproduced verifier ownership concerns. This PR does not contain every reviewed change from the ongoing audit.

Validation performed

On the extracted branch based on 44b638400, Node 24.22.1, macOS arm64:

  • npm run check:fast — passed typecheck and lint.
  • npm run verify:test-discovery — passed; all discovered files assigned exactly once.
  • npm run docs:check — passed.
  • npm run test:focused -- tests/boundary/process/ghidraVerifierAssertions.test.ts — 2 passed, including simulated access failures and a POSIX dangling symlink; no real Ghidra run.
  • npm run test:focused -- tests/boundary/process/commandcodeVerifierSkillBody.test.ts — 6 passed with a simulated client; native Command Code and SDK wire conversion were not verified.
  • npm run test:focused for regex matching, process exit ownership, and JEB failure envelopes — 71 passed, one skipped. JEB responses were simulated.
  • npm run test:focused -- tests/boundary/process/clientVerifierSetupTargets.test.ts — 17 passed on macOS; Copilot verifier cases are excluded on Windows, which was not run.
  • npm run test:focused for Claude/OpenCode setup targets and Gemini, DeepSeek, and Command Code skill-body controls — 32 passed across the two runs; simulated clients on macOS. Windows was not run.
  • npm run test:focused -- src/server/BundleResourcesMcp.test.ts — 2 passed; the public MCP keeper preserves bundle root provenance and session closure. Windows junction behavior was not tested.
  • npm run test:focused for the Swift classification and universal-slice MCP tests — 13 passed with synthetic providers and fixtures.
  • node --check scripts/verify-http3-network-captures.mjs — passed; four report-mode/status combinations were simulated, with no network capture run.
  • npm run test:focused -- tests/boundary/mcp/pcapMcp.test.ts — 1 passed with a synthetic capture provider; the public bundle retained the returned Evidence.
  • npm run test:focused -- tests/process-global/shortFileReads.test.ts — 21 passed.
  • npm run test:focused -- tests/boundary/filesystem/releaseNotes.test.ts — 12 passed.
  • npm run test:focused for the two Android JNI fixture consumers — 49 passed using synthetic ELF data.
  • node --check scripts/verify-real-ghidra-function.mjs — passed; a simulated reverse-completion control showed that the former receipt overstated serialization.
  • node --check scripts/verify-real-ghidra-nativeaot.mjs — passed; output wording controls were simulated, and Ghidra was not run.
  • npm run test:focused -- tests/boundary/process/deepseekVerifierSkillBody.test.ts — 10 passed using a simulated client; native DeepSeek Harness was not run.
  • npm run test:focused -- tests/boundary/process/geminiVerifierSkillBody.test.ts — 8 passed using a simulated client; native Gemini CLI was not run.
  • npm run test:focused -- tests/boundary/process/qwenVerifierSkillBody.test.ts — 7 passed using a simulated client; native Qwen was not run.
  • npm run test:focused for 15 FIT, Kuna, verifier, cache and Cutter files — 154 passed.
  • npm run test:focused for 12 GPU, model, PyInstaller, Flutter, MCP and discovery files — 451 passed, one skipped.
  • npm run test:focused for the retained PE imports, Rust alignment and Go pointer-width keepers — 23 passed.
  • git diff --check — passed before commit.

A complete macOS Vitest run on the original pinned baseline was stopped under the repository's resource guidance; it is not reported as passing. No real-provider workflow was run for this PR.

Compatibility, safety, and release

--install-apk is intentionally unavailable in the ADB verifier pending #8552; this does not remove the ADB tool APIs. The runtime Evidence verifier rejects nonregular or changing files, and sequential input reads can alter elapsed time. The package verifier no longer emits an unsupported boundedRegexBridge success field; external consumers of that report are unknown. The Ghidra concurrency receipt now reports completion rather than unverified serialization; external consumers of that receipt are unknown. The HTTP/3 verifier receipt adds an input-mode field and a provenance limitation; external consumers are unknown. No performance measurement or real-device result is claimed.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@morluto
morluto marked this pull request as ready for review November 1, 2026 17:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T18:04:47.247099Z 31e3d65 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cdc7ff280f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] The reviewed changes appear safe to merge, with no new actionable issue found.

Summary

Strengthens test expectations, preserves cancellation reasons, and tightens verifier result and cleanup checks.

  • FIT enumeration checks the reader again after its last entry.
  • Kuna cancellation errors keep the caller’s reason.
  • Verifier reports now match the inputs and evidence they actually check.
  • Tests compare results with independent values and drop redundant cases.

Reviews (3) · Last reviewed commit: "test: keep verifier setup target relativ..." · Reviewed by Greptile

Comment thread scripts/verify-claude-client.mjs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 31e3d65c52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@morluto
morluto merged commit 7bcefea into main Nov 1, 2026
8 checks passed
@morluto
morluto deleted the codex/test-audit-cleanup branch November 1, 2026 18:13
XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Nov 1, 2026
7bcefea ("test: strengthen and prune audited test coverage", morluto#8573)
moved the Frida remote-address import in `scripts/verify-frida.mjs` from
`dist/contracts/fridaRemoteAddress.js` to `dist/domain/fridaRemoteAddress.js`,
which matches the real build output (`src/domain/fridaRemoteAddress.ts`
with `rootDir: src`). The fixture in
`tests/boundary/process/providerVerifierCleanup.test.ts` still wrote the
old `dist/contracts/` path, so the copied script tried to import a module
that did not exist and the four `frida verifier preserves ...` cases died
on ERR_MODULE_NOT_FOUND before reaching the assertions they exist to
prove.

The same commit also left 16 files unformatted, so `oxfmt --check` fails
on main itself and on every PR whose merge ref includes it.

This restores both gates:

- the fixture writes `dist/domain/fridaRemoteAddress.js`, so the script
  resolves and the four cleanup/ownership assertions run again;
- `oxfmt .` is applied to exactly the 16 files the check reports.

`git diff upstream/main` outside those 17 files is empty. Nothing under
`src/` outside the test file above is touched.

Verified on this branch:

- `node node_modules/vitest/vitest.mjs run tests/boundary/process/providerVerifierCleanup.test.ts` - 8 passed (4 failed before the fixture fix)
- `npx oxfmt --check .` - `All matched files use the correct format.`
- `node scripts/run-typescript.mjs --noEmit` - exit 0
- `node --check scripts/verify-adb.mjs`, `node --check scripts/verify-http3-network-captures.mjs` - exit 0
coyoteXujie pushed a commit to coyoteXujie/rea that referenced this pull request Nov 2, 2026
* test: strengthen and prune audited test coverage

* test: require delivered DeepSeek skill instructions

* test: keep schema fixture types private

* test: verify Gemini receives skill instructions

* test: bind Qwen skill evidence to its tool result

* test: report NativeAOT verifier checks precisely

* fix: verify Ghidra cleanup paths reliably

* fix: verify Command Code skill activation

* test: tighten cleanup and fixture checks

* test: verify packet capture evidence is recorded

* fix: report HTTP3 capture provenance accurately

* test: preserve resource coverage through MCP

* test: prune repeated assertions and retain cancellation identity

* fix: validate client verifier fixture paths

* test: skip Copilot verifier cases on Windows

* test: keep verifier setup target relative
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant