context-engineering-core 0.12.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.
- context_engine/__init__.py +15 -0
- context_engine/__main__.py +3 -0
- context_engine/_sqlite.py +19 -0
- context_engine/_windows_security.py +125 -0
- context_engine/_windows_storage.py +110 -0
- context_engine/adapters.py +148 -0
- context_engine/answers.py +90 -0
- context_engine/budget.py +93 -0
- context_engine/cli.py +222 -0
- context_engine/config.py +193 -0
- context_engine/context.py +116 -0
- context_engine/demo.py +98 -0
- context_engine/errors.py +91 -0
- context_engine/evaluation/__init__.py +1 -0
- context_engine/evaluation/commands.py +90 -0
- context_engine/evaluation/corpus.py +247 -0
- context_engine/evaluation/data/freeze.json +26 -0
- context_engine/evaluation/data/ground_truth.json +287 -0
- context_engine/evaluation/data/pin_retention.json +8 -0
- context_engine/evaluation/data/protocol.json +122 -0
- context_engine/evaluation/data/scenario.json +1226 -0
- context_engine/evaluation/data/summary_fixture.json +7 -0
- context_engine/evaluation/execution.py +538 -0
- context_engine/evaluation/fixtures.py +32 -0
- context_engine/evaluation/grading.py +62 -0
- context_engine/evaluation/harness.py +165 -0
- context_engine/evaluation/heldout/__init__.py +260 -0
- context_engine/evaluation/heldout/__main__.py +40 -0
- context_engine/evaluation/heldout/data/ground_truth.json +18 -0
- context_engine/evaluation/heldout/data/manifest.json +9 -0
- context_engine/evaluation/heldout/data/protocol.json +14 -0
- context_engine/evaluation/heldout/data/scenarios.json +18 -0
- context_engine/evaluation/heldout/data/scoring_manifest.json +4 -0
- context_engine/evaluation/heldout/data/scoring_protocol.json +12 -0
- context_engine/evaluation/heldout/scoring.py +176 -0
- context_engine/evaluation/protocol.py +264 -0
- context_engine/evaluation/reporting.py +294 -0
- context_engine/evaluation/results.py +331 -0
- context_engine/evaluation/run_commands.py +146 -0
- context_engine/evaluation/strategies.py +261 -0
- context_engine/inspection.py +266 -0
- context_engine/layers/__init__.py +18 -0
- context_engine/layers/cap.py +99 -0
- context_engine/layers/common.py +162 -0
- context_engine/layers/pin.py +68 -0
- context_engine/layers/retrieve.py +233 -0
- context_engine/layers/summarize.py +202 -0
- context_engine/layers/window.py +29 -0
- context_engine/mcp_server.py +267 -0
- context_engine/memory/__init__.py +5 -0
- context_engine/memory/codec.py +91 -0
- context_engine/memory/demo.py +90 -0
- context_engine/memory/store.py +770 -0
- context_engine/models.py +384 -0
- context_engine/pipeline.py +383 -0
- context_engine/providers/__init__.py +1 -0
- context_engine/providers/client.py +301 -0
- context_engine/providers/commands.py +138 -0
- context_engine/providers/contracts.py +324 -0
- context_engine/providers/credentials.py +66 -0
- context_engine/providers/memory.py +112 -0
- context_engine/providers/store.py +408 -0
- context_engine/providers/transport.py +195 -0
- context_engine/providers/windows_credentials.py +23 -0
- context_engine/py.typed +0 -0
- context_engine/service/__init__.py +1 -0
- context_engine/service/__main__.py +68 -0
- context_engine/service/app.py +404 -0
- context_engine/service/auth.py +132 -0
- context_engine/service/client.py +52 -0
- context_engine/service/control.py +134 -0
- context_engine/service/demo.py +151 -0
- context_engine/service/integrations.py +28 -0
- context_engine/service/schemas.py +59 -0
- context_engine/service/worker.py +59 -0
- context_engine/service/workers.py +156 -0
- context_engine/summaries.py +196 -0
- context_engine/tokens.py +171 -0
- context_engine/work.py +46 -0
- context_engineering_core-0.12.0.dist-info/METADATA +203 -0
- context_engineering_core-0.12.0.dist-info/RECORD +84 -0
- context_engineering_core-0.12.0.dist-info/WHEEL +4 -0
- context_engineering_core-0.12.0.dist-info/entry_points.txt +3 -0
- context_engineering_core-0.12.0.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"scenario_id": "incident-100-v1",
|
|
4
|
+
"facts": [
|
|
5
|
+
{
|
|
6
|
+
"fact_id": "merchant",
|
|
7
|
+
"expected": "merchant-aurora",
|
|
8
|
+
"aliases": [],
|
|
9
|
+
"source_turn_id": "t5",
|
|
10
|
+
"source_message_id": "m5",
|
|
11
|
+
"question": "Which merchant was involved?",
|
|
12
|
+
"zone": "early"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"fact_id": "ticket",
|
|
16
|
+
"expected": "INC-4826",
|
|
17
|
+
"aliases": [],
|
|
18
|
+
"source_turn_id": "t8",
|
|
19
|
+
"source_message_id": "m8",
|
|
20
|
+
"question": "What was the incident ticket identifier?",
|
|
21
|
+
"zone": "early"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"fact_id": "service",
|
|
25
|
+
"expected": "payment-router",
|
|
26
|
+
"aliases": [],
|
|
27
|
+
"source_turn_id": "t11",
|
|
28
|
+
"source_message_id": "m11",
|
|
29
|
+
"question": "Which service handled payment routing?",
|
|
30
|
+
"zone": "early"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"fact_id": "owner",
|
|
34
|
+
"expected": "team-kestrel",
|
|
35
|
+
"aliases": [],
|
|
36
|
+
"source_turn_id": "t14",
|
|
37
|
+
"source_message_id": "m14",
|
|
38
|
+
"question": "Which team owned the remediation?",
|
|
39
|
+
"zone": "early"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"fact_id": "database",
|
|
43
|
+
"expected": "PostgreSQL",
|
|
44
|
+
"aliases": [],
|
|
45
|
+
"source_turn_id": "t17",
|
|
46
|
+
"source_message_id": "m17",
|
|
47
|
+
"question": "Which database stored the transactions?",
|
|
48
|
+
"zone": "early"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"fact_id": "queue",
|
|
52
|
+
"expected": "settlement-events",
|
|
53
|
+
"aliases": [],
|
|
54
|
+
"source_turn_id": "t20",
|
|
55
|
+
"source_message_id": "m20",
|
|
56
|
+
"question": "Which queue carried settlement messages?",
|
|
57
|
+
"zone": "early"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"fact_id": "rollback",
|
|
61
|
+
"expected": "release-amber",
|
|
62
|
+
"aliases": [],
|
|
63
|
+
"source_turn_id": "t23",
|
|
64
|
+
"source_message_id": "m23",
|
|
65
|
+
"question": "Which release was the rollback target?",
|
|
66
|
+
"zone": "early"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"fact_id": "runbook",
|
|
70
|
+
"expected": "RB-642",
|
|
71
|
+
"aliases": [],
|
|
72
|
+
"source_turn_id": "t26",
|
|
73
|
+
"source_message_id": "m26",
|
|
74
|
+
"question": "Which runbook guided the response?",
|
|
75
|
+
"zone": "early"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"fact_id": "cluster",
|
|
79
|
+
"expected": "cluster-cobalt",
|
|
80
|
+
"aliases": [],
|
|
81
|
+
"source_turn_id": "t29",
|
|
82
|
+
"source_message_id": "m29",
|
|
83
|
+
"question": "Which cluster hosted the workload?",
|
|
84
|
+
"zone": "early"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"fact_id": "bucket",
|
|
88
|
+
"expected": "audit-vault-731",
|
|
89
|
+
"aliases": [],
|
|
90
|
+
"source_turn_id": "t32",
|
|
91
|
+
"source_message_id": "m32",
|
|
92
|
+
"question": "Which bucket held the audit exports?",
|
|
93
|
+
"zone": "early"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"fact_id": "region",
|
|
97
|
+
"expected": "eu-north-2",
|
|
98
|
+
"aliases": [],
|
|
99
|
+
"source_turn_id": "t34",
|
|
100
|
+
"source_message_id": "m34",
|
|
101
|
+
"question": "Which region hosted the affected deployment?",
|
|
102
|
+
"zone": "middle"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"fact_id": "canary",
|
|
106
|
+
"expected": "canary-lotus",
|
|
107
|
+
"aliases": [],
|
|
108
|
+
"source_turn_id": "t37",
|
|
109
|
+
"source_message_id": "m37",
|
|
110
|
+
"question": "Which canary detected the regression?",
|
|
111
|
+
"zone": "middle"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"fact_id": "dashboard",
|
|
115
|
+
"expected": "latency-compass",
|
|
116
|
+
"aliases": [],
|
|
117
|
+
"source_turn_id": "t40",
|
|
118
|
+
"source_message_id": "m40",
|
|
119
|
+
"question": "Which dashboard tracked the latency?",
|
|
120
|
+
"zone": "middle"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"fact_id": "certificate",
|
|
124
|
+
"expected": "cert-marigold",
|
|
125
|
+
"aliases": [],
|
|
126
|
+
"source_turn_id": "t43",
|
|
127
|
+
"source_message_id": "m43",
|
|
128
|
+
"question": "Which certificate required replacement?",
|
|
129
|
+
"zone": "middle"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"fact_id": "feature",
|
|
133
|
+
"expected": "flag-river",
|
|
134
|
+
"aliases": [],
|
|
135
|
+
"source_turn_id": "t46",
|
|
136
|
+
"source_message_id": "m46",
|
|
137
|
+
"question": "Which feature flag was disabled?",
|
|
138
|
+
"zone": "middle"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"fact_id": "cache",
|
|
142
|
+
"expected": "redis-slate",
|
|
143
|
+
"aliases": [],
|
|
144
|
+
"source_turn_id": "t49",
|
|
145
|
+
"source_message_id": "m49",
|
|
146
|
+
"question": "Which cache instance was invalidated?",
|
|
147
|
+
"zone": "middle"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"fact_id": "trace",
|
|
151
|
+
"expected": "trace-8f2c",
|
|
152
|
+
"aliases": [],
|
|
153
|
+
"source_turn_id": "t52",
|
|
154
|
+
"source_message_id": "m52",
|
|
155
|
+
"question": "What trace identifier linked the failing requests?",
|
|
156
|
+
"zone": "middle"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"fact_id": "replica",
|
|
160
|
+
"expected": "replica-willow",
|
|
161
|
+
"aliases": [],
|
|
162
|
+
"source_turn_id": "t55",
|
|
163
|
+
"source_message_id": "m55",
|
|
164
|
+
"question": "Which replica served stale reads?",
|
|
165
|
+
"zone": "middle"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"fact_id": "schema",
|
|
169
|
+
"expected": "schema-violet",
|
|
170
|
+
"aliases": [],
|
|
171
|
+
"source_turn_id": "t58",
|
|
172
|
+
"source_message_id": "m58",
|
|
173
|
+
"question": "Which schema version introduced the mismatch?",
|
|
174
|
+
"zone": "middle"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"fact_id": "retries",
|
|
178
|
+
"expected": "seven",
|
|
179
|
+
"aliases": [
|
|
180
|
+
"7"
|
|
181
|
+
],
|
|
182
|
+
"source_turn_id": "t61",
|
|
183
|
+
"source_message_id": "m61",
|
|
184
|
+
"question": "How many retries were configured?",
|
|
185
|
+
"zone": "middle"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"fact_id": "timeout",
|
|
189
|
+
"expected": "timeout-420ms",
|
|
190
|
+
"aliases": [],
|
|
191
|
+
"source_turn_id": "t64",
|
|
192
|
+
"source_message_id": "m64",
|
|
193
|
+
"question": "What timeout setting was applied?",
|
|
194
|
+
"zone": "middle"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"fact_id": "region_backup",
|
|
198
|
+
"expected": "ap-south-3",
|
|
199
|
+
"aliases": [],
|
|
200
|
+
"source_turn_id": "t67",
|
|
201
|
+
"source_message_id": "m67",
|
|
202
|
+
"question": "Which region was reserved for failover?",
|
|
203
|
+
"zone": "late"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"fact_id": "policy",
|
|
207
|
+
"expected": "policy-cedar",
|
|
208
|
+
"aliases": [],
|
|
209
|
+
"source_turn_id": "t70",
|
|
210
|
+
"source_message_id": "m70",
|
|
211
|
+
"question": "Which access policy was revised?",
|
|
212
|
+
"zone": "late"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"fact_id": "namespace",
|
|
216
|
+
"expected": "payments-indigo",
|
|
217
|
+
"aliases": [],
|
|
218
|
+
"source_turn_id": "t73",
|
|
219
|
+
"source_message_id": "m73",
|
|
220
|
+
"question": "Which namespace contained the workers?",
|
|
221
|
+
"zone": "late"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"fact_id": "endpoint",
|
|
225
|
+
"expected": "gateway-orchid",
|
|
226
|
+
"aliases": [],
|
|
227
|
+
"source_turn_id": "t76",
|
|
228
|
+
"source_message_id": "m76",
|
|
229
|
+
"question": "Which endpoint received the redirected traffic?",
|
|
230
|
+
"zone": "late"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"fact_id": "checksum",
|
|
234
|
+
"expected": "sha256-91ac",
|
|
235
|
+
"aliases": [],
|
|
236
|
+
"source_turn_id": "t79",
|
|
237
|
+
"source_message_id": "m79",
|
|
238
|
+
"question": "Which checksum verified the recovered archive?",
|
|
239
|
+
"zone": "late"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"fact_id": "shard",
|
|
243
|
+
"expected": "shard-19",
|
|
244
|
+
"aliases": [],
|
|
245
|
+
"source_turn_id": "t82",
|
|
246
|
+
"source_message_id": "m82",
|
|
247
|
+
"question": "Which partition ended up carrying the blame?",
|
|
248
|
+
"zone": "late"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"fact_id": "batch",
|
|
252
|
+
"expected": "batch-6721",
|
|
253
|
+
"aliases": [],
|
|
254
|
+
"source_turn_id": "t85",
|
|
255
|
+
"source_message_id": "m85",
|
|
256
|
+
"question": "Which batch was replayed after recovery?",
|
|
257
|
+
"zone": "late"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"fact_id": "approval",
|
|
261
|
+
"expected": "approval-juniper",
|
|
262
|
+
"aliases": [],
|
|
263
|
+
"source_turn_id": "t90",
|
|
264
|
+
"source_message_id": "m90",
|
|
265
|
+
"question": "Which approval authorized the restart?",
|
|
266
|
+
"zone": "late"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"fact_id": "handoff",
|
|
270
|
+
"expected": "handoff-sparrow",
|
|
271
|
+
"aliases": [],
|
|
272
|
+
"source_turn_id": "t95",
|
|
273
|
+
"source_message_id": "m95",
|
|
274
|
+
"question": "Which handoff reference closed the investigation?",
|
|
275
|
+
"zone": "late"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"fact_id": "archive",
|
|
279
|
+
"expected": "archive-pine",
|
|
280
|
+
"aliases": [],
|
|
281
|
+
"source_turn_id": "t99",
|
|
282
|
+
"source_message_id": "m99",
|
|
283
|
+
"question": "Which archive stored the final evidence?",
|
|
284
|
+
"zone": "late"
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"protocol_id": "incident-evaluation-v1",
|
|
4
|
+
"approval": "owner_approved",
|
|
5
|
+
"scenario_id": "incident-100-v1",
|
|
6
|
+
"variants": [
|
|
7
|
+
{
|
|
8
|
+
"id": "A0",
|
|
9
|
+
"cap": false,
|
|
10
|
+
"pins": false,
|
|
11
|
+
"retrieve": false,
|
|
12
|
+
"summarize": false,
|
|
13
|
+
"window": false
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "A1",
|
|
17
|
+
"cap": false,
|
|
18
|
+
"pins": false,
|
|
19
|
+
"retrieve": false,
|
|
20
|
+
"summarize": false,
|
|
21
|
+
"window": true
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "A2",
|
|
25
|
+
"cap": true,
|
|
26
|
+
"pins": false,
|
|
27
|
+
"retrieve": false,
|
|
28
|
+
"summarize": false,
|
|
29
|
+
"window": true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "A3",
|
|
33
|
+
"cap": true,
|
|
34
|
+
"pins": true,
|
|
35
|
+
"retrieve": false,
|
|
36
|
+
"summarize": false,
|
|
37
|
+
"window": true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "A4",
|
|
41
|
+
"cap": true,
|
|
42
|
+
"pins": true,
|
|
43
|
+
"retrieve": true,
|
|
44
|
+
"summarize": false,
|
|
45
|
+
"window": true
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "A5",
|
|
49
|
+
"cap": true,
|
|
50
|
+
"pins": true,
|
|
51
|
+
"retrieve": true,
|
|
52
|
+
"summarize": true,
|
|
53
|
+
"window": true
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"budgets": [
|
|
57
|
+
900,
|
|
58
|
+
3000
|
|
59
|
+
],
|
|
60
|
+
"models": [
|
|
61
|
+
"openai/gpt-oss-120b",
|
|
62
|
+
"openai/gpt-oss-20b"
|
|
63
|
+
],
|
|
64
|
+
"generation": {
|
|
65
|
+
"temperature": 0,
|
|
66
|
+
"reasoning_effort": "low",
|
|
67
|
+
"max_completion_tokens": 256
|
|
68
|
+
},
|
|
69
|
+
"budget": {
|
|
70
|
+
"model_capacity": 131072,
|
|
71
|
+
"retrieval_reserve": 280,
|
|
72
|
+
"summary_reserve": 80
|
|
73
|
+
},
|
|
74
|
+
"cap": {
|
|
75
|
+
"max_tokens": 35,
|
|
76
|
+
"head_tokens": 22,
|
|
77
|
+
"tail_tokens": 8
|
|
78
|
+
},
|
|
79
|
+
"retrieval": {
|
|
80
|
+
"chunk_characters": 360,
|
|
81
|
+
"overlap_characters": 80,
|
|
82
|
+
"top_k": 4,
|
|
83
|
+
"minimum_score": 0,
|
|
84
|
+
"k1": 1.5,
|
|
85
|
+
"b": 0.75
|
|
86
|
+
},
|
|
87
|
+
"tokenizer": {
|
|
88
|
+
"encoding_name": "o200k_harmony",
|
|
89
|
+
"calibration_factor": 1.07,
|
|
90
|
+
"adapter_overhead_tokens": 0
|
|
91
|
+
},
|
|
92
|
+
"targets": {
|
|
93
|
+
"input_budget": 900,
|
|
94
|
+
"variant": "A5",
|
|
95
|
+
"fit": 31,
|
|
96
|
+
"retained": 28,
|
|
97
|
+
"correct": 27,
|
|
98
|
+
"median_input_reduction": 0.9,
|
|
99
|
+
"max_truncated": 0
|
|
100
|
+
},
|
|
101
|
+
"grading": {
|
|
102
|
+
"normalization": "nfkc-casefold-whitespace-v1",
|
|
103
|
+
"answer_mode": "exact-alias-or-json-answer",
|
|
104
|
+
"presence_mode": "identifier-boundary-v1",
|
|
105
|
+
"abstentions": [
|
|
106
|
+
"UNKNOWN"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"primary_pins": "empty",
|
|
110
|
+
"summary_coverage": "frozen-content-bound-to-omitted-history",
|
|
111
|
+
"zone_boundaries": [
|
|
112
|
+
33,
|
|
113
|
+
66,
|
|
114
|
+
100
|
|
115
|
+
],
|
|
116
|
+
"bm25_variant": "BM25Plus-delta1",
|
|
117
|
+
"corpus_limits": {
|
|
118
|
+
"turns": 100,
|
|
119
|
+
"facts": 31
|
|
120
|
+
},
|
|
121
|
+
"notes": "Model IDs and capacity are PRD defaults, not live-provider availability claims. Approval and spending authorization are required before inference."
|
|
122
|
+
}
|