@namewta/speculo 0.8.9 → 0.8.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/src/structured.js +186 -0
  2. package/dist/src/structured.js.map +1 -1
  3. package/package.json +1 -1
  4. package/template/commands/archive-and-consolidate.md +9 -0
  5. package/template/commands/status.md +3 -3
  6. package/template/workflows/ops/A-archive-and-learn/A-archive-and-learn.md +64 -0
  7. package/template/workflows/ops/A-archive-and-learn/promotion-plan-template.md +41 -0
  8. package/template/workflows/ops/A-archive-and-learn/retrospective-template.md +53 -0
  9. package/template/workflows/ops/E-execute-and-stabilize/E-execute-and-stabilize.md +75 -0
  10. package/template/workflows/ops/E-execute-and-stabilize/attempt-summary-template.md +44 -0
  11. package/template/workflows/ops/E-execute-and-stabilize/diagnosis-template.md +24 -0
  12. package/template/workflows/ops/E-execute-and-stabilize/handoff-template.md +32 -0
  13. package/template/workflows/ops/E-execute-and-stabilize/rollback-template.md +26 -0
  14. package/template/workflows/ops/E-execute-and-stabilize/verification-state-template.json +30 -0
  15. package/template/workflows/ops/E-execute-and-stabilize/verification-template.md +55 -0
  16. package/template/workflows/ops/I-intake-and-assess/I-intake-and-assess.md +66 -0
  17. package/template/workflows/ops/I-intake-and-assess/change-status-template.json +26 -0
  18. package/template/workflows/ops/I-intake-and-assess/collector-catalog.md +28 -0
  19. package/template/workflows/ops/I-intake-and-assess/deployment-dossier-template.md +62 -0
  20. package/template/workflows/ops/I-intake-and-assess/global-change-status-template.json +26 -0
  21. package/template/workflows/ops/I-intake-and-assess/project-detection.md +38 -0
  22. package/template/workflows/ops/I-intake-and-assess/request-template.md +44 -0
  23. package/template/workflows/ops/I-intake-and-assess/system-report-template.md +34 -0
  24. package/template/workflows/ops/I-intake-and-assess/target-profile-template.json +24 -0
  25. package/template/workflows/ops/INDEX.md +30 -0
  26. package/template/workflows/ops/P-plan-and-approve/P-plan-and-approve.md +65 -0
  27. package/template/workflows/ops/P-plan-and-approve/plan-review-template.md +78 -0
  28. package/template/workflows/ops/README.md +120 -0
  29. package/template/workflows/ops/_state/archive/.gitkeep +1 -0
  30. package/template/workflows/ops/_state/changes/.gitkeep +1 -0
  31. package/template/workflows/ops/_state/status.json +6 -0
  32. package/template/workflows/ops/common/rules/artifact-contract.md +37 -0
  33. package/template/workflows/ops/common/rules/closure-and-learning.md +25 -0
  34. package/template/workflows/ops/common/rules/evidence-and-redaction.md +22 -0
  35. package/template/workflows/ops/common/rules/execution-loop.md +27 -0
  36. package/template/workflows/ops/common/rules/path-and-scope-contract.md +21 -0
  37. package/template/workflows/ops/common/rules/plan-and-approval.md +25 -0
  38. package/template/workflows/ops/common/rules/project-and-change-scope.md +20 -0
  39. package/template/workflows/ops/common/rules/target-profile-and-release-gates.md +44 -0
  40. package/template/workflows/ops/common/schemas/approval.schema.json +28 -0
  41. package/template/workflows/ops/common/schemas/attempt.schema.json +42 -0
  42. package/template/workflows/ops/common/schemas/change-status.schema.json +43 -0
  43. package/template/workflows/ops/common/schemas/deployment-model.schema.json +26 -0
  44. package/template/workflows/ops/common/schemas/implementation-plan.schema.json +221 -0
  45. package/template/workflows/ops/common/schemas/inventory-snapshot.schema.json +31 -0
  46. package/template/workflows/ops/common/schemas/journal-event.schema.json +22 -0
  47. package/template/workflows/ops/common/schemas/project.schema.json +19 -0
  48. package/template/workflows/ops/common/schemas/promotion-approval.schema.json +20 -0
  49. package/template/workflows/ops/common/schemas/promotion-manifest.schema.json +22 -0
  50. package/template/workflows/ops/common/schemas/status.schema.json +30 -0
  51. package/template/workflows/ops/common/schemas/target-profile.schema.json +32 -0
  52. package/template/workflows/ops/common/schemas/verification-state.schema.json +30 -0
  53. package/template/workflows/ops/common/tools/close-change.mjs +177 -0
  54. package/template/workflows/ops/common/tools/validate-ops.mjs +992 -0
  55. package/template/workflows/ops/runtime-contract.json +14 -0
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:speculo:ops:change-status:v2",
4
+ "title": "Ops Change Status",
5
+ "type": "object",
6
+ "required": [
7
+ "schema_version", "artifact", "scope", "project_id", "change", "change_status", "phase",
8
+ "current_work", "works_run", "created_at", "updated_at", "completed_at", "archived_at",
9
+ "archive_path", "source_revision", "target_fingerprint", "plan_path", "plan_digest",
10
+ "approval_path", "approval_status", "approved_batches", "latest_attempt_id", "outcome", "blockers"
11
+ ],
12
+ "properties": {
13
+ "schema_version": {"const": 2},
14
+ "artifact": {"const": "ops-change-status"},
15
+ "scope": {"enum": ["global", "project"]},
16
+ "project_id": {"type": ["string", "null"], "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
17
+ "change": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"},
18
+ "change_status": {"enum": ["active", "blocked", "completed", "archived"]},
19
+ "phase": {"enum": ["intake", "assessment", "planning", "awaiting_approval", "approved", "executing", "diagnosing", "stabilizing", "ready_to_archive", "archived"]},
20
+ "current_work": {"anyOf": [{"type": "null"}, {"enum": ["ops/archive-and-learn", "ops/execute-and-stabilize", "ops/intake-and-assess", "ops/plan-and-approve"]}]},
21
+ "works_run": {"type": "array", "items": {"enum": ["ops/archive-and-learn", "ops/execute-and-stabilize", "ops/intake-and-assess", "ops/plan-and-approve"]}, "uniqueItems": true},
22
+ "created_at": {"type": "string", "format": "date-time"},
23
+ "updated_at": {"type": "string", "format": "date-time"},
24
+ "completed_at": {"type": ["string", "null"], "format": "date-time"},
25
+ "archived_at": {"type": ["string", "null"], "format": "date-time"},
26
+ "archive_path": {"type": ["string", "null"]},
27
+ "source_revision": {"type": ["string", "null"], "minLength": 1},
28
+ "target_fingerprint": {"type": ["string", "null"], "pattern": "^[a-f0-9]{64}$"},
29
+ "plan_path": {"anyOf": [{"type": "null"}, {"type": "string", "pattern": "^plan/plan-[0-9]{3}\\.json$"}]},
30
+ "plan_digest": {"type": ["string", "null"], "pattern": "^[a-f0-9]{64}$"},
31
+ "approval_path": {"anyOf": [{"type": "null"}, {"type": "string", "pattern": "^plan/approval-[0-9]{3}\\.json$"}]},
32
+ "approval_status": {"enum": ["not_requested", "pending", "approved", "invalidated"]},
33
+ "approved_batches": {"type": "array", "items": {"type": "string", "pattern": "^B[0-9]{2}$"}, "uniqueItems": true},
34
+ "latest_attempt_id": {"type": ["string", "null"], "pattern": "^ATTEMPT-[0-9]{3}$"},
35
+ "outcome": {"enum": ["pending", "succeeded", "rolled_back", "abandoned"]},
36
+ "blockers": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}
37
+ },
38
+ "allOf": [
39
+ {"if": {"properties": {"scope": {"const": "global"}}}, "then": {"properties": {"project_id": {"const": null}}}},
40
+ {"if": {"properties": {"scope": {"const": "project"}}}, "then": {"properties": {"project_id": {"type": "string"}}}}
41
+ ],
42
+ "additionalProperties": false
43
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:speculo:ops:deployment-model:v2",
4
+ "title": "Ops Deployment Model",
5
+ "type": "object",
6
+ "required": ["schema_version", "artifact", "scope", "project_id", "change", "generated_at", "project", "components", "dependencies", "configuration", "data", "deployment_options", "selected_method", "health_checks", "unknowns", "readiness"],
7
+ "properties": {
8
+ "schema_version": {"const": 2},
9
+ "artifact": {"const": "ops-deployment-model"},
10
+ "scope": {"enum": ["global", "project"]},
11
+ "project_id": {"type": ["string", "null"], "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
12
+ "change": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"},
13
+ "generated_at": {"type": "string", "format": "date-time"},
14
+ "project": {"anyOf": [{"type": "null"}, {"type": "object", "required": ["source_root", "source_revision", "languages", "build", "start"], "properties": {"source_root": {"type": "string", "minLength": 1}, "source_revision": {"type": "string", "minLength": 1}, "languages": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, "build": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, "start": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}}, "additionalProperties": false}]},
15
+ "components": {"type": "array", "items": {"type": "object", "required": ["id", "kind", "source"], "properties": {"id": {"type": "string"}, "kind": {"type": "string"}, "source": {"type": "string"}}, "additionalProperties": false}},
16
+ "dependencies": {"type": "array", "items": {"type": "object", "required": ["id", "kind", "required", "source", "target_disposition"], "properties": {"id": {"type": "string"}, "kind": {"type": "string"}, "required": {"type": "boolean"}, "source": {"type": "string"}, "target_disposition": {"enum": ["existing", "provision", "external", "unresolved"]}}, "additionalProperties": false}},
17
+ "configuration": {"type": "array", "items": {"type": "object", "required": ["key", "scope", "required", "secret", "source_ref"], "properties": {"key": {"type": "string", "minLength": 1}, "scope": {"enum": ["process", "service", "project", "container", "cluster", "global"]}, "required": {"type": "boolean"}, "secret": {"type": "boolean"}, "source_ref": {"type": ["string", "null"]}}, "additionalProperties": false}},
18
+ "data": {"type": "array", "items": {"type": "object", "required": ["id", "kind", "persistence", "migration"], "properties": {"id": {"type": "string"}, "kind": {"type": "string"}, "persistence": {"type": "string"}, "migration": {"type": ["string", "null"]}}, "additionalProperties": false}},
19
+ "deployment_options": {"type": "array", "items": {"type": "object", "required": ["id", "method", "evidence", "tradeoffs"], "properties": {"id": {"type": "string"}, "method": {"type": "string"}, "evidence": {"type": "array", "items": {"type": "string"}}, "tradeoffs": {"type": "array", "items": {"type": "string"}}}, "additionalProperties": false}},
20
+ "selected_method": {"type": ["string", "null"]},
21
+ "health_checks": {"type": "array", "items": {"type": "object", "required": ["id", "kind", "target", "success"], "properties": {"id": {"type": "string"}, "kind": {"type": "string"}, "target": {"type": "string"}, "success": {"type": "string"}}, "additionalProperties": false}},
22
+ "unknowns": {"type": "array", "items": {"type": "object", "required": ["id", "question", "blocking", "owner"], "properties": {"id": {"type": "string"}, "question": {"type": "string"}, "blocking": {"type": "boolean"}, "owner": {"type": "string"}}, "additionalProperties": false}},
23
+ "readiness": {"enum": ["blocked", "ready"]}
24
+ },
25
+ "additionalProperties": false
26
+ }
@@ -0,0 +1,221 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:speculo:ops:implementation-plan:v3",
4
+ "title": "Ops Implementation Plan",
5
+ "type": "object",
6
+ "required": ["schema_version", "artifact", "scope", "project_id", "plan_id", "change", "created_at", "supersedes_plan_path", "triggered_by_attempt", "depth", "status", "input_bindings", "scope_definition", "batches", "external_mutations", "global_environment_changes", "operations", "artifact_requirements", "gates", "data_protection", "retention_policy", "verification", "rollback_strategy", "blockers"],
7
+ "properties": {
8
+ "schema_version": {"const": 3},
9
+ "artifact": {"const": "ops-implementation-plan"},
10
+ "scope": {"enum": ["global", "project"]},
11
+ "project_id": {"type": ["string", "null"], "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
12
+ "plan_id": {"type": "string", "pattern": "^PLAN-[0-9]{3}$"},
13
+ "change": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"},
14
+ "created_at": {"type": "string", "format": "date-time"},
15
+ "supersedes_plan_path": {"anyOf": [{"type": "null"}, {"type": "string", "pattern": "^plan/plan-[0-9]{3}\\.json$"}]},
16
+ "triggered_by_attempt": {"type": ["string", "null"], "pattern": "^ATTEMPT-[0-9]{3}$"},
17
+ "depth": {"enum": ["lite", "standard", "deep"]},
18
+ "status": {"enum": ["blocked", "ready"]},
19
+ "input_bindings": {
20
+ "type": "object",
21
+ "required": ["request_path", "snapshot_path", "snapshot_digest", "deployment_model_path", "deployment_model_digest", "target_profile_path", "target_profile_digest", "source_revision", "target_fingerprint"],
22
+ "properties": {
23
+ "request_path": {"type": "string", "minLength": 1},
24
+ "snapshot_path": {"type": "string", "minLength": 1},
25
+ "snapshot_digest": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
26
+ "deployment_model_path": {"type": "string", "minLength": 1},
27
+ "deployment_model_digest": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
28
+ "target_profile_path": {"type": "string", "pattern": "^deployment/target-profile\\.json$"},
29
+ "target_profile_digest": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
30
+ "source_revision": {"type": "string", "minLength": 1},
31
+ "target_fingerprint": {"type": "string", "pattern": "^[a-f0-9]{64}$"}
32
+ },
33
+ "additionalProperties": false
34
+ },
35
+ "scope_definition": {
36
+ "type": "object",
37
+ "required": ["source_root", "deployment_root", "read_roots", "write_roots", "forbidden_roots"],
38
+ "properties": {
39
+ "source_root": {"type": "string", "minLength": 1},
40
+ "deployment_root": {"type": "string", "minLength": 1},
41
+ "read_roots": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
42
+ "write_roots": {"type": "array", "items": {"type": "string"}, "minItems": 1, "uniqueItems": true},
43
+ "forbidden_roots": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
44
+ },
45
+ "additionalProperties": false
46
+ },
47
+ "batches": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "object",
51
+ "required": ["id", "title", "risk", "requires_confirmation", "depends_on", "operation_ids", "gate_ids"],
52
+ "properties": {
53
+ "id": {"type": "string", "pattern": "^B[0-9]{2}$"},
54
+ "title": {"type": "string", "minLength": 1},
55
+ "risk": {"enum": ["low", "medium", "high", "critical"]},
56
+ "requires_confirmation": {"const": true},
57
+ "depends_on": {"type": "array", "items": {"type": "string", "pattern": "^B[0-9]{2}$"}, "uniqueItems": true},
58
+ "operation_ids": {"type": "array", "items": {"type": "string", "pattern": "^OP[0-9]{3}$"}, "minItems": 1, "uniqueItems": true},
59
+ "gate_ids": {"type": "array", "items": {"type": "string", "pattern": "^G[0-9]{2}$"}, "uniqueItems": true}
60
+ },
61
+ "additionalProperties": false
62
+ }
63
+ },
64
+ "external_mutations": {
65
+ "type": "array",
66
+ "items": {
67
+ "type": "object",
68
+ "required": ["id", "provider", "target", "current_state", "desired_state", "privilege", "blast_radius", "preview", "rollback", "batch_id"],
69
+ "properties": {
70
+ "id": {"type": "string", "pattern": "^EM[0-9]{3}$"},
71
+ "provider": {"type": "string"},
72
+ "target": {"type": "string"},
73
+ "current_state": {"type": "string"},
74
+ "desired_state": {"type": "string"},
75
+ "privilege": {"type": "string"},
76
+ "blast_radius": {"type": "string"},
77
+ "preview": {"type": "string"},
78
+ "rollback": {"type": "string"},
79
+ "batch_id": {"type": "string", "pattern": "^B[0-9]{2}$"}
80
+ },
81
+ "additionalProperties": false
82
+ }
83
+ },
84
+ "global_environment_changes": {
85
+ "type": "array",
86
+ "items": {
87
+ "type": "object",
88
+ "required": ["key", "target_scope", "value_source_ref", "impact", "rollback", "batch_id"],
89
+ "properties": {
90
+ "key": {"type": "string"},
91
+ "target_scope": {"type": "string"},
92
+ "value_source_ref": {"type": "string"},
93
+ "impact": {"type": "string"},
94
+ "rollback": {"type": "string"},
95
+ "batch_id": {"type": "string", "pattern": "^B[0-9]{2}$"}
96
+ },
97
+ "additionalProperties": false
98
+ }
99
+ },
100
+ "operations": {
101
+ "type": "array",
102
+ "items": {
103
+ "type": "object",
104
+ "required": ["id", "batch_id", "kind", "target", "working_directory", "preconditions", "write_set", "external_mutation_id", "preview", "apply", "postconditions", "rollback", "risk", "required_privilege", "evidence_path"],
105
+ "properties": {
106
+ "id": {"type": "string", "pattern": "^OP[0-9]{3}$"},
107
+ "batch_id": {"type": "string", "pattern": "^B[0-9]{2}$"},
108
+ "kind": {"enum": ["filesystem", "docker-compose", "systemd", "kubernetes", "helm", "terraform", "ansible", "database", "custom-command"]},
109
+ "target": {"type": "string"},
110
+ "working_directory": {"type": "string"},
111
+ "preconditions": {"type": "array", "items": {"type": "string"}, "minItems": 1},
112
+ "write_set": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
113
+ "external_mutation_id": {"type": ["string", "null"], "pattern": "^EM[0-9]{3}$"},
114
+ "preview": {"type": "object", "required": ["supported", "command", "limitations"], "properties": {"supported": {"type": "boolean"}, "command": {"type": ["string", "null"]}, "limitations": {"type": "array", "items": {"type": "string"}}}, "additionalProperties": false},
115
+ "apply": {"type": "object", "required": ["shell", "command"], "properties": {"shell": {"type": "string"}, "command": {"type": "string"}}, "additionalProperties": false},
116
+ "postconditions": {"type": "array", "items": {"type": "string"}, "minItems": 1},
117
+ "rollback": {"type": "object", "required": ["mode", "trigger", "command"], "properties": {"mode": {"enum": ["automatic", "manual", "not-available"]}, "trigger": {"type": "string"}, "command": {"type": ["string", "null"]}}, "additionalProperties": false},
118
+ "risk": {"enum": ["low", "medium", "high", "critical"]},
119
+ "required_privilege": {"type": "string"},
120
+ "evidence_path": {"type": "string"}
121
+ },
122
+ "additionalProperties": false
123
+ }
124
+ },
125
+ "artifact_requirements": {
126
+ "type": "array",
127
+ "items": {
128
+ "type": "object",
129
+ "required": ["id", "kind", "source_ref", "immutable_digest", "staging_ref", "activation_target", "previous_ref", "required"],
130
+ "properties": {
131
+ "id": {"type": "string", "pattern": "^AR[0-9]{3}$"},
132
+ "kind": {"enum": ["file", "archive", "container-image", "static-bundle", "other"]},
133
+ "source_ref": {"type": "string", "minLength": 1},
134
+ "immutable_digest": {"type": "string", "pattern": "^(?:sha256:)?[a-f0-9]{64}$"},
135
+ "staging_ref": {"type": ["string", "null"]},
136
+ "activation_target": {"type": "string", "minLength": 1},
137
+ "previous_ref": {"type": ["string", "null"]},
138
+ "required": {"type": "boolean"}
139
+ },
140
+ "additionalProperties": false
141
+ }
142
+ },
143
+ "gates": {
144
+ "type": "array",
145
+ "items": {
146
+ "type": "object",
147
+ "required": ["id", "title", "depends_on", "after_batches", "verification_ids", "required"],
148
+ "properties": {
149
+ "id": {"type": "string", "pattern": "^G[0-9]{2}$"},
150
+ "title": {"type": "string", "minLength": 1},
151
+ "depends_on": {"type": "array", "items": {"type": "string", "pattern": "^G[0-9]{2}$"}, "uniqueItems": true},
152
+ "after_batches": {"type": "array", "items": {"type": "string", "pattern": "^B[0-9]{2}$"}, "minItems": 1, "uniqueItems": true},
153
+ "verification_ids": {"type": "array", "items": {"type": "string", "pattern": "^VR[0-9]{3}$"}, "minItems": 1, "uniqueItems": true},
154
+ "required": {"type": "boolean"}
155
+ },
156
+ "additionalProperties": false
157
+ },
158
+ "minItems": 1
159
+ },
160
+ "data_protection": {
161
+ "type": "array",
162
+ "items": {
163
+ "type": "object",
164
+ "required": ["id", "resource", "operation_ids", "strategy", "backup", "waiver"],
165
+ "properties": {
166
+ "id": {"type": "string", "pattern": "^DP[0-9]{3}$"},
167
+ "resource": {"type": "string", "minLength": 1},
168
+ "operation_ids": {"type": "array", "items": {"type": "string", "pattern": "^OP[0-9]{3}$"}, "uniqueItems": true},
169
+ "strategy": {"enum": ["verified-backup", "waiver", "not-required"]},
170
+ "backup": {
171
+ "anyOf": [
172
+ {"type": "null"},
173
+ {"type": "object", "required": ["evidence_path", "digest", "readability_verified", "restore_ref", "restore_verified"], "properties": {"evidence_path": {"type": "string", "minLength": 1}, "digest": {"type": "string", "pattern": "^[a-f0-9]{64}$"}, "readability_verified": {"const": true}, "restore_ref": {"type": "string", "minLength": 1}, "restore_verified": {"type": "boolean"}}, "additionalProperties": false}
174
+ ]
175
+ },
176
+ "waiver": {
177
+ "anyOf": [
178
+ {"type": "null"},
179
+ {"type": "object", "required": ["decision_ref", "exact_scope", "object_identity_verified", "conflicts_absent", "recovery_mode"], "properties": {"decision_ref": {"type": "string", "minLength": 1}, "exact_scope": {"type": "string", "minLength": 1}, "object_identity_verified": {"const": true}, "conflicts_absent": {"const": true}, "recovery_mode": {"const": "forward-only"}}, "additionalProperties": false}
180
+ ]
181
+ }
182
+ },
183
+ "additionalProperties": false
184
+ }
185
+ },
186
+ "retention_policy": {
187
+ "type": "object",
188
+ "required": ["retain_failed_candidates", "retain_previous_release", "cleanup_requires_separate_approval"],
189
+ "properties": {
190
+ "retain_failed_candidates": {"const": true},
191
+ "retain_previous_release": {"const": true},
192
+ "cleanup_requires_separate_approval": {"const": true}
193
+ },
194
+ "additionalProperties": false
195
+ },
196
+ "verification": {
197
+ "type": "array",
198
+ "items": {
199
+ "type": "object",
200
+ "required": ["id", "kind", "target", "required", "expected", "stability", "convergence_group"],
201
+ "properties": {
202
+ "id": {"type": "string", "pattern": "^VR[0-9]{3}$"},
203
+ "kind": {"enum": ["http", "tcp", "command", "service", "artifact", "data", "custom"]},
204
+ "target": {"type": "string", "minLength": 1},
205
+ "required": {"type": "boolean"},
206
+ "expected": {"type": "object", "required": ["description", "http_statuses", "business_codes", "authenticated"], "properties": {"description": {"type": "string", "minLength": 1}, "http_statuses": {"type": "array", "items": {"type": "integer", "minimum": 100, "maximum": 599}, "uniqueItems": true}, "business_codes": {"type": "array", "items": {"type": ["integer", "string"]}, "uniqueItems": true}, "authenticated": {"type": ["boolean", "null"]}}, "additionalProperties": false},
207
+ "stability": {"anyOf": [{"type": "null"}, {"type": "object", "required": ["interval_seconds", "timeout_seconds", "required_consecutive_successes"], "properties": {"interval_seconds": {"type": "number", "exclusiveMinimum": 0}, "timeout_seconds": {"type": "number", "exclusiveMinimum": 0}, "required_consecutive_successes": {"type": "integer", "minimum": 1}}, "additionalProperties": false}]},
208
+ "convergence_group": {"type": ["string", "null"]}
209
+ },
210
+ "additionalProperties": false
211
+ }
212
+ },
213
+ "rollback_strategy": {"type": "string", "minLength": 1},
214
+ "blockers": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}
215
+ },
216
+ "allOf": [
217
+ {"if": {"properties": {"scope": {"const": "global"}}}, "then": {"properties": {"project_id": {"const": null}}}},
218
+ {"if": {"properties": {"scope": {"const": "project"}}}, "then": {"properties": {"project_id": {"type": "string"}}}}
219
+ ],
220
+ "additionalProperties": false
221
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:speculo:ops:inventory-snapshot:v2",
4
+ "title": "Ops Inventory Snapshot",
5
+ "type": "object",
6
+ "required": ["schema_version", "artifact", "scope", "project_id", "snapshot_id", "change", "captured_at", "scope_definition", "target_fingerprint", "collectors", "gaps", "redactions"],
7
+ "properties": {
8
+ "schema_version": {"const": 2},
9
+ "artifact": {"const": "ops-inventory-snapshot"},
10
+ "scope": {"enum": ["global", "project"]},
11
+ "project_id": {"type": ["string", "null"], "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
12
+ "snapshot_id": {"type": "string", "pattern": "^[0-9]{8}T[0-9]{6}Z(?:-[0-9]{2})?$"},
13
+ "change": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"},
14
+ "captured_at": {"type": "string", "format": "date-time"},
15
+ "scope_definition": {
16
+ "type": "object",
17
+ "required": ["levels", "targets", "approved_deep_roots"],
18
+ "properties": {
19
+ "levels": {"type": "array", "items": {"enum": ["L0", "L1", "L2"]}, "uniqueItems": true, "minItems": 1},
20
+ "targets": {"type": "array", "items": {"type": "string", "minLength": 1}, "minItems": 1, "uniqueItems": true},
21
+ "approved_deep_roots": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}
22
+ },
23
+ "additionalProperties": false
24
+ },
25
+ "target_fingerprint": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
26
+ "collectors": {"type": "array", "items": {"type": "object", "required": ["id", "category", "tool", "target", "status", "facts", "evidence", "error"], "properties": {"id": {"type": "string"}, "category": {"enum": ["host", "filesystem", "runtime", "service", "network", "container", "cluster", "project-location"]}, "tool": {"type": "string"}, "target": {"type": "string"}, "status": {"enum": ["observed", "partial", "unavailable", "denied", "failed"]}, "facts": {"type": "object", "additionalProperties": true}, "evidence": {"type": "array", "items": {"type": "string"}}, "error": {"type": ["string", "null"]}}, "additionalProperties": false}, "minItems": 1},
27
+ "gaps": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
28
+ "redactions": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}
29
+ },
30
+ "additionalProperties": false
31
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:speculo:ops:journal-event:v1",
4
+ "title": "Ops Attempt Journal Event",
5
+ "type": "object",
6
+ "required": ["schema_version", "artifact", "sequence", "at", "event", "batch_id", "gate_id", "operation_id", "result", "summary", "output_digest", "evidence"],
7
+ "properties": {
8
+ "schema_version": {"const": 1},
9
+ "artifact": {"const": "ops-journal-event"},
10
+ "sequence": {"type": "integer", "minimum": 1},
11
+ "at": {"type": "string", "format": "date-time"},
12
+ "event": {"enum": ["attempt-start", "gate-result", "operation-intent", "operation-result", "postcondition-result", "attempt-end"]},
13
+ "batch_id": {"type": ["string", "null"], "pattern": "^B[0-9]{2}$"},
14
+ "gate_id": {"type": ["string", "null"], "pattern": "^G[0-9]{2}$"},
15
+ "operation_id": {"type": ["string", "null"], "pattern": "^OP[0-9]{3}$"},
16
+ "result": {"enum": ["pending", "passed", "failed", "blocked", "skipped"]},
17
+ "summary": {"type": "string", "minLength": 1},
18
+ "output_digest": {"type": ["string", "null"], "pattern": "^[a-f0-9]{64}$"},
19
+ "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}
20
+ },
21
+ "additionalProperties": false
22
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:speculo:ops:project:v1",
4
+ "title": "Ops Project Identity",
5
+ "type": "object",
6
+ "required": ["schema_version", "artifact", "project_id", "display_name", "aliases", "identities", "source_hints", "created_at", "updated_at"],
7
+ "properties": {
8
+ "schema_version": {"const": 1},
9
+ "artifact": {"const": "ops-project"},
10
+ "project_id": {"type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
11
+ "display_name": {"type": "string", "minLength": 1},
12
+ "aliases": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
13
+ "identities": {"type": "array", "items": {"type": "object", "required": ["kind", "value", "source"], "properties": {"kind": {"enum": ["vcs", "monorepo-component", "workspace", "package", "user-confirmed", "digest"]}, "value": {"type": "string", "minLength": 1}, "source": {"type": "string", "minLength": 1}}, "additionalProperties": false}, "minItems": 1},
14
+ "source_hints": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
15
+ "created_at": {"type": "string", "format": "date-time"},
16
+ "updated_at": {"type": "string", "format": "date-time"}
17
+ },
18
+ "additionalProperties": false
19
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:speculo:ops:promotion-approval:v1",
4
+ "title": "Ops Promotion Approval",
5
+ "type": "object",
6
+ "required": ["schema_version", "artifact", "scope", "project_id", "change", "manifest_path", "manifest_digest", "decision", "decision_summary", "decided_at"],
7
+ "properties": {
8
+ "schema_version": {"const": 1},
9
+ "artifact": {"const": "ops-promotion-approval"},
10
+ "scope": {"enum": ["global", "project"]},
11
+ "project_id": {"type": ["string", "null"], "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
12
+ "change": {"type": "string"},
13
+ "manifest_path": {"const": "promotion/manifest.json"},
14
+ "manifest_digest": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
15
+ "decision": {"const": "approved"},
16
+ "decision_summary": {"type": "string", "minLength": 1},
17
+ "decided_at": {"type": "string", "format": "date-time"}
18
+ },
19
+ "additionalProperties": false
20
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:speculo:ops:promotion-manifest:v1",
4
+ "title": "Ops Promotion Manifest",
5
+ "type": "object",
6
+ "required": ["schema_version", "artifact", "scope", "project_id", "change", "created_at", "source_path", "archive_path", "retrospective_path", "writes", "archive_only", "summary"],
7
+ "properties": {
8
+ "schema_version": {"const": 1},
9
+ "artifact": {"const": "ops-promotion-manifest"},
10
+ "scope": {"enum": ["global", "project"]},
11
+ "project_id": {"type": ["string", "null"], "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
12
+ "change": {"type": "string"},
13
+ "created_at": {"type": "string", "format": "date-time"},
14
+ "source_path": {"type": "string", "minLength": 1},
15
+ "archive_path": {"type": "string", "minLength": 1},
16
+ "retrospective_path": {"const": "RETROSPECTIVE.md"},
17
+ "writes": {"type": "array", "items": {"type": "object", "required": ["stable_key", "knowledge_scope", "action", "staging_path", "target_path", "content_digest", "expected_target_digest", "evidence"], "properties": {"stable_key": {"type": "string", "minLength": 1}, "knowledge_scope": {"enum": ["project-context", "project-adr", "project-runbook", "global-context", "global-adr", "global-runbook"]}, "action": {"enum": ["create", "merge", "supersede"]}, "staging_path": {"type": "string", "minLength": 1}, "target_path": {"type": "string", "minLength": 1}, "content_digest": {"type": "string", "pattern": "^[a-f0-9]{64}$"}, "expected_target_digest": {"type": ["string", "null"], "pattern": "^[a-f0-9]{64}$"}, "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}, "minItems": 1, "uniqueItems": true}}, "additionalProperties": false}},
18
+ "archive_only": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
19
+ "summary": {"type": "string", "minLength": 1}
20
+ },
21
+ "additionalProperties": false
22
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:speculo:ops:status:v2",
4
+ "title": "Ops Global Status",
5
+ "type": "object",
6
+ "required": ["schema_version", "workflow", "active", "archived"],
7
+ "properties": {
8
+ "schema_version": {"const": 2},
9
+ "workflow": {"const": "ops"},
10
+ "active": {"type": "array", "items": {"$ref": "#/$defs/entry"}, "uniqueItems": true},
11
+ "archived": {"type": "array", "items": {"$ref": "#/$defs/entry"}, "uniqueItems": true}
12
+ },
13
+ "$defs": {
14
+ "entry": {
15
+ "type": "object",
16
+ "required": ["scope", "project_id", "change"],
17
+ "properties": {
18
+ "scope": {"enum": ["global", "project"]},
19
+ "project_id": {"type": ["string", "null"], "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
20
+ "change": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"}
21
+ },
22
+ "allOf": [
23
+ {"if": {"properties": {"scope": {"const": "global"}}}, "then": {"properties": {"project_id": {"const": null}}}},
24
+ {"if": {"properties": {"scope": {"const": "project"}}}, "then": {"properties": {"project_id": {"type": "string"}}}}
25
+ ],
26
+ "additionalProperties": false
27
+ }
28
+ },
29
+ "additionalProperties": false
30
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:speculo:ops:target-profile:v1",
4
+ "title": "Ops Target Profile",
5
+ "type": "object",
6
+ "required": ["schema_version", "artifact", "scope", "project_id", "change", "created_at", "operation_mode", "environment_class", "deployment_root", "existing_state", "identity_confirmed", "identity_confirmation_evidence", "identity_assertions", "ownership", "differences", "secret_requirements", "readiness", "blockers"],
7
+ "properties": {
8
+ "schema_version": {"const": 1},
9
+ "artifact": {"const": "ops-target-profile"},
10
+ "scope": {"enum": ["global", "project"]},
11
+ "project_id": {"type": ["string", "null"], "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
12
+ "change": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"},
13
+ "created_at": {"type": "string", "format": "date-time"},
14
+ "operation_mode": {"enum": ["audit", "takeover", "fresh", "release", "upgrade", "rollback"]},
15
+ "environment_class": {"enum": ["local", "shared-nonprod", "production"]},
16
+ "deployment_root": {"type": "string", "minLength": 1},
17
+ "existing_state": {"enum": ["absent", "present", "unknown"]},
18
+ "identity_confirmed": {"type": "boolean"},
19
+ "identity_confirmation_evidence": {"type": ["string", "null"]},
20
+ "identity_assertions": {"type": "array", "items": {"type": "object", "required": ["id", "provider", "key", "comparison", "expected", "evidence"], "properties": {"id": {"type": "string", "pattern": "^ID[0-9]{3}$"}, "provider": {"type": "string", "minLength": 1}, "key": {"type": "string", "minLength": 1}, "comparison": {"enum": ["exact", "ordered-list", "set", "digest"]}, "expected": {"anyOf": [{"type": "string", "minLength": 1}, {"type": "array", "items": {"type": "string", "minLength": 1}, "minItems": 1, "uniqueItems": true}]}, "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}, "minItems": 1, "uniqueItems": true}}, "additionalProperties": false}, "minItems": 1},
21
+ "ownership": {"type": "object", "required": ["owned_targets", "protected_targets", "unknown_targets"], "properties": {"owned_targets": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}, "protected_targets": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}, "unknown_targets": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}}, "additionalProperties": false},
22
+ "differences": {"type": "array", "items": {"type": "object", "required": ["id", "target", "classification", "evidence"], "properties": {"id": {"type": "string", "pattern": "^DF[0-9]{3}$"}, "target": {"type": "string", "minLength": 1}, "classification": {"enum": ["expected", "safe-reconcile", "requires-backup", "ownership-conflict", "unknown"]}, "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}, "minItems": 1, "uniqueItems": true}}, "additionalProperties": false}},
23
+ "secret_requirements": {"type": "array", "items": {"type": "object", "required": ["key", "source_ref", "presence_required", "version_ref"], "properties": {"key": {"type": "string", "minLength": 1}, "source_ref": {"type": "string", "minLength": 1}, "presence_required": {"type": "boolean"}, "version_ref": {"type": ["string", "null"]}}, "additionalProperties": false}},
24
+ "readiness": {"enum": ["blocked", "ready"]},
25
+ "blockers": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}
26
+ },
27
+ "allOf": [
28
+ {"if": {"properties": {"scope": {"const": "global"}}}, "then": {"properties": {"project_id": {"const": null}}}},
29
+ {"if": {"properties": {"scope": {"const": "project"}}}, "then": {"properties": {"project_id": {"type": "string"}}}}
30
+ ],
31
+ "additionalProperties": false
32
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:speculo:ops:verification-state:v1",
4
+ "title": "Ops Verification State",
5
+ "type": "object",
6
+ "required": ["schema_version", "artifact", "scope", "project_id", "change", "attempt_id", "captured_at", "target_profile_path", "target_profile_digest", "identity_results", "gates", "artifacts", "services", "probes", "convergence", "data_protection", "recovery", "retained_artifacts", "risks", "verdict"],
7
+ "properties": {
8
+ "schema_version": {"const": 1},
9
+ "artifact": {"const": "ops-verification-state"},
10
+ "scope": {"enum": ["global", "project"]},
11
+ "project_id": {"type": ["string", "null"], "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
12
+ "change": {"type": "string"},
13
+ "attempt_id": {"type": "string", "pattern": "^ATTEMPT-[0-9]{3}$"},
14
+ "captured_at": {"type": "string", "format": "date-time"},
15
+ "target_profile_path": {"type": ["string", "null"]},
16
+ "target_profile_digest": {"type": ["string", "null"], "pattern": "^[a-f0-9]{64}$"},
17
+ "identity_results": {"type": "array", "items": {"type": "object", "required": ["assertion_id", "comparison", "actual", "matched", "evidence"], "properties": {"assertion_id": {"type": "string", "pattern": "^ID[0-9]{3}$"}, "comparison": {"enum": ["exact", "ordered-list", "set", "digest"]}, "actual": {"anyOf": [{"type": "string", "minLength": 1}, {"type": "array", "items": {"type": "string", "minLength": 1}, "minItems": 1, "uniqueItems": true}]}, "matched": {"type": "boolean"}, "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}, "minItems": 1, "uniqueItems": true}}, "additionalProperties": false}},
18
+ "gates": {"type": "array", "items": {"type": "object", "required": ["id", "sequence", "status", "started_at", "ended_at", "evidence"], "properties": {"id": {"type": "string", "pattern": "^G[0-9]{2}$"}, "sequence": {"type": "integer", "minimum": 1}, "status": {"enum": ["passed", "failed", "blocked", "skipped"]}, "started_at": {"type": "string", "format": "date-time"}, "ended_at": {"type": "string", "format": "date-time"}, "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}}, "additionalProperties": false}},
19
+ "artifacts": {"type": "array", "items": {"type": "object", "required": ["requirement_id", "immutable_digest", "target_ref", "server_verified", "matched", "evidence"], "properties": {"requirement_id": {"type": "string", "pattern": "^AR[0-9]{3}$"}, "immutable_digest": {"type": "string", "pattern": "^(?:sha256:)?[a-f0-9]{64}$"}, "target_ref": {"type": "string", "minLength": 1}, "server_verified": {"type": "boolean"}, "matched": {"type": "boolean"}, "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}}, "additionalProperties": false}},
20
+ "services": {"type": "array", "items": {"type": "object", "required": ["id", "status", "immutable_ref", "restart_count", "runtime_digest", "evidence"], "properties": {"id": {"type": "string", "minLength": 1}, "status": {"enum": ["healthy", "running", "degraded", "failed", "absent"]}, "immutable_ref": {"type": ["string", "null"]}, "restart_count": {"type": "integer", "minimum": 0}, "runtime_digest": {"type": ["string", "null"]}, "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}}, "additionalProperties": false}},
21
+ "probes": {"type": "array", "items": {"type": "object", "required": ["verification_id", "ok", "http_status", "business_code", "authenticated", "consecutive_successes", "elapsed_seconds", "transient_failures", "evidence"], "properties": {"verification_id": {"type": "string", "pattern": "^VR[0-9]{3}$"}, "ok": {"type": "boolean"}, "http_status": {"type": ["integer", "null"]}, "business_code": {"type": ["integer", "string", "null"]}, "authenticated": {"type": ["boolean", "null"]}, "consecutive_successes": {"type": "integer", "minimum": 0}, "elapsed_seconds": {"type": "number", "minimum": 0}, "transient_failures": {"type": "array", "items": {"type": "string"}}, "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}}, "additionalProperties": false}},
22
+ "convergence": {"type": "array", "items": {"type": "object", "required": ["group", "member_ids", "digests", "matched", "evidence"], "properties": {"group": {"type": "string", "minLength": 1}, "member_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "minItems": 2, "uniqueItems": true}, "digests": {"type": "array", "items": {"type": "string", "minLength": 1}, "minItems": 2}, "matched": {"type": "boolean"}, "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}}, "additionalProperties": false}},
23
+ "data_protection": {"type": "array", "items": {"type": "object", "required": ["protection_id", "status", "evidence_path", "evidence_digest", "readability_verified", "restore_verified"], "properties": {"protection_id": {"type": "string", "pattern": "^DP[0-9]{3}$"}, "status": {"enum": ["verified", "waived", "not-required", "failed"]}, "evidence_path": {"type": ["string", "null"]}, "evidence_digest": {"type": ["string", "null"], "pattern": "^[a-f0-9]{64}$"}, "readability_verified": {"type": "boolean"}, "restore_verified": {"type": "boolean"}}, "additionalProperties": false}},
24
+ "recovery": {"type": "object", "required": ["strategy", "previous_release_ref", "rollback_operation_refs", "material_refs", "compatibility_verified", "data_restore_authorized", "evidence"], "properties": {"strategy": {"enum": ["restore-previous", "reverse-change", "forward-fix", "not-applicable"]}, "previous_release_ref": {"type": ["string", "null"]}, "rollback_operation_refs": {"type": "array", "items": {"type": "string", "pattern": "^OP[0-9]{3}$"}, "uniqueItems": true}, "material_refs": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}, "compatibility_verified": {"type": "boolean"}, "data_restore_authorized": {"type": ["boolean", "null"]}, "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}}, "additionalProperties": false},
25
+ "retained_artifacts": {"type": "array", "items": {"type": "object", "required": ["id", "kind", "locator", "reason"], "properties": {"id": {"type": "string", "minLength": 1}, "kind": {"type": "string", "minLength": 1}, "locator": {"type": "string", "minLength": 1}, "reason": {"type": "string", "minLength": 1}}, "additionalProperties": false}},
26
+ "risks": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
27
+ "verdict": {"enum": ["passed", "failed", "blocked"]}
28
+ },
29
+ "additionalProperties": false
30
+ }