{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.invalid/schemas/workflow-contract.schema.json",
"title": "Neutral RFC workflow contract",
"type": "object",
"additionalProperties": false,
"required": [
"$schema",
"contract_id",
"contract_version",
"name",
"summary",
"governing_rules",
"artifact_families",
"visibility_classes",
"roles",
"artifact_types",
"source_profile_hooks",
"stage_order",
"stage_graph",
"stages",
"correction_policy"
],
"properties": {
"$schema": {
"const": "./schemas/workflow-contract.schema.json"
},
"contract_id": {
"const": "neutral-rfc-workflow"
},
"contract_version": {
"type": "string",
"pattern": "^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$"
},
"name": {
"type": "string",
"minLength": 1
},
"summary": {
"type": "string",
"minLength": 1
},
"governing_rules": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/governingRule"
}
},
"artifact_families": {
"type": "object",
"additionalProperties": false,
"required": [
"public",
"evidence"
],
"properties": {
"public": {
"$ref": "#/$defs/artifactFamily"
},
"evidence": {
"$ref": "#/$defs/artifactFamily"
}
}
},
"visibility_classes": {
"type": "object",
"additionalProperties": false,
"required": [
"public",
"evidence-shared",
"evidence-restricted"
],
"properties": {
"public": {
"$ref": "#/$defs/visibilityClass"
},
"evidence-shared": {
"$ref": "#/$defs/visibilityClass"
},
"evidence-restricted": {
"$ref": "#/$defs/visibilityClass"
}
}
},
"roles": {
"type": "object",
"additionalProperties": false,
"required": [
"controller",
"context-builder",
"source-scout",
"draft-author",
"evidence-reviewer",
"readability-reviewer",
"cleanroom-reviewer",
"release-owner",
"public-reader"
],
"properties": {
"controller": {
"$ref": "#/$defs/role"
},
"context-builder": {
"$ref": "#/$defs/role"
},
"source-scout": {
"$ref": "#/$defs/role"
},
"draft-author": {
"$ref": "#/$defs/role"
},
"evidence-reviewer": {
"$ref": "#/$defs/role"
},
"readability-reviewer": {
"$ref": "#/$defs/role"
},
"cleanroom-reviewer": {
"$ref": "#/$defs/role"
},
"release-owner": {
"$ref": "#/$defs/role"
},
"public-reader": {
"$ref": "#/$defs/role"
}
}
},
"artifact_types": {
"type": "object",
"additionalProperties": false,
"required": [
"run-brief",
"context-packet",
"source-map",
"source-scout-report",
"claim-ledger",
"capability-matrix",
"section-map",
"public-draft-source",
"public-rendered-output",
"example-report",
"mechanical-report",
"review-report",
"reader-report",
"prose-report",
"correction-log",
"escalation-log",
"cleanroom-packet",
"cleanroom-report",
"public-manifest",
"evidence-manifest"
],
"properties": {
"run-brief": {
"$ref": "#/$defs/artifactType"
},
"context-packet": {
"$ref": "#/$defs/artifactType"
},
"source-map": {
"$ref": "#/$defs/artifactType"
},
"source-scout-report": {
"$ref": "#/$defs/artifactType"
},
"claim-ledger": {
"$ref": "#/$defs/artifactType"
},
"capability-matrix": {
"$ref": "#/$defs/artifactType"
},
"section-map": {
"$ref": "#/$defs/artifactType"
},
"public-draft-source": {
"$ref": "#/$defs/artifactType"
},
"public-rendered-output": {
"$ref": "#/$defs/artifactType"
},
"example-report": {
"$ref": "#/$defs/artifactType"
},
"mechanical-report": {
"$ref": "#/$defs/artifactType"
},
"review-report": {
"$ref": "#/$defs/artifactType"
},
"reader-report": {
"$ref": "#/$defs/artifactType"
},
"prose-report": {
"$ref": "#/$defs/artifactType"
},
"correction-log": {
"$ref": "#/$defs/artifactType"
},
"escalation-log": {
"$ref": "#/$defs/artifactType"
},
"cleanroom-packet": {
"$ref": "#/$defs/artifactType"
},
"cleanroom-report": {
"$ref": "#/$defs/artifactType"
},
"public-manifest": {
"$ref": "#/$defs/artifactType"
},
"evidence-manifest": {
"$ref": "#/$defs/artifactType"
}
}
},
"source_profile_hooks": {
"$ref": "#/$defs/sourceProfileHooks"
},
"stage_order": {
"const": [
"scope",
"context-packet",
"source-map",
"source-scout",
"claim-ledger",
"capability-matrix",
"draft-skeleton",
"example-lab",
"mechanical-validation",
"review-gauntlet",
"reader-onramp",
"prose-audit",
"correction-loop",
"clean-room-proof",
"final-packaging"
]
},
"stage_graph": {
"$ref": "#/$defs/stageGraph"
},
"stages": {
"type": "object",
"additionalProperties": false,
"required": [
"scope",
"context-packet",
"source-map",
"source-scout",
"claim-ledger",
"capability-matrix",
"draft-skeleton",
"example-lab",
"mechanical-validation",
"review-gauntlet",
"reader-onramp",
"prose-audit",
"correction-loop",
"clean-room-proof",
"final-packaging"
],
"properties": {
"scope": {
"$ref": "#/$defs/stage"
},
"context-packet": {
"$ref": "#/$defs/stage"
},
"source-map": {
"$ref": "#/$defs/stage"
},
"source-scout": {
"$ref": "#/$defs/stage"
},
"claim-ledger": {
"$ref": "#/$defs/stage"
},
"capability-matrix": {
"$ref": "#/$defs/stage"
},
"draft-skeleton": {
"$ref": "#/$defs/stage"
},
"example-lab": {
"$ref": "#/$defs/stage"
},
"mechanical-validation": {
"$ref": "#/$defs/stage"
},
"review-gauntlet": {
"$ref": "#/$defs/stage"
},
"reader-onramp": {
"$ref": "#/$defs/stage"
},
"prose-audit": {
"$ref": "#/$defs/stage"
},
"correction-loop": {
"$ref": "#/$defs/stage"
},
"clean-room-proof": {
"$ref": "#/$defs/stage"
},
"final-packaging": {
"$ref": "#/$defs/stage"
}
}
},
"correction_policy": {
"$ref": "#/$defs/correctionPolicy"
}
},
"$defs": {
"roleId": {
"enum": [
"controller",
"context-builder",
"source-scout",
"draft-author",
"evidence-reviewer",
"readability-reviewer",
"cleanroom-reviewer",
"release-owner",
"public-reader"
]
},
"artifactId": {
"enum": [
"run-brief",
"context-packet",
"source-map",
"source-scout-report",
"claim-ledger",
"capability-matrix",
"section-map",
"public-draft-source",
"public-rendered-output",
"example-report",
"mechanical-report",
"review-report",
"reader-report",
"prose-report",
"correction-log",
"escalation-log",
"cleanroom-packet",
"cleanroom-report",
"public-manifest",
"evidence-manifest"
]
},
"stageId": {
"enum": [
"scope",
"context-packet",
"source-map",
"source-scout",
"claim-ledger",
"capability-matrix",
"draft-skeleton",
"example-lab",
"mechanical-validation",
"review-gauntlet",
"reader-onramp",
"prose-audit",
"correction-loop",
"clean-room-proof",
"final-packaging"
]
},
"hookId": {
"enum": [
"scope-bootstrap",
"context-assembly",
"source-discovery",
"example-validation",
"mechanical-validation",
"review-focus",
"packaging"
]
},
"governingRule": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"rule"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9-]+$"
},
"rule": {
"type": "string",
"minLength": 1
}
}
},
"artifactFamily": {
"type": "object",
"additionalProperties": false,
"required": [
"publishable",
"description"
],
"properties": {
"publishable": {
"type": "boolean"
},
"description": {
"type": "string",
"minLength": 1
},
"must_exclude": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"must_include": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"may_include": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
}
}
},
"visibilityClass": {
"type": "object",
"additionalProperties": false,
"required": [
"description",
"readable_by"
],
"properties": {
"description": {
"type": "string",
"minLength": 1
},
"readable_by": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"$ref": "#/$defs/roleId"
}
}
}
},
"role": {
"type": "object",
"additionalProperties": false,
"required": [
"purpose",
"can_read"
],
"properties": {
"purpose": {
"type": "string",
"minLength": 1
},
"can_read": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"enum": [
"public",
"evidence-shared",
"evidence-restricted"
]
}
}
}
},
"artifactType": {
"type": "object",
"additionalProperties": false,
"required": [
"family",
"visibility",
"description"
],
"properties": {
"family": {
"enum": [
"public",
"evidence"
]
},
"visibility": {
"enum": [
"public",
"evidence-shared",
"evidence-restricted"
]
},
"description": {
"type": "string",
"minLength": 1
}
}
},
"hookPoint": {
"type": "object",
"additionalProperties": false,
"required": [
"stage",
"purpose",
"must_provide"
],
"properties": {
"stage": {
"$ref": "#/$defs/stageId"
},
"purpose": {
"type": "string",
"minLength": 1
},
"must_provide": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"minLength": 1
}
},
"may_provide": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"minLength": 1
}
}
}
},
"sourceProfileHooks": {
"type": "object",
"additionalProperties": false,
"required": [
"required_sections",
"hook_points"
],
"properties": {
"required_sections": {
"const": [
"profile-metadata",
"corpus",
"authority-order",
"context-sources",
"discovery-procedure",
"example-procedure",
"validation-procedure",
"review-focus",
"packaging-procedure"
]
},
"hook_points": {
"type": "object",
"additionalProperties": false,
"required": [
"scope-bootstrap",
"context-assembly",
"source-discovery",
"example-validation",
"mechanical-validation",
"review-focus",
"packaging"
],
"properties": {
"scope-bootstrap": {
"$ref": "#/$defs/hookPoint"
},
"context-assembly": {
"$ref": "#/$defs/hookPoint"
},
"source-discovery": {
"$ref": "#/$defs/hookPoint"
},
"example-validation": {
"$ref": "#/$defs/hookPoint"
},
"mechanical-validation": {
"$ref": "#/$defs/hookPoint"
},
"review-focus": {
"$ref": "#/$defs/hookPoint"
},
"packaging": {
"$ref": "#/$defs/hookPoint"
}
}
}
}
},
"stageGraph": {
"type": "object",
"additionalProperties": false,
"required": [
"start_stage",
"terminal_stages",
"default_failure_stage",
"pass_edges",
"dynamic_routes"
],
"properties": {
"start_stage": {
"const": "scope"
},
"terminal_stages": {
"const": [
"final-packaging"
]
},
"default_failure_stage": {
"const": "correction-loop"
},
"pass_edges": {
"type": "object",
"additionalProperties": false,
"required": [
"scope",
"context-packet",
"source-map",
"source-scout",
"claim-ledger",
"capability-matrix",
"draft-skeleton",
"example-lab",
"mechanical-validation",
"review-gauntlet",
"reader-onramp",
"prose-audit",
"correction-loop",
"clean-room-proof",
"final-packaging"
],
"properties": {
"scope": {
"const": [
"context-packet"
]
},
"context-packet": {
"const": [
"source-map"
]
},
"source-map": {
"const": [
"source-scout",
"claim-ledger"
]
},
"source-scout": {
"const": [
"source-scout",
"claim-ledger"
]
},
"claim-ledger": {
"const": [
"capability-matrix"
]
},
"capability-matrix": {
"const": [
"draft-skeleton"
]
},
"draft-skeleton": {
"const": [
"example-lab"
]
},
"example-lab": {
"const": [
"mechanical-validation"
]
},
"mechanical-validation": {
"const": [
"review-gauntlet"
]
},
"review-gauntlet": {
"const": [
"reader-onramp"
]
},
"reader-onramp": {
"const": [
"prose-audit"
]
},
"prose-audit": {
"const": [
"clean-room-proof"
]
},
"correction-loop": {
"const": []
},
"clean-room-proof": {
"const": [
"final-packaging"
]
},
"final-packaging": {
"const": []
}
}
},
"dynamic_routes": {
"type": "object",
"additionalProperties": false,
"required": [
"correction-loop"
],
"properties": {
"correction-loop": {
"const": "route-by-root-artifact-type"
}
}
}
}
},
"stage": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"title",
"owner_role",
"support_roles",
"depends_on_artifacts",
"may_consume_artifacts",
"source_profile_hooks",
"entry_criteria",
"outputs",
"next_stages",
"repeatable"
],
"properties": {
"id": {
"$ref": "#/$defs/stageId"
},
"title": {
"type": "string",
"minLength": 1
},
"owner_role": {
"$ref": "#/$defs/roleId"
},
"support_roles": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/$defs/roleId"
}
},
"depends_on_artifacts": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/$defs/artifactId"
}
},
"may_consume_artifacts": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/$defs/artifactId"
}
},
"source_profile_hooks": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/$defs/hookId"
}
},
"entry_criteria": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
},
"outputs": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"$ref": "#/$defs/artifactId"
}
},
"next_stages": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/$defs/stageId"
}
},
"repeatable": {
"type": "boolean"
}
}
},
"correctionPolicy": {
"type": "object",
"additionalProperties": false,
"required": [
"rule",
"route_by_root_artifact",
"rerun_scope",
"unresolved_blockers_stop_promotion"
],
"properties": {
"rule": {
"type": "string",
"minLength": 1
},
"route_by_root_artifact": {
"type": "object",
"additionalProperties": false,
"required": [
"run-brief",
"context-packet",
"source-map",
"source-scout-report",
"claim-ledger",
"capability-matrix",
"section-map",
"public-draft-source",
"example-report",
"mechanical-report",
"review-report",
"reader-report",
"prose-report",
"correction-log",
"escalation-log",
"cleanroom-packet",
"cleanroom-report",
"public-manifest",
"evidence-manifest"
],
"properties": {
"run-brief": {
"$ref": "#/$defs/stageId"
},
"context-packet": {
"$ref": "#/$defs/stageId"
},
"source-map": {
"$ref": "#/$defs/stageId"
},
"source-scout-report": {
"$ref": "#/$defs/stageId"
},
"claim-ledger": {
"$ref": "#/$defs/stageId"
},
"capability-matrix": {
"$ref": "#/$defs/stageId"
},
"section-map": {
"$ref": "#/$defs/stageId"
},
"public-draft-source": {
"$ref": "#/$defs/stageId"
},
"example-report": {
"$ref": "#/$defs/stageId"
},
"mechanical-report": {
"$ref": "#/$defs/stageId"
},
"review-report": {
"$ref": "#/$defs/stageId"
},
"reader-report": {
"$ref": "#/$defs/stageId"
},
"prose-report": {
"$ref": "#/$defs/stageId"
},
"correction-log": {
"$ref": "#/$defs/stageId"
},
"escalation-log": {
"$ref": "#/$defs/stageId"
},
"cleanroom-packet": {
"$ref": "#/$defs/stageId"
},
"cleanroom-report": {
"$ref": "#/$defs/stageId"
},
"public-manifest": {
"$ref": "#/$defs/stageId"
},
"evidence-manifest": {
"$ref": "#/$defs/stageId"
}
}
},
"rerun_scope": {
"const": "affected-downstream-stages-only"
},
"unresolved_blockers_stop_promotion": {
"const": true
}
}
}
}
}