betterwithage Claude Opus 4.7 commited on
Commit
1195536
·
verified ·
1 Parent(s): 46fb967

deploy(hf): sync szl-holdings/a11oy@9c3bdaf18f2fc3370631b1c820070cbe07eced2c derived COPY set

Browse files

Reusable Dockerfile-COPY-derived deploy from szl-holdings/a11oy 9c3bdaf18f2fc3370631b1c820070cbe07eced2c.
Files: 1129 Pruned: 0
Derived from Dockerfile COPY sources (NO hand-maintained allowlist).

Signed-off-by: SZL Holdings <noreply@szlholdings.ai>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

a11oy_frontier_page.py CHANGED
@@ -20,7 +20,8 @@ The whole stack on one surface:
20
  - the multi-node sovereign GPU fabric (REAL reachability probe),
21
  - the MODELED orbital tier (links out to the /orbital page),
22
  - governance / restraint (codified doctrine + signed DSSE receipts),
23
- - the ROADMAP composite inference-provenance-receipt play (clearly labeled).
 
24
 
25
  HONESTY (doctrine v11, non-negotiable):
26
  * A persistent honest banner is pinned to the top of every viewport and a
@@ -687,7 +688,7 @@ function tileCard(t) {{
687
  else if (label === 'SAMPLE')
688
  banner = `<div class="tile-banner sample">SAMPLE — illustrative value, never billable or live.</div>`;
689
  else if (label === 'UNAVAILABLE')
690
- banner = `<div class="tile-banner unavailable">UNAVAILABLE — sub-source down right now; reported honestly, not faked.</div>`;
691
  return `<div class="card" style="--edge:${{edge}}">
692
  <div class="cat">${{esc(t.category || '')}}</div>
693
  <h3><span>${{esc(t.name || '')}}</span><span class="badge ${{c}}">${{esc(label)}}</span></h3>
@@ -792,6 +793,11 @@ document.getElementById('brain-query-form').addEventListener('submit', async eve
792
  const tiles = m.capabilities || [];
793
  const s = m.summary || {{}};
794
  const lc = s.label_counts || {{}};
 
 
 
 
 
795
 
796
  // roll-up chips (honest counts straight from the manifest)
797
  document.getElementById('rollup').innerHTML = [
@@ -799,18 +805,22 @@ document.getElementById('brain-query-form').addEventListener('submit', async eve
799
  `<span class="chip">MEASURED <b>${{esc(lc.MEASURED || 0)}}</b></span>`,
800
  `<span class="chip">MODELED <b>${{esc(lc.MODELED || 0)}}</b></span>`,
801
  `<span class="chip">ROADMAP <b>${{esc(lc.ROADMAP || 0)}}</b></span>`,
802
- `<span class="chip">all sources live: <b>${{esc(String(s.all_sources_live))}}</b></span>`,
 
803
  (s.degraded_tiles && s.degraded_tiles.length)
804
  ? `<span class="chip">degraded: <b>${{esc(s.degraded_tiles.join(', '))}}</b></span>` : '',
 
 
805
  ].join('');
806
 
807
  document.getElementById('grid').innerHTML = tiles.map(tileCard).join('');
808
  drawConstellation(tiles);
809
 
810
  const el = document.getElementById('status');
811
- el.textContent = 'live · composed from ' + esc(MANIFEST_EP) +
812
- ' · ' + esc(s.tiles ?? tiles.length) + ' tiles · all_sources_live=' +
813
- esc(String(s.all_sources_live));
 
814
  document.getElementById('subline').innerHTML =
815
  'Every capability we run, on one screen — composed live by <code>/frontier/manifest</code>. ' +
816
  'Each tile shows its <b>honest label</b> and a <b>link to the proof</b>. No label is upgraded.';
 
20
  - the multi-node sovereign GPU fabric (REAL reachability probe),
21
  - the MODELED orbital tier (links out to the /orbital page),
22
  - governance / restraint (codified doctrine + signed DSSE receipts),
23
+ - the composite inference-provenance capability (UNAVAILABLE until a real write
24
+ has minted an independently visible artifact).
25
 
26
  HONESTY (doctrine v11, non-negotiable):
27
  * A persistent honest banner is pinned to the top of every viewport and a
 
688
  else if (label === 'SAMPLE')
689
  banner = `<div class="tile-banner sample">SAMPLE — illustrative value, never billable or live.</div>`;
690
  else if (label === 'UNAVAILABLE')
691
+ banner = `<div class="tile-banner unavailable">UNAVAILABLE — source, dependency, or required artifact is not operationally evidenced.</div>`;
692
  return `<div class="card" style="--edge:${{edge}}">
693
  <div class="cat">${{esc(t.category || '')}}</div>
694
  <h3><span>${{esc(t.name || '')}}</span><span class="badge ${{c}}">${{esc(label)}}</span></h3>
 
793
  const tiles = m.capabilities || [];
794
  const s = m.summary || {{}};
795
  const lc = s.label_counts || {{}};
796
+ const source = s.source_reachability || {{state:'UNKNOWN'}};
797
+ const readiness = s.operational_readiness || {{state:'UNKNOWN', ready:false, blocked_tiles:[]}};
798
+ const blockedNames = Array.isArray(readiness.blocked_tiles)
799
+ ? readiness.blocked_tiles.map(row => row && row.name ? row.name : row).filter(Boolean)
800
+ : [];
801
 
802
  // roll-up chips (honest counts straight from the manifest)
803
  document.getElementById('rollup').innerHTML = [
 
805
  `<span class="chip">MEASURED <b>${{esc(lc.MEASURED || 0)}}</b></span>`,
806
  `<span class="chip">MODELED <b>${{esc(lc.MODELED || 0)}}</b></span>`,
807
  `<span class="chip">ROADMAP <b>${{esc(lc.ROADMAP || 0)}}</b></span>`,
808
+ `<span class="chip">source reachability <b>${{esc(source.state || 'UNKNOWN')}}</b></span>`,
809
+ `<span class="chip">operational readiness <b>${{esc(readiness.state || 'UNKNOWN')}}</b></span>`,
810
  (s.degraded_tiles && s.degraded_tiles.length)
811
  ? `<span class="chip">degraded: <b>${{esc(s.degraded_tiles.join(', '))}}</b></span>` : '',
812
+ blockedNames.length
813
+ ? `<span class="chip">not ready: <b>${{esc(blockedNames.join(', '))}}</b></span>` : '',
814
  ].join('');
815
 
816
  document.getElementById('grid').innerHTML = tiles.map(tileCard).join('');
817
  drawConstellation(tiles);
818
 
819
  const el = document.getElementById('status');
820
+ el.textContent = 'manifest reachable · composed from ' + esc(MANIFEST_EP) +
821
+ ' · ' + esc(s.tiles ?? tiles.length) + ' tiles · source=' +
822
+ esc(source.state || 'UNKNOWN') + ' · operational=' +
823
+ esc(readiness.state || 'UNKNOWN');
824
  document.getElementById('subline').innerHTML =
825
  'Every capability we run, on one screen — composed live by <code>/frontier/manifest</code>. ' +
826
  'Each tile shows its <b>honest label</b> and a <b>link to the proof</b>. No label is upgraded.';
benchmarks/quant_live/receipts/latest.json ADDED
@@ -0,0 +1,398 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "receipt": {
3
+ "schema_version": "szl.quant-live-benchmark-receipt.v1",
4
+ "measurement_class": "MEASURED",
5
+ "scope": "bounded local execution; not a replication of vendor-scale claims",
6
+ "started_at": "2026-07-18T17:43:53.100404+00:00",
7
+ "completed_at": "2026-07-18T17:44:02.420257+00:00",
8
+ "host": {
9
+ "platform": "Windows-11-10.0.26200-SP0",
10
+ "python": "3.12.10",
11
+ "gpu": {
12
+ "available": true,
13
+ "devices": [
14
+ {
15
+ "index": 0,
16
+ "name": "NVIDIA GeForce RTX 5050 Laptop GPU",
17
+ "driver_version": "610.47",
18
+ "memory_total_mib": 8151.0,
19
+ "memory_used_mib": 5937.0,
20
+ "utilization_pct": 0.0,
21
+ "temperature_c": 56.0,
22
+ "power_w": 34.38
23
+ }
24
+ ]
25
+ }
26
+ },
27
+ "ollama": {
28
+ "base_url_class": "loopback-local",
29
+ "candidate_identity": {
30
+ "requested_model": "szl-nemo:latest",
31
+ "show_response_sha256": "5dc2366cd686de777b3dd450471fd2f38947bbc538a5780e8e2cd4dcba26b342",
32
+ "show_wall_ms": 203.729,
33
+ "reported_digest": "527db2cf6c705d8fabb95693d038d9c06b4a2b0b8b0a4bbdbd01212d37242970",
34
+ "base_lineage": {
35
+ "base_ref": "sha256:527db2cf6c705d8fabb95693d038d9c06b4a2b0b8b0a4bbdbd01212d37242970",
36
+ "parent_model": "nemotron-3-nano:4b",
37
+ "base_digest": "527db2cf6c705d8fabb95693d038d9c06b4a2b0b8b0a4bbdbd01212d37242970"
38
+ },
39
+ "details": {
40
+ "format": "gguf",
41
+ "family": "nemotron_h",
42
+ "families": [
43
+ "nemotron_h"
44
+ ],
45
+ "parameter_size": "4.0B",
46
+ "quantization_level": "Q4_K_M"
47
+ },
48
+ "model_info": {
49
+ "general.architecture": "nemotron_h",
50
+ "general.file_type": 15,
51
+ "general.parameter_count": 3973556832
52
+ }
53
+ },
54
+ "baseline_identity": {
55
+ "requested_model": "qwen2.5:3b",
56
+ "show_response_sha256": "24cd1f4b5d7ac8dbd5c559af4ad37e7b420cf00ed1cb5c8ef31f34c40ece59ad",
57
+ "show_wall_ms": 126.912,
58
+ "reported_digest": "5ee4f07cdb9beadbbb293e85803c569b01bd37ed059d2715faa7bb405f31caa6",
59
+ "base_lineage": {
60
+ "base_ref": "sha256:5ee4f07cdb9beadbbb293e85803c569b01bd37ed059d2715faa7bb405f31caa6",
61
+ "parent_model": null,
62
+ "base_digest": "5ee4f07cdb9beadbbb293e85803c569b01bd37ed059d2715faa7bb405f31caa6"
63
+ },
64
+ "details": {
65
+ "format": "gguf",
66
+ "family": "qwen2",
67
+ "families": [
68
+ "qwen2"
69
+ ],
70
+ "parameter_size": "3.1B",
71
+ "quantization_level": "Q4_K_M"
72
+ },
73
+ "model_info": {
74
+ "general.architecture": "qwen2",
75
+ "general.file_type": 15,
76
+ "general.parameter_count": 3085938688
77
+ }
78
+ },
79
+ "identity_stability": {
80
+ "candidate_before_sha256": "5dc2366cd686de777b3dd450471fd2f38947bbc538a5780e8e2cd4dcba26b342",
81
+ "candidate_after_sha256": "5dc2366cd686de777b3dd450471fd2f38947bbc538a5780e8e2cd4dcba26b342",
82
+ "baseline_before_sha256": "24cd1f4b5d7ac8dbd5c559af4ad37e7b420cf00ed1cb5c8ef31f34c40ece59ad",
83
+ "baseline_after_sha256": "24cd1f4b5d7ac8dbd5c559af4ad37e7b420cf00ed1cb5c8ef31f34c40ece59ad",
84
+ "stable": true
85
+ },
86
+ "candidate": {
87
+ "model": "szl-nemo:latest",
88
+ "warmup": {
89
+ "response": "WARM",
90
+ "done_reason": "stop",
91
+ "wall_ms": 722.382,
92
+ "total_duration_ms": 709.843,
93
+ "load_duration_ms": 276.664,
94
+ "prompt_eval_count": 134,
95
+ "eval_count": 3,
96
+ "tokens_per_second": 96.114
97
+ },
98
+ "exact_match": {
99
+ "tasks_total": 6,
100
+ "tasks_passed": 6,
101
+ "accuracy_pct": 100.0,
102
+ "rows": [
103
+ {
104
+ "task_id": "literal",
105
+ "expected": "A11OY",
106
+ "actual": "A11OY",
107
+ "passed": true,
108
+ "done_reason": "stop",
109
+ "wall_ms": 450.877,
110
+ "total_duration_ms": 420.954,
111
+ "load_duration_ms": 259.701,
112
+ "prompt_eval_count": 137,
113
+ "eval_count": 6,
114
+ "tokens_per_second": 89.067
115
+ },
116
+ {
117
+ "task_id": "multiply",
118
+ "expected": "56",
119
+ "actual": "56",
120
+ "passed": true,
121
+ "done_reason": "stop",
122
+ "wall_ms": 333.825,
123
+ "total_duration_ms": 329.301,
124
+ "load_duration_ms": 205.881,
125
+ "prompt_eval_count": 140,
126
+ "eval_count": 3,
127
+ "tokens_per_second": 101.331
128
+ },
129
+ {
130
+ "task_id": "divide",
131
+ "expected": "12",
132
+ "actual": "12",
133
+ "passed": true,
134
+ "done_reason": "stop",
135
+ "wall_ms": 529.241,
136
+ "total_duration_ms": 506.122,
137
+ "load_duration_ms": 379.366,
138
+ "prompt_eval_count": 146,
139
+ "eval_count": 3,
140
+ "tokens_per_second": 93.281
141
+ },
142
+ {
143
+ "task_id": "policy",
144
+ "expected": "DENY",
145
+ "actual": "DENY",
146
+ "passed": true,
147
+ "done_reason": "stop",
148
+ "wall_ms": 346.732,
149
+ "total_duration_ms": 331.693,
150
+ "load_duration_ms": 207.045,
151
+ "prompt_eval_count": 149,
152
+ "eval_count": 3,
153
+ "tokens_per_second": 102.435
154
+ },
155
+ {
156
+ "task_id": "prime",
157
+ "expected": "YES",
158
+ "actual": "YES",
159
+ "passed": true,
160
+ "done_reason": "stop",
161
+ "wall_ms": 352.869,
162
+ "total_duration_ms": 338.094,
163
+ "load_duration_ms": 229.918,
164
+ "prompt_eval_count": 141,
165
+ "eval_count": 2,
166
+ "tokens_per_second": 126.542
167
+ },
168
+ {
169
+ "task_id": "sequence",
170
+ "expected": "32",
171
+ "actual": "32",
172
+ "passed": true,
173
+ "done_reason": "stop",
174
+ "wall_ms": 374.745,
175
+ "total_duration_ms": 351.884,
176
+ "load_duration_ms": 224.815,
177
+ "prompt_eval_count": 153,
178
+ "eval_count": 3,
179
+ "tokens_per_second": 98.18
180
+ }
181
+ ]
182
+ },
183
+ "bounded_retrieval": {
184
+ "probes_total": 2,
185
+ "probes_passed": 1,
186
+ "max_prompt_eval_tokens": 2050,
187
+ "rows": [
188
+ {
189
+ "declared_context_words": 256,
190
+ "needle": "KHIPU-7319",
191
+ "actual": "KHIPU-7319",
192
+ "passed": true,
193
+ "done_reason": "stop",
194
+ "wall_ms": 719.438,
195
+ "total_duration_ms": 687.582,
196
+ "load_duration_ms": 246.987,
197
+ "prompt_eval_count": 1707,
198
+ "eval_count": 10,
199
+ "tokens_per_second": 79.863
200
+ },
201
+ {
202
+ "declared_context_words": 768,
203
+ "needle": "OUROBOROS-2048",
204
+ "actual": "THE BOUND_TOKEN IS \"OUROBOROS-2048\". IT APPEARS TO BE A PLACEHOLDER OR IDENTIFIER, POSSIBLY USED IN A SPECIFIC CONTEXT SUCH AS A GAME, CODE, OR SYSTEM WHERE TOKENS ARE BOUNDED BY CERTAIN VALUES. THE TERM \"OUROBOROS\" MAY REFERENCE THE MYTH",
205
+ "passed": false,
206
+ "done_reason": "length",
207
+ "wall_ms": 1356.424,
208
+ "total_duration_ms": 1313.648,
209
+ "load_duration_ms": 244.667,
210
+ "prompt_eval_count": 2050,
211
+ "eval_count": 64,
212
+ "tokens_per_second": 86.593
213
+ }
214
+ ]
215
+ },
216
+ "runtime": {
217
+ "requests": 8,
218
+ "p50_wall_ms": 412.811,
219
+ "p50_tokens_per_second": 95.731
220
+ }
221
+ },
222
+ "baseline": {
223
+ "model": "qwen2.5:3b",
224
+ "warmup": {
225
+ "response": "WARM",
226
+ "done_reason": "stop",
227
+ "wall_ms": 349.908,
228
+ "total_duration_ms": 320.413,
229
+ "load_duration_ms": 243.776,
230
+ "prompt_eval_count": 35,
231
+ "eval_count": 3,
232
+ "tokens_per_second": 115.576
233
+ },
234
+ "exact_match": {
235
+ "tasks_total": 6,
236
+ "tasks_passed": 5,
237
+ "accuracy_pct": 83.333,
238
+ "rows": [
239
+ {
240
+ "task_id": "literal",
241
+ "expected": "A11OY",
242
+ "actual": "A11OY",
243
+ "passed": true,
244
+ "done_reason": "stop",
245
+ "wall_ms": 245.158,
246
+ "total_duration_ms": 221.861,
247
+ "load_duration_ms": 140.6,
248
+ "prompt_eval_count": 38,
249
+ "eval_count": 6,
250
+ "tokens_per_second": 108.605
251
+ },
252
+ {
253
+ "task_id": "multiply",
254
+ "expected": "56",
255
+ "actual": "56",
256
+ "passed": true,
257
+ "done_reason": "stop",
258
+ "wall_ms": 218.939,
259
+ "total_duration_ms": 203.945,
260
+ "load_duration_ms": 144.901,
261
+ "prompt_eval_count": 41,
262
+ "eval_count": 3,
263
+ "tokens_per_second": 110.229
264
+ },
265
+ {
266
+ "task_id": "divide",
267
+ "expected": "12",
268
+ "actual": "12",
269
+ "passed": true,
270
+ "done_reason": "stop",
271
+ "wall_ms": 211.796,
272
+ "total_duration_ms": 195.573,
273
+ "load_duration_ms": 141.238,
274
+ "prompt_eval_count": 47,
275
+ "eval_count": 3,
276
+ "tokens_per_second": 113.062
277
+ },
278
+ {
279
+ "task_id": "policy",
280
+ "expected": "DENY",
281
+ "actual": "DENY",
282
+ "passed": true,
283
+ "done_reason": "stop",
284
+ "wall_ms": 196.783,
285
+ "total_duration_ms": 172.102,
286
+ "load_duration_ms": 136.666,
287
+ "prompt_eval_count": 49,
288
+ "eval_count": 3,
289
+ "tokens_per_second": 170.416
290
+ },
291
+ {
292
+ "task_id": "prime",
293
+ "expected": "YES",
294
+ "actual": "NO",
295
+ "passed": false,
296
+ "done_reason": "stop",
297
+ "wall_ms": 205.308,
298
+ "total_duration_ms": 191.094,
299
+ "load_duration_ms": 147.057,
300
+ "prompt_eval_count": 42,
301
+ "eval_count": 2,
302
+ "tokens_per_second": 132.1
303
+ },
304
+ {
305
+ "task_id": "sequence",
306
+ "expected": "32",
307
+ "actual": "32",
308
+ "passed": true,
309
+ "done_reason": "stop",
310
+ "wall_ms": 193.346,
311
+ "total_duration_ms": 190.3,
312
+ "load_duration_ms": 123.162,
313
+ "prompt_eval_count": 54,
314
+ "eval_count": 3,
315
+ "tokens_per_second": 105.156
316
+ }
317
+ ]
318
+ },
319
+ "bounded_retrieval": {
320
+ "probes_total": 2,
321
+ "probes_passed": 0,
322
+ "max_prompt_eval_tokens": 2050,
323
+ "rows": [
324
+ {
325
+ "declared_context_words": 256,
326
+ "needle": "KHIPU-7319",
327
+ "actual": "BOUND_TOKEN=KHIPU-7319",
328
+ "passed": false,
329
+ "done_reason": "stop",
330
+ "wall_ms": 333.571,
331
+ "total_duration_ms": 329.228,
332
+ "load_duration_ms": 183.964,
333
+ "prompt_eval_count": 1600,
334
+ "eval_count": 12,
335
+ "tokens_per_second": 114.273
336
+ },
337
+ {
338
+ "declared_context_words": 768,
339
+ "needle": "OUROBOROS-2048",
340
+ "actual": "BOUND_TOKEN REPRESENTS A SPECIFIC IDENTIFIER OR REFERENCE TO A CRYPTOGRAPHIC KEY OR TOKEN, IN THIS CASE, OUROBOROS-2048. WITHOUT ADDITIONAL CONTEXT ABOUT THE FULL SYSTEM OR PROTOCOL USING THIS TERM, WE CAN ONLY INTERPRET IT AS A PREDEFINED NAME FOR A 2048-BIT (OR 25",
341
+ "passed": false,
342
+ "done_reason": "length",
343
+ "wall_ms": 871.002,
344
+ "total_duration_ms": 852.869,
345
+ "load_duration_ms": 158.89,
346
+ "prompt_eval_count": 2050,
347
+ "eval_count": 64,
348
+ "tokens_per_second": 102.669
349
+ }
350
+ ]
351
+ },
352
+ "runtime": {
353
+ "requests": 8,
354
+ "p50_wall_ms": 215.368,
355
+ "p50_tokens_per_second": 111.645
356
+ }
357
+ }
358
+ },
359
+ "comparisons": {
360
+ "candidate_vs_baseline_wall_speed_ratio": 0.5217,
361
+ "candidate_minus_baseline_exact_match_points": 16.667
362
+ },
363
+ "quant_reference": {
364
+ "pca_pipeline": {
365
+ "repeats": 3,
366
+ "p50_ms": 11.09,
367
+ "min_ms": 8.473,
368
+ "max_ms": 476.677,
369
+ "compute_path": "CPU_REFERENCE"
370
+ },
371
+ "tda_stress_pipeline": {
372
+ "repeats": 3,
373
+ "p50_ms": 10.378,
374
+ "min_ms": 9.673,
375
+ "max_ms": 10.552,
376
+ "compute_path": "CPU_REFERENCE"
377
+ },
378
+ "gpu_acceleration_comparison": "UNAVAILABLE: no distinct cuML/CuPy/Ripser++ execution receipt"
379
+ },
380
+ "limitations": [
381
+ "Candidate and baseline differ in architecture and size; results are not vendor-claim replications.",
382
+ "Exact-match and needle suites are bounded operational probes, not general capability benchmarks.",
383
+ "PCA/TDA timings exercise the existing CPU reference path only.",
384
+ "No energy claim is made without an independently verified interval energy meter."
385
+ ],
386
+ "content_sha256": "8ede48b23df3063247c0871f328f8f8be6f1e5d2ceef285d00d0425cdc573ab8"
387
+ },
388
+ "dsse": {
389
+ "payloadType": "application/vnd.szl.quant-live-benchmark+json",
390
+ "payload": "eyJjb21wYXJpc29ucyI6eyJjYW5kaWRhdGVfbWludXNfYmFzZWxpbmVfZXhhY3RfbWF0Y2hfcG9pbnRzIjoxNi42NjcsImNhbmRpZGF0ZV92c19iYXNlbGluZV93YWxsX3NwZWVkX3JhdGlvIjowLjUyMTd9LCJjb21wbGV0ZWRfYXQiOiIyMDI2LTA3LTE4VDE3OjQ0OjAyLjQyMDI1NyswMDowMCIsImNvbnRlbnRfc2hhMjU2IjoiOGVkZTQ4YjIzZGYzMDYzMjQ3YzA4NzFmMzI4ZjhmOGJlNmYxZTVkMmNlZWYyODVkMDBkMDQyNWNkYzU3M2FiOCIsImhvc3QiOnsiZ3B1Ijp7ImF2YWlsYWJsZSI6dHJ1ZSwiZGV2aWNlcyI6W3siZHJpdmVyX3ZlcnNpb24iOiI2MTAuNDciLCJpbmRleCI6MCwibWVtb3J5X3RvdGFsX21pYiI6ODE1MS4wLCJtZW1vcnlfdXNlZF9taWIiOjU5MzcuMCwibmFtZSI6Ik5WSURJQSBHZUZvcmNlIFJUWCA1MDUwIExhcHRvcCBHUFUiLCJwb3dlcl93IjozNC4zOCwidGVtcGVyYXR1cmVfYyI6NTYuMCwidXRpbGl6YXRpb25fcGN0IjowLjB9XX0sInBsYXRmb3JtIjoiV2luZG93cy0xMS0xMC4wLjI2MjAwLVNQMCIsInB5dGhvbiI6IjMuMTIuMTAifSwibGltaXRhdGlvbnMiOlsiQ2FuZGlkYXRlIGFuZCBiYXNlbGluZSBkaWZmZXIgaW4gYXJjaGl0ZWN0dXJlIGFuZCBzaXplOyByZXN1bHRzIGFyZSBub3QgdmVuZG9yLWNsYWltIHJlcGxpY2F0aW9ucy4iLCJFeGFjdC1tYXRjaCBhbmQgbmVlZGxlIHN1aXRlcyBhcmUgYm91bmRlZCBvcGVyYXRpb25hbCBwcm9iZXMsIG5vdCBnZW5lcmFsIGNhcGFiaWxpdHkgYmVuY2htYXJrcy4iLCJQQ0EvVERBIHRpbWluZ3MgZXhlcmNpc2UgdGhlIGV4aXN0aW5nIENQVSByZWZlcmVuY2UgcGF0aCBvbmx5LiIsIk5vIGVuZXJneSBjbGFpbSBpcyBtYWRlIHdpdGhvdXQgYW4gaW5kZXBlbmRlbnRseSB2ZXJpZmllZCBpbnRlcnZhbCBlbmVyZ3kgbWV0ZXIuIl0sIm1lYXN1cmVtZW50X2NsYXNzIjoiTUVBU1VSRUQiLCJvbGxhbWEiOnsiYmFzZV91cmxfY2xhc3MiOiJsb29wYmFjay1sb2NhbCIsImJhc2VsaW5lIjp7ImJvdW5kZWRfcmV0cmlldmFsIjp7Im1heF9wcm9tcHRfZXZhbF90b2tlbnMiOjIwNTAsInByb2Jlc19wYXNzZWQiOjAsInByb2Jlc190b3RhbCI6Miwicm93cyI6W3siYWN0dWFsIjoiQk9VTkRfVE9LRU49S0hJUFUtNzMxOSIsImRlY2xhcmVkX2NvbnRleHRfd29yZHMiOjI1NiwiZG9uZV9yZWFzb24iOiJzdG9wIiwiZXZhbF9jb3VudCI6MTIsImxvYWRfZHVyYXRpb25fbXMiOjE4My45NjQsIm5lZWRsZSI6IktISVBVLTczMTkiLCJwYXNzZWQiOmZhbHNlLCJwcm9tcHRfZXZhbF9jb3VudCI6MTYwMCwidG9rZW5zX3Blcl9zZWNvbmQiOjExNC4yNzMsInRvdGFsX2R1cmF0aW9uX21zIjozMjkuMjI4LCJ3YWxsX21zIjozMzMuNTcxfSx7ImFjdHVhbCI6IkJPVU5EX1RPS0VOIFJFUFJFU0VOVFMgQSBTUEVDSUZJQyBJREVOVElGSUVSIE9SIFJFRkVSRU5DRSBUTyBBIENSWVBUT0dSQVBISUMgS0VZIE9SIFRPS0VOLCBJTiBUSElTIENBU0UsIE9VUk9CT1JPUy0yMDQ4LiBXSVRIT1VUIEFERElUSU9OQUwgQ09OVEVYVCBBQk9VVCBUSEUgRlVMTCBTWVNURU0gT1IgUFJPVE9DT0wgVVNJTkcgVEhJUyBURVJNLCBXRSBDQU4gT05MWSBJTlRFUlBSRVQgSVQgQVMgQSBQUkVERUZJTkVEIE5BTUUgRk9SIEEgMjA0OC1CSVQgKE9SIDI1IiwiZGVjbGFyZWRfY29udGV4dF93b3JkcyI6NzY4LCJkb25lX3JlYXNvbiI6Imxlbmd0aCIsImV2YWxfY291bnQiOjY0LCJsb2FkX2R1cmF0aW9uX21zIjoxNTguODksIm5lZWRsZSI6Ik9VUk9CT1JPUy0yMDQ4IiwicGFzc2VkIjpmYWxzZSwicHJvbXB0X2V2YWxfY291bnQiOjIwNTAsInRva2Vuc19wZXJfc2Vjb25kIjoxMDIuNjY5LCJ0b3RhbF9kdXJhdGlvbl9tcyI6ODUyLjg2OSwid2FsbF9tcyI6ODcxLjAwMn1dfSwiZXhhY3RfbWF0Y2giOnsiYWNjdXJhY3lfcGN0Ijo4My4zMzMsInJvd3MiOlt7ImFjdHVhbCI6IkExMU9ZIiwiZG9uZV9yZWFzb24iOiJzdG9wIiwiZXZhbF9jb3VudCI6NiwiZXhwZWN0ZWQiOiJBMTFPWSIsImxvYWRfZHVyYXRpb25fbXMiOjE0MC42LCJwYXNzZWQiOnRydWUsInByb21wdF9ldmFsX2NvdW50IjozOCwidGFza19pZCI6ImxpdGVyYWwiLCJ0b2tlbnNfcGVyX3NlY29uZCI6MTA4LjYwNSwidG90YWxfZHVyYXRpb25fbXMiOjIyMS44NjEsIndhbGxfbXMiOjI0NS4xNTh9LHsiYWN0dWFsIjoiNTYiLCJkb25lX3JlYXNvbiI6InN0b3AiLCJldmFsX2NvdW50IjozLCJleHBlY3RlZCI6IjU2IiwibG9hZF9kdXJhdGlvbl9tcyI6MTQ0LjkwMSwicGFzc2VkIjp0cnVlLCJwcm9tcHRfZXZhbF9jb3VudCI6NDEsInRhc2tfaWQiOiJtdWx0aXBseSIsInRva2Vuc19wZXJfc2Vjb25kIjoxMTAuMjI5LCJ0b3RhbF9kdXJhdGlvbl9tcyI6MjAzLjk0NSwid2FsbF9tcyI6MjE4LjkzOX0seyJhY3R1YWwiOiIxMiIsImRvbmVfcmVhc29uIjoic3RvcCIsImV2YWxfY291bnQiOjMsImV4cGVjdGVkIjoiMTIiLCJsb2FkX2R1cmF0aW9uX21zIjoxNDEuMjM4LCJwYXNzZWQiOnRydWUsInByb21wdF9ldmFsX2NvdW50Ijo0NywidGFza19pZCI6ImRpdmlkZSIsInRva2Vuc19wZXJfc2Vjb25kIjoxMTMuMDYyLCJ0b3RhbF9kdXJhdGlvbl9tcyI6MTk1LjU3Mywid2FsbF9tcyI6MjExLjc5Nn0seyJhY3R1YWwiOiJERU5ZIiwiZG9uZV9yZWFzb24iOiJzdG9wIiwiZXZhbF9jb3VudCI6MywiZXhwZWN0ZWQiOiJERU5ZIiwibG9hZF9kdXJhdGlvbl9tcyI6MTM2LjY2NiwicGFzc2VkIjp0cnVlLCJwcm9tcHRfZXZhbF9jb3VudCI6NDksInRhc2tfaWQiOiJwb2xpY3kiLCJ0b2tlbnNfcGVyX3NlY29uZCI6MTcwLjQxNiwidG90YWxfZHVyYXRpb25fbXMiOjE3Mi4xMDIsIndhbGxfbXMiOjE5Ni43ODN9LHsiYWN0dWFsIjoiTk8iLCJkb25lX3JlYXNvbiI6InN0b3AiLCJldmFsX2NvdW50IjoyLCJleHBlY3RlZCI6IllFUyIsImxvYWRfZHVyYXRpb25fbXMiOjE0Ny4wNTcsInBhc3NlZCI6ZmFsc2UsInByb21wdF9ldmFsX2NvdW50Ijo0MiwidGFza19pZCI6InByaW1lIiwidG9rZW5zX3Blcl9zZWNvbmQiOjEzMi4xLCJ0b3RhbF9kdXJhdGlvbl9tcyI6MTkxLjA5NCwid2FsbF9tcyI6MjA1LjMwOH0seyJhY3R1YWwiOiIzMiIsImRvbmVfcmVhc29uIjoic3RvcCIsImV2YWxfY291bnQiOjMsImV4cGVjdGVkIjoiMzIiLCJsb2FkX2R1cmF0aW9uX21zIjoxMjMuMTYyLCJwYXNzZWQiOnRydWUsInByb21wdF9ldmFsX2NvdW50Ijo1NCwidGFza19pZCI6InNlcXVlbmNlIiwidG9rZW5zX3Blcl9zZWNvbmQiOjEwNS4xNTYsInRvdGFsX2R1cmF0aW9uX21zIjoxOTAuMywid2FsbF9tcyI6MTkzLjM0Nn1dLCJ0YXNrc19wYXNzZWQiOjUsInRhc2tzX3RvdGFsIjo2fSwibW9kZWwiOiJxd2VuMi41OjNiIiwicnVudGltZSI6eyJwNTBfdG9rZW5zX3Blcl9zZWNvbmQiOjExMS42NDUsInA1MF93YWxsX21zIjoyMTUuMzY4LCJyZXF1ZXN0cyI6OH0sIndhcm11cCI6eyJkb25lX3JlYXNvbiI6InN0b3AiLCJldmFsX2NvdW50IjozLCJsb2FkX2R1cmF0aW9uX21zIjoyNDMuNzc2LCJwcm9tcHRfZXZhbF9jb3VudCI6MzUsInJlc3BvbnNlIjoiV0FSTSIsInRva2Vuc19wZXJfc2Vjb25kIjoxMTUuNTc2LCJ0b3RhbF9kdXJhdGlvbl9tcyI6MzIwLjQxMywid2FsbF9tcyI6MzQ5LjkwOH19LCJiYXNlbGluZV9pZGVudGl0eSI6eyJiYXNlX2xpbmVhZ2UiOnsiYmFzZV9kaWdlc3QiOiI1ZWU0ZjA3Y2RiOWJlYWRiYmIyOTNlODU4MDNjNTY5YjAxYmQzN2VkMDU5ZDI3MTVmYWE3YmI0MDVmMzFjYWE2IiwiYmFzZV9yZWYiOiJzaGEyNTY6NWVlNGYwN2NkYjliZWFkYmJiMjkzZTg1ODAzYzU2OWIwMWJkMzdlZDA1OWQyNzE1ZmFhN2JiNDA1ZjMxY2FhNiIsInBhcmVudF9tb2RlbCI6bnVsbH0sImRldGFpbHMiOnsiZmFtaWxpZXMiOlsicXdlbjIiXSwiZmFtaWx5IjoicXdlbjIiLCJmb3JtYXQiOiJnZ3VmIiwicGFyYW1ldGVyX3NpemUiOiIzLjFCIiwicXVhbnRpemF0aW9uX2xldmVsIjoiUTRfS19NIn0sIm1vZGVsX2luZm8iOnsiZ2VuZXJhbC5hcmNoaXRlY3R1cmUiOiJxd2VuMiIsImdlbmVyYWwuZmlsZV90eXBlIjoxNSwiZ2VuZXJhbC5wYXJhbWV0ZXJfY291bnQiOjMwODU5Mzg2ODh9LCJyZXBvcnRlZF9kaWdlc3QiOiI1ZWU0ZjA3Y2RiOWJlYWRiYmIyOTNlODU4MDNjNTY5YjAxYmQzN2VkMDU5ZDI3MTVmYWE3YmI0MDVmMzFjYWE2IiwicmVxdWVzdGVkX21vZGVsIjoicXdlbjIuNTozYiIsInNob3dfcmVzcG9uc2Vfc2hhMjU2IjoiMjRjZDFmNGI1ZDdhYzhkYmQ1YzU1OWFmNGFkMzdlN2I0MjBjZjAwZWQxY2I1YzhlZjMxZjM0YzQwZWNlNTlhZCIsInNob3dfd2FsbF9tcyI6MTI2LjkxMn0sImNhbmRpZGF0ZSI6eyJib3VuZGVkX3JldHJpZXZhbCI6eyJtYXhfcHJvbXB0X2V2YWxfdG9rZW5zIjoyMDUwLCJwcm9iZXNfcGFzc2VkIjoxLCJwcm9iZXNfdG90YWwiOjIsInJvd3MiOlt7ImFjdHVhbCI6IktISVBVLTczMTkiLCJkZWNsYXJlZF9jb250ZXh0X3dvcmRzIjoyNTYsImRvbmVfcmVhc29uIjoic3RvcCIsImV2YWxfY291bnQiOjEwLCJsb2FkX2R1cmF0aW9uX21zIjoyNDYuOTg3LCJuZWVkbGUiOiJLSElQVS03MzE5IiwicGFzc2VkIjp0cnVlLCJwcm9tcHRfZXZhbF9jb3VudCI6MTcwNywidG9rZW5zX3Blcl9zZWNvbmQiOjc5Ljg2MywidG90YWxfZHVyYXRpb25fbXMiOjY4Ny41ODIsIndhbGxfbXMiOjcxOS40Mzh9LHsiYWN0dWFsIjoiVEhFIEJPVU5EX1RPS0VOIElTIFwiT1VST0JPUk9TLTIwNDhcIi4gSVQgQVBQRUFSUyBUTyBCRSBBIFBMQUNFSE9MREVSIE9SIElERU5USUZJRVIsIFBPU1NJQkxZIFVTRUQgSU4gQSBTUEVDSUZJQyBDT05URVhUIFNVQ0ggQVMgQSBHQU1FLCBDT0RFLCBPUiBTWVNURU0gV0hFUkUgVE9LRU5TIEFSRSBCT1VOREVEIEJZIENFUlRBSU4gVkFMVUVTLiBUSEUgVEVSTSBcIk9VUk9CT1JPU1wiIE1BWSBSRUZFUkVOQ0UgVEhFIE1ZVEgiLCJkZWNsYXJlZF9jb250ZXh0X3dvcmRzIjo3NjgsImRvbmVfcmVhc29uIjoibGVuZ3RoIiwiZXZhbF9jb3VudCI6NjQsImxvYWRfZHVyYXRpb25fbXMiOjI0NC42NjcsIm5lZWRsZSI6Ik9VUk9CT1JPUy0yMDQ4IiwicGFzc2VkIjpmYWxzZSwicHJvbXB0X2V2YWxfY291bnQiOjIwNTAsInRva2Vuc19wZXJfc2Vjb25kIjo4Ni41OTMsInRvdGFsX2R1cmF0aW9uX21zIjoxMzEzLjY0OCwid2FsbF9tcyI6MTM1Ni40MjR9XX0sImV4YWN0X21hdGNoIjp7ImFjY3VyYWN5X3BjdCI6MTAwLjAsInJvd3MiOlt7ImFjdHVhbCI6IkExMU9ZIiwiZG9uZV9yZWFzb24iOiJzdG9wIiwiZXZhbF9jb3VudCI6NiwiZXhwZWN0ZWQiOiJBMTFPWSIsImxvYWRfZHVyYXRpb25fbXMiOjI1OS43MDEsInBhc3NlZCI6dHJ1ZSwicHJvbXB0X2V2YWxfY291bnQiOjEzNywidGFza19pZCI6ImxpdGVyYWwiLCJ0b2tlbnNfcGVyX3NlY29uZCI6ODkuMDY3LCJ0b3RhbF9kdXJhdGlvbl9tcyI6NDIwLjk1NCwid2FsbF9tcyI6NDUwLjg3N30seyJhY3R1YWwiOiI1NiIsImRvbmVfcmVhc29uIjoic3RvcCIsImV2YWxfY291bnQiOjMsImV4cGVjdGVkIjoiNTYiLCJsb2FkX2R1cmF0aW9uX21zIjoyMDUuODgxLCJwYXNzZWQiOnRydWUsInByb21wdF9ldmFsX2NvdW50IjoxNDAsInRhc2tfaWQiOiJtdWx0aXBseSIsInRva2Vuc19wZXJfc2Vjb25kIjoxMDEuMzMxLCJ0b3RhbF9kdXJhdGlvbl9tcyI6MzI5LjMwMSwid2FsbF9tcyI6MzMzLjgyNX0seyJhY3R1YWwiOiIxMiIsImRvbmVfcmVhc29uIjoic3RvcCIsImV2YWxfY291bnQiOjMsImV4cGVjdGVkIjoiMTIiLCJsb2FkX2R1cmF0aW9uX21zIjozNzkuMzY2LCJwYXNzZWQiOnRydWUsInByb21wdF9ldmFsX2NvdW50IjoxNDYsInRhc2tfaWQiOiJkaXZpZGUiLCJ0b2tlbnNfcGVyX3NlY29uZCI6OTMuMjgxLCJ0b3RhbF9kdXJhdGlvbl9tcyI6NTA2LjEyMiwid2FsbF9tcyI6NTI5LjI0MX0seyJhY3R1YWwiOiJERU5ZIiwiZG9uZV9yZWFzb24iOiJzdG9wIiwiZXZhbF9jb3VudCI6MywiZXhwZWN0ZWQiOiJERU5ZIiwibG9hZF9kdXJhdGlvbl9tcyI6MjA3LjA0NSwicGFzc2VkIjp0cnVlLCJwcm9tcHRfZXZhbF9jb3VudCI6MTQ5LCJ0YXNrX2lkIjoicG9saWN5IiwidG9rZW5zX3Blcl9zZWNvbmQiOjEwMi40MzUsInRvdGFsX2R1cmF0aW9uX21zIjozMzEuNjkzLCJ3YWxsX21zIjozNDYuNzMyfSx7ImFjdHVhbCI6IllFUyIsImRvbmVfcmVhc29uIjoic3RvcCIsImV2YWxfY291bnQiOjIsImV4cGVjdGVkIjoiWUVTIiwibG9hZF9kdXJhdGlvbl9tcyI6MjI5LjkxOCwicGFzc2VkIjp0cnVlLCJwcm9tcHRfZXZhbF9jb3VudCI6MTQxLCJ0YXNrX2lkIjoicHJpbWUiLCJ0b2tlbnNfcGVyX3NlY29uZCI6MTI2LjU0MiwidG90YWxfZHVyYXRpb25fbXMiOjMzOC4wOTQsIndhbGxfbXMiOjM1Mi44Njl9LHsiYWN0dWFsIjoiMzIiLCJkb25lX3JlYXNvbiI6InN0b3AiLCJldmFsX2NvdW50IjozLCJleHBlY3RlZCI6IjMyIiwibG9hZF9kdXJhdGlvbl9tcyI6MjI0LjgxNSwicGFzc2VkIjp0cnVlLCJwcm9tcHRfZXZhbF9jb3VudCI6MTUzLCJ0YXNrX2lkIjoic2VxdWVuY2UiLCJ0b2tlbnNfcGVyX3NlY29uZCI6OTguMTgsInRvdGFsX2R1cmF0aW9uX21zIjozNTEuODg0LCJ3YWxsX21zIjozNzQuNzQ1fV0sInRhc2tzX3Bhc3NlZCI6NiwidGFza3NfdG90YWwiOjZ9LCJtb2RlbCI6InN6bC1uZW1vOmxhdGVzdCIsInJ1bnRpbWUiOnsicDUwX3Rva2Vuc19wZXJfc2Vjb25kIjo5NS43MzEsInA1MF93YWxsX21zIjo0MTIuODExLCJyZXF1ZXN0cyI6OH0sIndhcm11cCI6eyJkb25lX3JlYXNvbiI6InN0b3AiLCJldmFsX2NvdW50IjozLCJsb2FkX2R1cmF0aW9uX21zIjoyNzYuNjY0LCJwcm9tcHRfZXZhbF9jb3VudCI6MTM0LCJyZXNwb25zZSI6IldBUk0iLCJ0b2tlbnNfcGVyX3NlY29uZCI6OTYuMTE0LCJ0b3RhbF9kdXJhdGlvbl9tcyI6NzA5Ljg0Mywid2FsbF9tcyI6NzIyLjM4Mn19LCJjYW5kaWRhdGVfaWRlbnRpdHkiOnsiYmFzZV9saW5lYWdlIjp7ImJhc2VfZGlnZXN0IjoiNTI3ZGIyY2Y2YzcwNWQ4ZmFiYjk1NjkzZDAzOGQ5YzA2YjRhMmIwYjhiMGE0YmJkYmQwMTIxMmQzNzI0Mjk3MCIsImJhc2VfcmVmIjoic2hhMjU2OjUyN2RiMmNmNmM3MDVkOGZhYmI5NTY5M2QwMzhkOWMwNmI0YTJiMGI4YjBhNGJiZGJkMDEyMTJkMzcyNDI5NzAiLCJwYXJlbnRfbW9kZWwiOiJuZW1vdHJvbi0zLW5hbm86NGIifSwiZGV0YWlscyI6eyJmYW1pbGllcyI6WyJuZW1vdHJvbl9oIl0sImZhbWlseSI6Im5lbW90cm9uX2giLCJmb3JtYXQiOiJnZ3VmIiwicGFyYW1ldGVyX3NpemUiOiI0LjBCIiwicXVhbnRpemF0aW9uX2xldmVsIjoiUTRfS19NIn0sIm1vZGVsX2luZm8iOnsiZ2VuZXJhbC5hcmNoaXRlY3R1cmUiOiJuZW1vdHJvbl9oIiwiZ2VuZXJhbC5maWxlX3R5cGUiOjE1LCJnZW5lcmFsLnBhcmFtZXRlcl9jb3VudCI6Mzk3MzU1NjgzMn0sInJlcG9ydGVkX2RpZ2VzdCI6IjUyN2RiMmNmNmM3MDVkOGZhYmI5NTY5M2QwMzhkOWMwNmI0YTJiMGI4YjBhNGJiZGJkMDEyMTJkMzcyNDI5NzAiLCJyZXF1ZXN0ZWRfbW9kZWwiOiJzemwtbmVtbzpsYXRlc3QiLCJzaG93X3Jlc3BvbnNlX3NoYTI1NiI6IjVkYzIzNjZjZDY4NmRlNzc3YjNkZDQ1MDQ3MWZkMmYzODk0N2JiYzUzOGE1NzgwZThlMmNkNGRjYmEyNmIzNDIiLCJzaG93X3dhbGxfbXMiOjIwMy43Mjl9LCJpZGVudGl0eV9zdGFiaWxpdHkiOnsiYmFzZWxpbmVfYWZ0ZXJfc2hhMjU2IjoiMjRjZDFmNGI1ZDdhYzhkYmQ1YzU1OWFmNGFkMzdlN2I0MjBjZjAwZWQxY2I1YzhlZjMxZjM0YzQwZWNlNTlhZCIsImJhc2VsaW5lX2JlZm9yZV9zaGEyNTYiOiIyNGNkMWY0YjVkN2FjOGRiZDVjNTU5YWY0YWQzN2U3YjQyMGNmMDBlZDFjYjVjOGVmMzFmMzRjNDBlY2U1OWFkIiwiY2FuZGlkYXRlX2FmdGVyX3NoYTI1NiI6IjVkYzIzNjZjZDY4NmRlNzc3YjNkZDQ1MDQ3MWZkMmYzODk0N2JiYzUzOGE1NzgwZThlMmNkNGRjYmEyNmIzNDIiLCJjYW5kaWRhdGVfYmVmb3JlX3NoYTI1NiI6IjVkYzIzNjZjZDY4NmRlNzc3YjNkZDQ1MDQ3MWZkMmYzODk0N2JiYzUzOGE1NzgwZThlMmNkNGRjYmEyNmIzNDIiLCJzdGFibGUiOnRydWV9fSwicXVhbnRfcmVmZXJlbmNlIjp7ImdwdV9hY2NlbGVyYXRpb25fY29tcGFyaXNvbiI6IlVOQVZBSUxBQkxFOiBubyBkaXN0aW5jdCBjdU1ML0N1UHkvUmlwc2VyKysgZXhlY3V0aW9uIHJlY2VpcHQiLCJwY2FfcGlwZWxpbmUiOnsiY29tcHV0ZV9wYXRoIjoiQ1BVX1JFRkVSRU5DRSIsIm1heF9tcyI6NDc2LjY3NywibWluX21zIjo4LjQ3MywicDUwX21zIjoxMS4wOSwicmVwZWF0cyI6M30sInRkYV9zdHJlc3NfcGlwZWxpbmUiOnsiY29tcHV0ZV9wYXRoIjoiQ1BVX1JFRkVSRU5DRSIsIm1heF9tcyI6MTAuNTUyLCJtaW5fbXMiOjkuNjczLCJwNTBfbXMiOjEwLjM3OCwicmVwZWF0cyI6M319LCJzY2hlbWFfdmVyc2lvbiI6InN6bC5xdWFudC1saXZlLWJlbmNobWFyay1yZWNlaXB0LnYxIiwic2NvcGUiOiJib3VuZGVkIGxvY2FsIGV4ZWN1dGlvbjsgbm90IGEgcmVwbGljYXRpb24gb2YgdmVuZG9yLXNjYWxlIGNsYWltcyIsInN0YXJ0ZWRfYXQiOiIyMDI2LTA3LTE4VDE3OjQzOjUzLjEwMDQwNCswMDowMCJ9",
391
+ "_dsse": "DSSEv1",
392
+ "_pae_sha256": "c3dc21ce7bdd6dfa1648f2731c58d86dedb568147f9aafa6f010bdc0c477c07e",
393
+ "_signed_at": "2026-07-18T17:44:02.600600+00:00",
394
+ "signatures": [],
395
+ "honesty": "UNSIGNED — neither SZL_COSIGN_PRIVATE_KEY_PEM nor SZL_COSIGN_PRIVATE_PEM secret present in this runtime; no signature fabricated.",
396
+ "signed": false
397
+ }
398
+ }
pages/hatun-mcp.html CHANGED
@@ -9,7 +9,7 @@ a{color:var(--gold);text-decoration:none}a:hover{text-decoration:underline}
9
  header{border-bottom:1px solid var(--line);padding:14px 22px;display:flex;align-items:center;gap:14px;background:linear-gradient(180deg,#10121b,#0a0b10)}
10
  header .brand{font-weight:700;letter-spacing:.5px;color:var(--gold);font-size:18px}
11
  header .tag{color:var(--mut);font-size:12px}
12
- nav{display:flex;flex-wrap:wrap;gap:8px;padding:10px 22px;border-bottom:1px solid var(--line);background:var(--panel)}
13
  nav a{font-size:12.5px;padding:4px 10px;border:1px solid var(--line);border-radius:999px;color:var(--mut)}
14
  nav a:hover{border-color:var(--gold);color:var(--gold);text-decoration:none}
15
  nav a.active{background:var(--gold);color:#0a0b10;border-color:var(--gold);font-weight:600}
@@ -22,6 +22,8 @@ h1{font-size:26px;margin:0 0 4px;color:#fff}h2{font-size:18px;margin:28px 0 10px
22
  .grid a.tile:hover{border-color:var(--gold);text-decoration:none}
23
  .grid a.tile .t{color:var(--gold);font-weight:600;margin-bottom:4px}.grid a.tile .d{color:var(--mut);font-size:12.5px}
24
  table{width:100%;border-collapse:collapse;margin:12px 0;font-size:13.5px}
 
 
25
  th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line);vertical-align:top}
26
  th{color:var(--mut);font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.4px}
27
  code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px}
@@ -35,12 +37,22 @@ footer{border-top:1px solid var(--line);color:var(--mut);font-size:11.5px;paddin
35
  .statline b{color:var(--ink)}
36
  .tag2{display:inline-block;background:#1c2030;color:var(--mut);border:1px solid var(--line);border-radius:6px;padding:1px 7px;font-size:11px;margin-left:6px}
37
  .st{color:var(--amb);font-weight:600}
 
 
 
 
 
 
 
 
 
 
38
  </style></head><body>
39
  <header><span class="brand">a11oy</span><span class="tag">Brand Orchestration Layer · the one place to see everything</span></header>
40
  <nav><a href="/hub">Hub</a><a href="/a11oy.code">a11oy.code</a><a href="/docs">Docs</a><a href="/pricing">Pricing</a><a href="/api-keys">API Keys</a><a href="/sdk">SDK</a><a href="/status">Status</a><a href="/hatun-mcp" class="active">Hatun-MCP</a><a href="/observability">Observability</a><a href="/security">Security</a><a href="/compliance">Compliance</a><a href="/cued-engagement">Cued Engagement</a><a href="/uds">UDS</a><a href="/counter-uas">Counter-UAS</a><a href="/evidence">Evidence</a><a href="/upgrades">Upgrades</a><a href="/audit">Audit</a><a href="/gap-report">Gap Report</a></nav>
41
  <main>
42
  <h1>Hatun-MCP — agentic MCP server</h1>
43
- <p class="sub"><b>Hatun</b> (Quechua: <i>great / sovereign</i>) is the Model Context Protocol gateway that exposes SZL's governed flagship capabilities to any MCP client (Claude Desktop, Cursor, custom agents). Every tool invocation passes the Yuyay-13 governance gate and emits a signed Khipu receipt. Anonymous calls are governed-but-declined (OWASP MCP07) provide an SZL API key to execute. This tab probes the live server directly from your browser.</p>
44
 
45
  <div class="card">
46
  <div class="statline">
@@ -50,20 +62,20 @@ footer{border-top:1px solid var(--line);color:var(--mut);font-size:11.5px;paddin
50
  <span>Protocol: <b id="proto">—</b></span>
51
  <span>Probe latency: <b id="lat">—</b></span>
52
  </div>
53
- <p class="sub" style="margin:12px 0 0">Endpoint: <code>https://szlholdings-a11oy.hf.space/mcp/</code> (canonical, live, same-origin) · Transport: JSON-RPC over Streamable HTTP (<code>POST /mcp/</code>) · MCP revision <code>2024-11-05</code><br><b>Note:</b> the standalone hatun-mcp Space is retired; a11oy now serves the canonical MCP directly at <code>/mcp/</code>.</p>
54
  </div>
55
 
56
- <h2>Tools exposed (<span id="toolcount">16</span>)</h2>
57
- <p class="sub">Loaded live from the canonical <code>GET /mcp/</code> discovery card on this Space. These are the real governed tools exposed by the live MCP (call them with <code>POST /mcp/</code> JSON-RPC <code>tools/call</code>).</p>
58
- <table><thead><tr><th>Tool</th><th>Backend flagship</th><th>Class</th></tr></thead><tbody id="tools"></tbody></table>
59
 
60
  <h2>Recent invocations</h2>
61
- <p class="sub">Each MCP call appends a Khipu receipt (continuum hash + DSSE signature) to the governance chain. Recent receipts are summarized here from the server's invocation feed; if the feed endpoint is unreachable cross-origin it shows the honest interim message below.</p>
62
- <table><thead><tr><th>Time (UTC)</th><th>Tool</th><th>Outcome</th><th>Continuum hash</th></tr></thead><tbody id="inv"><tr><td colspan="4" class="sub">loading…</td></tr></tbody></table>
63
 
64
  <h2>Connect a client</h2>
65
  <div class="card">
66
- <p style="margin:0 0 8px">Claude Desktop — add to <code>claude_desktop_config.json</code> (uses the <code>mcp-remote</code> bridge, pointing at a11oy's live canonical <code>/mcp/</code>):</p>
67
  <pre>{
68
  "mcpServers": {
69
  "szl-a11oy": {
@@ -72,63 +84,61 @@ footer{border-top:1px solid var(--line);color:var(--mut);font-size:11.5px;paddin
72
  }
73
  }
74
  }</pre>
75
- <p class="sub" style="margin:8px 0 0">Quick test: <code>curl -s https://szlholdings-a11oy.hf.space/mcp/</code> (discovery card) or <code>curl -s -X POST https://szlholdings-a11oy.hf.space/mcp/ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'</code> · public key: <a href="/cosign.pub" target="_blank" rel="noopener">/cosign.pub</a> · try the loop: <a href="/ask-and-act">/ask-and-act</a></p>
76
  </div>
77
 
78
- <div class="note">This tab probes a11oy's own canonical, same-origin <code>/mcp/</code> endpoint no cross-origin CORS, no dead Space. The tool list and protocol version below are read live from <code>GET /mcp/</code>.</div>
79
- <p class="sub">Source: szl_agentic_loop.py (canonical MCP + governed loop) · live probe of <code>/mcp/</code></p>
80
 
81
  <script>
82
- const BASE=""; // same-origin: a11oy serves the canonical /mcp/ directly
83
- // Static authoritative tool list (mirrors server-card.json); refreshed live below when CORS permits.
84
- const TOOLS=[
85
- ["szl_a11oy_code_chat","a11oy.code","read"],
86
- ["szl_killinchu_detect","vessels / killinchu","read"],
87
- ["szl_killinchu_cue","vessels / killinchu","2-person"],
88
- ["szl_sentra_scan","sentra","read"],
89
- ["szl_rosie_reason","rosie","read"],
90
- ["szl_khipu_verify","governance","read"],
91
- ["szl_lean_verify","lean / formal-verification","read"],
92
- ["szl_puriq_evaluate","puriq","read"],
93
- ["szl_yachay_dome_predict","yachay-dome","read"],
94
- ["szl_wayra_recent","wayra","read"],
95
- ["szl_anatomy_3d_render","anatomy","read"],
96
- ["szl_doctrine_lookup","governance / doctrine","read"],
97
- ["szl_yuyay_score","yuyay-v3","read"],
98
- ["szl_thesis_query","thesis","read"],
99
- ["szl_drone_lookup","uds / counter-uas","read"],
100
- ["szl_formula_evaluate","puriq / formal math","read"]];
101
- function paintTools(list){const tb=document.getElementById('tools');tb.innerHTML='';
102
- list.forEach(([n,b,c])=>{const tr=document.createElement('tr');
103
- const cls=c==='2-person'?'a':'n';
104
- tr.innerHTML=`<td><code>${n}</code></td><td>${b}</td><td><span class="pill ${cls}">${c}</span></td>`;tb.appendChild(tr);});
105
  document.getElementById('toolcount').textContent=list.length;}
106
- paintTools(TOOLS);
107
 
108
- // Live probe of the canonical, same-origin /mcp/ discovery card
109
  const t0=performance.now();
110
- fetch(BASE+"/mcp/").then(r=>r.json().then(j=>({r,j}))).then(({r,j})=>{
111
- const ms=Math.round(performance.now()-t0);
112
- document.getElementById('lat').textContent=ms+' ms';
113
- document.getElementById('health').innerHTML=(r.ok&&j.canonical)?'<span class="pill g">LIVE</span>':'<span class="pill a">'+r.status+'</span>';
114
- document.getElementById('signer').textContent='in-image ECDSA-P256 (see /cosign.pub)';
115
- document.getElementById('chain').textContent='hash-chained receipts ✓';
116
- document.getElementById('proto').textContent=j.protocolVersion||'';
117
- // refresh the tool table from the live card's real governed tools
118
- if(j&&Array.isArray(j.tools)&&j.tools.length){
119
- paintTools(j.tools.map(t=>[t.name, (t.title||'governed tool'), 'governed']));
120
  }
121
- }).catch(()=>{document.getElementById('health').innerHTML='<span class="pill r">unreachable</span>';});
 
 
 
 
 
 
122
 
123
- // Recent invocations feed (optional endpoint; honest fallback if absent/blocked)
124
- fetch(BASE+"/api/hatun/invocations",{mode:'cors'}).then(r=>r.ok?r.json():Promise.reject()).then(rows=>{
125
- const tb=document.getElementById('inv');tb.innerHTML='';
126
- if(!rows||!rows.length){tb.innerHTML='<tr><td colspan="4" class="sub">No recent invocations recorded.</td></tr>';return;}
127
- rows.slice(0,12).forEach(x=>{const tr=document.createElement('tr');
128
- const ok=x.outcome==='success';
129
- tr.innerHTML=`<td>${x.ts||''}</td><td><code>${x.tool||''}</code></td><td><span class="pill ${ok?'g':'a'}">${x.outcome||'—'}</span></td><td><code>${(x.continuum_hash||'').slice(0,16)}</code></td>`;tb.appendChild(tr);});
130
- }).catch(()=>{document.getElementById('inv').innerHTML='<tr><td colspan="4" class="sub">Run a governed agent at <a href="/ask-and-act">/ask-and-act</a> — each run produces a signed, hash-chained receipt you can re-verify in the browser (chain + signature). The MCP <code>tools/call</code> path drives the same governed pipeline.</td></tr>';});
 
 
131
  </script>
132
  </main>
133
- <footer>Doctrine v12 (PURIQ) additive · v11/v12 LOCKED: 749 declarations · 14 axioms · 163 sorries · 13-axis yuyay_v3 · lutar-v18.0.0 @ c7c0ba17 · SLSA L1 (honest) · Khipu signature = DSSE/cosign PLACEHOLDER<br>HfApi direct push only · IP-HOLD a11oy#57 untouched · ADDITIVE / zero-regression · Khipu receipt on every action · Signed <b>Yachay</b> · Co-author Perplexity Computer Agent</footer>
134
  </body></html>
 
9
  header{border-bottom:1px solid var(--line);padding:14px 22px;display:flex;align-items:center;gap:14px;background:linear-gradient(180deg,#10121b,#0a0b10)}
10
  header .brand{font-weight:700;letter-spacing:.5px;color:var(--gold);font-size:18px}
11
  header .tag{color:var(--mut);font-size:12px}
12
+ nav{display:flex;flex-wrap:nowrap;gap:8px;padding:10px 22px;border-bottom:1px solid var(--line);background:var(--panel);overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin}
13
  nav a{font-size:12.5px;padding:4px 10px;border:1px solid var(--line);border-radius:999px;color:var(--mut)}
14
  nav a:hover{border-color:var(--gold);color:var(--gold);text-decoration:none}
15
  nav a.active{background:var(--gold);color:#0a0b10;border-color:var(--gold);font-weight:600}
 
22
  .grid a.tile:hover{border-color:var(--gold);text-decoration:none}
23
  .grid a.tile .t{color:var(--gold);font-weight:600;margin-bottom:4px}.grid a.tile .d{color:var(--mut);font-size:12.5px}
24
  table{width:100%;border-collapse:collapse;margin:12px 0;font-size:13.5px}
25
+ .table-wrap{width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
26
+ .table-wrap table{min-width:620px}
27
  th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line);vertical-align:top}
28
  th{color:var(--mut);font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.4px}
29
  code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px}
 
37
  .statline b{color:var(--ink)}
38
  .tag2{display:inline-block;background:#1c2030;color:var(--mut);border:1px solid var(--line);border-radius:6px;padding:1px 7px;font-size:11px;margin-left:6px}
39
  .st{color:var(--amb);font-weight:600}
40
+ @media(max-width:700px){
41
+ header{padding:12px 14px;align-items:flex-start;flex-direction:column;gap:2px}
42
+ nav{padding:9px 14px}
43
+ main{padding:20px 14px 44px}
44
+ h1{font-size:23px;line-height:1.25}
45
+ .card{padding:15px}
46
+ .statline{display:grid;grid-template-columns:1fr;gap:8px}
47
+ pre{white-space:pre-wrap;overflow-wrap:anywhere}
48
+ footer{padding:16px 14px}
49
+ }
50
  </style></head><body>
51
  <header><span class="brand">a11oy</span><span class="tag">Brand Orchestration Layer · the one place to see everything</span></header>
52
  <nav><a href="/hub">Hub</a><a href="/a11oy.code">a11oy.code</a><a href="/docs">Docs</a><a href="/pricing">Pricing</a><a href="/api-keys">API Keys</a><a href="/sdk">SDK</a><a href="/status">Status</a><a href="/hatun-mcp" class="active">Hatun-MCP</a><a href="/observability">Observability</a><a href="/security">Security</a><a href="/compliance">Compliance</a><a href="/cued-engagement">Cued Engagement</a><a href="/uds">UDS</a><a href="/counter-uas">Counter-UAS</a><a href="/evidence">Evidence</a><a href="/upgrades">Upgrades</a><a href="/audit">Audit</a><a href="/gap-report">Gap Report</a></nav>
53
  <main>
54
  <h1>Hatun-MCP — agentic MCP server</h1>
55
+ <p class="sub"><b>Hatun</b> (Quechua: <i>great / sovereign</i>) is the Model Context Protocol gateway for SZL capabilities. This page separates a reachable runtime declaration from execution and receipt evidence. A listed tool is not proof that it has run. Receipt and signer fields remain <b>UNKNOWN</b> or <b>UNAVAILABLE</b> until the read-only evidence endpoint observes an actual governed-run receipt.</p>
56
 
57
  <div class="card">
58
  <div class="statline">
 
62
  <span>Protocol: <b id="proto">—</b></span>
63
  <span>Probe latency: <b id="lat">—</b></span>
64
  </div>
65
+ <p class="sub" style="margin:12px 0 0">Runtime path: <code>/mcp/</code> (same origin) · Transport: JSON-RPC over HTTP (<code>POST /mcp/</code>). Availability, protocol revision, signer evidence, and receipt-chain evidence are populated only from successful reads below.</p>
66
  </div>
67
 
68
+ <h2>Tools declared (<span id="toolcount"></span>) <span id="toolsource" class="pill a">STATIC FALLBACK</span></h2>
69
+ <p class="sub">The initial rows are an explicitly labelled static fallback. A successful <code>GET /mcp/</code> replaces them with the runtime-declared catalog. Neither state is execution proof.</p>
70
+ <div class="table-wrap"><table><thead><tr><th>Tool</th><th>Description</th><th>Evidence class</th></tr></thead><tbody id="tools"></tbody></table></div>
71
 
72
  <h2>Recent invocations</h2>
73
+ <p class="sub">This bounded, ephemeral feed contains only summaries of governed agent runs for which this process actually created a receipt. It does not claim that every MCP discovery or tool call is signed, and reading it never mints a receipt.</p>
74
+ <div class="table-wrap"><table><thead><tr><th>Time (UTC)</th><th>Observed tool</th><th>Outcome</th><th>Receipt evidence</th></tr></thead><tbody id="inv"><tr><td colspan="4" class="sub">loading…</td></tr></tbody></table></div>
75
 
76
  <h2>Connect a client</h2>
77
  <div class="card">
78
+ <p style="margin:0 0 8px">Claude Desktop — deployment example using the <code>mcp-remote</code> bridge. Verify the target URL and authentication requirements in your environment before use:</p>
79
  <pre>{
80
  "mcpServers": {
81
  "szl-a11oy": {
 
84
  }
85
  }
86
  }</pre>
87
+ <p class="sub" style="margin:8px 0 0">Same-origin checks: <code>GET /mcp/</code> for runtime discovery, <code>GET /api/hatun/evidence</code> for the no-mint evidence contract, and <code>GET /api/hatun/invocations</code> for observed receipt summaries. A public-key path alone is not proof that any receipt was signed.</p>
88
  </div>
89
 
90
+ <div class="note">The page performs read-only same-origin probes. <code>GET /mcp/</code> supplies runtime declarations; <code>GET /api/hatun/evidence</code> supplies observed receipt state. Neither GET signs, appends, or upgrades evidence.</div>
91
+ <p class="sub">Source: <code>szl_agentic_loop.py</code> · read-only probes of <code>/mcp/</code> and <code>/api/hatun/evidence</code></p>
92
 
93
  <script>
94
+ const BASE="";
95
+ const FALLBACK_TOOLS=[
96
+ {name:"retrieve_context",description:"Governance-corpus retrieval declaration"},
97
+ {name:"policy_check",description:"Deny-by-default policy declaration"},
98
+ {name:"trust_score",description:"Advisory trust-score declaration"},
99
+ {name:"sign_receipt",description:"Receipt-signing declaration"},
100
+ {name:"verify_receipt",description:"Receipt-verification declaration"}
101
+ ];
102
+
103
+ function cell(text,tag){const el=document.createElement(tag||'td');el.textContent=text==null?'—':String(text);return el;}
104
+ function pill(text,cls){const el=document.createElement('span');el.className='pill '+cls;el.textContent=text;return el;}
105
+ function setStatus(id,text,cls){const host=document.getElementById(id);host.textContent='';host.appendChild(pill(text,cls));}
106
+ function paintTools(list,evidenceClass){const tb=document.getElementById('tools');tb.textContent='';
107
+ list.forEach(tool=>{const tr=document.createElement('tr');const name=cell(tool.name,'td');
108
+ const code=document.createElement('code');code.textContent=tool.name||'—';name.textContent='';name.appendChild(code);
109
+ tr.appendChild(name);tr.appendChild(cell(tool.description||tool.title||'No description reported'));
110
+ const status=cell('','td');status.appendChild(pill(evidenceClass,evidenceClass==='RUNTIME DECLARED'?'n':'a'));tr.appendChild(status);tb.appendChild(tr);});
 
 
 
 
 
 
111
  document.getElementById('toolcount').textContent=list.length;}
112
+ paintTools(FALLBACK_TOOLS,'STATIC FALLBACK');
113
 
 
114
  const t0=performance.now();
115
+ fetch(BASE+"/mcp/",{cache:'no-store'}).then(r=>r.json().then(j=>({r,j}))).then(({r,j})=>{
116
+ document.getElementById('lat').textContent=Math.round(performance.now()-t0)+' ms';
117
+ setStatus('health',r.ok?'REACHABLE':'HTTP '+r.status,r.ok?'g':'a');
118
+ document.getElementById('proto').textContent=j.protocolVersion||'UNKNOWN';
119
+ if(r.ok&&j&&Array.isArray(j.tools)){
120
+ paintTools(j.tools,'RUNTIME DECLARED');
121
+ const source=document.getElementById('toolsource');source.className='pill n';source.textContent='RUNTIME DECLARED';
 
 
 
122
  }
123
+ }).catch(()=>{setStatus('health','UNAVAILABLE','r');document.getElementById('lat').textContent='UNAVAILABLE';});
124
+
125
+ fetch(BASE+"/api/hatun/evidence",{cache:'no-store'}).then(r=>r.ok?r.json():Promise.reject()).then(e=>{
126
+ const signer=e&&e.signer||{};const chain=e&&e.receipt_chain||{};
127
+ document.getElementById('signer').textContent=signer.status==='OBSERVED_VERIFIED'?(signer.label||'OBSERVED_VERIFIED'):(signer.status||'UNKNOWN');
128
+ document.getElementById('chain').textContent=chain.status||'UNKNOWN';
129
+ }).catch(()=>{document.getElementById('signer').textContent='UNAVAILABLE';document.getElementById('chain').textContent='UNAVAILABLE';});
130
 
131
+ function paintEmptyInvocation(message){const tb=document.getElementById('inv');tb.textContent='';const tr=document.createElement('tr');
132
+ const td=cell(message,'td');td.colSpan=4;td.className='sub';tr.appendChild(td);tb.appendChild(tr);}
133
+ fetch(BASE+"/api/hatun/invocations",{cache:'no-store'}).then(r=>r.ok?r.json():Promise.reject()).then(feed=>{
134
+ const items=feed&&Array.isArray(feed.items)?feed.items:[];const tb=document.getElementById('inv');tb.textContent='';
135
+ if(!items.length){paintEmptyInvocation('UNKNOWN — no governed-run receipt has been observed in this process.');return;}
136
+ items.slice(0,12).forEach(x=>{const tr=document.createElement('tr');tr.appendChild(cell(x.ts));
137
+ const tool=cell('','td'),code=document.createElement('code');code.textContent=x.tool||'—';tool.appendChild(code);tr.appendChild(tool);
138
+ const outcome=cell('','td');outcome.appendChild(pill(x.outcome||'UNKNOWN',x.outcome==='DENY'?'r':'a'));tr.appendChild(outcome);
139
+ const ev=cell('','td'),evCode=document.createElement('code');evCode.textContent=(x.signature_status||'UNKNOWN')+' · '+(x.receipt_hash||'').slice(0,16);ev.appendChild(evCode);tr.appendChild(ev);tb.appendChild(tr);});
140
+ }).catch(()=>{paintEmptyInvocation('UNAVAILABLE — the read-only invocation feed could not be read.');});
141
  </script>
142
  </main>
143
+ <footer>Doctrine v11 honesty boundary · tool catalog = runtime declaration, not execution proof · signer and receipt-chain state remain UNKNOWN or UNAVAILABLE until observed evidence exists · GET reads never mint receipts</footer>
144
  </body></html>
serve.py CHANGED
@@ -77,8 +77,13 @@ def gov_envelope(payload=None, status="REAL", citations=None, reason=None, **ext
77
  return out
78
  # === END GOVERNED ENVELOPE ===
79
 
80
- # RESET: SPA is served from /app/static (repo root mirrors dist/public). No /console subdir.
81
- STATIC_DIR = Path("/app/static")
 
 
 
 
 
82
  ASSETS_DIR = STATIC_DIR / "assets"
83
  INDEX_HTML = STATIC_DIR / "index.html"
84
  A11OY_BACKEND_PORT = 8081
@@ -1820,6 +1825,18 @@ try:
1820
  except Exception as _szl_gq_e: # pragma: no cover
1821
  print(f"[a11oy] GPU-Quant engine NOT registered: {_szl_gq_e!r}", file=__import__("sys").stderr)
1822
 
 
 
 
 
 
 
 
 
 
 
 
 
1823
  # ── Agentic PINN + Physical-Bounds Certifier MESH (pinn-bounds) — closes the audited
1824
  # gap where the PINN / FE-NO Physics-ML verticals lived ONLY in `platform` and were
1825
  # NOT in a11oy's governed /api/a11oy/v1/<name> route table. Adds /api/a11oy/v1/pinn/*:
@@ -3255,6 +3272,18 @@ except Exception as _vsp_e:
3255
  print(f"[a11oy] vsp-otel VSP skipped: {_vsp_e!r}", file=_vsp_sys.stderr)
3256
  # --- end vsp-otel VSP ---
3257
 
 
 
 
 
 
 
 
 
 
 
 
 
3258
 
3259
  # ── Live 3D Wires (PURIQ / Doctrine v12) — ADDITIVE, re-pinned FIRST ─────────
3260
  # Registered immediately after the app is constructed so FastAPI's ordered route
@@ -3462,7 +3491,9 @@ except Exception as _sec_hdr_e: # pragma: no cover
3462
  # ===========================================================================
3463
  from fastapi.responses import RedirectResponse as _PTG_Redirect
3464
 
3465
- _PTG_WEB = Path("/app/web")
 
 
3466
 
3467
  def _ptg_serve(filename: str):
3468
  async def _h() -> Response:
 
77
  return out
78
  # === END GOVERNED ENVELOPE ===
79
 
80
+ # RESET: the image serves the SPA from /app/static after Docker copies
81
+ # console/ there. Local verification must resolve the same source tree rather
82
+ # than trying to return a container-only path (which turns an otherwise honest
83
+ # 404 or history fallback into a 500).
84
+ _IMAGE_STATIC_DIR = Path("/app/static")
85
+ _LOCAL_STATIC_DIR = Path(__file__).resolve().parent / "console"
86
+ STATIC_DIR = _IMAGE_STATIC_DIR if (_IMAGE_STATIC_DIR / "index.html").is_file() else _LOCAL_STATIC_DIR
87
  ASSETS_DIR = STATIC_DIR / "assets"
88
  INDEX_HTML = STATIC_DIR / "index.html"
89
  A11OY_BACKEND_PORT = 8081
 
1825
  except Exception as _szl_gq_e: # pragma: no cover
1826
  print(f"[a11oy] GPU-Quant engine NOT registered: {_szl_gq_e!r}", file=__import__("sys").stderr)
1827
 
1828
+ # -- EvidenceOS involution probe: bounded clean-room boundary/bulk decomposition.
1829
+ # The endpoint requires a caller-declared finite involution, performs no writes or
1830
+ # effectors, and returns a content digest plus explicit PROVEN/MODELED/REPORTED scope.
1831
+ try:
1832
+ import szl_involution_probe as _szl_involution_probe
1833
+ _szl_involution_probe.register(app, ns="a11oy")
1834
+ print("[a11oy] EvidenceOS involution probe registered: /api/a11oy/v1/evidenceos/involution/*",
1835
+ file=__import__("sys").stderr)
1836
+ except Exception as _szl_involution_e: # pragma: no cover
1837
+ print(f"[a11oy] EvidenceOS involution probe NOT registered: {_szl_involution_e!r}",
1838
+ file=__import__("sys").stderr)
1839
+
1840
  # ── Agentic PINN + Physical-Bounds Certifier MESH (pinn-bounds) — closes the audited
1841
  # gap where the PINN / FE-NO Physics-ML verticals lived ONLY in `platform` and were
1842
  # NOT in a11oy's governed /api/a11oy/v1/<name> route table. Adds /api/a11oy/v1/pinn/*:
 
3272
  print(f"[a11oy] vsp-otel VSP skipped: {_vsp_e!r}", file=_vsp_sys.stderr)
3273
  # --- end vsp-otel VSP ---
3274
 
3275
+ # -- Runtime contracts: process liveness, fail-closed readiness, build identity,
3276
+ # explicit OTEL exporter/collector evidence, and soft-404 protection for unknown
3277
+ # file-like discovery paths. Read-only GETs; no receipt minting or external calls.
3278
+ try:
3279
+ import szl_runtime_contracts as _szl_runtime_contracts
3280
+ _runtime_contracts_status = _szl_runtime_contracts.register(app, ns="a11oy")
3281
+ print(f"[a11oy] Runtime contracts registered: {_runtime_contracts_status}",
3282
+ file=__import__("sys").stderr)
3283
+ except Exception as _runtime_contracts_e: # pragma: no cover
3284
+ print(f"[a11oy] Runtime contracts NOT registered: {_runtime_contracts_e!r}",
3285
+ file=__import__("sys").stderr)
3286
+
3287
 
3288
  # ── Live 3D Wires (PURIQ / Doctrine v12) — ADDITIVE, re-pinned FIRST ─────────
3289
  # Registered immediately after the app is constructed so FastAPI's ordered route
 
3491
  # ===========================================================================
3492
  from fastapi.responses import RedirectResponse as _PTG_Redirect
3493
 
3494
+ _PTG_IMAGE_WEB = Path("/app/web")
3495
+ _PTG_LOCAL_WEB = Path(__file__).resolve().parent / "web"
3496
+ _PTG_WEB = _PTG_IMAGE_WEB if _PTG_IMAGE_WEB.is_dir() else _PTG_LOCAL_WEB
3497
 
3498
  def _ptg_serve(filename: str):
3499
  async def _h() -> Response:
szl_agentic_loop.py CHANGED
@@ -10,9 +10,11 @@
10
  # chained, signed receipt.
11
  #
12
  # WHAT IT EXPOSES (all registered BEFORE the SPA catch-all via routes.insert(0)):
13
- # GET /mcp/ — MCP discovery card (canonical live MCP)
14
  # POST /mcp/ — MCP JSON-RPC (initialize, tools/list, tools/call)
15
  # GET /api/<ns>/v1/agent/tools — plain tool catalog (mirror of MCP tools/list)
 
 
16
  # POST /api/<ns>/v1/agent/run — the GOVERNED AGENT RUN (the whole loop)
17
  # POST /api/<ns>/v1/agent/verify-chain— re-verify a run's chained receipt
18
  # GET /ask-and-act — the consumer/investor UI (one button)
@@ -36,10 +38,17 @@ from __future__ import annotations
36
  import hashlib
37
  import json
38
  import math
 
39
  import time
40
  import uuid
41
  from datetime import datetime, timezone
42
 
 
 
 
 
 
 
43
  # ----------------------------------------------------------------------------
44
  # FORMULA WIRING (ADDITIVE 2026-06-06): the ~80 kernel-verified theorems wired
45
  # to REAL work. szl_formula_wiring exposes deterministic mechanisms that COMPUTE
@@ -747,9 +756,14 @@ def register(app, ns: str, sign_fn, verify_fn=None, pub_pem_fn=None,
747
  from starlette.responses import JSONResponse, HTMLResponse
748
  from starlette.requests import Request
749
 
750
- # in-memory chain of FULL runs (each run is itself a chained sub-ledger).
751
  _RUN_CHAIN = [] # list of {run_id, final_hash, prev_run_hash}
752
 
 
 
 
 
 
753
  def _do_run(query: str, action: str, severity: str, confidence: float,
754
  reversible: bool, untrusted_input: str = "", approval_grant=None,
755
  precondition_hash=None):
@@ -823,7 +837,7 @@ def register(app, ns: str, sign_fn, verify_fn=None, pub_pem_fn=None,
823
  "quarantined": True,
824
  "feeds_decision": False})
825
 
826
- # ---- HOP 3: MCP tool-call (policy_check tool, via the canonical MCP) ----
827
  with tr.span("tool_call", "mcp") as sp:
828
  tool_name = "policy_check"
829
  tool_input = {"action": action, "severity": severity,
@@ -1023,6 +1037,7 @@ def register(app, ns: str, sign_fn, verify_fn=None, pub_pem_fn=None,
1023
  sealed = _chain_receipt("emit", {"decision": decision,
1024
  "emitted": effect["emitted"],
1025
  "signed": bool(envelope.get("signed"))})
 
1026
 
1027
  # ---- OPERATOR + GRAPH + UNIFYING FORMULA WIRING (real, executed on the
1028
  # ---- SEALED chain) — these mechanisms run on the actual receipts below.
@@ -1088,11 +1103,12 @@ def register(app, ns: str, sign_fn, verify_fn=None, pub_pem_fn=None,
1088
  "decision": decision}
1089
  _RUN_CHAIN.append(run_record)
1090
 
1091
- return {
1092
  "run_id": tr.trace_id,
1093
  "decision": decision,
1094
  "emitted": effect["emitted"],
1095
- "summary": _plain_summary(decision, action, effect, reasons, trust, trust_pass),
 
1096
  "retrieved": chunks,
1097
  "untrusted": {"present": bool(untrusted_input),
1098
  "excerpt": (untrusted_input or "")[:240],
@@ -1118,25 +1134,34 @@ def register(app, ns: str, sign_fn, verify_fn=None, pub_pem_fn=None,
1118
  "signed_receipt": envelope,
1119
  "chain_final_hash": prev_hash,
1120
  "chain_depth": len(chain),
1121
- "signer": signer_label,
 
 
1122
  "verify_hint": ("Re-verify with POST /api/%s/v1/agent/verify-chain "
1123
- "(send the whole run object back). The final receipt is "
1124
- "signed; fetch /cosign.pub to verify offline." % ns),
1125
  "doctrine": "v11",
1126
  "honesty": ("Trust score is advisory (Conjecture 1). RAG retrieves over the "
1127
- "in-image governance corpus. The receipt is %s." % signer_label),
 
1128
  }
1129
-
1130
- def _plain_summary(decision, action, effect, reasons, trust, trust_pass):
 
 
 
 
 
 
1131
  if decision == "ALLOW":
1132
  return ("Allowed. After retrieving the relevant guidance, calling the policy "
1133
  "tool, passing the safety gate and the advisory trust check (score "
1134
- "%.2f), the action \"%s\" was %s. A signed receipt was produced."
1135
- % (trust, action, effect["effect"]))
1136
  why = "; ".join(reasons) if reasons else ("advisory trust score %.2f below the floor" % trust)
1137
  return ("Blocked. The safety/trust gate denied \"%s\" because: %s. No action was "
1138
- "taken — only a signed deny receipt was produced. This is the gate working."
1139
- % (action, why))
1140
 
1141
  def _verify_chain(run: dict):
1142
  """Re-verify a run object: (1) chain integrity (each prev_hash links and each
@@ -1188,6 +1213,122 @@ def register(app, ns: str, sign_fn, verify_fn=None, pub_pem_fn=None,
1188
  "Flip any byte in any receipt body and chain_intact becomes false."),
1189
  }
1190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1191
  # ------------------------------------------------------------------ #
1192
  # OUROBOROS CLOSED LOOP (ADDITIVE 2026-07-03, default-OFF, honest).
1193
  # Wraps the single governed pass `_do_run` into a BOUNDED, WITNESSED,
@@ -1398,7 +1539,7 @@ def register(app, ns: str, sign_fn, verify_fn=None, pub_pem_fn=None,
1398
  except Exception: # pragma: no cover - SGH must never take the cycle down
1399
  return core
1400
 
1401
- # ---- MCP JSON-RPC handler (canonical live MCP) ----
1402
  async def _mcp_post(request: Request):
1403
  try:
1404
  body = await request.json()
@@ -1496,18 +1637,21 @@ def register(app, ns: str, sign_fn, verify_fn=None, pub_pem_fn=None,
1496
  return {"_error": True, "detail": "unknown tool: %s" % name}
1497
 
1498
  async def _mcp_get(request: Request):
1499
- # MCP discovery card — proves a real, live, canonical MCP surface.
 
1500
  return JSONResponse({
1501
  "name": "szl-%s-mcp" % ns,
1502
- "title": "SZL %s — canonical governed MCP" % ns,
1503
  "protocol": "Model Context Protocol (JSON-RPC over Streamable HTTP)",
1504
  "protocolVersion": "2024-11-05",
1505
  "transport": {"post": "/mcp/ (JSON-RPC: initialize, tools/list, tools/call)"},
1506
  "tools": _tool_catalog(ns),
1507
  "tool_count": len(_tool_catalog(ns)),
1508
- "canonical": True,
1509
- "note": ("This is the single canonical live MCP for %s. The previously "
1510
- "advertised standalone MCP Spaces are retired; this surface replaces them." % ns),
 
 
1511
  "doctrine": "v11",
1512
  })
1513
 
@@ -1529,7 +1673,17 @@ def register(app, ns: str, sign_fn, verify_fn=None, pub_pem_fn=None,
1529
 
1530
  async def _agent_tools(request: Request):
1531
  return JSONResponse({"tools": _tool_catalog(ns), "count": len(_tool_catalog(ns)),
1532
- "canonical_mcp": "/mcp/", "doctrine": "v11"})
 
 
 
 
 
 
 
 
 
 
1533
 
1534
  async def _agent_governance_standards(request: Request):
1535
  return JSONResponse(governance_standards_note())
@@ -1595,6 +1749,10 @@ def register(app, ns: str, sign_fn, verify_fn=None, pub_pem_fn=None,
1595
  Route("/mcp", _mcp_any, methods=["GET", "POST"], name="%s_mcp_noslash" % ns),
1596
  Route("/api/%s/v1/agent/run" % ns, _agent_run, methods=["POST"], name="%s_agent_run" % ns),
1597
  Route("/api/%s/v1/agent/tools" % ns, _agent_tools, methods=["GET"], name="%s_agent_tools" % ns),
 
 
 
 
1598
  Route("/api/%s/v1/agent/governance-standards" % ns, _agent_governance_standards,
1599
  methods=["GET"], name="%s_agent_gov_standards" % ns),
1600
  Route("/api/%s/v1/agent/verify-chain" % ns, _agent_verify, methods=["POST"], name="%s_agent_verify" % ns),
@@ -1602,6 +1760,13 @@ def register(app, ns: str, sign_fn, verify_fn=None, pub_pem_fn=None,
1602
  Route("/ask-and-act", _ask_and_act_ui, methods=["GET"], name="%s_ask_and_act" % ns),
1603
  Route("/governed-run", _ask_and_act_ui, methods=["GET"], name="%s_governed_run" % ns),
1604
  ]
 
 
 
 
 
 
 
1605
  # insert at position 0 so they win over the SPA catch-all (the known gotcha).
1606
  for r in reversed(routes):
1607
  app.router.routes.insert(0, r)
 
10
  # chained, signed receipt.
11
  #
12
  # WHAT IT EXPOSES (all registered BEFORE the SPA catch-all via routes.insert(0)):
13
+ # GET /mcp/ — MCP runtime discovery (declaration only)
14
  # POST /mcp/ — MCP JSON-RPC (initialize, tools/list, tools/call)
15
  # GET /api/<ns>/v1/agent/tools — plain tool catalog (mirror of MCP tools/list)
16
+ # GET /api/<ns>/v1/agent/evidence — observed, read-only receipt evidence
17
+ # GET /api/<ns>/v1/agent/invocations — bounded, ephemeral receipt summaries
18
  # POST /api/<ns>/v1/agent/run — the GOVERNED AGENT RUN (the whole loop)
19
  # POST /api/<ns>/v1/agent/verify-chain— re-verify a run's chained receipt
20
  # GET /ask-and-act — the consumer/investor UI (one button)
 
38
  import hashlib
39
  import json
40
  import math
41
+ import threading
42
  import time
43
  import uuid
44
  from datetime import datetime, timezone
45
 
46
+
47
+ # The Hatun read surface exposes only a bounded, in-process summary of receipts
48
+ # that this module actually observed creating. It is deliberately ephemeral: a
49
+ # restart clears the feed, and no GET handler signs or appends anything.
50
+ _HATUN_FEED_LIMIT = 32
51
+
52
  # ----------------------------------------------------------------------------
53
  # FORMULA WIRING (ADDITIVE 2026-06-06): the ~80 kernel-verified theorems wired
54
  # to REAL work. szl_formula_wiring exposes deterministic mechanisms that COMPUTE
 
756
  from starlette.responses import JSONResponse, HTMLResponse
757
  from starlette.requests import Request
758
 
759
+ # In-memory chain of full runs (each run is itself a chained sub-ledger).
760
  _RUN_CHAIN = [] # list of {run_id, final_hash, prev_run_hash}
761
 
762
+ # Bounded read model derived only from receipts created by _do_run. This is
763
+ # not a durable ledger and it is never populated by a GET request.
764
+ _HATUN_EVIDENCE = []
765
+ _HATUN_EVIDENCE_LOCK = threading.Lock()
766
+
767
  def _do_run(query: str, action: str, severity: str, confidence: float,
768
  reversible: bool, untrusted_input: str = "", approval_grant=None,
769
  precondition_hash=None):
 
837
  "quarantined": True,
838
  "feeds_decision": False})
839
 
840
+ # ---- HOP 3: MCP tool-call (policy_check tool, via the registered MCP) ----
841
  with tr.span("tool_call", "mcp") as sp:
842
  tool_name = "policy_check"
843
  tool_input = {"action": action, "severity": severity,
 
1037
  sealed = _chain_receipt("emit", {"decision": decision,
1038
  "emitted": effect["emitted"],
1039
  "signed": bool(envelope.get("signed"))})
1040
+ receipt_has_signature = bool(envelope.get("signed") and envelope.get("signatures"))
1041
 
1042
  # ---- OPERATOR + GRAPH + UNIFYING FORMULA WIRING (real, executed on the
1043
  # ---- SEALED chain) — these mechanisms run on the actual receipts below.
 
1103
  "decision": decision}
1104
  _RUN_CHAIN.append(run_record)
1105
 
1106
+ result = {
1107
  "run_id": tr.trace_id,
1108
  "decision": decision,
1109
  "emitted": effect["emitted"],
1110
+ "summary": _plain_summary(decision, action, effect, reasons, trust, trust_pass,
1111
+ receipt_has_signature),
1112
  "retrieved": chunks,
1113
  "untrusted": {"present": bool(untrusted_input),
1114
  "excerpt": (untrusted_input or "")[:240],
 
1134
  "signed_receipt": envelope,
1135
  "chain_final_hash": prev_hash,
1136
  "chain_depth": len(chain),
1137
+ "signer": signer_label if receipt_has_signature else None,
1138
+ "signer_claim_status": ("SIGNATURE_PRESENT_UNVERIFIED"
1139
+ if receipt_has_signature else "UNAVAILABLE"),
1140
  "verify_hint": ("Re-verify with POST /api/%s/v1/agent/verify-chain "
1141
+ "(send the whole run object back). A signature is not called "
1142
+ "valid until that verifier succeeds." % ns),
1143
  "doctrine": "v11",
1144
  "honesty": ("Trust score is advisory (Conjecture 1). RAG retrieves over the "
1145
+ "in-image governance corpus. Receipt signature state is %s."
1146
+ % ("PRESENT_UNVERIFIED" if receipt_has_signature else "UNAVAILABLE")),
1147
  }
1148
+ _remember_hatun_receipt(result, decision_payload, tool_name)
1149
+ return result
1150
+
1151
+ def _plain_summary(decision, action, effect, reasons, trust, trust_pass,
1152
+ receipt_has_signature):
1153
+ receipt_note = ("A receipt envelope with signature bytes was produced; verification "
1154
+ "is a separate check." if receipt_has_signature else
1155
+ "The receipt is UNSIGNED because no signature evidence was available.")
1156
  if decision == "ALLOW":
1157
  return ("Allowed. After retrieving the relevant guidance, calling the policy "
1158
  "tool, passing the safety gate and the advisory trust check (score "
1159
+ "%.2f), the action \"%s\" was %s. %s"
1160
+ % (trust, action, effect["effect"], receipt_note))
1161
  why = "; ".join(reasons) if reasons else ("advisory trust score %.2f below the floor" % trust)
1162
  return ("Blocked. The safety/trust gate denied \"%s\" because: %s. No action was "
1163
+ "taken. %s This is the gate working."
1164
+ % (action, why, receipt_note))
1165
 
1166
  def _verify_chain(run: dict):
1167
  """Re-verify a run object: (1) chain integrity (each prev_hash links and each
 
1213
  "Flip any byte in any receipt body and chain_intact becomes false."),
1214
  }
1215
 
1216
+ def _signature_evidence_status(run: dict, verification: dict) -> str:
1217
+ """Classify only evidence present on an observed receipt.
1218
+
1219
+ A self-reported ``signed`` flag is not enough to call a signature
1220
+ verified. Verification requires the host-provided verifier to have run
1221
+ and returned a positive result.
1222
+ """
1223
+ envelope = run.get("signed_receipt") or {}
1224
+ has_signature = bool(envelope.get("signed") and envelope.get("signatures"))
1225
+ if (verify_fn is not None and has_signature
1226
+ and verification.get("signature_valid") is True):
1227
+ return "VERIFIED"
1228
+ if verify_fn is not None and has_signature:
1229
+ return "INVALID"
1230
+ if has_signature:
1231
+ return "PRESENT_UNVERIFIED"
1232
+ return "UNAVAILABLE"
1233
+
1234
+ def _remember_hatun_receipt(run: dict, decision_payload: dict, tool_name: str) -> None:
1235
+ """Append a bounded, redacted summary of an actual governed-run receipt."""
1236
+ verification = _verify_chain(run)
1237
+ signature_status = _signature_evidence_status(run, verification)
1238
+ if run.get("decision") == "DENY":
1239
+ outcome = "DENY"
1240
+ elif run.get("emitted"):
1241
+ outcome = "ALLOW_EMITTED"
1242
+ else:
1243
+ outcome = "ALLOW_HELD"
1244
+ entry = {
1245
+ "namespace": ns,
1246
+ "ts": decision_payload.get("issued_at"),
1247
+ "run_id": run.get("run_id"),
1248
+ "source": "governed_agent_run_receipt",
1249
+ "tool": tool_name,
1250
+ "outcome": outcome,
1251
+ "receipt_hash": run.get("chain_final_hash"),
1252
+ "chain_depth": run.get("chain_depth"),
1253
+ "chain_status": ("OBSERVED_INTACT"
1254
+ if verification.get("chain_intact") is True
1255
+ else "OBSERVED_BROKEN"),
1256
+ "signature_status": signature_status,
1257
+ "signer": signer_label if signature_status == "VERIFIED" else None,
1258
+ "maturity": "OBSERVED",
1259
+ }
1260
+ with _HATUN_EVIDENCE_LOCK:
1261
+ _HATUN_EVIDENCE.append(entry)
1262
+ overflow = len(_HATUN_EVIDENCE) - _HATUN_FEED_LIMIT
1263
+ if overflow > 0:
1264
+ del _HATUN_EVIDENCE[:overflow]
1265
+
1266
+ def _hatun_invocation_contract() -> dict:
1267
+ with _HATUN_EVIDENCE_LOCK:
1268
+ items = [dict(item) for item in reversed(_HATUN_EVIDENCE)]
1269
+ return {
1270
+ "schema": "szl.hatun.invocation-feed.v1",
1271
+ "namespace": ns,
1272
+ "status": "OBSERVED" if items else "UNKNOWN",
1273
+ "read_only": True,
1274
+ "get_mints_receipt": False,
1275
+ "ephemeral": True,
1276
+ "limit": _HATUN_FEED_LIMIT,
1277
+ "count": len(items),
1278
+ "source": "bounded in-process summaries of actual governed agent-run receipts",
1279
+ "items": items,
1280
+ }
1281
+
1282
+ def _hatun_evidence_contract() -> dict:
1283
+ feed = _hatun_invocation_contract()
1284
+ items = feed["items"]
1285
+ latest = items[0] if items else None
1286
+ verified = next((item for item in items
1287
+ if item.get("signature_status") == "VERIFIED"), None)
1288
+ if verified:
1289
+ signer = {"status": "OBSERVED_VERIFIED", "label": verified.get("signer")}
1290
+ elif any(item.get("signature_status") in ("PRESENT_UNVERIFIED", "INVALID")
1291
+ for item in items):
1292
+ signer = {"status": "UNVERIFIED", "label": None}
1293
+ elif items:
1294
+ signer = {"status": "UNAVAILABLE", "label": None}
1295
+ else:
1296
+ signer = {"status": "UNKNOWN", "label": None}
1297
+
1298
+ return {
1299
+ "schema": "szl.hatun.evidence.v1",
1300
+ "namespace": ns,
1301
+ "read_only": True,
1302
+ "get_mints_receipt": False,
1303
+ "runtime": {
1304
+ "status": "AVAILABLE",
1305
+ "mcp_endpoint": "/mcp/",
1306
+ "protocol_version": "2024-11-05",
1307
+ },
1308
+ "tool_catalog": {
1309
+ "status": "RUNTIME_DECLARED",
1310
+ "count": len(_tool_catalog(ns)),
1311
+ "evidence_boundary": "declaration and route presence; not execution proof",
1312
+ },
1313
+ "signer": signer,
1314
+ "receipt_chain": {
1315
+ "status": latest.get("chain_status") if latest else "UNKNOWN",
1316
+ "observed_receipts": len(items),
1317
+ "latest_receipt_hash": latest.get("receipt_hash") if latest else None,
1318
+ "latest_chain_depth": latest.get("chain_depth") if latest else None,
1319
+ },
1320
+ "invocations": {
1321
+ "status": feed["status"],
1322
+ "count": feed["count"],
1323
+ "ephemeral": True,
1324
+ "endpoint": "/api/hatun/invocations" if ns == "a11oy"
1325
+ else "/api/%s/v1/agent/invocations" % ns,
1326
+ },
1327
+ "honesty": ("No receipt or signer claim is promoted by this GET. UNKNOWN and "
1328
+ "UNAVAILABLE remain visible until an observed governed run supplies "
1329
+ "the corresponding evidence."),
1330
+ }
1331
+
1332
  # ------------------------------------------------------------------ #
1333
  # OUROBOROS CLOSED LOOP (ADDITIVE 2026-07-03, default-OFF, honest).
1334
  # Wraps the single governed pass `_do_run` into a BOUNDED, WITNESSED,
 
1539
  except Exception: # pragma: no cover - SGH must never take the cycle down
1540
  return core
1541
 
1542
+ # ---- MCP JSON-RPC handler (runtime-declared MCP surface) ----
1543
  async def _mcp_post(request: Request):
1544
  try:
1545
  body = await request.json()
 
1637
  return {"_error": True, "detail": "unknown tool: %s" % name}
1638
 
1639
  async def _mcp_get(request: Request):
1640
+ # The response proves this route was reachable for this request. Its tool
1641
+ # list remains a runtime declaration, not proof of tool execution.
1642
  return JSONResponse({
1643
  "name": "szl-%s-mcp" % ns,
1644
+ "title": "SZL %s — governed MCP runtime" % ns,
1645
  "protocol": "Model Context Protocol (JSON-RPC over Streamable HTTP)",
1646
  "protocolVersion": "2024-11-05",
1647
  "transport": {"post": "/mcp/ (JSON-RPC: initialize, tools/list, tools/call)"},
1648
  "tools": _tool_catalog(ns),
1649
  "tool_count": len(_tool_catalog(ns)),
1650
+ "runtime_status": "AVAILABLE",
1651
+ "catalog_evidence": "RUNTIME_DECLARED",
1652
+ "execution_evidence": "/api/%s/v1/agent/evidence" % ns,
1653
+ "note": ("This GET confirms route reachability and returns the catalog declared "
1654
+ "by this runtime. It does not prove a tool ran or a receipt was signed."),
1655
  "doctrine": "v11",
1656
  })
1657
 
 
1673
 
1674
  async def _agent_tools(request: Request):
1675
  return JSONResponse({"tools": _tool_catalog(ns), "count": len(_tool_catalog(ns)),
1676
+ "mcp_endpoint": "/mcp/",
1677
+ "catalog_evidence": "RUNTIME_DECLARED",
1678
+ "doctrine": "v11"})
1679
+
1680
+ async def _agent_evidence(request: Request):
1681
+ return JSONResponse(_hatun_evidence_contract(),
1682
+ headers={"Cache-Control": "no-store"})
1683
+
1684
+ async def _agent_invocations(request: Request):
1685
+ return JSONResponse(_hatun_invocation_contract(),
1686
+ headers={"Cache-Control": "no-store"})
1687
 
1688
  async def _agent_governance_standards(request: Request):
1689
  return JSONResponse(governance_standards_note())
 
1749
  Route("/mcp", _mcp_any, methods=["GET", "POST"], name="%s_mcp_noslash" % ns),
1750
  Route("/api/%s/v1/agent/run" % ns, _agent_run, methods=["POST"], name="%s_agent_run" % ns),
1751
  Route("/api/%s/v1/agent/tools" % ns, _agent_tools, methods=["GET"], name="%s_agent_tools" % ns),
1752
+ Route("/api/%s/v1/agent/evidence" % ns, _agent_evidence,
1753
+ methods=["GET"], name="%s_agent_evidence" % ns),
1754
+ Route("/api/%s/v1/agent/invocations" % ns, _agent_invocations,
1755
+ methods=["GET"], name="%s_agent_invocations" % ns),
1756
  Route("/api/%s/v1/agent/governance-standards" % ns, _agent_governance_standards,
1757
  methods=["GET"], name="%s_agent_gov_standards" % ns),
1758
  Route("/api/%s/v1/agent/verify-chain" % ns, _agent_verify, methods=["POST"], name="%s_agent_verify" % ns),
 
1760
  Route("/ask-and-act", _ask_and_act_ui, methods=["GET"], name="%s_ask_and_act" % ns),
1761
  Route("/governed-run", _ask_and_act_ui, methods=["GET"], name="%s_governed_run" % ns),
1762
  ]
1763
+ if ns == "a11oy":
1764
+ routes.extend([
1765
+ Route("/api/hatun/evidence", _agent_evidence, methods=["GET"],
1766
+ name="hatun_evidence"),
1767
+ Route("/api/hatun/invocations", _agent_invocations, methods=["GET"],
1768
+ name="hatun_invocations"),
1769
+ ])
1770
  # insert at position 0 so they win over the SPA catch-all (the known gotcha).
1771
  for r in reversed(routes):
1772
  app.router.routes.insert(0, r)
szl_frontier_manifest.py CHANGED
@@ -10,7 +10,7 @@ capability as a labeled tile. The manifest is REAL data pulled IN-PROCESS from t
10
  already-wired surfaces — it never fabricates a status, joule, receipt, or label:
11
 
12
  * energy operator — szl_energy_operator.handle_status() (MEASURED joules/jobs)
13
- * energy ledger — szl_energy_ledger.handle_ledger() (signed receipt chain)
14
  * energy provenance— szl_energy_provenance summary (tamper-evident chain)
15
  * UDS bundle sig — szl_uds_fleet narrative (cosign+Rekor pattern) (label honest)
16
  * orbital tier — szl_orbital_topology / _projection (MODELED roadmap)
@@ -34,12 +34,12 @@ DOCTRINE v11 (this surface is a roll-up — be ruthless about honesty):
34
  - If a sub-source raises or is down, its tile says so honestly
35
  (label "UNAVAILABLE", ok:false, the error) — we degrade the tile, never the truth,
36
  and the manifest as a whole still returns 200 with the surviving tiles.
37
- - The #1 frontier play (composite inference-provenance receipt) is surfaced ONLY as
38
- a clearly-labeled ROADMAP concept tile that NAMES its existing parts (the MEASURED
39
- joule receipt + the MODELED model-hash) no fabricated composite artifact is minted.
40
 
41
- The composition is the whole point: SZL already holds the parts (signed energy
42
- receipts MEASURED, signed UDS bundle MEASURED, governance doctrine MEASURED, MODELED
43
  orbital roadmap). This manifest shows them as one frontier surface, honestly labeled.
44
  """
45
  from __future__ import annotations
@@ -57,7 +57,7 @@ UNAVAILABLE = "UNAVAILABLE"
57
  _API = "/api/a11oy/v1"
58
 
59
  # UNIVERSAL Khipu verifier (judge-facing audit layer, szl_khipu_verify). A reader
60
- # pastes ANY receipt digest from ANY organ and gets an INDEPENDENT, COMPUTED
61
  # PASS|FAIL|NOT_FOUND (SHA3-256 seal recompute + prev-link re-walk to genesis).
62
  # This is the REAL endpoint each verifiable tile's `verify` field points to. Only
63
  # tiles whose receipts genuinely live in a shared szl_khipu organ DAG (immune,
@@ -105,6 +105,115 @@ def _unavailable_tile(name: str, category: str, provenance: dict, err: str) -> d
105
  error=err)
106
 
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  # ---------------------------------------------------------------------------
109
  # Per-capability tile builders. Each pulls IN-PROCESS from the live surface.
110
  # ---------------------------------------------------------------------------
@@ -134,6 +243,11 @@ def _tile_energy_operator() -> dict:
134
  joules_measured_total=measured_total,
135
  measured_jobs=measured_jobs,
136
  jobs_done=st.get("jobs_done"),
 
 
 
 
 
137
  )
138
 
139
 
@@ -151,14 +265,16 @@ def _tile_energy_ledger() -> dict:
151
  if isinstance(head, dict):
152
  head_digest = head.get("entry_digest") or head.get("digest") \
153
  or (head.get("receipt") or {}).get("payload_digest")
154
- status = (f"OK ({chain_len} signed receipts, links_intact={links_intact})"
155
  if chain_len else "IDLE (chain empty — no jobs minted yet)")
156
  return _tile(
157
- "Signed energy ledger", "energy", status=status, label=MEASURED,
158
  provenance={
159
  "endpoint": f"{_API}/energy/ledger",
160
- "kind": "hash-chained JouleCharge receipt chain",
 
161
  "chain_head_digest": head_digest,
 
162
  "single_receipt": f"{_API}/energy/receipt/{{idempotency_key}}",
163
  # The energy ledger is its OWN hash-chained JouleCharge chain (not a shared
164
  # szl_khipu organ DAG), so its honest verify surface is the ledger endpoint
@@ -172,6 +288,17 @@ def _tile_energy_ledger() -> dict:
172
  persistence_label=persistence.get("label"),
173
  survives_redeploy=survives,
174
  persistence_note=persistence.get("note"),
 
 
 
 
 
 
 
 
 
 
 
175
  )
176
 
177
 
@@ -179,7 +306,8 @@ def _tile_energy_provenance() -> dict:
179
  import szl_energy_provenance as ep
180
  summ = ep._CHAIN.summary()
181
  length = summ.get("length", 0)
182
- status = (f"VERIFIED ({length} tamper-evident receipts)" if length
 
183
  else "EMPTY (no receipts this process)")
184
  return _tile(
185
  "Energy provenance chain", "provenance", status=status, label=MEASURED,
@@ -188,12 +316,24 @@ def _tile_energy_provenance() -> dict:
188
  "kind": "tamper-evident hash-linked + Bekenstein-gated chain",
189
  "head_hash": summ.get("head_hash"),
190
  "link_rule": summ.get("link_rule"),
 
191
  # Its OWN Bekenstein-gated chain (not a shared szl_khipu organ) -> honest
192
  # verify surface is its own endpoint, re-walked. Not pointed at /khipu/verify.
193
  "verify": f"{_API}/energy/provenance",
194
  },
195
  length=length,
196
- chain_status=summ.get("status"),
 
 
 
 
 
 
 
 
 
 
 
197
  )
198
 
199
 
@@ -219,6 +359,11 @@ def _tile_uds_bundle() -> dict:
219
  "sbom": "CycloneDX / SPDX in-toto attestation",
220
  "backing_module": backing,
221
  },
 
 
 
 
 
222
  )
223
 
224
 
@@ -243,6 +388,11 @@ def _tile_orbital() -> dict:
243
  # reachable_nodes is REAL-PROBE-ONLY and MUST be 0 — no orbital hardware to probe.
244
  reachable_nodes=reachable,
245
  note="every orbital node is modeled:true / reachable:false; a MODELED orbital joule is NEVER MEASURED",
 
 
 
 
 
246
  )
247
 
248
 
@@ -271,6 +421,11 @@ def _tile_compute_fabric() -> dict:
271
  # reachable / gpu_reachable are REAL-PROBE-ONLY facts.
272
  nodes_reachable=reachable_n,
273
  gpu_reachable=gpu_reachable,
 
 
 
 
 
274
  )
275
 
276
 
@@ -281,35 +436,50 @@ def _tile_governance() -> dict:
281
  import szl_restraint as rs
282
  info = rs.info()
283
  doctrine = info.get("doctrine", {}) or {}
 
 
 
 
284
  return _tile(
285
- "Governance / restraint", "governance", status="OK (codified doctrine + signed receipts)",
286
  label=MEASURED,
287
  provenance={
288
  "endpoint": f"{_API}/restraint/info",
289
- "kind": "codified restraint ladder; each decision -> a signed DSSE receipt",
 
290
  "doctrine_version": doctrine.get("version"),
291
  "kernel_commit": doctrine.get("kernel_commit"),
292
  },
293
- signed_receipts=doctrine.get("signed_receipts"),
 
 
 
294
  runtime_cdn=doctrine.get("runtime_cdn"),
295
  lambda_=doctrine.get("lambda"),
 
 
 
 
 
 
296
  )
297
 
298
 
299
  def _concept_tile_inference_provenance() -> dict:
300
  """#1 frontier play — composite inference-provenance receipt (the inference-side C2PA).
301
 
302
- LIVE capability, surfaced by READING the shared provenance Khipu chain — this tile
303
- NEVER mints a receipt. The capstone surface szl_provenance_receipt composes ONE signed
304
- Khipu envelope binding every guarantee for a single governed action (immune verdict +
305
  PAC-Bayes bound + MEASURED/MODELED/SAMPLE energy label + governed model identity + Lean
306
- backing) but a receipt is signed ONLY when a real governed action POSTs
307
- /provenance/receipt, never just because someone loaded this page. Here we READ the
 
308
  chain head (depth + most-recent composite digest, if any) and re-verify chain
309
  integrity, so the tile honestly DESCRIBES the capability and points to where the real
310
  artifacts live (/provenance/receipt + the energy ledger) without growing the chain.
311
  Honesty held: a GET does not fabricate or mint a composite; if no composite exists yet
312
- the tile says so honestly (ROADMAP, awaiting first real action)."""
313
  import szl_khipu
314
  import szl_provenance_receipt as pr
315
 
@@ -320,30 +490,61 @@ def _concept_tile_inference_provenance() -> dict:
320
  head = dag.head()
321
  # Most-recent composite digest already on the chain (a READ, never a mint).
322
  last_composite = None
 
323
  for r in reversed(dag.tail(depth or 1)):
324
  if r.get("action") == "provenance.composite":
325
  last_composite = r.get("digest")
 
326
  break
327
 
328
  minted = last_composite is not None
329
- if minted:
330
- status = (f"LIVE ({depth} signed receipts on the provenance chain; latest composite "
331
- "binds immune verdict + PAC-Bayes bound + energy label + governed model "
332
- "identity + Lean backing). Receipts mint ONLY on a real POST, never on a GET.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  label = MEASURED
334
- note = ("inference-side C2PA, LIVE: each composite is a single signed Khipu envelope "
335
- "composing the REAL immune verdict, the PAC-Bayes bound (ROADMAP Lean), the "
 
336
  "MEASURED/MODELED/SAMPLE energy label, the governed model identity, and the "
337
- "exact Lean backing. Each part KEEPS its own label; no label is upgraded; the "
338
- "signature is the honest DSSE_PLACEHOLDER. This tile READS the chain — it does "
339
  "NOT mint a receipt per page view. POST the endpoint to mint one for a real "
340
  "action, then GET it back by digest.")
 
 
 
 
 
 
 
 
341
  else:
342
- status = ("ROADMAP (capability wired; no composite minted yet this process — a signed "
343
- "composite is created ONLY when a real governed action POSTs the endpoint)")
344
- label = ROADMAP
345
- note = ("inference-side C2PA capability is wired but no composite has been minted in "
346
- "this process yet. A signed composite is created ONLY on a real POST to "
 
347
  "/provenance/receipt (immune verdict + PAC-Bayes bound + energy label + "
348
  "governed model identity + Lean backing) — never fabricated, never minted by "
349
  "loading this manifest.")
@@ -352,10 +553,9 @@ def _concept_tile_inference_provenance() -> dict:
352
  "Composite inference-provenance receipt", "frontier-concept",
353
  status=status, label=label,
354
  provenance={
355
- "kind": "composite composed in-process by CALLING the live surfaces and signed "
356
- "into the shared provenance Khipu chain (signature = honest "
357
- "DSSE_PLACEHOLDER, cosign founder-gated); this manifest tile READS the "
358
- "chain head and NEVER mints a receipt per page view",
359
  "endpoint": f"{_API}/provenance/receipt",
360
  # Composite receipts live in the shared szl_khipu `provenance` organ, so a
361
  # judge can re-verify a composite digest TWO honest ways: the composite
@@ -368,16 +568,36 @@ def _concept_tile_inference_provenance() -> dict:
368
  "latest_composite_digest": last_composite,
369
  "chain_head": head,
370
  "chain_verified": chain.get("ok"),
 
 
 
371
  "composes_measured": f"{_API}/immune/verdict (REAL fail-closed gate) + the "
372
  "MEASURED energy joule-truth path",
373
- "composes_roadmap": f"{_API}/materials/certify (PAC-Bayes bound; Lean SORRY/ROADMAP)",
 
374
  },
375
  # READ facts straight off the chain — this tile mints nothing on a GET.
376
  on_artifact_minted=minted,
377
  composite_digest=last_composite,
378
  chain_ok=chain.get("ok"),
379
  chain_length=depth,
 
 
380
  note=note,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
  )
382
 
383
 
@@ -386,7 +606,7 @@ def _concept_tile_inference_provenance() -> dict:
386
  _TILE_SPECS: list[tuple[Callable[[], dict], str, str, dict]] = [
387
  (_tile_energy_operator, "Energy operator", "energy",
388
  {"endpoint": f"{_API}/energy/operator/status"}),
389
- (_tile_energy_ledger, "Signed energy ledger", "energy",
390
  {"endpoint": f"{_API}/energy/ledger"}),
391
  (_tile_energy_provenance, "Energy provenance chain", "provenance",
392
  {"endpoint": f"{_API}/energy/provenance"}),
@@ -430,7 +650,8 @@ def _build_manifest() -> dict:
430
  tiles.append(tile if tile is not None
431
  else _unavailable_tile(name, category, prov, err or "unknown error"))
432
 
433
- # #1 frontier play — always present, always ROADMAP, never a fabricated artifact.
 
434
  concept, c_err = _safe(_concept_tile_inference_provenance)
435
  if concept is None: # pragma: no cover — the concept tile is pure data
436
  concept = _unavailable_tile("Composite inference-provenance receipt",
@@ -441,47 +662,79 @@ def _build_manifest() -> dict:
441
  for t in tiles:
442
  label_counts[t["label"]] = label_counts.get(t["label"], 0) + 1
443
  degraded = [t["name"] for t in tiles if not t.get("ok", True)]
 
 
 
 
 
 
 
 
444
 
445
  return {
446
  "ok": True,
447
  "endpoint": "frontier/manifest",
448
  "service": "a11oy.frontier.manifest",
449
  "what": ("one honest roll-up of the SZL governed-provenance ecosystem — every "
450
- "capability as a tile with its MEASURED/MODELED/ROADMAP/SAMPLE label and "
451
  "a provenance pointer. Composed live, in-process, from the wired surfaces."),
452
  "doctrine": (
453
  "v11: REAL composed data only. No label is upgraded (orbital stays MODELED, "
454
  "ROADMAP stays ROADMAP). reachable/running/survives_redeploy are REAL-PROBE-ONLY "
455
  "and read straight from the live surfaces. A down sub-source yields an honest "
456
- "UNAVAILABLE tile, never a fabricated OK. The #1 frontier composite receipt is a "
457
- "ROADMAP concept that names its parts no composite artifact is minted. "
458
  "Λ = Conjecture 1."
459
  ),
460
  "universal_verifier": {
461
- "what": "judge-facing audit layer: paste ANY receipt digest from ANY shared "
462
  "szl_khipu organ (immune, materials, kverify, provenance, sda, "
463
- "nemo_agents) and get an INDEPENDENT, COMPUTED PASS|FAIL|NOT_FOUND",
464
  "verify_post": _KHIPU_VERIFY,
465
  "verify_link": _KHIPU_VERIFY_PATH,
466
  "organs": _KHIPU_ORGANS,
467
- "method": "SHA3-256 seal recompute (the exact szl_khipu sealing scheme) + "
468
- "prev-link re-walk to genesis; digest_matches + "
469
- "chain_to_genesis_verified are COMPUTED, never asserted",
470
- "signature_status": "DSSE_PLACEHOLDER (cosign founder-gated; never faked)",
471
- "khipu_kind": "Conjecture 2 (chain INTEGRITY real; BFT/consensus is the conjecture)",
 
 
 
472
  },
473
  "labels_legend": {
474
- "MEASURED": "real measured/shipped capability (e.g. signed joule receipts, REAL probes)",
 
475
  "MODELED": "design artifact derived from a real measurement (e.g. orbital joules from ground coeff)",
476
  "ROADMAP": "named forward work; no fabricated artifact",
477
  "SAMPLE": "illustrative sample value, never billable/live",
478
- "UNAVAILABLE": "sub-source down right now reported honestly, not faked",
479
  },
480
  "summary": {
481
  "tiles": len(tiles),
482
  "label_counts": label_counts,
483
  "degraded_tiles": degraded,
484
- "all_sources_live": len(degraded) == 0,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
  },
486
  "capabilities": tiles,
487
  "timestamp_utc": _now_iso(),
@@ -574,7 +827,7 @@ if __name__ == "__main__":
574
 
575
  # 4) the #1 frontier composite tile READS the provenance chain; it NEVER mints a
576
  # receipt on a manifest GET. A fresh process has an empty provenance chain, so the
577
- # tile is honestly ROADMAP / no-artifact; building the manifest must not grow it.
578
  import szl_khipu as _kh
579
  import szl_provenance_receipt as _pr
580
  _prov = _kh.get_dag(_pr._KHIPU_ORGAN, ns="a11oy")
@@ -584,10 +837,11 @@ if __name__ == "__main__":
584
  assert _after == _before, (
585
  f"manifest GET must NOT mint a provenance receipt (chain grew {_before}->{_after})")
586
  concept = next(t for t in tiles if t["category"] == "frontier-concept")
587
- assert concept["label"] in (ROADMAP, MEASURED), concept["label"]
588
- # On a fresh process (empty chain) the tile is honestly ROADMAP with no artifact.
589
  if _before == 0:
590
- assert concept["label"] == ROADMAP, "empty chain -> honest ROADMAP, no fabricated artifact"
 
591
  assert concept.get("on_artifact_minted") is False, "no composite minted by a GET"
592
  assert concept.get("composite_digest") is None, "no digest fabricated on a GET"
593
  assert concept["provenance"].get("chain_verified") is True, "provenance chain must verify"
@@ -596,6 +850,8 @@ if __name__ == "__main__":
596
 
597
  # 5) labels legend + summary present; degraded tiles (if any) reported honestly
598
  assert "labels_legend" in m and "summary" in m
 
 
599
  print(f"[5] summary: {_json.dumps(m['summary'])}")
600
 
601
  print("\n--- tiles (name / label / status) ---")
@@ -603,5 +859,3 @@ if __name__ == "__main__":
603
  print(f" - {t['name']:38s} {t['label']:11s} {t['status']}")
604
  print("\nok:true checks:5")
605
  _sys.exit(0)
606
-
607
-
 
10
  already-wired surfaces — it never fabricates a status, joule, receipt, or label:
11
 
12
  * energy operator — szl_energy_operator.handle_status() (MEASURED joules/jobs)
13
+ * energy ledger — szl_energy_ledger.handle_ledger() (tamper-evident chain)
14
  * energy provenance— szl_energy_provenance summary (tamper-evident chain)
15
  * UDS bundle sig — szl_uds_fleet narrative (cosign+Rekor pattern) (label honest)
16
  * orbital tier — szl_orbital_topology / _projection (MODELED roadmap)
 
34
  - If a sub-source raises or is down, its tile says so honestly
35
  (label "UNAVAILABLE", ok:false, the error) — we degrade the tile, never the truth,
36
  and the manifest as a whole still returns 200 with the surviving tiles.
37
+ - The composite inference-provenance capability is UNAVAILABLE until a real governed
38
+ action has minted an artifact. A read never creates one and an unminted capability is
39
+ never presented as operational merely because its source module is reachable.
40
 
41
+ The composition is the whole point: SZL already holds the parts (tamper-evident
42
+ energy receipts MEASURED, signed UDS bundle MEASURED, governance doctrine MEASURED, MODELED
43
  orbital roadmap). This manifest shows them as one frontier surface, honestly labeled.
44
  """
45
  from __future__ import annotations
 
57
  _API = "/api/a11oy/v1"
58
 
59
  # UNIVERSAL Khipu verifier (judge-facing audit layer, szl_khipu_verify). A reader
60
+ # pastes ANY receipt digest from ANY organ and gets a COMPUTED integrity
61
  # PASS|FAIL|NOT_FOUND (SHA3-256 seal recompute + prev-link re-walk to genesis).
62
  # This is the REAL endpoint each verifiable tile's `verify` field points to. Only
63
  # tiles whose receipts genuinely live in a shared szl_khipu organ DAG (immune,
 
105
  error=err)
106
 
107
 
108
+ def _tile_operational_readiness(tile: dict) -> tuple[bool, list[str]]:
109
+ """Derive runtime readiness from tile evidence without upgrading its label.
110
+
111
+ A source can answer while its operator is stopped, its chain is empty, its
112
+ hardware is unreachable, or its required artifact has not been minted.
113
+ Reachability is therefore reported separately from operational readiness.
114
+ """
115
+ reasons: list[str] = []
116
+ label = str(tile.get("label") or UNAVAILABLE).upper()
117
+ status = str(tile.get("status") or "").upper()
118
+ evidence = tile.get("operational_evidence")
119
+
120
+ # Absence of a negative is not positive evidence. Every ready tile must name
121
+ # its exact bounded predicate and report that predicate satisfied.
122
+ if not isinstance(evidence, dict):
123
+ reasons.append("explicit_operational_evidence_missing")
124
+ else:
125
+ predicate = evidence.get("predicate")
126
+ if not isinstance(predicate, str) or not predicate.strip():
127
+ reasons.append("explicit_operational_predicate_missing")
128
+ if evidence.get("satisfied") is not True:
129
+ evidence_reasons = evidence.get("reasons")
130
+ if isinstance(evidence_reasons, list) and evidence_reasons:
131
+ reasons.extend(str(reason) for reason in evidence_reasons)
132
+ else:
133
+ reasons.append("explicit_operational_evidence_not_satisfied")
134
+
135
+ if not tile.get("ok", True):
136
+ reasons.append("source_unavailable")
137
+ if label in {UNAVAILABLE, MODELED, ROADMAP, SAMPLE}:
138
+ reasons.append(f"label_{label.lower()}_is_not_operational_evidence")
139
+ if any(token in status for token in ("UNAVAILABLE", "IDLE", "EMPTY", "STOPPED")):
140
+ reasons.append("status_not_running")
141
+ if tile.get("running") is False:
142
+ reasons.append("operator_stopped")
143
+ if tile.get("on_artifact_minted") is False:
144
+ reasons.append("artifact_not_minted")
145
+ if tile.get("on_orbit_hardware") is False:
146
+ reasons.append("hardware_not_present")
147
+ if "nodes_reachable" in tile and int(tile.get("nodes_reachable") or 0) < 1:
148
+ reasons.append("no_nodes_reachable")
149
+ if "reachable_nodes" in tile and int(tile.get("reachable_nodes") or 0) < 1:
150
+ reasons.append("no_nodes_reachable")
151
+ if "chain_length" in tile and int(tile.get("chain_length") or 0) < 1:
152
+ reasons.append("no_chain_entries")
153
+ if "length" in tile and int(tile.get("length") or 0) < 1:
154
+ reasons.append("no_chain_entries")
155
+ if "links_intact" in tile and tile.get("links_intact") is not True:
156
+ reasons.append("chain_links_not_verified")
157
+ if "chain_ok" in tile and tile.get("chain_ok") is not True:
158
+ reasons.append("chain_not_verified")
159
+ if "survives_redeploy" in tile and tile.get("survives_redeploy") is not True:
160
+ reasons.append("persistence_not_verified")
161
+ if tile.get("signature_required") is True and tile.get("signature_verified") is not True:
162
+ reasons.append("cryptographic_signature_not_verified")
163
+
164
+ unique_reasons = list(dict.fromkeys(reasons))
165
+ return not unique_reasons, unique_reasons
166
+
167
+
168
+ def _runtime_signature_readiness(info: dict) -> tuple[bool, list[str], dict]:
169
+ """Require an observed runtime signer and a cryptographically verified receipt.
170
+
171
+ Static policy metadata such as ``signed_receipts=true`` describes an intended
172
+ contract. It is neither signer health nor proof that a signature was produced
173
+ and verified, so it cannot make the governance tile operational.
174
+ """
175
+ signer = info.get("signer_health") if isinstance(info.get("signer_health"), dict) else {}
176
+ verification = (info.get("receipt_verification")
177
+ if isinstance(info.get("receipt_verification"), dict) else {})
178
+ method = str(verification.get("method") or "").strip()
179
+ method_upper = method.upper()
180
+ signature_count = verification.get("signature_count")
181
+ try:
182
+ signature_count = int(signature_count)
183
+ except (TypeError, ValueError):
184
+ signature_count = 0
185
+
186
+ reasons = []
187
+ if signer.get("observed_this_process") is not True:
188
+ reasons.append("signer_health_not_observed")
189
+ if signer.get("ready") is not True:
190
+ reasons.append("signer_not_ready")
191
+ if verification.get("observed_this_process") is not True:
192
+ reasons.append("receipt_verification_not_observed")
193
+ if verification.get("cryptographically_verified") is not True:
194
+ reasons.append("cryptographic_signature_not_verified")
195
+ if signature_count < 1:
196
+ reasons.append("verified_signature_missing")
197
+ if not method or "PLACEHOLDER" in method_upper or method_upper in {"HASH", "HASH_CHAIN"}:
198
+ reasons.append("cryptographic_verification_method_missing")
199
+
200
+ evidence = {
201
+ "signer_observed_this_process": signer.get("observed_this_process") is True,
202
+ "signer_ready": signer.get("ready") is True,
203
+ "signer_identity": signer.get("identity"),
204
+ "receipt_verification_observed_this_process": (
205
+ verification.get("observed_this_process") is True
206
+ ),
207
+ "cryptographically_verified": (
208
+ verification.get("cryptographically_verified") is True
209
+ ),
210
+ "signature_count": signature_count,
211
+ "verification_method": method or None,
212
+ }
213
+ unique_reasons = list(dict.fromkeys(reasons))
214
+ return not unique_reasons, unique_reasons, evidence
215
+
216
+
217
  # ---------------------------------------------------------------------------
218
  # Per-capability tile builders. Each pulls IN-PROCESS from the live surface.
219
  # ---------------------------------------------------------------------------
 
243
  joules_measured_total=measured_total,
244
  measured_jobs=measured_jobs,
245
  jobs_done=st.get("jobs_done"),
246
+ operational_evidence={
247
+ "predicate": "energy operator reports running=true",
248
+ "satisfied": running,
249
+ "reasons": [] if running else ["operator_stopped"],
250
+ },
251
  )
252
 
253
 
 
265
  if isinstance(head, dict):
266
  head_digest = head.get("entry_digest") or head.get("digest") \
267
  or (head.get("receipt") or {}).get("payload_digest")
268
+ status = (f"OK ({chain_len} integrity-only receipts, links_intact={links_intact})"
269
  if chain_len else "IDLE (chain empty — no jobs minted yet)")
270
  return _tile(
271
+ "Tamper-evident energy ledger", "energy", status=status, label=MEASURED,
272
  provenance={
273
  "endpoint": f"{_API}/energy/ledger",
274
+ "kind": ("tamper-evident integrity-only JouleCharge hash chain; "
275
+ "no cryptographic signature is verified by this surface"),
276
  "chain_head_digest": head_digest,
277
+ "signature_status": "NOT_VERIFIED_INTEGRITY_ONLY",
278
  "single_receipt": f"{_API}/energy/receipt/{{idempotency_key}}",
279
  # The energy ledger is its OWN hash-chained JouleCharge chain (not a shared
280
  # szl_khipu organ DAG), so its honest verify surface is the ledger endpoint
 
288
  persistence_label=persistence.get("label"),
289
  survives_redeploy=survives,
290
  persistence_note=persistence.get("note"),
291
+ operational_evidence={
292
+ "predicate": "non-empty ledger + intact links + verified redeploy persistence",
293
+ "satisfied": bool(chain_len and links_intact is True and survives),
294
+ "reasons": [
295
+ reason for failed, reason in (
296
+ (not chain_len, "no_chain_entries"),
297
+ (links_intact is not True, "chain_links_not_verified"),
298
+ (not survives, "persistence_not_verified"),
299
+ ) if failed
300
+ ],
301
+ },
302
  )
303
 
304
 
 
306
  import szl_energy_provenance as ep
307
  summ = ep._CHAIN.summary()
308
  length = summ.get("length", 0)
309
+ verify = summ.get("verify", {}) or {}
310
+ status = (f"INTEGRITY-VERIFIED ({length} tamper-evident receipts)" if length
311
  else "EMPTY (no receipts this process)")
312
  return _tile(
313
  "Energy provenance chain", "provenance", status=status, label=MEASURED,
 
316
  "kind": "tamper-evident hash-linked + Bekenstein-gated chain",
317
  "head_hash": summ.get("head_hash"),
318
  "link_rule": summ.get("link_rule"),
319
+ "signature_status": "NOT_VERIFIED_INTEGRITY_ONLY",
320
  # Its OWN Bekenstein-gated chain (not a shared szl_khipu organ) -> honest
321
  # verify surface is its own endpoint, re-walked. Not pointed at /khipu/verify.
322
  "verify": f"{_API}/energy/provenance",
323
  },
324
  length=length,
325
+ integrity_chain_status=summ.get("status"),
326
+ verification_scope="content and hash-link integrity only; authorship not verified",
327
+ operational_evidence={
328
+ "predicate": "non-empty provenance chain + computed chain verification",
329
+ "satisfied": bool(length and verify.get("ok") is True),
330
+ "reasons": [
331
+ reason for failed, reason in (
332
+ (not length, "no_chain_entries"),
333
+ (verify.get("ok") is not True, "chain_not_verified"),
334
+ ) if failed
335
+ ],
336
+ },
337
  )
338
 
339
 
 
359
  "sbom": "CycloneDX / SPDX in-toto attestation",
360
  "backing_module": backing,
361
  },
362
+ operational_evidence={
363
+ "predicate": "a concrete UDS attestation is independently verified at runtime",
364
+ "satisfied": False,
365
+ "reasons": ["runtime_attestation_receipt_not_observed"],
366
+ },
367
  )
368
 
369
 
 
388
  # reachable_nodes is REAL-PROBE-ONLY and MUST be 0 — no orbital hardware to probe.
389
  reachable_nodes=reachable,
390
  note="every orbital node is modeled:true / reachable:false; a MODELED orbital joule is NEVER MEASURED",
391
+ operational_evidence={
392
+ "predicate": "at least one on-orbit hardware node is positively reachable",
393
+ "satisfied": False,
394
+ "reasons": ["hardware_not_present"],
395
+ },
396
  )
397
 
398
 
 
421
  # reachable / gpu_reachable are REAL-PROBE-ONLY facts.
422
  nodes_reachable=reachable_n,
423
  gpu_reachable=gpu_reachable,
424
+ operational_evidence={
425
+ "predicate": "at least one sovereign GPU node passes the live reachability probe",
426
+ "satisfied": gpu_reachable > 0,
427
+ "reasons": [] if gpu_reachable > 0 else ["no_sovereign_gpu_reachable"],
428
+ },
429
  )
430
 
431
 
 
436
  import szl_restraint as rs
437
  info = rs.info()
438
  doctrine = info.get("doctrine", {}) or {}
439
+ crypto_ready, crypto_reasons, crypto_evidence = _runtime_signature_readiness(info)
440
+ status = ("OK (runtime signer healthy; receipt signature cryptographically verified)"
441
+ if crypto_ready else
442
+ "DEGRADED (doctrine loaded; runtime signer/receipt verification not observed)")
443
  return _tile(
444
+ "Governance / restraint", "governance", status=status,
445
  label=MEASURED,
446
  provenance={
447
  "endpoint": f"{_API}/restraint/info",
448
+ "kind": ("codified restraint policy metadata; operational status additionally "
449
+ "requires observed signer health and cryptographic receipt verification"),
450
  "doctrine_version": doctrine.get("version"),
451
  "kernel_commit": doctrine.get("kernel_commit"),
452
  },
453
+ signed_receipts_declared=doctrine.get("signed_receipts"),
454
+ signer_health=crypto_evidence,
455
+ signature_required=True,
456
+ signature_verified=crypto_ready,
457
  runtime_cdn=doctrine.get("runtime_cdn"),
458
  lambda_=doctrine.get("lambda"),
459
+ operational_evidence={
460
+ "predicate": ("runtime signer health observed + at least one receipt signature "
461
+ "cryptographically verified this process"),
462
+ "satisfied": crypto_ready,
463
+ "reasons": crypto_reasons,
464
+ },
465
  )
466
 
467
 
468
  def _concept_tile_inference_provenance() -> dict:
469
  """#1 frontier play — composite inference-provenance receipt (the inference-side C2PA).
470
 
471
+ Capability surfaced by READING the shared provenance Khipu chain — this tile
472
+ NEVER mints a receipt. The capstone surface szl_provenance_receipt composes ONE
473
+ tamper-evident Khipu envelope binding fields for a single governed action (immune verdict +
474
  PAC-Bayes bound + MEASURED/MODELED/SAMPLE energy label + governed model identity + Lean
475
+ backing). It becomes signed evidence only when a cryptographic DSSE signature is observed
476
+ and verified. A real governed action POSTs /provenance/receipt; loading this page never
477
+ creates evidence. Here we READ the
478
  chain head (depth + most-recent composite digest, if any) and re-verify chain
479
  integrity, so the tile honestly DESCRIBES the capability and points to where the real
480
  artifacts live (/provenance/receipt + the energy ledger) without growing the chain.
481
  Honesty held: a GET does not fabricate or mint a composite; if no composite exists yet
482
+ the tile is UNAVAILABLE, awaiting a real governed write."""
483
  import szl_khipu
484
  import szl_provenance_receipt as pr
485
 
 
490
  head = dag.head()
491
  # Most-recent composite digest already on the chain (a READ, never a mint).
492
  last_composite = None
493
+ last_composite_receipt = None
494
  for r in reversed(dag.tail(depth or 1)):
495
  if r.get("action") == "provenance.composite":
496
  last_composite = r.get("digest")
497
+ last_composite_receipt = r
498
  break
499
 
500
  minted = last_composite is not None
501
+ signature = ((last_composite_receipt or {}).get("signature")
502
+ if last_composite_receipt else None)
503
+ verification = ((last_composite_receipt or {}).get("cryptographic_verification")
504
+ if isinstance((last_composite_receipt or {}).get(
505
+ "cryptographic_verification"), dict) else {})
506
+ verification_method = str(verification.get("method") or "").strip()
507
+ try:
508
+ verified_signature_count = int(verification.get("signature_count") or 0)
509
+ except (TypeError, ValueError):
510
+ verified_signature_count = 0
511
+ signature_verified = bool(
512
+ minted
513
+ and verification.get("observed_this_process") is True
514
+ and verification.get("verified") is True
515
+ and verified_signature_count > 0
516
+ and verification_method
517
+ and "PLACEHOLDER" not in verification_method.upper()
518
+ and signature not in (None, "", "DSSE_PLACEHOLDER")
519
+ )
520
+ if minted and signature_verified:
521
+ status = (f"LIVE ({depth} receipts on the provenance chain; latest composite has an "
522
+ "observed, cryptographically verified signature and binds immune verdict + "
523
+ "PAC-Bayes bound + energy label + governed model identity + Lean backing).")
524
  label = MEASURED
525
+ note = ("inference-side composite, LIVE: the latest Khipu envelope has an observed, "
526
+ "cryptographically verified signature and composes the REAL immune verdict, "
527
+ "the PAC-Bayes bound (ROADMAP Lean), the "
528
  "MEASURED/MODELED/SAMPLE energy label, the governed model identity, and the "
529
+ "exact Lean backing. Each part KEEPS its own label; no label is upgraded. "
530
+ "This tile READS the chain — it does "
531
  "NOT mint a receipt per page view. POST the endpoint to mint one for a real "
532
  "action, then GET it back by digest.")
533
+ elif minted:
534
+ status = (f"INTEGRITY-ONLY ({depth} hash-chained receipts; latest composite exists, "
535
+ "but no cryptographically verified DSSE signature was observed)")
536
+ label = UNAVAILABLE
537
+ note = ("the composite is content-addressed and its Khipu prev-links re-walk, but "
538
+ "DSSE_PLACEHOLDER is not a signature and proves no authorship. The signed "
539
+ "composite capability remains operationally blocked until real DSSE evidence "
540
+ "is verified this process.")
541
  else:
542
+ status = ("UNAVAILABLE (capability wired, but no composite receipt has been observed "
543
+ "in this process; only a real governed POST can mint one)")
544
+ label = UNAVAILABLE
545
+ note = ("inference-side C2PA capability is reachable but not operationally evidenced: "
546
+ "no composite has been minted in "
547
+ "this process yet. A composite is created ONLY on a real POST to "
548
  "/provenance/receipt (immune verdict + PAC-Bayes bound + energy label + "
549
  "governed model identity + Lean backing) — never fabricated, never minted by "
550
  "loading this manifest.")
 
553
  "Composite inference-provenance receipt", "frontier-concept",
554
  status=status, label=label,
555
  provenance={
556
+ "kind": ("composite composed in-process and recorded in a tamper-evident Khipu "
557
+ "hash chain; DSSE_PLACEHOLDER is integrity-only metadata, not a "
558
+ "cryptographic signature; this manifest READS and never mints"),
 
559
  "endpoint": f"{_API}/provenance/receipt",
560
  # Composite receipts live in the shared szl_khipu `provenance` organ, so a
561
  # judge can re-verify a composite digest TWO honest ways: the composite
 
568
  "latest_composite_digest": last_composite,
569
  "chain_head": head,
570
  "chain_verified": chain.get("ok"),
571
+ "signature_status": ("CRYPTOGRAPHICALLY_VERIFIED" if signature_verified else
572
+ "NOT_VERIFIED_INTEGRITY_ONLY"),
573
+ "signature_verification_method": verification_method or None,
574
  "composes_measured": f"{_API}/immune/verdict (REAL fail-closed gate) + the "
575
  "MEASURED energy joule-truth path",
576
+ "open_dependencies": f"{_API}/materials/certify (PAC-Bayes/Lean evidence must "
577
+ "retain the status reported by that dependency)",
578
  },
579
  # READ facts straight off the chain — this tile mints nothing on a GET.
580
  on_artifact_minted=minted,
581
  composite_digest=last_composite,
582
  chain_ok=chain.get("ok"),
583
  chain_length=depth,
584
+ signature_required=True,
585
+ signature_verified=signature_verified,
586
  note=note,
587
+ operational_evidence={
588
+ "predicate": ("a composite exists, its Khipu integrity chain verifies, and its "
589
+ "DSSE signature is cryptographically verified this process"),
590
+ "satisfied": bool(minted and depth > 0 and chain.get("ok") is True
591
+ and signature_verified),
592
+ "reasons": [
593
+ reason for failed, reason in (
594
+ (not minted, "artifact_not_minted"),
595
+ (depth < 1, "no_chain_entries"),
596
+ (chain.get("ok") is not True, "chain_not_verified"),
597
+ (not signature_verified, "cryptographic_signature_not_verified"),
598
+ ) if failed
599
+ ],
600
+ },
601
  )
602
 
603
 
 
606
  _TILE_SPECS: list[tuple[Callable[[], dict], str, str, dict]] = [
607
  (_tile_energy_operator, "Energy operator", "energy",
608
  {"endpoint": f"{_API}/energy/operator/status"}),
609
+ (_tile_energy_ledger, "Tamper-evident energy ledger", "energy",
610
  {"endpoint": f"{_API}/energy/ledger"}),
611
  (_tile_energy_provenance, "Energy provenance chain", "provenance",
612
  {"endpoint": f"{_API}/energy/provenance"}),
 
650
  tiles.append(tile if tile is not None
651
  else _unavailable_tile(name, category, prov, err or "unknown error"))
652
 
653
+ # Composite capability — always present, but UNAVAILABLE until a real write has
654
+ # minted an artifact. A manifest read never creates operational evidence.
655
  concept, c_err = _safe(_concept_tile_inference_provenance)
656
  if concept is None: # pragma: no cover — the concept tile is pure data
657
  concept = _unavailable_tile("Composite inference-provenance receipt",
 
662
  for t in tiles:
663
  label_counts[t["label"]] = label_counts.get(t["label"], 0) + 1
664
  degraded = [t["name"] for t in tiles if not t.get("ok", True)]
665
+ reachable = [t["name"] for t in tiles if t.get("ok", True)]
666
+ readiness_rows = []
667
+ for tile in tiles:
668
+ ready, reasons = _tile_operational_readiness(tile)
669
+ readiness_rows.append({"name": tile["name"], "ready": ready, "reasons": reasons})
670
+ blocked = [row for row in readiness_rows if not row["ready"]]
671
+ all_sources_reachable = len(degraded) == 0
672
+ operationally_ready = not blocked and bool(tiles)
673
 
674
  return {
675
  "ok": True,
676
  "endpoint": "frontier/manifest",
677
  "service": "a11oy.frontier.manifest",
678
  "what": ("one honest roll-up of the SZL governed-provenance ecosystem — every "
679
+ "capability as a tile with its own honesty label and "
680
  "a provenance pointer. Composed live, in-process, from the wired surfaces."),
681
  "doctrine": (
682
  "v11: REAL composed data only. No label is upgraded (orbital stays MODELED, "
683
  "ROADMAP stays ROADMAP). reachable/running/survives_redeploy are REAL-PROBE-ONLY "
684
  "and read straight from the live surfaces. A down sub-source yields an honest "
685
+ "UNAVAILABLE tile, never a fabricated OK. The composite receipt remains "
686
+ "UNAVAILABLE until a real governed write has minted an artifact. "
687
  "Λ = Conjecture 1."
688
  ),
689
  "universal_verifier": {
690
+ "what": "judge-facing integrity layer: paste ANY receipt digest from ANY shared "
691
  "szl_khipu organ (immune, materials, kverify, provenance, sda, "
692
+ "nemo_agents) and get a COMPUTED hash-chain PASS|FAIL|NOT_FOUND",
693
  "verify_post": _KHIPU_VERIFY,
694
  "verify_link": _KHIPU_VERIFY_PATH,
695
  "organs": _KHIPU_ORGANS,
696
+ "method": "integrity-only SHA3-256 seal recompute + prev-link re-walk to genesis; "
697
+ "digest_matches + chain_to_genesis_verified are COMPUTED, never "
698
+ "asserted; this does not verify authorship",
699
+ "signature_status": ("NOT_VERIFIED_INTEGRITY_ONLY; DSSE_PLACEHOLDER is not a "
700
+ "cryptographic signature"),
701
+ "khipu_kind": ("tamper-evident integrity chain only; authorship remains blocked "
702
+ "until a real DSSE signature is verified; BFT/consensus is "
703
+ "Conjecture 2"),
704
  },
705
  "labels_legend": {
706
+ "MEASURED": ("real measured/shipped capability (e.g. tamper-evident joule "
707
+ "receipts, REAL probes); MEASURED never implies signed"),
708
  "MODELED": "design artifact derived from a real measurement (e.g. orbital joules from ground coeff)",
709
  "ROADMAP": "named forward work; no fabricated artifact",
710
  "SAMPLE": "illustrative sample value, never billable/live",
711
+ "UNAVAILABLE": "source, dependency, or required artifact unavailable right now",
712
  },
713
  "summary": {
714
  "tiles": len(tiles),
715
  "label_counts": label_counts,
716
  "degraded_tiles": degraded,
717
+ "source_reachability": {
718
+ "state": "REACHABLE" if all_sources_reachable else "DEGRADED",
719
+ "all_sources_reachable": all_sources_reachable,
720
+ "reachable_tiles": reachable,
721
+ "unavailable_tiles": degraded,
722
+ },
723
+ "operational_readiness": {
724
+ "state": "READY" if operationally_ready else "NOT_READY",
725
+ "ready": operationally_ready,
726
+ "ready_tiles": [row["name"] for row in readiness_rows if row["ready"]],
727
+ "blocked_tiles": blocked,
728
+ },
729
+ # Deprecated for old clients. This value is intentionally stricter than source
730
+ # reachability and cannot be true while a required tile is stopped, unminted,
731
+ # modeled, sampled, or unavailable.
732
+ "all_sources_live": operationally_ready,
733
+ "all_sources_live_compatibility": {
734
+ "deprecated": True,
735
+ "meaning": "legacy alias for operational_readiness.ready; not source reachability",
736
+ "value": operationally_ready,
737
+ },
738
  },
739
  "capabilities": tiles,
740
  "timestamp_utc": _now_iso(),
 
827
 
828
  # 4) the #1 frontier composite tile READS the provenance chain; it NEVER mints a
829
  # receipt on a manifest GET. A fresh process has an empty provenance chain, so the
830
+ # tile is honestly UNAVAILABLE / no-artifact; building the manifest must not grow it.
831
  import szl_khipu as _kh
832
  import szl_provenance_receipt as _pr
833
  _prov = _kh.get_dag(_pr._KHIPU_ORGAN, ns="a11oy")
 
837
  assert _after == _before, (
838
  f"manifest GET must NOT mint a provenance receipt (chain grew {_before}->{_after})")
839
  concept = next(t for t in tiles if t["category"] == "frontier-concept")
840
+ assert concept["label"] in (UNAVAILABLE, MEASURED), concept["label"]
841
+ # On a fresh process (empty chain) the tile is honestly UNAVAILABLE with no artifact.
842
  if _before == 0:
843
+ assert concept["label"] == UNAVAILABLE, \
844
+ "empty chain -> honest UNAVAILABLE, no fabricated artifact"
845
  assert concept.get("on_artifact_minted") is False, "no composite minted by a GET"
846
  assert concept.get("composite_digest") is None, "no digest fabricated on a GET"
847
  assert concept["provenance"].get("chain_verified") is True, "provenance chain must verify"
 
850
 
851
  # 5) labels legend + summary present; degraded tiles (if any) reported honestly
852
  assert "labels_legend" in m and "summary" in m
853
+ assert "source_reachability" in m["summary"]
854
+ assert "operational_readiness" in m["summary"]
855
  print(f"[5] summary: {_json.dumps(m['summary'])}")
856
 
857
  print("\n--- tiles (name / label / status) ---")
 
859
  print(f" - {t['name']:38s} {t['label']:11s} {t['status']}")
860
  print("\nok:true checks:5")
861
  _sys.exit(0)
 
 
szl_gpu_quant.py CHANGED
@@ -30,10 +30,10 @@ HONESTY SPINE (doctrine v11 — the non-negotiable part of this build):
30
  (cuML LedoitWolf + cuPy eigh + giotto-tda / Ripser++) is labeled ROADMAP. GPU
31
  reachability and dependency imports are readiness only; MEASURED requires a distinct
32
  accelerated path plus device/kernel/timing execution evidence.
33
- * Every receipt is SIGNED via szl_dsse.sign_payload (REAL ECDSA when the cosign key
34
- is present in the runtime; an explicit UNSIGNED honesty marker otherwise — never a
35
- fabricated signature). The label SAMPLE_SIGNAL | NOT_LIVE | NO_BACKTEST_VALIDATED is
36
- embedded in the signed payload so the honesty claim is self-verifying.
37
  * No fabricated metric. No live-trading claim. No backtest claim. cuML speedups are
38
  cited to NVIDIA/STAC docs, never asserted as SZL-measured.
39
 
@@ -41,7 +41,7 @@ Routes (NEW; never collide):
41
  GET /api/{ns}/v1/quant/pca — Layer 1 PCA-Risk (LW + MP) on a SAMPLE universe
42
  GET /api/{ns}/v1/quant/tda — Layer 2 TDA fracture score f_t, z_t, Betti β0/β1
43
  GET /api/{ns}/v1/quant/kelly — Layer 3 HJB-Kelly weights w* with σ²_eff
44
- GET /api/{ns}/v1/quant/pipeline — full 3-layer pass + ONE signed SAMPLE receipt
45
  GET /api/{ns}/v1/quant/tiers — 2-GPU serve tier panel (TP=2 / role-split / NIM cloud)
46
  GET /api/{ns}/v1/quant/verify-claims — NVIDIA datasheet vs SZL-MEASURED (honest, empty/ROADMAP)
47
  GET /quant — unified mobile-first "Quant Engine" tab (0 CDN)
@@ -50,10 +50,12 @@ Pure stdlib. Defensive: a compute failure NEVER raises out of a handler.
50
  """
51
  from __future__ import annotations
52
 
 
53
  import hashlib as _hashlib
54
  import json as _json
55
  import math as _math
56
  import os as _os
 
57
  import random as _random
58
  import time as _time
59
  from datetime import datetime, timezone
@@ -61,6 +63,7 @@ from datetime import datetime, timezone
61
  # --- signed receipts: the SINGLE source of truth (never fabricate a signature) ----
62
  try:
63
  from szl_dsse import sign_payload as _sign_payload # REAL ECDSA when key present
 
64
  _SIGN_AVAILABLE = True
65
  except Exception: # pragma: no cover — defensive; honest unsigned fallback below
66
  _SIGN_AVAILABLE = False
@@ -79,6 +82,9 @@ except Exception: # pragma: no cover — defensive; honest unsigned fallback be
79
  "no signature fabricated."),
80
  }
81
 
 
 
 
82
  _QUANT_PAYLOAD_TYPE = "application/vnd.szl.quant.receipt+json"
83
 
84
  # --- optional acceleration probes (honest GPU-path labels) ------------------------
@@ -664,10 +670,10 @@ def layer3_hjb_kelly(l1=None, l2=None, gamma=0.5, kappa=1.0, stress=False):
664
 
665
 
666
  # =====================================================================================
667
- # FULL PIPELINE -> ONE signed SAMPLE receipt.
668
  # =====================================================================================
669
  def run_pipeline(stress=False, gamma=0.5, kappa=1.0) -> dict:
670
- """Full 3-layer pass + a single SIGNED SAMPLE receipt (DSSE over canonical JSON)."""
671
  returns = _sample_returns(stress=stress)
672
  l1 = layer1_pca_risk(returns=returns, stress=stress)
673
  l2 = layer2_tda_fracture(returns=returns, stress=stress)
@@ -815,7 +821,7 @@ def tiers_panel() -> dict:
815
  # =====================================================================================
816
  # VERIFY-THE-CLAIMS panel: NVIDIA datasheet vs SZL-MEASURED (honest; empty/ROADMAP).
817
  # =====================================================================================
818
- def verify_claims_panel() -> dict:
819
  """Side-by-side NVIDIA datasheet numbers vs SZL-MEASURED (signed). Honest: SZL columns
820
  are empty/ROADMAP until we actually measure on OUR harness. NEVER print the datasheet
821
  number as if it were ours."""
@@ -855,6 +861,366 @@ def verify_claims_panel() -> dict:
855
  }
856
 
857
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
858
  # =====================================================================================
859
  # Unified "Quant Engine" HTML tab (0 CDN; window.SZLLabels).
860
  # =====================================================================================
@@ -890,10 +1256,23 @@ def _html(pipe: dict, tiers: dict, verify: dict) -> str:
890
  + row("de-risk ratio", fmt(l3["derisk_ratio_vs_uninflated"]))
891
  + row("γ, κ", "%s, %s <small>(uncalibrated)</small>" % (l3["gamma"], l3["kappa"])))
892
  dsse = pipe["signed_receipt"]["dsse"]
893
- signed = dsse.get("signed", False)
 
 
 
 
 
 
 
 
 
 
 
 
 
894
  rc_body = (row("data source", "SAMPLE_SYNTHETIC")
895
  + row("pipeline", "<code>szl-gpu-quant-v0.1</code>")
896
- + row("DSSE signed", fmt(signed))
897
  + row("PAE sha256", "<code>%s…</code>" % str(dsse.get("_pae_sha256", ""))[:16])
898
  + row("label", "<small>%s</small>" % SAMPLE_LABEL))
899
 
@@ -911,19 +1290,27 @@ def _html(pipe: dict, tiers: dict, verify: dict) -> str:
911
 
912
  vrows = ""
913
  for r in verify["rows"]:
914
- vrows += ('<tr><td>%s</td><td class="ds">%s</td><td class="ms"><span class="pill-slot" '
915
- 'data-label="%s"></span> %s</td></tr>' % (
916
- r["claim"], r["nvidia_datasheet"], r["szl_label"], fmt(r["szl_measured"])))
917
- verify_tbl = ('<table class="vt"><thead><tr><th>Claim</th><th>NVIDIA datasheet</th>'
918
- '<th>SZL-MEASURED (signed)</th></tr></thead><tbody>%s</tbody></table>' % vrows)
 
 
 
 
 
 
 
 
 
 
919
 
920
  cards = "".join([
921
  card("Layer 1 · PCA Risk (LW + MP)", l1["label"].split(" | ")[0].replace("_SIGNAL", ""), l1_body, l1["honest_note"]),
922
  card("Layer 2 · TDA Fracture (β0/β1)", "SAMPLE", l2_body, l2["honest_note"]),
923
  card("Layer 3 · HJB-Kelly Sizing", "MODELED", l3_body, l3["honest_note"]),
924
- card("Signed SAMPLE Receipt", "SAMPLE", rc_body,
925
- ("DSSE envelope over the canonical receipt — REAL ECDSA when the cosign key is in the "
926
- "runtime, else an explicit UNSIGNED honesty marker (never a fabricated signature).")),
927
  ])
928
 
929
  return """<!doctype html>
@@ -959,15 +1346,15 @@ def _html(pipe: dict, tiers: dict, verify: dict) -> str:
959
  <header>
960
  <h1>Sovereign Quant Engine</h1>
961
  <p class="summary">__SUMMARY__</p>
962
- <p class="sub">Three orthogonal risk signals per bar — PCA-Risk · TDA-Fracture · HJB-Kelly — each a SIGNED receipt, honestly labeled <b>SAMPLE_SIGNAL · NOT_LIVE · NO_BACKTEST_VALIDATED</b>. Not a trading instruction.</p>
963
  <p class="state">backend=__BACKEND__ · gpu_reachable=__REACH__ · scenario=__SCEN__</p>
964
  </header>
965
- <h2>3-Layer Pipeline (signed SAMPLE receipt)</h2>
966
  <section class="grid">__CARDS__</section>
967
  <h2>2-GPU Sovereign Serve · Throttle Both</h2>
968
  <section class="grid">__TIERS__</section>
969
- <h2>Verify the Claims — NVIDIA datasheet vs SZL-MEASURED (signed)</h2>
970
- <section>__VERIFY__<p class="note">__VNOTE__</p></section>
971
  <footer>
972
  <p class="lock">Doctrine __DV__ LOCKED · locked-proven=__LC__ {__LP__} · __CORPUS__ @ __KC__ · Λ = Conjecture 1 (NOT a theorem) · __SLSA__</p>
973
  <p>SAMPLE = honest synthetic fixture (not live) · MODELED = labeled model output (uncalibrated) · ROADMAP = wiring ready, not measured yet (never faked). Cites: Brodetsky (LinkedIn) · Ledoit-Wolf (honey.pdf) · Laloux/Bouchaud/Potters · Gidea-Katz arXiv:1703.04385 · RAPIDS/cuML · giotto-tda · Ripser++ arXiv:2003.07989.</p>
@@ -983,7 +1370,8 @@ def _html(pipe: dict, tiers: dict, verify: dict) -> str:
983
  title: (label === "SAMPLE") ? "Honest synthetic fixture — not a live feed, no backtest." :
984
  (label === "MODELED") ? "Labeled model output — uncalibrated, not measured." :
985
  (label === "LIVE") ? "Real backend wired and live." :
986
- "Wiring ready; not measured yet. ROADMAP, never faked."});
 
987
  }
988
  return '<span>' + label + '</span>';
989
  }
@@ -993,13 +1381,15 @@ def _html(pipe: dict, tiers: dict, verify: dict) -> str:
993
  })();
994
  </script>
995
  </body></html>""" \
996
- .replace("__SUMMARY__", "VRAM-resident quant pipeline (honest CPU fallback today; GPU path ROADMAP)") \
997
  .replace("__BACKEND__", str(backend["backend"])) \
998
  .replace("__REACH__", str(backend["gpu_reachable"])) \
999
  .replace("__SCEN__", str(pipe["scenario"])) \
 
1000
  .replace("__CARDS__", cards) \
1001
  .replace("__TIERS__", tier_cards) \
1002
  .replace("__VERIFY__", verify_tbl) \
 
1003
  .replace("__VNOTE__", verify["honesty"]) \
1004
  .replace("__DV__", d["version"]) \
1005
  .replace("__LC__", str(d["locked_count"])) \
@@ -1099,10 +1489,11 @@ def _selftest() -> dict:
1099
  assert t["sovereign"] == tp["gpu_reachable"], t
1100
  out["tiers_sovereign_honest"] = True
1101
 
1102
- # (f) Verify-claims: SZL-MEASURED column is empty/ROADMAP (never the datasheet number).
1103
  vc = verify_claims_panel()
1104
- assert all(r["szl_measured"] is None and r["szl_label"] == "ROADMAP" for r in vc["rows"]), vc
1105
- out["verify_claims_roadmap"] = True
 
1106
 
1107
  # (g) HTML renders, non-trivial, no forbidden raw claims.
1108
  h = _html(pipe, tp, vc)
 
30
  (cuML LedoitWolf + cuPy eigh + giotto-tda / Ripser++) is labeled ROADMAP. GPU
31
  reachability and dependency imports are readiness only; MEASURED requires a distinct
32
  accelerated path plus device/kernel/timing execution evidence.
33
+ * Every receipt is wrapped by szl_dsse.sign_payload (verified ECDSA when the cosign key
34
+ is present in the runtime; explicitly UNSIGNED otherwise — never a fabricated
35
+ signature). The label SAMPLE_SIGNAL | NOT_LIVE | NO_BACKTEST_VALIDATED is embedded
36
+ in the content-addressed payload and its signature state is reported separately.
37
  * No fabricated metric. No live-trading claim. No backtest claim. cuML speedups are
38
  cited to NVIDIA/STAC docs, never asserted as SZL-measured.
39
 
 
41
  GET /api/{ns}/v1/quant/pca — Layer 1 PCA-Risk (LW + MP) on a SAMPLE universe
42
  GET /api/{ns}/v1/quant/tda — Layer 2 TDA fracture score f_t, z_t, Betti β0/β1
43
  GET /api/{ns}/v1/quant/kelly — Layer 3 HJB-Kelly weights w* with σ²_eff
44
+ GET /api/{ns}/v1/quant/pipeline — full 3-layer pass + ONE DSSE-bearing SAMPLE receipt
45
  GET /api/{ns}/v1/quant/tiers — 2-GPU serve tier panel (TP=2 / role-split / NIM cloud)
46
  GET /api/{ns}/v1/quant/verify-claims — NVIDIA datasheet vs SZL-MEASURED (honest, empty/ROADMAP)
47
  GET /quant — unified mobile-first "Quant Engine" tab (0 CDN)
 
50
  """
51
  from __future__ import annotations
52
 
53
+ import base64 as _base64
54
  import hashlib as _hashlib
55
  import json as _json
56
  import math as _math
57
  import os as _os
58
+ from pathlib import Path as _Path
59
  import random as _random
60
  import time as _time
61
  from datetime import datetime, timezone
 
63
  # --- signed receipts: the SINGLE source of truth (never fabricate a signature) ----
64
  try:
65
  from szl_dsse import sign_payload as _sign_payload # REAL ECDSA when key present
66
+ from szl_dsse import verify_envelope as _verify_envelope
67
  _SIGN_AVAILABLE = True
68
  except Exception: # pragma: no cover — defensive; honest unsigned fallback below
69
  _SIGN_AVAILABLE = False
 
82
  "no signature fabricated."),
83
  }
