Skip to content

fix(javascript): preserve POSIX runtime path case on Windows - #2422

Merged
morluto merged 1 commit into
morluto:mainfrom
Aurantium-47:fix/javascript-posix-runtime-paths
Oct 13, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
Aurantium-47:fix/javascript-posix-runtime-paths

Conversation

@Aurantium-47

@Aurantium-47 Aurantium-47 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Keep recorded POSIX runtime roots case-sensitive when reconciliation runs on Windows. This fixes a source-discovered bug; no existing issue or PR covering this case was found.

Problem and expected behavior

Given a file mapping rooted at /runtime/App, a recorded script at /runtime/app/renderer.js must not acquire that mapping. On Windows, pathBelowRoot used the host-default path.relative even after identifying POSIX input, so those different roots produced a false location match. Automatic matching against the static application's POSIX input root had the same problem.

Change and scope

Use posix.relative for the POSIX branch of the shared root matcher. Its Windows branch still uses win32.relative. Add four service-level regressions using complete Evidence inputs: the two case mismatches, an exact POSIX match, and the existing case-insensitive Windows mapping behavior.

Contract and boundary impact

  • Semantic owner: pathBelowRoot in javascriptRuntimeStaticCandidates.ts, used by runtime path matching and active static-layer scope.
  • Contribution scope: routine correction to existing offline Evidence reconciliation; no separate maintainer scope decision is required.
  • CLI and MCP/tool-catalog contract: no schema change; corrected match facts.
  • Provider/platform impact: Windows-hosted reconciliation of recorded POSIX paths; no provider or bridge changes.
  • Evidence/provenance: unmatched root spellings remain unknown instead of producing an unsupported location match. Input Evidence remains unchanged.
  • Target selection, authority and cleanup: the operation consumes supplied Evidence without filesystem, browser, or target I/O; no new authority or cleanup behavior.
  • Generated metadata, package and installation impact: none.

Expected effects:

  • Read existing files or captured data (supplied Evidence).
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

On Windows x64, the final local-path tests against base c462a4ebd3a10e59253bcf38353a0914b176738b produced two failures: both POSIX case mismatches were reported matched. With this change all six local-path tests pass, including the existing relative-root and foreign-path controls.

Executed public CLI output, with no script source bytes supplied:

Runtime file, mapping rooted at /runtime/App Status Basis Reason
/runtime/app/renderer.js unknown none no-authorized-location-mapping
/runtime/App/renderer.js matched operator-file-mapping unique-location-match
  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity and source provenance remain preserved.
  • Unsupported and uncertain outcomes remain visible.

Validation performed

Pinned Node 24.18.0 / npm 11.16.0 on Windows x64:

  • node node_modules/vitest/vitest.mjs run tests/boundary/filesystem/javascriptApplicationWorkflows.test.ts -t "JavaScript runtime reconciliation local paths" — 6 passed; 9 unrelated cases filtered out.
  • node node_modules/vitest/vitest.mjs run tests/boundary/cli/electronCli.test.ts -t "Electron CLI runtime reconciliation" — 1 passed; 4 unrelated cases filtered out.
  • Public reconcile-javascript-runtime <input.json> --json calls for the two examples above — both exited 0.
  • npm run check — passed.
  • npm run verify:test-discovery — all 1002 test files discovered exactly once.
  • git diff --check — passed.

Compatibility, safety, and release

No migration, package, schema, or generated metadata change. Validation covers synthetic recorded Evidence through the production reconciliation service and compiled CLI. Live Electron/browser and native-provider verification were not run; those capture/provider paths are unchanged. The broader filesystem suite requires the Windows native artifact unavailable in this checkout. No containment or security-severity claim is made.

Before merge

  • This PR addresses a concrete problem.
  • Scope and authority questions are resolved for this existing offline operation.
  • The PR has one focused outcome and a Conventional Commit title.
  • The reason for not linking an existing issue is stated above.
  • Tests cover changed behavior and positive controls.
  • No owning docs, contracts, or generated metadata changes are needed.
  • Representative CLI output is included.
  • The diff was checked for secrets, unrelated cleanup, and unsupported claims.

AI-assisted implementation and review using OpenAI GPT-6; the validation above was executed locally.

Use POSIX path semantics for recorded POSIX roots when reconciling runtime Evidence on Windows. Preserve Windows mapping behavior and cover implicit and explicit file roots through the reconciliation service.

Assisted-by: OpenAI GPT-6 <noreply@openai.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

@greptileai review

N0zoM1z0 added a commit that referenced this pull request Oct 13, 2026
Follow up on #2422 and the host-relative path diagnosis by @Aurantium-47. Select the recorded path grammar at the shared root matcher, preserving Windows case semantics and both matching and active-layer scope.

Verify real npm module data and passive Node Inspector Evidence through Windows CLI and same-connection SDK MCP. Positive normalized results remain unchanged; rejected POSIX roots leave load state unknown. All 101 related tests and static/docs gates pass. Register the existing workflow tests in Windows CI execution and package scope. No IDA or Ghidra engine was used; scoped resources and delivery costs are recorded in experiments/analysis-efficiency/windows-posix-reconciliation.md.
@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

pathBelowRoot now uses posix.relative for recorded POSIX paths, even on Windows.

  • POSIX runtime paths keep their case on Windows.

No actionable issues found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "fix(javascript): preserve POSIX runtime ..." · Reviewed by Greptile

@morluto
morluto merged commit 1a1b67c into morluto:main Oct 13, 2026
1 check passed
N0zoM1z0 added a commit that referenced this pull request Oct 13, 2026
Follow up on #2422 and the host-relative path diagnosis by @Aurantium-47. Select the recorded path grammar at the shared root matcher, preserving Windows case semantics and both matching and active-layer scope.

