Skip to content

refactor(native): read retained inventory views through the operation fact contracts - #10883

Merged
morluto merged 3 commits into
mainfrom
refactor/native-inventory-view-facts
Nov 15, 2026
Merged

morluto merged 3 commits into
mainfrom
refactor/native-inventory-view-facts

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Second step of ADR docs/adr/native/typed-operation-facts.md: the native inventory view reads retained list_*/search_* Evidence through the parent operation's named fact contract instead of its own copy of the row schemas. #10880 has merged; this PR now targets main and also carries the collapsed stack: #10887 (matching inventories, xrefs address resolution, literal tracing and decompile-all read their inventories through the operation fact contracts) and #10889 (dispatch-metadata symbol fallbacks read as lenient name facts at the port). See those PRs for their own scope and review.

Problem and expected behavior

  • nativeInventoryView built its readers from nativeInventoryRowsSchemas directly and chose names vs strings by an operation-name test, a second interpretation of which contract applies to which operation.
  • Expected: one reader per inventory operation, built from that operation's contract (listNamesFact, listProceduresFact, searchProceduresFact, listStringsFact, searchStringsFact), selected by the parent operation with exact types.

Change and scope

  • src/domain/analysisView/nativeInventoryView.ts: readInventory maps every NativeInventoryOperation to a cached view reader over its contract's schema (satisfies Record<NativeInventoryOperation, …>, so a new inventory operation without a reader fails typecheck). The direct schema import is removed.

Not included: anything beyond the readers above. Behavior is unchanged: each contract's schema is the schema this view used for that operation, so Evidence produced earlier still parses.

Contribution scope: not applicable (internal refactor).

Contract and boundary impact

  • Semantic owner and earliest changed stage: nativeOperationFacts.ts contracts; the view consumes them.
  • Contribution scope fit and linked maintainer decision: ADR docs(adr): accept parsing native operation facts once at the operation port #10866 (accepted).
  • CLI and MCP/tool-catalog contract: unchanged.
  • Provider, bridge, target-format, or platform compatibility: unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: none; existing view coverage exercises every inventory operation's reader through MCP and the domain projection.
  • Base reproduction or other evidence: source-derived.
  • User-visible CLI/MCP output (if applicable): none.
  • Remaining proof gaps: none known for a schema-identical substitution.

For evidence-bearing changes:

  • 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

  • npm run test:focused -- src/domain/analysisView/nativeInventoryView.test.ts tests/boundary/mcp/nativeInventoryViewsMcp.test.ts tests/boundary/mcp/nativeViewPredicateMcp.test.ts — 12 passed
  • npm run check:fast — passed; pre-commit and pre-push hooks passed
  • After rebasing the combined stack onto main (d06f6cc): npm run check:fast — passed; node scripts/verify/architecture-guards.mjs --shrink-baselines — passed, no baseline change; npm run test:focused -- src/application/EnhancedLiteralTracing.test.ts src/application/XrefsAddressResolution.test.ts src/application/native/EnhancedNativeInvestigation.test.ts src/application/native/NativeDispatchMetadataInspection.fallback.test.ts — 50 passed

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: not applicable.

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

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • 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.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 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-15T09:23:00.544100Z 1576292 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.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge.

Summary

Routes native inventory readers through named operation contracts.

  • Retained inventory views use each operation’s own contract.
  • Literal tracing checks each search with its own result contract.
  • Name lookup checks inventory rows before using their addresses for xrefs.
  • Directory decompilation loads procedures through their named contract.
  • Native dispatch inspection accepts extra fields on valid name rows.
  • Enhanced tools read name inventories through their operation contracts.
  • Binary overview counts come from validated inventory facts.
  • Function matching reads name and procedure rows through their contracts.
  • Procedure prompt completion checks rows with the procedure contract.
  • The architecture check flags inventory parsers outside their contracts.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Provider["Provider execution"] --> Port["executeFact"]
  Contract["Named operation contract"] --> Port
  Port --> Fact["Typed rows for live readers"]
  Port --> Execution["Unchanged source execution"]
  Execution --> Evidence["Retained Evidence"]
  Evidence --> Reader["Cached reader for parent operation"]
  Contract --> Reader
  Reader --> View["Inventory view"]
Loading

Reviews (3) · Last reviewed commit: "refactor(native): read dispatch symbol f..." · Reviewed by Greptile

@morluto
morluto force-pushed the refactor/native-operation-fact-port branch from 0615298 to 5e5f9f4 Compare November 15, 2026 08:49
@morluto
morluto force-pushed the refactor/native-inventory-view-facts branch from 2f49d21 to c6340b4 Compare November 15, 2026 08:50
@morluto
morluto changed the base branch from refactor/native-operation-fact-port to main November 15, 2026 08:59
…s at the port (#10889)

* refactor(native): read dispatch symbol fallbacks as lenient name facts at the port

* test(native): accept undeclared name-row fields in both dispatch consumers

* refactor(native): read literal searches and overview counts as operation facts (#10894)

* refactor(native): read literal searches and overview counts as operation facts

* refactor(native): read addressed inventory rows as operation facts in every reader (#10899)

* refactor(native): read addressed inventory rows as operation facts in every reader

* test(native): cover xrefs name resolution through the name fact contract

* test(server): pin procedure completion to the procedure inventory contract
@morluto
morluto force-pushed the refactor/native-inventory-view-facts branch from 7c6fa3f to 1576292 Compare November 15, 2026 09:21
@morluto
morluto merged commit 85df219 into main Nov 15, 2026
6 of 8 checks passed
@morluto
morluto deleted the refactor/native-inventory-view-facts branch November 15, 2026 09:24
@morluto morluto added the area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior label Nov 22, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant