diff --git a/schemas/imports/profit-mpcc/README.md b/schemas/imports/profit-mpcc/README.md new file mode 100644 index 0000000..09a2f56 --- /dev/null +++ b/schemas/imports/profit-mpcc/README.md @@ -0,0 +1,10 @@ +# Profit MPCC execution-facing imports + +This directory stages narrow execution-facing contracts imported from `mdheller/profit-mpcc`. + +Current imported drafts: +- `effect-request.schema.v0.json` +- `approval-event.schema.v0.json` +- `effect-record.schema.v0.json` + +These are intake copies for review and alignment inside the execution lane. They are not yet the canonical upstream source of truth. diff --git a/schemas/imports/profit-mpcc/approval-event.schema.v0.json b/schemas/imports/profit-mpcc/approval-event.schema.v0.json new file mode 100644 index 0000000..10702cf --- /dev/null +++ b/schemas/imports/profit-mpcc/approval-event.schema.v0.json @@ -0,0 +1,51 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.org/schemas/approval-event.schema.json", + "title": "ApprovalEvent", + "type": "object", + "required": [ + "approval_event_id", + "effect_id", + "decision", + "approver_id", + "approved_at" + ], + "properties": { + "approval_event_id": { "type": "string" }, + "effect_id": { "type": "string" }, + "decision": { + "type": "string", + "enum": ["approved", "denied", "pending", "expired", "revoked"] + }, + "approver_id": { "type": "string" }, + "authority_context": { + "type": "object", + "additionalProperties": true + }, + "policy_basis": { + "type": "array", + "items": { "type": "string" } + }, + "approved_effect": { + "type": ["object", "null"], + "additionalProperties": true + }, + "reasons": { + "type": "array", + "items": { "type": "string" } + }, + "approved_at": { + "type": "string", + "format": "date-time" + }, + "expires_at": { + "type": "string", + "format": "date-time" + }, + "provenance_links": { + "type": "array", + "items": { "type": "object" } + } + }, + "additionalProperties": true +} diff --git a/schemas/imports/profit-mpcc/effect-record.schema.v0.json b/schemas/imports/profit-mpcc/effect-record.schema.v0.json new file mode 100644 index 0000000..b6acee2 --- /dev/null +++ b/schemas/imports/profit-mpcc/effect-record.schema.v0.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.org/schemas/effect-record.schema.json", + "title": "EffectRecord", + "type": "object", + "required": [ + "effect_record_id", + "effect_id", + "execution_status" + ], + "properties": { + "effect_record_id": { "type": "string" }, + "effect_id": { "type": "string" }, + "execution_status": { + "type": "string", + "enum": ["authorized", "executed", "failed", "skipped", "compensated"] + }, + "executor_id": { "type": "string" }, + "execution_context": { + "type": "object", + "additionalProperties": true + }, + "actual_effect": { + "type": "object", + "additionalProperties": true + }, + "approved_by": { "type": "string" }, + "idempotence_key": { "type": "string" }, + "started_at": { + "type": "string", + "format": "date-time" + }, + "completed_at": { + "type": "string", + "format": "date-time" + }, + "compensation_refs": { + "type": "array", + "items": { "type": "string" } + }, + "policy_labels": { + "type": "array", + "items": { "type": "string" } + }, + "risk_labels": { + "type": "array", + "items": { "type": "string" } + }, + "provenance_links": { + "type": "array", + "items": { "type": "object" } + } + }, + "additionalProperties": true +} diff --git a/schemas/imports/profit-mpcc/effect-request.schema.v0.json b/schemas/imports/profit-mpcc/effect-request.schema.v0.json new file mode 100644 index 0000000..34b37c1 --- /dev/null +++ b/schemas/imports/profit-mpcc/effect-request.schema.v0.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.org/schemas/effect-request.schema.json", + "title": "EffectRequest", + "type": "object", + "required": [ + "effect_id", + "requested_by_event_id", + "requested_at", + "operation" + ], + "properties": { + "effect_id": { "type": "string" }, + "requested_by_event_id": { "type": "string" }, + "requested_by_actor_id": { "type": "string" }, + "workspace_id": { "type": "string" }, + "branch_id": { "type": "string" }, + "target_kind": { "type": "string" }, + "operation": { "type": "string" }, + "parameters": { + "type": "object", + "additionalProperties": true + }, + "authority_context_ref": { "type": "string" }, + "idempotence_key": { "type": "string" }, + "policy_labels": { + "type": "array", + "items": { "type": "string" } + }, + "risk_labels": { + "type": "array", + "items": { "type": "string" } + }, + "requested_at": { + "type": "string", + "format": "date-time" + }, + "notes": { "type": "string" } + }, + "additionalProperties": true +}