84
 
85
+ def _verify_envelope(_envelope): # type: ignore
86
+ return {"verified": False, "reason": "szl_dsse verifier is unavailable"}
87
+
88
  _QUANT_PAYLOAD_TYPE = "application/vnd.szl.quant.receipt+json"
89
 
90
  # --- optional acceleration probes (honest GPU-path labels) ------------------------
 
670
 
671
 
672
  # =====================================================================================
673
+ # FULL PIPELINE -> ONE DSSE-bearing SAMPLE receipt.
674
  # =====================================================================================
675
  def run_pipeline(stress=False, gamma=0.5, kappa=1.0) -> dict:
676
+ """Full 3-layer pass plus a DSSE envelope whose signature state is explicit."""
677
  returns = _sample_returns(stress=stress)
678
  l1 = layer1_pca_risk(returns=returns, stress=stress)
679
  l2 = layer2_tda_fracture(returns=returns, stress=stress)
 
821
  # =====================================================================================
822
  # VERIFY-THE-CLAIMS panel: NVIDIA datasheet vs SZL-MEASURED (honest; empty/ROADMAP).
823
  # =====================================================================================
824
+ def _legacy_verify_claims_panel() -> dict:
825
  """Side-by-side NVIDIA datasheet numbers vs SZL-MEASURED (signed). Honest: SZL columns
826
  are empty/ROADMAP until we actually measure on OUR harness. NEVER print the datasheet
827
  number as if it were ours."""
 
