open-standards/arl/vocab/v1.shapes.ttl
Transaction Science 43cb6a2ace vocab v1 SHACL shapes across sister standards (wave-23 #4/#5)
Carries the SHACL contract shipped at jouleclaw/vocab/v1.shapes.ttl
across every TX Science sister standard. Each standard now has a
SHACL Core shape graph that validates its main wire types
locally — before a payload crosses a tool boundary, a rail
driver, a lockstep replicator, a CDN cache, an inference vendor.

Live at the same prefix as the JSON-LD + Turtle vocab:

  https://arl.transaction.science/vocab/v1.shapes.ttl
  https://openpay.transaction.science/vocab/v1.shapes.ttl
  https://byte.transaction.science/vocab/v1.shapes.ttl
  https://eoc.transaction.science/vocab/v1.shapes.ttl
  https://wai.transaction.science/vocab/v1.shapes.ttl

All five serve with Content-Type: text/turtle (joulecode.t.s does
not yet have a site config so the file lives in repo only).

What each shape graph covers:

  arl/vocab/v1.shapes.ttl       Claim (four-axis: 1–9 validation
                                depth, A–E convergence, energy
                                profile, S0–S4 security, plus
                                derived arlScore in 1–9),
                                Session (Tier 0–3 isolation +
                                replayable/tampering booleans +
                                joules), Attestation (Ed25519
                                signature 128 hex + public key
                                64 hex + signedAt), Evaluation
                                (input/output BLAKE3 hex 64).

  openpay/vocab/v1.shapes.ttl   Money (signed integer + ISO 4217
                                3-letter currency), Receipt
                                (method ∈ {Card, A2A, Stablecoin,
                                Wallet, EMV}; rail ∈ {FedNow, PIX,
                                SEPAInstant, USDC, USDT}; status ∈
                                {Authorized, Captured, Settled,
                                Refunded, Voided, Disputed,
                                Failed}; idempotencyKey required),
                                Refund (refundedAt required), Card
                                (scheme ∈ {Visa, Mastercard, Amex,
                                Discover} + vaultRef required).

  smart-byte/vocab/v1.shapes.ttl Byte (BLAKE3 64-hex content hash,
                                issuer IRI, cargo + cargoClass ∈
                                {Value, Coding, Identity,
                                Telemetry, Custom}, energy
                                provenance, signature 128 hex,
                                sequence ≥ 0), LockstepEvent
                                (previousHash + contentHash hex +
                                lockstepHeight ≥ 0 + signature),
                                AID ([A-Za-z0-9_-]+ identifier).

  eoc/vocab/v1.shapes.ttl       Receipt (stageClosed ∈ {Cache,
                                KeyValue, Graph, Neural} +
                                joules_uj ≥ 0 + energy provenance
                                + input/output BLAKE3 hex 64 +
                                closedAt RFC 3339), CarbonRecord
                                (carbonGrams ≥ 0), Query
                                (queryText required).

  wai/vocab/v1.shapes.ttl       Manifest (modality ∈ {Image,
                                Audio, Video, Volume, Mesh,
                                Compressed}; path ∈ {NeuralPath,
                                ZerothPath}; codec ∈ the v1
                                registered menu of nine;
                                contentHash BLAKE3 hex 64; size ≥
                                0; mediaType IANA-shaped),
                                NeuralPrior (sharedPriorUri IRI +
                                sharedPriorHash hex 64).

  joule-code/vocab/v1.shapes.ttl Receipt (tierClosed ∈ {L0Cache,
                                L1Lawful, L2Embed, L3Model,
                                L4Wire} + joulesMeasuredUj +
                                joulesEstimatedUj + energy
                                provenance + closedAt),
                                Transition (operation ∈ {Edit,
                                Refactor, Generate} + sourceBefore/
                                AfterHash BLAKE3 hex 64), Agent
                                (agentId + agentVendor ∈
                                {ClaudeCode, Gemini, Codex,
                                GenericAgent} + acpEndpoint).

Every shape graph uses SHACL Core only — no SPARQL constraints,
no qualified value shapes. Consumable by:

  - Any full SHACL validator (pyshacl, Apache Jena, TopBraid).
  - The lightweight jouleclaw-shacl Rust validator, which is the
    reference and ships in ~600 LOC; WASM-compilable for in-browser
    validation.
  - The Python + Go reference clients in
    jouleclaw-hydra-client/clients/{python,go}/.

Each vocab README also gains a row pointing at the shapes file.

Operational follow-up done in parallel: the canonical Caddyfile
at site-ops/ adds an @<site>_jsonld matcher per site so .jsonld
files serve as application/ld+json across all five sister-site
hosts (joulecode.t.s does not yet have a site). The Caddyfile is
in a separate repo and is being committed via that repo's own
flow.

The Gen-3 architecture — vocabulary, Hydra discovery, SHACL
validation — now spans the entire TX Science open-standards
portfolio. A consumer reading any TX-Science wire form can
validate it locally before sending; can ground its meaning in
typed RDF via JSON-LD; can discover what services it can talk
to via Hydra (where the service publishes one). One pattern,
seven standards.
2026-06-02 18:55:56 -04:00

46 lines
2.9 KiB
Turtle

@prefix arl: <https://arl.transaction.science/vocab/v1#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
# ARL v1 SHACL shapes — validates Claim / Session / Evaluation /
# Attestation against the v1 vocabulary before the document
# crosses a tool boundary. SHACL Core subset only.
arl:ClaimShape a sh:NodeShape ;
sh:targetClass arl:Claim ;
sh:property [ sh:path arl:task ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
sh:property [ sh:path arl:context ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
sh:property [ sh:path arl:validationDepth ; sh:datatype xsd:integer ; sh:minCount 1 ; sh:maxCount 1 ;
sh:minInclusive 1 ; sh:maxInclusive 9 ] ;
sh:property [ sh:path arl:convergenceClass ; sh:nodeKind sh:IRI ; sh:minCount 1 ; sh:maxCount 1 ;
sh:in ( arl:ConvergenceA arl:ConvergenceB arl:ConvergenceC arl:ConvergenceD arl:ConvergenceE ) ] ;
sh:property [ sh:path arl:energyProfile ; sh:nodeKind sh:IRI ; sh:minCount 1 ; sh:maxCount 1 ;
sh:in ( arl:Disclosed arl:Undisclosed ) ] ;
sh:property [ sh:path arl:securityClass ; sh:nodeKind sh:IRI ; sh:minCount 1 ; sh:maxCount 1 ;
sh:in ( arl:S0 arl:S1 arl:S2 arl:S3 arl:S4 ) ] ;
sh:property [ sh:path arl:arlScore ; sh:datatype xsd:integer ; sh:maxCount 1 ;
sh:minInclusive 1 ; sh:maxInclusive 9 ] .
arl:SessionShape a sh:NodeShape ;
sh:targetClass arl:Session ;
sh:property [ sh:path arl:isolationTier ; sh:nodeKind sh:IRI ; sh:minCount 1 ; sh:maxCount 1 ;
sh:in ( arl:Tier0 arl:Tier1 arl:Tier2 arl:Tier3 ) ] ;
sh:property [ sh:path arl:replayable ; sh:datatype xsd:boolean ; sh:minCount 1 ; sh:maxCount 1 ] ;
sh:property [ sh:path arl:tamperingDetected ; sh:datatype xsd:boolean ; sh:minCount 1 ; sh:maxCount 1 ] ;
sh:property [ sh:path arl:joulesMicrojoules ; sh:datatype xsd:nonNegativeInteger ; sh:maxCount 1 ] .
arl:AttestationShape a sh:NodeShape ;
sh:targetClass arl:Attestation ;
sh:property [ sh:path arl:signature ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ;
sh:pattern "^[a-f0-9]{128}$" ] ;
sh:property [ sh:path arl:publicKey ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ;
sh:pattern "^[a-f0-9]{64}$" ] ;
sh:property [ sh:path arl:signedAt ; sh:datatype xsd:dateTime ; sh:minCount 1 ; sh:maxCount 1 ] .
arl:EvaluationShape a sh:NodeShape ;
sh:targetClass arl:Evaluation ;
sh:property [ sh:path arl:inputHash ; sh:datatype xsd:string ; sh:maxCount 1 ;
sh:pattern "^[a-f0-9]{64}$" ] ;
sh:property [ sh:path arl:outputHash ; sh:datatype xsd:string ; sh:maxCount 1 ;
sh:pattern "^[a-f0-9]{64}$" ] .