Skip to content

fix(javascript): keep source-to-bundle coverage unknown when an input's coverage is unknown - #11162

Merged
morluto merged 1 commit into
refactor/coverage-status-joinfrom
refactor/source-bundle-coverage-unknown
Nov 15, 2026
Merged

morluto merged 1 commit into
refactor/coverage-status-joinfrom
refactor/source-bundle-coverage-unknown

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

compare_source_to_bundle reported coverage.status: "partial" whenever the historical source inventory or the Application Graph coverage was not complete, including when one of them was unknown (or the graph's unavailable). Partial claims a known gap. When an input cannot tell what it covered, the comparison cannot either. The comparison now reports unknown in that case, through a shared joinCoverageStatus fold where unknown wins.

Stacked on #11134 (adds src/domain/coverage.ts). W6 step 2, first per-domain migration. No linked issue.

Problem and expected behavior

  • Trigger: compare_source_to_bundle with a HistoricalSourceGraph whose inventory_state is unknown, or graph Evidence whose coverage status is unknown or unavailable.
  • Before: coverage.status: "partial".
  • After: coverage.status: "unknown". Complete plus complete still gives complete-within-inputs. Partial with complete or partial still gives partial. Unknown beside partial gives unknown.

Change and scope

  • src/domain/coverage.ts: joinCoverageStatus(parts) takes at least one status. Any unknown gives unknown, then any partial gives partial, otherwise complete.
  • src/domain/javascript/sourceToBundleComparison.ts: coverageStatus folds the reference inventory and graph coverage (graph unavailable is read as unknown) through joinCoverageStatus, and maps complete to the existing complete-within-inputs wire value.
  • src/domain/javascript/sourceToBundleComparisonSchemas.ts: the result coverage.status enum adds unknown and describes when each value applies.
  • Not included: the other complete-within-inputs comparison vocabularies (JavaScript version, export shape, runtime reconciliation, WASM interface). Each needs its own PR.

Contribution scope: ordinary fix within existing boundaries; not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: coverageStatus in sourceToBundleComparison.ts produces the status. Consumers are the source-to-bundle analysis view (sourceToBundleView.ts, which passes source_coverage through) and the workflow Evidence (pass-through). Per-item classification was already unchanged: it uses absenceClaimable and keeps items unknown.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: additive output value: compare_source_to_bundle coverage.status may now be "unknown". Clients should treat it as not complete. Retained comparison Evidence from earlier versions still parses.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: the comparison no longer asserts a known gap when an input reported that it could not tell. reference_inventory_state and application_graph_status are unchanged.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: the advertised output schema gains one enum value and a description; CI regenerates the catalog.

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: sourceToBundleComparison.test.ts "source to bundle coverage" covers five input pairs (unknown/complete, complete/unknown, complete/unavailable, partial/unknown, unknown/partial). The test fixtures now accept unknown inventories and unknown or unavailable graph coverage.
  • Base reproduction or other evidence: executed. With the base sourceToBundleComparison.ts restored, all 5 new cases fail (they receive partial); with the change, 30 of 30 pass.
  • User-visible CLI/MCP output (if applicable): "coverage": { "status": "unknown", "reference_inventory_state": "unknown", "application_graph_status": "complete", ... }.
  • Remaining proof gaps: no CLI/MCP workflow run; the projection is a pass-through.

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:local -- src/domain/javascript/sourceToBundleComparison.test.ts: 30 passed. With the base implementation file restored: 5 failed, 25 passed.
  • npm run test:local -- src/application/analysisView/JavaScriptProvenanceViews.test.ts src/contracts/outputSchemaDefinitions.test.ts src/contracts/compactOutputSchema.test.ts: 24 passed
  • node scripts/verify/architecture-guards.mjs: passed
  • npm run check:fast: passed

Compatibility, safety, and release

  • Breaking changes or migration steps: none; additive output enum value.
  • 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

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T13:30:53.966860Z
We couldn’t complete this review. Comment @codex review to try again.
eb562d5 PR opened
ℹ️ 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

The comparison now reports unknown when either input cannot establish its coverage.

  • Source-to-bundle coverage stays unknown when an input cannot tell.

Reviews (1) · Last reviewed commit: "fix(javascript): keep source-to-bundle c..." · Reviewed by Greptile

@morluto
morluto merged commit f82da09 into refactor/coverage-status-join Nov 15, 2026
1 check passed
@morluto
morluto deleted the refactor/source-bundle-coverage-unknown branch November 15, 2026 13:33
morluto added a commit that referenced this pull request Nov 15, 2026
…r and ratchet local completeness enums (#11134)

* refactor(coverage): give the complete/partial/unknown status one owner and ratchet local completeness enums

* fix(verify): count chained local completeness enums and exclude detail levels

* fix(javascript): keep source-to-bundle coverage unknown when an input's coverage is unknown (#11162)
@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.

1 participant