861
  }
862
 
863
 
864
+ # =====================================================================================
865
+ # Receipt-gated local verification. The legacy static panel above is retained only as
866
+ # historical code; this definition is authoritative for routes and the UI.
867
+ # =====================================================================================
868
+ _QUANT_RECEIPT_SCHEMA = "szl.quant-live-benchmark-receipt.v1"
869
+ _QUANT_RECEIPT_SCOPE = "bounded local execution; not a replication of vendor-scale claims"
870
+ _QUANT_RECEIPT_PAYLOAD_TYPE = "application/vnd.szl.quant-live-benchmark+json"
871
+
872
+
873
+ def _dsse_signature_state(dsse):
874
+ """Classify a DSSE envelope from cryptographic evidence, not its flag."""
875
+ if not isinstance(dsse, dict):
876
+ return "INVALID_SIGNATURE"
877
+ signatures = dsse.get("signatures")
878
+ if not isinstance(signatures, list):
879
+ return "INVALID_SIGNATURE"
880
+ if dsse.get("signed") is True:
881
+ verdict = _verify_envelope(dsse)
882
+ if isinstance(verdict, dict) and verdict.get("verified") is True:
883
+ return "SIGNED_VERIFIED"
884
+ return "INVALID_SIGNATURE"
885
+ if signatures:
886
+ return "INVALID_SIGNATURE"
887
+ return "UNSIGNED_CONTENT_ADDRESSED"
888
+
889
+
890
+ def _finite_number(value, field, minimum=None, maximum=None):
891
+ if isinstance(value, bool) or not isinstance(value, (int, float)) or not _math.isfinite(float(value)):
892
+ raise ValueError("%s must be a finite number" % field)
893
+ number = float(value)
894
+ if minimum is not None and number < minimum:
895
+ raise ValueError("%s is below its allowed minimum" % field)
896
+ if maximum is not None and number > maximum:
897
+ raise ValueError("%s exceeds its allowed maximum" % field)
898
+ return number
899
+
900
+
901
+ def _bounded_int(value, field, minimum=0, maximum=1_000_000):
902
+ if isinstance(value, bool) or not isinstance(value, int) or not minimum <= value <= maximum:
903
+ raise ValueError("%s must be an integer between %s and %s" % (field, minimum, maximum))
904
+ return value
905
+
906
+
907
+ def _aware_timestamp(value, field):
908
+ if not isinstance(value, str) or not value.strip():
909
+ raise ValueError("%s missing" % field)
910
+ try:
911
+ parsed = datetime.fromisoformat(value.replace("Z", "+00:00"))
912
+ except ValueError as exc:
913
+ raise ValueError("%s is not an ISO-8601 timestamp" % field) from exc
914
+ if parsed.tzinfo is None or parsed.utcoffset() is None:
915
+ raise ValueError("%s must include a timezone" % field)
916
+ return parsed.astimezone(timezone.utc)
917
+
918
+
919
+ def _validate_model_identity(identity, measurement, role):
920
+ if not isinstance(identity, dict):
921
+ raise ValueError("%s identity missing" % role)
922
+ if not isinstance(measurement, dict):
923
+ raise ValueError("%s measurement missing" % role)
924
+ requested = identity.get("requested_model")
925
+ if not isinstance(requested, str) or not requested.strip() or requested != measurement.get("model"):
926
+ raise ValueError("%s identity does not match measured model" % role)
927
+ manifest_hash = identity.get("show_response_sha256")
928
+ if not isinstance(manifest_hash, str) or len(manifest_hash) != 64:
929
+ raise ValueError("%s identity manifest hash missing" % role)
930
+ try:
931
+ int(manifest_hash, 16)
932
+ except ValueError as exc:
933
+ raise ValueError("%s identity manifest hash is not SHA-256" % role) from exc
934
+ lineage = identity.get("base_lineage")
935
+ if not isinstance(lineage, dict) or not any(
936
+ isinstance(lineage.get(key), str) and lineage.get(key).strip()
937
+ for key in ("base_ref", "parent_model", "base_digest")
938
+ ):
939
+ raise ValueError("%s base lineage missing" % role)
940
+ wall_ms = identity.get("show_wall_ms")
941
+ if wall_ms is not None:
942
+ _finite_number(wall_ms, "%s identity show_wall_ms" % role, 0.0)
943
+ return manifest_hash.lower()
944
+
945
+
946
+ def _validate_model_measurement(measurement, role):
947
+ if not isinstance(measurement, dict):
948
+ raise ValueError("%s measurement missing" % role)
949
+ exact = measurement.get("exact_match")
950
+ retrieval = measurement.get("bounded_retrieval")
951
+ runtime = measurement.get("runtime")
952
+ if not isinstance(exact, dict) or not isinstance(retrieval, dict) or not isinstance(runtime, dict):
953
+ raise ValueError("%s semantic measurement sections missing" % role)
954
+ total = _bounded_int(exact.get("tasks_total"), "%s tasks_total" % role, 1, 10_000)
955
+ passed = _bounded_int(exact.get("tasks_passed"), "%s tasks_passed" % role, 0, total)
956
+ accuracy = _finite_number(exact.get("accuracy_pct"), "%s accuracy_pct" % role, 0.0, 100.0)
957
+ expected_accuracy = 100.0 * passed / total
958
+ if abs(accuracy - expected_accuracy) > 0.001:
959
+ raise ValueError("%s accuracy_pct is inconsistent with pass counts" % role)
960
+ probes_total = _bounded_int(retrieval.get("probes_total"), "%s probes_total" % role, 1, 10_000)
961
+ _bounded_int(retrieval.get("probes_passed"), "%s probes_passed" % role, 0, probes_total)
962
+ _bounded_int(
963
+ retrieval.get("max_prompt_eval_tokens"), "%s max_prompt_eval_tokens" % role, 0, 10_000_000
964
+ )
965
+ _bounded_int(runtime.get("requests"), "%s runtime requests" % role, 1, 100_000)
966
+ latency = _finite_number(runtime.get("p50_wall_ms"), "%s p50_wall_ms" % role, 0.000001)
967
+ tps = runtime.get("p50_tokens_per_second")
968
+ if tps is not None:
969
+ _finite_number(tps, "%s p50_tokens_per_second" % role, 0.000001)
970
+ return {"accuracy": accuracy, "latency": latency}
971
+
972
+
973
+ def _validate_cpu_reference(reference, field):
974
+ if not isinstance(reference, dict):
975
+ raise ValueError("%s missing" % field)
976
+ _bounded_int(reference.get("repeats"), "%s repeats" % field, 1, 20)
977
+ minimum = _finite_number(reference.get("min_ms"), "%s min_ms" % field, 0.0)
978
+ p50 = _finite_number(reference.get("p50_ms"), "%s p50_ms" % field, 0.0)
979
+ maximum = _finite_number(reference.get("max_ms"), "%s max_ms" % field, 0.0)
980
+ if minimum > p50 or p50 > maximum:
981
+ raise ValueError("%s latency order is inconsistent" % field)
982
+ if reference.get("compute_path") != "CPU_REFERENCE":
983
+ raise ValueError("%s is not an explicit CPU reference" % field)
984
+ return p50
985
+
986
+
987
+ def _validate_quant_receipt(envelope):
988
+ if not isinstance(envelope, dict):
989
+ raise ValueError("receipt envelope missing")
990
+ receipt = envelope.get("receipt")
991
+ if not isinstance(receipt, dict):
992
+ raise ValueError("receipt object missing")
993
+ if receipt.get("schema_version") != _QUANT_RECEIPT_SCHEMA:
994
+ raise ValueError("unsupported receipt schema")
995
+ if receipt.get("measurement_class") != "MEASURED":
996
+ raise ValueError("receipt is not a completed MEASURED execution")
997
+ if receipt.get("scope") != _QUANT_RECEIPT_SCOPE:
998
+ raise ValueError("receipt scope is not the bounded local harness")
999
+
1000
+ claimed_digest = receipt.get("content_sha256")
1001
+ unsigned_body = dict(receipt)
1002
+ unsigned_body.pop("content_sha256", None)
1003
+ observed_digest = _hashlib.sha256(
1004
+ _json.dumps(unsigned_body, sort_keys=True, separators=(",", ":"), ensure_ascii=False).encode("utf-8")
1005
+ ).hexdigest()
1006
+ if claimed_digest != observed_digest:
1007
+ raise ValueError("content digest mismatch")
1008
+
1009
+ started = _aware_timestamp(receipt.get("started_at"), "started_at")
1010
+ completed = _aware_timestamp(receipt.get("completed_at"), "completed_at")
1011
+ now = datetime.now(timezone.utc)
1012
+ if completed < started:
1013
+ raise ValueError("completed_at precedes started_at")
1014
+ if completed.timestamp() > now.timestamp() + 300:
1015
+ raise ValueError("completed_at is implausibly in the future")
1016
+
1017
+ ollama = receipt.get("ollama")
1018
+ if not isinstance(ollama, dict) or ollama.get("base_url_class") != "loopback-local":
1019
+ raise ValueError("receipt is not bound to a loopback-local Ollama endpoint")
1020
+ candidate = ollama.get("candidate")
1021
+ baseline = ollama.get("baseline")
1022
+ c_identity = _validate_model_identity(ollama.get("candidate_identity"), candidate, "candidate")
1023
+ b_identity = _validate_model_identity(ollama.get("baseline_identity"), baseline, "baseline")
1024
+ if c_identity == b_identity:
1025
+ raise ValueError("candidate and baseline resolve to the same manifest")
1026
+ stability = ollama.get("identity_stability")
1027
+ if not isinstance(stability, dict) or stability.get("stable") is not True:
1028
+ raise ValueError("model identity stability is not proven")
1029
+ if not (
1030
+ stability.get("candidate_before_sha256") == c_identity
1031
+ and stability.get("candidate_after_sha256") == c_identity
1032
+ and stability.get("baseline_before_sha256") == b_identity
1033
+ and stability.get("baseline_after_sha256") == b_identity
1034
+ ):
1035
+ raise ValueError("model identity drift detected in receipt")
1036
+
1037
+ candidate_metrics = _validate_model_measurement(candidate, "candidate")
1038
+ baseline_metrics = _validate_model_measurement(baseline, "baseline")
1039
+ comparisons = receipt.get("comparisons")
1040
+ if not isinstance(comparisons, dict):
1041
+ raise ValueError("comparison metrics missing")
1042
+ speed = _finite_number(
1043
+ comparisons.get("candidate_vs_baseline_wall_speed_ratio"), "wall speed ratio", 0.000001
1044
+ )
1045
+ expected_speed = baseline_metrics["latency"] / candidate_metrics["latency"]
1046
+ if abs(speed - expected_speed) > 0.0001:
1047
+ raise ValueError("wall speed ratio is inconsistent with measured latency")
1048
+ uplift = _finite_number(
1049
+ comparisons.get("candidate_minus_baseline_exact_match_points"), "accuracy uplift", -100.0, 100.0
1050
+ )
1051
+ expected_uplift = candidate_metrics["accuracy"] - baseline_metrics["accuracy"]
1052
+ if abs(uplift - expected_uplift) > 0.001:
1053
+ raise ValueError("accuracy uplift is inconsistent with measured accuracy")
1054
+
1055
+ quant_reference = receipt.get("quant_reference")
1056
+ if not isinstance(quant_reference, dict):
1057
+ raise ValueError("quant reference section missing")
1058
+ _validate_cpu_reference(quant_reference.get("pca_pipeline"), "pca_pipeline")
1059
+ _validate_cpu_reference(quant_reference.get("tda_stress_pipeline"), "tda_stress_pipeline")
1060
+ gpu_comparison = quant_reference.get("gpu_acceleration_comparison")
1061
+ if not isinstance(gpu_comparison, str) or not gpu_comparison.startswith("UNAVAILABLE:"):
1062
+ raise ValueError("GPU acceleration status is not an explicit structured refusal")
1063
+
1064
+ dsse = envelope.get("dsse")
1065
+ if not isinstance(dsse, dict):
1066
+ raise ValueError("DSSE status missing")
1067
+ signatures = dsse.get("signatures")
1068
+ if not isinstance(signatures, list):
1069
+ raise ValueError("DSSE signatures must be a list")
1070
+ embedded = dsse.get("payload")
1071
+ if embedded is not None:
1072
+ if dsse.get("payloadType") != _QUANT_RECEIPT_PAYLOAD_TYPE:
1073
+ raise ValueError("DSSE payload type mismatch")
1074
+ try:
1075
+ decoded = _base64.b64decode(embedded, validate=True)
1076
+ except Exception as exc:
1077
+ raise ValueError("DSSE payload is not valid base64") from exc
1078
+ expected = _json.dumps(receipt, sort_keys=True, separators=(",", ":"), ensure_ascii=False).encode("utf-8")
1079
+ if decoded != expected:
1080
+ raise ValueError("DSSE payload does not match receipt")
1081
+ if dsse.get("signed") is True:
1082
+ if not signatures or embedded is None:
1083
+ raise ValueError("DSSE claims signed without signatures and payload")
1084
+ verdict = _verify_envelope(dsse)
1085
+ if not isinstance(verdict, dict) or verdict.get("verified") is not True:
1086
+ reason = verdict.get("reason") if isinstance(verdict, dict) else None
1087
+ suffix = ": " + str(reason) if reason else ""
1088
+ raise ValueError("DSSE signature verification failed" + suffix)
1089
+ signature_state = "SIGNED_VERIFIED"
1090
+ elif signatures:
1091
+ raise ValueError("unsigned DSSE contains signatures")
1092
+ else:
1093
+ signature_state = "UNSIGNED_CONTENT_ADDRESSED"
1094
+
1095
+ raw_fresh_seconds = _os.environ.get("SZL_QUANT_BENCH_FRESH_SECONDS", "604800")
1096
+ try:
1097
+ fresh_seconds = int(raw_fresh_seconds)
1098
+ except ValueError as exc:
1099
+ raise ValueError("SZL_QUANT_BENCH_FRESH_SECONDS must be an integer") from exc
1100
+ if not 60 <= fresh_seconds <= 2_678_400:
1101
+ raise ValueError("SZL_QUANT_BENCH_FRESH_SECONDS is outside the allowed range")
1102
+ age_seconds = max(0, int((now - completed).total_seconds()))
1103
+ return {
1104
+ "envelope": envelope,
1105
+ "age_seconds": age_seconds,
1106
+ "freshness_state": "CURRENT" if age_seconds <= fresh_seconds else "HISTORICAL",
1107
+ "candidate_manifest_sha256": c_identity,
1108
+ "baseline_manifest_sha256": b_identity,
1109
+ "signature_state": signature_state,
1110
+ }
1111
+
1112
+
1113
+ def verify_claims_panel() -> dict:
1114
+ """Read a bounded local benchmark receipt without producing side effects.
1115
+
1116
+ Missing, semantically inconsistent, stale-looking, or tampered data never
1117
+ becomes a live claim. Valid old receipts remain visible as HISTORICAL.
1118
+ """
1119
+ configured_path = _os.environ.get("SZL_QUANT_BENCH_RECEIPT", "").strip()
1120
+ receipt_candidates = ([_Path(configured_path)] if configured_path else [
1121
+ _Path.home() / ".a11oy" / "receipts" / "quant-live-benchmark.json",
1122
+ _Path(__file__).resolve().parent / "benchmarks" / "quant_live" / "receipts" / "latest.json",
1123
+ ])
1124
+ receipt_path = next((path for path in receipt_candidates if path.is_file()), receipt_candidates[0])
1125
+ measured = None
1126
+ validation = None
1127
+ receipt_error = None
1128
+ try:
1129
+ if receipt_path.is_file() and receipt_path.stat().st_size <= 2_000_000:
1130
+ envelope = _json.loads(receipt_path.read_text(encoding="utf-8"))
1131
+ validation = _validate_quant_receipt(envelope)
1132
+ measured = validation["envelope"]
1133
+ else:
1134
+ receipt_error = "measurement receipt absent"
1135
+ except (OSError, ValueError, TypeError, _json.JSONDecodeError) as exc:
1136
+ receipt_error = "%s: %s" % (type(exc).__name__, exc)
1137
+
1138
+ local = measured.get("receipt") if measured else {}
1139
+ ollama = local.get("ollama", {})
1140
+ candidate = ollama.get("candidate", {})
1141
+ baseline = ollama.get("baseline", {})
1142
+ comparisons = local.get("comparisons", {})
1143
+ quant_reference = local.get("quant_reference", {})
1144
+ freshness = (validation or {}).get("freshness_state", "NO_RECEIPT")
1145
+ signature_state = (validation or {}).get("signature_state", "NO_RECEIPT")
1146
+ signed = signature_state == "SIGNED_VERIFIED"
1147
+
1148
+ def cell(value, how):
1149
+ if measured is None:
1150
+ return {"szl_measured": None, "szl_label": "NOT_MEASURED", "how": how,
1151
+ "comparison_status": "NO_RECEIPT", "freshness_label": freshness}
1152
+ return {"szl_measured": value, "szl_label": "MEASURED", "how": how,
1153
+ "comparison_status": "BOUNDED_LOCAL_NOT_VENDOR_REPLICATION",
1154
+ "freshness_label": freshness}
1155
+
1156
+ def no_gpu_claim(local_reference, how):
1157
+ return {
1158
+ "szl_measured": None,
1159
+ "szl_label": "NOT_MEASURED",
1160
+ "local_reference": local_reference if measured else None,
1161
+ "local_reference_label": "MEASURED" if measured else "NOT_MEASURED",
1162
+ "how": how,
1163
+ "comparison_status": "NO_GPU_COMPARISON_RECEIPT" if measured else "NO_RECEIPT",
1164
+ "freshness_label": freshness,
1165
+ }
1166
+
1167
+ def vendor_row(claim, reported, values):
1168
+ return {"claim": claim, "nvidia_datasheet": reported, "nvidia_label": "REPORTED", **values}
1169
+
1170
+ c_acc = candidate.get("exact_match", {})
1171
+ c_ret = candidate.get("bounded_retrieval", {})
1172
+ speed = comparisons.get("candidate_vs_baseline_wall_speed_ratio")
1173
+ uplift = comparisons.get("candidate_minus_baseline_exact_match_points")
1174
+ pca = quant_reference.get("pca_pipeline", {})
1175
+ tda = quant_reference.get("tda_stress_pipeline", {})
1176
+ rows = [
1177
+ vendor_row("Nemotron speedup vs prior frontier", "up to 5x", no_gpu_claim(
1178
+ ("%sx local Ollama wall-speed ratio vs %s" % (speed, baseline.get("model"))) if speed is not None else None,
1179
+ "Local Ollama p50 wall latency is separate evidence; no vendor-frontier or GPU comparison receipt exists.")),
1180
+ vendor_row("Reasoning/accuracy uplift", "+30%", cell(
1181
+ ("%s percentage points vs local baseline" % uplift) if uplift is not None else None,
1182
+ "Six preregistered deterministic exact-match operational probes; not a general reasoning benchmark.")),
1183
+ vendor_row("Benchmark accuracy", "91%", cell(
1184
+ ("%s%% (%s/%s exact match)" % (c_acc.get("accuracy_pct"), c_acc.get("tasks_passed"), c_acc.get("tasks_total"))) if c_acc else None,
1185
+ "Bounded SZL exact-match operational suite; not NVIDIA's benchmark.")),
1186
+ vendor_row("Long-context retrieval", "1M-token retrieval", cell(
1187
+ ("%s/%s needles; max %s evaluated prompt tokens" % (c_ret.get("probes_passed"), c_ret.get("probes_total"), c_ret.get("max_prompt_eval_tokens"))) if c_ret else None,
1188
+ "Bounded local needle probes; no one-million-token claim.")),
1189
+ vendor_row("cuML PCA speedup (quant Layer 1)", "10-50x (S&P 500 scale); about 100x genomic", no_gpu_claim(
1190
+ ("CPU reference p50 %s ms; GPU comparison UNAVAILABLE" % pca.get("p50_ms")) if pca else None,
1191
+ "Measured CPU reference only; no distinct cuML execution receipt exists.")),
1192
+ vendor_row("Ripser++ persistence (quant Layer 2)", "up to 30x vs CPU Ripser", no_gpu_claim(
1193
+ ("CPU stress reference p50 %s ms; GPU comparison UNAVAILABLE" % tda.get("p50_ms")) if tda else None,
1194
+ "Measured CPU reference only; no distinct Ripser++ execution receipt exists.")),
1195
+ ]
1196
+ for row in rows:
1197
+ row.setdefault("local_reference", None)
1198
+ row.setdefault("local_reference_label", "NOT_MEASURED")
1199
+ return {
1200
+ "service": "verify-the-claims",
1201
+ "doctrine": DOCTRINE["version"],
1202
+ "summary": (("Current" if freshness == "CURRENT" else "Historical")
1203
+ + " bounded %s receipt loaded; vendor-scale and GPU comparisons remain out of scope."
1204
+ % ("cryptographically verified DSSE" if signed else "unsigned content-addressed")
1205
+ if measured else "No valid local measurement receipt is available; no number is invented."),
1206
+ "gpu_reachable": _gpu_reachable(),
1207
+ "rows": rows,
1208
+ "receipt": {"path_class": "operator-local", "loaded": bool(measured), "error": receipt_error,
1209
+ "content_sha256": local.get("content_sha256"), "completed_at": local.get("completed_at"),
1210
+ "dsse_signed": signed,
1211
+ "signature_state": signature_state,
1212
+ "freshness_state": freshness, "age_seconds": (validation or {}).get("age_seconds"),
1213
+ "candidate_manifest_sha256": (validation or {}).get("candidate_manifest_sha256"),
1214
+ "baseline_manifest_sha256": (validation or {}).get("baseline_manifest_sha256")},
1215
+ "honesty": ("The NVIDIA column is a cited vendor claim, not an endorsement. The SZL column comes from a "
1216
+ "bounded local execution receipt and is not presented as a vendor-scale replication. Signature "
1217
+ "state is derived from cryptographic verification; unsigned content-addressed evidence is never "
1218
+ "displayed as signed."),
1219
+ "citations": [CITATIONS["rapids_cuml"], CITATIONS["ripserpp"]],
1220
+ "computed_at": _now_iso(),
1221
+ }
1222
+
1223
+
1224
  # =====================================================================================
