Skip to content

fix(diagnostics): separate external references from dangling edges - #3590

Closed
DevChiniwala wants to merge 1 commit into
Graphify-Labs:v8from
DevChiniwala:fix/2191-external-reference-diagnostics
Closed

DevChiniwala wants to merge 1 commit into
Graphify-Labs:v8from
DevChiniwala:fix/2191-external-reference-diagnostics

Conversation

@DevChiniwala

Copy link
Copy Markdown
Contributor

Summary

  • classify missing ref_* dependency targets separately from internal dangling endpoints
  • keep graph-health diagnostics actionable for malformed and internal missing IDs
  • expose the external-reference count in machine-readable and text reports

Fixes #2191

Validation

  • python -m pytest tests/test_multigraph_diagnostics.py tests/test_duplicate_annotation_edges.py tests/test_evidence_binding.py -q --tb=short — 48 passed
  • python -m ruff check graphify/diagnostics.py tests/test_multigraph_diagnostics.py — passed
  • graphify update . — completed on current v8; expected optional-parser warnings only

Compatibility

This adds external_reference_edges and narrows dangling_endpoint_edges to actionable missing endpoints. Existing malformed and internal missing targets remain classified as dangling.

Copilot AI lite review requested due to automatic review settings September 16, 2026 05:45

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@graphify-labs graphify-labs 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.

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.

Formal verification. No changes could be formally verified in this run.


Graphify review — findings

Splits edge diagnostics so that a ref_-prefixed target with a valid internal source counts as external_reference_edges (expected out-of-corpus dependencies) rather than as an actionable dangling_endpoint_edges. diagnose_extraction now emits the new count, and format_diagnostic_report renders it, defaulting to 0 for summaries that predate the field.

Worth a look

  • Changed public dangling_endpoint_edges semantics for ref_ targets — graphify/diagnostics.py:203 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 224 functions depend on the 47 functions this change touches.

Health — this change adds coupling hotspots:

  • new: dispatch_command() — 2 callers, 125 callees
  • new: diagnose_extraction() — 15 callers, 10 callees
  • new: test_poisoned_manifest_is_healed() — 0 callers, 6 callees

Verification — 224 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 141 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

4 of 283 test file(s) selected (1%) via static blast radius.

  • tests/test_corrupt_graph_json.py — impact
  • tests/test_duplicate_annotation_edges.py — impact
  • tests/test_evidence_binding.py — impact
  • tests/test_multigraph_diagnostics.py — impact, changed-test

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

Formal verification

Could not verify: Could not verify diagnose\_extraction.

The verifier did not have enough to check diagnose\_extraction, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: no capturable inputs from the test suite; property tier: not verifiable: all 6 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly NameError — names the real obstacle, not a sampling gap)

Could not verify: Could not verify format\_diagnostic\_report.

The verifier did not have enough to check format\_diagnostic\_report, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: no capturable inputs from the test suite; property tier: not verifiable: all 6 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly KeyError — names the real obstacle, not a sampling gap)

· 3 more finding(s) on lines outside this diff (see the check run).

@safishamsi

Copy link
Copy Markdown
Member

Shipped in v0.9.64 (on PyPI). Cherry-picked with authorship preserved so it shows under your GitHub contributions. Thanks @DevChiniwala!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

diagnose_extraction counts external-package import refs (ref_*) as dangling edges — false "graph may be incomplete/corrupt" warning on JS/TS projects

3 participants