Skip to content
Closed
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,8 +1,12 @@
.PHONY: validate validate-control-plane-examples validate-nlboot-examples validate-lattice-data-governai-examples validate-ops-history-examples validate-runtime-observability-examples validate-interpretability-examples validate-lifecycle-boundary-examples validate-svf-contracts validate-sync-cycle-receipts validate-onboarding-examples validate-runtime-causality-examples validate-agentic-os-examples validate-triparty-examples validate-labor-market-examples validate-supply-chain-risk-examples validate-reasoning-examples
.PHONY: validate validate-control-plane-examples validate-nlboot-examples validate-lattice-data-governai-examples validate-ops-history-examples validate-runtime-observability-examples validate-interpretability-examples validate-lifecycle-boundary-examples validate-svf-contracts validate-sync-cycle-receipts validate-onboarding-examples validate-runtime-causality-examples validate-agentic-os-examples validate-triparty-examples validate-labor-market-examples validate-supply-chain-risk-examples validate-reasoning-examples validate-pattern-warrant-examples

validate: validate-control-plane-examples validate-nlboot-examples validate-lattice-data-governai-examples validate-ops-history-examples validate-runtime-observability-examples validate-interpretability-examples validate-lifecycle-boundary-examples validate-svf-contracts validate-sync-cycle-receipts validate-onboarding-examples validate-runtime-causality-examples validate-agentic-os-examples validate-triparty-examples validate-labor-market-examples validate-supply-chain-risk-examples validate-reasoning-examples
validate: validate-control-plane-examples validate-nlboot-examples validate-lattice-data-governai-examples validate-ops-history-examples validate-runtime-observability-examples validate-interpretability-examples validate-lifecycle-boundary-examples validate-svf-contracts validate-sync-cycle-receipts validate-onboarding-examples validate-runtime-causality-examples validate-agentic-os-examples validate-triparty-examples validate-labor-market-examples validate-supply-chain-risk-examples validate-reasoning-examples validate-pattern-warrant-examples
@echo "OK: validate"

validate-pattern-warrant-examples:
python3 -m pip install --user jsonschema >/dev/null
python3 tools/validate_pattern_warrant_examples.py

