memoryking 0.1.0__py3-none-any.whl
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.
- memoryking/__init__.py +3 -0
- memoryking/__main__.py +1328 -0
- memoryking/adapters/__init__.py +1 -0
- memoryking/adapters/adapter_state.py +242 -0
- memoryking/adapters/anchor_schema.sql +7 -0
- memoryking/adapters/atlas.py +441 -0
- memoryking/adapters/browser_commands.py +125 -0
- memoryking/adapters/dashboard.py +510 -0
- memoryking/adapters/dense_search.py +86 -0
- memoryking/adapters/egress_policy.py +244 -0
- memoryking/adapters/egress_schema.sql +13 -0
- memoryking/adapters/embedding.schema.json +302 -0
- memoryking/adapters/embedding_store.py +469 -0
- memoryking/adapters/execution.py +369 -0
- memoryking/adapters/experience.py +423 -0
- memoryking/adapters/experience.schema.json +1508 -0
- memoryking/adapters/experience_records.py +239 -0
- memoryking/adapters/experience_schema.sql +23 -0
- memoryking/adapters/handoff.py +494 -0
- memoryking/adapters/handoff.schema.json +299 -0
- memoryking/adapters/handoff_schema.sql +17 -0
- memoryking/adapters/index_schema.sql +11 -0
- memoryking/adapters/inference.py +454 -0
- memoryking/adapters/inference.schema.json +541 -0
- memoryking/adapters/inspection.py +1128 -0
- memoryking/adapters/inspection.schema.json +568 -0
- memoryking/adapters/knowledge.schema.json +633 -0
- memoryking/adapters/knowledge_schema.sql +37 -0
- memoryking/adapters/knowledge_store.py +800 -0
- memoryking/adapters/legacy_snapshot.py +358 -0
- memoryking/adapters/legacy_tables.py +49 -0
- memoryking/adapters/local_contract.py +45 -0
- memoryking/adapters/local_embeddings.py +189 -0
- memoryking/adapters/local_files.py +242 -0
- memoryking/adapters/local_ipc.py +258 -0
- memoryking/adapters/local_schema.sql +44 -0
- memoryking/adapters/local_store.py +632 -0
- memoryking/adapters/local_wire.schema.json +7672 -0
- memoryking/adapters/models/minilm-l6-v2-onnx.json +57 -0
- memoryking/adapters/models/ms-marco-minilm-l6-v2-onnx.json +57 -0
- memoryking/adapters/optional_schema.sql +43 -0
- memoryking/adapters/plan_dashboard.py +51 -0
- memoryking/adapters/plans.py +253 -0
- memoryking/adapters/postgres_admin.py +300 -0
- memoryking/adapters/postgres_anchor_schema.sql +9 -0
- memoryking/adapters/postgres_counter.sql +14 -0
- memoryking/adapters/postgres_egress_schema.sql +15 -0
- memoryking/adapters/postgres_experience_schema.sql +39 -0
- memoryking/adapters/postgres_index_schema.sql +7 -0
- memoryking/adapters/postgres_optional_schema.sql +71 -0
- memoryking/adapters/postgres_pool.py +77 -0
- memoryking/adapters/postgres_recovery.py +525 -0
- memoryking/adapters/postgres_schema.sql +365 -0
- memoryking/adapters/postgres_sql.py +102 -0
- memoryking/adapters/postgres_store.py +428 -0
- memoryking/adapters/postgres_summary_schema.sql +12 -0
- memoryking/adapters/postgres_trust_schema.sql +20 -0
- memoryking/adapters/processing.schema.json +471 -0
- memoryking/adapters/processing_store.py +346 -0
- memoryking/adapters/projects.py +83 -0
- memoryking/adapters/proposals.py +238 -0
- memoryking/adapters/ranking.py +315 -0
- memoryking/adapters/repository.schema.json +664 -0
- memoryking/adapters/repository_git.py +264 -0
- memoryking/adapters/repository_schema.sql +25 -0
- memoryking/adapters/repository_store.py +960 -0
- memoryking/adapters/retrieval.py +1285 -0
- memoryking/adapters/retrieval.schema.json +553 -0
- memoryking/adapters/retrieval_schema.sql +10 -0
- memoryking/adapters/shared_control.py +40 -0
- memoryking/adapters/shared_dashboard.py +636 -0
- memoryking/adapters/shared_gateway.py +63 -0
- memoryking/adapters/shared_http.py +216 -0
- memoryking/adapters/shared_mcp.py +159 -0
- memoryking/adapters/shared_service.py +124 -0
- memoryking/adapters/stdio.py +193 -0
- memoryking/adapters/stdio.tools.json +6776 -0
- memoryking/adapters/summary_schema.sql +10 -0
- memoryking/adapters/team.py +253 -0
- memoryking/adapters/timeline.py +80 -0
- memoryking/adapters/token_count.py +55 -0
- memoryking/adapters/tokenizers/LICENSE +21 -0
- memoryking/adapters/tokenizers/cl100k_base.tiktoken +100256 -0
- memoryking/adapters/trust.py +123 -0
- memoryking/adapters/trust_schema.sql +13 -0
- memoryking/adapters/web/app.css +1251 -0
- memoryking/adapters/web/app.js +907 -0
- memoryking/adapters/web/brand.js +44 -0
- memoryking/adapters/web/crown-mono.svg +1 -0
- memoryking/adapters/web/crown.svg +8 -0
- memoryking/adapters/web/elephant.png +0 -0
- memoryking/adapters/web/favicon.svg +8 -0
- memoryking/adapters/web/graph-layout.js +52 -0
- memoryking/adapters/web/graph-worker.js +10 -0
- memoryking/adapters/web/graph.js +570 -0
- memoryking/adapters/web/index.html +208 -0
- memoryking/adapters/web/observatory.js +1208 -0
- memoryking/adapters/web/team.js +151 -0
- memoryking/adapters/web/wordmark.svg +1 -0
- memoryking/adapters/working.py +971 -0
- memoryking/adapters/working.schema.json +1717 -0
- memoryking/adapters/working_schema.sql +24 -0
- memoryking/application/__init__.py +1 -0
- memoryking/application/conformance.py +50 -0
- memoryking/application/legacy_import.py +337 -0
- memoryking/application/local_port.py +9 -0
- memoryking/application/storage.py +117 -0
- memoryking/application/store_core.py +1292 -0
- memoryking/backups.py +131 -0
- memoryking/contracts/__init__.py +6 -0
- memoryking/contracts/__main__.py +20 -0
- memoryking/contracts/canonical.py +88 -0
- memoryking/contracts/embedding.schema.json +302 -0
- memoryking/contracts/embedding_generated.py +65 -0
- memoryking/contracts/experience.schema.json +1508 -0
- memoryking/contracts/experience_generated.py +239 -0
- memoryking/contracts/generated.py +122 -0
- memoryking/contracts/handoff.schema.json +299 -0
- memoryking/contracts/handoff_generated.py +69 -0
- memoryking/contracts/inference.schema.json +541 -0
- memoryking/contracts/inference_generated.py +106 -0
- memoryking/contracts/processing.schema.json +471 -0
- memoryking/contracts/processing_generated.py +82 -0
- memoryking/contracts/py.typed +0 -0
- memoryking/contracts/repository.schema.json +664 -0
- memoryking/contracts/repository_generated.py +144 -0
- memoryking/contracts/retrieval.schema.json +553 -0
- memoryking/contracts/retrieval_generated.py +110 -0
- memoryking/contracts/schema.json +696 -0
- memoryking/contracts/validation.py +92 -0
- memoryking/contracts/working.schema.json +1717 -0
- memoryking/contracts/working_generated.py +291 -0
- memoryking/domain/__init__.py +1 -0
- memoryking/domain/anchors.py +97 -0
- memoryking/domain/briefing.py +108 -0
- memoryking/domain/briefing_text.py +222 -0
- memoryking/domain/checkpoint.py +118 -0
- memoryking/domain/compression.py +64 -0
- memoryking/domain/delta.py +129 -0
- memoryking/domain/embeddings.py +90 -0
- memoryking/domain/hints.py +465 -0
- memoryking/domain/http_status.py +45 -0
- memoryking/domain/learning.py +62 -0
- memoryking/domain/local.py +65 -0
- memoryking/domain/plans.py +140 -0
- memoryking/domain/repository.py +118 -0
- memoryking/domain/selectors.py +356 -0
- memoryking/domain/summary.py +88 -0
- memoryking/domain/usage.py +163 -0
- memoryking/embedding_loop.py +98 -0
- memoryking/embedding_worker.py +131 -0
- memoryking/harness.py +882 -0
- memoryking/harness_context.py +376 -0
- memoryking/hooks.py +171 -0
- memoryking/host_hooks.py +454 -0
- memoryking/lean.py +352 -0
- memoryking/memory_tool.py +776 -0
- memoryking/migration.py +194 -0
- memoryking/model_install.py +78 -0
- memoryking/observability.py +101 -0
- memoryking/observability_metrics.py +100 -0
- memoryking/profiles.py +150 -0
- memoryking/providers.py +330 -0
- memoryking/py.typed +0 -0
- memoryking/pytest_plugin.py +69 -0
- memoryking/reference_agent.py +152 -0
- memoryking/repository_worker.py +57 -0
- memoryking/resume_adapter.py +154 -0
- memoryking/sdk.py +302 -0
- memoryking/shared.py +301 -0
- memoryking/shared_sdk.py +101 -0
- memoryking/vault.py +176 -0
- memoryking-0.1.0.dist-info/METADATA +157 -0
- memoryking-0.1.0.dist-info/RECORD +179 -0
- memoryking-0.1.0.dist-info/WHEEL +5 -0
- memoryking-0.1.0.dist-info/entry_points.txt +7 -0
- memoryking-0.1.0.dist-info/licenses/LICENSE +202 -0
- memoryking-0.1.0.dist-info/licenses/NOTICE +12 -0
- memoryking-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"""Generated experience requests; runtime schema is authoritative."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from typing import Any, Literal, NotRequired, TypedDict
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Procedure(TypedDict):
|
|
8
|
+
prerequisites: list[str]
|
|
9
|
+
steps: list[str]
|
|
10
|
+
verification: list[str]
|
|
11
|
+
expected_artifacts: list[str]
|
|
12
|
+
exceptions: list[str]
|
|
13
|
+
failure_signals: list[str]
|
|
14
|
+
recovery: list[str]
|
|
15
|
+
known_conditions: list[str]
|
|
16
|
+
success_evidence: list[str]
|
|
17
|
+
failure_evidence: list[str]
|
|
18
|
+
failure_assessment: str
|
|
19
|
+
dependency_mode: Literal["independent", "required"]
|
|
20
|
+
|
|
21
|
+
class Propose(TypedDict):
|
|
22
|
+
project: str
|
|
23
|
+
logical_key: str
|
|
24
|
+
expected_version: int
|
|
25
|
+
body: dict[str, Any]
|
|
26
|
+
|
|
27
|
+
class Review(TypedDict):
|
|
28
|
+
project: str
|
|
29
|
+
revision: str
|
|
30
|
+
expected_version: int
|
|
31
|
+
decision: Literal["accept", "reject", "deprecate", "quarantine", "release_quarantine"]
|
|
32
|
+
reason: str
|
|
33
|
+
breadth_reviewed: bool
|
|
34
|
+
replacement: NotRequired[dict[str, Any]]
|
|
35
|
+
|
|
36
|
+
class Activate(TypedDict):
|
|
37
|
+
project: str
|
|
38
|
+
revision: str
|
|
39
|
+
expected_version: int
|
|
40
|
+
reason: str
|
|
41
|
+
bindings: list[dict[str, Any]]
|
|
42
|
+
policy: Literal["reviewed-procedure-v1"]
|
|
43
|
+
|
|
44
|
+
class Suspend(TypedDict):
|
|
45
|
+
project: str
|
|
46
|
+
revision: str
|
|
47
|
+
expected_version: int
|
|
48
|
+
reason: str
|
|
49
|
+
|
|
50
|
+
class Query(TypedDict):
|
|
51
|
+
project: str
|
|
52
|
+
bindings: list[dict[str, Any]]
|
|
53
|
+
task: NotRequired[str]
|
|
54
|
+
run: NotRequired[str]
|
|
55
|
+
diagnostic: NotRequired[bool]
|
|
56
|
+
|
|
57
|
+
class OutcomeBody(TypedDict):
|
|
58
|
+
task: str
|
|
59
|
+
run: str
|
|
60
|
+
result: Literal["success", "failure", "unknown"]
|
|
61
|
+
acceptance_evidence: list[dict[str, Any]]
|
|
62
|
+
failures: list[str]
|
|
63
|
+
rework: list[str]
|
|
64
|
+
elapsed_ms: int | None
|
|
65
|
+
input_tokens: int | None
|
|
66
|
+
cached_input_tokens: int | None
|
|
67
|
+
output_tokens: int | None
|
|
68
|
+
limitations: list[str]
|
|
69
|
+
readers: None | list[str]
|
|
70
|
+
|
|
71
|
+
class Outcome(TypedDict):
|
|
72
|
+
project: str
|
|
73
|
+
logical_key: str
|
|
74
|
+
expected_revision: int
|
|
75
|
+
body: OutcomeBody
|
|
76
|
+
|
|
77
|
+
class Feedback(TypedDict):
|
|
78
|
+
project: str
|
|
79
|
+
receipt: str
|
|
80
|
+
reference: str
|
|
81
|
+
task: str
|
|
82
|
+
run: str
|
|
83
|
+
expected_revision: int
|
|
84
|
+
use: Literal["unknown", "read", "used"]
|
|
85
|
+
usefulness: Literal["unknown", "helpful", "irrelevant", "misleading", "harmful"]
|
|
86
|
+
comment: str | None
|
|
87
|
+
readers: None | list[str]
|
|
88
|
+
|
|
89
|
+
class Records(TypedDict):
|
|
90
|
+
project: str
|
|
91
|
+
kind: Literal["outcome", "feedback", "ranking", "shadow"]
|
|
92
|
+
|
|
93
|
+
class ShadowBrief(TypedDict):
|
|
94
|
+
project: str
|
|
95
|
+
query: str
|
|
96
|
+
bindings: list[dict[str, Any]]
|
|
97
|
+
max_output_tokens: int
|
|
98
|
+
tokenizer: str
|
|
99
|
+
top_k: NotRequired[int]
|
|
100
|
+
task: NotRequired[str]
|
|
101
|
+
run: NotRequired[str]
|
|
102
|
+
freshness: NotRequired[Literal["any", "attested"]]
|
|
103
|
+
|
|
104
|
+
class RankingPropose(TypedDict):
|
|
105
|
+
project: str
|
|
106
|
+
logical_key: str
|
|
107
|
+
feedback: list[str]
|
|
108
|
+
max_adjustment_ppm: int
|
|
109
|
+
policy: Literal["bounded-feedback-v1"]
|
|
110
|
+
|
|
111
|
+
class ShadowCase(TypedDict):
|
|
112
|
+
brief: ShadowBrief
|
|
113
|
+
relevant: list[str]
|
|
114
|
+
forbidden: list[str]
|
|
115
|
+
|
|
116
|
+
class RankingEvaluate(TypedDict):
|
|
117
|
+
project: str
|
|
118
|
+
configuration: str
|
|
119
|
+
logical_key: str
|
|
120
|
+
cases: list[ShadowCase]
|
|
121
|
+
dataset_kind: Literal["development"]
|
|
122
|
+
judgment_provenance: str
|
|
123
|
+
|
|
124
|
+
class RankingActivate(TypedDict):
|
|
125
|
+
project: str
|
|
126
|
+
configuration: str
|
|
127
|
+
shadow: str
|
|
128
|
+
expected_version: int
|
|
129
|
+
reason: str
|
|
130
|
+
|
|
131
|
+
class RankingRollback(TypedDict):
|
|
132
|
+
project: str
|
|
133
|
+
configuration: str | None
|
|
134
|
+
expected_version: int
|
|
135
|
+
reason: str
|
|
136
|
+
|
|
137
|
+
class RankingInspect(TypedDict):
|
|
138
|
+
project: str
|
|
139
|
+
|
|
140
|
+
class RecordLookup(TypedDict):
|
|
141
|
+
project: str
|
|
142
|
+
record: str
|
|
143
|
+
kind: Literal["outcome", "feedback", "ranking", "shadow"]
|
|
144
|
+
|
|
145
|
+
class Command0(TypedDict):
|
|
146
|
+
version: Literal[1]
|
|
147
|
+
incarnation: str
|
|
148
|
+
action: Literal["propose"]
|
|
149
|
+
args: Propose
|
|
150
|
+
key: str
|
|
151
|
+
|
|
152
|
+
class Command1(TypedDict):
|
|
153
|
+
version: Literal[1]
|
|
154
|
+
incarnation: str
|
|
155
|
+
action: Literal["review"]
|
|
156
|
+
args: Review
|
|
157
|
+
key: str
|
|
158
|
+
|
|
159
|
+
class Command2(TypedDict):
|
|
160
|
+
version: Literal[1]
|
|
161
|
+
incarnation: str
|
|
162
|
+
action: Literal["activate"]
|
|
163
|
+
args: Activate
|
|
164
|
+
key: str
|
|
165
|
+
|
|
166
|
+
class Command3(TypedDict):
|
|
167
|
+
version: Literal[1]
|
|
168
|
+
incarnation: str
|
|
169
|
+
action: Literal["suspend"]
|
|
170
|
+
args: Suspend
|
|
171
|
+
key: str
|
|
172
|
+
|
|
173
|
+
class Command4(TypedDict):
|
|
174
|
+
version: Literal[1]
|
|
175
|
+
incarnation: str
|
|
176
|
+
action: Literal["query"]
|
|
177
|
+
args: Query
|
|
178
|
+
|
|
179
|
+
class Command5(TypedDict):
|
|
180
|
+
version: Literal[1]
|
|
181
|
+
incarnation: str
|
|
182
|
+
action: Literal["outcome"]
|
|
183
|
+
args: Outcome
|
|
184
|
+
key: str
|
|
185
|
+
|
|
186
|
+
class Command6(TypedDict):
|
|
187
|
+
version: Literal[1]
|
|
188
|
+
incarnation: str
|
|
189
|
+
action: Literal["feedback"]
|
|
190
|
+
args: Feedback
|
|
191
|
+
key: str
|
|
192
|
+
|
|
193
|
+
class Command7(TypedDict):
|
|
194
|
+
version: Literal[1]
|
|
195
|
+
incarnation: str
|
|
196
|
+
action: Literal["records"]
|
|
197
|
+
args: Records
|
|
198
|
+
|
|
199
|
+
class Command8(TypedDict):
|
|
200
|
+
version: Literal[1]
|
|
201
|
+
incarnation: str
|
|
202
|
+
action: Literal["ranking_propose"]
|
|
203
|
+
args: RankingPropose
|
|
204
|
+
key: str
|
|
205
|
+
|
|
206
|
+
class Command9(TypedDict):
|
|
207
|
+
version: Literal[1]
|
|
208
|
+
incarnation: str
|
|
209
|
+
action: Literal["ranking_evaluate"]
|
|
210
|
+
args: RankingEvaluate
|
|
211
|
+
key: str
|
|
212
|
+
|
|
213
|
+
class Command10(TypedDict):
|
|
214
|
+
version: Literal[1]
|
|
215
|
+
incarnation: str
|
|
216
|
+
action: Literal["ranking_activate"]
|
|
217
|
+
args: RankingActivate
|
|
218
|
+
key: str
|
|
219
|
+
|
|
220
|
+
class Command11(TypedDict):
|
|
221
|
+
version: Literal[1]
|
|
222
|
+
incarnation: str
|
|
223
|
+
action: Literal["ranking_rollback"]
|
|
224
|
+
args: RankingRollback
|
|
225
|
+
key: str
|
|
226
|
+
|
|
227
|
+
class Command12(TypedDict):
|
|
228
|
+
version: Literal[1]
|
|
229
|
+
incarnation: str
|
|
230
|
+
action: Literal["ranking_inspect"]
|
|
231
|
+
args: RankingInspect
|
|
232
|
+
|
|
233
|
+
class Command13(TypedDict):
|
|
234
|
+
version: Literal[1]
|
|
235
|
+
incarnation: str
|
|
236
|
+
action: Literal["record"]
|
|
237
|
+
args: RecordLookup
|
|
238
|
+
|
|
239
|
+
ExperienceCommand = Command0 | Command1 | Command2 | Command3 | Command4 | Command5 | Command6 | Command7 | Command8 | Command9 | Command10 | Command11 | Command12 | Command13
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"""Generated; source SHA256 9ce3283a06554e2e31517c52452db9f0d846ea378c4cd786d79be0b9418d2ce0. Do not edit."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from typing import Literal, NotRequired, TypedDict
|
|
5
|
+
|
|
6
|
+
Id = str
|
|
7
|
+
|
|
8
|
+
HistoryIncarnation = str
|
|
9
|
+
|
|
10
|
+
Counter = str
|
|
11
|
+
|
|
12
|
+
Digest = str
|
|
13
|
+
|
|
14
|
+
PhaseId = str
|
|
15
|
+
|
|
16
|
+
TimestampMs = int
|
|
17
|
+
|
|
18
|
+
class Scope(TypedDict):
|
|
19
|
+
store_id: Id
|
|
20
|
+
tenant_id: Id
|
|
21
|
+
project_id: Id
|
|
22
|
+
|
|
23
|
+
class HistoryPosition(TypedDict):
|
|
24
|
+
scope: Scope
|
|
25
|
+
history_incarnation: HistoryIncarnation
|
|
26
|
+
position: Counter
|
|
27
|
+
|
|
28
|
+
class AuthorizationContext(TypedDict):
|
|
29
|
+
store_id: Id
|
|
30
|
+
tenant_id: Id
|
|
31
|
+
principal_id: Id
|
|
32
|
+
history_incarnation: HistoryIncarnation
|
|
33
|
+
authorization_generation: Counter
|
|
34
|
+
audience: str
|
|
35
|
+
|
|
36
|
+
class EvidenceReference(TypedDict):
|
|
37
|
+
evidence_id: Id
|
|
38
|
+
digest: Digest
|
|
39
|
+
source_revision: str
|
|
40
|
+
classification: Literal["synthetic", "internal", "restricted"]
|
|
41
|
+
|
|
42
|
+
ErrorCode = Literal["invalid_request", "forbidden", "revision_conflict", "budget_insufficient", "constraint_resolution_incomplete", "constraint_conflict", "applicability_unknown", "operation_ambiguous", "index_not_ready", "provider_unavailable", "history_changed", "reconciliation_required", "authorization_release_expired", "context_rebuild_required", "selector_unsupported", "selector_limit_exceeded", "selector_relation_indeterminate", "replacement_out_of_range", "replay_expired", "replay_purged", "replay_artifact_missing", "unsupported_schema", "rate_limited", "internal_error"]
|
|
43
|
+
|
|
44
|
+
class ErrorEnvelope(TypedDict):
|
|
45
|
+
schema_version: Literal["1"]
|
|
46
|
+
code: ErrorCode
|
|
47
|
+
request_id: Id
|
|
48
|
+
retryable: bool
|
|
49
|
+
retry_after_ms: int | None
|
|
50
|
+
|
|
51
|
+
class RequestIdentity(TypedDict):
|
|
52
|
+
scope: Scope
|
|
53
|
+
history_incarnation: HistoryIncarnation
|
|
54
|
+
request_namespace: Id
|
|
55
|
+
principal_id: Id
|
|
56
|
+
operation: str
|
|
57
|
+
idempotency_key: str
|
|
58
|
+
canonicalization_version: Literal["MK-C14N-1"]
|
|
59
|
+
request_hash: Digest
|
|
60
|
+
|
|
61
|
+
ExecutionStatus = Literal["planned", "ready", "running", "waiting", "blocked", "failed", "cancelled", "finished"]
|
|
62
|
+
|
|
63
|
+
class WorkItem(TypedDict):
|
|
64
|
+
task_id: Id
|
|
65
|
+
parent_task_id: Id | None
|
|
66
|
+
dependencies: list[Id]
|
|
67
|
+
execution_status: ExecutionStatus
|
|
68
|
+
criterion_ids: list[Id]
|
|
69
|
+
|
|
70
|
+
class Plan(TypedDict):
|
|
71
|
+
schema_version: Literal["1"]
|
|
72
|
+
plan_id: Id
|
|
73
|
+
plan_revision: Counter
|
|
74
|
+
scope: Scope
|
|
75
|
+
history_incarnation: HistoryIncarnation
|
|
76
|
+
tasks: list[WorkItem]
|
|
77
|
+
|
|
78
|
+
class AcceptanceCriterion(TypedDict):
|
|
79
|
+
criterion_id: Id
|
|
80
|
+
task_id: Id
|
|
81
|
+
plan_revision: Counter
|
|
82
|
+
status: Literal["passed", "failed", "pending", "stale", "waived", "not_evaluated"]
|
|
83
|
+
evidence: list[EvidenceReference]
|
|
84
|
+
waiver_decision_id: Id | None
|
|
85
|
+
|
|
86
|
+
class PhaseStatus(TypedDict):
|
|
87
|
+
schema_version: Literal["1"]
|
|
88
|
+
phase_id: PhaseId
|
|
89
|
+
plan_revision: Counter
|
|
90
|
+
technical_status: Literal["not_started", "in_progress", "closeout_pending", "complete", "partial", "blocked"]
|
|
91
|
+
approval_status: Literal["pending", "accepted", "rejected"]
|
|
92
|
+
blocking_decisions: list[Id]
|
|
93
|
+
report_status: Literal["not_generated", "draft", "qa_passed"]
|
|
94
|
+
email_status: Literal["not_submitted", "unknown", "smtp_accepted", "failed"]
|
|
95
|
+
device_status: Literal["unverified", "confirmed", "rejected"]
|
|
96
|
+
report_digest: Digest | None
|
|
97
|
+
|
|
98
|
+
class ObservationDetail(TypedDict):
|
|
99
|
+
execution_status: NotRequired[ExecutionStatus]
|
|
100
|
+
verification_status: NotRequired[Literal["passed", "failed", "pending", "stale", "waived", "not_evaluated"]]
|
|
101
|
+
summary: NotRequired[str]
|
|
102
|
+
|
|
103
|
+
class ObservationEvent(TypedDict):
|
|
104
|
+
schema_version: Literal["1"]
|
|
105
|
+
event_id: Id
|
|
106
|
+
event_type: Literal["task.updated", "verification.recorded", "checkpoint.recorded", "operation.observed", "phase.updated", "heartbeat.observed"]
|
|
107
|
+
scope: Scope
|
|
108
|
+
history_incarnation: HistoryIncarnation
|
|
109
|
+
plan_id: Id
|
|
110
|
+
plan_revision: Counter
|
|
111
|
+
phase_id: PhaseId | None
|
|
112
|
+
task_id: Id | None
|
|
113
|
+
run_id: Id | None
|
|
114
|
+
producer_id: Id
|
|
115
|
+
correlation_id: Id
|
|
116
|
+
causation_id: Id | None
|
|
117
|
+
observed_at_ms: TimestampMs
|
|
118
|
+
recorded_at_ms: TimestampMs
|
|
119
|
+
source_position: HistoryPosition
|
|
120
|
+
entity_revision: Counter
|
|
121
|
+
evidence: list[EvidenceReference]
|
|
122
|
+
detail: ObservationDetail
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://memoryking.invalid/contracts/handoff-v1",
|
|
4
|
+
"title": "MemoryKing recipient-bound full handoffs v1",
|
|
5
|
+
"oneOf": [
|
|
6
|
+
{
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"version": {
|
|
10
|
+
"const": 1
|
|
11
|
+
},
|
|
12
|
+
"incarnation": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"pattern": "^hist_[a-f0-9]{32}(?![\\s\\S])"
|
|
15
|
+
},
|
|
16
|
+
"action": {
|
|
17
|
+
"const": "prepare"
|
|
18
|
+
},
|
|
19
|
+
"key": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
22
|
+
},
|
|
23
|
+
"args": {
|
|
24
|
+
"$ref": "#/$defs/Prepare"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"required": [
|
|
28
|
+
"version",
|
|
29
|
+
"incarnation",
|
|
30
|
+
"action",
|
|
31
|
+
"key",
|
|
32
|
+
"args"
|
|
33
|
+
],
|
|
34
|
+
"additionalProperties": false
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "object",
|
|
38
|
+
"properties": {
|
|
39
|
+
"version": {
|
|
40
|
+
"const": 1
|
|
41
|
+
},
|
|
42
|
+
"incarnation": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"pattern": "^hist_[a-f0-9]{32}(?![\\s\\S])"
|
|
45
|
+
},
|
|
46
|
+
"action": {
|
|
47
|
+
"const": "materialize"
|
|
48
|
+
},
|
|
49
|
+
"key": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
52
|
+
},
|
|
53
|
+
"args": {
|
|
54
|
+
"$ref": "#/$defs/View"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"required": [
|
|
58
|
+
"version",
|
|
59
|
+
"incarnation",
|
|
60
|
+
"action",
|
|
61
|
+
"key",
|
|
62
|
+
"args"
|
|
63
|
+
],
|
|
64
|
+
"additionalProperties": false
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"type": "object",
|
|
68
|
+
"properties": {
|
|
69
|
+
"version": {
|
|
70
|
+
"const": 1
|
|
71
|
+
},
|
|
72
|
+
"incarnation": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"pattern": "^hist_[a-f0-9]{32}(?![\\s\\S])"
|
|
75
|
+
},
|
|
76
|
+
"action": {
|
|
77
|
+
"const": "preview"
|
|
78
|
+
},
|
|
79
|
+
"key": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
82
|
+
},
|
|
83
|
+
"args": {
|
|
84
|
+
"$ref": "#/$defs/View"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"required": [
|
|
88
|
+
"version",
|
|
89
|
+
"incarnation",
|
|
90
|
+
"action",
|
|
91
|
+
"key",
|
|
92
|
+
"args"
|
|
93
|
+
],
|
|
94
|
+
"additionalProperties": false
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"type": "object",
|
|
98
|
+
"properties": {
|
|
99
|
+
"version": {
|
|
100
|
+
"const": 1
|
|
101
|
+
},
|
|
102
|
+
"incarnation": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"pattern": "^hist_[a-f0-9]{32}(?![\\s\\S])"
|
|
105
|
+
},
|
|
106
|
+
"action": {
|
|
107
|
+
"const": "ack"
|
|
108
|
+
},
|
|
109
|
+
"key": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
112
|
+
},
|
|
113
|
+
"args": {
|
|
114
|
+
"$ref": "#/$defs/Acknowledge"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"required": [
|
|
118
|
+
"version",
|
|
119
|
+
"incarnation",
|
|
120
|
+
"action",
|
|
121
|
+
"key",
|
|
122
|
+
"args"
|
|
123
|
+
],
|
|
124
|
+
"additionalProperties": false
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"type": "object",
|
|
128
|
+
"properties": {
|
|
129
|
+
"version": {
|
|
130
|
+
"const": 1
|
|
131
|
+
},
|
|
132
|
+
"incarnation": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"pattern": "^hist_[a-f0-9]{32}(?![\\s\\S])"
|
|
135
|
+
},
|
|
136
|
+
"action": {
|
|
137
|
+
"const": "cancel"
|
|
138
|
+
},
|
|
139
|
+
"key": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
142
|
+
},
|
|
143
|
+
"args": {
|
|
144
|
+
"$ref": "#/$defs/Cancel"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"required": [
|
|
148
|
+
"version",
|
|
149
|
+
"incarnation",
|
|
150
|
+
"action",
|
|
151
|
+
"key",
|
|
152
|
+
"args"
|
|
153
|
+
],
|
|
154
|
+
"additionalProperties": false
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"$defs": {
|
|
158
|
+
"Prepare": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"properties": {
|
|
161
|
+
"project": {
|
|
162
|
+
"type": "string",
|
|
163
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
164
|
+
},
|
|
165
|
+
"task": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
168
|
+
},
|
|
169
|
+
"run": {
|
|
170
|
+
"anyOf": [
|
|
171
|
+
{
|
|
172
|
+
"type": "string",
|
|
173
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"type": "null"
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
"checkpoint": {
|
|
181
|
+
"type": "string",
|
|
182
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
183
|
+
},
|
|
184
|
+
"recipient": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
187
|
+
},
|
|
188
|
+
"role": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
191
|
+
},
|
|
192
|
+
"stage": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
195
|
+
},
|
|
196
|
+
"bindings": {
|
|
197
|
+
"type": "array",
|
|
198
|
+
"minItems": 1,
|
|
199
|
+
"maxItems": 256,
|
|
200
|
+
"items": {
|
|
201
|
+
"type": "object"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"ttl_ms": {
|
|
205
|
+
"type": "integer",
|
|
206
|
+
"minimum": 1000,
|
|
207
|
+
"maximum": 86400000
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"required": [
|
|
211
|
+
"project",
|
|
212
|
+
"task",
|
|
213
|
+
"run",
|
|
214
|
+
"checkpoint",
|
|
215
|
+
"recipient",
|
|
216
|
+
"role",
|
|
217
|
+
"stage",
|
|
218
|
+
"bindings",
|
|
219
|
+
"ttl_ms"
|
|
220
|
+
],
|
|
221
|
+
"additionalProperties": false
|
|
222
|
+
},
|
|
223
|
+
"View": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"properties": {
|
|
226
|
+
"project": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
229
|
+
},
|
|
230
|
+
"handle": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
233
|
+
},
|
|
234
|
+
"max_output_tokens": {
|
|
235
|
+
"type": "integer",
|
|
236
|
+
"minimum": 1,
|
|
237
|
+
"maximum": 65536
|
|
238
|
+
},
|
|
239
|
+
"tokenizer": {
|
|
240
|
+
"type": "string",
|
|
241
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"required": [
|
|
245
|
+
"project",
|
|
246
|
+
"handle",
|
|
247
|
+
"max_output_tokens",
|
|
248
|
+
"tokenizer"
|
|
249
|
+
],
|
|
250
|
+
"additionalProperties": false
|
|
251
|
+
},
|
|
252
|
+
"Acknowledge": {
|
|
253
|
+
"type": "object",
|
|
254
|
+
"properties": {
|
|
255
|
+
"project": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
258
|
+
},
|
|
259
|
+
"handle": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
262
|
+
},
|
|
263
|
+
"materialization": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
266
|
+
},
|
|
267
|
+
"rendered_hash": {
|
|
268
|
+
"type": "string",
|
|
269
|
+
"pattern": "^[a-f0-9]{64}(?![\\s\\S])"
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"required": [
|
|
273
|
+
"project",
|
|
274
|
+
"handle",
|
|
275
|
+
"materialization",
|
|
276
|
+
"rendered_hash"
|
|
277
|
+
],
|
|
278
|
+
"additionalProperties": false
|
|
279
|
+
},
|
|
280
|
+
"Cancel": {
|
|
281
|
+
"type": "object",
|
|
282
|
+
"properties": {
|
|
283
|
+
"project": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
286
|
+
},
|
|
287
|
+
"handle": {
|
|
288
|
+
"type": "string",
|
|
289
|
+
"pattern": "^[A-Za-z0-9_-]{1,96}(?![\\s\\S])"
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
"required": [
|
|
293
|
+
"project",
|
|
294
|
+
"handle"
|
|
295
|
+
],
|
|
296
|
+
"additionalProperties": false
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|