Skip to content

fix(call-path): preserve relationship coverage from analysis - #2001

Merged
morluto merged 1 commit into
morluto:mainfrom
khanukov:fix/call-path-relationship-coverage
Oct 12, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
khanukov:fix/call-path-relationship-coverage

Conversation

@khanukov

@khanukov khanukov commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

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.

Forward observed relationship coverage into function Evidence and use its typed completeness when searching call paths. Preserve contextual limitations, legacy fallback, provenance, and unknown outcomes.

Avoid argument-spread exhaustion on large valid limitation lists. Cover the public MCP producer/consumer chain, metadata tampering, terminal and unreachable coverage, and large-list capacity.

Related to morluto#1964; separate get_call_graph and trace_call_path work is not included. AI-assisted with Hermes (Nous Research).
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 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-12T00:44:39.454062Z cb7cbd7 PR opened
ℹ️ 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.

@morluto
morluto merged commit ed6af7e into morluto:main Oct 12, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 12, 2026
3 tasks done
@morluto

morluto commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

@khanukov, thank you for preserving relationship coverage from function analysis into Evidence and using that validated metadata for call-path completeness. The public MCP producer-to-consumer tests also pin down the important distinction between contextual limitations and incomplete relationship coverage. Welcome to REA!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants