[PR #6945] [MERGED] test: align stale fixtures with recent native and launcher contracts #7465

Closed
opened 2026-11-01 21:48:03 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6945
Author: @kaoru0822-kitauji
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/apple-dispatch-bound-target-test


📝 Commits (4)

  • 5bf38d5 test(native): expect artifact_changed when a bound metadata target is lost
  • b5237c8 Merge remote-tracking branch 'origin/main' into fix/apple-dispatch-bound-target-test
  • 7e8c7fc test(package): ship the CLI process environment owner in launcher fixtures
  • c00fa6b test(native): expect XML plist validation in typed-value provenance

📊 Changes

4 files changed (+25 additions, -8 deletions)

View changed files

📝 src/native/AppleDispatchMetadata.failure.test.ts (+7 -6)
📝 tests/boundary/cli/nativePlistCli.test.ts (+11 -1)
📝 tests/boundary/mcp/deferredRuntime.test.ts (+6 -1)
📝 tests/boundary/process/packageTarListing.test.ts (+1 -0)

📄 Description

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: 41e10b240 (bound-target errors), c2caae88f (launcher's scripts/lib/cli-process-environment.mjs) and 9f5dd56e2 (XML plist lint provenance).
Risk: test-only; no production code changes.

Summary

41e10b240 (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 ae24b7879, 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 915e56e3e), and they're fixed here too:

  • c2caae88f (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.
  • 9f5dd56e2 (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. 41e10b240'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 41e10b240~1 (5/5) and fails on 41e10b240, ba6cec31f, ae24b7879 and f9fabdfcb (2 failed / 3 passed), with expected 'AnalysisArtifactChangedError' to be 'AnalysisInputError'. On 21a20306b 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 21a20306b + 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 21a20306b + 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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6945 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/apple-dispatch-bound-target-test` --- ### 📝 Commits (4) - [`5bf38d5`](https://github.com/morluto/rea/commit/5bf38d57ff489b30d71755ad4d012caf301307e2) test(native): expect artifact_changed when a bound metadata target is lost - [`b5237c8`](https://github.com/morluto/rea/commit/b5237c8156a15c68e40c57896aeec93124873cb7) Merge remote-tracking branch 'origin/main' into fix/apple-dispatch-bound-target-test - [`7e8c7fc`](https://github.com/morluto/rea/commit/7e8c7fce99d78045c6e6a34b0662e23a69c4f78a) test(package): ship the CLI process environment owner in launcher fixtures - [`c00fa6b`](https://github.com/morluto/rea/commit/c00fa6b3066da9200f2bb015d379b1ff81175526) test(native): expect XML plist validation in typed-value provenance ### 📊 Changes **4 files changed** (+25 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/native/AppleDispatchMetadata.failure.test.ts` (+7 -6) 📝 `tests/boundary/cli/nativePlistCli.test.ts` (+11 -1) 📝 `tests/boundary/mcp/deferredRuntime.test.ts` (+6 -1) 📝 `tests/boundary/process/packageTarListing.test.ts` (+1 -0) </details> ### 📄 Description **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: 41e10b240 (bound-target errors), c2caae88f (launcher's `scripts/lib/cli-process-environment.mjs`) and 9f5dd56e2 (XML plist lint provenance). **Risk:** test-only; no production code changes. ## Summary 41e10b240 (`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 ae24b7879, 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 915e56e3e), and they're fixed here too: - **c2caae88f** (`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`. - **9f5dd56e2** (`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. 41e10b240'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. - [x] 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 41e10b240~1 (5/5) and fails on 41e10b240, ba6cec31f, ae24b7879 and f9fabdfcb (2 failed / 3 passed), with `expected 'AnalysisArtifactChangedError' to be 'AnalysisInputError'`. On 21a20306b 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 21a20306b + 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 21a20306b + 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 - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:48:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7465
No description provided.