Skip to content

Harden graph diagnostics and PHP publication semantics - #256

Merged
forhappy merged 3 commits into
mainfrom
agent/graphify-blind-spots
Aug 16, 2026
Merged

Harden graph diagnostics and PHP publication semantics#256
forhappy merged 3 commits into
mainfrom
agent/graphify-blind-spots

Conversation

@forhappy

@forhappy forhappy commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Complete the recommended graph-analysis priorities and preserve PHP semantics that the canonical v1 publisher previously lost:

  • Harden structural-gap and disconnected-component diagnostics for deterministic ordering, category-aware question selection, relation multiplicity, noise filtering, witness evidence, and exact omission accounting.
  • Publish the typed compass.graph-insights/1 projection in analysis.json, optional compass.orientation/2, GRAPH_REPORT.md, and the read-only MCP resource compass://graph-insights.
  • Persist and compare blind-spot IDs across immutable realizations with compass history blind-spots, including active/resolved findings and explicit missing-sidecar observations.
  • Preserve anonymous PHP functions and arrow functions as callable closure nodes.
  • Preserve exact PHP trait composition as mixes_in instead of collapsing it into implements.
  • Canonicalize file-node identities from portable source paths before coalescing, preventing empty ECMAScript files from producing identity collisions.

Root cause and impact

The PHP extractor and resolver already emitted closure declarations and exact trait-use evidence. The compass.graph/1 publication vocabulary did not recognize closure, so it quarantined those nodes and their relationships. It also normalized mixes_in to implements, losing the distinction between trait composition and interface conformance.

On the Laravel Framework corpus, the corrected publisher produces 57,202 nodes and 118,646 edges, including 9,227 closures and 1,110 mixes_in relationships, with zero publication omissions or identity collisions. The unchanged warm run reused all 3,083 files in 2.84 seconds and reproduced the identical graph hash.

Contract and behavior

  • Structural analysis remains a projection only: it does not add, remove, or rewrite graph edges.
  • Containment/import/definition wiring and file, concept, and JSON-key noise are excluded from topical-gap evidence; all graph edges remain available to the rest of Compass.
  • Parallel relations remain distinct in witness counts and deterministic output is invariant to relation input order.
  • Candidate pairs, witnesses, components, members, history items, and rendered outputs have explicit bounds and omission ledgers.
  • Orientation is versioned from compass.orientation/1 to compass.orientation/2; older orientation files must be regenerated.
  • The public code-graph schema remains compass.graph/1; closure and mixes_in are additive typed vocabulary entries.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --lib --bins --locked -- -D warnings
  • Scoped all-feature Clippy checks for the affected graph, model, query, core, history, output, CLI, and MCP crates
  • cargo test --workspace --lib --bins --locked
  • Focused graph publication, model validation, history, output, CLI, and MCP suites
  • ./scripts/qualify_code_graph_v1.sh --fixtures-only
  • Laravel Framework cold and deterministic warm extraction
  • sh scripts/check_product_boundary.sh
  • git diff --check

@forhappy
forhappy marked this pull request as ready for review August 16, 2026 03:32
@forhappy forhappy changed the title Add graph blind-spot diagnostics Harden graph diagnostics and PHP publication semantics Aug 16, 2026
@forhappy
forhappy merged commit 7707dcb into main Aug 16, 2026
14 checks passed
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.

1 participant