fix: correct the P-row misuse and the basis tier ordering

Both from info-tech-canon's review of the restatement.

STRAIN 1 — credential custody was recorded as one unit of class P consumption.
P is purchased platform capacity, and using security.secrets buys none. Removed
the row; the relationship now sits in provisions[].uses_provisions alongside the
object-store dependency, marked explicitly as a proposed extension because
ITC-CAP declares no provision-to-provision relation. Filed as
info-tech-canon/demand/ProvisionRelationships.md (their commit ce17dc4).

BASIS TIERS — their point about invoiced being a fin-hub fact we name rather
than originate exposed a real bug: a strict list order made weakest(["invoiced",
"measured"]) return "measured", implying an invoice outranks a measurement. It
does not outside its own domain. Strength is now a tier — invoiced and measured
are peers, quoted below both — with ties broken deterministically by catalog
order without implying a difference that does not exist.

Also filed info-tech-canon/demand/EvidenceBasis.md at their request, proposing
ITC-GOV as owner rather than ITC-CAP.

187 tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
tegwick 2026-08-15 19:02:58 +02:00
parent 13c2b82281
commit b8081f6c2d
3 changed files with 146 additions and 42 deletions

View file

@ -30,31 +30,51 @@ BASIS_ORDER = (
"unknown", # no value exists
)
BASES = frozenset(BASIS_ORDER)
_RANK = {name: index for index, name in enumerate(BASIS_ORDER)}
# Strength is a tier, not a total order. `invoiced` and `measured` are peers:
# an invoice is the authoritative record of a payment, a measurement is the
# authoritative record of a quantity, and neither outranks the other outside
# its own domain. Asserting an order between them would make the weakest-input
# rule claim something it cannot know.
_TIER = {
"invoiced": 0, "measured": 0,
"quoted": 1,
"derived": 2,
"projected": 3,
"estimated": 4,
"assumed": 5,
"unknown": 6,
}
_ORDER = {name: index for index, name in enumerate(BASIS_ORDER)}
# Bases that assert an observed or contracted fact about the world.
EVIDENCED = frozenset({"invoiced", "measured", "quoted"})
def rank(basis: str) -> int:
if basis not in _RANK:
"""Strength tier; lower is stronger. Peers share a tier."""
if basis not in _TIER:
raise ValueError(f"unknown evidence basis {basis!r}")
return _RANK[basis]
return _TIER[basis]
def weakest(bases) -> str:
"""The weakest basis in a collection. Empty means nothing is known."""
"""The weakest basis in a collection. Empty means nothing is known.
Ties within a tier resolve by catalog order so the result is deterministic
without implying a strength difference that does not exist.
"""
bases = list(bases)
if not bases:
return "unknown"
return max(bases, key=rank)
return min(bases, key=lambda b: (-rank(b), _ORDER[b]))
def strongest(bases) -> str:
bases = list(bases)
if not bases:
return "unknown"
return min(bases, key=rank)
return min(bases, key=lambda b: (rank(b), _ORDER[b]))
def is_evidenced(basis: str) -> bool: