Skip to content

test(applications): import capture fixtures through file URLs - #3050

Merged
N0zoM1z0 merged 2 commits into
morluto:mainfrom
GuilhermeFusari:test/windows-esm-fixture-file-url
Oct 15, 2026
Merged

N0zoM1z0 merged 2 commits into
morluto:mainfrom
GuilhermeFusari:test/windows-esm-fixture-file-url

Conversation

@GuilhermeFusari

@GuilhermeFusari GuilhermeFusari commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The capture-lifetime acceptance fixture passed a raw filesystem path to Node's ESM import(). Windows drive paths are URL schemes to the loader; # in a POSIX path becomes a fragment. Convert the selected path once with pathToFileURL(...).href at the fixture execution boundary.

The existing public CLI/MCP case now uses a test-owned child directory containing spaces and #, so Linux also catches regression. Both authored modules still execute independently of REA analysis, and all captured-value, comparison and provenance assertions remain. The original 20s timeout is unchanged. Only one test file changes; no runtime or caching policy changes.

Refreshed on main 5b16f2431, including #3049 and the latest literal byte-limit implementation. The complete post-merge main file passed all 34 cases before this change. With only the legal special-character child directory added, the original raw-path import fails with ERR_MODULE_NOT_FOUND at the real Node ESM loader (one selected case); this is the negative control, not a semantic failure.

Validation

  • Linux x64 / Node24.18.0, two cores, 1.5GiB Node heap: complete acceptance file 34 passed. Wall 85.00s, child user/system CPU 88.28/20.96s, sampled family peak RSS 1.97GiB. Warm artifacts, fresh test/CLI/MCP processes. RSS can count shared pages repeatedly and miss short/reparented children; wrapper CPU excluded. Agent tokens unmeasured. No speedup claim.
  • The valid raw-path negative control fails at the actual ESM loader; unchanged-main full-file verification before this change passes all 34 cases.
  • check:ci (eight tasks and 1439 architecture guards) and normal pre-push passed.
  • Native Windows x64 / Node24.18.0: unchanged main 5b16f2431 fails the selected fixture at the actual ESM loader with ERR_UNSUPPORTED_ESM_URL_SCHEME. Candidate 011be9c3d passes the complete file: 34 passed, zero skips, including test(applications): pass Evidence requests to the CLI through files #3049 transport integration. Reports and source-identity receipt were downloaded and checked. Diagnostic commit 43303502e differs only in ci.yml; the gate restores and verifies clean candidate source. Baseline failed command 4.89s versus full completed file 56.51s are different workloads, not a speed comparison. Hosted CPU/peak memory and isolated cold-MCP Windows timing were not measured. The full file retains one shared stateless MCP connection; the changed capture case took 3.10s in that context.
  • Complete current-head CI passed, including all five shards, Portable tests and the required gate. Its merged report confirms 34 tests from this file executed. All 35 job results were checked through the paged API, including jobs omitted by the installed older CLI. Additional Go metadata, packet-capture and signal-recording checks passed.
  • Codex and Greptile reviewed 011be9c3d without findings; no unresolved threads. No test/timeout/runner-condition retry was needed for this head. The initial synchronize run was superseded by the reopened-event run; source was unchanged.

Original contributor: @GuilhermeFusari. The user delegated follow-up implementation, technical review, ready-for-review update and merge. Assistant technical review is reported; a separate human reread is not claimed.

The capture-lifetime acceptance test executes its authored fixtures with
`import(process.argv[1])` and passed a filesystem path. ESM import()
takes a URL specifier, so on Windows the drive letter parses as a `c:`
scheme and Node rejects the import with ERR_UNSUPPORTED_ESM_URL_SCHEME
before the fixture runs.

Pass the fixture as a file URL from pathToFileURL instead.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 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-10-15T16:02:11.771066Z 011be9c Manual request
ℹ️ 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 Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5 Tier: apex

[Medium impact] Test fixture imports and documentation updates across the codebase.

The supplied comparison should not merge until port normalization and Webpack loader-alias tracking are fixed.

Summary

Updates capture fixtures to use encoded file URLs and adds a test directory containing spaces and #.

  • The capture-lifetime test imports fixtures from file URLs.

Reviews (2) · Last reviewed commit: "test(applications): execute ESM fixtures..." · Reviewed by Greptile

@morluto morluto added area: tests Test suite and verification area: runtime Process capture and runtime observation labels Oct 14, 2026
Refresh the Windows fixture fix on current main and exercise spaces and hash characters in the existing test-owned application directory. Preserve real module execution, CLI/MCP comparisons and the existing timeout.

Co-authored-by: Kaoru0822 <[email protected]>
@N0zoM1z0

Copy link
Copy Markdown
Collaborator

@codex review

@N0zoM1z0 N0zoM1z0 closed this Oct 15, 2026
@N0zoM1z0 N0zoM1z0 reopened this Oct 15, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 011be9c3d5

ℹ️ 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 Oct 15, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff

These findings could not be posted inline.

  • P1 URL ports stop normalizing src/process/capture/ProcessNormalization.ts:378 ▶

    With normalization.ports enabled, text such as http://localhost:8080/ keeps its raw port. The first replacement succeeds, but normalizePortsBounded returns the second replacement's unchanged result. Its caller ignores that result's value and loses the first replacement.

    Both terminal capture paths now use this normalizer, so runs that differ only in assigned ports can report false changes. Preserve the first replacement when the second changes nothing.

      const afterEndpoint = endpoint.state === "bounded" ? endpoint.value : value;
      const field = boundedRegexReplace(
        afterEndpoint,
        PORT_FIELD_MATCHER,
        portFieldReplacement,
        maxBytes,
      );
      return field.state === "unchanged" ? endpoint : field;
    

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 area: tests Test suite and verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants