Skip to content

cgis_drift: zero-match / no-signal domains report 'clean' instead of 'empty' (silent mis-targeted ontology passes green) #178

Description

@zaebee

Summary

A project_domain whose fqn_prefix matches zero nodes (or zero connected triples) currently returns drift_score: 0.0, status: "clean", empty census — indistinguishable from a genuinely healthy domain. A totally mis-targeted ontology therefore reports 100% green. Add a guard that marks such domains empty (not clean).

Reproduction (real, this session)

click ships its package under src/click/, so ingested FQNs are src.click.core, src.click.parser, … I wrote an ontology with fqn_prefix: "click.core" (the import name, not the ingest-relative FQN). Result:

EVERY domain → drift_score 0.0, status "clean", t_imports/t_calls all zeros, any_critical=false

The ontology measured nothing, yet the report was all-green. Fixing the prefix to src.click.* produced real censuses and warnings. The failure was silent — only a manual sqlite peek (select id from nodes where id like '%click.core%') revealed FQNs start with src..

This is the worst failure mode for a CI gate: it passes on an ontology that covers nothing.

Proposal

  • When a domain's selector matches 0 nodesstatus: "empty" + a message (fqn_prefix matched 0 nodes; did you mean 'src.click.core'? with closest-prefix suggestions).
  • When it matches nodes but 0 connected triples in every layer → status: "no_signal" (distinct from clean), so single-symbol or alias-only matches don't masquerade as healthy.
  • Make any_critical (or a new any_empty) reflect these so CI can fail on a broken ontology.

Closest-prefix suggestion overlaps with the symbol-search idea in #173.

Why it matters

Without this, a wrong fqn_prefix (very easy with src/-layout repos, monorepos, or renamed packages) silently disables drift while showing green. Drift can only be trusted as a gate if "matched nothing" is loud.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions