Skip to content

feat(catalog): SourceOS model/adapter catalog entry admission contract v0.1#19

Merged
mdheller merged 1 commit into
mainfrom
work/model-catalog-entry-v0
Jun 11, 2026
Merged

feat(catalog): SourceOS model/adapter catalog entry admission contract v0.1#19
mdheller merged 1 commit into
mainfrom
work/model-catalog-entry-v0

Conversation

@mdheller

Copy link
Copy Markdown
Member

Summary

  • Implements the ModelCatalogEntry admission contract from the SourceOS model/adapter catalog entry TypeScript spec
  • Python validator with all 7 admission gates, 35 tests, 3 example fixtures, JSON Schema, path-scoped CI workflow
  • make validate-model-catalog-entry wired into make validate — gated on every full validation run

Design decisions

TypeScript is the source of truth (contracts/sourceos/model-catalog-entry.v0.1.ts). The JSON Schema and Python validator are derived from it. The TypeScript file is the canonical contract document; the other files are implementations.

encrypted: true is a const, not a flag. The JSON Schema uses "const": true. The Python validator treats it as an admission invariant — encrypted: falsecontent_hash_mismatch. This is the Apple discipline: encryption-at-rest is identity, not a configuration option.

base_version_mismatch is structural at validation time, runtime at delivery time. The static validator checks that adapters declare a fully-specified base binding (non-empty IDs + valid sha256). The runtime check (comparing baseVersion against the currently-loaded base) lives at delivery and is not in scope here.

High-privilege requires declared permissions. highPrivilege: true with empty requiredPermissionscapability_not_granted. guardrail-fabric has nothing to check against without an explicit permission surface.

All denials are accumulated. Multiple failures produce multiple denial reasons. No early exit — the full set is surfaced in AdmissionResult.denials.

Admission gates (all hard — single failure denies)

Gate Denial reason Trigger
Content hash content_hash_mismatch Non-64-char-hex hash, encrypted≠true, or payload hash divergence
Attestation attestation_invalid Empty signer, signature, or hash-chain
Base binding base_version_mismatch Adapter/steering/guardrail with missing/empty base IDs or invalid base hash
Capability capability_not_granted highPrivilege: true + empty requiredPermissions
Epistemic label missing_epistemic_label Absent or empty epistemicLevel
Epistemic rejected epistemic_rejected epistemicLevel: "rejected"
Steering diff steering_diff_unsupported steeringTier full/local + emitsSteeringDiff: false

Verification

make validate-model-catalog-entry
python3 -m pytest tools/tests/test_model_catalog_entry.py -v
# 35 passed

…t v0.1

Implements the ModelCatalogEntry admission contract for model-router.
Designed from forensic analysis of Apple Foundation Models delivery,
Claude Code/Codex lifecycle failures, and SourceOS differentiators
(SAE interpretability, SCOPE-D epistemic labeling, guardrail-fabric policy,
Ontogenesis ontologies, TriTRPC provenance wire).

Seven hard admission gates — a single failure denies, no silent admission:
  1. content_hash_mismatch  — sha256 format + payload verification; encrypted=true invariant
  2. attestation_invalid    — signer identity, signature, hash-chain (provenance anchor)
  3. base_version_mismatch  — adapters/steering/guardrail must declare exact base binding
  4. capability_not_granted — highPrivilege requires non-empty requiredPermissions
  5. missing_epistemic_label — SCOPE-D level required; no label = inadmissible
  6. epistemic_rejected     — retained for audit, never loadable
  7. steering_diff_unsupported — steeringTier full/local requires emitsSteeringDiff=true

Artifacts:
  contracts/sourceos/model-catalog-entry.v0.1.ts   — TypeScript source of truth
  schemas/model-catalog-entry.v0.1.schema.json     — JSON Schema (draft-07)
  examples/model-catalog-entry.admitted.json       — valid admitted entry
  examples/model-catalog-entry.denied.epistemic-rejected.json
  examples/model-catalog-entry.denied.steering-diff-unsupported.json
  tools/validate_model_catalog_entry.py            — Python admission implementation
  tools/tests/test_model_catalog_entry.py          — 35 tests, all gates covered
  Makefile: validate-model-catalog-entry wired into make validate
  .github/workflows/model-catalog-entry.yml        — path-scoped CI
@mdheller mdheller merged commit 461ccc1 into main Jun 11, 2026
9 checks passed
Sign up for free to 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.

1 participant