@aliip/pilah 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/BUILD_STATUS.md +23 -0
  2. package/LICENSE +21 -0
  3. package/README.md +108 -2
  4. package/assets/logo.svg +5 -0
  5. package/docs/AB_EVALUATION.md +62 -0
  6. package/docs/ACCEPTANCE_GATE.md +41 -0
  7. package/docs/ADAPTIVE_RCA_WORKFLOW.md +93 -0
  8. package/docs/AGENT_DECISION_REVIEW.md +17 -0
  9. package/docs/AGENT_TRACE_BENCHMARK.md +17 -0
  10. package/docs/ALWAYS_ON_5_WHYS.md +75 -0
  11. package/docs/ARCHITECTURE.md +43 -0
  12. package/docs/BEHAVIORAL_5_WHYS_V2_0_1.md +117 -0
  13. package/docs/CHECKPOINT_RECOVERY.md +86 -0
  14. package/docs/CI_EFFICIENCY.md +63 -0
  15. package/docs/COMPATIBILITY.md +84 -0
  16. package/docs/CONTRACTS.md +177 -0
  17. package/docs/CONVERSATION_USAGE.md +52 -0
  18. package/docs/ENGINEERING_METHOD.md +68 -0
  19. package/docs/HOST_VALIDATION.md +35 -0
  20. package/docs/INDEPENDENT_ACCEPTANCE_RUNBOOK.md +72 -0
  21. package/docs/INTERVENTION_LEDGER.md +25 -0
  22. package/docs/MAIN_VALIDATION_BACKLOG.md +19 -0
  23. package/docs/NATIVE_FIRST_WORKFLOW.md +27 -0
  24. package/docs/OPEN_SOURCE_ENGINEERING_STANDARDS.md +62 -0
  25. package/docs/ORCHESTRATION_ADVISOR.md +36 -0
  26. package/docs/PRE_VNEXT_INTEGRATION.md +27 -0
  27. package/docs/PRIVATE_BENCHMARK_EXPORT.md +14 -0
  28. package/docs/README.md +58 -0
  29. package/docs/RELEASE.md +33 -0
  30. package/docs/RELEASE_AUTHORIZATION.md +33 -0
  31. package/docs/RISK_GUIDANCE.md +18 -0
  32. package/docs/SECURITY.md +76 -0
  33. package/docs/SECURITY_RELIABILITY_AUDIT_V2_0_1.md +55 -0
  34. package/docs/SEMANTIC_EVIDENCE.md +27 -0
  35. package/docs/SOURCES.md +13 -0
  36. package/docs/STOCKROOM_BENCHMARK_RECHECK_2026_11_18.md +53 -0
  37. package/docs/TOKEN_EFFICIENCY.md +71 -0
  38. package/docs/TOKEN_PROVENANCE.md +15 -0
  39. package/docs/V2_0_1_TRACEABILITY.md +66 -0
  40. package/hooks.json +45 -0
  41. package/mcp_config.json +16 -0
  42. package/package.json +31 -4
  43. package/plugin.json +27 -0
  44. package/rules/AGENTS.md +2 -0
  45. package/schemas/database.sql +84 -0
  46. package/schemas/mcp-tools.json +552 -0
  47. package/scripts/a2a.mjs +343 -0
  48. package/scripts/check-release.mjs +42 -0
  49. package/scripts/check-syntax.mjs +30 -0
  50. package/scripts/checkpoint.mjs +50 -0
  51. package/scripts/compare-agent-traces.mjs +53 -0
  52. package/scripts/context-guardian.mjs +132 -0
  53. package/scripts/evaluate-acceptance.mjs +110 -0
  54. package/scripts/export-benchmark.mjs +31 -0
  55. package/scripts/generate-contracts.mjs +6 -0
  56. package/scripts/hook.mjs +406 -0
  57. package/scripts/host-check.mjs +40 -0
  58. package/scripts/intervention-ledger.mjs +94 -0
  59. package/scripts/pilah.mjs +3 -0
  60. package/scripts/release-authorization.mjs +137 -0
  61. package/scripts/review-agent-decisions.mjs +34 -0
  62. package/scripts/semantic-evidence.mjs +15 -0
  63. package/scripts/verifykit.mjs +3 -0
  64. package/skills/pilah/SKILL.md +24 -0
  65. package/src/acceptance-matrix.mjs +84 -0
  66. package/src/browser-evidence.mjs +40 -0
  67. package/src/context-health.mjs +14 -0
  68. package/src/conversations.mjs +302 -0
  69. package/src/engine.mjs +494 -0
  70. package/src/graph.mjs +169 -0
  71. package/src/mcp-diagnostics.mjs +53 -0
  72. package/src/mcp.mjs +151 -0
  73. package/src/model-recovery.mjs +108 -0
  74. package/src/native-tool-recovery.mjs +45 -0
  75. package/src/node-runtime.mjs +13 -0
  76. package/src/orchestration-advisor.mjs +24 -0
  77. package/src/rca.mjs +174 -0
  78. package/src/risk-guidance.mjs +95 -0
  79. package/src/scanner.mjs +303 -0
  80. package/src/security.mjs +793 -0
  81. package/src/semantic-evidence.mjs +144 -0
  82. package/src/skill-discovery.mjs +23 -0
  83. package/src/sqlite-compat.mjs +11 -0
  84. package/src/storage.mjs +455 -0
  85. package/src/tokens.mjs +627 -0
  86. package/src/tools.mjs +164 -0
  87. package/src/verification.mjs +567 -0
  88. package/src/workflow-router.mjs +34 -0