1225
  # Unified "Quant Engine" HTML tab (0 CDN; window.SZLLabels).
1226
  # =====================================================================================
 
1256
  + row("de-risk ratio", fmt(l3["derisk_ratio_vs_uninflated"]))
1257
  + row("γ, κ", "%s, %s <small>(uncalibrated)</small>" % (l3["gamma"], l3["kappa"])))
1258
  dsse = pipe["signed_receipt"]["dsse"]
1259
+ pipeline_signature_state = _dsse_signature_state(dsse)
1260
+ pipeline_signed = pipeline_signature_state == "SIGNED_VERIFIED"
1261
+ pipeline_receipt_title = (
1262
+ "Verified Signed SAMPLE Receipt" if pipeline_signed else
1263
+ "Unsigned SAMPLE Receipt" if pipeline_signature_state == "UNSIGNED_CONTENT_ADDRESSED" else
1264
+ "Invalid DSSE SAMPLE Receipt"
1265
+ )
1266
+ pipeline_receipt_note = (
1267
+ "DSSE signature verified against the configured SZL public key."
1268
+ if pipeline_signed else
1269
+ "Content-addressed DSSE envelope; no verified signature is present."
1270
+ if pipeline_signature_state == "UNSIGNED_CONTENT_ADDRESSED" else
1271
+ "DSSE signature is invalid or unverifiable; this receipt is not presented as signed."
1272
+ )
1273
  rc_body = (row("data source", "SAMPLE_SYNTHETIC")
1274
  + row("pipeline", "<code>szl-gpu-quant-v0.1</code>")
1275
+ + row("signature state", pipeline_signature_state)
1276
  + row("PAE sha256", "<code>%s…</code>" % str(dsse.get("_pae_sha256", ""))[:16])
1277
  + row("label", "<small>%s</small>" % SAMPLE_LABEL))
