Establish Railiance Fabric graph model

This commit is contained in:
2026-05-17 19:47:37 +02:00
parent 9c1f4d1381
commit 19f9fddc35
89 changed files with 5007 additions and 2 deletions

View File

@@ -0,0 +1,52 @@
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "https://railiance.local/fabric/schemas/binding.schema.yaml"
title: "BindingAssertion"
type: object
additionalProperties: false
required:
- apiVersion
- kind
- metadata
- spec
properties:
apiVersion:
$ref: "./common.schema.yaml#/$defs/apiVersion"
kind:
type: string
const: BindingAssertion
metadata:
$ref: "./common.schema.yaml#/$defs/metadata"
spec:
type: object
additionalProperties: false
required:
- lifecycle
- environments
- dependency_id
- provider_capability_id
- status
- rationale
properties:
lifecycle:
$ref: "./common.schema.yaml#/$defs/lifecycle"
environments:
$ref: "./common.schema.yaml#/$defs/environments"
dependency_id:
$ref: "./common.schema.yaml#/$defs/graphId"
provider_capability_id:
$ref: "./common.schema.yaml#/$defs/graphId"
provider_interface_id:
$ref: "./common.schema.yaml#/$defs/graphId"
status:
type: string
enum:
- exact
- compatible
- degraded
- missing
- disputed
rationale:
type: string
minLength: 1
compatibility:
$ref: "./common.schema.yaml#/$defs/compatibility"

View File

@@ -0,0 +1,52 @@
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "https://railiance.local/fabric/schemas/capability.schema.yaml"
title: "CapabilityDeclaration"
type: object
additionalProperties: false
required:
- apiVersion
- kind
- metadata
- spec
properties:
apiVersion:
$ref: "./common.schema.yaml#/$defs/apiVersion"
kind:
type: string
const: CapabilityDeclaration
metadata:
$ref: "./common.schema.yaml#/$defs/metadata"
spec:
type: object
additionalProperties: false
required:
- lifecycle
- environments
- description
- capability_type
- service_id
- criticality
- data_classification
properties:
lifecycle:
$ref: "./common.schema.yaml#/$defs/lifecycle"
environments:
$ref: "./common.schema.yaml#/$defs/environments"
description:
type: string
minLength: 1
capability_type:
type: string
minLength: 1
service_id:
$ref: "./common.schema.yaml#/$defs/graphId"
interface_ids:
type: array
items:
$ref: "./common.schema.yaml#/$defs/graphId"
criticality:
$ref: "./common.schema.yaml#/$defs/criticality"
data_classification:
$ref: "./common.schema.yaml#/$defs/dataClassification"
compatibility:
$ref: "./common.schema.yaml#/$defs/compatibility"

164
schemas/common.schema.yaml Normal file
View File

@@ -0,0 +1,164 @@
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "https://railiance.local/fabric/schemas/common.schema.yaml"
title: "Railiance Fabric Common Definitions"
type: object
$defs:
apiVersion:
type: string
const: "railiance.fabric/v1alpha1"
graphId:
type: string
pattern: "^[a-z0-9][a-z0-9.-]*[a-z0-9]$"
minLength: 3
maxLength: 160
lifecycle:
type: string
enum:
- planned
- active
- deprecated
- retired
environment:
type: string
enum:
- dev
- staging
- prod
- all
environments:
type: array
minItems: 1
uniqueItems: true
items:
$ref: "#/$defs/environment"
criticality:
type: string
enum:
- low
- medium
- high
- critical
dataClassification:
type: string
enum:
- public
- internal
- confidential
- restricted
- secret
authMethod:
type: string
enum:
- none
- oidc
- jwt
- mtls
- kubernetes_service_account
- openbao_token
- static_secret
- database_role
- sts_token
- api_key
- unknown
sourceLink:
type: object
additionalProperties: false
required:
- label
properties:
label:
type: string
minLength: 1
path:
type: string
minLength: 1
url:
type: string
format: uri
ref:
type: string
minLength: 1
anyOf:
- required: [path]
- required: [url]
- required: [ref]
metadata:
type: object
additionalProperties: false
required:
- id
- name
- owner
- repo
- domain
properties:
id:
$ref: "#/$defs/graphId"
name:
type: string
minLength: 1
owner:
type: string
minLength: 1
repo:
type: string
minLength: 1
domain:
type: string
minLength: 1
source_links:
type: array
items:
$ref: "#/$defs/sourceLink"
compatibility:
type: object
additionalProperties: false
properties:
version:
type: string
minLength: 1
requires:
type: array
items:
type: string
minLength: 1
compatible_with:
type: array
items:
$ref: "#/$defs/graphId"
breaks:
type: array
items:
type: string
minLength: 1
notes:
type: string
minLength: 1
auth:
type: object
additionalProperties: false
required:
- method
properties:
method:
$ref: "#/$defs/authMethod"
audience:
type: string
minLength: 1
scopes:
type: array
items:
type: string
minLength: 1

View File

