Files
repo-scoping/docs/schemas/self-scoping-assessment.schema.json

635 lines
16 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://repo-scoping.local/schemas/self-scoping-assessment.schema.json",
"title": "Self-Scoping Assessment Artifact",
"description": "Immutable artifact used to compare repo-scoping self-analysis results across engine releases.",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version",
"artifact_id",
"artifact_type",
"created_at",
"target_repository",
"engine_identity",
"execution",
"assessment",
"fact_summary",
"content_chunk_summary",
"generated_tree",
"approved_map",
"review_decisions",
"quality_gate_outcomes",
"known_regression_patterns"
],
"properties": {
"schema_version": {
"const": "self-scoping-assessment/v1"
},
"artifact_id": {
"type": "string",
"description": "Stable artifact identifier."
},
"artifact_type": {
"enum": ["assessment_run"]
},
"created_at": {
"type": "string",
"format": "date-time"
},
"target_repository": {
"$ref": "#/$defs/targetRepository"
},
"engine_identity": {
"$ref": "#/$defs/engineIdentity"
},
"execution": {
"$ref": "#/$defs/execution"
},
"assessment": {
"$ref": "#/$defs/assessment"
},
"fact_summary": {
"$ref": "#/$defs/factSummary"
},
"content_chunk_summary": {
"$ref": "#/$defs/contentChunkSummary"
},
"generated_tree": {
"$ref": "#/$defs/generatedTree"
},
"approved_map": {
"$ref": "#/$defs/approvedMap"
},
"review_decisions": {
"type": "array",
"items": {
"$ref": "#/$defs/reviewDecision"
}
},
"quality_gate_outcomes": {
"type": "array",
"items": {
"$ref": "#/$defs/qualityGateOutcome"
}
},
"known_regression_patterns": {
"type": "array",
"items": {
"$ref": "#/$defs/regressionPattern"
}
},
"notes": {
"type": "array",
"items": {
"type": "string"
}
}
},
"$defs": {
"targetRepository": {
"type": "object",
"additionalProperties": false,
"required": [
"repo_slug",
"repository_id",
"source",
"target_commit",
"target_branch",
"dirty_state",
"file_count"
],
"properties": {
"repo_slug": {
"type": "string"
},
"repository_id": {
"type": ["integer", "null"]
},
"source": {
"type": "string"
},
"target_commit": {
"type": "string"
},
"target_branch": {
"type": "string"
},
"dirty_state": {
"enum": ["clean", "dirty", "unknown"]
},
"file_count": {
"type": ["integer", "null"],
"minimum": 0
}
}
},
"engineIdentity": {
"type": "object",
"additionalProperties": false,
"required": [
"repo_scoping_version",
"engine_commit",
"engine_release",
"engine_dirty_state",
"scanner_version",
"candidate_generator_version",
"quality_criteria_version",
"prompt_version",
"release_binding_status"
],
"properties": {
"repo_scoping_version": {
"type": "string"
},
"engine_commit": {
"type": ["string", "null"]
},
"engine_release": {
"type": ["string", "null"]
},
"engine_dirty_state": {
"enum": ["clean", "dirty", "unknown"]
},
"scanner_version": {
"type": "string"
},
"candidate_generator_version": {
"type": "string"
},
"quality_criteria_version": {
"type": "string"
},
"prompt_version": {
"type": ["string", "null"]
},
"release_binding_status": {
"enum": ["complete", "historical_incomplete", "unbound"]
},
"release_binding_note": {
"type": "string"
}
}
},
"execution": {
"type": "object",
"additionalProperties": false,
"required": [
"mode",
"analysis_run_id",
"candidate_source",
"acceptance_mode"
],
"properties": {
"mode": {
"enum": [
"deterministic-only",
"llm-assisted",
"agent-reviewed",
"manual-review",
"trusted-auto-review",
"mixed"
]
},
"analysis_run_id": {
"type": ["integer", "null"]
},
"candidate_source": {
"type": "string"
},
"acceptance_mode": {
"type": "string"
},
"started_at": {
"type": ["string", "null"],
"format": "date-time"
},
"completed_at": {
"type": ["string", "null"],
"format": "date-time"
}
}
},
"assessment": {
"type": "object",
"additionalProperties": false,
"required": [
"role",
"outcome",
"summary",
"reviewer",
"comparison_eligibility"
],
"properties": {
"role": {
"enum": ["baseline", "challenger", "negative_regression_seed"]
},
"outcome": {
"enum": ["baseline", "challenger", "preferred", "tied", "rejected", "superseded", "needs-human"]
},
"summary": {
"type": "string"
},
"reviewer": {
"type": "string"
},
"comparison_eligibility": {
"enum": ["eligible", "eligible_as_negative_seed", "not_comparable"]
},
"rationale": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"factSummary": {
"type": "object",
"additionalProperties": false,
"required": ["counts_by_kind"],
"properties": {
"counts_by_kind": {
"type": "object",
"additionalProperties": {
"type": "integer",
"minimum": 0
}
},
"contamination_sources": {
"type": "array",
"items": {
"$ref": "#/$defs/contaminationSource"
}
}
}
},
"contaminationSource": {
"type": "object",
"additionalProperties": false,
"required": ["path", "reason"],
"properties": {
"path": {
"type": "string"
},
"reason": {
"type": "string"
}
}
},
"contentChunkSummary": {
"type": "object",
"additionalProperties": false,
"required": ["total", "counts_by_kind", "counts_by_source_role", "paths"],
"properties": {
"total": {
"type": "integer",
"minimum": 0
},
"counts_by_kind": {
"type": "object",
"additionalProperties": {
"type": "integer",
"minimum": 0
}
},
"counts_by_source_role": {
"type": "object",
"additionalProperties": {
"type": "integer",
"minimum": 0
}
},
"paths": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"generatedTree": {
"type": "object",
"additionalProperties": false,
"required": ["abilities"],
"properties": {
"abilities": {
"type": "array",
"items": {
"$ref": "#/$defs/ability"
}
}
}
},
"ability": {
"type": "object",
"additionalProperties": false,
"required": ["name", "status", "primary_class", "source_refs", "capabilities"],
"properties": {
"name": {
"type": "string"
},
"status": {
"type": "string"
},
"primary_class": {
"type": "string"
},
"source_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/sourceRef"
}
},
"capabilities": {
"type": "array",
"items": {
"$ref": "#/$defs/capability"
}
}
}
},
"capability": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"status",
"primary_class",
"source_refs",
"features",
"evidence"
],
"properties": {
"name": {
"type": "string"
},
"status": {
"type": "string"
},
"primary_class": {
"type": "string"
},
"source_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/sourceRef"
}
},
"features": {
"type": "array",
"items": {
"$ref": "#/$defs/feature"
}
},
"evidence": {
"type": "array",
"items": {
"$ref": "#/$defs/candidateEvidence"
}
}
}
},
"feature": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"type",
"status",
"primary_class",
"location",
"source_refs"
],
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"status": {
"type": "string"
},
"primary_class": {
"type": "string"
},
"location": {
"type": "string"
},
"source_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/sourceRef"
}
}
}
},
"candidateEvidence": {
"type": "object",
"additionalProperties": false,
"required": ["type", "reference", "strength", "status", "source_refs"],
"properties": {
"type": {
"type": "string"
},
"reference": {
"type": "string"
},
"strength": {
"type": "string"
},
"status": {
"type": "string"
},
"source_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/sourceRef"
}
}
}
},
"sourceRef": {
"type": "object",
"additionalProperties": false,
"required": ["fact_id", "path", "kind", "name", "line"],
"properties": {
"fact_id": {
"type": ["integer", "null"]
},
"path": {
"type": "string"
},
"kind": {
"type": "string"
},
"name": {
"type": "string"
},
"line": {
"type": ["integer", "null"]
}
}
},
"approvedMap": {
"type": "object",
"description": "Current approved ability map at export time.",
"additionalProperties": true
},
"reviewDecision": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"repository_id",
"analysis_run_id",
"action",
"notes",
"created_at"
],
"properties": {
"id": {
"type": "integer"
},
"repository_id": {
"type": "integer"
},
"analysis_run_id": {
"type": ["integer", "null"]
},
"action": {
"type": "string"
},
"notes": {
"type": "string"
},
"created_at": {
"type": "string"
}
}
},
"qualityGateOutcome": {
"type": "object",
"description": "Versioned deterministic quality-gate outcome. Empty until RREG-WP-0014 introduces gates.",
"additionalProperties": true
},
"regressionPattern": {
"type": "object",
"additionalProperties": false,
"required": ["id", "title", "severity", "description", "detection_hint"],
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"severity": {
"enum": ["low", "medium", "high", "critical"]
},
"description": {
"type": "string"
},
"detection_hint": {
"type": "string"
}
}
}
},
"examples": [
{
"schema_version": "self-scoping-assessment/v1",
"artifact_id": "repo-scoping-known-bad-2026-05-15-run-39",
"artifact_type": "assessment_run",
"created_at": "2026-05-15T09:28:48Z",
"target_repository": {
"repo_slug": "repo-scoping",
"repository_id": 16,
"source": "/home/worsch/repo-scoping/var/checkouts/repo-scoping-8a9c4168485c",
"target_commit": "00b57d509124789059639fedc724d9314edbb7b2",
"target_branch": "main",
"dirty_state": "unknown",
"file_count": 96
},
"engine_identity": {
"repo_scoping_version": "0.1.0",
"engine_commit": null,
"engine_release": null,
"engine_dirty_state": "unknown",
"scanner_version": "deterministic-v0.1",
"candidate_generator_version": "unversioned",
"quality_criteria_version": "none",
"prompt_version": null,
"release_binding_status": "historical_incomplete",
"release_binding_note": "Historical database run did not record engine commit."
},
"execution": {
"mode": "trusted-auto-review",
"analysis_run_id": 39,
"candidate_source": "deterministic",
"acceptance_mode": "trusted_auto_approve_candidate_graph",
"started_at": "2026-05-15T09:28:47Z",
"completed_at": "2026-05-15T09:28:48Z"
},
"assessment": {
"role": "negative_regression_seed",
"outcome": "rejected",
"summary": "Provider vocabulary was promoted into a false native LLM routing capability.",
"reviewer": "codex",
"comparison_eligibility": "eligible_as_negative_seed",
"rationale": ["The generated tree misclassified scanner vocabulary as product behavior."]
},
"fact_summary": {
"counts_by_kind": {
"llm_provider": 41
},
"contamination_sources": [
{
"path": "src/repo_scoping/repo_scanning/scanner.py",
"reason": "Scanner rule vocabulary was treated as repo-owned capability evidence."
}
]
},
"content_chunk_summary": {
"total": 0,
"counts_by_kind": {},
"counts_by_source_role": {},
"paths": []
},
"generated_tree": {
"abilities": [
{
"name": "Support Repo Registry",
"status": "approved",
"primary_class": "repository-intelligence",
"source_refs": [],
"capabilities": [
{
"name": "Route LLM Requests Across Providers",
"status": "approved",
"primary_class": "llm-integration",
"source_refs": [],
"features": [],
"evidence": []
}
]
}
]
},
"approved_map": {},
"review_decisions": [],
"quality_gate_outcomes": [],
"known_regression_patterns": [
{
"id": "RREG-SELF-REG-001",
"title": "LLM provider vocabulary promoted as native capability",
"severity": "critical",
"description": "Scanner or fixture vocabulary becomes a repo-scoping product capability.",
"detection_hint": "Flag Route LLM Requests Across Providers when parented as a native repo-scoping capability."
}
]
}
]
}