Skip to content

fix(comparison): qualify exact function text differences - #2088

Closed
Jax367 wants to merge 17 commits into
morluto:mainfrom
Jax367:codex/qualify-function-text-differences
Closed

Jax367 wants to merge 17 commits into
morluto:mainfrom
Jax367:codex/qualify-function-text-differences

Conversation

@Jax367

@Jax367 Jax367 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

compare_functions reports exact pseudocode differences without explaining that relocated addresses and generated names can account for them. Qualify both text dimensions, preserve the selected dimension's caveats in reconstruction verification and static/runtime correlation, and document how to read them alongside CFG comparisons. Refs #1947 (the documentation-first option in that design issue).

Problem and expected behavior

For example, FUN_00001010() versus FUN_00002010() produces pseudocode: changed even when only the function's location changed. The result should expose that exact-text limitation inline, so consumers do not treat a textual difference as proof of changed behavior.

Change and scope

  • Qualify pseudocode and assembly comparisons, including unresolved provider comparisons and bounded-diff failures.
  • Carry status and limitations together when selecting a function dimension for reconstruction verification or static/runtime correlation. Keep the Evidence envelope for whole-comparison caveats; an overall function claim includes all dimension limitations. Keep canonical example Evidence consistent with production.
  • Document unchanged CFGs as observed block-size/successor agreement, without claiming behavioral equivalence.
  • Preserve the existing exact statuses, digests, numeric constants, and eight dimensions. Address-normalized dimensions remain a separate design decision; this PR does not close [Design] Address-normalized text dimensions for compare_functions #1947.

Contract and boundary impact

  • Semantic owner and earliest changed stage: domain text comparison in functionComparisonDimensions.ts, and dimension selection in reconstruction verification/static-runtime correlation.
  • CLI and MCP/tool-catalog contract: existing result shape; additional limitation text only. compare_functions is an MCP tool.
  • Provider, bridge, target-format, or platform compatibility: no provider changes.
  • Evidence, artifact, provenance, or reconstruction contract: original input Evidence links, exact text digests and comparison statuses retained; result Evidence identity changes to include the new qualification.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: none; generated ignored documentation artifacts were checked locally.

Evidence and regression coverage

  • Tests updated: function comparison and static/runtime correlation domain tests, and the existing MCP reconstruction comparison journey. Verify qualifications on selected claims/correlations, no assembly/CFG caveat leakage into pseudocode, and aggregation only for an overall function claim. The correlation regression uses a producer-generated unknown CFG alongside usable text dimensions.

  • Base evidence: source-derived missing pseudocode qualification; a relocated-label fixture verifies exact text remains changed while CFG remains unchanged. The new inline-limitation assertions fail on the base revision.

  • User-visible MCP output: dimensions[].limitations states that exact provider text has no address/generated-name normalization and layout-only differences do not establish a behavior change.

  • Remaining proof gaps: no real Hopper, Ghidra or IDA run; this change consumes already-authenticated dossiers without executing a native provider.

  • 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

Executed on native Windows with Node 24.18.0 / npm 11.16.0:

  • npm run test:focused -- src/domain/functionComparison.test.ts tests/boundary/mcp/functionComparisonMcp.test.ts src/domain/staticRuntimeCorrelation.test.ts src/domain/reconstructionVerification.test.ts — 49 tests passed.
  • npm run check — all six tasks and architecture guards passed (existing lint warnings, zero errors).
  • npm run docs:check — all six tasks passed.
  • Compiled production stdio MCP probe with canonical function/process Evidence — qualification and source links verified through comparison, reconstruction verification and static/runtime correlation, including the absence of assembly-only caveats from pseudocode claims/correlations; exact statuses retained; connection closed normally.
  • git diff --check — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: native Windows domain/MCP checks; no native engine or browser run.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no new permissions, target execution, or persistent configuration.

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.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible 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 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-13T18:42:36.081245Z bdfe212 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e6e63d031

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef303832d5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/functionComparison.ts Resolved
@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issue remains.

Summary

The PR qualifies exact pseudocode and assembly comparisons without changing their statuses or digests.

  • Function text comparisons show when layout differences may explain a change.
  • Function verification claims carry the limitations of their comparison.
  • Static/runtime correlations carry caveats for the selected function dimension.
  • Comparison readers share one check for nested Evidence links.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Function source Evidence] --> B[compareFunctions]
  B --> C[Exact text status and dimension caveats]
  C --> D[Selected function dimension]
  D --> E[Reconstruction claim]
  D --> F[Static/runtime correlation]
  C --> G[All dimensions for overall claim]
  G --> E
  H[Whole-comparison caveats] --> E
  H --> F
Loading

Reviews (10) · Last reviewed commit: "Merge branch 'main' into codex/qualify-f..." · Reviewed by Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 14f241fe5b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b7f4f4ea7

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/domain/comparisonSourceEvidence.ts Resolved
@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open.

  1. thread 1

Handled in 8b7f4f4. The source-Evidence closure owner now validates every nested function dimension before either overall caveat aggregation or selected-dimension evaluation. Reconstruction verification and static/runtime correlation share assertComparisonFindingLinks; duplicate local closure implementations were removed. Imported overall comparisons cannot carry a caveat linked outside their envelope. The existing admitted-bundle regression now covers both selected and overall claims.

Source inspection and git diff --check completed. Tests, builds, typechecking, and lint were skipped at the user's explicit request.

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open.

  1. thread 1

Root cause: the changed-case fixture differs only in pseudocode, so pseudocode and overall fail while assembly and CFG pass. Corrected the existing MCP summary expectation to passed:2, failed:2, unknown:0 for changed, retaining passed:4 for unchanged. This fixes the expectation before the same integration case checks limitation scoping. Validation: inspected producing boundaries and affected consumers; targeted source formatting and git diff --check completed. Tests, typechecks, lint, builds, provider runs and CI reruns were not executed, per the user's explicit instruction. No directly related cleanup is deferred.

  1. thread 1

Root cause: changed-behavior parsing retained a second closure validator after the shared owner was introduced. Both function and artifact finding consumers now call assertComparisonFindingLinks from comparisonSourceEvidence, and the private assertNestedLinks implementation was removed. The existing malformed nested-link regression continues to cover the same error contract. Validation: inspected producing boundaries and affected consumers; targeted source formatting and git diff --check completed. Tests, typechecks, lint, builds, provider runs and CI reruns were not executed, per the user's explicit instruction. No directly related cleanup is deferred.

@morluto morluto added bug Something isn't working area: domain Domain logic, errors, and pure functions area: server Server layer and tool wiring P2: medium Medium priority issue labels Oct 13, 2026
morluto and others added 5 commits October 13, 2026 23:10
* fix(comparison): preserve incomplete function call evidence

Keep missing, unknown, partial and unresolved call relationships unknown in function comparisons and reconstruction claims. Aggregate IDA caller and callee coverage without overwriting uncertainty.

Validate with 144 focused tests, typecheck/lint, docs checks and test discovery. Real providers were not verified; the full headless IDA session suite requires unavailable Windows native controls.

* fix(comparison): recheck historical calls-only changes

---------

Co-authored-by: morluto <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f84707d63

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# Conflicts:
#	src/domain/reconstructionVerification.ts
@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open.

review thread

The function comparison branch already calls assertComparisonFindingLinks over every dimension’s nested links before selecting the requested dimension. I removed the second local subset check, so closure policy now stays with the shared owner and the caller only selects the parsed dimension. Targeted formatting and git diff --check passed; tests were not run under the wave instructions. Published at 58b0ac0.

review thread

Artifact comparison findings were passed to assertComparisonFindingLinks twice with the same flattened links. I removed the duplicate traversal and allocation, retaining one shared-owner closure check. Targeted formatting and git diff --check passed; tests were not run under the wave instructions. Published at 58b0ac0.

morluto added a commit that referenced this pull request Oct 14, 2026
Preserve XML and Interface Builder identity at their parsing boundary, retain usable Objective-C slots with precise coverage, and keep native trace failures distinct from absence. Add caller-selected Interface Builder summaries backed by complete retained Evidence, and preserve comparison limitations.

Reviewed fixes: #1969, #2088, #2108, #2513, #2639, #2684, #2731, #2759, #2875, #2888, #2889, #2970, #2971, #3002.

Validation: relevant native/domain focused lane passed 142 tests; earlier Interface Builder/MCP checks passed 24 tests. Real native UI and Ghidra producer coverage was not repeated.
@morluto morluto closed this in 80de314 Oct 14, 2026
@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

@Jax367, thanks for pointing out that exact pseudocode or assembly text changes can reflect relocated addresses and generated names. The comparison and its composed workflows now carry those caveats with the selected text dimension (main).

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

Labels

area: domain Domain logic, errors, and pure functions area: server Server layer and tool wiring bug Something isn't working P2: medium Medium priority issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Design] Address-normalized text dimensions for compare_functions

3 participants