validate-reasoning-examples:
python3 -m pip install --user jsonschema >/dev/null
python3 tools/validate_reasoning_examples.py
Expand Down
69 changes: 69 additions & 0 deletions examples/candidate-manifest.c2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"id": "urn:srcos:manifest:reconcile-invoices-c2-001",
"type": "CandidateManifest",
"specVersion": "SP-PATT-WARR-001/0.1.0",
"patternRef": "urn:srcos:pattern:invoice-reconciliation-request",
"consequenceClass": "C2",
"capabilities": [
{
"capability": "ledger.read",
"scope": { "namespace": "finance/ledger" },
"minConsequenceClass": "C0"
},
{
"capability": "ledger.reconcile",
"scope": { "namespace": "finance/ledger", "reversible": true },
"minConsequenceClass": "C2"
}
],
"evidenceSetDigest": "sha256:2f0c9d1a6b4e8c7f5a3b2d1e0f9c8b7a6d5e4c3b2a1908f7e6d5c4b3a2f1e0d9c",
"warrantAtDeclaration": {
"epistemicLevel": "BOUNDED",
"H": 0.31,
"k": 6,
"computedAt": "2026-07-21T09:00:00Z"
},
"falsificationRecord": {
"wouldFalsifyIf": [
"reconciliation applied to a non-matching invoice/ledger pair",
"a reconciled entry that is not internally reversible within the SoR"
],
"testsRun": [
{ "testId": "urn:srcos:test:recon-match-precondition", "verdict": "POS" },
{ "testId": "urn:srcos:test:recon-reversibility", "verdict": "POS" },
{ "testId": "urn:srcos:test:recon-cross-tenant-leak", "verdict": "ZERO" }
],
"nearMisses": [
"duplicate invoice id across two vendors nearly matched the wrong ledger row"
]
},
"consentExposure": {
"tokenCount": 41,
"revocableFraction": 0.62,
"maxSingleTokenContribution": 0.09
},
"attestations": [
{
"id": "urn:srcos:attestation:owner-sig-001",
"type": "AttestationAtom",
"specVersion": "SP-PATT-WARR-001/0.1.0",
"attestor": "urn:srcos:principal:mdheller",
"quorumRole": "owner",
"manifestRef": "urn:srcos:manifest:reconcile-invoices-c2-001",
"evidenceSetDigest": "sha256:2f0c9d1a6b4e8c7f5a3b2d1e0f9c8b7a6d5e4c3b2a1908f7e6d5c4b3a2f1e0d9c",
"signature": "ed25519:PLACEHOLDER_SIGNATURE_OWNER",
"attestedAt": "2026-07-21T09:15:00Z"
},
{
"id": "urn:srcos:attestation:reviewer-sig-001",
"type": "AttestationAtom",
"specVersion": "SP-PATT-WARR-001/0.1.0",
"attestor": "urn:srcos:principal:reviewer-a",
"quorumRole": "reviewer",
"manifestRef": "urn:srcos:manifest:reconcile-invoices-c2-001",
"evidenceSetDigest": "sha256:2f0c9d1a6b4e8c7f5a3b2d1e0f9c8b7a6d5e4c3b2a1908f7e6d5c4b3a2f1e0d9c",
"signature": "ed25519:PLACEHOLDER_SIGNATURE_REVIEWER",
"attestedAt": "2026-07-21T09:40:00Z"
}
]
}
47 changes: 47 additions & 0 deletions examples/warrant-lattice.default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"id": "urn:srcos:warrantlattice:default-v1",
"type": "WarrantLattice",
"specVersion": "SP-PATT-WARR-001/0.1.0",
"minW": {
"C0": "SPECULATIVE",
"C1": "EMPIRICAL",
"C2": "BOUNDED",
"C3": "PROVED"
},
"quorum": {
"C0": { "minAttestors": 1, "roles": ["owner"] },
"C1": { "minAttestors": 1, "roles": ["owner"] },
"C2": { "minAttestors": 2, "roles": ["owner", "reviewer"] },
"C3": { "minAttestors": 3, "roles": ["owner", "reviewer", "control"] }
},
"decayHalfLifeDays": {
"C0": 180,
"C1": 90,
"C2": 30,
"C3": 14
},
"hysteresis": {
"dwellUpDays": 7,
"dwellDownDays": 2,
"thetaUp": {},
"thetaDown": {}
},
"concentrationCaps": [
{
"ceiling": "EMPIRICAL",
"maxHerfindahl": null,
"minDistinctPrincipals": null
},
{
"ceiling": "BOUNDED",
"maxHerfindahl": 0.5,
"minDistinctPrincipals": 3
},
{
"ceiling": "PROVED",
"maxHerfindahl": 0.25,
"minDistinctPrincipals": 8,
"machineDerivedExempt": true
}
]
}
98 changes: 98 additions & 0 deletions fixtures/pattern-warrant/conformance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"spec": "SP-PATT-WARR-001",
"specVersion": "0.1.0",
"description": "§9 conformance vectors. Every implementing layer (L1-L7) MUST pass the vectors applicable to it. 'appliesTo' names the layers that must exercise the vector.",
"vectors": [
{
"id": "T1",
"title": "PROVED warrant without attestation does not grant",
"appliesTo": ["L2", "L4"],
"given": {
"warrant": "PROVED",
"consequenceClass": "C3",
"attestations": []
},
"expect": { "grant": false, "reason": "SP-PW-I1: no score authorizes; quorum unmet" }
},
{
"id": "T2",
"title": "Single-principal evidence capped at EMPIRICAL",
"appliesTo": ["L2"],
"given": {
"evidence": { "distinctPrincipals": 1, "volume": 100000, "H": 1.0 }
},
"expect": { "warrantCeiling": "EMPIRICAL", "reason": "§2.2 concentration cap" }
},
{
"id": "T3",
"title": "Consent revocation recomputes in O(1) token stats",
"appliesTo": ["L2", "L7"],
"given": {
"revoke": "topContributingToken",
"scorer": "decomposableAggregate"
},
"expect": {
"recomputeTouches": "O(revokedTokens)",
"withinSLA": true,
"reason": "SP-PW-R2 incremental sufficient statistics"
}
},
{
"id": "T4",
"title": "Decay past minW(C2) reduces ceiling to C1, abstains on C2 ops",
"appliesTo": ["L2", "L5", "L6"],
"given": {
"consequenceClass": "C2",
"warrantDecaysTo": "EMPIRICAL",
"operationRequires": "C2"
},
"expect": {
"ternary": "ZERO",
"ceilingClass": "C1",
"response": "AbstentionEvent",
"suspended": false,
"errorClass": false,
"reason": "§3.3 per-capability ceiling reduction, not suspension"
}
},
{
"id": "T5",
"title": "Attested NEG suspends and returns to declaration gate; attestations retained",
"appliesTo": ["L2", "L4", "L5"],
"given": {
"attestedVerdict": "NEG"
},
"expect": {
"suspended": true,
"returnedToDeclarationGate": true,
"attestationsDeleted": false,
"reason": "§3.3 NEG; §9 T5 monotone attestations"
}
},
{
"id": "T6",
"title": "Oscillating evidence at theta boundary does not flap the ceiling",
"appliesTo": ["L2"],
"given": {
"evidence": "oscillatingAtThetaBoundary"
},
"expect": {
"ceilingFlapping": false,
"reason": "§3.2 hysteresis dwell (d_up=7d, d_down=2d) honored"
}
},
{
"id": "T7",
"title": "ZERO is never serialized as NEG at PEP, log, or UI",
"appliesTo": ["L4", "L5", "L6"],
"given": {
"ternary": "ZERO"
},
"expect": {
"serializedAs": "ZERO",
"neverRenderedAs": "NEG",
"reason": "INVARIANT SP-PW-I2"
}
}
]
}
62 changes: 62 additions & 0 deletions schemas/AbstentionEvent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.srcos.ai/v2/AbstentionEvent.json",
"title": "AbstentionEvent",
"description": "SP-PATT-WARR-001 §3.3 corollary. Emitted when an operation requires a consequence class above the manifest's current ceiling. An abstention is NOT an error and NOT a denial: it is reduced authority under live uncertainty (ternary ZERO). INVARIANT SP-PW-I2: this event must never be serialized or surfaced as NEG/deny. It carries the W_p value and evidence-set digest that produced the abstention.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"type",
"specVersion",
"manifestRef",
"capability",
"requestedClass",
"ceilingClass",
"warrantAtDecision",
"ternary",
"evidenceSetDigest",
"decidedAt"
],
"properties": {
"id": {
"type": "string",
"pattern": "^urn:srcos:abstention:[A-Za-z0-9._~-]+$"
},
"type": {
"const": "AbstentionEvent"
},
"specVersion": {
"type": "string"
},
"manifestRef": {
"type": "string",
"pattern": "^urn:srcos:manifest:[A-Za-z0-9._~-]+$"
},
"capability": {
"type": "string",
"description": "The specific capability abstained on; ceiling reduction is per-capability (§4)."
},
"requestedClass": {
"enum": ["C0", "C1", "C2", "C3"]
},
"ceilingClass": {
"enum": ["C0", "C1", "C2", "C3"],
"description": "max{ c : minW(c) <= W_p } at decision time."
},
"warrantAtDecision": {
"enum": ["SPECULATIVE", "EMPIRICAL", "BOUNDED", "PROVED"]
},
"ternary": {
"const": "ZERO",
"description": "Abstention is the ZERO response by construction; never POS, never NEG."
},
"evidenceSetDigest": {
"type": "string"
},
"decidedAt": {
"type": "string",
"format": "date-time"
}
}
}
54 changes: 54 additions & 0 deletions schemas/AttestationAtom.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.srcos.ai/v2/AttestationAtom.json",
"title": "AttestationAtom",
"description": "SP-PATT-WARR-001 §5. A signed reviewer attestation contributing to the quorum Q(C). Monotone and never deleted: on NEG suspension (§3.3) prior attestations are retained, not removed (§9 T5). The signature binds evidenceSetDigest so evidence cannot be substituted post-attestation.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"type",
"specVersion",
"attestor",
"quorumRole",
"manifestRef",
"evidenceSetDigest",
"signature",
"attestedAt"
],
"properties": {
"id": {
"type": "string",
"pattern": "^urn:srcos:attestation:[A-Za-z0-9._~-]+$"
},
"type": {
"const": "AttestationAtom"
},
"specVersion": {
"type": "string"
},
"attestor": {
"type": "string",
"description": "PrincipalId of the reviewer."
},
"quorumRole": {
"type": "string",
"description": "Role slot this attestation fills within the required quorum Q(C)."
},
"manifestRef": {
"type": "string",
"pattern": "^urn:srcos:manifest:[A-Za-z0-9._~-]+$"
},
"evidenceSetDigest": {
"type": "string",
"description": "Digest of the evidence set as presented to the attestor; bound into the signed payload (threat: evidence-set substitution)."
},
"signature": {
"type": "string"
},
"attestedAt": {
"type": "string",
"format": "date-time"
}
}
}
Loading
Loading