Documentation
¶
Overview ¶
Package modelresolveaudit is a static invariant audit that fails when a name-keyed model-registry lookup skips capability resolution.
A loop is spawned with whatever name a rule handed it — that name can be a CAPABILITY (coordinator/developer/reviewer), not a concrete endpoint. A raw reg.GetEndpoint(name) / reg.GetMaxTokens(name) / reg.Endpoints[name] lookup MISSES on a capability and silently returns wrong/zero endpoint accounting, limits, or provider — the #584 (cost-usd) / #594 (max_tokens) bug class. The invariant (model/registry.go ResolveEndpointName): every name-keyed lookup on the accounting/limit/aux paths MUST resolve the name through model.ResolveEndpointName (or reg.Resolve) first.
This audit is a heuristic go/ast scan over owned source. A lookup passes when its argument is provably a resolved name (an inline ResolveEndpointName/Resolve call, or a variable assigned from one earlier in the same function), or when the site carries an inline `// modelresolveaudit:allow <reason>` escape-hatch, mirroring internal/entityidaudit and internal/predicateaudit.
Index ¶
Constants ¶
const ( // SurfaceGetEndpoint marks a reg.GetEndpoint(name) call. SurfaceGetEndpoint = "go-call:GetEndpoint" // SurfaceGetMaxTokens marks a reg.GetMaxTokens(name) call. SurfaceGetMaxTokens = "go-call:GetMaxTokens" // SurfaceEndpointsIndex marks a reg.Endpoints[name] index expression. SurfaceEndpointsIndex = "go-index:Endpoints" )
Surface labels for the three name-keyed lookup shapes the audit detects.
Variables ¶
This section is empty.