Skip to content

test: assert absolute-path facts without frozen sentences - #9231

Merged
morluto merged 2 commits into
mainfrom
cursor/absolute-path-error-facts-45fd
Nov 7, 2026
Merged

morluto merged 2 commits into
mainfrom
cursor/absolute-path-error-facts-45fd

Conversation

@morluto

@morluto morluto commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Sibling tests for host-absolute paths were still green if the explanatory sentence changed, or if a negative loop stopped running. They now require the field path, invalid_format, and expected: "regex", and they record that each negative case ran. NUL rejection follows the argument that contains the byte and still names the NUL-specific reason.

This stays off #9178, #9179, and #9181 so those admission fixes remain focused.

Problem and expected behavior

Smallest trigger: tests/boundary/mcp/wasmArtifactMcp.test.ts required the sentence must be an absolute local filesystem path even though the issue already carried path, reason, and expected. tests/boundary/mcp/absoluteLocalPathSchema.test.ts searched the whole JSON for absolute, and its handler loop skipped the structured path check whenever issuePath was unset. tests/acceptance/tools/localToolContracts.test.ts searched responses for the word NUL.

Expected: a wording change in the absolute-path message still passes, while NUL rejection still explains the invalid byte. Dropping the absolute constraint, reporting the wrong field, or emptying the case list fails. Providers are still not called for the rejected inputs.

Change and scope

The assertions cover the WASM artifact tool, the shared absolute-path MCP catalog, session export and snapshot paths, firmware output directories, Electron file URLs, CLI JSON path normalization, and the local-path unit matrix. Each relative-path case names its field. The NUL catalog derives the issue path from the value that contains \0 and requires invalid_format / regex and a NUL-specific reason. Catalog loops assert a known set of cases, so an empty list cannot pass.

Contribution scope: ordinary test fix. Maintainer scope decision for new providers or target execution: not applicable.

Not included: packet-capture, Hermes, EVM, and cache-directory tests that use the word absolute for a different constraint. No production schema or handler change. No desktop, debugger, host-effect, or god-file work.

Contract and boundary impact

  • Semantic owner and earliest changed stage: absoluteLocalPathStringSchema remains the owner. These tests now read its structured issue instead of a copied sentence.
  • Contribution scope fit and linked maintainer decision: ordinary fix; not applicable.
  • CLI and MCP/tool-catalog contract: none. Advertised schemas are unchanged.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

No new target interaction. The tests keep their existing in-memory MCP and fixture calls.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/mcp/wasmArtifactMcp.test.ts, tests/boundary/mcp/absoluteLocalPathSchema.test.ts, tests/boundary/mcp/sessionMcp.test.ts, tests/acceptance/tools/localToolContracts.test.ts, tests/acceptance/applications/electronInvalidPaths.test.ts, src/cliJsonPaths.test.ts, src/domain/localPath.test.ts.
  • Base reproduction or other evidence: the previous assertions matched explanatory text or JSON.stringify(result).includes("absolute"). The handler loop's structured check was behind if (issuePath !== undefined), and pathCase never set issuePath.
  • User-visible CLI/MCP output (if applicable): unchanged. A relative path is still invalid_request with invalid_format and expected: "regex" on the named field.
  • Remaining proof gaps: Windows host execution was not run. The absolute pattern still follows process.platform inside the existing schema. Packet-capture, Hermes, EVM executable, and cache-path prose checks were left in place because they are different constraints.

Boundary regression: malformed path admission before provider work. Lifecycle regressions are not applicable.

Validation performed

  • Follow-up on Node 24: focused local-path and MCP suites passed 23 tests; check:fast, targeted formatting and git diff --check passed. Tautological loop self-comparisons were removed while the fixed-case controls remain.

  • npm run test:focused -- src/domain/localPath.test.ts src/cliJsonPaths.test.ts tests/boundary/mcp/wasmArtifactMcp.test.ts tests/boundary/mcp/absoluteLocalPathSchema.test.ts tests/boundary/mcp/sessionMcp.test.ts — 43 passed.

  • npm run test:focused -- tests/acceptance/tools/localToolContracts.test.ts tests/acceptance/applications/electronInvalidPaths.test.ts — 11 passed.

  • npm run check:fast — typecheck and lint passed. Pre-push check:fast passed.

  • npx oxfmt on the touched files — formatted.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Test assertions only.
  • Real Hopper/Ghidra, browser, or OS coverage: not required. Rejection happens before a provider opens the path. Windows was not executed.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none. No new target interaction.

Author readiness

Human owner: @morluto

  • 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.
Open in Web Open in Cursor 

Sibling path tests now require the field path, invalid_format, and regex
expectation, and they record that each negative case ran. NUL rejection
follows the argument that contains the byte instead of searching for the
word NUL.
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T14:21:33.429188Z beb9c66 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.

@greptile-apps

greptile-apps Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable defects were found in the reviewed changes.

Summary

This test-only PR replaces fixed absolute-path sentences with checks for the affected field, error reason, and expected format.

  • Path tests check the reported field instead of fixed error wording.
  • NUL-path tests point each rejection to the input field.

Reviews (2) · Last reviewed commit: "test: retain actionable NUL path diagnos..." · Reviewed by Greptile

@morluto
morluto merged commit 2e2f981 into main Nov 7, 2026
52 of 54 checks passed
@morluto
morluto deleted the cursor/absolute-path-error-facts-45fd branch November 7, 2026 14:46
@morluto morluto added the area: tests Test suite and verification label Nov 22, 2026
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.

2 participants