@@ -0,0 +1,84 @@
1
+ -- A2A database schema v1; runtime applies idempotently.
2
+ CREATE TABLE IF NOT EXISTS meta (key TEXT PRIMARY KEY, value TEXT NOT NULL);
3
+ CREATE TABLE IF NOT EXISTS workspaces (id TEXT PRIMARY KEY, canonical_path TEXT UNIQUE NOT NULL, created_at TEXT NOT NULL, current_revision_id TEXT);
4
+ CREATE TABLE IF NOT EXISTS revisions (id TEXT PRIMARY KEY, workspace_id TEXT NOT NULL, git_head TEXT, snapshot_sha TEXT NOT NULL, environment_json TEXT NOT NULL DEFAULT '{}', created_at TEXT NOT NULL, FOREIGN KEY(workspace_id) REFERENCES workspaces(id));
5
+ CREATE INDEX IF NOT EXISTS revisions_by_ws ON revisions(workspace_id,created_at DESC);
6
+ CREATE TABLE IF NOT EXISTS files (workspace_id TEXT NOT NULL, path TEXT NOT NULL, content_sha TEXT NOT NULL, language TEXT, bytes INTEGER NOT NULL, revision_id TEXT NOT NULL, mtime_ms REAL, PRIMARY KEY(workspace_id,path));
7
+ CREATE TABLE IF NOT EXISTS nodes (workspace_id TEXT NOT NULL, id TEXT NOT NULL, kind TEXT NOT NULL, label TEXT NOT NULL, file_path TEXT, line INTEGER, basis TEXT NOT NULL DEFAULT 'source', revision_id TEXT NOT NULL, PRIMARY KEY(workspace_id,id));
8
+ CREATE INDEX IF NOT EXISTS nodes_search ON nodes(workspace_id,label);
9
+ CREATE TABLE IF NOT EXISTS edges (workspace_id TEXT NOT NULL, id TEXT NOT NULL, source TEXT NOT NULL, target TEXT NOT NULL, kind TEXT NOT NULL, basis TEXT NOT NULL, state TEXT NOT NULL, source_file TEXT, revision_id TEXT NOT NULL, PRIMARY KEY(workspace_id,id));
10
+ CREATE INDEX IF NOT EXISTS edges_source ON edges(workspace_id,source);
11
+ CREATE INDEX IF NOT EXISTS edges_target ON edges(workspace_id,target);
12
+ CREATE TABLE IF NOT EXISTS evidence (id TEXT PRIMARY KEY, workspace_id TEXT NOT NULL, revision_id TEXT NOT NULL, criterion_id TEXT NOT NULL, status TEXT NOT NULL CHECK(status IN ('passed','failed','blocked','inconclusive')), evidence_type TEXT NOT NULL, artifact_path TEXT NOT NULL, artifact_sha TEXT NOT NULL, metadata_json TEXT NOT NULL, created_at TEXT NOT NULL);
13
+ CREATE INDEX IF NOT EXISTS evidence_lookup ON evidence(workspace_id,criterion_id,created_at DESC);
14
+ CREATE TABLE IF NOT EXISTS runs (id TEXT PRIMARY KEY, workspace_id TEXT NOT NULL, revision_id TEXT NOT NULL, verdict TEXT NOT NULL, criteria_json TEXT NOT NULL, created_at TEXT NOT NULL);
15
+ CREATE TABLE IF NOT EXISTS incidents (id TEXT PRIMARY KEY, workspace_id TEXT NOT NULL, title TEXT NOT NULL, root_cause TEXT NOT NULL, state TEXT NOT NULL, revision_id TEXT NOT NULL, related_paths_json TEXT NOT NULL, criteria_json TEXT NOT NULL, evidence_ids_json TEXT NOT NULL, created_at TEXT NOT NULL, signature_sha TEXT);
16
+ CREATE INDEX IF NOT EXISTS incidents_lookup ON incidents(workspace_id,created_at DESC);
17
+ CREATE INDEX IF NOT EXISTS incidents_signature ON incidents(workspace_id,signature_sha,created_at DESC);
18
+ CREATE TABLE IF NOT EXISTS hypotheses (id TEXT PRIMARY KEY, workspace_id TEXT NOT NULL, incident_id TEXT, description TEXT NOT NULL, status TEXT NOT NULL, experiment TEXT, evidence_ids_json TEXT NOT NULL, created_at TEXT NOT NULL, revision_id TEXT, parent_hypothesis_id TEXT, why_depth INTEGER NOT NULL DEFAULT 1, predicted_observation TEXT, disconfirming_test TEXT, expected_criterion_id TEXT, plan_id TEXT, assessment_json TEXT NOT NULL DEFAULT '{}', assessed_revision_id TEXT, updated_at TEXT);
19
+ CREATE INDEX IF NOT EXISTS hypotheses_incident ON hypotheses(workspace_id,incident_id,created_at DESC);
20
+ -- Append-only local experimental interpretations. Never independent causal proof.
21
+ CREATE TABLE IF NOT EXISTS rca_experiments (
22
+ id TEXT PRIMARY KEY,
23
+ workspace_id TEXT NOT NULL,
24
+ hypothesis_id TEXT NOT NULL,
25
+ revision_id TEXT NOT NULL,
26
+ outcome TEXT NOT NULL,
27
+ observation TEXT NOT NULL,
28
+ criterion_id TEXT NOT NULL,
29
+ evidence_ids_json TEXT NOT NULL,
30
+ created_at TEXT NOT NULL
31
+ );
32
+ CREATE INDEX IF NOT EXISTS rca_experiments_history ON rca_experiments(workspace_id,hypothesis_id,created_at DESC);
33
+ CREATE TABLE IF NOT EXISTS telemetry (workspace_id TEXT NOT NULL, tool_name TEXT NOT NULL, action TEXT NOT NULL, raw_scope_tokens INTEGER NOT NULL DEFAULT 0, response_tokens INTEGER NOT NULL DEFAULT 0, tokens_saved INTEGER NOT NULL DEFAULT 0, created_at TEXT NOT NULL);
34
+ CREATE INDEX IF NOT EXISTS telemetry_by_ws ON telemetry(workspace_id,created_at DESC);
35
+ CREATE TABLE IF NOT EXISTS side_questions (id TEXT PRIMARY KEY, workspace_id TEXT, conversation_id TEXT NOT NULL, parent_conversation_id TEXT, title TEXT, question TEXT NOT NULL, summary TEXT, status TEXT NOT NULL DEFAULT 'resolved', transcript_path TEXT, metadata_json TEXT NOT NULL DEFAULT '{}', created_at TEXT NOT NULL, updated_at TEXT NOT NULL);
36
+ CREATE INDEX IF NOT EXISTS side_q_conv ON side_questions(conversation_id);
37
+ CREATE INDEX IF NOT EXISTS side_q_parent ON side_questions(parent_conversation_id);
38
+ CREATE INDEX IF NOT EXISTS side_q_ws ON side_questions(workspace_id);
39
+ CREATE TABLE IF NOT EXISTS artifact_versions (id TEXT PRIMARY KEY, workspace_id TEXT, conversation_id TEXT NOT NULL, artifact_name TEXT NOT NULL, version_number INTEGER NOT NULL, content_sha TEXT NOT NULL, content TEXT NOT NULL, diff_from_previous TEXT, created_at TEXT NOT NULL);
40
+ CREATE INDEX IF NOT EXISTS artifact_v_lookup ON artifact_versions(conversation_id, artifact_name, version_number DESC);
41
+ CREATE INDEX IF NOT EXISTS artifact_v_conv ON artifact_versions(conversation_id);
42
+ CREATE INDEX IF NOT EXISTS artifact_v_ws ON artifact_versions(workspace_id);
43
+
44
+
45
+ -- A2A model recovery: only sanitized model/category metadata, never raw errors.
46
+ CREATE TABLE IF NOT EXISTS model_recovery_state (
47
+ workspace_id TEXT NOT NULL,
48
+ conversation_id TEXT NOT NULL,
49
+ model_name TEXT,
50
+ incident_category TEXT,
51
+ incident_confidence TEXT,
52
+ incident_at TEXT,
53
+ notice_signature TEXT,
54
+ updated_at TEXT NOT NULL,
55
+ PRIMARY KEY(workspace_id, conversation_id)
56
+ );
57
+ CREATE INDEX IF NOT EXISTS model_recovery_recent ON model_recovery_state(workspace_id,updated_at DESC);
58
+ -- Checkpoints are explicit opt-in summaries, not automatic transcript copies.
59
+ CREATE TABLE IF NOT EXISTS recovery_checkpoints (
60
+ workspace_id TEXT NOT NULL,
61
+ conversation_id TEXT NOT NULL,
62
+ revision_id TEXT,
63
+ task_summary TEXT NOT NULL,
64
+ completed_json TEXT NOT NULL,
65
+ next_steps_json TEXT NOT NULL,
66
+ decisions_json TEXT NOT NULL DEFAULT '[]',
67
+ pending_tests_json TEXT NOT NULL DEFAULT '[]',
68
+ created_at TEXT NOT NULL,
69
+ updated_at TEXT NOT NULL,
70
+ PRIMARY KEY(workspace_id, conversation_id)
71
+ );
72
+ CREATE INDEX IF NOT EXISTS recovery_recent ON recovery_checkpoints(workspace_id,updated_at DESC);
73
+
74
+ -- Explicit opt-in, revision-bound acceptance plan scope for subsequent assess calls.
75
+ CREATE TABLE IF NOT EXISTS acceptance_plans (
76
+ id TEXT PRIMARY KEY,
77
+ workspace_id TEXT NOT NULL,
78
+ revision_id TEXT NOT NULL,
79
+ manifest_sha TEXT NOT NULL,
80
+ criteria_json TEXT NOT NULL,
81
+ created_at TEXT NOT NULL,
82
+ FOREIGN KEY(workspace_id) REFERENCES workspaces(id)
83
+ );
84
+ CREATE INDEX IF NOT EXISTS acceptance_plans_recent ON acceptance_plans(workspace_id,created_at DESC);
@@ -0,0 +1,552 @@
1
+ {
2
+ "schema_version": "1.0.0",
3
+ "tools": [
4
+ {
5
+ "name": "pilah_context",
6
+ "description": "Scoped project symbols and file relations; static only.",
7
+ "inputSchema": {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": [
11
+ "workspace"
12
+ ],
13
+ "properties": {
14
+ "workspace": {
15
+ "type": "string",
16
+ "maxLength": 1024
17
+ },
18
+ "action": {
19
+ "type": "string",
20
+ "enum": [
21
+ "inspect",
22
+ "query",
23
+ "freshness",
24
+ "tokens",
25
+ "skeleton",
26
+ "orchestration"
27
+ ],
28
+ "default": "inspect"
29
+ },
30
+ "query": {
31
+ "type": "string",
32
+ "maxLength": 160
33
+ },
34
+ "limit": {
35
+ "type": "integer",
36
+ "minimum": 1,
37
+ "maximum": 40
38
+ },
39
+ "file": {
40
+ "type": "string",
41
+ "maxLength": 500
42
+ },
43
+ "files": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": "string",
47
+ "maxLength": 500
48
+ },
49
+ "maxItems": 20
50
+ },
51
+ "history_scope": {
52
+ "type": "string",
53
+ "enum": [
54
+ "current",
55
+ "all"
56
+ ]
57
+ },
58
+ "history_limit": {
59
+ "type": "integer",
60
+ "minimum": 1,
61
+ "maximum": 10
62
+ },
63
+ "task": {
64
+ "type": "object",
65
+ "description": "Native advice only; launches nothing.",
66
+ "additionalProperties": false,
67
+ "properties": {
68
+ "tier": {
69
+ "type": "string",
70
+ "enum": [
71
+ "free",
72
+ "pro",
73
+ "ultra",
74
+ "paid-other",
75
+ "unknown"
76
+ ]
77
+ },
78
+ "available_commands": {
79
+ "type": "array",
80
+ "items": {
81
+ "type": "string",
82
+ "enum": [
83
+ "/swarm",
84
+ "/teamwork",
85
+ "/boost",
86
+ "@subagent"
87
+ ]
88
+ },
89
+ "maxItems": 4
90
+ },
91
+ "workstreams": {
92
+ "type": "array",
93
+ "items": {
94
+ "type": "string",
95
+ "maxLength": 120
96
+ },
97
+ "maxItems": 30
98
+ },
99
+ "dependencies": {
100
+ "type": "string",
101
+ "enum": [
102
+ "low",
103
+ "high",
104
+ "unknown"
105
+ ]
106
+ },
107
+ "milestones": {
108
+ "type": "integer",
109
+ "minimum": 0,
110
+ "maximum": 100
111
+ },
112
+ "long_horizon": {
113
+ "type": "boolean"
114
+ },
115
+ "hard_reasoning": {
116
+ "type": "boolean"
117
+ },
118
+ "file_ownership": {
119
+ "type": "string",
120
+ "enum": [
121
+ "independent",
122
+ "shared",
123
+ "unknown"
124
+ ]
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
130
+ },
131
+ {
132
+ "name": "pilah_impact",
133
+ "description": "Static impact and candidate tests; not proof.",
134
+ "inputSchema": {
135
+ "type": "object",
136
+ "additionalProperties": false,
137
+ "required": [
138
+ "workspace"
139
+ ],
140
+ "properties": {
141
+ "workspace": {
142
+ "type": "string",
143
+ "maxLength": 1024
144
+ },
145
+ "changed": {
146
+ "type": "array",
147
+ "items": {
148
+ "type": "string",
149
+ "maxLength": 500
150
+ },
151
+ "maxItems": 200
152
+ },
153
+ "depth": {
154
+ "type": "integer",
155
+ "minimum": 1,
156
+ "maximum": 4
157
+ },
158
+ "summary": {
159
+ "type": "boolean"
160
+ }
161
+ }
162
+ }
163
+ },
164
+ {
165
+ "name": "pilah_verify",
166
+ "description": "Local tests/evidence; not release proof.",
167
+ "inputSchema": {
168
+ "type": "object",
169
+ "additionalProperties": false,
170
+ "required": [
171
+ "workspace",
172
+ "operation"
173
+ ],
174
+ "properties": {
175
+ "workspace": {
176
+ "type": "string",
177
+ "maxLength": 1024
178
+ },
179
+ "operation": {
180
+ "type": "string",
181
+ "enum": [
182
+ "plan",
183
+ "assess",
184
+ "verify_handoff",
185
+ "assess_release",
186
+ "assess_semantic",
187
+ "assess_browser"
188
+ ]
189
+ },
190
+ "changed": {
191
+ "type": "array",
192
+ "items": {
193
+ "type": "string",
194
+ "maxLength": 500
195
+ },
196
+ "maxItems": 200
197
+ },
198
+ "persist_plan": {
199
+ "type": "boolean",
200
+ "description": "Opt-in, revision-pinned plan."
201
+ },
202
+ "plan_id": {
203
+ "type": "string",
204
+ "maxLength": 120
205
+ },
206
+ "criteria": {
207
+ "type": "array",
208
+ "maxItems": 40,
209
+ "items": {
210
+ "oneOf": [
211
+ {
212
+ "type": "string",
213
+ "maxLength": 240
214
+ },
215
+ {
216
+ "type": "object",
217
+ "additionalProperties": false,
218
+ "required": [
219
+ "id"
220
+ ],
221
+ "properties": {
222
+ "id": {
223
+ "type": "string",
224
+ "maxLength": 160
225
+ },
226
+ "artifact": {
227
+ "type": "string",
228
+ "maxLength": 500
229
+ },
230
+ "test_name": {
231
+ "type": "string",
232
+ "maxLength": 160,
233
+ "description": "Exact test; * is legacy only."
234
+ },
235
+ "blocked": {
236
+ "type": "boolean"
237
+ },
238
+ "reason": {
239
+ "type": "string",
240
+ "maxLength": 240
241
+ },
242
+ "given": {
243
+ "type": "string",
244
+ "maxLength": 200
245
+ },
246
+ "when": {
247
+ "type": "string",
248
+ "maxLength": 200
249
+ },
250
+ "then": {
251
+ "type": "string",
252
+ "maxLength": 200
253
+ },
254
+ "evidence_type": {
255
+ "type": "string",
256
+ "enum": [
257
+ "build",
258
+ "unit",
259
+ "integration",
260
+ "browser",
261
+ "visual",
262
+ "hardware",
263
+ "security",
264
+ "independent"
265
+ ]
266
+ },
267
+ "viewport": {
268
+ "type": "string",
269
+ "maxLength": 160
270
+ },
271
+ "ui_state": {
272
+ "type": "string",
273
+ "maxLength": 160
274
+ },
275
+ "reference": {
276
+ "type": "string",
277
+ "maxLength": 160
278
+ },
279
+ "negative": {
280
+ "type": "boolean"
281
+ },
282
+ "source_revision": {
283
+ "type": "string",
284
+ "maxLength": 160
285
+ },
286
+ "description": {
287
+ "type": "string",
288
+ "maxLength": 160
289
+ }
290
+ }
291
+ }
292
+ ]
293
+ }
294
+ },
295
+ "worker_name": {
296
+ "type": "string",
297
+ "maxLength": 128
298
+ },
299
+ "artifact": {
300
+ "type": "string",
301
+ "maxLength": 500
302
+ },
303
+ "allow_stale": {
304
+ "type": "boolean",
305
+ "description": "No-op: stale reports never pass."
306
+ }
307
+ }
308
+ }
309
+ },
310
+ {
311
+ "name": "pilah_evidence",
312
+ "description": "Local incidents, RCA, history and artifacts.",
313
+ "inputSchema": {
314
+ "type": "object",
315
+ "additionalProperties": false,
316
+ "required": [
317
+ "workspace",
318
+ "operation"
319
+ ],
320
+ "properties": {
321
+ "workspace": {
322
+ "type": "string",
323
+ "maxLength": 1024
324
+ },
325
+ "operation": {
326
+ "type": "string",
327
+ "enum": [
328
+ "list",
329
+ "runs",
330
+ "incidents",
331
+ "record_incident",
332
+ "add_hypothesis",
333
+ "assess_hypothesis",
334
+ "hypotheses",
335
+ "delete_incident",
336
+ "side_questions",
337
+ "record_side_question",
338
+ "artifact_versions",
339
+ "artifact_diff",
340
+ "snapshot_artifact",
341
+ "save_checkpoint",
342
+ "model_recovery",
343
+ "tool_recovery"
344
+ ]
345
+ },
346
+ "id": {
347
+ "type": "string",
348
+ "maxLength": 160
349
+ },
350
+ "limit": {
351
+ "type": "integer",
352
+ "minimum": 1,
353
+ "maximum": 50
354
+ },
355
+ "title": {
356
+ "type": "string",
357
+ "maxLength": 240
358
+ },
359
+ "root_cause": {
360
+ "type": "string",
361
+ "maxLength": 1400
362
+ },
363
+ "paths": {
364
+ "type": "array",
365
+ "items": {
366
+ "type": "string",
367
+ "maxLength": 500
368
+ },
369
+ "maxItems": 200
370
+ },
371
+ "criteria": {
372
+ "type": "array",
373
+ "items": {
374
+ "type": "string",
375
+ "maxLength": 240
376
+ },
377
+ "maxItems": 40
378
+ },
379
+ "evidence_ids": {
380
+ "type": "array",
381
+ "items": {
382
+ "type": "string",
383
+ "maxLength": 160
384
+ },
385
+ "maxItems": 20
386
+ },
387
+ "hypothesis": {
388
+ "type": "string",
389
+ "maxLength": 1000
390
+ },
391
+ "experiment": {
392
+ "type": "string",
393
+ "maxLength": 1000
394
+ },
395
+ "incident_id": {
396
+ "type": "string",
397
+ "maxLength": 160
398
+ },
399
+ "persist_rca": {
400
+ "type": "boolean",
401
+ "description": "Opt-in local private RCA retention."
402
+ },
403
+ "confirm_deletion": {
404
+ "type": "boolean",
405
+ "description": "Confirm logical removal; not secure erasure."
406
+ },
407
+ "hypothesis_id": {
408
+ "type": "string",
409
+ "maxLength": 128
410
+ },
411
+ "parent_hypothesis_id": {
412
+ "type": "string",
413
+ "maxLength": 128
414
+ },
415
+ "predicted_observation": {
416
+ "type": "string",
417
+ "maxLength": 300
418
+ },
419
+ "disconfirming_test": {
420
+ "type": "string",
421
+ "maxLength": 300
422
+ },
423
+ "expected_criterion_id": {
424
+ "type": "string",
425
+ "maxLength": 160,
426
+ "description": "Named test only, not causal proof."
427
+ },
428
+ "plan_id": {
429
+ "type": "string",
430
+ "maxLength": 120
431
+ },
432
+ "experiment_outcome": {
433
+ "type": "string",
434
+ "enum": [
435
+ "supports",
436
+ "refutes",
437
+ "inconclusive"
438
+ ],
439
+ "description": "Agent report; not independent proof."
440
+ },
441
+ "observation": {
442
+ "type": "string",
443
+ "maxLength": 400
444
+ },
445
+ "conversation_id": {
446
+ "type": "string",
447
+ "maxLength": 128
448
+ },
449
+ "parent_conversation_id": {
450
+ "type": "string",
451
+ "maxLength": 128
452
+ },
453
+ "question": {
454
+ "type": "string",
455
+ "maxLength": 4000
456
+ },
457
+ "summary": {
458
+ "type": "string",
459
+ "maxLength": 4000
460
+ },
461
+ "status": {
462
+ "type": "string",
463
+ "maxLength": 40
464
+ },
465
+ "task_summary": {
466
+ "type": "string",
467
+ "maxLength": 500
468
+ },
469
+ "completed": {
470
+ "type": "array",
471
+ "maxItems": 8,
472
+ "items": {
473
+ "type": "string",
474
+ "maxLength": 200
475
+ }
476
+ },
477
+ "next_steps": {
478
+ "type": "array",
479
+ "maxItems": 8,
480
+ "items": {
481
+ "type": "string",
482
+ "maxLength": 200
483
+ }
484
+ },
485
+ "artifact_name": {
486
+ "type": "string",
487
+ "maxLength": 240
488
+ },
489
+ "artifact_path": {
490
+ "type": "string",
491
+ "maxLength": 500
492
+ },
493
+ "v1": {
494
+ "type": "integer",
495
+ "minimum": 0
496
+ },
497
+ "v2": {
498
+ "type": "integer",
499
+ "minimum": 1
500
+ },
501
+ "decisions": {
502
+ "type": "array",
503
+ "maxItems": 8,
504
+ "items": {
505
+ "type": "string",
506
+ "maxLength": 200
507
+ }
508
+ },
509
+ "pending_tests": {
510
+ "type": "array",
511
+ "maxItems": 8,
512
+ "items": {
513
+ "type": "string",
514
+ "maxLength": 200
515
+ }
516
+ },
517
+ "tool_family": {
518
+ "type": "string",
519
+ "enum": [
520
+ "mcp",
521
+ "browser",
522
+ "filesystem",
523
+ "terminal",
524
+ "other"
525
+ ]
526
+ },
527
+ "error_hint": {
528
+ "type": "string",
529
+ "maxLength": 400
530
+ },
531
+ "error_class": {
532
+ "type": "string",
533
+ "enum": [
534
+ "invalid_arguments",
535
+ "context_lost",
536
+ "timeout",
537
+ "permission_denied",
538
+ "missing_file",
539
+ "edit_conflict",
540
+ "unknown"
541
+ ]
542
+ },
543
+ "retry_count": {
544
+ "type": "integer",
545
+ "minimum": 0,
546
+ "maximum": 20
547
+ }
548
+ }
549
+ }
550
+ }
551
+ ]
552
+ }