Skip to content

tangle_ratio: discount the CALLS layer by unresolved_ratio (false gate_failed on sparse calls) #244

Description

@zaebee

Problem

PatternFingerprint.tangle_ratio (added in #241 / PR #241) is

tangle_ratio = max(tangle_mass(t_imports), tangle_mass(t_calls))

The CALLS layer (t_calls) is a normalized_census over resolved intra-domain
CALLS only — raw/unresolved calls (raw_call: targets) never enter it. In a domain
whose calls are mostly raw/external, a single connected mutual triple (e.g. one 201)
makes t_calls ≈ one-hot → tangle_mass ≈ 0.67 → a hard gate_failed on very thin
evidence.

This is inconsistent with the rest of the drift machinery: the drift-distance path
deliberately fades the calls layer via the confidence discount (1 − unresolved_ratio)
(_clip_discount, _score_v2 calls term), precisely because resolved-calls evidence is
unreliable when most calls are unresolved. The hygiene gate applies no such discount,
and max() actively selects the worse (calls) layer.

Impact

False-positive gate_failed on small or low-resolution domains: a couple of resolved
mutual helper calls forming one connected triple trips the gate even though the domain's
call graph is mostly unmeasured. This is exactly the kind of low-confidence noise the
discount exists to suppress (cf. the guardian noise lessons).

The IMPORTS layer is reliable (resolved via import_map), so import-side tangle is fine;
the issue is specifically the CALLS layer feeding a hard gate undiscounted.

Options to consider

  1. Apply the confidence discount to the calls-layer tangle before the max():
    max(tangle_mass(t_imports), discount * tangle_mass(t_calls)) where
    discount = clip(1 − unresolved_ratio).
  2. Add a minimum-triad-count floor on a layer before its tangle can trip the gate
    (don't let a single connected triple fire a hard gate).
  3. Some combination — discount + floor.

Self-drift is currently safe regardless (cgis-self max tangle_ratio measured at
0.0228 vs default max: 0.25), so this is a robustness/noise fix, not a live breakage.

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions