Skip to content

test: align stale fixtures with recent native and launcher contracts - #6945

Merged
gensokyo-dev merged 4 commits into
mainfrom
fix/apple-dispatch-bound-target-test
Oct 24, 2026
Merged

gensokyo-dev merged 4 commits into
mainfrom
fix/apple-dispatch-bound-target-test

Conversation

@kaoru0822-kitauji

@kaoru0822-kitauji kaoru0822-kitauji commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

What broke: three recent maintainer commits changed contracts on purpose but left fixtures behind, so main's required Source tests, Test shard and Portable tests lanes fail (plus the macOS Real Apple lane).
The fix: align the stale fixtures with the shipped contracts: 41e10b2 (bound-target errors), c2caae8 (launcher's scripts/lib/cli-process-environment.mjs) and 9f5dd56 (XML plist lint provenance).
Risk: test-only; no production code changes.

Summary

41e10b2 (fix(filesystem): distinguish admission and bound-target failures) changed appleDispatchMetadataPrimaryFailure. A bound metadata target that fails the source boundary (ArtifactReaderFailure reason path), or whose read fails with ENOENT, now reports AnalysisArtifactChangedError instead of AnalysisInputError. The code comment there and the new docs/testing.md paragraph both state this: "Each refusal must report artifact_changed". The module test was not updated and still expects AnalysisInputError, so it fails on every main run since then (e.g. CI run 40059009782 on ae24b78, Test shard (1/6)). This blocks every open PR's required checks. No issue is linked; this is a main-health fix.

Two more stale fixtures fail on main's later commits (e.g. CI run 40061496630 on 915e56e), and they're fixed here too:

  • c2caae8 (refactor(cli): share process environment preparation) moved launcher environment preparation into scripts/lib/cli-process-environment.mjs, made scripts/rea.mjs import it, and made verifyPackagePack require it in the packed listing. It updated dispatcher.test.ts but not:
    • tests/boundary/process/packageTarListing.test.ts: its fake listing omits the module, so all 3 cases stop at package omitted the CLI process environment owner.
    • tests/boundary/mcp/deferredRuntime.test.ts: its copied compiled package omits the module, so the copied launcher fails with an ESM resolve error instead of SERVER_START_FAILED.
  • 9f5dd56 (fix(native): validate XML plist source admission) records a successful plutil -lint of an XML source in provenance (documented in docs/native-investigation.md). The macOS-only tests/boundary/cli/nativePlistCli.test.ts typed-value case still expected only file for both formats. XML now expects the lint step; binary is unchanged.

Problem and expected behavior

  • Trigger: npm run test:local -- src/native/AppleDispatchMetadata.failure.test.ts on main → expected 'AnalysisArtifactChangedError' to be 'AnalysisInputError' (2 of 5 tests).
  • Expected: the test asserts the shipped contract. Access denial (EACCES/EPERM) stays AnalysisAccessDeniedError; integrity, path and ENOENT are AnalysisArtifactChangedError.

Change and scope

  • Test-only changes, one commit per root cause:
    • src/native/AppleDispatchMetadata.failure.test.ts: expectations and names describe a bound target.
    • packageTarListing.test.ts and deferredRuntime.test.ts fixtures include scripts/lib/cli-process-environment.mjs, as dispatcher.test.ts already does.
    • nativePlistCli.test.ts expects the XML lint provenance step.
  • Not included: any production change. 41e10b2's behavior is intentional and covered end to end by its own tests/boundary/mcp/nativeDispatchBoundTarget.test.ts.
  • The timing assertions that also fail intermittently on main (javascriptStaticAnalysis.routeProperties, javascriptSemanticAnalysis.reference_lifetimes) are separate and not addressed here.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Apple dispatch metadata failure mapping (src/native/AppleDispatchMetadata.ts); unchanged here.
  • Contribution scope fit and linked maintainer decision: not applicable (test alignment with an existing maintainer change).
  • CLI and MCP/tool-catalog contract: none.
  • 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.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • 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

  • Tests updated: src/native/AppleDispatchMetadata.failure.test.ts, tests/boundary/process/packageTarListing.test.ts, tests/boundary/mcp/deferredRuntime.test.ts, tests/boundary/cli/nativePlistCli.test.ts.
  • Base reproduction (executed, local, Node 24.22.1): the test passes on 41e10b2~1 (5/5) and fails on 41e10b2, ba6cec3, ae24b78 and f9fabdf (2 failed / 3 passed), with expected 'AnalysisArtifactChangedError' to be 'AnalysisInputError'. On 21a2030 without this PR, npm run test:focused fails deferredRuntime (ESM resolve error), packageTarListing (3 cases) and nativePlistCli XML typed values (extra plutil provenance entry), all locally on macOS.
  • User-visible CLI/MCP output (if applicable): none.
  • Remaining proof gaps: none for this test. Main's other intermittent timing failures are out of scope.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:local -- src/native/AppleDispatchMetadata.failure.test.ts (on 21a2030 + this PR): 5 passed.
  • npm run test:local -- src/native/AppleDispatchMetadata.failure.test.ts src/native/AppleDispatchMetadata*.test.ts: 2 files, 109 tests passed.
  • npm run test:focused -- tests/boundary/process/packageTarListing.test.ts tests/boundary/cli/nativePlistCli.test.ts (macOS, on 21a2030 + this PR): 2 files, 21 tests passed.
  • npm run test:focused -- tests/boundary/mcp/deferredRuntime.test.ts: 29 passed.
  • npm run check:fast: passed.
  • npm run format:check: passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none needed (test-only).

Author readiness

Human owner: @kaoru0822-kitauji

  • 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.

🤖 Generated with Claude Code

… lost

41e10b2 made a bound metadata target that fails the source boundary
(`path`) or disappears (`ENOENT`) report AnalysisArtifactChangedError, as
its comment and docs/testing.md state, but left the module test expecting
AnalysisInputError. The test now asserts the shipped contract, so main's
Test shard and Portable tests lanes pass again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji kaoru0822-kitauji added bug Something isn't working track:env-prs PR shepherding for environment PRs labels Oct 24, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 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-24T04:51:35.417819Z c00fa6b 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.

kaoru0822-kitauji and others added 3 commits October 24, 2026 04:44
…tures

c2caae8 moved launcher environment preparation into
scripts/lib/cli-process-environment.mjs, made scripts/rea.mjs import it and
made verifyPackagePack require it in the packed listing, and updated the
dispatcher fixtures, but two other fixtures still omit it:

- packageTarListing's fake tar listing, so every case stops at "package
  omitted the CLI process environment owner" before its own assertion;
- deferredRuntime's copied compiled package, so the copied launcher fails
  to resolve its import instead of reporting the corrupted catalog.

Both fixtures now include the module, as the package ships it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
9f5dd56 records a successful `plutil -lint` of an XML plist source in
provenance, as docs/native-investigation.md states, but the macOS typed-value
CLI test still expected only the `file` step for both formats. XML sources now
expect the lint step; binary sources are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji kaoru0822-kitauji changed the title test(native): expect artifact_changed when a bound metadata target is lost test: align stale fixtures with recent native and launcher contracts Oct 24, 2026
@gensokyo-dev
gensokyo-dev merged commit b869fa7 into main Oct 24, 2026
36 of 42 checks passed
@gensokyo-dev
gensokyo-dev deleted the fix/apple-dispatch-bound-target-test branch October 24, 2026 05:08
shoyann added a commit to shoyann/rea that referenced this pull request Oct 26, 2026
Bring in the upstream Apple metadata error-contract tests (morluto#6945) and
Webpack factory fixture correction (morluto#6951). Preserve the five-file
physical symlink target fix relative to main.
@morluto morluto added the area: domain Domain logic, errors, and pure functions label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working track:env-prs PR shepherding for environment PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants