Skip to content

fix(javascript): preserve uncertainty for unexamined sources - #7911

Merged
morluto merged 3 commits into
mainfrom
codex/fix-selected-source-comparison
Oct 29, 2026
Merged

morluto merged 3 commits into
mainfrom
codex/fix-selected-source-comparison

Conversation

@morluto

@morluto morluto commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #7393. Comparing a fully analyzed directory with a source-selected analysis no longer reports an identical excluded file as changed solely because its analysis metadata differs.

Problem and expected behavior

An excluded file retains its content digest but lacks the other analysis's parsed facts. That establishes file identity, not equality of unexamined analysis. Its comparison is now unknown with a coverage limitation; independently observed content or property changes still report changed.

Change and scope

The shared JavaScript application-version comparison excludes analysis-only file metadata from property comparisons when either side's source analysis is unavailable or incomplete. Retained observations and evidence are unchanged. Domain regressions cover selected, excluded, failed, and invalid-source cases; a CLI regression compares both input directions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: JavaScript application-version comparison projection, shared by the CLI and MCP consumers.
  • Contribution scope and maintainer decision: existing read-only analysis; no new capability or scope decision.
  • CLI and MCP contract: an uncertain comparison may now report unknown and coverage rather than a false property change; no schema change.
  • Provider and compatibility: built-in JavaScript application analysis; no external provider changes.
  • Evidence and provenance: original observations, source identity, and evidence remain available; analysis uncertainty is explicit.
  • Target selection and cleanup: respects the existing source selection, with no new target interaction or lifecycle.
  • Generated metadata, package, and installation: no changes.

Expected effects:

  • 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

The CLI regression analyzes a directory containing main.js and lib.js, compares full and main.js-selected evidence in both directions, and checks that lib.js has an exact digest match, unknown status, and coverage rather than a false property change. Domain tests also preserve reporting of independent observed changes and exercise JSON and unavailable analysis states. No direct MCP workflow or external provider was exercised.

  • 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/javascript/javascriptApplicationVersionUnavailableScopes.test.ts tests/acceptance/applications/applicationVersionSelectedSourceCli.test.ts — passed, 6 tests.
  • git diff --check — passed.
  • npm run check:fast and npm run lint — failed on duplicate join and createTestTempDirectory imports already present in tests/boundary/mcp/serverUnknownsMcp.test.ts on the base revision. The pre-push hook encountered the same failure; the push bypassed that hook to publish this draft.

Compatibility, safety, and release

Existing callers may see corrected status and dimensions for incompletely analyzed files; no migration or schema change. No real external provider or MCP workflow was tested. No package, process-authority, or installation changes.

Author readiness

Human owner: @morluto

  • 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.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

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

Summary

This PR keeps comparisons uncertain when source analysis is incomplete, without hiding observed file changes. The latest update uses package parsing results instead of JSON-module results for package.json.

  • JavaScript version comparisons mark unexamined matching files as unknown.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Matched files] --> B{Observed content or property change?}
  B -->|Yes| C[changed]
  B -->|No| D{Source analysis incomplete?}
  D -->|Yes| E[unknown with coverage limit]
  D -->|No| F[Apply remaining comparison checks]
Loading

Reviews (3) · Last reviewed commit: "fix(javascript): compare observed packag..." · Reviewed by Greptile

@morluto
morluto marked this pull request as ready for review October 28, 2026 21:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-28T23:44:09.920390Z e82c47b 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: 0fd2c231d5

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

@morluto
morluto merged commit 63f05d1 into main Oct 29, 2026
40 checks passed
@morluto
morluto deleted the codex/fix-selected-source-comparison branch October 29, 2026 01:25
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels 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 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Selecting one source makes version comparison mark an identical excluded file as changed

1 participant