[PR #2001] [MERGED] fix(call-path): preserve relationship coverage from analysis #4959

Closed
opened 2026-10-31 00:57:23 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2001
Author: @khanukov
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @morluto

Base: main ← Head: fix/call-path-relationship-coverage


📝 Commits (1)

  • cb7cbd7 fix(call-path): preserve relationship coverage from analysis

📊 Changes

4 files changed (+320 additions, -5 deletions)

View changed files

📝 src/application/FunctionAnalysisEvidence.ts (+3 -0)
📝 src/domain/callPath.test.ts (+110 -0)
📝 src/domain/callPath.ts (+17 -2)
📝 tests/boundary/mcp/investigationAnalysisMcp.test.ts (+190 -3)

📄 Description

Summary

Addresses the build_call_path follow-up discussed in #1964. Preserve observed relationship coverage when analyze_function creates Evidence, and use that digest-validated coverage when deciding whether the supplied call-path search is exhaustive.

AI-assisted contribution prepared with Hermes (Nous Research). This PR does not claim to resolve the separate get_call_graph or trace_call_path work, and intentionally does not close the whole issue.

Problem and expected behavior

Two stages lost or ignored the existing completeness contract:

  • The shared function-analysis application helper omitted AnalysisExecution.relationshipCoverage when creating Evidence.
  • build_call_path treated every generic provider/dossier limitation as incomplete relationship coverage, while explicit partial/unknown coverage without generic limitations could produce a false not_found.

For the supplied reachable observations, complete relationship coverage remains exhaustive even with unrelated contextual limitations. Partial/unknown coverage remains non-exhaustive and retains its structured reasons. Missing metadata keeps the existing conservative legacy behavior. None of these results establishes absence across the entire binary.

Change and scope

  • Forward the existing typed coverage metadata at the function-analysis-to-Evidence boundary.
  • Let digest-validated relationship_coverage own call-path completeness; preserve generic limitations, structured reasons, citations and unresolved questions.
  • Accumulate both limitation lists iteratively, avoiding JavaScript argument-spread RangeError on large schema-valid inputs without adding arbitrary graph/schema caps.
  • Exercise the actual public MCP analyze_function → build_call_path producer/consumer chain, legacy cases and coverage tampering.

No provider implementation, Evidence schema/identity algorithm, get_call_graph, trace_call_path, or unrelated capability changes.

Contract and boundary impact

  • Semantic owner and earliest changed stage: executeFunctionAnalysisEvidence preserves observed metadata; the existing call-path domain consumer interprets it.
  • CLI and MCP/tool-catalog contract: no new tools, flags or schemas. Existing call-path status/exhaustiveness fields now reflect existing coverage semantics.
  • Provider, bridge, target-format, or platform compatibility: no adapter or platform changes; absent metadata retains legacy fallback.
  • Evidence, artifact, provenance, or reconstruction contract: existing digest-bound coverage is preserved; artifact identity, provider, raw output, locations and downstream Evidence links remain intact. Forged coverage without a new digest is rejected.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: none; no generated/build outputs are committed.

Evidence and regression coverage

  • Tests added or updated: real public MCP producer-chain cases for complete+context, partial/unknown without generic limitations, both legacy cases, provenance, unknown ledger and tampering; domain cases for found paths, terminal/unreachable coverage and large limitation lists. The existing 20,000-node chain remains covered.

  • Base reproduction or other evidence: new call-path regressions failed against the exact affected base. Before forwarding metadata, three public producer-chain scenarios failed semantically. Before iterative accumulation, 1,000,000 structured reasons and independently 1,000,000 distinct generic reasons reproduced RangeError in the Vitest worker. The originally reported 150,000-entry standalone case also passes after the fix; that smaller case did not reproduce the crash under Vitest's larger worker stack and is not described as RED evidence.

  • User-visible CLI/MCP output: executed fixture-backed producer/consumer checks returned status: "not_found", search_scope: { exhaustive: true } for complete+context; partial/unknown returned status: "unknown", search_scope: { exhaustive: false } with their original reasons. Public MCP regressions assert the same fields and citations.

  • Remaining proof gaps: no live proprietary provider or platform verification; full deterministic suite/coverage is CI-owned per CONTRIBUTING.md and was not run locally.

  • 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

All repository execution used an offline, credential-free Linux sandbox with pinned Node 24.18.0 / npm 11.16.0.

  • npm run test:focused -- src/domain/callPath.test.ts src/domain/evidence.test.ts tests/boundary/mcp/investigationAnalysisMcp.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts tests/boundary/mcp/enhancedTools.06-rejects-incomplete-function-dossiers-at.test.ts — 69 tests / 6 files passed.
  • npm run check — passed; 810 existing warnings, zero errors; no warning locations in the four changed files.
  • npm run verify:test-discovery — passed.
  • npm run build:cached — passed.
  • node scripts/rea.mjs --help — passed (CLI smoke, not a live analysis claim).
  • Independent adversarial graph probe — 8,192 finite directed-graph cases plus 13 targeted semantic/authentication checks passed; original standalone 150,000-reason case returned unknown without crashing.
  • git diff --cached --check and added-line security scan — passed.
  • Two fresh independent agent reviews (spec compliance and adversarial semantics) passed on the exact four-file snapshot. These are not maintainer approvals. Runtime-only sabotage of producer forwarding caused three expected semantic failures; restoring argument spreads caused two expected RangeError failures; the unmodified snapshot passed again.

Reviewed source base: 6395e8d3007d5ee453477460e7ee1c51cff76be0.
Staged binary-diff SHA-256: 82bd4b64ff1f1ecf9dfeb7840eb0a73c070ef8d250a464d2b9e69f2c5ee78ba0.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; callers with missing coverage keep their previous behavior.
  • Real Hopper/Ghidra, browser, or OS coverage: fixture-backed public MCP and portable domain behavior on Linux only; no live IDA/Hopper/Ghidra, macOS or Windows run.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no new process/network/file access; existing Evidence digest checks remain intact; they validate content consistency, not external-provider honesty. Source review and added-line scans found no credential literals or unsafe execution patterns.

Review checklist

  • This PR addresses a concrete problem or an agreed enhancement.
  • 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 (no authored schema/catalog change required).
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/2001 **Author:** [@khanukov](https://github.com/khanukov) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/call-path-relationship-coverage` --- ### 📝 Commits (1) - [`cb7cbd7`](https://github.com/morluto/rea/commit/cb7cbd7964d223284529f93e829372f07499a568) fix(call-path): preserve relationship coverage from analysis ### 📊 Changes **4 files changed** (+320 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/application/FunctionAnalysisEvidence.ts` (+3 -0) 📝 `src/domain/callPath.test.ts` (+110 -0) 📝 `src/domain/callPath.ts` (+17 -2) 📝 `tests/boundary/mcp/investigationAnalysisMcp.test.ts` (+190 -3) </details> ### 📄 Description ## Summary Addresses the `build_call_path` follow-up discussed in #1964. Preserve observed relationship coverage when `analyze_function` creates Evidence, and use that digest-validated coverage when deciding whether the supplied call-path search is exhaustive. AI-assisted contribution prepared with Hermes (Nous Research). This PR does not claim to resolve the separate `get_call_graph` or `trace_call_path` work, and intentionally does not close the whole issue. ## Problem and expected behavior Two stages lost or ignored the existing completeness contract: - The shared function-analysis application helper omitted `AnalysisExecution.relationshipCoverage` when creating Evidence. - `build_call_path` treated every generic provider/dossier limitation as incomplete relationship coverage, while explicit partial/unknown coverage without generic limitations could produce a false `not_found`. For the supplied reachable observations, complete relationship coverage remains exhaustive even with unrelated contextual limitations. Partial/unknown coverage remains non-exhaustive and retains its structured reasons. Missing metadata keeps the existing conservative legacy behavior. None of these results establishes absence across the entire binary. ## Change and scope - Forward the existing typed coverage metadata at the function-analysis-to-Evidence boundary. - Let digest-validated `relationship_coverage` own call-path completeness; preserve generic limitations, structured reasons, citations and unresolved questions. - Accumulate both limitation lists iteratively, avoiding JavaScript argument-spread `RangeError` on large schema-valid inputs without adding arbitrary graph/schema caps. - Exercise the actual public MCP `analyze_function → build_call_path` producer/consumer chain, legacy cases and coverage tampering. No provider implementation, Evidence schema/identity algorithm, `get_call_graph`, `trace_call_path`, or unrelated capability changes. ## Contract and boundary impact - Semantic owner and earliest changed stage: `executeFunctionAnalysisEvidence` preserves observed metadata; the existing call-path domain consumer interprets it. - CLI and MCP/tool-catalog contract: no new tools, flags or schemas. Existing call-path status/exhaustiveness fields now reflect existing coverage semantics. - Provider, bridge, target-format, or platform compatibility: no adapter or platform changes; absent metadata retains legacy fallback. - Evidence, artifact, provenance, or reconstruction contract: existing digest-bound coverage is preserved; artifact identity, provider, raw output, locations and downstream Evidence links remain intact. Forged coverage without a new digest is rejected. - Process execution, authorization, cleanup, or containment impact: none. - Generated metadata, package, or installation impact: none; no generated/build outputs are committed. ## Evidence and regression coverage - Tests added or updated: real public MCP producer-chain cases for complete+context, partial/unknown without generic limitations, both legacy cases, provenance, unknown ledger and tampering; domain cases for found paths, terminal/unreachable coverage and large limitation lists. The existing 20,000-node chain remains covered. - Base reproduction or other evidence: new call-path regressions failed against the exact affected base. Before forwarding metadata, three public producer-chain scenarios failed semantically. Before iterative accumulation, 1,000,000 structured reasons and independently 1,000,000 distinct generic reasons reproduced `RangeError` in the Vitest worker. The originally reported 150,000-entry standalone case also passes after the fix; that smaller case did not reproduce the crash under Vitest's larger worker stack and is not described as RED evidence. - User-visible CLI/MCP output: executed fixture-backed producer/consumer checks returned `status: "not_found", search_scope: { exhaustive: true }` for complete+context; partial/unknown returned `status: "unknown", search_scope: { exhaustive: false }` with their original reasons. Public MCP regressions assert the same fields and citations. - Remaining proof gaps: no live proprietary provider or platform verification; full deterministic suite/coverage is CI-owned per `CONTRIBUTING.md` and was not run locally. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed All repository execution used an offline, credential-free Linux sandbox with pinned Node 24.18.0 / npm 11.16.0. - `npm run test:focused -- src/domain/callPath.test.ts src/domain/evidence.test.ts tests/boundary/mcp/investigationAnalysisMcp.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts tests/boundary/mcp/enhancedTools.06-rejects-incomplete-function-dossiers-at.test.ts` — 69 tests / 6 files passed. - `npm run check` — passed; 810 existing warnings, zero errors; no warning locations in the four changed files. - `npm run verify:test-discovery` — passed. - `npm run build:cached` — passed. - `node scripts/rea.mjs --help` — passed (CLI smoke, not a live analysis claim). - Independent adversarial graph probe — 8,192 finite directed-graph cases plus 13 targeted semantic/authentication checks passed; original standalone 150,000-reason case returned `unknown` without crashing. - `git diff --cached --check` and added-line security scan — passed. - Two fresh independent agent reviews (spec compliance and adversarial semantics) passed on the exact four-file snapshot. These are not maintainer approvals. Runtime-only sabotage of producer forwarding caused three expected semantic failures; restoring argument spreads caused two expected `RangeError` failures; the unmodified snapshot passed again. Reviewed source base: `6395e8d3007d5ee453477460e7ee1c51cff76be0`. Staged binary-diff SHA-256: `82bd4b64ff1f1ecf9dfeb7840eb0a73c070ef8d250a464d2b9e69f2c5ee78ba0`. ## Compatibility, safety, and release - Breaking changes or migration steps: none; callers with missing coverage keep their previous behavior. - Real Hopper/Ghidra, browser, or OS coverage: fixture-backed public MCP and portable domain behavior on Linux only; no live IDA/Hopper/Ghidra, macOS or Windows run. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no new process/network/file access; existing Evidence digest checks remain intact; they validate content consistency, not external-provider honesty. Source review and added-line scans found no credential literals or unsafe execution patterns. ## Review checklist - [x] This PR addresses a concrete problem or an agreed enhancement. - [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 (no authored schema/catalog change required). - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:57:23 +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#4959
No description provided.