Skip to content

feat(schemas): Model Plane inference-provenance contracts (T7-1/T7-3/T7-4) - #240

Merged
mdheller merged 2 commits into
mainfrom
feat/t7-model-plane-schemas
Aug 2, 2026
Merged

feat(schemas): Model Plane inference-provenance contracts (T7-1/T7-3/T7-4)#240
mdheller merged 2 commits into
mainfrom
feat/t7-model-plane-schemas

Conversation

@mdheller

Copy link
Copy Markdown
Contributor

Tranche 7 — Model Plane, first schema drop

Implements T7-1, T7-3, T7-4 from the Model Plane spec v0.1 (§XIV). Authored against the current repo, not the spec's 2026-06-09 snapshot, so it reuses the existing Agent Machine / Model Carry family (InferenceProvider, ModelResidency, SourceOSModelCarryRef, ExternalModelProviderProfile, AgentMachineReceipt) rather than forking it.

Added

  • schemas/InferenceReceipt.json (T7-1) — per-completion provenance primitive.
  • schemas/EscalationDecision.json (T7-3) — governed tier / data-residency boundary crossing.
  • schemas/AdapterPromotionDecision.json (T7-4) — human-governed LoRA-adapter promotion.
  • Canonical examples, schemas/README.md family rows + recent-additions block, CHANGELOG.md entry, docs/adr/0015-model-plane-inference-provenance.md.

Governance is schema if/then teeth — verified to fire both ways

  • Off-device InferenceReceipt (sovereign_cluster/external_permitted) cannot validate without an authorizing capabilityLeaseRef + non-empty escalationChain (SEAM-015).
  • EscalationDecisioncannot be permitted without a grantRefandsensitivityCheck.result: pass; prompt-unanswered is the fail-closed resolution for non-interactive workloads (SEAM-015).
  • AdapterPromotionDecisioncannot be promoted without verified signature + per-event consent + all eval gates (incl. adversarialProbePassed) + named promotedBy + mandatory rollbackTargetDigest (SEAM-016/017).

Negative tests confirm each gate rejects the bad case and admits the good case.

Review hardening (optional, additive)

  • ledgerPrevHash on all three (append-only-ledger hash-chaining).
  • confidenceMethod on the receipt (the escalation trigger is self-reported).

Deferred to tracked issues (design decisions, not rammed through)

  • T7-2ModelManifest/AdapterManifest — overlaps SourceOSModelCarryRef; "AdapterManifest" collides with AdapterDescriptor.
  • T7-5 add inference_provider to AgentPassport.agent_class — the estate already models providers as the separate InferenceProvider object (apparent deliberate choice); a 6th host-process class is a core-ontology change (breaks EXPECTED_CLASSES, touches ADR-0014).

Validation run

  • ajv compile of all three (with sibling refs) — pass.
  • Examples validate against their schemas — pass.
  • scripts/check_duplicate_schema_ids.py — 338 unique $id, pass.
  • Negative/positive teeth tests — 8/8 pass.

Grant refs use the estate's urn:srcos:lease:, not the spec's illustrative urn:srcos:grant: (which does not exist).

⚠️ Do not auto-merge — awaiting Copilot review.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the first Model Plane inference-provenance schema tranche to sourceos-spec, introducing normative, validation-enforced contracts for per-completion receipts, governed escalation across residency/tier boundaries, and human-governed LoRA adapter promotion. This fits the repo’s role as the canonical contract/schema source by extending the existing Agent Machine / Model Carry vocabulary rather than forking it.

Changes:

  • Introduces three new Draft 2020-12 schemas: InferenceReceipt, EscalationDecision, and AdapterPromotionDecision.
  • Adds canonical JSON examples for each new schema.
  • Documents the design reconciliation and rollout via ADR-0015, plus catalog + changelog updates.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
