Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
478 changes: 478 additions & 0 deletions harness/lib/research/decision_artifact.py

Large diffs are not rendered by default.

181 changes: 181 additions & 0 deletions harness/schemas/evidence/decision_artifact.v1.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://solar.local/schemas/evidence/decision_artifact.v1.schema.json",
"title": "Solar Evidence ABI - Decision Artifact",
"type": "object",
"required": [
"schema",
"decision_id",
"title",
"problem",
"decision_status",
"alternatives",
"criteria",
"evidence_links",
"assessments",
"risks",
"recommendation",
"limitations",
"review",
"approval",
"next_action",
"provenance"
],
"additionalProperties": false,
"properties": {
"schema": {"const": "decision_artifact.v1"},
"decision_id": {"type": "string", "minLength": 1},
"title": {"type": "string", "minLength": 1},
"problem": {"type": "string", "minLength": 1},
"decision_status": {"const": "review_required"},
"alternatives": {
"type": "array",
"minItems": 2,
"items": {"$ref": "#/$defs/alternative"}
},
"criteria": {
"type": "array",
"minItems": 1,
"items": {"$ref": "#/$defs/criterion"}
},
"evidence_links": {
"type": "array",
"minItems": 1,
"items": {"$ref": "#/$defs/evidenceLink"}
},
"assessments": {
"type": "array",
"minItems": 1,
"items": {"$ref": "#/$defs/assessment"}
},
"risks": {
"type": "array",
"minItems": 1,
"items": {"$ref": "#/$defs/risk"}
},
"recommendation": {"$ref": "#/$defs/recommendation"},
"limitations": {
"type": "array",
"minItems": 1,
"items": {"type": "string", "minLength": 1}
},
"review": {"$ref": "#/$defs/review"},
"approval": {"$ref": "#/$defs/approval"},
"next_action": {"type": "string", "minLength": 1},
"provenance": {"$ref": "#/$defs/provenance"}
},
"$defs": {
"ids": {
"type": "array",
"minItems": 1,
"items": {"type": "string", "minLength": 1},
"uniqueItems": true
},
"alternative": {
"type": "object",
"required": ["alternative_id", "title", "description"],
"additionalProperties": false,
"properties": {
"alternative_id": {"type": "string", "minLength": 1},
"title": {"type": "string", "minLength": 1},
"description": {"type": "string", "minLength": 1}
}
},
"criterion": {
"type": "object",
"required": ["criterion_id", "name", "weight"],
"additionalProperties": false,
"properties": {
"criterion_id": {"type": "string", "minLength": 1},
"name": {"type": "string", "minLength": 1},
"weight": {"type": "number", "exclusiveMinimum": 0, "maximum": 1}
}
},
"evidenceLink": {
"type": "object",
"required": ["evidence_id", "evidence_type", "source_path", "sha256", "semantic_locator", "observed_support", "summary"],
"additionalProperties": false,
"properties": {
"evidence_id": {"type": "string", "minLength": 1},
"evidence_type": {"type": "string", "enum": ["claim_verdict", "experiment_result"]},
"source_path": {"type": "string", "minLength": 1},
"sha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
"semantic_locator": {"type": "string", "pattern": "^/"},
"observed_support": {},
"summary": {"type": "string", "minLength": 1},
"supporting_evidence_ids": {"$ref": "#/$defs/ids"}
}
},
"assessment": {
"type": "object",
"required": ["alternative_id", "criterion_id", "score", "rationale", "evidence_ids"],
"additionalProperties": false,
"properties": {
"alternative_id": {"type": "string", "minLength": 1},
"criterion_id": {"type": "string", "minLength": 1},
"score": {"type": "number", "minimum": 0, "maximum": 5},
"rationale": {"type": "string", "minLength": 1},
"evidence_ids": {"$ref": "#/$defs/ids"}
}
},
"risk": {
"type": "object",
"required": ["risk_id", "description", "mitigation", "evidence_ids"],
"additionalProperties": false,
"properties": {
"risk_id": {"type": "string", "minLength": 1},
"description": {"type": "string", "minLength": 1},
"mitigation": {"type": "string", "minLength": 1},
"evidence_ids": {"$ref": "#/$defs/ids"}
}
},
"recommendation": {
"type": "object",
"required": ["alternative_id", "rationale", "criterion_ids", "evidence_ids"],
"additionalProperties": false,
"properties": {
"alternative_id": {"type": "string", "minLength": 1},
"rationale": {"type": "string", "minLength": 1},
"criterion_ids": {"$ref": "#/$defs/ids"},
"evidence_ids": {"$ref": "#/$defs/ids"}
}
},
"review": {
"type": "object",
"required": ["status", "unresolved_items", "reviewed_by", "review_evidence"],
"additionalProperties": false,
"properties": {
"status": {"const": "pending"},
"unresolved_items": {
"type": "array",
"minItems": 1,
"items": {"type": "string", "minLength": 1}
},
"reviewed_by": {"type": "null"},
"review_evidence": {"type": "array", "maxItems": 0}
}
},
"approval": {
"type": "object",
"required": ["status", "approved_by", "approval_evidence"],
"additionalProperties": false,
"properties": {
"status": {"const": "not_requested"},
"approved_by": {"type": "null"},
"approval_evidence": {"type": "array", "maxItems": 0}
}
},
"provenance": {
"type": "object",
"required": ["constructor", "constructed_at", "request_path", "request_sha256", "source_root"],
"additionalProperties": false,
"properties": {
"constructor": {"const": "harness.lib.research.decision_artifact.construct_decision_artifact"},
"constructed_at": {"type": "string", "format": "date-time"},
"request_path": {"type": "string", "minLength": 1},
"request_sha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
"source_root": {"type": "string", "minLength": 1}
}
}
}
}
111 changes: 111 additions & 0 deletions harness/schemas/evidence/publication_delivery_handoff.v1.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://solar.local/schemas/evidence/publication_delivery_handoff.v1.schema.json",
"title": "Solar Publication Delivery Handoff",
"type": "object",
"additionalProperties": false,
"required": [
"schema", "delivery_id", "audience", "delivery_format", "content_scope",
"permissions", "handoff_checklist", "files", "evidence_index", "provenance", "limitations"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows a manifest to claim external_email permissions without including any external_delivery evidence.

],
"properties": {
"schema": {"const": "publication_delivery_handoff.v1"},
"delivery_id": {"type": "string", "minLength": 1},
"audience": {
"type": "object",
"additionalProperties": false,
"required": ["role"],
"properties": {
"role": {"type": "string", "minLength": 1},
"description": {"type": "string"}
}
},
"delivery_format": {"type": "string", "enum": ["markdown_bundle", "paper_bundle", "mixed_bundle"]},
"content_scope": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}},
"permissions": {
"type": "object",
"additionalProperties": false,
"required": ["distribution_scope", "approval_required", "approval_state"],
"properties": {
"distribution_scope": {"enum": ["local_only", "external_email"]},
"approval_required": {"const": true},
"approval_state": {"enum": ["not_requested", "pending", "approved"]},
"approval_ref": {"type": "string"},
"approved_by": {"type": "string"},
"approved_at": {"type": "string", "format": "date-time"}
}
},
"external_delivery": {
"type": "object",
"additionalProperties": false,
"required": ["channel", "recipient", "status", "delivered", "approval_ref", "runtime_evidence_path", "runtime_evidence_sha256"],
"properties": {
"channel": {"enum": ["gmail", "smtp", "gmail_smtp"]},
"recipient": {"type": "string", "minLength": 3},
"status": {"const": "completed"},
"delivered": {"const": true},
"approval_ref": {"type": "string", "minLength": 1},
"provider": {"type": "string"},
"runtime_evidence_path": {"type": "string", "pattern": "^files/[^/]+$"},
"runtime_evidence_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"recipient_acceptance_required": {"type": "boolean"}
}
},
"handoff_checklist": {
"type": "array",
"minItems": 5,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["check_id", "status", "evidence"],
"properties": {
"check_id": {"type": "string", "minLength": 1},
"status": {"const": "completed"},
"evidence": {"type": "string", "minLength": 1}
}
}
},
"files": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/file"}},
"evidence_index": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["evidence_id", "file_id", "sha256"],
"properties": {
"evidence_id": {"type": "string", "minLength": 1},
"file_id": {"type": "string", "minLength": 1},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
}
}
},
"provenance": {
"type": "object",
"additionalProperties": false,
"required": ["request_sha256", "constructed_at", "tool"],
"properties": {
"request_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"constructed_at": {"type": "string", "format": "date-time"},
"tool": {"const": "harness/tools/publication_delivery_bundle.py"}
}
},
"limitations": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}}
},
"$defs": {
"file": {
"type": "object",
"additionalProperties": false,
"required": ["file_id", "type", "path", "bytes", "sha256", "source_sha256", "evidence_ids"],
"properties": {
"file_id": {"type": "string", "minLength": 1},
"type": {"type": "string", "minLength": 1},
"path": {"type": "string", "pattern": "^files/[^/]+$"},
"bytes": {"type": "integer", "minimum": 1},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"source_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"evidence_ids": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}}
}
}
}
}
Loading
Loading