Skip to content

fix(mcp): report native value flow support in session status - #8786

Merged
morluto merged 8 commits into
mainfrom
codex/value-flow-capability-experiment
Nov 7, 2026
Merged

morluto merged 8 commits into
mainfrom
codex/value-flow-capability-experiment

Conversation

@morluto

@morluto morluto commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

binary_session told Kuna users to configure a call-target resolver without explaining that REA's Kuna provider also does not supply native value-flow observations. It also did not distinguish an absent resolver from the possibility of a useful local trace. This exposes the routed analysis provider's value-flow declaration and retains partial-result guidance. Related: #8471. Prerequisite #8785 has merged.

Problem and expected behavior

The tool status now reports value_flow_support as supported, unavailable with its provider's reason, or unknown, with the routed provider's identity. Supported means some functions may supply a model, not that a particular function does. Availability still reflects declared prerequisites and readiness; an unknown declaration is not a promise of output. A direct call may return local observations and call-resolution unknowns even if resolver discovery is unavailable.

Change and scope

The routed analyze_function capability owns the declaration; session status preserves it through grouping, and the trace inventory combines it with resolver readiness without dropping runtime or unsupported-host repairs. Kuna's capability and dossier share one provider-owned reason. No target authority or upstream provider behavior changes. Contribution scope decision: not applicable to this existing read-only workflow.

Contract and boundary impact

  • Semantic owner: analysis provider capability, projected through binary session status and MCP inventory.
  • CLI and MCP: adds optional provider-capability and tool-availability facts; availability remediation changes. Strict clients that reject new output properties should update their schemas.
  • Evidence and provenance: no new Evidence format in this PR; fix(native)!: preserve value-flow absence semantics #8785 supplies the prerequisite dossier semantics.
  • Providers and platforms: declarations describe REA's Ghidra and Kuna adapters; per-function availability and runtime readiness remain separate.
  • Target selection, authority, cleanup, installation, generated metadata: no intentional change.

Expected effects of the existing workflow:

  • Read existing files or captured data.
  • Launch or attach to a process.

Evidence and regression coverage

  • Previously, real Kuna status reported the missing resolver but did not state that REA's Kuna adapter cannot report native def-use observations; a direct trace returned an unavailable-flow unknown.
  • Public MCP tests exercise supported, unknown, and unavailable declarations without a resolver, including direct partial traces and SDK-converted output-schema validation in compact and full profiles. Providers in these tests are simulated.
  • Status tests cover routed ownership, an unselected candidate, runtime resolver failure and an unsupported resolver host, preserving both failure and repair facts through grouped projections.
  • Real MCP sessions on macOS arm64 with Kuna 1.989 and Ghidra 12.1.4 reported respectively unavailable with the Kuna reason and supported from Ghidra. Both compact and full advertised output schemas and returned session responses validated with Ajv 2020. Separately, a Ghidra external function had no HighFunction, confirming that provider support is not a per-function guarantee.
  • Real provider checks cover the selected fixture and host only. Cross-provider failure combinations are simulated; no real mixed-provider session or other platform was verified. Context/token cost was not measured.

Automated review follow-up: repeated MCP cases now share file-owned SDK and assertion validators while sessions remain isolated. Assertions use structured support and provider identity, the resolver operation name, and direct trace behavior rather than prose fragments. A harmless guidance reword passed all six cases; changing the reported provider identity made four cases fail. The selected provider reason remains checked as caller-supplied data.

Validation performed

  • npm run test:focused -- src/application/binary/BinarySessionStatus.test.ts tests/boundary/mcp/nativeValueFlowAvailability.test.ts — 27 passed.
  • npm run check:ci:fast — typecheck, lint, formatting and module boundaries passed.
  • npm run docs:check — passed.
  • Real stdio MCP and JSON Schema 2020-12 controls — passed for both providers and both profiles as described above.

Main reconciliation follow-up

  • Follow-up: hosted static checks encountered the unformatted CLI help test introduced on main by fix(cli): stop restating schema defaults in help descriptions #9278. Merged main ac30fbd after style(test): format CLI help default annotations #9280 formatted that test; Node 24 npm run format:check passes. No unrelated local formatting change was added.

  • Merged main 0ecf3a4 and reconciled the trace with its newer source-retention owner: adapters without a retention session return capability_unavailable; a supported direct session still retains its existing partial-result guidance. Consolidated the Kuna unavailability reason at the capability owner.

  • On Node 24.22.1: 69 focused session, trace, and MCP tests passed; 39 Kuna-provider fixture tests passed; npm run check:fast and npm run docs:check passed. git diff --check passed.

  • The real provider checks recorded above were on the earlier PR revision; no real Ghidra or Kuna provider run was repeated after the merge. Hosted checks must run on the updated head.

Compatibility, safety, and release

  • Additive status properties and changed remediation; strict output consumers may need updated schemas. No new compatibility fallback.
  • Real coverage is limited to the macOS arm64 versions and fixture above; no target executable was run.
  • No package, installation, or target-mutation change.

Latest main reconciliation

Merged main at c928bb8. The independent-decompilation and native-value-flow facts are both retained through capability grouping and schema expansion. The focused session, MCP, and Kuna fixture suites passed (66 tests); a subsequent session suite with the new grouping regression passed (22 tests). These use simulated providers.

Current main refresh

Merged main at a67525cdf1; session status and value-flow MCP boundary tests passed (28 tests, simulated providers).

Author readiness

Human owner:

  • 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

  • The prerequisite PR and this focused outcome have been reviewed.
  • Material scope and authority questions are resolved.
  • Tests and documentation are adequate for the final diff.
  • The final diff and validation evidence have been checked.

@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge; no blocking issue was found.

Summary

Adds provider-owned native value-flow declarations and carries them through session capabilities and trace_native_values discovery.

  • Native value traces now show provider support and resolver guidance.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Provider declaration] --> B[Routed analyze_function capability]
  B --> C[Grouped session capabilities]
  C --> D[Expanded capability inventory]
  R[Resolver readiness] --> D
  D --> E[trace_native_values status and repair advice]
Loading

Reviews (6) · Last reviewed commit: "chore: integrate current main" · Reviewed by Greptile

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T17:49:33.833982Z 673a5f4 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.

Base automatically changed from codex/native-value-flow-absence to main November 4, 2026 18:32
@morluto
morluto enabled auto-merge (squash) November 7, 2026 18:17
@morluto
morluto merged commit 688dca3 into main Nov 7, 2026
52 of 54 checks passed
@morluto
morluto deleted the codex/value-flow-capability-experiment branch November 7, 2026 21:26
@morluto morluto added area: mcp MCP server, transport, and tool registration bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant