| { |
| "$schema": "https://json-schema.org/draft/2020-12/schema", |
| "$id": "urn:awesome-loop-engineering:loop-contract", |
| "title": "Loop Engineering Contract", |
| "description": "A portable contract for recurring AI-agent loops.", |
| "type": "object", |
| "additionalProperties": false, |
| "required": [ |
| "name", |
| "objective", |
| "trigger", |
| "intake", |
| "workspace", |
| "context", |
| "agents", |
| "verification", |
| "state", |
| "budget", |
| "escalation", |
| "exit" |
| ], |
| "properties": { |
| "name": { |
| "type": "string", |
| "minLength": 1 |
| }, |
| "objective": { |
| "type": "string", |
| "minLength": 1 |
| }, |
| "trigger": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["type", "cadence_or_event"], |
| "properties": { |
| "type": { |
| "type": "string", |
| "enum": ["scheduled", "event", "goal", "manual-bootstrap"] |
| }, |
| "cadence_or_event": { |
| "type": "string", |
| "minLength": 1 |
| } |
| } |
| }, |
| "intake": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["sources", "selection_rule"], |
| "properties": { |
| "sources": { |
| "type": "array", |
| "minItems": 1, |
| "items": { |
| "type": "string", |
| "minLength": 1 |
| } |
| }, |
| "selection_rule": { |
| "type": "string", |
| "minLength": 1 |
| } |
| } |
| }, |
| "workspace": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["isolation", "allowed_actions", "disallowed_actions"], |
| "properties": { |
| "isolation": { |
| "type": "string", |
| "minLength": 1 |
| }, |
| "allowed_actions": { |
| "type": "array", |
| "items": { |
| "type": "string", |
| "minLength": 1 |
| } |
| }, |
| "disallowed_actions": { |
| "type": "array", |
| "items": { |
| "type": "string", |
| "minLength": 1 |
| } |
| } |
| } |
| }, |
| "context": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["required_files", "runtime_sources"], |
| "properties": { |
| "required_files": { |
| "type": "array", |
| "items": { |
| "type": "string", |
| "minLength": 1 |
| } |
| }, |
| "runtime_sources": { |
| "type": "array", |
| "items": { |
| "type": "string", |
| "minLength": 1 |
| } |
| } |
| } |
| }, |
| "agents": { |
| "type": "array", |
| "minItems": 1, |
| "items": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["role", "responsibility"], |
| "properties": { |
| "role": { |
| "type": "string", |
| "minLength": 1 |
| }, |
| "responsibility": { |
| "type": "string", |
| "minLength": 1 |
| } |
| } |
| } |
| }, |
| "verification": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["gates", "receipts"], |
| "properties": { |
| "gates": { |
| "type": "array", |
| "minItems": 1, |
| "items": { |
| "type": "string", |
| "minLength": 1 |
| } |
| }, |
| "receipts": { |
| "type": "array", |
| "minItems": 1, |
| "items": { |
| "type": "string", |
| "minLength": 1 |
| } |
| } |
| } |
| }, |
| "state": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["artifacts", "update_rule"], |
| "properties": { |
| "artifacts": { |
| "type": "array", |
| "minItems": 1, |
| "items": { |
| "type": "string", |
| "minLength": 1 |
| } |
| }, |
| "update_rule": { |
| "type": "string", |
| "minLength": 1 |
| } |
| } |
| }, |
| "budget": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["max_retries", "max_runtime_minutes"], |
| "properties": { |
| "max_retries": { |
| "type": "integer", |
| "minimum": 0 |
| }, |
| "max_runtime_minutes": { |
| "type": "integer", |
| "minimum": 1 |
| } |
| } |
| }, |
| "escalation": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["conditions", "destination"], |
| "properties": { |
| "conditions": { |
| "type": "array", |
| "minItems": 1, |
| "items": { |
| "type": "string", |
| "minLength": 1 |
| } |
| }, |
| "destination": { |
| "type": "string", |
| "minLength": 1 |
| } |
| } |
| }, |
| "exit": { |
| "type": "object", |
| "additionalProperties": false, |
| "required": ["success", "stop_without_success"], |
| "properties": { |
| "success": { |
| "type": "string", |
| "minLength": 1 |
| }, |
| "stop_without_success": { |
| "type": "string", |
| "minLength": 1 |
| } |
| } |
| } |
| } |
| } |
|
|