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
- 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).
- 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).
- 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
Problem
PatternFingerprint.tangle_ratio(added in #241 / PR #241) isThe CALLS layer (
t_calls) is anormalized_censusover resolved intra-domainCALLS only — raw/unresolved calls (
raw_call:targets) never enter it. In a domainwhose calls are mostly raw/external, a single connected mutual triple (e.g. one
201)makes
t_calls≈ one-hot →tangle_mass≈ 0.67 → a hardgate_failedon very thinevidence.
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_v2calls term), precisely because resolved-calls evidence isunreliable when most calls are unresolved. The hygiene gate applies no such discount,
and
max()actively selects the worse (calls) layer.Impact
False-positive
gate_failedon small or low-resolution domains: a couple of resolvedmutual 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
max():max(tangle_mass(t_imports), discount * tangle_mass(t_calls))wherediscount = clip(1 − unresolved_ratio).(don't let a single connected triple fire a hard gate).
Self-drift is currently safe regardless (cgis-self max
tangle_ratiomeasured at0.0228 vs default
max: 0.25), so this is a robustness/noise fix, not a live breakage.Context
docs/specs/2026-06-13-tangle-anti-pattern-design.md.src/cgis/query/fingerprint.py::PatternFingerprint.tangle_ratio,src/cgis/query/triads.py::tangle_mass.