Contracts
mission-dossier-artifact-indexed.schema.json
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Mission Dossier Artifact Indexed Event", "description": "Emitted when an artifact is successfully indexed in the dossier", "type": "object", "properties": { "event_type": { "type": "string", "enum": ["mission_dossier_artifact_indexed"], "description": "Event type identifier" }, "event_id": { "type": "string", "pattern": "^[0-9a-f]{26}$", "description": "Unique event identifier (ULID format)" }, "feature_slug": { "type": "string", "pattern": "^[0-9]{3}-[a-z0-9\\-]+$", "description": "Feature identifier (e.g., '042-local-mission-dossier')" }, "actor": { "type": "string", "description": "Actor who triggered the scan (e.g., 'claude', 'curator')" }, "timestamp": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp when event was emitted" }, "payload": { "type": "object", "properties": { "artifact_key": { "type": "string", "description": "Stable, unique key for artifact (e.g., 'input.spec.main')" }, "artifact_class": { "type": "string", "enum": ["input", "workflow", "output", "evidence", "policy", "runtime"], "description": "Classification of artifact (deterministic, 6 classes)" }, "relative_path": { "type": "string", "description": "Path relative to feature directory (e.g., 'spec.md')" }, "content_hash_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA256 hash of artifact content (64 hex chars)" }, "size_bytes": { "type": "integer", "minimum": 0, "description": "File size in bytes" }, "wp_id": { "type": ["string", "null"], "description": "Work package ID if applicable (e.g., 'WP01')" }, "step_id": { "type": ["string", "null"], "description": "Mission step if applicable (e.g., 'planning')" }, "required_status": { "type": "string", "enum": ["required", "optional"], "description": "Whether artifact is required or optional" } }, "required": [ "artifact_key", "artifact_class", "relative_path", "content_hash_sha256", "size_bytes", "required_status" ] } }, "required": ["event_type", "feature_slug", "actor", "timestamp", "payload"] }
mission-dossier-artifact-missing.schema.json
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Mission Dossier Artifact Missing Event", "description": "Anomaly event emitted when a required artifact is missing or unreadable", "type": "object", "properties": { "event_type": { "type": "string", "enum": ["mission_dossier_artifact_missing"], "description": "Event type identifier" }, "event_id": { "type": "string", "pattern": "^[0-9a-f]{26}$", "description": "Unique event identifier (ULID format)" }, "feature_slug": { "type": "string", "pattern": "^[0-9]{3}-[a-z0-9\\-]+$", "description": "Feature identifier" }, "actor": { "type": "string", "description": "Actor who triggered the scan" }, "timestamp": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp when event was emitted" }, "payload": { "type": "object", "properties": { "artifact_key": { "type": "string", "description": "Stable key for the missing artifact" }, "artifact_class": { "type": "string", "enum": ["input", "workflow", "output", "evidence", "policy", "runtime"], "description": "Classification of missing artifact (6 classes)" }, "expected_path_pattern": { "type": "string", "description": "Path pattern from manifest (e.g., 'spec.md' or 'tasks/*.md')" }, "reason_code": { "type": "string", "enum": ["not_found", "unreadable", "invalid_format", "deleted_after_scan"], "description": "Reason artifact is missing or inaccessible" }, "reason_detail": { "type": ["string", "null"], "description": "Additional detail (e.g., permission error message)" }, "blocking": { "type": "boolean", "description": "True if missing artifact blocks completeness" } }, "required": [ "artifact_key", "artifact_class", "expected_path_pattern", "reason_code", "blocking" ] } }, "required": ["event_type", "feature_slug", "actor", "timestamp", "payload"] }
mission-dossier-parity-drift-detected.schema.json
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Mission Dossier Parity Drift Detected Event", "description": "Anomaly event emitted when local parity hash differs from cached baseline", "type": "object", "properties": { "event_type": { "type": "string", "enum": ["mission_dossier_parity_drift_detected"], "description": "Event type identifier" }, "event_id": { "type": "string", "pattern": "^[0-9a-f]{26}$", "description": "Unique event identifier (ULID format)" }, "feature_slug": { "type": "string", "pattern": "^[0-9]{3}-[a-z0-9\\-]+$", "description": "Feature identifier" }, "actor": { "type": "string", "description": "Actor who triggered the scan" }, "timestamp": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp when event was emitted" }, "payload": { "type": "object", "properties": { "local_parity_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "Current local parity hash" }, "baseline_parity_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "Last-known baseline parity hash (from SaaS or local cache)" }, "missing_in_local": { "type": "array", "items": { "type": "string" }, "description": "Artifact keys present in baseline but missing in local" }, "missing_in_baseline": { "type": "array", "items": { "type": "string" }, "description": "Artifact keys present in local but missing in baseline" }, "severity": { "type": "string", "enum": ["info", "warning", "error"], "description": "'info' for new artifacts, 'warning' for modified, 'error' for deleted required" } }, "required": [ "local_parity_hash", "baseline_parity_hash", "missing_in_local", "missing_in_baseline", "severity" ] } }, "required": ["event_type", "feature_slug", "actor", "timestamp", "payload"] }
mission-dossier-snapshot-computed.schema.json
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Mission Dossier Snapshot Computed Event", "description": "Emitted after dossier finalization with parity hash and completeness status", "type": "object", "properties": { "event_type": { "type": "string", "enum": ["mission_dossier_snapshot_computed"], "description": "Event type identifier" }, "event_id": { "type": "string", "pattern": "^[0-9a-f]{26}$", "description": "Unique event identifier (ULID format)" }, "feature_slug": { "type": "string", "pattern": "^[0-9]{3}-[a-z0-9\\-]+$", "description": "Feature identifier" }, "actor": { "type": "string", "description": "Actor who triggered the scan" }, "timestamp": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp when event was emitted" }, "payload": { "type": "object", "properties": { "snapshot_id": { "type": "string", "format": "uuid", "description": "Unique snapshot identifier" }, "parity_hash_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "Deterministic parity hash (SHA256) for artifact catalog" }, "artifact_counts": { "type": "object", "properties": { "total": { "type": "integer", "minimum": 0, "description": "Total number of indexed artifacts" }, "required": { "type": "integer", "minimum": 0, "description": "Total required artifacts (from manifest)" }, "required_present": { "type": "integer", "minimum": 0, "description": "Required artifacts that are present" }, "required_missing": { "type": "integer", "minimum": 0, "description": "Required artifacts that are missing (blocking)" }, "optional": { "type": "integer", "minimum": 0, "description": "Total optional artifacts" }, "optional_present": { "type": "integer", "minimum": 0, "description": "Optional artifacts that are present" } }, "required": [ "total", "required", "required_present", "required_missing", "optional", "optional_present" ] }, "completeness_status": { "type": "string", "enum": ["complete", "incomplete", "unknown"], "description": "'complete' if all required artifacts present, 'incomplete' if any missing, 'unknown' if no manifest" } }, "required": [ "snapshot_id", "parity_hash_sha256", "artifact_counts", "completeness_status" ] } }, "required": ["event_type", "feature_slug", "actor", "timestamp", "payload"] }