1278
 
 
1290
 
1291
  vrows = ""
1292
  for r in verify["rows"]:
1293
+ vrows += ('<tr><td>%s</td><td class="ds"><span class="pill-slot" data-label="%s"></span> %s</td>'
1294
+ '<td class="ms"><span class="pill-slot" data-label="%s"></span> %s<br><small>%s</small></td>'
1295
+ '<td class="ms"><span class="pill-slot" data-label="%s"></span> %s</td></tr>' % (
1296
+ r["claim"], r["nvidia_label"], r["nvidia_datasheet"],
1297
+ r["szl_label"], fmt(r["szl_measured"]), r.get("freshness_label", "NO_RECEIPT"),
1298
+ r["local_reference_label"], fmt(r["local_reference"])))
1299
+ verify_tbl = ('<table class="vt"><thead><tr><th>Claim</th><th>NVIDIA published</th>'
1300
+ '<th>SZL comparison</th><th>Separate local evidence</th></tr></thead>'
1301
+ '<tbody>%s</tbody></table>' % vrows)
1302
+ receipt_view = verify.get("receipt", {})
1303
+ receipt_line = ("loaded=%s · completed_at=%s · signature=%s · content_sha256=%s" % (
1304
+ receipt_view.get("loaded"), receipt_view.get("completed_at") or "—",
1305
+ receipt_view.get("signature_state") or "UNKNOWN",
1306
+ (str(receipt_view.get("content_sha256") or "—")[:20] + "…")
1307
+ if receipt_view.get("content_sha256") else "—"))
1308
 