schemas/README.mdAdds a “Recent additions” section for Tranche 7 Model Plane provenance types.
schemas/InferenceReceipt.jsonNew per-completion provenance receipt schema with SEAM-015 if/then gating.
schemas/EscalationDecision.jsonNew governed tier/residency boundary decision schema with fail-closed if/then rules.
schemas/AdapterPromotionDecision.jsonNew human-governed LoRA adapter promotion decision schema with promotion “teeth”.
examples/inference-receipt.jsonCanonical example instance for InferenceReceipt.
examples/escalation-decision.jsonCanonical example instance for EscalationDecision.
examples/adapter-promotion-decision.jsonCanonical example instance for AdapterPromotionDecision.
docs/adr/0015-model-plane-inference-provenance.mdADR capturing reuse vs. deferrals for T7 and schema-level governance constraints.
CHANGELOG.mdAdds an Unreleased entry describing the new Model Plane provenance contracts and examples.

Comment threadschemas/EscalationDecision.json Outdated
"sensitiveCategories": { "type": "array", "description": "Categories detected (e.g. pii, biometric, credential, health). A biometric detection forbids any crossing.", "items": { "type": "string" } }
}
},
"grantRef": { "type": ["string", "null"], "pattern": "^urn:srcos:lease:", "description": "AgentCapabilityLease URN authorizing the crossing to the target residency class. Null when no grant exists — in which case the verdict must be refused (enforced below)." },

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 03ad41e — renamed grantRefcapabilityLeaseRef across schema + example + ADR + CHANGELOG so both EscalationDecision and InferenceReceipt use one consistent name for the urn:srcos:lease: reference.

Comment on lines +62 to +68
"then": {
"required": ["capabilityLeaseRef", "escalatedFrom"],
"properties": {
"capabilityLeaseRef": { "type": "string" },
"escalationChain": { "minItems": 1 }
}
}

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 03ad41e — the off-device then now lists escalationChain in required (so minItems:1 actually fires) and tightens escalatedFrom to a non-null tier enum [T0,T1,T2,T3]. Added negative tests: an off-device receipt with a missing/empty escalationChain or escalatedFrom:null now rejects. Good catch — my original negative test only covered the missing-lease case.

…T7-4)
Add InferenceReceipt, EscalationDecision, and AdapterPromotionDecision atop
the existing Agent Machine / Model Carry family (InferenceProvider,
ModelResidency, SourceOSModelCarryRef, ExternalModelProviderProfile reused,
not restated). Governance is enforced as schema if/then teeth verified to
fire both ways: off-device receipt requires lease + escalation chain
(SEAM-015); permitted escalation requires grant + passing T0 sensitivity
check (SEAM-015); promoted adapter requires signature + consent + all eval
gates (incl. adversarial probe) + human promoter + rollback target
(SEAM-016/017). Optional ledgerPrevHash (hash-chain) and confidenceMethod
added as review hardening.
Defers T7-2 (ModelManifest/AdapterManifest vs SourceOSModelCarryRef +
AdapterDescriptor name collision) and T7-5 (inference_provider agent_class
vs deliberate separate-object InferenceProvider) to tracked issues; see
docs/adr/0015-model-plane-inference-provenance.md.
Copilot #2: InferenceReceipt off-device gate under-enforced — escalationChain
was not in the 'then' required list (minItems never fired if omitted) and
escalatedFrom could still be null. Now both are required+non-null for any
off-device (sovereign_cluster/external_permitted) receipt. Negative tests
added: missing/empty escalationChain and null escalatedFrom now all reject.
Copilot #1: unify field name — EscalationDecision.grantRef -> capabilityLeaseRef
to match InferenceReceipt for the same urn:srcos:lease: concept (schema +
example + ADR + CHANGELOG).
@mdheller
mdhellerforce-pushed the feat/t7-model-plane-schemas branch from 80f5043 to 03ad41eCompareAugust 2, 2026 18:17
@mdheller
mdheller merged commit 24f0044 into mainAug 2, 2026
7 checks passed
@mdheller
mdheller deleted the feat/t7-model-plane-schemas branch August 2, 2026 18:20
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mdheller