@@ -0,0 +1,82 @@
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "https://railiance.local/fabric/schemas/dependency.schema.yaml"
title: "DependencyDeclaration"
type: object
additionalProperties: false
required:
- apiVersion
- kind
- metadata
- spec
properties:
apiVersion:
$ref: "./common.schema.yaml#/$defs/apiVersion"
kind:
type: string
const: DependencyDeclaration
metadata:
$ref: "./common.schema.yaml#/$defs/metadata"
spec:
type: object
additionalProperties: false
required:
- lifecycle
- environments
- consumer_service_id
- requires
- criticality
- data_classification
properties:
lifecycle:
$ref: "./common.schema.yaml#/$defs/lifecycle"
environments:
$ref: "./common.schema.yaml#/$defs/environments"
consumer_service_id:
$ref: "./common.schema.yaml#/$defs/graphId"
requires:
type: object
additionalProperties: false
required:
- capability_type
properties:
capability_type:
type: string
minLength: 1
capability_id:
$ref: "./common.schema.yaml#/$defs/graphId"
interface:
type: object
additionalProperties: false
properties:
type:
type: string
minLength: 1
version_constraint:
type: string
minLength: 1
auth:
$ref: "./common.schema.yaml#/$defs/auth"
criticality:
$ref: "./common.schema.yaml#/$defs/criticality"
data_classification:
$ref: "./common.schema.yaml#/$defs/dataClassification"
fallback:
type: object
additionalProperties: false
required:
- mode
- description
properties:
mode:
type: string
enum:
- none
- manual
- degraded
- cached
- alternate_provider
description:
type: string
minLength: 1
compatibility:
$ref: "./common.schema.yaml#/$defs/compatibility"

View File

@@ -0,0 +1,69 @@
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "https://railiance.local/fabric/schemas/interface.schema.yaml"
title: "InterfaceDeclaration"
type: object
additionalProperties: false
required:
- apiVersion
- kind
- metadata
- spec
properties:
apiVersion:
$ref: "./common.schema.yaml#/$defs/apiVersion"
kind:
type: string
const: InterfaceDeclaration
metadata:
$ref: "./common.schema.yaml#/$defs/metadata"
spec:
type: object
additionalProperties: false
required:
- lifecycle
- environments
- description
- interface_type
- version
- service_id
- auth
- data_classification
properties:
lifecycle:
$ref: "./common.schema.yaml#/$defs/lifecycle"
environments:
$ref: "./common.schema.yaml#/$defs/environments"
description:
type: string
minLength: 1
interface_type:
type: string
minLength: 1
version:
type: string
minLength: 1
service_id:
$ref: "./common.schema.yaml#/$defs/graphId"
capability_ids:
type: array
items:
$ref: "./common.schema.yaml#/$defs/graphId"
endpoint:
type: object
additionalProperties: false
properties:
url:
type: string
minLength: 1
path:
type: string
minLength: 1
notes:
type: string
minLength: 1
auth:
$ref: "./common.schema.yaml#/$defs/auth"
data_classification:
$ref: "./common.schema.yaml#/$defs/dataClassification"
compatibility:
$ref: "./common.schema.yaml#/$defs/compatibility"

View File

@@ -0,0 +1,44 @@
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "https://railiance.local/fabric/schemas/service.schema.yaml"
title: "ServiceDeclaration"
type: object
additionalProperties: false
required:
- apiVersion
- kind
- metadata
- spec
properties:
apiVersion:
$ref: "./common.schema.yaml#/$defs/apiVersion"
kind:
type: string
const: ServiceDeclaration
metadata:
$ref: "./common.schema.yaml#/$defs/metadata"
spec:
type: object
additionalProperties: false
required:
- lifecycle
- environments
- description
properties:
lifecycle:
$ref: "./common.schema.yaml#/$defs/lifecycle"
environments:
$ref: "./common.schema.yaml#/$defs/environments"
description:
type: string
minLength: 1
service_type:
type: string
minLength: 1
provides_capabilities:
type: array
items:
$ref: "./common.schema.yaml#/$defs/graphId"
exposes_interfaces:
type: array
items:
$ref: "./common.schema.yaml#/$defs/graphId"

View File

@@ -0,0 +1,71 @@
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "https://railiance.local/fabric/schemas/state-hub-export.schema.yaml"
title: "FabricGraphExport"
type: object
additionalProperties: false
required:
- apiVersion
- kind
- nodes
- edges
properties:
apiVersion:
type: string
const: railiance.fabric/v1alpha1
kind:
type: string
const: FabricGraphExport
generated_at:
type: string
format: date-time
source:
type: object
additionalProperties: false
properties:
repo:
type: string
commit:
type: string
path:
type: string
nodes:
type: array
items:
type: object
additionalProperties: false
required:
- id
- kind
- name
- repo
- domain
- lifecycle
properties:
id:
$ref: "./common.schema.yaml#/$defs/graphId"
kind:
type: string
name:
type: string
repo:
type: string
domain:
type: string
lifecycle:
type: string
edges:
type: array
items:
type: object
additionalProperties: false
required:
- from
- to
- type
properties:
from:
$ref: "./common.schema.yaml#/$defs/graphId"
to:
$ref: "./common.schema.yaml#/$defs/graphId"
type:
type: string