1309
  cards = "".join([
1310
  card("Layer 1 · PCA Risk (LW + MP)", l1["label"].split(" | ")[0].replace("_SIGNAL", ""), l1_body, l1["honest_note"]),
1311
  card("Layer 2 · TDA Fracture (β0/β1)", "SAMPLE", l2_body, l2["honest_note"]),
1312
  card("Layer 3 · HJB-Kelly Sizing", "MODELED", l3_body, l3["honest_note"]),
1313
+ card(pipeline_receipt_title, "SAMPLE", rc_body, pipeline_receipt_note),
 
 
1314
  ])
1315
 
1316
  return """<!doctype html>
 
1346
  <header>
1347
  <h1>Sovereign Quant Engine</h1>
1348
  <p class="summary">__SUMMARY__</p>
1349
+ <p class="sub">Three orthogonal risk signals per bar — PCA-Risk · TDA-Fracture · HJB-Kelly — with receipt state <b>__PIPE_SIG__</b>, honestly labeled <b>SAMPLE_SIGNAL · NOT_LIVE · NO_BACKTEST_VALIDATED</b>. Not a trading instruction.</p>
1350
  <p class="state">backend=__BACKEND__ · gpu_reachable=__REACH__ · scenario=__SCEN__</p>
1351
  </header>
1352
+ <h2>3-Layer Pipeline (DSSE receipt: __PIPE_SIG__)</h2>
1353
  <section class="grid">__CARDS__</section>
1354
  <h2>2-GPU Sovereign Serve · Throttle Both</h2>
1355
  <section class="grid">__TIERS__</section>
1356
+ <h2>Verify the Claims — vendor statement vs bounded local receipt</h2>
1357
+ <section>__VERIFY__<p class="state">__VRECEIPT__</p><p class="note">__VNOTE__</p></section>
1358
  <footer>
1359
  <p class="lock">Doctrine __DV__ LOCKED · locked-proven=__LC__ {__LP__} · __CORPUS__ @ __KC__ · Λ = Conjecture 1 (NOT a theorem) · __SLSA__</p>
1360
  <p>SAMPLE = honest synthetic fixture (not live) · MODELED = labeled model output (uncalibrated) · ROADMAP = wiring ready, not measured yet (never faked). Cites: Brodetsky (LinkedIn) · Ledoit-Wolf (honey.pdf) · Laloux/Bouchaud/Potters · Gidea-Katz arXiv:1703.04385 · RAPIDS/cuML · giotto-tda · Ripser++ arXiv:2003.07989.</p>
 
1370
  title: (label === "SAMPLE") ? "Honest synthetic fixture — not a live feed, no backtest." :
1371
  (label === "MODELED") ? "Labeled model output — uncalibrated, not measured." :
1372
  (label === "LIVE") ? "Real backend wired and live." :
1373
+ (label === "NOT_MEASURED") ? "No valid execution receipt is loaded; no value is invented." :
1374
+ "Capability state reported by the live surface."});
1375
  }
1376
  return '<span>' + label + '</span>';
1377
  }
 
1381
  })();
1382
  </script>
1383
  </body></html>""" \
1384
+ .replace("__SUMMARY__", "Operational bounded quant pipeline; CPU reference measured, GPU comparison requires a kernel receipt") \
1385
  .replace("__BACKEND__", str(backend["backend"])) \
1386
  .replace("__REACH__", str(backend["gpu_reachable"])) \
1387
  .replace("__SCEN__", str(pipe["scenario"])) \
1388
+ .replace("__PIPE_SIG__", pipeline_signature_state) \
1389
  .replace("__CARDS__", cards) \
1390
  .replace("__TIERS__", tier_cards) \
1391
  .replace("__VERIFY__", verify_tbl) \
1392
+ .replace("__VRECEIPT__", receipt_line) \
1393
  .replace("__VNOTE__", verify["honesty"]) \
1394
  .replace("__DV__", d["version"]) \
1395
  .replace("__LC__", str(d["locked_count"])) \
 
1489
  assert t["sovereign"] == tp["gpu_reachable"], t
1490
  out["tiers_sovereign_honest"] = True
1491
 
1492
+ # (f) Verify-claims: without a receipt no measured number is invented.
1493
  vc = verify_claims_panel()
1494
+ if not vc["receipt"]["loaded"]:
1495
+ assert all(r["szl_measured"] is None and r["szl_label"] == "NOT_MEASURED" for r in vc["rows"]), vc
1496
+ out["verify_claims_receipt_gate"] = True
1497
 
1498
  # (g) HTML renders, non-trivial, no forbidden raw claims.
1499
  h = _html(pipe, tp, vc)
