Phase 3 — Enforce trust tiers in capability registration and routing #298
Labels
No labels
blocked:children
blocked:commit-ready-failed
blocked:depends-231
blocked:depends-236
blocked:depends-237
blocked:depends-238
blocked:depends-239
blocked:gate-fetch
blocked:gate-fetch
blocked:gate-lint
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:no-procedure
blocked:preflight
blocked:verify-failed
bug
enhancement
feature-request
high-priority
in-progress
lint-cleanup
needs-decompose
needs-triage
ops-retry
ops-task
phase-5
quickfix
security/medium
self-building
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/mesh-seed#298
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source
tier/classas first-class fields on capability records and routing inputs.Goal
Carry
trust_tierthrough capability registration and make routing enforce the tier required by an intent/pathway. The substrate already hassubstrate/trust_tiers.pywithTrustTier(LOW/MEDIUM/HIGH) andTrustTierManager(resolve_tier, contract_requirement, calculate_required_tier, find_execution_tier, allows_contract). What's missing is the integration on the registry + router side so trust becomes a real gate, not just a hint.Scope
Registration — first-class
trust_tierfield on capabilitiestrust_tier(str | None) toPrimitiveRecordand to the canonical capability schema (schemas/capability.schema.json).PrimitiveRegistry._register_templateandregister(...)must validate the value (viaTrustTierManager.resolve_tier); unknown strings raise a clear error, not a silent default.trust_tierfield must continue to load (defaulting to a documented "unverified" value, e.g.TrustTier.LOWso they fail closed on stricter intents but remain routable on intents that don't require trust). Surface this default explicitly in the schema description and the field docstring.PrimitiveRecord.from_dict(record.to_dict())works whethertrust_tieris set or unset.Intent/Pathway — declared required tier
required_trust_tier(ormin_trust_tier) field to the intent schema (schemas/intent.schema.json) and document the convention for pathways (runtime/pathway_manager.py).TrustTierManager.intent_minimum_tieralready readsmin_trust_level/min_trust/trust_tierfrom intent dicts; extend it to also readrequired_trust_tierso both names work.LOW/none) — not silently bypass trust.Router — enforce, score, reject
runtime/intent_router.py::_route_standardalready callstrust_manager.calculate_required_tier(...)andfind_execution_tier(...); verify the trust-block path (reason=trust_level_unavailable) actually surfaces in_route_standard,_route_gpu, and any other routing entry point. Today it only runs in_route_standard— the GPU path and pathway path need the same gate.trust_tier, the router must NOT silently assume HIGH; it must treat the candidate asLOW(or the documented default) so a stricter intent still rejects it. This is the "no silent bypass" requirement.Tests (
tests/unit/)test_capability_registry_trust.py— registration with valid tier, invalid tier (raises), missing tier (loads as default), round-trip, schema validation.test_router_trust_enforcement.py— required-tier match routes, insufficient trust blocks withtrust_level_unavailable, missing metadata is treated as LOW, tie-break picks HIGH over LOW at equal score, GPU route also enforces trust, intent without tier + contract without requirement defaults consistently.test_trust_tiers.pyandtest_router.pyif any assertions change.Docs
docs/reference/TRUST_TIERS.md(or extend an existing reference) documenting:trust_tiers.py),trust_tier,Acceptance criteria
trust_tierand preserve backward compatibility for legacy records.Out of scope
substrate/trust_tiers.py.runtime/capability_watcher.pybeyond what schema changes require.mesh-seed#56umbrella tasks that are still open elsewhere.Reference
substrate/trust_tiers.py— existing tier definitions + manager.runtime/capability_registry.py— wrapsPrimitiveRegistry.runtime/primitive_registry.py—PrimitiveRecord+ template loader.runtime/intent_router.py—_route_standard,_route_gpu,_route_via_planner.runtime/pathway_manager.py— pathway spec (where required-tier should also surface).schemas/capability.schema.json+schemas/intent.schema.json— schemas.tests/unit/test_trust_tiers.py— existing tests to extend.