[PR #2888] [MERGED] test(native): assert failed-callee call identities and edge caps #5472

Closed
opened 2026-10-31 01:06:55 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2888
Author: @IvenKooLab
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @morluto

Base: main ← Head: fix/native-value-failed-attempts


📝 Commits (5)

  • f558c24 fix(native): attempt failed value trace selectors once per invocation
  • cf7a4a1 test(native): assert failed-callee call identities and edge caps
  • 1e1658a merge: sync native trace review with upstream main
  • 5a96fd8 Merge remote-tracking branch 'upstream/main' into fix/native-value-failed-attempts
  • 0e4f2d2 Merge remote-tracking branch 'upstream/main' into fix/native-value-failed-attempts

📊 Changes

1 file changed (+21 additions, -1 deletions)

View changed files

📝 src/application/native/NativeValueTrace.test.ts (+21 -1)

📄 Description

Summary

Strengthen the failed-callee regression so it verifies each call site's exact source and destination, including the two-edge prefix under max_edges=2. Three incorrect edges could previously satisfy the count-only assertion.

The original failed-selector traversal fix and the shared node-budget work are already present in upstream commit 55dd21a5e, which references #2888 and #2889. After syncing main, this PR's remaining diff is only the regression assertion update.

Problem and expected behavior

Review finding: checking only the call-edge count misses repeated source IDs or incorrect destinations. The test now requires bad-1 → 0x2000, bad-2 → 0x2000, and good → 0x3000, with fully qualified source IDs, and checks the exact first two relationships when the edge budget truncates output.

Change and scope

Reuse the existing regression fixture and production application traversal. Keep exact expected pairs in one local test value and assert both the complete and capped results. The existing retry-across-invocations, failure reason, function coverage, and truncation checks remain.

Routine test correction within existing static-analysis scope. No separate issue; the linked review finding is the concrete problem. No new provider or target capability; an advance maintainer scope decision is not applicable.

Contract and boundary impact

  • Semantic owner: regression assertions at the native application workflow boundary.
  • CLI/MCP/tool catalog: no production contract change.
  • Provider, bridge, format, or platform compatibility: no production change.
  • Evidence/provenance: tests protect exact call-site identity rather than only edge count.
  • Target selection, authority, upstream behavior, cleanup: simulated analysis ports only in the changed test; no added target interaction.
  • Generated metadata, package, or installation: none.

Expected effects of the final diff: execute local simulated regression tests only.

Evidence and regression coverage

A temporary mutation forced all three call edges to share bad-1 as their source, preserving the edge count. The strengthened assertion failed on the incorrect source pairs. The mutation was restored and is not committed.

After merging current main, the remaining diff is one test file, 21 insertions and one deletion. Original production fixes are already incorporated upstream; no further production refactor is needed for this assertion gap.

  • Observations, derived relationships, and unknowns remain distinct.
  • Artifact provenance and exact call-site relationships remain covered.
  • Failed attempts and incomplete outcomes remain visible.

Validation performed

Earlier local run with pinned Node 24.18.0/npm 11.16.0 and the locked dependencies available at that time:

  • npm run test:local -- src/application/native/NativeValueTrace.test.ts src/application/native/EnhancedNativeInvestigation.test.ts — 40 tests passed in that earlier local run.
  • npm run check — passed (typecheck, lint, format, knip, metadata, compile dependency, and architecture guards).
  • Test discovery, touched-file formatting, and git diff --check — passed.
  • Wrong-source mutation — rejected by the new assertion as expected; restored before commit.

Independent verification by CassieFox23 applied this patch to main 5b16f2431 and reported 42/42 tests passing across the same two files. Their wrong-source mutation also confirmed that the new assertion catches a case the old count check missed. These are independently reported results on the specified main snapshot; that run was not repeated during this update.

Compatibility, safety, and release

No runtime behavior, schema, migration, package metadata, or authority change. No real-provider or end-to-end CLI/MCP run was performed for this test-only follow-up. The earlier runtime performance measurements do not describe a new runtime change in the final diff.

Before merge

  • Concrete review finding linked; focused Conventional Commit title.
  • Scope and authority unchanged.
  • Complete and truncated call relationships covered.
  • Documentation and generated metadata unaffected by the final test-only diff.
  • Final diff checked for unrelated changes, secrets, and unsupported claims.

Author readiness

Human owner: @IvenKooLab

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

🔄 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/2888 **Author:** [@IvenKooLab](https://github.com/IvenKooLab) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/native-value-failed-attempts` --- ### 📝 Commits (5) - [`f558c24`](https://github.com/morluto/rea/commit/f558c242ef167e6f1bb7950d45041a24e8c85e6a) fix(native): attempt failed value trace selectors once per invocation - [`cf7a4a1`](https://github.com/morluto/rea/commit/cf7a4a146cf90b8c3650a443289a3e6b838ab2eb) test(native): assert failed-callee call identities and edge caps - [`1e1658a`](https://github.com/morluto/rea/commit/1e1658a14fe5874de08e2f0544317ac5c62d4282) merge: sync native trace review with upstream main - [`5a96fd8`](https://github.com/morluto/rea/commit/5a96fd8e75d9702a6796150eacce7ad77fb434c5) Merge remote-tracking branch 'upstream/main' into fix/native-value-failed-attempts - [`0e4f2d2`](https://github.com/morluto/rea/commit/0e4f2d28493fb18c75e432e6331dcc043e158ddd) Merge remote-tracking branch 'upstream/main' into fix/native-value-failed-attempts ### 📊 Changes **1 file changed** (+21 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/application/native/NativeValueTrace.test.ts` (+21 -1) </details> ### 📄 Description ## Summary Strengthen the failed-callee regression so it verifies each call site's exact source and destination, including the two-edge prefix under `max_edges=2`. Three incorrect edges could previously satisfy the count-only assertion. The original failed-selector traversal fix and the shared node-budget work are already present in upstream commit [55dd21a5e](https://github.com/morluto/rea/commit/55dd21a5e2172187dfe7167df684f85ecb536f5e), which references #2888 and #2889. After syncing main, this PR's remaining diff is only the regression assertion update. ## Problem and expected behavior [Review finding](https://github.com/morluto/rea/pull/2888#discussion_r4260832420): checking only the call-edge count misses repeated source IDs or incorrect destinations. The test now requires `bad-1 → 0x2000`, `bad-2 → 0x2000`, and `good → 0x3000`, with fully qualified source IDs, and checks the exact first two relationships when the edge budget truncates output. ## Change and scope Reuse the existing regression fixture and production application traversal. Keep exact expected pairs in one local test value and assert both the complete and capped results. The existing retry-across-invocations, failure reason, function coverage, and truncation checks remain. Routine test correction within existing static-analysis scope. No separate issue; the linked review finding is the concrete problem. No new provider or target capability; an advance maintainer scope decision is not applicable. ## Contract and boundary impact - Semantic owner: regression assertions at the native application workflow boundary. - CLI/MCP/tool catalog: no production contract change. - Provider, bridge, format, or platform compatibility: no production change. - Evidence/provenance: tests protect exact call-site identity rather than only edge count. - Target selection, authority, upstream behavior, cleanup: simulated analysis ports only in the changed test; no added target interaction. - Generated metadata, package, or installation: none. Expected effects of the final diff: execute local simulated regression tests only. ## Evidence and regression coverage A temporary mutation forced all three call edges to share `bad-1` as their source, preserving the edge count. The strengthened assertion failed on the incorrect source pairs. The mutation was restored and is not committed. After merging current main, the remaining diff is one test file, 21 insertions and one deletion. Original production fixes are already incorporated upstream; no further production refactor is needed for this assertion gap. - [x] Observations, derived relationships, and unknowns remain distinct. - [x] Artifact provenance and exact call-site relationships remain covered. - [x] Failed attempts and incomplete outcomes remain visible. ## Validation performed Earlier local run with pinned Node 24.18.0/npm 11.16.0 and the locked dependencies available at that time: - `npm run test:local -- src/application/native/NativeValueTrace.test.ts src/application/native/EnhancedNativeInvestigation.test.ts` — 40 tests passed in that earlier local run. - `npm run check` — passed (typecheck, lint, format, knip, metadata, compile dependency, and architecture guards). - Test discovery, touched-file formatting, and `git diff --check` — passed. - Wrong-source mutation — rejected by the new assertion as expected; restored before commit. [Independent verification by CassieFox23](https://github.com/morluto/rea/pull/2888#issuecomment-6198065850) applied this patch to main `5b16f2431` and reported 42/42 tests passing across the same two files. Their wrong-source mutation also confirmed that the new assertion catches a case the old count check missed. These are independently reported results on the specified main snapshot; that run was not repeated during this update. ## Compatibility, safety, and release No runtime behavior, schema, migration, package metadata, or authority change. No real-provider or end-to-end CLI/MCP run was performed for this test-only follow-up. The earlier runtime performance measurements do not describe a new runtime change in the final diff. ## Before merge - [x] Concrete review finding linked; focused Conventional Commit title. - [x] Scope and authority unchanged. - [x] Complete and truncated call relationships covered. - [x] Documentation and generated metadata unaffected by the final test-only diff. - [x] Final diff checked for unrelated changes, secrets, and unsupported claims. ## Author readiness Human owner: @IvenKooLab - [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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:06:55 +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#5472
No description provided.