szl_involution_probe.py ADDED
@@ -0,0 +1,383 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ # Copyright 2026 Stephen P. Lutar Jr. / SZL Holdings
4
+ """Pure, bounded decomposition of paired observations under an involution.
5
+
6
+ Taxonomy home: provenance / EvidenceOS analysis.
7
+
8
+ This module is a clean-room systems adaptation of a general symmetry idea used in
9
+ the cited transport study. It copies no article prose, figure, or implementation.
10
+ The caller declares a permutation ``P`` and supplies a left observation ``x`` and
11
+ an observation ``y`` collected on the transformed surface. With the convention
12
+ ``(P v)[i] = v[P[i]]`` and a required involution ``P(P(i)) = i``, the probe aligns
13
+ the transformed observation and computes::
14
+
15
+ y_aligned = P^-1 y
16
+ S = (x + y_aligned) / 2
17
+ A = (x - y_aligned) / 2
18
+
19
+ The algebraic reconstruction identities are labelled PROVEN. A concrete result
20
+ is MODELED because it is derived from caller-supplied observations, not measured
21
+ by this module. The motivating experimental findings remain REPORTED.
22
+
23
+ Primary-source citations:
24
+ * https://doi.org/10.1038/s41467-026-75369-y
25
+ * https://doi.org/10.5281/zenodo.17050703
26
+
27
+ The probe is deliberately pure: it performs no file or network I/O, emits no
28
+ signature, writes no receipt, and invokes no effector.
29
+ """
30
+
31
+ import hashlib
32
+ import json
33
+ import math
34
+ import numbers
35
+ from collections.abc import Sequence
36
+
37
+
38
+ SCHEMA = "szl.evidenceos.involution-probe.v1"
39
+ MAX_DIMENSION = 4096
40
+ MAX_ABS_VALUE = 1.0e12
41
+ MAX_PAIR_ID_BYTES = 256
42
+
43
+ LABEL_PROVEN = "PROVEN"
44
+ LABEL_MODELED = "MODELED"
45
+ LABEL_REPORTED = "REPORTED"
46
+
47
+ VERDICT_DECOMPOSED = "DECOMPOSED"
48
+ VERDICT_REFUSED = "REFUSED"
49
+
50
+ ARTICLE_DOI = "10.1038/s41467-026-75369-y"
51
+ DATA_CODE_DOI = "10.5281/zenodo.17050703"
52
+
53
+ _CITATIONS = (
54
+ {
55
+ "kind": "article",
56
+ "doi": ARTICLE_DOI,
57
+ "url": "https://doi.org/" + ARTICLE_DOI,
58
+ "evidence_label": LABEL_REPORTED,
59
+ },
60
+ {
61
+ "kind": "data-and-code",
62
+ "doi": DATA_CODE_DOI,
63
+ "url": "https://doi.org/" + DATA_CODE_DOI,
64
+ "evidence_label": LABEL_REPORTED,
65
+ },
66
+ )
67
+
68
+
69
+ class _Refusal(ValueError):
70
+ """Internal, bounded validation refusal converted to a public result."""
71
+
72
+ def __init__(self, code: str, reason: str):
73
+ super().__init__(reason)
74
+ self.code = code
75
+ self.reason = reason
76
+
77
+
78
+ def _canonical_for_digest(value):
79
+ """Return a JSON-safe projection with platform-stable finite-float encoding."""
80
+ if isinstance(value, float):
81
+ # Validation guarantees finiteness. Normalizing negative zero prevents two
82
+ # numerically identical decompositions from receiving different digests.
83
+ normalized = 0.0 if value == 0.0 else value
84
+ return {"float_hex": normalized.hex()}
85
+ if isinstance(value, dict):
86
+ return {str(key): _canonical_for_digest(item)
87
+ for key, item in sorted(value.items(), key=lambda pair: str(pair[0]))}
88
+ if isinstance(value, (list, tuple)):
89
+ return [_canonical_for_digest(item) for item in value]
90
+ return value
91
+
92
+
93
+ def _stable_digest(payload: dict) -> str:
94
+ canonical = json.dumps(
95
+ _canonical_for_digest(payload),
96
+ sort_keys=True,
97
+ separators=(",", ":"),
98
+ ensure_ascii=False,
99
+ allow_nan=False,
100
+ )
101
+ return hashlib.sha256(canonical.encode("utf-8")).hexdigest()
102
+
103
+
104
+ def _utf8_size(value: str) -> int:
105
+ try:
106
+ return len(value.encode("utf-8"))
107
+ except UnicodeEncodeError as exc:
108
+ raise _Refusal("PAIR_ID_INVALID", "pair_id must be valid UTF-8 text") from exc
109
+
110
+
111
+ def _validate_pair_id(pair_id) -> str:
112
+ if not isinstance(pair_id, str) or not pair_id.strip():
113
+ raise _Refusal("PAIR_ID_REQUIRED", "pair_id must be a non-blank string")
114
+ if _utf8_size(pair_id) > MAX_PAIR_ID_BYTES:
115
+ raise _Refusal("PAIR_ID_TOO_LARGE", "pair_id exceeds the byte bound")
116
+ return pair_id
117
+
118
+
119
+ def _as_bounded_vector(name: str, value) -> tuple[float, ...]:
120
+ if value is None:
121
+ raise _Refusal("PAIR_MISSING", f"{name} is required")
122
+ if isinstance(value, (str, bytes, bytearray)) or not isinstance(value, Sequence):
123
+ raise _Refusal("VECTOR_INVALID", f"{name} must be a finite numeric sequence")
124
+ size = len(value)
125
+ if size < 1 or size > MAX_DIMENSION:
126
+ raise _Refusal("DIMENSION_OUT_OF_BOUNDS", f"{name} dimension is outside bounds")
127
+
128
+ out: list[float] = []
129
+ for item in value:
130
+ if isinstance(item, bool) or not isinstance(item, numbers.Real):
131
+ raise _Refusal("VECTOR_INVALID", f"{name} contains a non-real value")
132
+ number = float(item)
133
+ if not math.isfinite(number):
134
+ raise _Refusal("VECTOR_NONFINITE", f"{name} contains a non-finite value")
135
+ if abs(number) > MAX_ABS_VALUE:
136
+ raise _Refusal("VALUE_OUT_OF_BOUNDS", f"{name} exceeds the magnitude bound")
137
+ out.append(0.0 if number == 0.0 else number)
138
+ return tuple(out)
139
+
140
+
141
+ def _as_involution(permutation, dimension: int) -> tuple[int, ...]:
142
+ if permutation is None:
143
+ raise _Refusal("PERMUTATION_REQUIRED", "a declared permutation is required")
144
+ if (isinstance(permutation, (str, bytes, bytearray))
145
+ or not isinstance(permutation, Sequence)):
146
+ raise _Refusal("PERMUTATION_INVALID", "permutation must be an integer sequence")
147
+ if len(permutation) != dimension:
148
+ raise _Refusal("DIMENSION_MISMATCH", "permutation and vectors must share a dimension")
149
+ if any(isinstance(index, bool) or not isinstance(index, int)
150
+ for index in permutation):
151
+ raise _Refusal("PERMUTATION_INVALID", "permutation indices must be integers")
152
+
153
+ result = tuple(permutation)
154
+ if any(index < 0 or index >= dimension for index in result):
155
+ raise _Refusal("PERMUTATION_OUT_OF_RANGE", "permutation index is outside the vector")
156
+ if len(set(result)) != dimension:
157
+ raise _Refusal("PERMUTATION_NOT_BIJECTIVE", "permutation must be bijective")
158
+ if any(result[result[index]] != index for index in range(dimension)):
159
+ raise _Refusal("PERMUTATION_NOT_INVOLUTION", "declared permutation does not satisfy P^2=I")
160
+ return result
161
+
162
+
163
+ def _apply_permutation(vector: tuple[float, ...], permutation: tuple[int, ...]) -> tuple[float, ...]:
164
+ return tuple(vector[index] for index in permutation)
165
+
166
+
167
+ def _linf(values) -> float:
168
+ return max((abs(value) for value in values), default=0.0)
169
+
170
+
171
+ def _labels() -> dict:
172
+ return {
173
+ "algebraic_contract": LABEL_PROVEN,
174
+ "computed_observation": LABEL_MODELED,
175
+ "external_findings": LABEL_REPORTED,
176
+ "note": (
177
+ "PROVEN is limited to the finite-vector identities checked here; "
178
+ "MODELED is a deterministic transform of caller-supplied observations; "
179
+ "REPORTED identifies claims made by the cited primary sources."
180
+ ),
181
+ "adds_to_locked_8": 0,
182
+ }
183
+
184
+
185
+ def _refusal(pair_id, code: str, reason: str) -> dict:
186
+ safe_pair_id = None
187
+ if isinstance(pair_id, str):
188
+ try:
189
+ if _utf8_size(pair_id) <= MAX_PAIR_ID_BYTES:
190
+ safe_pair_id = pair_id
191
+ except _Refusal:
192
+ pass
193
+ core = {
194
+ "schema": SCHEMA,
195
+ "ok": False,
196
+ "verdict": VERDICT_REFUSED,
197
+ "pair_id": safe_pair_id,
198
+ "refusal": {"code": code, "reason": reason},
199
+ "labels": _labels(),
200
+ "citations": [dict(citation) for citation in _CITATIONS],
201
+ }
202
+ core["digest"] = {
203
+ "algorithm": "sha256",
204
+ "stable_content_sha256": _stable_digest(core),
205
+ "signed": False,
206
+ }
207
+ return core
208
+
209
+
210
+ def evaluate_involution_pair(*, pair_id, left_observation, transformed_observation,
211
+ permutation) -> dict:
212
+ """Validate and decompose one declared involution pair.
213
+
214
+ Returns a deterministic ``DECOMPOSED`` result or a deterministic ``REFUSED``
215
+ result for an incomplete, unbounded, non-finite, mismatched, non-bijective, or
216
+ non-involutive input. Programmer faults are not hidden by a broad exception.
217
+ """
218
+ try:
219
+ validated_pair_id = _validate_pair_id(pair_id)
220
+ left = _as_bounded_vector("left_observation", left_observation)
221
+ transformed = _as_bounded_vector("transformed_observation", transformed_observation)
222
+ if len(left) != len(transformed):
223
+ raise _Refusal("PAIR_DIMENSION_MISMATCH", "paired vectors must share a dimension")
224
+ involution = _as_involution(permutation, len(left))
225
+ except _Refusal as refusal:
226
+ return _refusal(pair_id, refusal.code, refusal.reason)
227
+
228
+ # P^-1 is P because validation established P^2=I.
229
+ aligned = _apply_permutation(transformed, involution)
230
+ symmetric = tuple((a + b) / 2.0 for a, b in zip(left, aligned))
231
+ antisymmetric = tuple((a - b) / 2.0 for a, b in zip(left, aligned))
232
+
233
+ reconstructed_left = tuple(s + a for s, a in zip(symmetric, antisymmetric))
234
+ reconstructed_aligned = tuple(s - a for s, a in zip(symmetric, antisymmetric))
235
+ reconstructed_transformed = _apply_permutation(reconstructed_aligned, involution)
236
+
237
+ permutation_closure_residual = max(
238
+ (abs(involution[involution[index]] - index) for index in range(len(involution))),
239
+ default=0,
240
+ )
241
+ reconstruction_residual = _linf(
242
+ [actual - reconstructed for actual, reconstructed in zip(left, reconstructed_left)]
243
+ + [actual - reconstructed
244
+ for actual, reconstructed in zip(transformed, reconstructed_transformed)]
245
+ )
246
+ paired_delta = _linf(a - b for a, b in zip(left, aligned))
247
+
248
+ input_contract = {
249
+ "pair_id": validated_pair_id,
250
+ "dimension": len(left),
251
+ "permutation": list(involution),
252
+ "left_observation": list(left),
253
+ "transformed_observation": list(transformed),
254
+ "permutation_convention": "(P v)[i] = v[P[i]]",
255
+ }
256
+ result_core = {
257
+ "schema": SCHEMA,
258
+ "ok": True,
259
+ "verdict": VERDICT_DECOMPOSED,
260
+ "pair_id": validated_pair_id,
261
+ "bounds": {
262
+ "max_dimension": MAX_DIMENSION,
263
+ "max_abs_value": MAX_ABS_VALUE,
264
+ "max_pair_id_bytes": MAX_PAIR_ID_BYTES,
265
+ },
266
+ "contract": {
267
+ "permutation_convention": "(P v)[i] = v[P[i]]",
268
+ "requires_involution": True,
269
+ "aligned_transformed": "P^-1(transformed_observation)",
270
+ "symmetric": "(left + aligned_transformed) / 2",
271
+ "antisymmetric": "(left - aligned_transformed) / 2",
272
+ },
273
+ "input": {
274
+ "dimension": len(left),
275
+ "permutation": list(involution),
276
+ },
277
+ "decomposition": {
278
+ "aligned_transformed": list(aligned),
279
+ "symmetric": list(symmetric),
280
+ "antisymmetric": list(antisymmetric),
281
+ },
282
+ "closure": {
283
+ "permutation_squared_identity": permutation_closure_residual == 0,
284
+ "permutation_closure_residual": permutation_closure_residual,
285
+ "pair_reconstruction_residual_linf": reconstruction_residual,
286
+ "paired_delta_linf": paired_delta,
287
+ },
288
+ "labels": _labels(),
289
+ "citations": [dict(citation) for citation in _CITATIONS],
290
+ "effects": {
291
+ "writes": 0,
292
+ "signatures": 0,
293
+ "effectors": 0,
294
+ "network_calls": 0,
295
+ },
296
+ }
297
+ result_core["digests"] = {
298
+ "algorithm": "sha256",
299
+ "input_sha256": _stable_digest({"schema": SCHEMA, "input": input_contract}),
300
+ "result_sha256": _stable_digest(result_core),
301
+ "signed": False,
302
+ }
303
+ return result_core
304
+
305
+
306
+ __all__ = [
307
+ "ARTICLE_DOI",
308
+ "DATA_CODE_DOI",
309
+ "LABEL_MODELED",
310
+ "LABEL_PROVEN",
311
+ "LABEL_REPORTED",
312
+ "MAX_ABS_VALUE",
313
+ "MAX_DIMENSION",
314
+ "MAX_PAIR_ID_BYTES",
315
+ "SCHEMA",
316
+ "VERDICT_DECOMPOSED",
317
+ "VERDICT_REFUSED",
318
+ "evaluate_involution_pair",
319
+ ]
320
+
321
+
322
+ def register(app, ns="a11oy"):
323
+ """Register the read-only contract view and bounded evaluation endpoint."""
324
+ from fastapi import Request
325
+ from fastapi.responses import JSONResponse
326
+
327
+ base = "/api/%s/v1/evidenceos/involution" % ns
328
+
329
+ def _json_response(body, status_code=200):
330
+ response = JSONResponse(body, status_code=status_code)
331
+ response.headers["Cache-Control"] = "no-store"
332
+ response.headers["X-Content-Type-Options"] = "nosniff"
333
+ return response
334
+
335
+ @app.get(base + "/info")
336
+ async def _involution_info(): # noqa: ANN202
337
+ return _json_response({
338
+ "schema": SCHEMA,
339
+ "service_state": "LIVE",
340
+ "effectors": 0,
341
+ "writes": 0,
342
+ "max_dimension": MAX_DIMENSION,
343
+ "permutation_contract": "(P v)[i] = v[P[i]] and P^2 = I",
344
+ "labels": _labels(),
345
+ "citations": [dict(citation) for citation in _CITATIONS],
346
+ "receipt_policy": "pure computation; content digest returned; no state write and no signature minted",
347
+ })
348
+
349
+ @app.post(base + "/evaluate")
350
+ async def _involution_evaluate(request: Request): # noqa: ANN202
351
+ raw = await request.body()
352
+ if len(raw) > 200_000:
353
+ return _json_response({"ok": False, "verdict": VERDICT_REFUSED,
354
+ "refusal": {"code": "BODY_TOO_LARGE", "reason": "request exceeds 200000 bytes"}},
355
+ status_code=413)
356
+ try:
357
+ body = json.loads(raw.decode("utf-8"))
358
+ except (UnicodeDecodeError, json.JSONDecodeError):
359
+ return _json_response({"ok": False, "verdict": VERDICT_REFUSED,
360
+ "refusal": {"code": "INVALID_JSON", "reason": "request body must be JSON"}},
361
+ status_code=400)
362
+ if not isinstance(body, dict):
363
+ return _json_response({"ok": False, "verdict": VERDICT_REFUSED,
364
+ "refusal": {"code": "INVALID_BODY", "reason": "request body must be an object"}},
365
+ status_code=400)
366
+ allowed = {"pair_id", "left_observation", "transformed_observation", "permutation"}
367
+ unknown = sorted(str(key) for key in body if key not in allowed)
368
+ if unknown:
369
+ return _json_response({"ok": False, "verdict": VERDICT_REFUSED,
370
+ "refusal": {"code": "UNKNOWN_FIELDS", "reason": "unexpected fields", "fields": unknown}},
371
+ status_code=400)
372
+ result = evaluate_involution_pair(
373
+ pair_id=body.get("pair_id"),
374
+ left_observation=body.get("left_observation"),
375
+ transformed_observation=body.get("transformed_observation"),
376
+ permutation=body.get("permutation"),
377
+ )
378
+ return _json_response(result, status_code=200 if result["ok"] else 422)
379
+
380
+ return {"ok": True, "routes": [base + "/info", base + "/evaluate"]}
381
+
382
+
383
+ __all__.append("register")
szl_runtime_contracts.py ADDED
@@ -0,0 +1,421 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright 2026 Stephen P. Lutar Jr. / SZL Holdings
3
+ """Bounded runtime contracts for the a11oy service layer.
4
+
5
+ Taxonomy home: services/ (runtime health, identity, and observability posture).
6
+
7
+ The four read-only endpoints deliberately answer different questions:
8
+
9
+ * ``/api/livez`` proves only that this Python process can answer a request.
10
+ * ``/api/readyz`` re-walks the configured Khipu chain and folds in the existing
11
+ boot-preflight signal. Missing or non-durable chain state fails closed.
12
+ * ``/api/build-info`` emits only observable, allowlisted build metadata.
13
+ * ``/api/<ns>/v1/otel/status`` separates in-process propagation, exporter
14
+ configuration, and fresh collector delivery evidence.
15
+
16
+ GETs never mint receipts, sign data, contact an upstream, or write to disk.
17
+ """
18
+
19
+ import os
20
+ import platform
21
+ import re
22
+ import subprocess
23
+ import sys
24
+ import time
25
+ from pathlib import Path
26
+ from typing import Any, Optional
27
+
28
+
29
+ _STARTED_MONOTONIC = time.monotonic()
30
+ _SHA_RE = re.compile(r"(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})\Z")
31
+ _VERSION_RE = re.compile(r"[A-Za-z0-9][A-Za-z0-9._+\-]{0,63}\Z")
32
+ _ENV_SHA_NAMES = (
33
+ "A11OY_GIT_SHA",
34
+ "GITHUB_SHA",
35
+ "VERCEL_GIT_COMMIT_SHA",
36
+ "SOURCE_VERSION",
37
+ "GIT_COMMIT",
38
+ )
39
+ _ENV_VERSION_NAMES = ("A11OY_VERSION", "APP_VERSION", "RELEASE_VERSION")
40
+ _DURABLE_BACKENDS = {"sqlite", "json", "postgres", "postgresql", "lmdb"}
41
+ _FRESH_COLLECTOR_EVIDENCE_S = 120.0
42
+
43
+
44
+ def _no_store_json(content: dict[str, Any], status_code: int = 200):
45
+ from fastapi.responses import JSONResponse
46
+
47
+ response = JSONResponse(content=content, status_code=status_code)
48
+ response.headers["Cache-Control"] = "no-store"
49
+ response.headers["X-Content-Type-Options"] = "nosniff"
50
+ return response
51
+
52
+
53
+ def _safe_env_sha() -> tuple[Optional[str], Optional[str]]:
54
+ for name in _ENV_SHA_NAMES:
55
+ value = str(os.environ.get(name, "")).strip()
56
+ if _SHA_RE.fullmatch(value):
57
+ return value.lower(), f"env:{name}"
58
+ return None, None
59
+
60
+
61
+ def _safe_git(args: list[str]) -> Optional[subprocess.CompletedProcess[str]]:
62
+ """Run one bounded, read-only git query; never uses a shell."""
63
+ try:
64
+ return subprocess.run(
65
+ ["git", *args],
66
+ cwd=Path(__file__).resolve().parent,
67
+ capture_output=True,
68
+ text=True,
69
+ timeout=0.75,
70
+ check=False,
71
+ )
72
+ except (FileNotFoundError, OSError, subprocess.SubprocessError):
73
+ return None
74
+
75
+
76
+ def _build_identity() -> dict[str, Any]:
77
+ sha, source = _safe_env_sha()
78
+ if sha is None:
79
+ result = _safe_git(["rev-parse", "HEAD"])
80
+ candidate = result.stdout.strip() if result and result.returncode == 0 else ""
81
+ if _SHA_RE.fullmatch(candidate):
82
+ sha, source = candidate.lower(), "git:HEAD"
83
+
84
+ version = None
85
+ version_source = None
86
+ for name in _ENV_VERSION_NAMES:
87
+ candidate = str(os.environ.get(name, "")).strip()
88
+ if _VERSION_RE.fullmatch(candidate):
89
+ version, version_source = candidate, f"env:{name}"
90
+ break
91
+
92
+ dirty: Optional[bool] = None
93
+ status = _safe_git(["status", "--porcelain", "--untracked-files=normal"])
94
+ if status and status.returncode == 0:
95
+ dirty = bool(status.stdout.strip())
96
+
97
+ return {
98
+ "state": "OBSERVED" if sha else "UNKNOWN",
99
+ "revision": sha,
100
+ "revision_source": source or "UNKNOWN",
101
+ "version": version,
102
+ "version_source": version_source or "UNKNOWN",
103
+ "working_tree": (
104
+ "DIRTY" if dirty is True else "CLEAN" if dirty is False else "UNKNOWN"
105
+ ),
106
+ }
107
+
108
+
109
+ def _verify_khipu_store(app: Any) -> dict[str, Any]:
110
+ state = getattr(app, "state", None)
111
+ store = getattr(state, "be_khipu", None) if state is not None else None
112
+ if store is not None and callable(getattr(store, "verify", None)):
113
+ backend = str(getattr(store, "backend", "UNKNOWN"))
114
+ try:
115
+ result = store.verify()
116
+ if not isinstance(result, tuple) or len(result) != 3:
117
+ raise ValueError("verify() returned an unsupported contract")
118
+ intact, depth, first_break = result
119
+ durable = backend.lower() in _DURABLE_BACKENDS
120
+ ready = bool(intact) and durable
121
+ return {
122
+ "state": "READY" if ready else "NOT_READY",
123
+ "source": "app.state.be_khipu",
124
+ "chain_intact": bool(intact),
125
+ "depth": int(depth),
126
+ "first_break_seq": int(first_break),
127
+ "backend": backend,
128
+ "durable": durable,
129
+ "blocking": not ready,
130
+ }
131
+ except Exception as exc:
132
+ return {
133
+ "state": "UNAVAILABLE",
134
+ "source": "app.state.be_khipu",
135
+ "backend": backend,
136
+ "durable": backend.lower() in _DURABLE_BACKENDS,
137
+ "blocking": True,
138
+ "error_type": type(exc).__name__,
139
+ }
140
+
141
+ # Some small deployments use the shared in-process DAG registry without
142
+ # szl_be_hardening. Re-walk it for diagnostic evidence, but never promote
143
+ # an in-memory registry to readiness: intact links do not prove durable
144
+ # receipt persistence.
145
+ try:
146
+ import szl_khipu_verify
147
+
148
+ report = szl_khipu_verify.list_organs()
149
+ organs = list(report.get("organs") or [])
150
+ if not organs:
151
+ return {
152
+ "state": "UNKNOWN",
153
+ "source": "szl_khipu_verify.list_organs",
154
+ "organ_count": 0,
155
+ "blocking": True,
156
+ "reason": "no observed Khipu DAG in this process",
157
+ }
158
+ intact_values = [row.get("links_intact") for row in organs]
159
+ all_intact = all(value is True for value in intact_values)
160
+ return {
161
+ "state": "NOT_READY",
162
+ "source": "szl_khipu_verify.list_organs",
163
+ "organ_count": len(organs),
164
+ "chains_intact": all_intact,
165
+ "backend": "in-process-registry",
166
+ "durable": False,
167
+ "blocking": True,
168
+ "reason": (
169
+ "in-process DAG links are intact but durable persistence is not observed"
170
+ if all_intact
171
+ else "in-process DAG links are not intact and durable persistence is not observed"
172
+ ),
173
+ }
174
+ except Exception as exc:
175
+ return {
176
+ "state": "UNAVAILABLE",
177
+ "source": "szl_khipu_verify.list_organs",
178
+ "blocking": True,
179
+ "error_type": type(exc).__name__,
180
+ }
181
+
182
+
183
+ def _boot_preflight() -> dict[str, Any]:
184
+ try:
185
+ import szl_boot_preflight
186
+
187
+ report = szl_boot_preflight.readiness()
188
+ overall = str(report.get("overall", "UNKNOWN")).upper()
189
+ # Missing optional cloud credentials are explicitly DEGRADED, not a
190
+ # failure of the local core. A hard-required dependency is UNAVAILABLE.
191
+ blocking = overall not in {"LIVE", "DEGRADED"}
192
+ return {
193
+ "state": overall,
194
+ "source": "szl_boot_preflight.readiness",
195
+ "subsystem_count": len(report.get("subsystems") or []),
196
+ "blocking": blocking,
197
+ }
198
+ except Exception as exc:
199
+ return {
200
+ "state": "UNAVAILABLE",
201
+ "source": "szl_boot_preflight.readiness",
202
+ "blocking": True,
203
+ "error_type": type(exc).__name__,
204
+ }
205
+
206
+
207
+ def _readiness(app: Any) -> tuple[dict[str, Any], int]:
208
+ components = {
209
+ "khipu": _verify_khipu_store(app),
210
+ "boot_preflight": _boot_preflight(),
211
+ }
212
+ blockers = [name for name, value in components.items() if value.get("blocking")]
213
+ ready = not blockers
214
+ body = {
215
+ "status": "READY" if ready else "NOT_READY",
216
+ "ready": ready,
217
+ "components": components,
218
+ "blocking_components": blockers,
219
+ "receipt_minted": False,
220
+ }
221
+ return body, 200 if ready else 503
222
+
223
+
224
+ def _collector_evidence(app: Any, exporter_configured: bool) -> dict[str, Any]:
225
+ state = getattr(app, "state", None)
226
+ evidence = getattr(state, "otel_collector_evidence", None) if state is not None else None
227
+ if isinstance(evidence, dict):
228
+ try:
229
+ observed = float(evidence["observed_at_unix"])
230
+ age = max(0.0, time.time() - observed)
231
+ if age <= _FRESH_COLLECTOR_EVIDENCE_S and isinstance(
232
+ evidence.get("reachable"), bool
233
+ ):
234
+ reachable = bool(evidence["reachable"])
235
+ return {
236
+ "state": "REACHABLE" if reachable else "UNREACHABLE",
237
+ "evidence": "FRESH_PROBE",
238
+ "age_s": round(age, 3),
239
+ }
240
+ return {
241
+ "state": "UNKNOWN",
242
+ "evidence": "STALE_OR_INVALID_PROBE",
243
+ "age_s": round(age, 3),
244
+ }
245
+ except (KeyError, TypeError, ValueError, OverflowError):
246
+ pass
247
+ return {
248
+ "state": "UNKNOWN" if exporter_configured else "UNAVAILABLE",
249
+ "evidence": "NO_FRESH_DELIVERY_PROBE",
250
+ "age_s": None,
251
+ }
252
+
253
+
254
+ def _otel_posture(app: Any) -> dict[str, Any]:
255
+ installed = bool(getattr(app, "_vsp_otel_installed", False))
256
+ exporter_raw = str(getattr(app, "_vsp_otel_exporter", "UNAVAILABLE"))
257
+ policy = dict(getattr(app, "_vsp_otel_endpoint_policy", {}) or {})
258
+
259
+ # Prefer the existing VSP status object when it is available, but recompute
260
+ # maturity below: VSP propagation is not proof of collector delivery.
261
+ try:
262
+ import vsp_otel.middleware as vsp_otel
263
+
264
+ existing = vsp_otel.status(app)
265
+ installed = existing.get("propagation") == "READY"
266
+ exporter_raw = str(existing.get("exporter", exporter_raw))
267
+ endpoint = existing.get("endpoint")
268
+ if isinstance(endpoint, dict):
269
+ policy = endpoint
270
+ except Exception:
271
+ pass
272
+
273
+ exporter_configured = exporter_raw.startswith("otlp-grpc:configured:")
274
+ collector = _collector_evidence(app, exporter_configured)
275
+ if collector["state"] == "REACHABLE":
276
+ overall = "LIVE"
277
+ elif installed:
278
+ overall = "DEGRADED"
279
+ else:
280
+ overall = "UNAVAILABLE"
281
+ return {
282
+ "status": overall,
283
+ "in_process": {
284
+ "state": "LIVE" if installed else "UNAVAILABLE",
285
+ "trace_propagation": "READY" if installed else "UNAVAILABLE",
286
+ },
287
+ "exporter": {
288
+ "state": "CONFIGURED_UNVERIFIED" if exporter_configured else "UNAVAILABLE",
289
+ "endpoint_policy": str(policy.get("state", "UNKNOWN")),
290
+ "endpoint_fingerprint": policy.get("fingerprint"),
291
+ "delivery_asserted": False,
292
+ },
293
+ "collector": collector,
294
+ "receipt_minted": False,
295
+ "note": "in-process trace propagation is separate from exporter configuration and collector delivery",
296
+ }
297
+
298
+
299
+ def _looks_like_file_or_well_known(path: str) -> bool:
300
+ if path == "/.well-known" or path.startswith("/.well-known/"):
301
+ return True
302
+ last = path.rsplit("/", 1)[-1]
303
+ return bool(last and "." in last and last not in {".", ".."})
304
+
305
+
306
+ def _matched_by_path_catchall(app: Any, scope: dict[str, Any]) -> bool:
307
+ """Return True only when the first matching route is a ``:path`` wildcard."""
308
+ try:
309
+ from starlette.routing import Match
310
+
311
+ for route in app.router.routes:
312
+ matches = getattr(route, "matches", None)
313
+ if not callable(matches):
314
+ continue
315
+ match, _ = matches(scope)
316
+ if match == Match.FULL:
317
+ template = str(getattr(route, "path", ""))
318
+ return ":path}" in template
319
+ except Exception:
320
+ return False
321
+ return False
322
+
323
+
324
+ def _install_soft_404_guard(app: Any) -> None:
325
+ if getattr(app.state, "szl_runtime_soft_404_guard", False):
326
+ return
327
+
328
+ @app.middleware("http")
329
+ async def _runtime_soft_404_guard(request, call_next):
330
+ suspicious = request.method in {"GET", "HEAD"} and _looks_like_file_or_well_known(
331
+ request.url.path
332
+ )
333
+ catchall_match = suspicious and _matched_by_path_catchall(app, request.scope)
334
+ response = await call_next(request)
335
+ content_type = str(response.headers.get("content-type", "")).lower()
336
+ if catchall_match and response.status_code == 200 and "text/html" in content_type:
337
+ return _no_store_json(
338
+ {
339
+ "status": "NOT_FOUND",
340
+ "path": request.url.path,
341
+ "reason": "unknown file-like path refused SPA fallback",
342
+ },
343
+ status_code=404,
344
+ )
345
+ return response
346
+
347
+ app.state.szl_runtime_soft_404_guard = True
348
+
349
+
350
+ def _front_move_new_routes(app: Any, previous_ids: set[int]) -> None:
351
+ """Ensure exact contracts win even when register() follows a SPA catch-all."""
352
+ added = [route for route in app.router.routes if id(route) not in previous_ids]
353
+ if not added:
354
+ return
355
+ old = [route for route in app.router.routes if id(route) in previous_ids]
356
+ app.router.routes[:] = added + old
357
+
358
+
359
+ def register(app: Any, ns: str = "a11oy") -> dict[str, Any]:
360
+ """Register idempotent, read-only runtime endpoints and the soft-404 guard."""
361
+ if getattr(app.state, "szl_runtime_contracts_registered", False):
362
+ return {"registered": False, "reason": "already_registered"}
363
+
364
+ previous_ids = {id(route) for route in app.router.routes}
365
+ # Git inspection is a bounded startup observation, not request work. Keep
366
+ # the immutable snapshot in this registration closure so public GETs never
367
+ # spawn child processes or re-read the working tree.
368
+ build_identity = _build_identity()
369
+
370
+ @app.get("/api/livez", tags=["runtime"], include_in_schema=True)
371
+ async def _livez():
372
+ return _no_store_json(
373
+ {
374
+ "status": "LIVE",
375
+ "process": {
376
+ "pid": os.getpid(),
377
+ "uptime_s": round(time.monotonic() - _STARTED_MONOTONIC, 3),
378
+ "python_implementation": platform.python_implementation(),
379
+ },
380
+ "scope": "process liveness only; no dependency readiness asserted",
381
+ "receipt_minted": False,
382
+ }
383
+ )
384
+
385
+ @app.get("/api/readyz", tags=["runtime"], include_in_schema=True)
386
+ async def _readyz():
387
+ body, status = _readiness(app)
388
+ return _no_store_json(body, status_code=status)
389
+
390
+ @app.get("/api/build-info", tags=["runtime"], include_in_schema=True)
391
+ async def _build_info():
392
+ return _no_store_json(
393
+ {
394
+ "status": "OBSERVED",
395
+ "service": ns,
396
+ "build": build_identity,
397
+ "runtime": {
398
+ "python": platform.python_version(),
399
+ "platform": sys.platform,
400
+ },
401
+ "receipt_minted": False,
402
+ }
403
+ )
404
+
405
+ @app.get(f"/api/{ns}/v1/otel/status", tags=["runtime"], include_in_schema=True)
406
+ async def _otel_status():
407
+ return _no_store_json(_otel_posture(app))
408
+
409
+ _front_move_new_routes(app, previous_ids)
410
+ _install_soft_404_guard(app)
411
+ app.state.szl_runtime_contracts_registered = True
412
+ return {
413
+ "registered": True,
414
+ "routes": [
415
+ "/api/livez",
416
+ "/api/readyz",
417
+ "/api/build-info",
418
+ f"/api/{ns}/v1/otel/status",
419
+ ],
420
+ "external_writes": False,
421
+ }
web/immune.html CHANGED
@@ -4,7 +4,7 @@
4
  <meta charset="UTF-8"/>
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6
  <title>Immune (Hukulla) — fail-closed egress gate · SZL Holdings</title>
7
- <meta name="description" content="Live, honest view of the Immune organ (Quechua role 'Hukulla') — a fail-closed, deny-by-default egress gate. Real threat-signature scan + 1 MB size guard + Lambda-gate floor, every verdict signed into the shared Khipu chain. Lean backing: ImmuneNeymanPearsonOpt + FrontierWelfordVariance. Lambda = Conjecture 1; Khipu = Conjecture 2; trust never 100%."/>
8
  <!-- 0 runtime CDN (doctrine v11): system fonts only — no Google Fonts, no external assets. -->
9
  <style>
10
  :root{
@@ -26,7 +26,9 @@ a{color:inherit;text-decoration:none;}
26
  .topbar{position:sticky;top:0;z-index:60;display:flex;align-items:center;gap:1rem;flex-wrap:wrap;padding:.5rem 1.1rem;background:rgba(10,10,10,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--gold-line);font-family:var(--mono);font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--gold);}
27
  .topbar .sep{color:var(--dim);}
28
  .topbar .live{display:inline-flex;align-items:center;gap:.4rem;color:var(--cream);}
29
- .live-dot{width:6px;height:6px;border-radius:50%;background:var(--live);box-shadow:0 0 6px var(--live);animation:pulse 2.2s ease-in-out infinite;}
 
 
30
  @keyframes pulse{0%,100%{opacity:1;}50%{opacity:.35;}}
31
  .switcher{margin-left:auto;display:flex;align-items:center;gap:.3rem;}
32
  .flag{padding:.22rem .55rem;border-radius:6px;border:1px solid transparent;color:var(--muted);transition:.15s;}
@@ -37,12 +39,13 @@ h1{font-size:1.7rem;font-weight:600;margin:.2rem 0 .3rem;letter-spacing:-.01em;}
37
  .badge{display:inline-block;font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--teal);border:1px solid var(--teal-line);background:var(--teal-soft);padding:.25rem .6rem;border-radius:5px;margin-left:.4rem;vertical-align:middle;}
