Skip to content

fix(native): accept declared facts in dispatch name inventory - #2906

Merged
morluto merged 1 commit into
morluto:mainfrom
ShitK:fix/native-dispatch-symbol-inventory
Oct 13, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
ShitK:fix/native-dispatch-symbol-inventory

Conversation

@ShitK

@ShitK ShitK commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #2564.

Accept declared symbol facts in the list_names fallback used by native dispatch inspection and UI action tracing. Previously, valid inventory records with these facts failed as unreadable_output.

Problem and expected behavior

The fallback's local strict schemas recognized only address and value (or legacy name), contradicting the existing inventory contract's optional fields. Valid provider results should reach symbol-based dispatch analysis; malformed inventory should still fail validation.

Change and scope

Reuse the canonical addressedValue schema with strict top-level validation, deriving the legacy name variant from the same schema. This removes the duplicated inventory definition while retaining rejection of undeclared top-level fields and malformed declared facts. Dispatch inference remains based on symbol names, with partial and unsupported coverage reported as before.

Contract and boundary impact

  • Semantic owner: the existing inventory contract; the changed stage is application validation of the list_names fallback.
  • Ordinary compatibility fix within existing scope; a separate maintainer scope decision is not applicable.
  • Public request/output schemas, provider protocols, target authority, provenance, and cleanup behavior are unchanged. No new target operations, generated outputs, package metadata, or installation changes are introduced.

Evidence and regression coverage

On base 7e3a19863835215491b55fba7127a78bad6a7709, the updated regression suite produced 4 failures and 24 passes, including an unreadable_output failure through the MCP SDK boundary.

Tests cover plain inventory, declared symbol facts with both value and legacy name, target/provider identity, conservative symbol-only coverage, and rejection of malformed fields in both dispatch inspection and UI tracing. The existing MCP fixture now supplies declared symbol facts to exercise both public tools.

Validation performed

macOS arm64, Node.js 24.18.0, npm 11.16.0:

  • Direct Vitest run of src/application/native/EnhancedNativeInvestigation.test.ts, tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts, and src/domain/native/objcSwiftMetadata.test.ts — 29 passed (26 + 2 + 1).
  • Touched-file lint and format checks, module boundaries (1,756 source files), architecture guards (1,321), and test discovery (1,108 test files) — passed.
  • Independent read-only diff review — no actionable findings.
  • Normal pre-commit checks and git diff --check — passed.
  • npm run knip — blocked by unresolved #javascript-analysis-worker, whose package import points to the missing compiled worker artifact. This also reproduces on the pristine base without build outputs.
  • npm run check — blocked by existing formatting failures in functionComparison.test.ts and IdaOperationRunner.ts.

The final full TypeScript check reports the same pre-existing errors as the base: SupportedClients.ts:542,744,809 rejects the devin format (TS2322), clientProfileLifecycle.test.ts:297 reports TS2345, and ghidraInventoryMcp.test.ts:4,17 has duplicate join imports (TS2300). These failures were independently reproduced on a pristine export of this exact base with the same runtime. Standard checks remain blocked. The normal pre-push hook failed on the unchanged duplicate join import; the branch was pushed with a one-command HUSKY=0 override.

Compatibility, safety, and release

No migration is needed. MCP coverage uses the actual SDK with an in-memory transport and simulated analysis port. Real Ghidra was unavailable locally (no JDK/Ghidra); no real-engine, compiled CLI, stdio, or CI verification is claimed. The issue's external live reproduction is not local verification. This fix was prepared with AI assistance.

Before merge

  • Focused fix linked to its issue, with regression coverage for both affected consumers and invalid input.
  • Canonical inventory validation and conservative coverage are preserved.
  • Standard checks and CI pass; resolve or re-evaluate the documented base failures.

@ShitK
ShitK marked this pull request as ready for review October 13, 2026 16:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-13T16:32:52.887498Z 76b563d Draft marked ready
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The changed code appears safe to merge, with no actionable defects found.

Summary

The PR fixes the list_names fallback by reusing addressedValue. Declared symbol facts now pass validation without changing name-based dispatch inference.

  • Native dispatch and UI traces accept declared symbol facts in name lists.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Dispatch inspection or UI trace] --> B{Native metadata available?}
  B -->|Yes| C[Use validated native metadata]
  B -->|No| D[list_names]
  D --> E[Strict addressedValue or legacy name schema]
  E -->|Invalid| F[AnalysisOutputError]
  E -->|Valid| G[Keep address and symbol name]
  G --> H[Name-based dispatch inference]
  H --> I[Preserve target and provider identity]
Loading

Reviews (1) · Last reviewed commit: "fix(native): accept declared facts in di..." · Reviewed by Greptile

@morluto
morluto merged commit 0c9ee56 into morluto:main Oct 13, 2026
3 of 5 checks passed
@morluto morluto mentioned this pull request Oct 13, 2026
3 tasks done
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto

morluto commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Thanks for #2906, @ShitK. Reusing the canonical inventory schema lets valid symbol facts reach native dispatch analysis while keeping strict validation for malformed records; addressing both dispatch inspection and UI tracing makes the fix complete across its consumers.

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

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(native): accept declared symbol facts in dispatch name inventory

2 participants