Add LLM tier and dossier primitives (LIP-0008)#1
Draft
danvoulez wants to merge 1 commit into
Draft
Conversation
- Add LlmTier - Add GrammarKind - Add Dossier - Add FrontierVerdict - Extend CapabilityManifest with allowed ingress tiers and grammars - Add tier/grammar matrix tests Tracks LIP-0008 (Proposed). Does not implement LIP-0008. Makes LIP-0008 representable in the type system. Option<BTreeSet<_>> on the new CapabilityManifest fields preserves the distinction between "legacy / unspecified" (None) and "explicitly allows nothing" (Some(empty)), so later admission patches can route each case correctly. Test: exhaustive 3 × 4 matrix on GrammarKind::admits. Lib tests unchanged (141/141, no regression). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes LIP-0008 representable in the constitutional-runtime type system. Does not implement LIP-0008. PR is intentionally Draft while LIP-0008 is Proposed.
What's in
src/tier.rsLlmTier(Mini/Operator/Translator/Frontier),GrammarKind(Operational/Strong/Dossier),GrammarKind::admits(&LlmTier)matrixsrc/dossier.rsDossier,FrontierVerdict,DecisionRequest,Candidate,GhostRecord— the only admissible shape crossing the Frontier boundarysrc/capability.rsCapabilityManifestextended withallowed_ingress_tiers: Option<BTreeSet<LlmTier>>+allowed_grammars: Option<BTreeSet<GrammarKind>>src/lib.rstests/tier_admission.rsGrammarKind::admitsDossierreuses existingEvidenceRecord(fromevidence.rs) andCostEnvelope(fromcapability.rs) — no duplication.What's NOT in (intentional Gate 2 discipline)
admission.rsis not modifiedLogLine-Foundation/engine, separate PR)This PR has exactly one talent: make the type exist. The lâmina fina.
Design note:
Option<BTreeSet<_>>The new fields are
Option<BTreeSet<_>>, notBTreeSet<_>:None= legacy / unspecified — legacy manifests deserialize cleanlySome(empty)= explicit policy that allows nothingSome(set)= explicit policyLater admission patches will treat these three cases differently.
#[serde(skip_serializing_if = "Option::is_none")]keeps wire format clean for current manifests.Test plan
cargo checkcleancargo test --lib→ 141/141 pass (no regression)cargo test --tests→ 1/1 (12 matrix assertions)cargo test --doc→ 1/1 (GrammarKind::admits docstring)Gates
🤖 Generated with Claude Code