Add first-consumer model request and result contract - #36
Draft
mark-e-deyoung wants to merge 17 commits into
Draft
Add first-consumer model request and result contract#36mark-e-deyoung wants to merge 17 commits into
mark-e-deyoung wants to merge 17 commits into
Conversation
This was referenced Sep 1, 2026
This was referenced Sep 4, 2026
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.
Purpose
Implements #35 as the missing versioned request/result boundary between exact native materialization and qualification receipt binding.
The first-consumer receipt binds
request.digest, and the changed-envelope gate compares request digests. This PR makes that identity concrete without implementing a general planner.Request v1
The request contains only project requirement facts:
Provider/model/acquisition/token/local-handle fields are rejected as invalid request fields. Allowed runtime/representation/quantization arrays are canonicalized so input ordering does not change request identity.
Result v1
Exactly one status:
qualified— stable exact selection + retained qualification subject/record;candidate— stable exact proposed selection, explicitly not qualified;unknown— unresolved deterministic knowledge with reason(s), no fake selection;rejected— deterministic rejection with reason(s), no fake selection.A selection now binds only stable chosen-artifact facts: provider, repository, immutable source revision, representation/quantization, runtime ID, and target profile. Provider-observation digests/refs belong in the existing result
evidencearray rather than selection identity.2026-09-04 provider-identity correction
Cross-contract red-team found that
selection.artifact.observation_digestimported observation-event identity into the stable selection. Because a normalized observation may change on metadata recapture while the exact immutable provider revision does not, this could perturb retained binding content without any actual model selection change.The correction removes that redundant field rather than adding a new artifact-identity framework. V1 remains conservative across different immutable provider revisions.
Identity
request_digest = sha256(canonical normalized request JSON).Changing target, offline policy, runtime, representation, quantization, quality policy, or any declared envelope limit changes the digest. Wall clock/storage location is absent from the request identity.
Fixture warning
The numeric envelope values in the committed KV-Ground-shaped request fixture are contract-test values only, not approved first-consumer resource/performance thresholds. The real envelope and measurement procedure must be frozen separately before observing candidate performance.
Included
schemas/model-request-v1.schema.jsonschemas/model-plan-result-v1.schema.jsontools/model_request_contract.pyDeliberate non-goals
No model ranking, catalog/database, provider discovery, target scanner, Generator–Validator implementation, model acquisition, consumer runtime mutation, or private target/workload data.
Stack
impl/issue-29-hf-native-materializationat7380395be39934407565edb8717eb56afb77f728;0ac14c7e477f830cc23554a674517f0170020ecb;R4
Canonical, offline, byte-repeatable, no runtime/provider side effects, independently reversible, and provider-observation recapture does not alter stable selection identity.
Related: #18, #19, #31, #33, #35, #37; draft PRs #30/#32/#38/#34;
SemperSupra/desktop-ui-cv#35.