@smartmemory/compose 0.3.4-beta → 0.3.6-beta
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.
- package/bin/judgment-import.js +565 -0
- package/contracts/judgment-record.schema.json +400 -0
- package/dist/assets/{App-BG92y_CY.js → App-BG3ngu8H.js} +92 -92
- package/dist/assets/{abnfDiagram-VRR7QNED-Bip6cMjP.js → abnfDiagram-VRR7QNED-CjB_sD3D.js} +1 -1
- package/dist/assets/{arc-CyMTM07c.js → arc-_v4hR_uD.js} +1 -1
- package/dist/assets/{architectureDiagram-ZJ3FMSHR-BukV0CJw.js → architectureDiagram-ZJ3FMSHR-DreJmzXQ.js} +1 -1
- package/dist/assets/{blockDiagram-677ZJIJ3-Bjb_MNB4.js → blockDiagram-677ZJIJ3-BG9-c0O1.js} +1 -1
- package/dist/assets/{c4Diagram-LMCZKHZV-CUmTCrMW.js → c4Diagram-LMCZKHZV-DZf45Fbz.js} +1 -1
- package/dist/assets/channel-B3U5wFAT.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-Cyvi1AFH.js → chunk-2Q5K7J3B-Dn1spZYu.js} +1 -1
- package/dist/assets/{chunk-32BRIVSS-B1y5FpOd.js → chunk-32BRIVSS-pURGrJDk.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-Qw-L7OoJ.js → chunk-5VM5RSS4-BY4_PV5H.js} +1 -1
- package/dist/assets/{chunk-EX3LRPZG-G_MZEji_.js → chunk-EX3LRPZG-DdELs1qP.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-DQFs7gjy.js → chunk-JWPE2WC7-_7ujgd_Q.js} +1 -1
- package/dist/assets/{chunk-MOJQB5TN-CQZQYMcz.js → chunk-MOJQB5TN-D-ky35G-.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-CmAda4sZ.js → chunk-RYQCIY6F-Dag_kVlO.js} +1 -1
- package/dist/assets/{chunk-V7JOEXUC-CbjBz-Ek.js → chunk-V7JOEXUC-BtewURat.js} +1 -1
- package/dist/assets/{chunk-VR4S4FIN-Dvhgnm7E.js → chunk-VR4S4FIN-Dt9NZ67m.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-CSdt06Hp.js → chunk-XXDRQBXY-DfdVhbmA.js} +1 -1
- package/dist/assets/classDiagram-OUVF2IWQ-B6fCN-ht.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-B6fCN-ht.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-G8l05tXy.js → cose-bilkent-JH36ORCC-BieYif4o.js} +1 -1
- package/dist/assets/{cynefin-VYW2F7L2-C3n1PNJC.js → cynefin-VYW2F7L2-CT2BA6KE.js} +1 -1
- package/dist/assets/{cynefinDiagram-TSTJHNR4-C8N_CvKJ.js → cynefinDiagram-TSTJHNR4-Bh6exbyg.js} +1 -1
- package/dist/assets/{dagre-VKFMJZFB-B2pkwDhN.js → dagre-VKFMJZFB-aXMLSmQL.js} +1 -1
- package/dist/assets/{diagram-FQU43EPY-DPHD_t-1.js → diagram-FQU43EPY-Dr7JAOuQ.js} +1 -1
- package/dist/assets/{diagram-G47NLZAW-DGmHIZRr.js → diagram-G47NLZAW-DUvA3FQK.js} +1 -1
- package/dist/assets/{diagram-NH7WQ7WH-BlLWwKVt.js → diagram-NH7WQ7WH-BQUARqcu.js} +1 -1
- package/dist/assets/{diagram-OA4YK3LP-DEv704Re.js → diagram-OA4YK3LP-dDUc1zHi.js} +1 -1
- package/dist/assets/{diagram-WEI45ONY-Bj6PGUCe.js → diagram-WEI45ONY-B2h5Qlb1.js} +1 -1
- package/dist/assets/{ebnfDiagram-CCIWWBDH-Ch-icksT.js → ebnfDiagram-CCIWWBDH-DThRGupB.js} +1 -1
- package/dist/assets/{erDiagram-Q63AITRT-CI3lwEFA.js → erDiagram-Q63AITRT-BUCsprO2.js} +1 -1
- package/dist/assets/{flowDiagram-23GEKE2U-DcUANpAz.js → flowDiagram-23GEKE2U-DXtNNi6r.js} +1 -1
- package/dist/assets/{ganttDiagram-NO4QXBWP-Cy0Ie8KS.js → ganttDiagram-NO4QXBWP-D4zbBHh_.js} +1 -1
- package/dist/assets/{gitGraphDiagram-IHSO6WYX-BswI52az.js → gitGraphDiagram-IHSO6WYX-DpoQws0W.js} +1 -1
- package/dist/assets/{index-B1H7-G2y.js → index-3ZH5eMcZ.js} +2 -2
- package/dist/assets/{infoDiagram-FWYZ7A6U-BBunqvr-.js → infoDiagram-FWYZ7A6U-Bbas2GAo.js} +1 -1
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-Hm4zSDlM.js → ishikawaDiagram-FXEZZL3T-CzEB9fQS.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-CIqcTFuO.js → journeyDiagram-5HDEW3XC-Bz8TCdz2.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-CB9jCXj_.js → kanban-definition-HUTT4EX6-tozrMoV_.js} +1 -1
- package/dist/assets/{linear-CsXqv70E.js → linear-Ck7gpa5N.js} +1 -1
- package/dist/assets/{mindmap-definition-LN4V7U3C-CpqH5F_P.js → mindmap-definition-LN4V7U3C-DTcHO0DJ.js} +1 -1
- package/dist/assets/{pegDiagram-2B236MQR-HpQyrDcm.js → pegDiagram-2B236MQR-CHiINrNy.js} +1 -1
- package/dist/assets/{pieDiagram-ENE6RG2P-xkcpHwnY.js → pieDiagram-ENE6RG2P-CfS4YFlR.js} +1 -1
- package/dist/assets/{quadrantDiagram-ABIIQ3AL-kebZIOmu.js → quadrantDiagram-ABIIQ3AL-CadesS9w.js} +1 -1
- package/dist/assets/{railroadDiagram-RFXS5EU6-DNvGwWm9.js → railroadDiagram-RFXS5EU6-CgWEspBN.js} +1 -1
- package/dist/assets/{requirementDiagram-TGXJPOKE-D1lG1P7h.js → requirementDiagram-TGXJPOKE-bnI2zJeT.js} +1 -1
- package/dist/assets/{sankeyDiagram-HTMAVEWB-DOEEcn52.js → sankeyDiagram-HTMAVEWB-YWKFgOGw.js} +1 -1
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-DynIVCk_.js → sequenceDiagram-DBY2YBRQ-BvkNOyF9.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-DJXFjUUL.js → sizeCapture-X5ZJPWSS-DlFPA2yO.js} +1 -1
- package/dist/assets/{stateDiagram-2N3HPSRC-OZ7trFh5.js → stateDiagram-2N3HPSRC-h8NIx0kQ.js} +1 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-DjPgZtJ9.js +1 -0
- package/dist/assets/{swimlanes-5IMT3BWC-DULYAFmB.js → swimlanes-5IMT3BWC-CT5n22kG.js} +2 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-Dn318Bhq.js +8 -0
- package/dist/assets/{timeline-definition-FHXFAJF6-CzqqUDvt.js → timeline-definition-FHXFAJF6-D267GQFF.js} +1 -1
- package/dist/assets/{vennDiagram-L72KCM5P-CdKmtcFL.js → vennDiagram-L72KCM5P-Dj-wWLYG.js} +1 -1
- package/dist/assets/{wardleyDiagram-EHGQE667-DknGwjCA.js → wardleyDiagram-EHGQE667-BxCeYxkG.js} +1 -1
- package/dist/assets/{xychartDiagram-FW5EYKEG-DdYyKfQ3.js → xychartDiagram-FW5EYKEG-DMFqWn7z.js} +1 -1
- package/dist/index.html +1 -1
- package/lib/idempotency.js +33 -8
- package/lib/judgment/schema.js +23 -0
- package/lib/judgment/store/index.js +49 -0
- package/lib/judgment/store/records.js +246 -0
- package/lib/judgment-gen.js +342 -0
- package/lib/judgment-write-guard.js +230 -0
- package/lib/judgment-writer.js +877 -0
- package/lib/lifecycle-modes.js +42 -0
- package/package.json +1 -1
- package/server/compose-mcp-tools.js +34 -0
- package/server/compose-mcp.js +125 -0
- package/server/mcp-tool-policy.js +1 -0
- package/dist/assets/channel-BzkmtaLy.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-BIvLcbex.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-BIvLcbex.js +0 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-GcPRHAJT.js +0 -1
- package/dist/assets/swimlanesDiagram-G3AALYLV-BB0gCy01.js +0 -8
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://compose.smartmemory.dev/contracts/judgment-record.schema.json",
|
|
4
|
+
"title": "judgment-record",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "Record shapes for judgment canon under docs/judgment/records/ (COMP-JUDGMENT-WRITER, design.md rev 5). Records are canonical JSON; markdown is projection. Every record carries a writer-stamped provenance block the caller can never set. Definitions: position_revision (append-only chain member), joint (state lives here), prediction, ledger_event (kind-specific required fields), pending_intent (intent-first transitions).",
|
|
7
|
+
"_source": "docs/features/COMP-JUDGMENT-WRITER/design.md",
|
|
8
|
+
"_roadmap": "COMP-JUDGMENT-WRITER",
|
|
9
|
+
"type": "object",
|
|
10
|
+
|
|
11
|
+
"definitions": {
|
|
12
|
+
|
|
13
|
+
"slug": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"pattern": "^[a-z0-9][a-z0-9-]*$"
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
"revision_ref": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "Address of a specific position revision: <slug>#r<N>.",
|
|
21
|
+
"pattern": "^[a-z0-9][a-z0-9-]*#r[1-9][0-9]*$"
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
"provenance": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"description": "Writer-stamped, never caller-set. actor is a v1 constant (oq1-agent-only-v1); session is best-effort diagnostic garnish and nothing may depend on it; via: 'import' marks historical transcription.",
|
|
27
|
+
"required": ["actor", "written_at"],
|
|
28
|
+
"additionalProperties": false,
|
|
29
|
+
"properties": {
|
|
30
|
+
"actor": { "const": "agent" },
|
|
31
|
+
"session": { "type": ["string", "null"] },
|
|
32
|
+
"written_at": { "type": "string", "format": "date-time" },
|
|
33
|
+
"via": { "enum": ["import"] }
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
"elicitation": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"description": "Required companion of ASSERT grounding (assert-elicitation-amendment, ratified 2026-07-22): what question was put to the owner, when, and where the answer is recorded.",
|
|
40
|
+
"required": ["asked", "answered_at", "answer_ref"],
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"properties": {
|
|
43
|
+
"asked": { "type": "string", "minLength": 1 },
|
|
44
|
+
"answered_at": { "type": "string", "format": "date-time" },
|
|
45
|
+
"answer_ref": { "type": "string", "minLength": 1 }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
"conviction": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"required": ["level", "source"],
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"properties": {
|
|
54
|
+
"level": { "enum": ["high", "medium", "low"] },
|
|
55
|
+
"source": { "enum": ["stated", "inferred"] }
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
"rejected_alternative": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"required": ["what", "why"],
|
|
62
|
+
"additionalProperties": false,
|
|
63
|
+
"properties": {
|
|
64
|
+
"what": { "type": "string", "minLength": 1 },
|
|
65
|
+
"why": { "type": "string", "minLength": 1 }
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
"claim": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"description": "Individually addressable claim with per-claim grounding and upward links (P1a). owner_locked is structurally representable ONLY for import fidelity — the write guard refuses it through tools (lib/judgment-write-guard.js).",
|
|
72
|
+
"required": ["id", "text", "grounding"],
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"properties": {
|
|
75
|
+
"id": { "$ref": "#/definitions/slug" },
|
|
76
|
+
"text": { "type": "string", "minLength": 1 },
|
|
77
|
+
"grounding": { "enum": ["EXT", "INT", "ASSERT", "DERIVED", "AGENT"] },
|
|
78
|
+
"supports": { "type": "array", "items": { "type": "string" }, "default": [] },
|
|
79
|
+
"owner_locked": { "type": "boolean" },
|
|
80
|
+
"elicitation": { "$ref": "#/definitions/elicitation" }
|
|
81
|
+
},
|
|
82
|
+
"allOf": [
|
|
83
|
+
{
|
|
84
|
+
"if": { "properties": { "grounding": { "const": "ASSERT" } }, "required": ["grounding"] },
|
|
85
|
+
"then": { "required": ["elicitation"] }
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
"position_revision": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"description": "One immutable member of an append-only revision chain at records/positions/<slug>/r<N>.json. Status (live|superseded|retracted) is DERIVED by readers, never stored. A tombstone revision carries retracted: true and may have empty claims.",
|
|
93
|
+
"required": ["slug", "claims", "conviction", "provenance"],
|
|
94
|
+
"additionalProperties": false,
|
|
95
|
+
"properties": {
|
|
96
|
+
"slug": { "$ref": "#/definitions/slug" },
|
|
97
|
+
"rev": { "type": "integer", "minimum": 1 },
|
|
98
|
+
"claims": { "type": "array", "items": { "$ref": "#/definitions/claim" } },
|
|
99
|
+
"conviction": { "$ref": "#/definitions/conviction" },
|
|
100
|
+
"rejected_alternatives": {
|
|
101
|
+
"type": "array",
|
|
102
|
+
"items": { "$ref": "#/definitions/rejected_alternative" },
|
|
103
|
+
"default": []
|
|
104
|
+
},
|
|
105
|
+
"supersedes": { "$ref": "#/definitions/revision_ref" },
|
|
106
|
+
"retracted": { "const": true },
|
|
107
|
+
"provider_ids": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"additionalProperties": false,
|
|
110
|
+
"properties": { "smartmemory": { "type": "string" } }
|
|
111
|
+
},
|
|
112
|
+
"provenance": { "$ref": "#/definitions/provenance" }
|
|
113
|
+
},
|
|
114
|
+
"allOf": [
|
|
115
|
+
{
|
|
116
|
+
"if": { "not": { "required": ["retracted"] } },
|
|
117
|
+
"then": { "properties": { "claims": { "minItems": 1 } } }
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
"ext_package": {
|
|
123
|
+
"description": "EXT method gate: sharpened question package OR the BAR-OR-JUDGMENT judgment-dispatch exception. Exactly one form.",
|
|
124
|
+
"oneOf": [
|
|
125
|
+
{
|
|
126
|
+
"type": "object",
|
|
127
|
+
"required": ["sharpened_question", "bar", "falsifier"],
|
|
128
|
+
"additionalProperties": false,
|
|
129
|
+
"properties": {
|
|
130
|
+
"sharpened_question": { "type": "string", "minLength": 1 },
|
|
131
|
+
"bar": { "type": "string", "minLength": 1 },
|
|
132
|
+
"falsifier": { "type": "string", "minLength": 1 }
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"type": "object",
|
|
137
|
+
"required": ["judgment_dispatch", "reason"],
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"properties": {
|
|
140
|
+
"judgment_dispatch": { "const": true },
|
|
141
|
+
"reason": { "type": "string", "minLength": 1 }
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
"straddle_package": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"required": ["discriminating_signal", "kill_criteria"],
|
|
150
|
+
"additionalProperties": false,
|
|
151
|
+
"properties": {
|
|
152
|
+
"discriminating_signal": { "type": "string", "minLength": 1 },
|
|
153
|
+
"kill_criteria": { "type": "string", "minLength": 1 }
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
"ext_result": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"description": "Ruled external-signal result package. sources[] address immutable records/evidence/ packages (written by the Answerer slice — not this feature). judgment_dispatch: true propagates the BAR-OR-JUDGMENT stamp permanently.",
|
|
160
|
+
"required": ["outcome", "sources", "search_record", "found_or_provoked", "judgment_not_evidence"],
|
|
161
|
+
"additionalProperties": false,
|
|
162
|
+
"properties": {
|
|
163
|
+
"outcome": { "enum": ["FOUND", "CONTRARY", "SILENT", "UNREACHABLE"] },
|
|
164
|
+
"sources": { "type": "array", "items": { "type": "string" } },
|
|
165
|
+
"search_record": { "type": "string", "minLength": 1 },
|
|
166
|
+
"found_or_provoked": { "enum": ["found", "provoked"] },
|
|
167
|
+
"judgment_not_evidence": { "type": "boolean" },
|
|
168
|
+
"judgment_dispatch": { "const": true }
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
"resolution": {
|
|
173
|
+
"type": "object",
|
|
174
|
+
"description": "Exactly the ruled four outcomes — dissolution is its OWN artifact on the joint, not an outcome. Per-outcome required fields per the edge→artifact table (design Decision 2).",
|
|
175
|
+
"required": ["outcome"],
|
|
176
|
+
"additionalProperties": false,
|
|
177
|
+
"properties": {
|
|
178
|
+
"outcome": { "enum": ["resolved", "inconclusive", "failed_to_run", "superseded"] },
|
|
179
|
+
"evidence": { "type": ["string", "object"] },
|
|
180
|
+
"learned": { "type": "string" },
|
|
181
|
+
"would_have_settled": { "type": "string" },
|
|
182
|
+
"reason": { "type": "string" },
|
|
183
|
+
"why": { "type": "string" },
|
|
184
|
+
"elicitation": { "$ref": "#/definitions/elicitation" },
|
|
185
|
+
"ext_result": { "$ref": "#/definitions/ext_result" }
|
|
186
|
+
},
|
|
187
|
+
"allOf": [
|
|
188
|
+
{
|
|
189
|
+
"if": { "properties": { "outcome": { "const": "resolved" } } },
|
|
190
|
+
"then": { "required": ["evidence"] }
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"if": { "properties": { "outcome": { "const": "inconclusive" } } },
|
|
194
|
+
"then": { "required": ["learned", "would_have_settled"] }
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"if": { "properties": { "outcome": { "const": "failed_to_run" } } },
|
|
198
|
+
"then": { "required": ["reason"] }
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"if": { "properties": { "outcome": { "const": "superseded" } } },
|
|
202
|
+
"then": { "required": ["why"] }
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
|
|
207
|
+
"dissolution": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"description": "Terminal decomposition artifact — 'dissolved by decomposition' is a distinct fact from 'got an answer'.",
|
|
210
|
+
"required": ["decomposed_into"],
|
|
211
|
+
"additionalProperties": false,
|
|
212
|
+
"properties": {
|
|
213
|
+
"decomposed_into": {
|
|
214
|
+
"type": "array",
|
|
215
|
+
"items": { "type": "string", "minLength": 1 },
|
|
216
|
+
"minItems": 1
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
"joint": {
|
|
222
|
+
"type": "object",
|
|
223
|
+
"description": "One file per joint at records/joints/<slug>.json; state lives here and is written only as a transition's artifact. Both branches REQUIRED; cost is exactly the ruled COARSE-BUCKETS (no minutes — import maps minutes to hours with a note).",
|
|
224
|
+
"required": ["slug", "question", "branch_true", "branch_false", "resolve_by", "cost", "rank", "state", "provenance"],
|
|
225
|
+
"additionalProperties": false,
|
|
226
|
+
"properties": {
|
|
227
|
+
"slug": { "$ref": "#/definitions/slug" },
|
|
228
|
+
"question": { "type": "string", "minLength": 1 },
|
|
229
|
+
"branch_true": { "type": "string", "minLength": 1 },
|
|
230
|
+
"branch_false": { "type": "string", "minLength": 1 },
|
|
231
|
+
"resolve_by": { "enum": ["EXT", "INT", "CONSTRUCT", "ASSERT", "STRADDLE"] },
|
|
232
|
+
"cost": { "enum": ["hours", "days", "weeks", "months"] },
|
|
233
|
+
"rank": { "enum": ["high", "medium"] },
|
|
234
|
+
"state": { "enum": ["open", "under_test", "resolved", "inconclusive", "superseded", "dissolved"] },
|
|
235
|
+
"ext": { "$ref": "#/definitions/ext_package" },
|
|
236
|
+
"straddle": { "$ref": "#/definitions/straddle_package" },
|
|
237
|
+
"resolution": { "$ref": "#/definitions/resolution" },
|
|
238
|
+
"dissolution": { "$ref": "#/definitions/dissolution" },
|
|
239
|
+
"flags": { "type": "array", "items": { "type": "string" }, "default": [] },
|
|
240
|
+
"provider_ids": {
|
|
241
|
+
"type": "object",
|
|
242
|
+
"additionalProperties": false,
|
|
243
|
+
"properties": { "smartmemory": { "type": "string" } }
|
|
244
|
+
},
|
|
245
|
+
"provenance": { "$ref": "#/definitions/provenance" }
|
|
246
|
+
},
|
|
247
|
+
"allOf": [
|
|
248
|
+
{
|
|
249
|
+
"if": {
|
|
250
|
+
"properties": { "resolve_by": { "const": "ASSERT" } },
|
|
251
|
+
"required": ["resolve_by", "resolution"]
|
|
252
|
+
},
|
|
253
|
+
"then": {
|
|
254
|
+
"properties": { "resolution": { "required": ["elicitation"] } }
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
|
|
260
|
+
"prediction": {
|
|
261
|
+
"type": "object",
|
|
262
|
+
"description": "Spawned by CONSTRUCT/commit ledger events at records/predictions/<id>.json; the P6 sweep queries status: open. A postmortem grade flips it to graded.",
|
|
263
|
+
"required": ["id", "text", "outcome_criteria", "made_at", "context", "status", "provenance"],
|
|
264
|
+
"additionalProperties": false,
|
|
265
|
+
"properties": {
|
|
266
|
+
"id": { "type": "string", "minLength": 1 },
|
|
267
|
+
"text": { "type": "string", "minLength": 1 },
|
|
268
|
+
"outcome_criteria": { "type": "string", "minLength": 1 },
|
|
269
|
+
"made_at": { "type": "string", "format": "date-time" },
|
|
270
|
+
"context": { "enum": ["construct", "commit"] },
|
|
271
|
+
"refs": { "type": "array", "items": { "type": "string" }, "default": [] },
|
|
272
|
+
"status": { "enum": ["open", "graded"] },
|
|
273
|
+
"grade": { "enum": ["right", "right-wrong-reason", "wrong"] },
|
|
274
|
+
"provenance": { "$ref": "#/definitions/provenance" }
|
|
275
|
+
},
|
|
276
|
+
"allOf": [
|
|
277
|
+
{
|
|
278
|
+
"if": { "properties": { "status": { "const": "graded" } } },
|
|
279
|
+
"then": { "required": ["grade"] }
|
|
280
|
+
}
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
|
|
284
|
+
"embedded_prediction": {
|
|
285
|
+
"type": "object",
|
|
286
|
+
"description": "Prediction inputs carried by a commit-decide or CONSTRUCT-disposition event; the writer spawns the prediction record from these.",
|
|
287
|
+
"required": ["text", "outcome_criteria"],
|
|
288
|
+
"additionalProperties": false,
|
|
289
|
+
"properties": {
|
|
290
|
+
"text": { "type": "string", "minLength": 1 },
|
|
291
|
+
"outcome_criteria": { "type": "string", "minLength": 1 }
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
|
|
295
|
+
"ledger_event": {
|
|
296
|
+
"type": "object",
|
|
297
|
+
"description": "Append-only events in records/ledger.jsonl. The validating-writer premise is the kind-specific REQUIRED fields, not the common envelope. A decide carrying trigger is a commit-moment decide (P4). disposition: CONSTRUCT marks a CONSTRUCT-disposition event and requires its embedded prediction.",
|
|
298
|
+
"required": ["kind", "title", "provenance"],
|
|
299
|
+
"additionalProperties": false,
|
|
300
|
+
"properties": {
|
|
301
|
+
"kind": { "enum": ["decide", "kill", "override", "escalate", "calibrate", "postmortem", "rank", "note", "correct", "open"] },
|
|
302
|
+
"title": { "type": "string", "minLength": 1 },
|
|
303
|
+
"body": { "type": "string" },
|
|
304
|
+
"refs": { "type": "array", "items": { "type": "string" }, "default": [] },
|
|
305
|
+
"rejected": { "type": "array", "items": { "$ref": "#/definitions/rejected_alternative" } },
|
|
306
|
+
"conviction": { "$ref": "#/definitions/conviction" },
|
|
307
|
+
"trigger": { "type": "string", "minLength": 1 },
|
|
308
|
+
"open_joints": { "type": "array", "items": { "type": "string" } },
|
|
309
|
+
"prediction": { "$ref": "#/definitions/embedded_prediction" },
|
|
310
|
+
"disposition": { "enum": ["EXT", "INT", "CONSTRUCT", "ASSERT", "STRADDLE"] },
|
|
311
|
+
"recall_verdict": { "enum": ["NAMED", "NAMED-BUT-MISRANKED", "MISSED", "UNKNOWABLE"] },
|
|
312
|
+
"attribution": { "type": "string", "minLength": 1 },
|
|
313
|
+
"prediction_ref": { "type": "string", "minLength": 1 },
|
|
314
|
+
"prediction_grade": { "enum": ["right", "right-wrong-reason", "wrong"] },
|
|
315
|
+
"reason": { "type": "string", "minLength": 1 },
|
|
316
|
+
"anchor": { "type": "string", "minLength": 1 },
|
|
317
|
+
"rank_change": {
|
|
318
|
+
"type": "object",
|
|
319
|
+
"required": ["joint", "from", "to"],
|
|
320
|
+
"additionalProperties": false,
|
|
321
|
+
"properties": {
|
|
322
|
+
"joint": { "$ref": "#/definitions/slug" },
|
|
323
|
+
"from": { "enum": ["high", "medium"] },
|
|
324
|
+
"to": { "enum": ["high", "medium"] }
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"elicitation": { "$ref": "#/definitions/elicitation" },
|
|
328
|
+
"provenance": { "$ref": "#/definitions/provenance" }
|
|
329
|
+
},
|
|
330
|
+
"allOf": [
|
|
331
|
+
{
|
|
332
|
+
"if": { "properties": { "kind": { "const": "decide" } } },
|
|
333
|
+
"then": { "required": ["rejected", "conviction"] }
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"if": {
|
|
337
|
+
"properties": { "kind": { "const": "decide" } },
|
|
338
|
+
"required": ["trigger"]
|
|
339
|
+
},
|
|
340
|
+
"then": {
|
|
341
|
+
"required": ["open_joints", "prediction"],
|
|
342
|
+
"properties": { "trigger": { "enum": ["earned", "forced", "exhausted"] } }
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"if": {
|
|
347
|
+
"properties": {
|
|
348
|
+
"kind": { "const": "decide" },
|
|
349
|
+
"trigger": { "enum": ["forced", "exhausted"] }
|
|
350
|
+
},
|
|
351
|
+
"required": ["trigger"]
|
|
352
|
+
},
|
|
353
|
+
"then": {
|
|
354
|
+
"properties": { "open_joints": { "minItems": 1 } }
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"if": { "properties": { "kind": { "const": "postmortem" } } },
|
|
359
|
+
"then": { "required": ["trigger", "recall_verdict", "attribution"] }
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"if": {
|
|
363
|
+
"properties": { "kind": { "const": "postmortem" } },
|
|
364
|
+
"required": ["prediction_ref"]
|
|
365
|
+
},
|
|
366
|
+
"then": { "required": ["prediction_grade"] }
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"if": { "properties": { "kind": { "const": "override" } } },
|
|
370
|
+
"then": { "required": ["reason"] }
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"if": { "properties": { "kind": { "const": "note" } } },
|
|
374
|
+
"then": { "required": ["anchor"] }
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"if": { "properties": { "kind": { "const": "rank" } } },
|
|
378
|
+
"then": { "required": ["rank_change"] }
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"if": { "required": ["disposition"], "properties": { "disposition": { "const": "CONSTRUCT" } } },
|
|
382
|
+
"then": { "required": ["prediction"] }
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
},
|
|
386
|
+
|
|
387
|
+
"pending_intent": {
|
|
388
|
+
"type": "object",
|
|
389
|
+
"description": "Intent-first transition record: the COMPLETE mutation persisted atomically BEFORE the guard call, replayed idempotently by the reconciler — guard state authoritative for the edge, the intent authoritative for the payload.",
|
|
390
|
+
"required": ["id", "op", "payload", "created_at"],
|
|
391
|
+
"additionalProperties": false,
|
|
392
|
+
"properties": {
|
|
393
|
+
"id": { "type": "string", "minLength": 1 },
|
|
394
|
+
"op": { "type": "string", "minLength": 1 },
|
|
395
|
+
"payload": { "type": "object" },
|
|
396
|
+
"created_at": { "type": "string", "format": "date-time" }
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|