38
  .lede{color:var(--paragraph);font-size:.95rem;line-height:1.65;max-width:1180px;margin:.6rem 0 1rem;}
39
  .lede b{color:var(--cream);font-weight:600;}
40
- .cards{display:grid;grid-template-columns:repeat(4,1fr);gap:.8rem;margin:0 0 1.2rem;}
41
  .card{border:1px solid var(--gold-line);background:var(--panel);border-radius:8px;padding:.85rem 1rem;}
42
  .card .lbl{font-family:var(--mono);font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--dim);}
43
  .card .big{font-size:1.5rem;font-weight:600;margin:.35rem 0 .15rem;color:var(--teal);}
44
  .card .sub{font-family:var(--mono);font-size:10.5px;color:var(--muted);}
45
- .grid2{display:grid;grid-template-columns:1fr 1fr;gap:1rem;}
 
46
  .panel{border:1px solid var(--gold-line);background:var(--panel);border-radius:10px;padding:1rem 1.1rem;margin-bottom:1rem;}
47
  .panel h2{font-size:1.05rem;font-weight:600;margin:0 0 .2rem;display:flex;align-items:center;justify-content:space-between;}
48
  .panel h2 .meta{font-family:var(--mono);font-size:10px;color:var(--dim);text-transform:uppercase;letter-spacing:.06em;}
@@ -56,6 +59,8 @@ h1{font-size:1.7rem;font-weight:600;margin:.2rem 0 .3rem;letter-spacing:-.01em;}
56
  .pill.dim{color:var(--muted);}
57
  .simnote{border:1px solid var(--warn);background:rgba(201,160,95,.06);border-radius:8px;padding:.7rem .9rem;margin-top:.8rem;font-family:var(--mono);font-size:11px;color:#d8c39a;line-height:1.65;}
58
  table{width:100%;border-collapse:collapse;font-family:var(--mono);font-size:11.5px;margin-top:.5rem;}
 
 
59
  th,td{text-align:left;padding:.34rem .5rem;border-bottom:1px solid var(--gold-soft);color:var(--paragraph);vertical-align:top;}
60
  th{color:var(--dim);text-transform:uppercase;letter-spacing:.06em;font-size:9.5px;}
61
  td.deny{color:var(--red);}td.allow{color:var(--green);}
@@ -63,6 +68,7 @@ textarea,input{width:100%;background:var(--panel2);border:1px solid var(--gold-l
63
  textarea:focus,input:focus{outline:none;border-color:var(--teal-line);}
64
  button.run{margin-top:.6rem;padding:.55rem 1.1rem;border-radius:7px;border:1px solid var(--teal-line);background:var(--teal-soft);color:var(--teal);font-family:var(--mono);font-size:12px;letter-spacing:.06em;text-transform:uppercase;cursor:pointer;transition:.15s;}
65
  button.run:hover{background:rgba(95,179,163,.18);color:var(--cream);}
 
66
  .preset{display:inline-block;margin:.3rem .3rem 0 0;padding:.2rem .5rem;border-radius:5px;border:1px solid var(--gold-line);color:var(--muted);font-family:var(--mono);font-size:10.5px;cursor:pointer;}
67
  .preset:hover{color:var(--cream);border-color:var(--teal-line);}
68
  .verdict-box{margin-top:.8rem;border:1px solid var(--gold-line);border-radius:8px;padding:.85rem 1rem;background:var(--panel2);font-family:var(--mono);font-size:12px;line-height:1.8;}
@@ -72,12 +78,33 @@ button.run:hover{background:rgba(95,179,163,.18);color:var(--cream);}
72
  .digest{color:var(--gold);word-break:break-all;}
73
  code{font-family:var(--mono);color:var(--teal);}
74
  .footnote{font-family:var(--mono);font-size:10px;color:var(--dim);margin-top:1.6rem;line-height:1.7;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  </style>
76
  </head>
77
  <body>
78
  <div class="topbar">
79
  <span>SZL HOLDINGS</span><span class="sep">/</span><span>a11oy</span>
80
- <span class="live"><span class="live-dot"></span><span id="liveTag">IMMUNE · LIVE</span></span>
81
  <span class="switcher">
82
  <a class="flag active" href="/immune">Immune</a>
83
  <a class="flag" href="/energy">Energy</a>
@@ -88,12 +115,13 @@ code{font-family:var(--mono);color:var(--teal);}
88
  </div>
89
 
90
  <div class="wrap">
91
- <h1>Immune (Hukulla) — fail-closed egress gate<span class="badge" id="organBadge">deny-by-default · real inspection · Khipu-signed</span></h1>
92
  <p class="lede">
93
  The <b>Immune</b> organ (Quechua role <b>Hukulla</b>) is a <b>fail-closed, deny-by-default</b> egress gate.
94
- Every action is inspected against a real threat-signature corpus, a 1&nbsp;MB size guard and a
95
- <b>&Lambda;-gate floor</b> (MIN of supplied trust axes &lt; 0.5 &rarr; deny). Each verdict is signed into the
96
- <b>shared Khipu chain</b> (<code>SZL.Immune.Verdict.v1</code>). Proven Lean backing:
 
97
  <code>ImmuneNeymanPearsonOpt.lean</code> (Neyman&ndash;Pearson-optimal egress) and
98
  <code>FrontierWelfordVariance.lean</code> (Welford online variance). These back the gate but are
99
  <b>not</b> folded into the locked-8 proven set. &Lambda; = <b>Conjecture&nbsp;1</b> (not a theorem);
@@ -111,7 +139,7 @@ code{font-family:var(--mono);color:var(--teal);}
111
  <div class="panel">
112
  <h2>Inspect an action <span class="meta" id="verdictEp">POST /api/a11oy/v1/immune/verdict</span></h2>
113
  <p class="lede" style="margin:.2rem 0 .6rem;font-size:.86rem;">
114
- Submit a real action payload. The gate runs the live inspection and signs a Khipu receipt.
115
  Optionally include <code>axes</code> (a JSON array of trust scores) to exercise the &Lambda;-gate floor.
116
  </p>
117
  <div>
@@ -129,7 +157,7 @@ code{font-family:var(--mono);color:var(--teal);}
129
 
130
  <div class="panel">
131
  <h2>Live status <span class="meta" id="statusEp">GET /api/a11oy/v1/immune/status</span></h2>
132
- <div class="kv" id="statusKv"><span class="k">loading…</span></div>
133
  <div class="simnote" id="honestyNote">
134
  Λ = Conjecture 1 (NOT a theorem). Khipu = Conjecture 2. Trust never 100%. Effectors simulated.
135
  Decision feed is in-memory (resets on restart) — empty means IDLE, never faked.
@@ -139,12 +167,12 @@ code{font-family:var(--mono);color:var(--teal);}
139
 
140
  <div class="panel">
141
  <h2>Gates <span class="meta" id="gatesEp">GET /api/a11oy/v1/immune/gates</span></h2>
142
- <table id="gatesTable"><thead><tr><th>id</th><th>name</th><th>label</th><th>category</th><th>sample → expected</th></tr></thead><tbody><tr><td class="mono" colspan="5">loading…</td></tr></tbody></table>
143
  </div>
144
 
145
  <div class="panel">
146
  <h2>Decision feed <span class="meta" id="feedEp">GET /api/a11oy/v1/immune/feed</span></h2>
147
- <table id="feedTable"><thead><tr><th>time</th><th>decision</th><th>signals</th><th>Λ</th><th>receipt</th></tr></thead><tbody><tr><td class="mono" colspan="5">loading…</td></tr></tbody></table>
148
  </div>
149
 
150
  <div class="footnote" id="leanFoot">
@@ -156,45 +184,96 @@ code{font-family:var(--mono);color:var(--teal);}
156
 
157
  <script>
158
  const BASE = "/api/a11oy/v1/immune";
159
- async function getJSON(u,opt){try{const r=await fetch(u,opt);if(!r.ok)return null;return await r.json();}catch(e){return null;}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  function esc(s){return String(s).replace(/[&<>"']/g,function(c){return({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]||c);});}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  async function loadStatus(){
163
- const s = await getJSON(BASE + "/status");
164
  const kv = document.getElementById("statusKv");
165
- if(!s){kv.innerHTML='<span class="k">status</span><span class="v">unreachable — retrying</span>';return;}
166
- document.getElementById("cVerdicts").textContent = (s.verdicts_this_process ?? 0);
 
 
 
 
 
 
167
  document.getElementById("cDenyRate").textContent = (s.deny_rate==null?"—":(Math.round(s.deny_rate*1000)/10)+"%");
168
- document.getElementById("cDenySub").textContent = (s.deny ?? 0)+" deny / "+(s.allow ?? 0)+" allow";
169
  document.getElementById("cCorpus").textContent = (s.signature_corpus_size ?? "—");
170
- document.getElementById("cCorpusSub").textContent = (s.threats_corpus_total ?? 0)+" STIX/MITRE in corpus";
171
  const k = s.khipu||{};
172
  document.getElementById("cChain").textContent = (k.chain_depth ?? "—");
173
- document.getElementById("cChainSub").textContent = (k.chain_verified? "chain verified":"unverified");
 
174
  kv.innerHTML =
175
- '<div><span class="k">organ</span><span class="v">'+esc(s.organ||"Immune (Hukulla)")+'</span></div>'+
176
- '<div><span class="k">role</span><span class="v">'+esc(s.role||"")+'</span></div>'+
177
- '<div><span class="k">Λ-gate floor</span><span class="v">'+esc(s.lambda_gate_floor)+'</span></div>'+
178
- '<div><span class="k">size guard</span><span class="v">'+esc(s.size_guard_bytes)+' bytes</span></div>'+
179
- '<div><span class="k">signatures</span><span class="v">'+esc((s.signatures||[]).join(", "))+'</span></div>'+
180
- '<div><span class="k">last receipt</span><span class="v digest">'+esc(s.last_receipt_digest||"(none yet)")+'</span></div>'+
181
- '<div><span class="k">khipu head</span><span class="v digest">'+esc((k.head_digest||"").slice(0,32))+'…</span></div>'+
182
- '<div><span class="k">status</span><span class="pill green">'+esc(s.status||"REAL")+'</span></div>';
 
 
183
  }
184
 
185
  async function loadGates(){
186
- const g = await getJSON(BASE + "/gates");
187
  const tb = document.querySelector("#gatesTable tbody");
188
- if(!g || !g.gates){tb.innerHTML='<tr><td class="mono" colspan="5">unreachable</td></tr>';return;}
 
189
  tb.innerHTML = g.gates.map(x=>
190
  '<tr><td class="mono">'+esc(x.id)+'</td><td>'+esc(x.name)+'</td><td>'+esc(x.label)+'</td><td>'+esc(x.category)+'</td>'+
191
  '<td><code>'+esc(String(x.sampleInput).slice(0,46))+'</code> → <b>'+esc(x.expectedDecision)+'</b></td></tr>').join("");
192
  }
193
 
194
  async function loadFeed(){
195
- const f = await getJSON(BASE + "/feed?limit=20");
196
  const tb = document.querySelector("#feedTable tbody");
197
- if(!f || !f.verdicts || !f.verdicts.length){tb.innerHTML='<tr><td class="mono" colspan="5">IDLE — no verdicts buffered (resets on restart)</td></tr>';return;}
 
 
198
  tb.innerHTML = f.verdicts.map(v=>
199
  '<tr><td>'+esc((v.timestamp||"").slice(11,19))+'</td>'+
200
  '<td class="'+esc(v.decision)+'">'+esc(v.decision)+'</td>'+
@@ -209,21 +288,33 @@ async function runVerdict(){
209
  try{ body = JSON.parse(document.getElementById("actionInput").value); }
210
  catch(e){ out.innerHTML='<div class="verdict-box deny">Invalid JSON: '+esc(e.message)+'</div>'; return; }
211
  out.innerHTML='<div class="verdict-box">inspecting…</div>';
212
- const v = await getJSON(BASE + "/verdict", {method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(body)});
213
- if(!v){ out.innerHTML='<div class="verdict-box deny">endpoint unreachable — retry</div>'; return; }
214
- const cls = v.decision==="deny"?"deny":"allow";
215
- const pill = v.decision==="deny"?'<span class="pill red">DENY</span>':'<span class="pill green">ALLOW</span>';
216
- const sigs = (v.signals||[]).map(s=>'<span class="sig">'+esc(s)+'</span>').join("") || '<span class="pill dim">no signal</span>';
 
 
217
  const rec = v.khipu_receipt||{};
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  out.innerHTML =
219
  '<div class="verdict-box '+cls+'">'+
220
- '<div>decision '+pill+' &nbsp; <span style="color:var(--dim)">Λ='+esc(v.lambda_value)+' (floor '+esc(v.lambda_floor)+')</span></div>'+
221
- '<div style="margin:.4rem 0;color:var(--paragraph)">'+esc(v.reason)+'</div>'+
222
  '<div style="margin:.3rem 0;">signals: '+sigs+'</div>'+
223
- '<div><span style="color:var(--dim)">verdict hash</span> <span class="digest">'+esc(v.receipt_hash)+'</span></div>'+
224
- '<div><span style="color:var(--dim)">Khipu receipt</span> <span class="digest">'+esc(rec.digest||"")+'</span> '+
225
- '<span style="color:var(--dim)">seq '+esc(rec.seq)+' · '+esc(rec.receipt_type||"SZL.Immune.Verdict.v1")+'</span></div>'+
226
- '<div style="color:var(--dim);margin-top:.3rem">fail-closed='+esc(v.fail_closed)+' · doctrine '+esc(v.doctrine)+'</div>'+
227
  '</div>';
228
  loadStatus(); loadFeed();
229
  }
 
4
  <meta charset="UTF-8"/>
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6
  <title>Immune (Hukulla) — fail-closed egress gate · SZL Holdings</title>
7
+ <meta name="description" content="Honest operational view of the Immune organ (Quechua role 'Hukulla') — a fail-closed, deny-by-default egress gate. Status, trace, signature, and Khipu-chain evidence are shown only when returned by the live backend. Lambda = Conjecture 1; Khipu = Conjecture 2; trust never 100%."/>
8
  <!-- 0 runtime CDN (doctrine v11): system fonts only — no Google Fonts, no external assets. -->
9
  <style>
10
  :root{
 
26
  .topbar{position:sticky;top:0;z-index:60;display:flex;align-items:center;gap:1rem;flex-wrap:wrap;padding:.5rem 1.1rem;background:rgba(10,10,10,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--gold-line);font-family:var(--mono);font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--gold);}
27
  .topbar .sep{color:var(--dim);}
28
  .topbar .live{display:inline-flex;align-items:center;gap:.4rem;color:var(--cream);}
29
+ .live-dot{width:6px;height:6px;border-radius:50%;background:var(--warn);box-shadow:0 0 6px var(--warn);animation:pulse 2.2s ease-in-out infinite;}
30
+ .live-dot.ready{background:var(--live);box-shadow:0 0 6px var(--live);}
31
+ .live-dot.error{background:var(--err);box-shadow:0 0 6px var(--err);animation:none;}
32
  @keyframes pulse{0%,100%{opacity:1;}50%{opacity:.35;}}
33
  .switcher{margin-left:auto;display:flex;align-items:center;gap:.3rem;}
34
  .flag{padding:.22rem .55rem;border-radius:6px;border:1px solid transparent;color:var(--muted);transition:.15s;}
 
39
  .badge{display:inline-block;font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--teal);border:1px solid var(--teal-line);background:var(--teal-soft);padding:.25rem .6rem;border-radius:5px;margin-left:.4rem;vertical-align:middle;}
40
  .lede{color:var(--paragraph);font-size:.95rem;line-height:1.65;max-width:1180px;margin:.6rem 0 1rem;}
41
  .lede b{color:var(--cream);font-weight:600;}
42
+ .cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:.8rem;margin:0 0 1.2rem;}
43
  .card{border:1px solid var(--gold-line);background:var(--panel);border-radius:8px;padding:.85rem 1rem;}
44
  .card .lbl{font-family:var(--mono);font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--dim);}
45
  .card .big{font-size:1.5rem;font-weight:600;margin:.35rem 0 .15rem;color:var(--teal);}
46
  .card .sub{font-family:var(--mono);font-size:10.5px;color:var(--muted);}
47
+ .grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;}
48
+ .grid2>*{min-width:0;}
49
  .panel{border:1px solid var(--gold-line);background:var(--panel);border-radius:10px;padding:1rem 1.1rem;margin-bottom:1rem;}
50
  .panel h2{font-size:1.05rem;font-weight:600;margin:0 0 .2rem;display:flex;align-items:center;justify-content:space-between;}
51
  .panel h2 .meta{font-family:var(--mono);font-size:10px;color:var(--dim);text-transform:uppercase;letter-spacing:.06em;}
 
59
  .pill.dim{color:var(--muted);}
60
  .simnote{border:1px solid var(--warn);background:rgba(201,160,95,.06);border-radius:8px;padding:.7rem .9rem;margin-top:.8rem;font-family:var(--mono);font-size:11px;color:#d8c39a;line-height:1.65;}
61
  table{width:100%;border-collapse:collapse;font-family:var(--mono);font-size:11.5px;margin-top:.5rem;}
62
+ .table-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;}
63
+ .table-scroll table{min-width:680px;}
64
  th,td{text-align:left;padding:.34rem .5rem;border-bottom:1px solid var(--gold-soft);color:var(--paragraph);vertical-align:top;}
65
  th{color:var(--dim);text-transform:uppercase;letter-spacing:.06em;font-size:9.5px;}
66
  td.deny{color:var(--red);}td.allow{color:var(--green);}
 
68
  textarea:focus,input:focus{outline:none;border-color:var(--teal-line);}
69
  button.run{margin-top:.6rem;padding:.55rem 1.1rem;border-radius:7px;border:1px solid var(--teal-line);background:var(--teal-soft);color:var(--teal);font-family:var(--mono);font-size:12px;letter-spacing:.06em;text-transform:uppercase;cursor:pointer;transition:.15s;}
70
  button.run:hover{background:rgba(95,179,163,.18);color:var(--cream);}
71
+ button.run:focus-visible,.preset:focus-visible,.flag:focus-visible{outline:2px solid var(--teal);outline-offset:2px;}
72
  .preset{display:inline-block;margin:.3rem .3rem 0 0;padding:.2rem .5rem;border-radius:5px;border:1px solid var(--gold-line);color:var(--muted);font-family:var(--mono);font-size:10.5px;cursor:pointer;}
73
  .preset:hover{color:var(--cream);border-color:var(--teal-line);}
74
  .verdict-box{margin-top:.8rem;border:1px solid var(--gold-line);border-radius:8px;padding:.85rem 1rem;background:var(--panel2);font-family:var(--mono);font-size:12px;line-height:1.8;}
 
78
  .digest{color:var(--gold);word-break:break-all;}
79
  code{font-family:var(--mono);color:var(--teal);}
80
  .footnote{font-family:var(--mono);font-size:10px;color:var(--dim);margin-top:1.6rem;line-height:1.7;}
81
+ @media(max-width:760px){
82
+ .topbar{position:static;padding:.55rem .8rem;gap:.55rem;}
83
+ .switcher{order:3;width:100%;margin-left:0;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;padding-bottom:.15rem;}
84
+ .flag{flex:0 0 auto;min-height:44px;display:inline-flex;align-items:center;}
85
+ .wrap{padding:1.15rem .85rem 3rem;}
86
+ h1{font-size:1.4rem;line-height:1.25;}
87
+ .badge{display:block;width:max-content;max-width:100%;margin:.55rem 0 0;white-space:normal;}
88
+ .grid2{grid-template-columns:minmax(0,1fr);}
89
+ .panel{padding:.85rem;}
90
+ .panel h2{align-items:flex-start;gap:.5rem;flex-direction:column;}
91
+ .kv .k{min-width:130px;}
92
+ button.run{min-height:44px;width:100%;}
93
+ .preset{min-height:44px;display:inline-flex;align-items:center;}
94
+ }
95
+ @media(max-width:420px){
96
+ .cards{grid-template-columns:minmax(0,1fr);}
97
+ .kv>div{display:grid;grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr);gap:.5rem;}
98
+ .kv .k{min-width:0;}
99
+ .kv .v,.digest{overflow-wrap:anywhere;word-break:break-word;}
100
+ }
101
+ @media(prefers-reduced-motion:reduce){.live-dot{animation:none;}}
102
  </style>
103
  </head>
104
  <body>
105
  <div class="topbar">
106
  <span>SZL HOLDINGS</span><span class="sep">/</span><span>a11oy</span>
107
+ <span class="live"><span class="live-dot" id="liveDot"></span><span id="liveTag" aria-live="polite">IMMUNE · PROBING</span></span>
108
  <span class="switcher">
109
  <a class="flag active" href="/immune">Immune</a>
110
  <a class="flag" href="/energy">Energy</a>
 
115
  </div>
116
 
117
  <div class="wrap">
118
+ <h1>Immune (Hukulla) — fail-closed egress gate<span class="badge" id="organBadge">deny-by-default · evidence pending</span></h1>
119
  <p class="lede">
120
  The <b>Immune</b> organ (Quechua role <b>Hukulla</b>) is a <b>fail-closed, deny-by-default</b> egress gate.
121
+ Submitted actions are sent to the live threat-signature, size, and
122
+ <b>&Lambda;-gate</b> inspection path (MIN of supplied trust axes &lt; 0.5 &rarr; deny). When the backend
123
+ returns a Khipu receipt, its digest, sequence, signature, chain result, and trace context are shown below.
124
+ No receipt or signature state is inferred by this page. Proven Lean backing:
125
  <code>ImmuneNeymanPearsonOpt.lean</code> (Neyman&ndash;Pearson-optimal egress) and
126
  <code>FrontierWelfordVariance.lean</code> (Welford online variance). These back the gate but are
127
  <b>not</b> folded into the locked-8 proven set. &Lambda; = <b>Conjecture&nbsp;1</b> (not a theorem);
 
139
  <div class="panel">
140
  <h2>Inspect an action <span class="meta" id="verdictEp">POST /api/a11oy/v1/immune/verdict</span></h2>
141
  <p class="lede" style="margin:.2rem 0 .6rem;font-size:.86rem;">
142
+ Submit an action payload to the live inspection endpoint. Returned receipt and signing evidence is shown without inference.
143
  Optionally include <code>axes</code> (a JSON array of trust scores) to exercise the &Lambda;-gate floor.
144
  </p>
145
  <div>
 
157
 
158
  <div class="panel">
159
  <h2>Live status <span class="meta" id="statusEp">GET /api/a11oy/v1/immune/status</span></h2>
160
+ <div class="kv" id="statusKv" aria-live="polite"><span class="k">status</span><span class="v">PROBING</span></div>
161
  <div class="simnote" id="honestyNote">
162
  Λ = Conjecture 1 (NOT a theorem). Khipu = Conjecture 2. Trust never 100%. Effectors simulated.
163
  Decision feed is in-memory (resets on restart) — empty means IDLE, never faked.
 
167
 
168
  <div class="panel">
169
  <h2>Gates <span class="meta" id="gatesEp">GET /api/a11oy/v1/immune/gates</span></h2>
170
+ <div class="table-scroll" role="region" aria-label="Immune gates" tabindex="0"><table id="gatesTable"><thead><tr><th>id</th><th>name</th><th>label</th><th>category</th><th>sample → expected</th></tr></thead><tbody><tr><td class="mono" colspan="5">loading…</td></tr></tbody></table></div>
171
  </div>
172
 
173
  <div class="panel">
174
  <h2>Decision feed <span class="meta" id="feedEp">GET /api/a11oy/v1/immune/feed</span></h2>
175
+ <div class="table-scroll" role="region" aria-label="Immune decision feed" tabindex="0"><table id="feedTable"><thead><tr><th>time</th><th>decision</th><th>signals</th><th>Λ</th><th>receipt</th></tr></thead><tbody><tr><td class="mono" colspan="5">loading…</td></tr></tbody></table></div>
176
  </div>
177
 
178
  <div class="footnote" id="leanFoot">
 
184
 
185
  <script>
186
  const BASE = "/api/a11oy/v1/immune";
187
+ async function requestJSON(u,opt){
188
+ try{
189
+ const r=await fetch(u,opt);
190
+ const text=await r.text();
191
+ let data=null;
192
+ if(text){
193
+ try{data=JSON.parse(text);}
194
+ catch(e){return {ok:false,status:r.status,error:"invalid JSON response",data:null};}
195
+ }
196
+ if(!r.ok){
197
+ const detail=data&&(data.detail||data.error||data.message);
198
+ return {ok:false,status:r.status,error:detail||("HTTP "+r.status),data:data};
199
+ }
200
+ return {ok:true,status:r.status,error:null,data:data};
201
+ }catch(e){
202
+ return {ok:false,status:null,error:(e&&e.message)||String(e),data:null};
203
+ }
204
+ }
205
  function esc(s){return String(s).replace(/[&<>"']/g,function(c){return({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]||c);});}
206
+ function evidenceValue(v){
207
+ if(typeof v==="string")return v;
208
+ try{return JSON.stringify(v);}catch(e){return String(v);}
209
+ }
210
+ function present(v){return v!==undefined&&v!==null&&v!=="";}
211
+ function row(label,value,cls){
212
+ if(!present(value))return "";
213
+ return '<div><span class="k">'+esc(label)+'</span><span class="v '+(cls||'')+'">'+esc(evidenceValue(value))+'</span></div>';
214
+ }
215
+ function connectionState(state,reachable){
216
+ const normalized=present(state)?String(state).trim().toUpperCase():"UNKNOWN";
217
+ const ready=reachable&&["LIVE","REAL","READY","OPERATIONAL","MEASURED"].includes(normalized);
218
+ const dot=document.getElementById("liveDot");
219
+ dot.className="live-dot"+(ready?" ready":reachable?"":" error");
220
+ document.getElementById("liveTag").textContent="IMMUNE · "+(reachable?normalized:"UNAVAILABLE");
221
+ document.getElementById("organBadge").textContent=ready?"deny-by-default · backend reported "+normalized.toLowerCase():"deny-by-default · evidence "+(reachable?normalized.toLowerCase():"unavailable");
222
+ return {normalized,ready};
223
+ }
224
+ function requestFailure(result){
225
+ const status=result.status==null?"network error":"HTTP "+result.status;
226
+ return status+(present(result.error)?" · "+result.error:result.ok?" · required evidence unavailable":"");
227
+ }
228
 
229
  async function loadStatus(){
230
+ const result = await requestJSON(BASE + "/status");
231
  const kv = document.getElementById("statusKv");
232
+ if(!result.ok||!result.data){
233
+ connectionState(null,false);
234
+ kv.innerHTML=row("status","UNAVAILABLE")+row("evidence",requestFailure(result));
235
+ return;
236
+ }
237
+ const s=result.data;
238
+ const state=connectionState(s.status,true);
239
+ document.getElementById("cVerdicts").textContent = (s.verdicts_this_process ?? "—");
240
  document.getElementById("cDenyRate").textContent = (s.deny_rate==null?"—":(Math.round(s.deny_rate*1000)/10)+"%");
241
+ document.getElementById("cDenySub").textContent = (s.deny ?? "—")+" deny / "+(s.allow ?? "—")+" allow";
242
  document.getElementById("cCorpus").textContent = (s.signature_corpus_size ?? "—");
243
+ document.getElementById("cCorpusSub").textContent = (s.threats_corpus_total ?? "—")+" STIX/MITRE in corpus";
244
  const k = s.khipu||{};
245
  document.getElementById("cChain").textContent = (k.chain_depth ?? "—");
246
+ document.getElementById("cChainSub").textContent = (typeof k.chain_verified==="boolean"?(k.chain_verified?"chain verified":"chain not verified"):"verification unavailable");
247
+ const observed=s.observed_at||s.observedAt||s.timestamp;
248
  kv.innerHTML =
249
+ row("organ",s.organ)+
250
+ row("role",s.role)+
251
+ row("Λ-gate floor",s.lambda_gate_floor)+
252
+ row("size guard",present(s.size_guard_bytes)?s.size_guard_bytes+" bytes":null)+
253
+ row("signatures",Array.isArray(s.signatures)?s.signatures.join(", "):s.signatures)+
254
+ row("last receipt",s.last_receipt_digest,"digest")+
255
+ row("khipu head",k.head_digest,"digest")+
256
+ row("chain verified",typeof k.chain_verified==="boolean"?String(k.chain_verified):null)+
257
+ row("observed at",observed)+
258
+ '<div><span class="k">status</span><span class="pill '+(state.ready?'green':'yellow')+'">'+esc(state.normalized)+'</span></div>';
259
  }
260
 
261
  async function loadGates(){
262
+ const result = await requestJSON(BASE + "/gates");
263
  const tb = document.querySelector("#gatesTable tbody");
264
+ if(!result.ok||!result.data||!Array.isArray(result.data.gates)){tb.innerHTML='<tr><td class="mono" colspan="5">'+esc(requestFailure(result))+'</td></tr>';return;}
265
+ const g=result.data;
266
  tb.innerHTML = g.gates.map(x=>
267
  '<tr><td class="mono">'+esc(x.id)+'</td><td>'+esc(x.name)+'</td><td>'+esc(x.label)+'</td><td>'+esc(x.category)+'</td>'+
268
  '<td><code>'+esc(String(x.sampleInput).slice(0,46))+'</code> → <b>'+esc(x.expectedDecision)+'</b></td></tr>').join("");
269
  }
270
 
271
  async function loadFeed(){
272
+ const result = await requestJSON(BASE + "/feed?limit=20");
273
  const tb = document.querySelector("#feedTable tbody");
274
+ if(!result.ok||!result.data||!Array.isArray(result.data.verdicts)){tb.innerHTML='<tr><td class="mono" colspan="5">'+esc(requestFailure(result))+'</td></tr>';return;}
275
+ const f=result.data;
276
+ if(!f.verdicts.length){tb.innerHTML='<tr><td class="mono" colspan="5">IDLE — no verdicts buffered (resets on restart)</td></tr>';return;}
277
  tb.innerHTML = f.verdicts.map(v=>
278
  '<tr><td>'+esc((v.timestamp||"").slice(11,19))+'</td>'+
279
  '<td class="'+esc(v.decision)+'">'+esc(v.decision)+'</td>'+
 
288
  try{ body = JSON.parse(document.getElementById("actionInput").value); }
289
  catch(e){ out.innerHTML='<div class="verdict-box deny">Invalid JSON: '+esc(e.message)+'</div>'; return; }
290
  out.innerHTML='<div class="verdict-box">inspecting…</div>';
291
+ const result = await requestJSON(BASE + "/verdict", {method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(body)});
292
+ if(!result.ok||!result.data){ out.innerHTML='<div class="verdict-box deny">'+esc(requestFailure(result))+'</div>'; return; }
293
+ const v=result.data;
294
+ const decision=String(v.decision||"UNKNOWN").toLowerCase();
295
+ const cls = decision==="deny"?"deny":decision==="allow"?"allow":"";
296
+ const pill = decision==="deny"?'<span class="pill red">DENY</span>':decision==="allow"?'<span class="pill green">ALLOW</span>':'<span class="pill yellow">UNKNOWN</span>';
297
+ const sigs = Array.isArray(v.signals)?(v.signals.map(s=>'<span class="sig">'+esc(s)+'</span>').join("")||'<span class="pill dim">no signals returned</span>'):'<span class="pill dim">signals unavailable</span>';
298
  const rec = v.khipu_receipt||{};
299
+ const observed=v.observed_at||v.observedAt||v.timestamp||rec.observed_at||rec.timestamp;
300
+ const lambdaEvidence=present(v.lambda_value)?' &nbsp; <span style="color:var(--dim)">Λ='+esc(v.lambda_value)+(present(v.lambda_floor)?' (floor '+esc(v.lambda_floor)+')':'')+'</span>':'';
301
+ const reasonEvidence=present(v.reason)?'<div style="margin:.4rem 0;color:var(--paragraph)">'+esc(v.reason)+'</div>':'';
302
+ const policyEvidence=row("fail closed",v.fail_closed)+row("doctrine",v.doctrine);
303
+ const receiptEvidence=
304
+ row("verdict hash",v.receipt_hash,"digest")+
305
+ row("receipt digest",rec.digest,"digest")+
306
+ row("receipt sequence",rec.seq)+
307
+ row("receipt type",rec.receipt_type)+
308
+ row("signature",rec.signature,"digest")+
309
+ row("chain verified",typeof rec.chain_verified==="boolean"?String(rec.chain_verified):null)+
310
+ row("traceparent",v.traceparent,"digest")+
311
+ row("observed at",observed);
312
  out.innerHTML =
313
  '<div class="verdict-box '+cls+'">'+
314
+ '<div>decision '+pill+lambdaEvidence+'</div>'+
315
+ reasonEvidence+
316
  '<div style="margin:.3rem 0;">signals: '+sigs+'</div>'+
317
+ '<div class="kv">'+receiptEvidence+policyEvidence+'</div>'+
 
 
 
318
  '</div>';
319
  loadStatus(); loadFeed();
320
  }