Skip to content

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

Merged
morluto merged 3 commits into
refactor/literal-trace-factsfrom
refactor/addressed-row-facts
Nov 15, 2026
Merged

morluto merged 3 commits into
refactor/literal-trace-factsfrom
refactor/addressed-row-facts

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Sixth step of ADR docs/adr/native/typed-operation-facts.md (sibling sweep): the remaining readers that parsed native inventory rows with addressedValueSchema directly now read listNamesFact/listProceduresFact through executeFact, and the architecture guard also rejects direct addressedValueSchema row parses. Stacked on #10894.

Problem and expected behavior

  • Same root cause as the four ADR readers, found by sweeping consumers: EnhancedTools (#allAddressed, #parseAddressed, #objcClasses), decompileAll (list_procedures), XrefsAddressResolution (list_names) and MCP prompt completion (list_procedures) each re-parsed the provider value, refusing with differing wording and no diagnostics or partial Evidence.
  • Expected: one parse per call through the named contract; reader-specific rules stay as steps over typed rows (xrefs refuses an empty address it could not pass back; decompileAll skips empty addresses and counts them as unaddressed; completion keeps its silent fallback on a malformed inventory).

Change and scope

  • src/application/EnhancedTools.ts: #allAddressed and #objcClasses use executeFact over #observed; #parseAddressed replaced by a pure addressedNames projection of typed rows.
  • src/application/decompileDirectory/decompileAll.ts, src/application/XrefsAddressResolution.ts: executeFact; the array check and per-row parse are removed.
  • src/server/promptCompletion.ts: parses the looked-up inventory with listProceduresFact.schema instead of a local pick schema.
  • scripts/verify/architecture-guards.mjs: the guard also matches z.array(addressedValueSchema…) and addressedValueSchema.safeParse|parse|pick.

Not included: addressedValueSchema.extend(...) in literalFeatureMatch.ts and nativeInventoryView.ts (they define output record shapes, not reads of provider results).

Contribution scope: not applicable (internal refactor).

Contract and boundary impact

  • Semantic owner and earliest changed stage: nativeOperationFacts.ts contracts and executeFact.
  • 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: output schemas unchanged. Malformed inventory refusals in these tools now use the shared reason (for example "Provider returned an invalid name inventory") with contract_issues and partial Evidence. Prompt completion now validates row symbol metadata like every other reader; a malformed inventory still yields no suggestions.
  • 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): xrefs fallback still triggers only on capability-unavailable list_names failures; a contract refusal is an output error and does not fall back.
  • 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: src/application/XrefsAddressResolution.test.ts (undeclared field accepted and resolved; malformed address refused with contract_issues; empty address refused at index 0).
  • Base reproduction or other evidence: source-derived.
  • User-visible CLI/MCP output (if applicable): refusal wording as above.
  • Remaining proof gaps: no real-provider run.

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 -- 35 files (src/application/EnhancedTools*.test.ts, src/application/native/**/*.test.ts, src/application/decompileDirectory/**/*.test.ts, and tests naming xrefs-name resolution, prompt completion or ObjC classes) — 611 passed
  • npm run test:local -- src/application/XrefsAddressResolution.test.ts — 3 passed
  • Review follow-up: npm run test:focused -- tests/boundary/mcp/promptCompletion.test.ts — 16 passed (new cases: valid symbol metadata plus an undeclared field completes; malformed symbol metadata returns no suggestions)
  • node scripts/verify/architecture-guards.mjs — passed
  • npm run check:fast — passed; npx knip --include exports,types,files — no findings; pre-commit and pre-push hooks passed

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not run.
  • 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-15T08:20:32.753430Z ac96f41 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 PR appears safe to merge, with the previous test gap addressed and no new actionable issues found.

Summary

Moves the remaining addressed-inventory readers to shared operation facts and extends the architecture guard against local row parsing.

  • Enhanced tools read name and procedure rows through shared contracts.
  • Xrefs name lookup validates rows through the shared name contract.
  • Decompile-all loads procedures through the shared inventory contract.
  • MCP completion checks procedure symbol metadata against the shared schema.

Reviews (2) · Last reviewed commit: "test(server): pin procedure completion t..." · Reviewed by Greptile

Comment thread src/server/promptCompletion.ts Resolved
@morluto
morluto merged commit 162bdb0 into refactor/literal-trace-facts Nov 15, 2026
1 check passed
@morluto
morluto deleted the refactor/addressed-row-facts branch November 15, 2026 08:27
morluto added a commit that referenced this pull request Nov 15, 2026
…ion 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 added a commit that referenced this pull request Nov 15, 2026
…ion 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 added a commit that referenced this pull request Nov 15, 2026
…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 added a commit that referenced this pull request Nov 15, 2026
…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 added a commit that referenced this pull request Nov 15, 2026
… fact contracts (#10883)

* refactor(native): read retained inventory views through the operation fact contracts

* refactor(native): read matching inventories through the operation fact contracts (#10887)

* refactor(native): read dispatch symbol fallbacks as lenient name facts 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 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