generated from coulomb/repo-seed
Add discovery snapshot contract
This commit is contained in:
487
schemas/discovery-snapshot.schema.yaml
Normal file
487
schemas/discovery-snapshot.schema.yaml
Normal file
@@ -0,0 +1,487 @@
|
||||
$schema: "https://json-schema.org/draft/2020-12/schema"
|
||||
$id: "https://railiance.local/fabric/schemas/discovery-snapshot.schema.yaml"
|
||||
title: "FabricDiscoverySnapshot"
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- apiVersion
|
||||
- kind
|
||||
- source
|
||||
- scan
|
||||
- replacement_scopes
|
||||
- candidates
|
||||
- tombstones
|
||||
- reconciliation
|
||||
properties:
|
||||
apiVersion:
|
||||
$ref: "./common.schema.yaml#/$defs/apiVersion"
|
||||
kind:
|
||||
type: string
|
||||
const: FabricDiscoverySnapshot
|
||||
generated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
source:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- repo_slug
|
||||
- commit
|
||||
properties:
|
||||
repo_slug:
|
||||
type: string
|
||||
minLength: 1
|
||||
repo_name:
|
||||
type: string
|
||||
domain:
|
||||
type: string
|
||||
commit:
|
||||
type: string
|
||||
minLength: 1
|
||||
default_branch:
|
||||
type: string
|
||||
path:
|
||||
type: string
|
||||
scan:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- run_id
|
||||
- profile
|
||||
- deterministic_only
|
||||
- llm_enabled
|
||||
properties:
|
||||
run_id:
|
||||
$ref: "#/$defs/stableKey"
|
||||
profile:
|
||||
type: string
|
||||
minLength: 1
|
||||
deterministic_only:
|
||||
type: boolean
|
||||
llm_enabled:
|
||||
type: boolean
|
||||
started_at:
|
||||
type: string
|
||||
format: date-time
|
||||
completed_at:
|
||||
type: string
|
||||
format: date-time
|
||||
llm_budget:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
replacement_scopes:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/$defs/replacementScope"
|
||||
candidates:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- nodes
|
||||
- edges
|
||||
- attributes
|
||||
properties:
|
||||
nodes:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/$defs/candidateNode"
|
||||
edges:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/$defs/candidateEdge"
|
||||
attributes:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/$defs/candidateAttribute"
|
||||
tombstones:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/$defs/tombstone"
|
||||
reconciliation:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- precedence
|
||||
- duplicate_policy
|
||||
- retirement_policy
|
||||
properties:
|
||||
precedence:
|
||||
type: array
|
||||
minItems: 1
|
||||
uniqueItems: true
|
||||
items:
|
||||
$ref: "#/$defs/origin"
|
||||
duplicate_policy:
|
||||
type: string
|
||||
minLength: 1
|
||||
retirement_policy:
|
||||
type: string
|
||||
minLength: 1
|
||||
conflicts:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
|
||||
$defs:
|
||||
stableKey:
|
||||
type: string
|
||||
minLength: 3
|
||||
maxLength: 240
|
||||
pattern: "^[A-Za-z0-9][A-Za-z0-9._:/@+-]*$"
|
||||
|
||||
origin:
|
||||
type: string
|
||||
enum:
|
||||
- repo_declaration
|
||||
- deterministic
|
||||
- catalog
|
||||
- registry
|
||||
- llm
|
||||
- manual
|
||||
|
||||
reviewState:
|
||||
type: string
|
||||
enum:
|
||||
- accepted
|
||||
- candidate
|
||||
- needs_review
|
||||
- rejected
|
||||
|
||||
entityStatus:
|
||||
type: string
|
||||
enum:
|
||||
- active
|
||||
- retired
|
||||
- duplicate
|
||||
- conflicted
|
||||
|
||||
sourceKind:
|
||||
type: string
|
||||
enum:
|
||||
- file
|
||||
- declaration
|
||||
- package_manifest
|
||||
- lockfile
|
||||
- api_contract
|
||||
- deployment_manifest
|
||||
- service_config
|
||||
- service_catalog
|
||||
- package_registry
|
||||
- container_registry
|
||||
- fabric_registry
|
||||
- llm
|
||||
- manual
|
||||
|
||||
extractionMethod:
|
||||
type: string
|
||||
enum:
|
||||
- declaration
|
||||
- deterministic
|
||||
- connector
|
||||
- llm
|
||||
- manual
|
||||
|
||||
confidence:
|
||||
type: number
|
||||
minimum: 0
|
||||
maximum: 1
|
||||
|
||||
jsonValue:
|
||||
anyOf:
|
||||
- type: "null"
|
||||
- type: string
|
||||
- type: number
|
||||
- type: integer
|
||||
- type: boolean
|
||||
- type: array
|
||||
items:
|
||||
$ref: "#/$defs/jsonValue"
|
||||
- type: object
|
||||
additionalProperties:
|
||||
$ref: "#/$defs/jsonValue"
|
||||
|
||||
sourceAnchor:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- source_kind
|
||||
- fingerprint
|
||||
properties:
|
||||
source_kind:
|
||||
$ref: "#/$defs/sourceKind"
|
||||
path:
|
||||
type: string
|
||||
minLength: 1
|
||||
url:
|
||||
type: string
|
||||
format: uri
|
||||
ref:
|
||||
type: string
|
||||
minLength: 1
|
||||
line_start:
|
||||
type: integer
|
||||
minimum: 1
|
||||
line_end:
|
||||
type: integer
|
||||
minimum: 1
|
||||
json_pointer:
|
||||
type: string
|
||||
fingerprint:
|
||||
type: string
|
||||
minLength: 8
|
||||
snippet:
|
||||
type: string
|
||||
|
||||
provenance:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- extractor_id
|
||||
- method
|
||||
- origin
|
||||
properties:
|
||||
extractor_id:
|
||||
type: string
|
||||
minLength: 1
|
||||
extractor_version:
|
||||
type: string
|
||||
method:
|
||||
$ref: "#/$defs/extractionMethod"
|
||||
origin:
|
||||
$ref: "#/$defs/origin"
|
||||
prompt_version:
|
||||
type: string
|
||||
provider:
|
||||
type: string
|
||||
model:
|
||||
type: string
|
||||
usage:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
rationale:
|
||||
type: string
|
||||
|
||||
replacementScope:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- extractor_id
|
||||
- source_kind
|
||||
- mode
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/$defs/stableKey"
|
||||
extractor_id:
|
||||
type: string
|
||||
minLength: 1
|
||||
source_kind:
|
||||
$ref: "#/$defs/sourceKind"
|
||||
source_path:
|
||||
type: string
|
||||
mode:
|
||||
type: string
|
||||
enum:
|
||||
- replacement
|
||||
- additive
|
||||
description:
|
||||
type: string
|
||||
|
||||
candidateNode:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- stable_key
|
||||
- kind
|
||||
- label
|
||||
- repo
|
||||
- origin
|
||||
- review_state
|
||||
- status
|
||||
- confidence
|
||||
- replacement_scope
|
||||
- provenance
|
||||
- source_anchors
|
||||
properties:
|
||||
stable_key:
|
||||
$ref: "#/$defs/stableKey"
|
||||
graph_id:
|
||||
$ref: "./common.schema.yaml#/$defs/graphId"
|
||||
kind:
|
||||
type: string
|
||||
minLength: 1
|
||||
label:
|
||||
type: string
|
||||
minLength: 1
|
||||
repo:
|
||||
type: string
|
||||
minLength: 1
|
||||
domain:
|
||||
type: string
|
||||
lifecycle:
|
||||
type: string
|
||||
aliases:
|
||||
type: array
|
||||
uniqueItems: true
|
||||
items:
|
||||
type: string
|
||||
minLength: 1
|
||||
attributes:
|
||||
type: object
|
||||
additionalProperties:
|
||||
$ref: "#/$defs/jsonValue"
|
||||
origin:
|
||||
$ref: "#/$defs/origin"
|
||||
review_state:
|
||||
$ref: "#/$defs/reviewState"
|
||||
status:
|
||||
$ref: "#/$defs/entityStatus"
|
||||
confidence:
|
||||
$ref: "#/$defs/confidence"
|
||||
replacement_scope:
|
||||
$ref: "#/$defs/stableKey"
|
||||
provenance:
|
||||
type: array
|
||||
minItems: 1
|
||||
items:
|
||||
$ref: "#/$defs/provenance"
|
||||
source_anchors:
|
||||
type: array
|
||||
minItems: 1
|
||||
items:
|
||||
$ref: "#/$defs/sourceAnchor"
|
||||
|
||||
candidateEdge:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- stable_key
|
||||
- edge_type
|
||||
- source_key
|
||||
- target_key
|
||||
- origin
|
||||
- review_state
|
||||
- status
|
||||
- confidence
|
||||
- replacement_scope
|
||||
- provenance
|
||||
- source_anchors
|
||||
properties:
|
||||
stable_key:
|
||||
$ref: "#/$defs/stableKey"
|
||||
edge_type:
|
||||
type: string
|
||||
minLength: 1
|
||||
source_key:
|
||||
$ref: "#/$defs/stableKey"
|
||||
target_key:
|
||||
$ref: "#/$defs/stableKey"
|
||||
aliases:
|
||||
type: array
|
||||
uniqueItems: true
|
||||
items:
|
||||
type: string
|
||||
minLength: 1
|
||||
attributes:
|
||||
type: object
|
||||
additionalProperties:
|
||||
$ref: "#/$defs/jsonValue"
|
||||
origin:
|
||||
$ref: "#/$defs/origin"
|
||||
review_state:
|
||||
$ref: "#/$defs/reviewState"
|
||||
status:
|
||||
$ref: "#/$defs/entityStatus"
|
||||
confidence:
|
||||
$ref: "#/$defs/confidence"
|
||||
replacement_scope:
|
||||
$ref: "#/$defs/stableKey"
|
||||
provenance:
|
||||
type: array
|
||||
minItems: 1
|
||||
items:
|
||||
$ref: "#/$defs/provenance"
|
||||
source_anchors:
|
||||
type: array
|
||||
minItems: 1
|
||||
items:
|
||||
$ref: "#/$defs/sourceAnchor"
|
||||
|
||||
candidateAttribute:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- stable_key
|
||||
- entity_key
|
||||
- name
|
||||
- value
|
||||
- origin
|
||||
- review_state
|
||||
- confidence
|
||||
- replacement_scope
|
||||
- provenance
|
||||
- source_anchors
|
||||
properties:
|
||||
stable_key:
|
||||
$ref: "#/$defs/stableKey"
|
||||
entity_key:
|
||||
$ref: "#/$defs/stableKey"
|
||||
name:
|
||||
type: string
|
||||
minLength: 1
|
||||
value:
|
||||
$ref: "#/$defs/jsonValue"
|
||||
origin:
|
||||
$ref: "#/$defs/origin"
|
||||
review_state:
|
||||
$ref: "#/$defs/reviewState"
|
||||
confidence:
|
||||
$ref: "#/$defs/confidence"
|
||||
replacement_scope:
|
||||
$ref: "#/$defs/stableKey"
|
||||
provenance:
|
||||
type: array
|
||||
minItems: 1
|
||||
items:
|
||||
$ref: "#/$defs/provenance"
|
||||
source_anchors:
|
||||
type: array
|
||||
minItems: 1
|
||||
items:
|
||||
$ref: "#/$defs/sourceAnchor"
|
||||
|
||||
tombstone:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
required:
|
||||
- stable_key
|
||||
- entity_kind
|
||||
- replacement_scope
|
||||
- retired_at
|
||||
- reason
|
||||
properties:
|
||||
stable_key:
|
||||
$ref: "#/$defs/stableKey"
|
||||
entity_kind:
|
||||
type: string
|
||||
enum:
|
||||
- node
|
||||
- edge
|
||||
- attribute
|
||||
replacement_scope:
|
||||
$ref: "#/$defs/stableKey"
|
||||
retired_at:
|
||||
type: string
|
||||
format: date-time
|
||||
reason:
|
||||
type: string
|
||||
enum:
|
||||
- source_missing
|
||||
- scope_replaced
|
||||
- duplicate_superseded
|
||||
- declaration_override
|
||||
- manually_retired
|
||||
previous_candidate:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
Reference in New Issue
Block a user