Verify real npm module data and passive Node Inspector Evidence through Windows CLI and same-connection SDK MCP. Positive normalized results remain unchanged; rejected POSIX roots leave load state unknown. All 101 related tests and static/docs gates pass. Register the existing workflow tests in Windows CI execution and package scope. No IDA or Ghidra engine was used; scoped resources and delivery costs are recorded in experiments/analysis-efficiency/windows-posix-reconciliation.md.
N0zoM1z0 added a commit that referenced this pull request Oct 13, 2026
Follow up on #2422 and the host-relative path diagnosis by @Aurantium-47. Select the recorded path grammar at the shared root matcher, preserving Windows case semantics and both matching and active-layer scope.

Verify real npm module data and passive Node Inspector Evidence through Windows CLI and same-connection SDK MCP. Positive normalized results remain unchanged; rejected POSIX roots leave load state unknown. All 101 related tests and static/docs gates pass. Register the existing workflow tests in Windows CI execution and package scope. No IDA or Ghidra engine was used; scoped resources and delivery costs are recorded in experiments/analysis-efficiency/windows-posix-reconciliation.md.
N0zoM1z0 added a commit that referenced this pull request Oct 13, 2026
Follow up on #2422 and the host-relative path diagnosis by @Aurantium-47. Select the recorded path grammar at the shared root matcher, preserving Windows case semantics and both matching and active-layer scope.

Verify real npm module data and passive Node Inspector Evidence through Windows CLI and same-connection SDK MCP. Positive normalized results remain unchanged; rejected POSIX roots leave load state unknown. All 101 related tests and static/docs gates pass. Register the existing workflow tests in Windows CI execution and package scope. No IDA or Ghidra engine was used; scoped resources and delivery costs are recorded in experiments/analysis-efficiency/windows-posix-reconciliation.md.
N0zoM1z0 added a commit that referenced this pull request Oct 13, 2026
Follow up on #2422 and the host-relative path diagnosis by @Aurantium-47. Select the recorded path grammar at the shared root matcher, preserving Windows case semantics and both matching and active-layer scope.

Verify real npm module data and passive Node Inspector Evidence through Windows CLI and same-connection SDK MCP. Positive normalized results remain unchanged; rejected POSIX roots leave load state unknown. All 101 related tests and static/docs gates pass. Register the existing workflow tests in Windows CI execution and package scope. No IDA or Ghidra engine was used; scoped resources and delivery costs are recorded in experiments/analysis-efficiency/windows-posix-reconciliation.md.
N0zoM1z0 added a commit that referenced this pull request Oct 13, 2026
Follow up on #2422 and the host-relative path diagnosis by @Aurantium-47. Select the recorded path grammar at the shared root matcher, preserving Windows case semantics and both matching and active-layer scope.

Verify real npm module data and passive Node Inspector Evidence through Windows CLI and same-connection SDK MCP. Positive normalized results remain unchanged; rejected POSIX roots leave load state unknown. All 101 related tests and static/docs gates pass. Register the existing workflow tests in Windows CI execution and package scope. No IDA or Ghidra engine was used; scoped resources and delivery costs are recorded in experiments/analysis-efficiency/windows-posix-reconciliation.md.
N0zoM1z0 added a commit that referenced this pull request Oct 13, 2026
Follow up on #2422 and the host-relative path diagnosis by @Aurantium-47. Select the recorded path grammar at the shared root matcher, preserving Windows case semantics and both matching and active-layer scope.

Verify real npm module data and passive Node Inspector Evidence through Windows CLI and same-connection SDK MCP. Positive normalized results remain unchanged; rejected POSIX roots leave load state unknown. All 101 related tests and static/docs gates pass. Register the existing workflow tests in Windows CI execution and package scope. No IDA or Ghidra engine was used; scoped resources and delivery costs are recorded in experiments/analysis-efficiency/windows-posix-reconciliation.md.
N0zoM1z0 added a commit that referenced this pull request Oct 13, 2026
Select the Windows curated lane for edits to the shared runtime path matcher and its workflow suite. Strengthen the existing POSIX/Windows mapping controls with matching basis, coherent target/script coordinates, caller spelling and static load-state assertions.

Follow-up to #2422; thanks to @Aurantium-47 for identifying the recorded-path grammar issue.

Verified with actual Windows 11 x64, official Node 24.18.0 and production CLI/MCP workflows using published npm 11.16.0 module Evidence. Four exact/mismatched implicit/explicit mapping cases pass with unchanged normalized hashes. The capture provider was Node Inspector; no IDA, Ghidra or Electron GUI verification is claimed.

230 focused tests, all eight CI static tasks, architecture guards and documentation checks pass after rebasing onto main fb28ec1. The unrelated release-checkpoint and dyld fixture corrections were integrated from upstream; no patches to those files are included here. Final Windows MCP replay at e6e8694 preserves all four normalized hashes, with no owned Node processes remaining. Resource probes ran serially at BelowNormal priority with one CPU and 512 MiB Node heaps; calls took 251–620 ms and the sampled process-family working-set sum peaked at 499,380,224 bytes. Source pins, provenance and measurement limits are recorded in experiments/analysis-efficiency/windows-posix-reconciliation.md.

All 34 jobs in current-head CI run 38391921571 passed, including the Windows capability/package lane, all six portable test shards, JavaScript recovery and the required aggregate. Current-head Codex and Greptile reviews are clean; both prior scope-selection findings were fixed and resolved.
@morluto morluto mentioned this pull request Oct 13, 2026
3 tasks done
@morluto morluto added bug Something isn't working area: runtime Process capture and runtime observation labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants