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
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: validate validate-control-plane-examples validate-nlboot-examples
.PHONY: validate validate-control-plane-examples validate-nlboot-examples validate-lattice-data-governai-examples

validate: validate-control-plane-examples validate-nlboot-examples
validate: validate-control-plane-examples validate-nlboot-examples validate-lattice-data-governai-examples
@echo "OK: validate"

validate-control-plane-examples:
Expand All @@ -10,3 +10,7 @@ validate-control-plane-examples:
validate-nlboot-examples:
python3 -m pip install --user jsonschema >/dev/null
python3 tools/validate_nlboot_examples.py

validate-lattice-data-governai-examples:
python3 -m pip install --user jsonschema >/dev/null
python3 tools/validate_lattice_data_governai_examples.py
40 changes: 40 additions & 0 deletions examples/annotation_set.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"id": "urn:srcos:annotation-set:community_truth_demo_labels",
"type": "AnnotationSet",
"specVersion": "2.0.0",
"name": "Community Truth Demo Labels",
"description": "Synthetic factuality and fallacy labels for a governed training/evaluation path.",
"subjectRefs": ["urn:srcos:data-product:community_truth_demo"],
"labelingProjectRef": "urn:srcos:labeling-project:community_truth_demo",
"annotations": [
{
"annotationId": "ann-001",
"targetRef": "urn:srcos:content:demo-article-001",
"label": "factuality",
"value": "supported",
"span": null,
"sourceRef": "urn:srcos:user:demo-reviewer",
"confidence": 0.88,
"createdAt": "2026-05-01T19:00:00Z"
},
{
"annotationId": "ann-002",
"targetRef": "urn:srcos:content:demo-article-001",
"label": "fallacy",
"value": "none-observed",
"span": { "start": 0, "end": 120 },
"sourceRef": "urn:srcos:user:demo-reviewer",
"confidence": 0.73,
"createdAt": "2026-05-01T19:01:00Z"
}
],
"governance": {
"trainingAllowed": true,
"evaluationAllowed": true,
"policyRef": "urn:srcos:policy:annotation-training-demo",
"licensePolicyRef": "urn:srcos:license-policy:demo-open-review",
"annotationReliabilityScore": 0.81
},
"derivedDatasetRefs": ["urn:srcos:dataset:community_truth_demo_training"],
"evidenceRef": "urn:srcos:evidence:community_truth_demo_annotations"
}
30 changes: 30 additions & 0 deletions examples/data_contract.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"id": "urn:srcos:data-contract:community_truth_demo",
"type": "DataContract",
"specVersion": "2.0.0",
"name": "Community Truth Demo Contract",
"description": "Contract for demo factuality and annotation-derived data product.",
"ownerRef": "urn:srcos:community:lattice-demo",
"schemaRefs": ["urn:srcos:schema:community_truth_demo_v1"],
"semanticRefs": ["urn:srcos:glossary:factuality", "urn:srcos:glossary:information-density"],
"allowedUses": {
"query": true,
"export": false,
"training": true,
"publication": true,
"notes": "Training use allowed only for governed demo models."
},
"sensitivity": "internal",
"freshness": {
"expectedInterval": "P1D",
"staleAfter": "P7D"
},
"qualityRef": "urn:srcos:quality-profile:community_truth_demo",
"retention": {
"policyRef": "urn:srcos:policy:demo-retention",
"minimumDays": 30,
"maximumDays": 365
},
"policyRef": "urn:srcos:policy:lattice-data-contract-demo",
"evidenceRefs": ["urn:srcos:evidence:community_truth_demo_contract"]
}
30 changes: 30 additions & 0 deletions examples/data_product.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"id": "urn:srcos:data-product:community_truth_demo",
"type": "DataProduct",
"specVersion": "2.0.0",
"name": "Community Truth Demo Data Product",
"description": "Demo data product for Lattice Studio/Data/GovernAI vertical slice.",
"ownerRef": "urn:srcos:community:lattice-demo",
"stewardRefs": ["urn:srcos:user:demo-steward"],
"resourceRefs": ["urn:srcos:asset:community_truth_demo_object_prefix"],
"datasetRefs": ["urn:srcos:dataset:health_obs"],
"contractRef": "urn:srcos:data-contract:community_truth_demo",
"qualityProfileRef": "urn:srcos:quality-profile:community_truth_demo",
"policyRef": "urn:srcos:policy:lattice-data-product-demo",
"licensePolicyRef": "urn:srcos:license-policy:demo-open-review",
"lineageRefs": ["urn:srcos:prov:community_truth_demo_ingest"],
"trust": {
"datasetTrustScore": 0.82,
"provenanceDepth": 3,
"reproducibilityScore": 0.77,
"scoreEvidenceRefs": ["urn:srcos:evidence:community_truth_demo_trust"]
},
"lifecycle": {
"state": "candidate",
"stateSince": "2026-05-01T19:00:00Z",
"deprecationNoticeRef": null
},
"consumerImpactRefs": [],
"evidenceRef": "urn:srcos:evidence:community_truth_demo_data_product",
"links": []
}
34 changes: 34 additions & 0 deletions examples/evaluation_bundle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"id": "urn:srcos:evaluation-bundle:community_truth_demo_model_eval",
"type": "EvaluationBundle",
"specVersion": "2.0.0",
"subjectRef": "urn:srcos:model:community_truth_demo_candidate",
"evaluationKind": "model",
"inputRefs": [
"urn:srcos:data-product:community_truth_demo",
"urn:srcos:dataset:community_truth_demo_evaluation"
],
"runtimeRef": "urn:srcos:runtime:lattice-python-ml-demo",
"metrics": [
{
"name": "factuality_f1",
"value": 0.84,
"status": "pass",
"threshold": 0.8,
"evidenceRef": "urn:srcos:evidence:eval-factuality-f1"
},
{
"name": "grounding_precision",
"value": 0.78,
"status": "warn",
"threshold": 0.8,
"evidenceRef": "urn:srcos:evidence:eval-grounding-precision"
}
],
"verdict": "needs-review",
"riskTier": "medium",
"evaluatedAt": "2026-05-01T19:05:00Z",
"evaluatorRef": "urn:srcos:agent:lattice-eval-demo",
"policyRef": "urn:srcos:policy:model-eval-demo",
"evidenceRefs": ["urn:srcos:evidence:community_truth_demo_model_eval"]
}
33 changes: 33 additions & 0 deletions examples/factsheet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": "urn:srcos:factsheet:community_truth_demo_model",
"type": "Factsheet",
"specVersion": "2.0.0",
"subjectRef": "urn:srcos:model:community_truth_demo_candidate",
"factsheetKind": "model",
"summary": {
"name": "Community Truth Demo Model",
"purpose": "Classify factuality and annotation quality for the Lattice demo path.",
"ownerRef": "urn:srcos:community:lattice-demo",
"limitations": [
"Synthetic demo fixture only",
"Not approved for production use"
]
},
"lineageRefs": [
"urn:srcos:data-product:community_truth_demo",
"urn:srcos:annotation-set:community_truth_demo_labels"
],
"evaluationRefs": ["urn:srcos:evaluation-bundle:community_truth_demo_model_eval"],
"risk": {
"riskTier": "medium",
"riskRefs": ["urn:srcos:risk:demo-factuality-classifier"]
},
"approval": {
"state": "needs-review",
"workflowRef": "urn:srcos:workflow:model-review-demo",
"decidedAt": "2026-05-01T19:06:00Z",
"decisionRef": null
},
"policyRefs": ["urn:srcos:policy:model-eval-demo"],
"evidenceRefs": ["urn:srcos:evidence:community_truth_demo_factsheet"]
}
27 changes: 27 additions & 0 deletions examples/publication_artifact.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"id": "urn:srcos:publication-artifact:community_truth_demo_report",
"type": "PublicationArtifact",
"specVersion": "2.0.0",
"title": "Community Truth Demo Reproducible Report",
"abstract": "Synthetic reproducible report package for the Lattice Studio/Data/GovernAI vertical slice.",
"authorRefs": ["urn:srcos:user:demo-author"],
"artifactRefs": {
"dataProductRefs": ["urn:srcos:data-product:community_truth_demo"],
"runtimeRefs": ["urn:srcos:runtime:lattice-python-ml-demo"],
"notebookRefs": ["urn:srcos:notebook-session:community_truth_demo"],
"modelRefs": ["urn:srcos:model:community_truth_demo_candidate"],
"promptRefs": []
},
"reproduction": {
"recipeRef": "urn:srcos:recipe:community_truth_demo_report",
"attemptRefs": ["urn:srcos:reproduction-attempt:community_truth_demo_report_001"],
"score": 0.74
},
"review": {
"state": "under-review",
"reviewThreadRefs": ["urn:srcos:review-thread:community_truth_demo_report"],
"decisionRef": null
},
"policyRefs": ["urn:srcos:policy:publication-review-demo"],
"evidenceRefs": ["urn:srcos:evidence:community_truth_demo_report"]
}
24 changes: 24 additions & 0 deletions examples/quality_profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"id": "urn:srcos:quality-profile:community_truth_demo",
"type": "QualityProfile",
"specVersion": "2.0.0",
"subjectRef": "urn:srcos:data-product:community_truth_demo",
"dimensions": [
{
"name": "completeness",
"score": 0.91,
"status": "pass",
"evidenceRef": "urn:srcos:evidence:quality-completeness"
},
{
"name": "freshness",
"score": 0.72,
"status": "warn",
"evidenceRef": "urn:srcos:evidence:quality-freshness"
}
],
"overallScore": 0.82,
"evaluatedAt": "2026-05-01T19:00:00Z",
"profileStatsRefs": ["urn:srcos:profile-stats:community_truth_demo"],
"lineageRefs": ["urn:srcos:prov:community_truth_demo_quality"]
}
58 changes: 58 additions & 0 deletions schemas/AnnotationSet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.srcos.ai/v2/AnnotationSet.json",
"title": "AnnotationSet",
"description": "A governed set of community, reviewer, or model annotations that can seed training and evaluation datasets.",
"type": "object",
"additionalProperties": false,
"required": ["id", "type", "specVersion", "subjectRefs", "labelingProjectRef", "annotations", "governance", "evidenceRef"],
"properties": {
"id": { "type": "string", "pattern": "^urn:srcos:annotation-set:" },
"type": { "const": "AnnotationSet" },
"specVersion": { "type": "string" },
"name": { "type": "string" },
"description": { "type": ["string", "null"] },
"subjectRefs": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
"labelingProjectRef": { "type": "string", "minLength": 1 },
"annotations": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["annotationId", "targetRef", "label", "sourceRef", "createdAt"],
"properties": {
"annotationId": { "type": "string", "minLength": 1 },
"targetRef": { "type": "string", "minLength": 1 },
"label": { "type": "string", "minLength": 1 },
"value": { "type": ["string", "number", "boolean", "null"] },
"span": {
"type": ["object", "null"],
"additionalProperties": false,
"properties": {
"start": { "type": "integer", "minimum": 0 },
"end": { "type": "integer", "minimum": 0 }
}
},
"sourceRef": { "type": "string", "minLength": 1 },
"confidence": { "type": "number", "minimum": 0, "maximum": 1 },
"createdAt": { "type": "string", "format": "date-time" }
}
}
},
"governance": {
"type": "object",
"additionalProperties": false,
"required": ["trainingAllowed", "evaluationAllowed", "policyRef"],
"properties": {
"trainingAllowed": { "type": "boolean" },
"evaluationAllowed": { "type": "boolean" },
"policyRef": { "type": "string", "minLength": 1 },
"licensePolicyRef": { "type": ["string", "null"] },
"annotationReliabilityScore": { "type": "number", "minimum": 0, "maximum": 1 }
}
},
"derivedDatasetRefs": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
"evidenceRef": { "type": "string", "minLength": 1 }
}
}
53 changes: 53 additions & 0 deletions schemas/DataContract.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.srcos.ai/v2/DataContract.json",
"title": "DataContract",
"description": "A governed contract for a DataProduct covering schema, semantics, freshness, quality, privacy, retention, and allowed use.",
"type": "object",
"additionalProperties": false,
"required": ["id", "type", "specVersion", "name", "schemaRefs", "ownerRef", "allowedUses", "sensitivity", "freshness", "qualityRef", "policyRef"],
"properties": {
"id": { "type": "string", "pattern": "^urn:srcos:data-contract:" },
"type": { "const": "DataContract" },
"specVersion": { "type": "string" },
"name": { "type": "string", "minLength": 1 },
"description": { "type": ["string", "null"] },
"ownerRef": { "type": "string", "minLength": 1 },
"schemaRefs": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
"semanticRefs": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
"allowedUses": {
"type": "object",
"additionalProperties": false,
"required": ["query", "export", "training", "publication"],
"properties": {
"query": { "type": "boolean" },
"export": { "type": "boolean" },
"training": { "type": "boolean" },
"publication": { "type": "boolean" },
"notes": { "type": ["string", "null"] }
}
},
"sensitivity": { "enum": ["public", "internal", "restricted", "sensitive", "regulated"] },
"freshness": {
"type": "object",
"additionalProperties": false,
"required": ["expectedInterval", "staleAfter"],
"properties": {
"expectedInterval": { "type": "string" },
"staleAfter": { "type": "string" }
}
},
"qualityRef": { "type": "string", "pattern": "^urn:srcos:quality-profile:" },
"retention": {
"type": "object",
"additionalProperties": false,
"properties": {
"policyRef": { "type": "string" },
"minimumDays": { "type": "integer", "minimum": 0 },
"maximumDays": { "type": ["integer", "null"], "minimum": 0 }
}
},
"policyRef": { "type": "string", "minLength": 1 },
"evidenceRefs": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }
}
}
Loading