Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ jobs:
run: make smoke
- name: Strict jsonschema validation of maturity record
run: python3 tools/validate_maturity.py schemas/repo-maturity.schema.json repo.maturity.yaml
- name: Negative fixtures (must be rejected)
run: python3 tools/run_negative_fixtures.py
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: validate validate-spine smoke carry
.PHONY: validate validate-spine validate-negative smoke carry

validate: validate-spine
python3 tools/validate.py
Expand All @@ -11,3 +11,6 @@ smoke:

carry:
python3 tools/emit_sourceos_carry.py > examples/sourceos-carry.graphlab.json

validate-negative:
python3 tools/run_negative_fixtures.py
54 changes: 54 additions & 0 deletions fixtures/invalid/functional-service.bad-function.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"schemaVersion": "functional-service.v1",
"service": {
"id": "graphlab.holmes.graph-pilot",
"name": "GraphLab Holmes Graph Pilot",
"ownerRepository": "SociOS-Linux/graphlab",
"status": "experimental",
"description": "Offline deterministic graph functional surface emitted by graphlab for governed promotion."
},
"function": "not-a-real-function",
"model": {
"modelRef": "urn:socioprophet:functional-model:graphlab:deterministic-graph:v0",
"adapterRefs": [],
"runtime": "python-stdlib-offline-smoke",
"mutableStatePolicy": "forbidden-in-sourceos"
},
"inputs": [
"graph/query",
"graph/corpus"
],
"outputs": [
"graph/features",
"ranking/candidates",
"evidence/smoke-receipt"
],
"evals": {
"required": true,
"references": [
"examples/smoke-input.json",
"examples/smoke-output.json",
"evidence/smoke-receipt.example.json"
],
"minimumPromotionGate": "candidate requires signed eval and dataset provenance"
},
"governance": {
"ledgerRequired": true,
"guardrailRequired": true,
"routingRequired": true,
"policyRefs": [
"SocioProphet/model-governance-ledger",
"SocioProphet/guardrail-fabric",
"SocioProphet/model-router",
"SocioProphet/holmes"
]
},
"sourceosCarry": {
"allowed": true,
"carriesMutableModelState": false,
"clientRefRequired": true,
"launchProfileRefs": [
"urn:srcos:model-carry:functional-service:graphlab-holmes-pilot"
]
}
}
53 changes: 53 additions & 0 deletions fixtures/invalid/functional-service.missing-schema-version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"service": {
"id": "graphlab.holmes.graph-pilot",
"name": "GraphLab Holmes Graph Pilot",
"ownerRepository": "SociOS-Linux/graphlab",
"status": "experimental",
"description": "Offline deterministic graph functional surface emitted by graphlab for governed promotion."
},
"function": "graph",
"model": {
"modelRef": "urn:socioprophet:functional-model:graphlab:deterministic-graph:v0",
"adapterRefs": [],
"runtime": "python-stdlib-offline-smoke",
"mutableStatePolicy": "forbidden-in-sourceos"
},
"inputs": [
"graph/query",
"graph/corpus"
],
"outputs": [
"graph/features",
"ranking/candidates",
"evidence/smoke-receipt"
],
"evals": {
"required": true,
"references": [
"examples/smoke-input.json",
"examples/smoke-output.json",
"evidence/smoke-receipt.example.json"
],
"minimumPromotionGate": "candidate requires signed eval and dataset provenance"
},
"governance": {
"ledgerRequired": true,
"guardrailRequired": true,
"routingRequired": true,
"policyRefs": [
"SocioProphet/model-governance-ledger",
"SocioProphet/guardrail-fabric",
"SocioProphet/model-router",
"SocioProphet/holmes"
]
},
"sourceosCarry": {
"allowed": true,
"carriesMutableModelState": false,
"clientRefRequired": true,
"launchProfileRefs": [
"urn:srcos:model-carry:functional-service:graphlab-holmes-pilot"
]
}
}
54 changes: 54 additions & 0 deletions fixtures/invalid/functional-service.mutable-carry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"schemaVersion": "functional-service.v1",
"service": {
"id": "graphlab.holmes.graph-pilot",
"name": "GraphLab Holmes Graph Pilot",
"ownerRepository": "SociOS-Linux/graphlab",
"status": "experimental",
"description": "Offline deterministic graph functional surface emitted by graphlab for governed promotion."
},
"function": "graph",
"model": {
"modelRef": "urn:socioprophet:functional-model:graphlab:deterministic-graph:v0",
"adapterRefs": [],
"runtime": "python-stdlib-offline-smoke",
"mutableStatePolicy": "forbidden-in-sourceos"
},
"inputs": [
"graph/query",
"graph/corpus"
],
"outputs": [
"graph/features",
"ranking/candidates",
"evidence/smoke-receipt"
],
"evals": {
"required": true,
"references": [
"examples/smoke-input.json",
"examples/smoke-output.json",
"evidence/smoke-receipt.example.json"
],
"minimumPromotionGate": "candidate requires signed eval and dataset provenance"
},
"governance": {
"ledgerRequired": true,
"guardrailRequired": true,
"routingRequired": true,
"policyRefs": [
"SocioProphet/model-governance-ledger",
"SocioProphet/guardrail-fabric",
"SocioProphet/model-router",
"SocioProphet/holmes"
]
},
"sourceosCarry": {
"allowed": true,
"carriesMutableModelState": true,
"clientRefRequired": true,
"launchProfileRefs": [
"urn:srcos:model-carry:functional-service:graphlab-holmes-pilot"
]
}
}
47 changes: 47 additions & 0 deletions fixtures/invalid/maturity.empty-owners.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
schemaVersion: repo-maturity.v1
repository: SociOS-Linux/graphlab
plane: socios-lab
status: experimental
canonicality: reference
owners: []
maturity:
level: M2
targetLevel: M3
evidence:
- README.md states lab purpose, lab-only boundary, and integration points.
- service-manifest/functional-service.v1.json conforms to functional-service.v1.
- lab.manifest.json enumerates 5 governed lab surfaces.
- make validate exits 0 (offline, deterministic).
- CI runs make validate + strict jsonschema validation on every push/PR.
validation:
commands:
- make validate
- make smoke
ciRequired: true
lastKnownStatus: passing
integrations:
- repository: SocioProphet/functional-model-surfaces
relationship: emits functional-service.v1 manifests
required: true
- repository: SocioProphet/model-governance-ledger
relationship: sends promotion evidence
required: true
- repository: SocioProphet/sociosphere
relationship: registers maturity/evidence status
required: true
- repository: SocioProphet/holmes
relationship: provides the graph functional surface to Holmes
required: false
- repository: SocioProphet/model-router
relationship: routable governed surface
required: false
- repository: SocioProphet/guardrail-fabric
relationship: guardrail policy enforcement
required: false
- repository: SourceOS-Linux/sourceos-model-carry
relationship: disabled-by-default SourceOS carry reference
required: false
nextActions:
- Add negative fixtures under fixtures/invalid/ (>=2 per schema) to reach M3.
- Wire promotion evidence into SocioProphet/model-governance-ledger.
- Register maturity record with SocioProphet/sociosphere workspace-inventory.
48 changes: 48 additions & 0 deletions fixtures/invalid/maturity.invalid-level.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
schemaVersion: repo-maturity.v1
repository: SociOS-Linux/graphlab
plane: socios-lab
status: experimental
canonicality: reference
owners:
- SociOS-Linux
maturity:
level: M9
targetLevel: M3
evidence:
- README.md states lab purpose, lab-only boundary, and integration points.
- service-manifest/functional-service.v1.json conforms to functional-service.v1.
- lab.manifest.json enumerates 5 governed lab surfaces.
- make validate exits 0 (offline, deterministic).
- CI runs make validate + strict jsonschema validation on every push/PR.
validation:
commands:
- make validate
- make smoke
ciRequired: true
lastKnownStatus: passing
integrations:
- repository: SocioProphet/functional-model-surfaces
relationship: emits functional-service.v1 manifests
required: true
- repository: SocioProphet/model-governance-ledger
relationship: sends promotion evidence
required: true
- repository: SocioProphet/sociosphere
relationship: registers maturity/evidence status
required: true
- repository: SocioProphet/holmes
relationship: provides the graph functional surface to Holmes
required: false
- repository: SocioProphet/model-router
relationship: routable governed surface
required: false
- repository: SocioProphet/guardrail-fabric
relationship: guardrail policy enforcement
required: false
- repository: SourceOS-Linux/sourceos-model-carry
relationship: disabled-by-default SourceOS carry reference
required: false
nextActions:
- Add negative fixtures under fixtures/invalid/ (>=2 per schema) to reach M3.
- Wire promotion evidence into SocioProphet/model-governance-ledger.
- Register maturity record with SocioProphet/sociosphere workspace-inventory.
8 changes: 4 additions & 4 deletions repo.maturity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ canonicality: reference
owners:
- SociOS-Linux
maturity:
level: M2
targetLevel: M3
level: M3
targetLevel: M4
evidence:
- README.md states lab purpose, lab-only boundary, and integration points.
- service-manifest/functional-service.v1.json conforms to functional-service.v1.
- lab.manifest.json enumerates 5 governed lab surfaces.
- make validate exits 0 (offline, deterministic).
- CI runs make validate + strict jsonschema validation on every push/PR.
- Negative fixtures under fixtures/invalid/ confirm the schemas reject malformed documents (CI-enforced).
validation:
commands:
- make validate
Expand Down Expand Up @@ -43,6 +44,5 @@ integrations:
relationship: disabled-by-default SourceOS carry reference
required: false
nextActions:
- Add negative fixtures under fixtures/invalid/ (>=2 per schema) to reach M3.
- Wire promotion evidence into SocioProphet/model-governance-ledger.
- Produce tagged releases with sha256 checksums / provenance attestation (M4).
- Register maturity record with SocioProphet/sociosphere workspace-inventory.
48 changes: 48 additions & 0 deletions tools/run_negative_fixtures.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env python3
"""M3 negative-fixture runner: every fixture under fixtures/invalid/ MUST be rejected
by its schema. Exits non-zero if any invalid document unexpectedly validates — that would
mean the schema/validator has regressed and could admit a malformed manifest."""
import json, os, sys, glob
import jsonschema
try:
import yaml
except Exception:
yaml=None

FS="schemas/functional-service.schema.json"
RM="schemas/repo-maturity.schema.json"

def load(p):
if p.endswith((".yaml",".yml")):
return None if yaml is None else yaml.safe_load(open(p))
return json.load(open(p))

def schema_for(p):
b=os.path.basename(p)
if b.startswith("functional-service"): return json.load(open(FS))
if b.startswith("maturity"): return json.load(open(RM))
return None

def main():
fixtures=sorted(glob.glob("fixtures/invalid/*"))
if not fixtures:
print("FAIL: no negative fixtures found under fixtures/invalid/", file=sys.stderr); return 1
leaked=0
for p in fixtures:
s=schema_for(p)
if s is None:
print(f" SKIP (no schema mapping): {p}"); continue
d=load(p)
if d is None:
print(f" SKIP (pyyaml unavailable): {p}"); continue
try:
jsonschema.validate(d, s)
print(f" FAIL: {p} unexpectedly VALIDATED — schema too loose"); leaked+=1
except jsonschema.ValidationError as e:
print(f" OK rejected: {os.path.basename(p)} :: {e.message[:70]}")
if leaked:
print(f"{leaked} invalid fixture(s) passed validation", file=sys.stderr); return 1
print("OK: all negative fixtures correctly rejected"); return 0

if __name__=="__main__":
raise SystemExit(main())
Loading