@wowok/agent-mcp 2.5.4 → 2.6.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 (76) hide show
  1. package/README.md +33 -26
  2. package/dist/config/runtime.js +3 -6
  3. package/dist/harness/checkpoint.js +2 -2
  4. package/dist/knowledge/flywheel-loop.js +2 -5
  5. package/dist/knowledge/overrides-loader.js +2 -4
  6. package/dist/knowledge/progress-ledger.js +3 -0
  7. package/dist/knowledge/progress-translation.js +5 -1
  8. package/dist/knowledge/reward-confirm.d.ts +3 -0
  9. package/dist/knowledge/reward-confirm.js +30 -0
  10. package/dist/knowledge/reward-puzzle.d.ts +1 -0
  11. package/dist/knowledge/reward-puzzle.js +12 -0
  12. package/dist/knowledge/reward-risk.d.ts +4 -1
  13. package/dist/knowledge/reward-risk.js +85 -3
  14. package/dist/knowledge/tools-reference.js +5 -4
  15. package/dist/loop-engineering/improve.js +2 -4
  16. package/dist/project/deployment-bridge.d.ts +5 -0
  17. package/dist/project/deployment-bridge.js +96 -0
  18. package/dist/project/evaluation.d.ts +53 -0
  19. package/dist/project/evaluation.js +860 -0
  20. package/dist/project/graph-builder.d.ts +43 -0
  21. package/dist/project/graph-builder.js +585 -0
  22. package/dist/project/handlers.d.ts +154 -0
  23. package/dist/project/handlers.js +567 -0
  24. package/dist/project/index.d.ts +1 -0
  25. package/dist/project/index.js +26 -7
  26. package/dist/project/project-store.js +2 -5
  27. package/dist/project/query.d.ts +1 -0
  28. package/dist/project/query.js +2 -0
  29. package/dist/project/semantic-assembler.d.ts +93 -0
  30. package/dist/project/semantic-assembler.js +345 -0
  31. package/dist/schema/call/base.js +1 -1
  32. package/dist/schema/config/index.d.ts +12 -12
  33. package/dist/schema/local/index.d.ts +108 -108
  34. package/dist/schema/local/index.js +21 -18
  35. package/dist/schema/messenger/index.d.ts +16 -16
  36. package/dist/schema/messenger/index.js +2 -2
  37. package/dist/schema/operations.d.ts +0 -6
  38. package/dist/schema/project/index.d.ts +1840 -3903
  39. package/dist/schema/project/index.js +403 -955
  40. package/dist/schema/query/index.d.ts +10 -5
  41. package/dist/schema/trust/index.d.ts +6 -6
  42. package/dist/schemas/account_operation.output.json +7 -21
  43. package/dist/schemas/account_operation.schema.json +9 -23
  44. package/dist/schemas/bridge_operation.schema.json +1 -1
  45. package/dist/schemas/guard2file.schema.json +1 -1
  46. package/dist/schemas/index.json +2 -2
  47. package/dist/schemas/machineNode2file.schema.json +1 -1
  48. package/dist/schemas/messenger_operation.schema.json +6 -6
  49. package/dist/schemas/onchain_operations.schema.json +5 -5
  50. package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
  51. package/dist/schemas/onchain_operations_arbitration.schema.json +1 -1
  52. package/dist/schemas/onchain_operations_contact.schema.json +1 -1
  53. package/dist/schemas/onchain_operations_demand.schema.json +1 -1
  54. package/dist/schemas/onchain_operations_gen_passport.schema.json +2 -2
  55. package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -2
  56. package/dist/schemas/onchain_operations_guard.schema.json +1 -1
  57. package/dist/schemas/onchain_operations_machine.schema.json +1 -1
  58. package/dist/schemas/onchain_operations_order.schema.json +1 -1
  59. package/dist/schemas/onchain_operations_payment.schema.json +1 -1
  60. package/dist/schemas/onchain_operations_permission.schema.json +1 -1
  61. package/dist/schemas/onchain_operations_personal.schema.json +1 -1
  62. package/dist/schemas/onchain_operations_progress.schema.json +1 -1
  63. package/dist/schemas/onchain_operations_proof.schema.json +1 -1
  64. package/dist/schemas/onchain_operations_repository.schema.json +1 -1
  65. package/dist/schemas/onchain_operations_reward.schema.json +1 -1
  66. package/dist/schemas/onchain_operations_service.schema.json +1 -1
  67. package/dist/schemas/onchain_operations_treasury.schema.json +1 -1
  68. package/dist/schemas/project_operation.output.json +1178 -2494
  69. package/dist/schemas/project_operation.schema.json +216 -530
  70. package/dist/schemas/query_toolkit.output.json +7 -6
  71. package/dist/schemas/query_toolkit.schema.json +0 -4
  72. package/dist/telemetry/storage.js +2 -2
  73. package/dist/tools/handlers/onchain.js +110 -19
  74. package/dist/tools/handlers/project.js +56 -1046
  75. package/dist/tools/index.js +85 -56
  76. package/package.json +2 -2
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "https://wowok.net/schemas/project_operation.json",
4
- "title": "Project - Namespace & Object Graph",
5
- "description": "Manage and query the local object dependency graph (DAG) built on top of local_mark tags. Actions: list_projects, list_objects, shareable, dependencies, referenced_by, pre_publish_check, cross_project_refs, graph_stats, save_graph, load_graph.",
4
+ "title": "Project - Entity Management & Evaluation",
5
+ "description": "Project management service — manage projects as first-class entities with SQLite persistence, rigid project-object relationships, three-pathway graph construction, and a dual rule-based + LLM-assisted evaluation engine. Actions: list_projects, create_project, create_project_from_onchain, update_project, get_project_detail, add_object, remove_object, create_version, build_graph, get_graph, evaluate_project, save_evaluation, compare_projects, refresh_objects, get_object_diff, assemble_context.",
6
6
  "$ref": "#/definitions/project_operation",
7
7
  "definitions": {
8
8
  "project_operation": {
@@ -18,1884 +18,238 @@
18
18
  "const": "list_projects"
19
19
  },
20
20
  "items": {
21
- "type": "array",
22
- "items": {
23
- "type": "object",
24
- "additionalProperties": {}
25
- },
26
- "description": "List of result items. Each item is an untyped record — shape varies per query."
27
- }
28
- },
29
- "required": [
30
- "action",
31
- "items"
32
- ],
33
- "additionalProperties": false
34
- },
35
- {
36
- "type": "object",
37
- "properties": {
38
- "action": {
39
- "type": "string",
40
- "const": "list_objects"
41
- },
42
- "items": {
43
- "type": "array",
44
- "items": {
45
- "type": "object",
46
- "additionalProperties": {}
47
- },
48
- "description": "List of result items. Each item is an untyped record — shape varies per query."
49
- }
50
- },
51
- "required": [
52
- "action",
53
- "items"
54
- ],
55
- "additionalProperties": false
56
- },
57
- {
58
- "type": "object",
59
- "properties": {
60
- "action": {
61
- "type": "string",
62
- "const": "shareable"
63
- },
64
- "items": {
65
- "type": "array",
66
- "items": {
67
- "type": "object",
68
- "additionalProperties": {}
69
- },
70
- "description": "List of result items. Each item is an untyped record — shape varies per query."
71
- }
72
- },
73
- "required": [
74
- "action",
75
- "items"
76
- ],
77
- "additionalProperties": false
78
- },
79
- {
80
- "type": "object",
81
- "properties": {
82
- "action": {
83
- "type": "string",
84
- "const": "dependencies"
85
- },
86
- "items": {
87
- "type": "array",
88
- "items": {
89
- "type": "object",
90
- "additionalProperties": {}
91
- },
92
- "description": "List of result items. Each item is an untyped record — shape varies per query."
93
- }
94
- },
95
- "required": [
96
- "action",
97
- "items"
98
- ],
99
- "additionalProperties": false
100
- },
101
- {
102
- "type": "object",
103
- "properties": {
104
- "action": {
105
- "type": "string",
106
- "const": "referenced_by"
107
- },
108
- "items": {
109
- "type": "array",
110
- "items": {
111
- "type": "object",
112
- "additionalProperties": {}
113
- },
114
- "description": "List of result items. Each item is an untyped record — shape varies per query."
115
- }
116
- },
117
- "required": [
118
- "action",
119
- "items"
120
- ],
121
- "additionalProperties": false
122
- },
123
- {
124
- "type": "object",
125
- "properties": {
126
- "action": {
127
- "type": "string",
128
- "const": "pre_publish_check"
129
- },
130
- "warnings": {
131
- "type": "array",
132
- "items": {
133
- "type": "string"
134
- },
135
- "description": "Pre-publish warnings. Empty array means no issues detected."
136
- }
137
- },
138
- "required": [
139
- "action",
140
- "warnings"
141
- ],
142
- "additionalProperties": false
143
- },
144
- {
145
- "type": "object",
146
- "properties": {
147
- "action": {
148
- "type": "string",
149
- "const": "cross_project_refs"
150
- },
151
- "items": {
152
- "type": "array",
153
- "items": {
154
- "type": "object",
155
- "additionalProperties": {}
156
- },
157
- "description": "List of result items. Each item is an untyped record — shape varies per query."
158
- }
159
- },
160
- "required": [
161
- "action",
162
- "items"
163
- ],
164
- "additionalProperties": false
165
- },
166
- {
167
- "type": "object",
168
- "properties": {
169
- "action": {
170
- "type": "string",
171
- "const": "graph_stats"
172
- },
173
- "stats": {
174
- "type": "object",
175
- "additionalProperties": {},
176
- "description": "Object dependency graph statistics (counts, depth, etc.)."
177
- }
178
- },
179
- "required": [
180
- "action",
181
- "stats"
182
- ],
183
- "additionalProperties": false
184
- },
185
- {
186
- "type": "object",
187
- "properties": {
188
- "action": {
189
- "type": "string",
190
- "const": "save_graph"
191
- },
192
- "saved": {
193
- "type": "boolean",
194
- "const": true,
195
- "description": "Always true — confirms the graph was saved."
196
- },
197
- "path": {
198
- "type": "string",
199
- "description": "Filesystem path where the graph was saved."
200
- }
201
- },
202
- "required": [
203
- "action",
204
- "saved",
205
- "path"
206
- ],
207
- "additionalProperties": false
208
- },
209
- {
210
- "type": "object",
211
- "properties": {
212
- "action": {
213
- "type": "string",
214
- "const": "load_graph"
215
- },
216
- "loaded": {
217
- "type": "boolean",
218
- "description": "Whether the graph was successfully loaded from disk."
219
- }
220
- },
221
- "required": [
222
- "action",
223
- "loaded"
224
- ],
225
- "additionalProperties": false
226
- },
227
- {
228
- "type": "object",
229
- "properties": {
230
- "action": {
231
- "type": "string",
232
- "const": "analyze_intent"
233
- },
234
- "intent_parsed": {
235
- "type": "object",
236
- "properties": {
237
- "primary_object": {
238
- "type": "string"
239
- },
240
- "secondary_objects": {
241
- "type": "array",
242
- "items": {
243
- "type": "string"
244
- }
245
- },
246
- "detected_scenes": {
247
- "type": "array",
248
- "items": {
249
- "type": "object",
250
- "properties": {
251
- "object": {
252
- "type": "string"
253
- },
254
- "scene_id": {
255
- "type": "string"
256
- }
257
- },
258
- "required": [
259
- "object",
260
- "scene_id"
261
- ],
262
- "additionalProperties": false
263
- }
264
- },
265
- "industry": {
266
- "type": "string"
267
- },
268
- "keyword_matches": {
269
- "type": "array",
270
- "items": {
271
- "type": "object",
272
- "properties": {
273
- "keyword": {
274
- "type": "string"
275
- },
276
- "category": {
277
- "type": "string"
278
- },
279
- "matched_objects": {
280
- "type": "array",
281
- "items": {
282
- "type": "string"
283
- }
284
- },
285
- "required_level": {
286
- "type": "string",
287
- "enum": [
288
- "R",
289
- "C",
290
- "OPTIONAL"
291
- ]
292
- },
293
- "match_count": {
294
- "type": "integer"
295
- }
296
- },
297
- "required": [
298
- "keyword",
299
- "category",
300
- "matched_objects",
301
- "required_level",
302
- "match_count"
303
- ],
304
- "additionalProperties": false
305
- }
306
- }
307
- },
308
- "required": [
309
- "primary_object",
310
- "secondary_objects",
311
- "detected_scenes",
312
- "industry",
313
- "keyword_matches"
314
- ],
315
- "additionalProperties": false
316
- },
317
- "puzzles": {
318
- "type": "object",
319
- "additionalProperties": {
320
- "type": "object",
321
- "properties": {
322
- "puzzle": {
323
- "type": "object",
324
- "additionalProperties": {},
325
- "description": "Per-object puzzle snapshot. Shape varies per object_type — see knowledge/<obj>-puzzle.ts."
326
- },
327
- "completeness": {
328
- "type": "object",
329
- "additionalProperties": {},
330
- "description": "Completeness assessment from checkPuzzleCompleteness(). Shape varies per object."
331
- },
332
- "missing_dimensions": {
333
- "type": "array",
334
- "items": {
335
- "type": "string"
336
- },
337
- "description": "Dimensions still missing for this object (e.g. ['A','B'])."
338
- }
339
- },
340
- "required": [
341
- "puzzle",
342
- "completeness",
343
- "missing_dimensions"
344
- ],
345
- "additionalProperties": false
346
- }
347
- },
348
- "overall_completeness": {
349
- "type": "string",
350
- "enum": [
351
- "complete",
352
- "partial",
353
- "empty"
354
- ]
355
- },
356
- "next_step": {
357
- "type": "string"
358
- },
359
- "recommended_creation_order": {
360
- "type": "array",
361
- "items": {
362
- "type": "string"
363
- },
364
- "description": "Recommended object creation order based on dependency topology (e.g. ['permission','progress','guard','allocation','machine','service'])."
365
- },
366
- "next_action": {
367
- "type": "string",
368
- "enum": [
369
- "aggregate_risks",
370
- "none"
371
- ],
372
- "description": "Next project_operation action to call. 'aggregate_risks' when puzzles are complete enough; 'none' if user must fill missing fields first."
373
- },
374
- "warnings": {
375
- "type": "array",
376
- "items": {
377
- "type": "string"
378
- }
379
- },
380
- "gate_validation": {
381
- "type": "object",
382
- "properties": {
383
- "stage": {
384
- "type": "integer",
385
- "minimum": 1,
386
- "maximum": 5
387
- },
388
- "passed": {
389
- "type": "boolean",
390
- "description": "True when no FAIL checks exist."
391
- },
392
- "checks": {
393
- "type": "array",
394
- "items": {
395
- "type": "object",
396
- "properties": {
397
- "dimension": {
398
- "type": "string",
399
- "enum": [
400
- "semantic",
401
- "tools",
402
- "reversibility",
403
- "risk",
404
- "isolation",
405
- "gas_budget"
406
- ]
407
- },
408
- "status": {
409
- "type": "string",
410
- "enum": [
411
- "PASS",
412
- "FAIL",
413
- "WARN"
414
- ]
415
- },
416
- "message": {
417
- "type": "string"
418
- }
419
- },
420
- "required": [
421
- "dimension",
422
- "status",
423
- "message"
424
- ],
425
- "additionalProperties": false
426
- }
427
- },
428
- "blocking_issues": {
429
- "type": "array",
430
- "items": {
431
- "type": "string"
432
- }
433
- },
434
- "warnings": {
435
- "type": "array",
436
- "items": {
437
- "type": "string"
438
- }
439
- },
440
- "can_proceed": {
441
- "type": "boolean"
442
- }
443
- },
444
- "required": [
445
- "stage",
446
- "passed",
447
- "checks",
448
- "blocking_issues",
449
- "warnings",
450
- "can_proceed"
451
- ],
452
- "additionalProperties": false,
453
- "description": "Stage gate validation result (6 dimensions: semantic/tools/reversibility/risk/isolation/gas_budget)."
454
- }
455
- },
456
- "required": [
457
- "action",
458
- "intent_parsed",
459
- "puzzles",
460
- "overall_completeness",
461
- "next_step",
462
- "recommended_creation_order",
463
- "next_action",
464
- "warnings"
465
- ],
466
- "additionalProperties": false
467
- },
468
- {
469
- "type": "object",
470
- "properties": {
471
- "action": {
472
- "type": "string",
473
- "const": "aggregate_risks"
474
- },
475
- "namespace": {
476
- "type": "object",
477
- "properties": {
478
- "prefix": {
479
- "type": "string"
480
- },
481
- "version": {
482
- "type": "string"
483
- },
484
- "industry": {
485
- "type": "string"
486
- }
487
- },
488
- "required": [
489
- "prefix",
490
- "version"
491
- ],
492
- "additionalProperties": false
493
- },
494
- "findings": {
495
- "type": "array",
496
- "items": {
497
- "type": "object",
498
- "properties": {
499
- "risk_rule_id": {
500
- "type": "string"
501
- },
502
- "object_type": {
503
- "type": "string"
504
- },
505
- "entry_id": {
506
- "type": "string"
507
- },
508
- "severity": {
509
- "type": "string",
510
- "enum": [
511
- "CRITICAL",
512
- "HIGH",
513
- "MEDIUM",
514
- "LOW",
515
- "INFO"
516
- ]
517
- },
518
- "message": {
519
- "type": "string"
520
- },
521
- "fix_suggestion": {
522
- "type": "string"
523
- },
524
- "details": {
525
- "type": "object",
526
- "properties": {
527
- "field_path": {
528
- "type": "string"
529
- },
530
- "rule_source": {
531
- "type": "string"
532
- }
533
- },
534
- "additionalProperties": false
535
- }
536
- },
537
- "required": [
538
- "risk_rule_id",
539
- "object_type",
540
- "entry_id",
541
- "severity",
542
- "message",
543
- "fix_suggestion"
544
- ],
545
- "additionalProperties": false
546
- }
547
- },
548
- "severity_summary": {
549
- "type": "object",
550
- "properties": {
551
- "CRITICAL": {
552
- "type": "integer"
553
- },
554
- "HIGH": {
555
- "type": "integer"
556
- },
557
- "MEDIUM": {
558
- "type": "integer"
559
- },
560
- "LOW": {
561
- "type": "integer"
562
- },
563
- "INFO": {
564
- "type": "integer"
565
- }
566
- },
567
- "required": [
568
- "CRITICAL",
569
- "HIGH",
570
- "MEDIUM",
571
- "LOW",
572
- "INFO"
573
- ],
574
- "additionalProperties": false
575
- },
576
- "status": {
577
- "type": "string",
578
- "enum": [
579
- "RISK_PASSED",
580
- "RISK_BLOCKED",
581
- "RISK_PENDING_CONFIRM",
582
- "RISK_CANCELLED"
583
- ]
584
- },
585
- "pending_confirmations": {
586
- "type": "array",
587
- "items": {
588
- "type": "object",
589
- "properties": {
590
- "risk_rule_id": {
591
- "type": "string"
592
- },
593
- "description": {
594
- "type": "string"
595
- },
596
- "fix_suggestion": {
597
- "type": "string"
598
- },
599
- "object_type": {
600
- "type": "string"
601
- },
602
- "entry_id": {
603
- "type": "string"
604
- }
605
- },
606
- "required": [
607
- "risk_rule_id",
608
- "description",
609
- "fix_suggestion",
610
- "object_type",
611
- "entry_id"
612
- ],
613
- "additionalProperties": false
614
- }
615
- },
616
- "fix_suggestions_grouped": {
617
- "type": "object",
618
- "additionalProperties": {
619
- "type": "array",
620
- "items": {
621
- "type": "object",
622
- "properties": {
623
- "risk_rule_id": {
624
- "type": "string"
625
- },
626
- "severity": {
627
- "type": "string",
628
- "enum": [
629
- "CRITICAL",
630
- "HIGH",
631
- "MEDIUM",
632
- "LOW",
633
- "INFO"
634
- ]
635
- },
636
- "message": {
637
- "type": "string"
638
- },
639
- "fix_suggestion": {
640
- "type": "string"
641
- },
642
- "entry_id": {
643
- "type": "string"
644
- }
645
- },
646
- "required": [
647
- "risk_rule_id",
648
- "severity",
649
- "message",
650
- "fix_suggestion",
651
- "entry_id"
652
- ],
653
- "additionalProperties": false
654
- }
655
- },
656
- "description": "Fix suggestions grouped by object_type for better readability."
657
- },
658
- "calibrated_at": {
659
- "type": "integer"
660
- },
661
- "warnings": {
662
- "type": "array",
663
- "items": {
664
- "type": "string"
665
- }
666
- },
667
- "can_proceed": {
668
- "type": "boolean",
669
- "description": "Whether the user can proceed to the next stage. False only when CRITICAL risks exist."
670
- },
671
- "next_action": {
672
- "type": "string",
673
- "enum": [
674
- "generate_deployment_doc",
675
- "fix_risks",
676
- "none"
677
- ],
678
- "description": "Next project_operation action. 'generate_deployment_doc' when can_proceed=true; 'fix_risks' when CRITICAL risks exist; 'none' for other cases."
679
- },
680
- "user_action_required": {
681
- "type": "string",
682
- "description": "Human-readable next-step guidance."
683
- },
684
- "gate_validation": {
685
- "$ref": "#/definitions/project_operation/properties/result/anyOf/10/properties/gate_validation"
686
- }
687
- },
688
- "required": [
689
- "action",
690
- "namespace",
691
- "findings",
692
- "severity_summary",
693
- "status",
694
- "calibrated_at",
695
- "warnings",
696
- "can_proceed",
697
- "next_action",
698
- "user_action_required"
699
- ],
700
- "additionalProperties": false
701
- },
702
- {
703
- "type": "object",
704
- "properties": {
705
- "action": {
706
- "type": "string",
707
- "const": "generate_deployment_doc"
708
- },
709
- "markdown": {
710
- "type": "string",
711
- "description": "Complete deployment MD document (§0-§7)"
712
- },
713
- "meta": {
714
- "type": "object",
715
- "properties": {
716
- "project_prefix": {
717
- "type": "string"
718
- },
719
- "version": {
720
- "type": "string"
721
- },
722
- "generated_at": {
723
- "type": "string",
724
- "description": "ISO timestamp"
725
- },
726
- "object_count": {
727
- "type": "integer"
728
- },
729
- "step_count": {
730
- "type": "integer"
731
- }
732
- },
733
- "required": [
734
- "project_prefix",
735
- "version",
736
- "generated_at",
737
- "object_count",
738
- "step_count"
739
- ],
740
- "additionalProperties": false
741
- },
742
- "validation": {
743
- "type": "object",
744
- "properties": {
745
- "valid": {
746
- "type": "boolean"
747
- },
748
- "checks": {
749
- "type": "array",
750
- "items": {
751
- "type": "object",
752
- "properties": {
753
- "check_id": {
754
- "type": "string"
755
- },
756
- "description": {
757
- "type": "string"
758
- },
759
- "status": {
760
- "type": "string",
761
- "enum": [
762
- "PASS",
763
- "FAIL",
764
- "WARN"
765
- ]
766
- },
767
- "notes": {
768
- "type": "string"
769
- }
770
- },
771
- "required": [
772
- "check_id",
773
- "description",
774
- "status"
775
- ],
776
- "additionalProperties": false
777
- }
778
- },
779
- "errors": {
780
- "type": "array",
781
- "items": {
782
- "type": "string"
783
- }
784
- }
785
- },
786
- "required": [
787
- "valid",
788
- "checks",
789
- "errors"
790
- ],
791
- "additionalProperties": false,
792
- "description": "Scanner validation result. Present when run_scanner=true."
793
- },
794
- "estimated_gas": {
795
- "type": "object",
796
- "properties": {
797
- "total_gas_mist": {
798
- "type": "integer",
799
- "description": "Estimated total gas in MIST (1 WOW = 10^9 MIST)."
800
- },
801
- "per_object": {
802
- "type": "array",
803
- "items": {
804
- "type": "object",
805
- "properties": {
806
- "entry_id": {
807
- "type": "string"
808
- },
809
- "object_type": {
810
- "type": "string"
811
- },
812
- "create_gas_mist": {
813
- "type": "integer"
814
- },
815
- "publish_gas_mist": {
816
- "type": "integer"
817
- }
818
- },
819
- "required": [
820
- "entry_id",
821
- "object_type",
822
- "create_gas_mist",
823
- "publish_gas_mist"
824
- ],
825
- "additionalProperties": false
826
- }
827
- },
828
- "publish_gas_mist": {
829
- "type": "integer",
830
- "description": "Gas for publish operations only."
831
- }
832
- },
833
- "required": [
834
- "total_gas_mist",
835
- "per_object",
836
- "publish_gas_mist"
837
- ],
838
- "additionalProperties": false,
839
- "description": "Gas cost estimate for deploying all objects."
840
- },
841
- "persisted": {
842
- "type": "object",
843
- "properties": {
844
- "all_files": {
845
- "type": "array",
846
- "items": {
847
- "type": "string"
848
- },
849
- "description": "Project-relative paths of all generated files (27 total)."
850
- },
851
- "all_stages_passed": {
852
- "type": "boolean",
853
- "description": "Whether all 5 stage gates passed validation."
854
- }
855
- },
856
- "required": [
857
- "all_files",
858
- "all_stages_passed"
859
- ],
860
- "additionalProperties": false,
861
- "description": "Nested-autonomy doc set persistence result (§11). Present when the doc set was successfully written to disk."
862
- },
863
- "can_proceed": {
864
- "type": "boolean",
865
- "description": "Whether the user can proceed to stage 5. False when D-errors exist."
866
- },
867
- "next_action": {
868
- "type": "string",
869
- "enum": [
870
- "trace_substeps",
871
- "fix_doc_errors",
872
- "none"
873
- ],
874
- "description": "Next project_operation action. 'trace_substeps' when can_proceed=true; 'fix_doc_errors' when D-errors exist; 'none' for other cases."
875
- },
876
- "user_action_required": {
877
- "type": "string"
878
- },
879
- "gate_validation": {
880
- "$ref": "#/definitions/project_operation/properties/result/anyOf/10/properties/gate_validation"
881
- }
882
- },
883
- "required": [
884
- "action",
885
- "markdown",
886
- "meta",
887
- "can_proceed",
888
- "next_action",
889
- "user_action_required"
890
- ],
891
- "additionalProperties": false
892
- },
893
- {
894
- "type": "object",
895
- "properties": {
896
- "action": {
897
- "type": "string",
898
- "const": "trace_substeps"
899
- },
900
- "namespace": {
901
- "type": "object",
902
- "properties": {
903
- "prefix": {
904
- "type": "string"
905
- },
906
- "version": {
907
- "type": "string"
908
- }
909
- },
910
- "required": [
911
- "prefix",
912
- "version"
913
- ],
914
- "additionalProperties": false
915
- },
916
- "network": {
917
- "type": "string",
918
- "enum": [
919
- "testnet",
920
- "mainnet"
921
- ]
922
- },
923
- "coherent": {
924
- "type": "boolean",
925
- "description": "True when no dangling/circular/missing/cross-step issues."
926
- },
927
- "dangling_inputs": {
928
- "type": "array",
929
- "items": {
930
- "type": "object",
931
- "properties": {
932
- "substep_id": {
933
- "type": "string"
934
- },
935
- "missing_ref": {
936
- "type": "string"
937
- },
938
- "field_path": {
939
- "type": "string"
940
- }
941
- },
942
- "required": [
943
- "substep_id",
944
- "missing_ref",
945
- "field_path"
946
- ],
947
- "additionalProperties": false
948
- }
949
- },
950
- "circular_refs": {
951
- "type": "array",
952
- "items": {
953
- "type": "object",
954
- "properties": {
955
- "cycle": {
956
- "type": "array",
957
- "items": {
958
- "type": "string"
959
- }
960
- }
961
- },
962
- "required": [
963
- "cycle"
964
- ],
965
- "additionalProperties": false
966
- }
967
- },
968
- "missing_outputs": {
969
- "type": "array",
970
- "items": {
971
- "type": "object",
972
- "properties": {
973
- "substep_id": {
974
- "type": "string"
975
- },
976
- "expected_field": {
977
- "type": "string"
978
- },
979
- "dependent_substeps": {
980
- "type": "array",
981
- "items": {
982
- "type": "string"
983
- }
984
- }
985
- },
986
- "required": [
987
- "substep_id",
988
- "expected_field",
989
- "dependent_substeps"
990
- ],
991
- "additionalProperties": false
992
- }
993
- },
994
- "cross_step_breaks": {
995
- "type": "array",
996
- "items": {
997
- "type": "object",
998
- "properties": {
999
- "source_step": {
1000
- "type": "string"
1001
- },
1002
- "target_step": {
1003
- "type": "string"
1004
- },
1005
- "missing_field": {
1006
- "type": "string"
1007
- }
1008
- },
1009
- "required": [
1010
- "source_step",
1011
- "target_step",
1012
- "missing_field"
1013
- ],
1014
- "additionalProperties": false
1015
- }
1016
- },
1017
- "step_details": {
1018
- "type": "array",
1019
- "items": {
1020
- "type": "object",
1021
- "properties": {
1022
- "parent_step": {
1023
- "type": "string"
1024
- },
1025
- "total_substeps": {
1026
- "type": "integer"
1027
- },
1028
- "successful": {
1029
- "type": "integer"
1030
- },
1031
- "failed": {
1032
- "type": "integer"
1033
- },
1034
- "pending": {
1035
- "type": "integer"
1036
- },
1037
- "skipped": {
1038
- "type": "integer"
1039
- },
1040
- "substep_ids": {
1041
- "type": "array",
1042
- "items": {
1043
- "type": "string"
1044
- }
1045
- }
1046
- },
1047
- "required": [
1048
- "parent_step",
1049
- "total_substeps",
1050
- "successful",
1051
- "failed",
1052
- "pending",
1053
- "skipped",
1054
- "substep_ids"
1055
- ],
1056
- "additionalProperties": false
1057
- }
1058
- },
1059
- "topological_order": {
1060
- "type": "array",
1061
- "items": {
1062
- "type": "string"
1063
- }
1064
- },
1065
- "d10_check": {
1066
- "type": "object",
1067
- "properties": {
1068
- "check_id": {
1069
- "type": "string",
1070
- "const": "D-10"
1071
- },
1072
- "description": {
1073
- "type": "string"
1074
- },
1075
- "status": {
1076
- "type": "string",
1077
- "enum": [
1078
- "PASS",
1079
- "FAIL",
1080
- "WARN"
1081
- ]
1082
- }
1083
- },
1084
- "required": [
1085
- "check_id",
1086
- "description",
1087
- "status"
1088
- ],
1089
- "additionalProperties": false
1090
- },
1091
- "can_proceed": {
1092
- "type": "boolean",
1093
- "description": "Whether deployment can complete. False when D-10 fails or substeps FAILED."
1094
- },
1095
- "next_action": {
1096
- "type": "string",
1097
- "enum": [
1098
- "deploy",
1099
- "fix_substeps",
1100
- "none"
1101
- ],
1102
- "description": "Next action. 'deploy' when can_proceed=true (execute substeps via onchain_operations); 'fix_substeps' when issues exist; 'none' when done."
1103
- },
1104
- "user_action_required": {
1105
- "type": "string"
1106
- },
1107
- "gate_validation": {
1108
- "$ref": "#/definitions/project_operation/properties/result/anyOf/10/properties/gate_validation"
1109
- }
1110
- },
1111
- "required": [
1112
- "action",
1113
- "namespace",
1114
- "network",
1115
- "coherent",
1116
- "dangling_inputs",
1117
- "circular_refs",
1118
- "missing_outputs",
1119
- "cross_step_breaks",
1120
- "step_details",
1121
- "topological_order",
1122
- "d10_check",
1123
- "can_proceed",
1124
- "next_action",
1125
- "user_action_required"
1126
- ],
1127
- "additionalProperties": false
1128
- },
1129
- {
1130
- "type": "object",
1131
- "properties": {
1132
- "action": {
1133
- "type": "string",
1134
- "const": "get_project_status"
1135
- },
1136
- "project": {
1137
- "type": "string"
1138
- },
1139
- "version": {
1140
- "type": "string"
1141
- },
1142
- "stage": {
1143
- "type": "integer",
1144
- "minimum": 1,
1145
- "maximum": 5
1146
- },
1147
- "stage_name": {
1148
- "type": "string"
1149
- },
1150
- "stage_description": {
1151
- "type": "string"
1152
- },
1153
- "next_action": {
1154
- "type": "string",
1155
- "description": "The next project_operation action to call."
1156
- },
1157
- "can_proceed": {
1158
- "type": "boolean"
1159
- },
1160
- "last_updated": {
1161
- "type": "integer",
1162
- "description": "Timestamp of last stage update (ms)."
1163
- },
1164
- "risk_status": {
1165
- "type": "string"
1166
- },
1167
- "risk_can_proceed": {
1168
- "type": "boolean"
1169
- },
1170
- "doc_generated": {
1171
- "type": "boolean"
1172
- },
1173
- "trace_coherent": {
1174
- "type": "boolean"
1175
- }
1176
- },
1177
- "required": [
1178
- "action",
1179
- "project",
1180
- "version",
1181
- "stage",
1182
- "stage_name",
1183
- "stage_description",
1184
- "next_action",
1185
- "can_proceed"
1186
- ],
1187
- "additionalProperties": false
1188
- },
1189
- {
1190
- "type": "object",
1191
- "properties": {
1192
- "action": {
1193
- "type": "string",
1194
- "const": "load_project"
1195
- },
1196
- "items": {
1197
- "type": "array",
1198
- "items": {
1199
- "type": "object",
1200
- "properties": {
1201
- "prefix": {
1202
- "type": "string"
1203
- },
1204
- "version": {
1205
- "type": "string"
1206
- },
1207
- "dir_name": {
1208
- "type": "string"
1209
- },
1210
- "initialized": {
1211
- "type": "boolean"
1212
- },
1213
- "archived": {
1214
- "type": "boolean"
1215
- },
1216
- "needs_migration": {
1217
- "type": "boolean",
1218
- "description": "Whether schema_version differs from current."
1219
- },
1220
- "forked_from": {
1221
- "type": "string"
1222
- },
1223
- "chain_exists": {
1224
- "type": "boolean",
1225
- "description": "Whether the project prefix exists on-chain."
1226
- },
1227
- "sync_status": {
1228
- "type": "string",
1229
- "enum": [
1230
- "synced",
1231
- "local_only",
1232
- "archived",
1233
- "uninitialized"
1234
- ],
1235
- "description": "Cross-validation of local filesystem vs chain truth."
1236
- }
1237
- },
1238
- "required": [
1239
- "prefix",
1240
- "version",
1241
- "dir_name",
1242
- "initialized",
1243
- "archived",
1244
- "needs_migration",
1245
- "chain_exists",
1246
- "sync_status"
1247
- ],
1248
- "additionalProperties": false
1249
- }
1250
- },
1251
- "total": {
1252
- "type": "integer"
1253
- },
1254
- "project": {
1255
- "type": "string"
1256
- },
1257
- "version": {
1258
- "type": "string"
1259
- },
1260
- "local_exists": {
1261
- "type": "boolean"
1262
- },
1263
- "manifest": {
1264
- "type": "object",
1265
- "properties": {
1266
- "schema_version": {
1267
- "type": "string"
1268
- },
1269
- "mcp_version": {
1270
- "type": "string"
1271
- },
1272
- "prefix": {
1273
- "type": "string"
1274
- },
1275
- "version": {
1276
- "type": "string"
1277
- },
1278
- "created_at": {
1279
- "type": "string"
1280
- },
1281
- "updated_at": {
1282
- "type": "string"
1283
- },
1284
- "forked_from": {
1285
- "type": "string"
1286
- },
1287
- "needs_recalibration": {
1288
- "type": "boolean"
1289
- }
1290
- },
1291
- "required": [
1292
- "schema_version",
1293
- "mcp_version",
1294
- "prefix",
1295
- "version",
1296
- "created_at",
1297
- "updated_at"
1298
- ],
1299
- "additionalProperties": false
1300
- },
1301
- "stage_state": {
1302
- "type": "object",
1303
- "properties": {
1304
- "stage": {
1305
- "type": "integer",
1306
- "minimum": 1,
1307
- "maximum": 5
1308
- },
1309
- "updated_at": {
1310
- "type": "integer"
1311
- },
1312
- "has_published_object": {
1313
- "type": "boolean"
1314
- },
1315
- "archived": {
1316
- "type": "boolean"
1317
- }
1318
- },
1319
- "additionalProperties": false
1320
- },
1321
- "sync_status": {
1322
- "type": "object",
1323
- "properties": {
1324
- "local_exists": {
1325
- "type": "boolean"
1326
- },
1327
- "initialized": {
1328
- "type": "boolean"
1329
- },
1330
- "needs_migration": {
1331
- "type": "boolean"
1332
- },
1333
- "archived": {
1334
- "type": "boolean"
1335
- }
1336
- },
1337
- "required": [
1338
- "local_exists",
1339
- "initialized",
1340
- "needs_migration",
1341
- "archived"
1342
- ],
1343
- "additionalProperties": false
1344
- },
1345
- "migration": {
1346
- "type": "object",
1347
- "properties": {
1348
- "migrated": {
1349
- "type": "boolean",
1350
- "description": "Whether a migration was performed."
1351
- },
1352
- "from_version": {
1353
- "type": "string"
1354
- },
1355
- "to_version": {
1356
- "type": "string"
1357
- },
1358
- "steps_executed": {
1359
- "type": "array",
1360
- "items": {
1361
- "type": "string"
1362
- }
1363
- },
1364
- "backup_path": {
1365
- "type": "string"
1366
- },
1367
- "needs_recalibration": {
1368
- "type": "boolean"
1369
- },
1370
- "message": {
1371
- "type": "string"
1372
- }
1373
- },
1374
- "required": [
1375
- "migrated",
1376
- "from_version",
1377
- "to_version",
1378
- "steps_executed",
1379
- "needs_recalibration",
1380
- "message"
1381
- ],
1382
- "additionalProperties": false
1383
- },
1384
- "message": {
1385
- "type": "string"
1386
- }
1387
- },
1388
- "required": [
1389
- "action"
1390
- ],
1391
- "additionalProperties": false
1392
- },
1393
- {
1394
- "type": "object",
1395
- "properties": {
1396
- "action": {
1397
- "type": "string",
1398
- "const": "fork_project"
1399
- },
1400
- "new_prefix": {
1401
- "type": "string"
1402
- },
1403
- "new_version": {
1404
- "type": "string"
1405
- },
1406
- "new_path": {
1407
- "type": "string",
1408
- "description": "Absolute filesystem path of the new project directory."
1409
- },
1410
- "forked_from": {
1411
- "type": "string",
1412
- "description": "Absolute path of the source project directory."
1413
- },
1414
- "copied_files": {
1415
- "type": "array",
1416
- "items": {
1417
- "type": "string"
1418
- },
1419
- "description": "Project-relative paths of copied files (excludes stage.json + audit.jsonl)."
1420
- },
1421
- "copied_file_count": {
1422
- "type": "integer"
1423
- },
1424
- "warning": {
1425
- "type": "string",
1426
- "description": "Project isolation notice — forked project must re-create its own objects."
1427
- },
1428
- "next_action": {
1429
- "type": "string",
1430
- "const": "analyze_intent",
1431
- "description": "The forked project starts at stage 2 (analyze_intent)."
1432
- }
1433
- },
1434
- "required": [
1435
- "action",
1436
- "new_prefix",
1437
- "new_version",
1438
- "new_path",
1439
- "forked_from",
1440
- "copied_files",
1441
- "copied_file_count",
1442
- "warning",
1443
- "next_action"
1444
- ],
1445
- "additionalProperties": false
1446
- },
1447
- {
1448
- "type": "object",
1449
- "properties": {
1450
- "action": {
1451
- "type": "string",
1452
- "const": "export_project"
1453
- },
1454
- "project": {
1455
- "type": "string"
1456
- },
1457
- "version": {
1458
- "type": "string"
1459
- },
1460
- "files": {
1461
21
  "type": "array",
1462
22
  "items": {
1463
23
  "type": "object",
1464
24
  "properties": {
1465
- "path": {
25
+ "id": {
1466
26
  "type": "string",
1467
- "description": "Project-relative file path."
1468
- },
1469
- "size": {
1470
- "type": "integer",
1471
- "description": "File size in bytes."
27
+ "description": "Project UUID."
1472
28
  },
1473
- "kind": {
29
+ "prefix": {
1474
30
  "type": "string",
1475
- "enum": [
1476
- "json",
1477
- "markdown",
1478
- "jsonl",
1479
- "other"
1480
- ]
31
+ "description": "Human-readable unique prefix."
1481
32
  },
1482
- "content": {
1483
- "type": "string",
1484
- "description": "File content (text)."
1485
- }
1486
- },
1487
- "required": [
1488
- "path",
1489
- "size",
1490
- "kind",
1491
- "content"
1492
- ],
1493
- "additionalProperties": false
1494
- }
1495
- },
1496
- "total_files": {
1497
- "type": "integer"
1498
- }
1499
- },
1500
- "required": [
1501
- "action",
1502
- "project",
1503
- "version",
1504
- "files",
1505
- "total_files"
1506
- ],
1507
- "additionalProperties": false
1508
- },
1509
- {
1510
- "type": "object",
1511
- "properties": {
1512
- "action": {
1513
- "type": "string",
1514
- "const": "get_project_files"
1515
- },
1516
- "project": {
1517
- "type": "string"
1518
- },
1519
- "version": {
1520
- "type": "string"
1521
- },
1522
- "files": {
1523
- "type": "array",
1524
- "items": {
1525
- "type": "object",
1526
- "properties": {
1527
- "path": {
33
+ "name": {
1528
34
  "type": "string",
1529
- "description": "Project-relative file path."
35
+ "description": "Display name."
36
+ },
37
+ "description": {
38
+ "type": [
39
+ "string",
40
+ "null"
41
+ ]
1530
42
  },
1531
- "size": {
1532
- "type": "integer",
1533
- "description": "File size in bytes."
43
+ "industry": {
44
+ "type": [
45
+ "string",
46
+ "null"
47
+ ]
1534
48
  },
1535
- "kind": {
49
+ "perspective": {
1536
50
  "type": "string",
1537
51
  "enum": [
1538
- "json",
1539
- "markdown",
1540
- "jsonl",
1541
- "other"
52
+ "producer",
53
+ "consumer",
54
+ "both"
1542
55
  ]
1543
56
  },
1544
- "mtime": {
1545
- "type": "integer",
1546
- "description": "Last modified time (ms)."
1547
- }
1548
- },
1549
- "required": [
1550
- "path",
1551
- "size",
1552
- "kind",
1553
- "mtime"
1554
- ],
1555
- "additionalProperties": false
1556
- }
1557
- },
1558
- "total_files": {
1559
- "type": "integer"
1560
- }
1561
- },
1562
- "required": [
1563
- "action",
1564
- "project",
1565
- "version",
1566
- "files",
1567
- "total_files"
1568
- ],
1569
- "additionalProperties": false
1570
- },
1571
- {
1572
- "type": "object",
1573
- "properties": {
1574
- "action": {
1575
- "type": "string",
1576
- "const": "validate_stage_unit"
1577
- },
1578
- "project": {
1579
- "type": "string"
1580
- },
1581
- "version": {
1582
- "type": "string"
1583
- },
1584
- "stage": {
1585
- "type": "integer",
1586
- "minimum": 1,
1587
- "maximum": 5
1588
- },
1589
- "valid": {
1590
- "type": "boolean",
1591
- "description": "True when all 4 stage unit files exist and pass consistency checks."
1592
- },
1593
- "missing_files": {
1594
- "type": "array",
1595
- "items": {
1596
- "type": "string"
1597
- },
1598
- "description": "Project-relative paths of missing stage unit files (empty if all present)."
1599
- },
1600
- "checks": {
1601
- "type": "array",
1602
- "items": {
1603
- "type": "object",
1604
- "properties": {
1605
- "check_id": {
1606
- "type": "string"
1607
- },
1608
57
  "status": {
1609
58
  "type": "string",
1610
59
  "enum": [
1611
- "pass",
1612
- "fail",
1613
- "warn"
60
+ "draft",
61
+ "active",
62
+ "inactive",
63
+ "archived"
1614
64
  ]
1615
65
  },
1616
- "message": {
1617
- "type": "string"
1618
- }
1619
- },
1620
- "required": [
1621
- "check_id",
1622
- "status",
1623
- "message"
1624
- ],
1625
- "additionalProperties": false
1626
- }
1627
- },
1628
- "blocking_issues": {
1629
- "type": "array",
1630
- "items": {
1631
- "type": "string"
1632
- }
1633
- },
1634
- "stage_passed": {
1635
- "type": "boolean",
1636
- "description": "From verification.json stage_passed field (undefined if file missing)."
1637
- }
1638
- },
1639
- "required": [
1640
- "action",
1641
- "project",
1642
- "version",
1643
- "stage",
1644
- "valid",
1645
- "missing_files",
1646
- "checks",
1647
- "blocking_issues"
1648
- ],
1649
- "additionalProperties": false
1650
- },
1651
- {
1652
- "type": "object",
1653
- "properties": {
1654
- "action": {
1655
- "type": "string",
1656
- "const": "get_stage_assessment"
1657
- },
1658
- "project": {
1659
- "type": "string"
1660
- },
1661
- "version": {
1662
- "type": "string"
1663
- },
1664
- "stage": {
1665
- "type": "integer",
1666
- "minimum": 1,
1667
- "maximum": 5
1668
- },
1669
- "found": {
1670
- "type": "boolean"
1671
- },
1672
- "assessment": {
1673
- "type": "object",
1674
- "properties": {
1675
- "stage": {
1676
- "type": "integer",
1677
- "minimum": 1,
1678
- "maximum": 5
1679
- },
1680
- "assessed_at": {
1681
- "type": "integer"
1682
- },
1683
- "goal_completion": {
1684
- "type": "object",
1685
- "additionalProperties": {
1686
- "type": "number"
1687
- }
1688
- },
1689
- "findings": {
1690
- "type": "array",
1691
- "items": {
1692
- "type": "object",
1693
- "properties": {
1694
- "finding_id": {
1695
- "type": "string"
1696
- },
1697
- "severity": {
1698
- "type": "string",
1699
- "enum": [
1700
- "info",
1701
- "warn",
1702
- "critical"
1703
- ]
1704
- },
1705
- "criterion_id": {
1706
- "type": "string"
1707
- },
1708
- "description": {
1709
- "type": "string"
1710
- },
1711
- "evidence": {}
1712
- },
1713
- "required": [
1714
- "finding_id",
1715
- "severity",
1716
- "criterion_id",
1717
- "description"
1718
- ],
1719
- "additionalProperties": false
1720
- }
1721
- },
1722
- "recommendations": {
1723
- "type": "array",
1724
- "items": {
1725
- "type": "string"
1726
- }
1727
- }
1728
- },
1729
- "required": [
1730
- "stage",
1731
- "assessed_at",
1732
- "goal_completion",
1733
- "findings",
1734
- "recommendations"
1735
- ],
1736
- "additionalProperties": false,
1737
- "description": "The stage assessment object (from assessment.json)."
1738
- }
1739
- },
1740
- "required": [
1741
- "action",
1742
- "project",
1743
- "version",
1744
- "stage",
1745
- "found"
1746
- ],
1747
- "additionalProperties": false
1748
- },
1749
- {
1750
- "type": "object",
1751
- "properties": {
1752
- "action": {
1753
- "type": "string",
1754
- "const": "get_stage_risk_policy"
1755
- },
1756
- "project": {
1757
- "type": "string"
1758
- },
1759
- "version": {
1760
- "type": "string"
1761
- },
1762
- "stage": {
1763
- "type": "integer",
1764
- "minimum": 1,
1765
- "maximum": 5
1766
- },
1767
- "found": {
1768
- "type": "boolean"
1769
- },
1770
- "risk_policy": {
1771
- "type": "object",
1772
- "properties": {
1773
- "stage": {
1774
- "type": "integer",
1775
- "minimum": 1,
1776
- "maximum": 5
1777
- },
1778
- "risks": {
1779
- "type": "array",
1780
- "items": {
1781
- "type": "object",
1782
- "properties": {
1783
- "risk_id": {
1784
- "type": "string"
1785
- },
1786
- "category": {
1787
- "type": "string",
1788
- "enum": [
1789
- "naming",
1790
- "dependency",
1791
- "operational",
1792
- "financial",
1793
- "security"
1794
- ]
1795
- },
1796
- "description": {
1797
- "type": "string"
1798
- },
1799
- "likelihood": {
1800
- "type": "string",
1801
- "enum": [
1802
- "low",
1803
- "medium",
1804
- "high"
1805
- ]
1806
- },
1807
- "impact": {
1808
- "type": "string",
1809
- "enum": [
1810
- "low",
1811
- "medium",
1812
- "high",
1813
- "critical"
1814
- ]
1815
- },
1816
- "mitigation": {
1817
- "type": "string"
66
+ "labels": {
67
+ "anyOf": [
68
+ {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "string"
72
+ }
1818
73
  },
1819
- "owner": {
1820
- "type": "string",
1821
- "enum": [
1822
- "ai",
1823
- "user",
1824
- "system"
1825
- ]
74
+ {
75
+ "type": "null"
1826
76
  }
1827
- },
1828
- "required": [
1829
- "risk_id",
1830
- "category",
1831
- "description",
1832
- "likelihood",
1833
- "impact",
1834
- "mitigation",
1835
- "owner"
77
+ ]
78
+ },
79
+ "currentVersion": {
80
+ "type": [
81
+ "string",
82
+ "null"
1836
83
  ],
1837
- "additionalProperties": false
1838
- }
1839
- },
1840
- "active_controls": {
1841
- "type": "array",
1842
- "items": {
1843
- "type": "object",
1844
- "properties": {
1845
- "control_id": {
1846
- "type": "string"
1847
- },
1848
- "control_type": {
1849
- "type": "string",
1850
- "enum": [
1851
- "preventive",
1852
- "detective",
1853
- "corrective"
1854
- ]
1855
- },
1856
- "target_risk": {
1857
- "type": "string"
1858
- },
1859
- "implementation": {
1860
- "type": "string"
84
+ "description": "Current version tag (e.g. 'v1')."
85
+ },
86
+ "serviceAddress": {
87
+ "type": [
88
+ "string",
89
+ "null"
90
+ ],
91
+ "description": "Core Service on-chain address (producer projects)."
92
+ },
93
+ "defaultAccount": {
94
+ "type": [
95
+ "string",
96
+ "null"
97
+ ]
98
+ },
99
+ "network": {
100
+ "type": "string",
101
+ "description": "Network the project is bound to."
102
+ },
103
+ "createdAt": {
104
+ "type": "number"
105
+ },
106
+ "updatedAt": {
107
+ "type": "number"
108
+ },
109
+ "metadata": {
110
+ "anyOf": [
111
+ {
112
+ "type": "object",
113
+ "additionalProperties": {}
1861
114
  },
1862
- "verified": {
1863
- "type": "boolean"
115
+ {
116
+ "type": "null"
1864
117
  }
1865
- },
1866
- "required": [
1867
- "control_id",
1868
- "control_type",
1869
- "target_risk",
1870
- "implementation",
1871
- "verified"
1872
118
  ],
1873
- "additionalProperties": false
119
+ "description": "Arbitrary metadata key-value pairs or null."
120
+ },
121
+ "objectCount": {
122
+ "type": "number",
123
+ "description": "Number of objects in this project (from project_objects table)."
124
+ },
125
+ "evaluationCount": {
126
+ "type": "number",
127
+ "description": "Number of stored evaluations for this project (from evaluations table)."
128
+ },
129
+ "objectTypes": {
130
+ "type": "array",
131
+ "items": {
132
+ "type": "string"
133
+ },
134
+ "description": "Distinct object types in this project (e.g. ['Service','Machine'])."
1874
135
  }
1875
136
  },
1876
- "residual_risks": {
1877
- "type": "array",
1878
- "items": {
1879
- "type": "string"
1880
- }
137
+ "required": [
138
+ "id",
139
+ "prefix",
140
+ "name",
141
+ "description",
142
+ "industry",
143
+ "perspective",
144
+ "status",
145
+ "labels",
146
+ "currentVersion",
147
+ "serviceAddress",
148
+ "defaultAccount",
149
+ "network",
150
+ "createdAt",
151
+ "updatedAt",
152
+ "metadata",
153
+ "objectCount",
154
+ "evaluationCount",
155
+ "objectTypes"
156
+ ],
157
+ "additionalProperties": false
158
+ },
159
+ "description": "GLM6 projects from SQLite (first-class entities, with object summary)."
160
+ },
161
+ "total": {
162
+ "type": "number",
163
+ "description": "Total number of projects returned."
164
+ }
165
+ },
166
+ "required": [
167
+ "action",
168
+ "items",
169
+ "total"
170
+ ],
171
+ "additionalProperties": false
172
+ },
173
+ {
174
+ "type": "object",
175
+ "properties": {
176
+ "action": {
177
+ "type": "string",
178
+ "const": "create_project"
179
+ },
180
+ "project": {
181
+ "type": "object",
182
+ "properties": {
183
+ "id": {
184
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/id"
185
+ },
186
+ "prefix": {
187
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/prefix"
188
+ },
189
+ "name": {
190
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/name"
191
+ },
192
+ "description": {
193
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/description"
194
+ },
195
+ "industry": {
196
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/industry"
197
+ },
198
+ "perspective": {
199
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/perspective"
200
+ },
201
+ "status": {
202
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/status"
203
+ },
204
+ "labels": {
205
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/labels"
206
+ },
207
+ "currentVersion": {
208
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/currentVersion"
209
+ },
210
+ "serviceAddress": {
211
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/serviceAddress"
212
+ },
213
+ "defaultAccount": {
214
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/defaultAccount"
215
+ },
216
+ "network": {
217
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/network"
218
+ },
219
+ "createdAt": {
220
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/createdAt"
221
+ },
222
+ "updatedAt": {
223
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/updatedAt"
224
+ },
225
+ "metadata": {
226
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/metadata"
1881
227
  }
1882
228
  },
1883
229
  "required": [
1884
- "stage",
1885
- "risks",
1886
- "active_controls",
1887
- "residual_risks"
230
+ "id",
231
+ "prefix",
232
+ "name",
233
+ "description",
234
+ "industry",
235
+ "perspective",
236
+ "status",
237
+ "labels",
238
+ "currentVersion",
239
+ "serviceAddress",
240
+ "defaultAccount",
241
+ "network",
242
+ "createdAt",
243
+ "updatedAt",
244
+ "metadata"
1888
245
  ],
1889
246
  "additionalProperties": false,
1890
- "description": "The stage risk policy object (from risk-policy.json)."
247
+ "description": "The created project."
1891
248
  }
1892
249
  },
1893
250
  "required": [
1894
251
  "action",
1895
- "project",
1896
- "version",
1897
- "stage",
1898
- "found"
252
+ "project"
1899
253
  ],
1900
254
  "additionalProperties": false
1901
255
  },
@@ -1904,227 +258,173 @@
1904
258
  "properties": {
1905
259
  "action": {
1906
260
  "type": "string",
1907
- "const": "get_doc_relations"
261
+ "const": "create_project_from_onchain"
1908
262
  },
1909
263
  "project": {
1910
- "type": "string"
1911
- },
1912
- "version": {
1913
- "type": "string"
1914
- },
1915
- "found": {
1916
- "type": "boolean"
1917
- },
1918
- "relations": {
1919
264
  "type": "object",
1920
265
  "properties": {
1921
- "version": {
1922
- "type": "string"
266
+ "id": {
267
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/id"
1923
268
  },
1924
- "generated_at": {
1925
- "type": "integer"
269
+ "prefix": {
270
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/prefix"
1926
271
  },
1927
- "project_invariants": {
1928
- "type": "array",
1929
- "items": {
1930
- "type": "object",
1931
- "properties": {
1932
- "invariant_id": {
1933
- "type": "string"
1934
- },
1935
- "description": {
1936
- "type": "string"
1937
- },
1938
- "verified_by_stages": {
1939
- "type": "array",
1940
- "items": {
1941
- "type": "integer"
1942
- }
1943
- }
1944
- },
1945
- "required": [
1946
- "invariant_id",
1947
- "description",
1948
- "verified_by_stages"
1949
- ],
1950
- "additionalProperties": false
1951
- }
272
+ "name": {
273
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/name"
1952
274
  },
1953
- "stage_units": {
1954
- "type": "array",
1955
- "items": {
1956
- "type": "object",
1957
- "properties": {
1958
- "stage": {
1959
- "type": "integer",
1960
- "minimum": 1,
1961
- "maximum": 5
1962
- },
1963
- "goal_id": {
1964
- "type": "string"
1965
- },
1966
- "assessment_id": {
1967
- "type": "string"
1968
- },
1969
- "risk_policy_id": {
1970
- "type": "string"
1971
- },
1972
- "verification_id": {
1973
- "type": "string"
1974
- },
1975
- "artifacts": {
275
+ "description": {
276
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/description"
277
+ },
278
+ "industry": {
279
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/industry"
280
+ },
281
+ "perspective": {
282
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/perspective"
283
+ },
284
+ "status": {
285
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/status"
286
+ },
287
+ "labels": {
288
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/labels"
289
+ },
290
+ "currentVersion": {
291
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/currentVersion"
292
+ },
293
+ "serviceAddress": {
294
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/serviceAddress"
295
+ },
296
+ "defaultAccount": {
297
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/defaultAccount"
298
+ },
299
+ "network": {
300
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/network"
301
+ },
302
+ "createdAt": {
303
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/createdAt"
304
+ },
305
+ "updatedAt": {
306
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/updatedAt"
307
+ },
308
+ "metadata": {
309
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/metadata"
310
+ }
311
+ },
312
+ "required": [
313
+ "id",
314
+ "prefix",
315
+ "name",
316
+ "description",
317
+ "industry",
318
+ "perspective",
319
+ "status",
320
+ "labels",
321
+ "currentVersion",
322
+ "serviceAddress",
323
+ "defaultAccount",
324
+ "network",
325
+ "createdAt",
326
+ "updatedAt",
327
+ "metadata"
328
+ ],
329
+ "additionalProperties": false,
330
+ "description": "The created consumer project."
331
+ },
332
+ "objects": {
333
+ "type": "array",
334
+ "items": {
335
+ "type": "object",
336
+ "properties": {
337
+ "id": {
338
+ "type": "string",
339
+ "description": "ProjectObject UUID (project_objects.id)."
340
+ },
341
+ "projectId": {
342
+ "type": "string",
343
+ "description": "Owning project UUID."
344
+ },
345
+ "objectAddress": {
346
+ "type": "string",
347
+ "description": "On-chain object address (0x...)."
348
+ },
349
+ "objectType": {
350
+ "type": [
351
+ "string",
352
+ "null"
353
+ ],
354
+ "description": "Object type (Service, Machine, etc.) or null if unknown."
355
+ },
356
+ "objectName": {
357
+ "type": [
358
+ "string",
359
+ "null"
360
+ ],
361
+ "description": "LocalMark name or null."
362
+ },
363
+ "role": {
364
+ "type": "string",
365
+ "enum": [
366
+ "core",
367
+ "dependency",
368
+ "reference"
369
+ ],
370
+ "description": "Object role in project."
371
+ },
372
+ "tags": {
373
+ "anyOf": [
374
+ {
1976
375
  "type": "array",
1977
376
  "items": {
1978
377
  "type": "string"
1979
378
  }
1980
- }
1981
- },
1982
- "required": [
1983
- "stage",
1984
- "goal_id",
1985
- "assessment_id",
1986
- "risk_policy_id",
1987
- "verification_id",
1988
- "artifacts"
1989
- ],
1990
- "additionalProperties": false
1991
- }
1992
- },
1993
- "derivations": {
1994
- "type": "array",
1995
- "items": {
1996
- "type": "object",
1997
- "properties": {
1998
- "source_type": {
1999
- "type": "string",
2000
- "enum": [
2001
- "project_invariant",
2002
- "project_goal"
2003
- ]
2004
- },
2005
- "source_id": {
2006
- "type": "string"
2007
- },
2008
- "target_type": {
2009
- "type": "string",
2010
- "enum": [
2011
- "stage_goal",
2012
- "stage_risk",
2013
- "stage_verification"
2014
- ]
2015
- },
2016
- "target_stage": {
2017
- "type": "integer",
2018
- "minimum": 1,
2019
- "maximum": 5
2020
379
  },
2021
- "target_id": {
2022
- "type": "string"
2023
- },
2024
- "derivation_logic": {
2025
- "type": "string"
380
+ {
381
+ "type": "null"
2026
382
  }
2027
- },
2028
- "required": [
2029
- "source_type",
2030
- "source_id",
2031
- "target_type",
2032
- "target_stage",
2033
- "target_id",
2034
- "derivation_logic"
2035
383
  ],
2036
- "additionalProperties": false
2037
- }
2038
- },
2039
- "propagation_rules": {
2040
- "type": "array",
2041
- "items": {
2042
- "type": "object",
2043
- "properties": {
2044
- "rule_id": {
2045
- "type": "string"
2046
- },
2047
- "trigger": {
384
+ "description": "Tags array or null."
385
+ },
386
+ "addedAt": {
387
+ "type": "number",
388
+ "description": "Timestamp (ms) when added to project."
389
+ },
390
+ "metadata": {
391
+ "anyOf": [
392
+ {
2048
393
  "type": "object",
2049
- "properties": {
2050
- "stage": {
2051
- "type": "integer"
2052
- },
2053
- "event": {
2054
- "type": "string",
2055
- "enum": [
2056
- "verification_passed",
2057
- "verification_failed"
2058
- ]
2059
- }
2060
- },
2061
- "required": [
2062
- "stage",
2063
- "event"
2064
- ],
2065
- "additionalProperties": false
394
+ "additionalProperties": {}
2066
395
  },
2067
- "effect": {
2068
- "type": "object",
2069
- "properties": {
2070
- "target": {
2071
- "type": "string",
2072
- "enum": [
2073
- "project_invariant",
2074
- "next_stage"
2075
- ]
2076
- },
2077
- "action": {
2078
- "type": "string",
2079
- "enum": [
2080
- "verify",
2081
- "block"
2082
- ]
2083
- }
2084
- },
2085
- "required": [
2086
- "target",
2087
- "action"
2088
- ],
2089
- "additionalProperties": false
396
+ {
397
+ "type": "null"
2090
398
  }
2091
- },
2092
- "required": [
2093
- "rule_id",
2094
- "trigger",
2095
- "effect"
2096
399
  ],
2097
- "additionalProperties": false
400
+ "description": "Arbitrary metadata key-value pairs or null."
2098
401
  }
2099
402
  },
2100
- "impact_map": {
2101
- "type": "object",
2102
- "additionalProperties": {
2103
- "type": "array",
2104
- "items": {
2105
- "type": "string"
2106
- }
2107
- }
2108
- }
403
+ "required": [
404
+ "id",
405
+ "projectId",
406
+ "objectAddress",
407
+ "objectType",
408
+ "objectName",
409
+ "role",
410
+ "tags",
411
+ "addedAt",
412
+ "metadata"
413
+ ],
414
+ "additionalProperties": false
2109
415
  },
2110
- "required": [
2111
- "version",
2112
- "generated_at",
2113
- "project_invariants",
2114
- "stage_units",
2115
- "derivations",
2116
- "propagation_rules",
2117
- "impact_map"
2118
- ],
2119
- "additionalProperties": false,
2120
- "description": "The validation chain graph (from relations.json)."
416
+ "description": "Objects discovered from on-chain Service + graph traversal."
417
+ },
418
+ "graphEdgeCount": {
419
+ "type": "number",
420
+ "description": "Number of relationship edges discovered and persisted."
2121
421
  }
2122
422
  },
2123
423
  "required": [
2124
424
  "action",
2125
425
  "project",
2126
- "version",
2127
- "found"
426
+ "objects",
427
+ "graphEdgeCount"
2128
428
  ],
2129
429
  "additionalProperties": false
2130
430
  },
@@ -2133,74 +433,81 @@
2133
433
  "properties": {
2134
434
  "action": {
2135
435
  "type": "string",
2136
- "const": "update_deployment_doc"
436
+ "const": "update_project"
2137
437
  },
2138
438
  "project": {
2139
- "type": "string"
2140
- },
2141
- "version": {
2142
- "type": "string"
2143
- },
2144
- "updated": {
2145
- "type": "boolean",
2146
- "description": "Whether the deployment doc set was regenerated."
2147
- },
2148
- "updated_files": {
2149
- "type": "array",
2150
- "items": {
2151
- "type": "string"
2152
- },
2153
- "description": "Project-relative paths of regenerated files."
2154
- },
2155
- "updated_file_count": {
2156
- "type": "integer"
2157
- },
2158
- "all_stages_passed": {
2159
- "type": "boolean",
2160
- "description": "Whether all stages passed their D-checks after the update."
2161
- },
2162
- "impact_summary": {
2163
439
  "type": "object",
2164
440
  "properties": {
2165
- "stages_affected": {
2166
- "type": "array",
2167
- "items": {
2168
- "type": "integer"
2169
- },
2170
- "description": "Stage numbers whose content changed."
441
+ "id": {
442
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/id"
2171
443
  },
2172
- "relations_rebuilt": {
2173
- "type": "boolean",
2174
- "description": "Whether relations.json was regenerated."
444
+ "prefix": {
445
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/prefix"
446
+ },
447
+ "name": {
448
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/name"
449
+ },
450
+ "description": {
451
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/description"
452
+ },
453
+ "industry": {
454
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/industry"
455
+ },
456
+ "perspective": {
457
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/perspective"
458
+ },
459
+ "status": {
460
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/status"
461
+ },
462
+ "labels": {
463
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/labels"
464
+ },
465
+ "currentVersion": {
466
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/currentVersion"
467
+ },
468
+ "serviceAddress": {
469
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/serviceAddress"
470
+ },
471
+ "defaultAccount": {
472
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/defaultAccount"
473
+ },
474
+ "network": {
475
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/network"
476
+ },
477
+ "createdAt": {
478
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/createdAt"
479
+ },
480
+ "updatedAt": {
481
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/updatedAt"
482
+ },
483
+ "metadata": {
484
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/metadata"
2175
485
  }
2176
486
  },
2177
487
  "required": [
2178
- "stages_affected",
2179
- "relations_rebuilt"
488
+ "id",
489
+ "prefix",
490
+ "name",
491
+ "description",
492
+ "industry",
493
+ "perspective",
494
+ "status",
495
+ "labels",
496
+ "currentVersion",
497
+ "serviceAddress",
498
+ "defaultAccount",
499
+ "network",
500
+ "createdAt",
501
+ "updatedAt",
502
+ "metadata"
2180
503
  ],
2181
504
  "additionalProperties": false,
2182
- "description": "Summary of what changed (based on relations.json impact analysis)."
2183
- },
2184
- "next_action": {
2185
- "type": "string",
2186
- "enum": [
2187
- "validate_validation_chain",
2188
- "trace_substeps",
2189
- "none"
2190
- ],
2191
- "description": "Next action: validate the chain after update, or proceed to trace_substeps."
505
+ "description": "The updated project."
2192
506
  }
2193
507
  },
2194
508
  "required": [
2195
509
  "action",
2196
- "project",
2197
- "version",
2198
- "updated",
2199
- "updated_files",
2200
- "updated_file_count",
2201
- "all_stages_passed",
2202
- "impact_summary",
2203
- "next_action"
510
+ "project"
2204
511
  ],
2205
512
  "additionalProperties": false
2206
513
  },
@@ -2209,154 +516,263 @@
2209
516
  "properties": {
2210
517
  "action": {
2211
518
  "type": "string",
2212
- "const": "validate_validation_chain"
519
+ "const": "get_project_detail"
2213
520
  },
2214
521
  "project": {
2215
- "type": "string"
2216
- },
2217
- "version": {
2218
- "type": "string"
2219
- },
2220
- "valid": {
2221
- "type": "boolean",
2222
- "description": "True when derivation, propagation, cross-stage, and impact-map checks all pass."
522
+ "type": "object",
523
+ "properties": {
524
+ "id": {
525
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/id"
526
+ },
527
+ "prefix": {
528
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/prefix"
529
+ },
530
+ "name": {
531
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/name"
532
+ },
533
+ "description": {
534
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/description"
535
+ },
536
+ "industry": {
537
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/industry"
538
+ },
539
+ "perspective": {
540
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/perspective"
541
+ },
542
+ "status": {
543
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/status"
544
+ },
545
+ "labels": {
546
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/labels"
547
+ },
548
+ "currentVersion": {
549
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/currentVersion"
550
+ },
551
+ "serviceAddress": {
552
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/serviceAddress"
553
+ },
554
+ "defaultAccount": {
555
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/defaultAccount"
556
+ },
557
+ "network": {
558
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/network"
559
+ },
560
+ "createdAt": {
561
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/createdAt"
562
+ },
563
+ "updatedAt": {
564
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/updatedAt"
565
+ },
566
+ "metadata": {
567
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/0/properties/items/items/properties/metadata"
568
+ }
569
+ },
570
+ "required": [
571
+ "id",
572
+ "prefix",
573
+ "name",
574
+ "description",
575
+ "industry",
576
+ "perspective",
577
+ "status",
578
+ "labels",
579
+ "currentVersion",
580
+ "serviceAddress",
581
+ "defaultAccount",
582
+ "network",
583
+ "createdAt",
584
+ "updatedAt",
585
+ "metadata"
586
+ ],
587
+ "additionalProperties": false
2223
588
  },
2224
- "derivation_checks": {
589
+ "objects": {
2225
590
  "type": "array",
2226
591
  "items": {
2227
- "type": "object",
2228
- "properties": {
2229
- "check_id": {
2230
- "type": "string"
2231
- },
2232
- "status": {
2233
- "type": "string",
2234
- "enum": [
2235
- "pass",
2236
- "fail",
2237
- "warn"
2238
- ]
2239
- },
2240
- "message": {
2241
- "type": "string"
2242
- }
2243
- },
2244
- "required": [
2245
- "check_id",
2246
- "status",
2247
- "message"
2248
- ],
2249
- "additionalProperties": false
2250
- }
592
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items"
593
+ },
594
+ "description": "Project objects (rigid relationships)."
595
+ },
596
+ "graphEdgeCount": {
597
+ "type": "number",
598
+ "description": "Number of persisted graph edges."
2251
599
  },
2252
- "propagation_checks": {
600
+ "evaluations": {
2253
601
  "type": "array",
2254
602
  "items": {
2255
603
  "type": "object",
2256
604
  "properties": {
2257
- "check_id": {
605
+ "id": {
2258
606
  "type": "string"
2259
607
  },
2260
- "status": {
608
+ "evalType": {
2261
609
  "type": "string",
2262
610
  "enum": [
2263
- "pass",
2264
- "fail",
2265
- "warn"
611
+ "risk",
612
+ "trust",
613
+ "completeness",
614
+ "value",
615
+ "worth_buying"
2266
616
  ]
2267
617
  },
2268
- "message": {
2269
- "type": "string"
2270
- }
2271
- },
2272
- "required": [
2273
- "check_id",
2274
- "status",
2275
- "message"
2276
- ],
2277
- "additionalProperties": false
2278
- }
2279
- },
2280
- "cross_stage_checks": {
2281
- "type": "array",
2282
- "items": {
2283
- "type": "object",
2284
- "properties": {
2285
- "check_id": {
2286
- "type": "string"
618
+ "score": {
619
+ "type": [
620
+ "number",
621
+ "null"
622
+ ]
2287
623
  },
2288
- "status": {
2289
- "type": "string",
2290
- "enum": [
2291
- "pass",
2292
- "fail",
2293
- "warn"
624
+ "summary": {
625
+ "type": [
626
+ "string",
627
+ "null"
2294
628
  ]
2295
629
  },
2296
- "message": {
2297
- "type": "string"
630
+ "details": {
631
+ "anyOf": [
632
+ {
633
+ "type": "object",
634
+ "properties": {
635
+ "criterionScores": {
636
+ "type": "array",
637
+ "items": {
638
+ "type": "object",
639
+ "properties": {
640
+ "name": {
641
+ "type": "string",
642
+ "description": "Criterion name (e.g. 'Service Published', 'Governance Present')."
643
+ },
644
+ "score": {
645
+ "type": "number",
646
+ "description": "Per-criterion score (0-100, higher = better)."
647
+ },
648
+ "weight": {
649
+ "type": "number",
650
+ "description": "Weight in the overall score (0-1)."
651
+ },
652
+ "rationale": {
653
+ "type": "string",
654
+ "description": "Why this score was assigned."
655
+ }
656
+ },
657
+ "required": [
658
+ "name",
659
+ "score",
660
+ "weight",
661
+ "rationale"
662
+ ],
663
+ "additionalProperties": false
664
+ },
665
+ "description": "Per-criterion scores with rationale."
666
+ },
667
+ "findings": {
668
+ "type": "array",
669
+ "items": {
670
+ "type": "object",
671
+ "properties": {
672
+ "criterion": {
673
+ "type": "string",
674
+ "description": "Criterion this finding relates to."
675
+ },
676
+ "severity": {
677
+ "type": "string",
678
+ "enum": [
679
+ "critical",
680
+ "warning",
681
+ "info"
682
+ ],
683
+ "description": "Severity level: critical (blocks deployment), warning (should fix), info (advisory)."
684
+ },
685
+ "message": {
686
+ "type": "string",
687
+ "description": "Human-readable finding description."
688
+ },
689
+ "deduction": {
690
+ "type": "number",
691
+ "description": "Score deduction applied (negative number, e.g. -20)."
692
+ }
693
+ },
694
+ "required": [
695
+ "criterion",
696
+ "severity",
697
+ "message",
698
+ "deduction"
699
+ ],
700
+ "additionalProperties": false
701
+ },
702
+ "description": "Negative findings (warnings/critical issues) with deductions."
703
+ },
704
+ "strengths": {
705
+ "type": "array",
706
+ "items": {
707
+ "type": "string"
708
+ },
709
+ "description": "Positive evidence explaining high scores."
710
+ }
711
+ },
712
+ "required": [
713
+ "criterionScores",
714
+ "findings",
715
+ "strengths"
716
+ ],
717
+ "additionalProperties": false
718
+ },
719
+ {
720
+ "type": "null"
721
+ }
722
+ ],
723
+ "description": "Structured inspection content (criterion scores, findings, strengths). Null for evaluations created before details were stored."
724
+ },
725
+ "evaluatedAt": {
726
+ "type": "number"
2298
727
  }
2299
728
  },
2300
729
  "required": [
2301
- "check_id",
2302
- "status",
2303
- "message"
730
+ "id",
731
+ "evalType",
732
+ "score",
733
+ "summary",
734
+ "details",
735
+ "evaluatedAt"
2304
736
  ],
2305
737
  "additionalProperties": false
2306
- }
738
+ },
739
+ "description": "Stored evaluation results (most recent first)."
2307
740
  },
2308
- "impact_map_checks": {
741
+ "versions": {
2309
742
  "type": "array",
2310
743
  "items": {
2311
744
  "type": "object",
2312
745
  "properties": {
2313
- "check_id": {
746
+ "version": {
2314
747
  "type": "string"
2315
748
  },
2316
- "status": {
2317
- "type": "string",
2318
- "enum": [
2319
- "pass",
2320
- "fail",
2321
- "warn"
749
+ "description": {
750
+ "type": [
751
+ "string",
752
+ "null"
2322
753
  ]
2323
754
  },
2324
- "message": {
2325
- "type": "string"
755
+ "createdAt": {
756
+ "type": "number"
2326
757
  }
2327
758
  },
2328
759
  "required": [
2329
- "check_id",
2330
- "status",
2331
- "message"
760
+ "version",
761
+ "description",
762
+ "createdAt"
2332
763
  ],
2333
764
  "additionalProperties": false
2334
- }
2335
- },
2336
- "blocking_issues": {
2337
- "type": "array",
2338
- "items": {
2339
- "type": "string"
2340
- }
2341
- },
2342
- "warnings": {
2343
- "type": "array",
2344
- "items": {
2345
- "type": "string"
2346
- }
765
+ },
766
+ "description": "Project version history."
2347
767
  }
2348
768
  },
2349
769
  "required": [
2350
770
  "action",
2351
771
  "project",
2352
- "version",
2353
- "valid",
2354
- "derivation_checks",
2355
- "propagation_checks",
2356
- "cross_stage_checks",
2357
- "impact_map_checks",
2358
- "blocking_issues",
2359
- "warnings"
772
+ "objects",
773
+ "graphEdgeCount",
774
+ "evaluations",
775
+ "versions"
2360
776
  ],
2361
777
  "additionalProperties": false
2362
778
  },
@@ -2365,58 +781,173 @@
2365
781
  "properties": {
2366
782
  "action": {
2367
783
  "type": "string",
2368
- "const": "apply_improvement"
2369
- },
2370
- "proposal_id": {
2371
- "type": "string"
2372
- },
2373
- "previous_status": {
2374
- "type": "string"
2375
- },
2376
- "new_status": {
2377
- "type": "string"
2378
- },
2379
- "applied": {
2380
- "type": "boolean",
2381
- "description": "Whether the proposal was applied (true for approved+config_override, true for approved+source_patch producing patch file)."
784
+ "const": "add_object"
2382
785
  },
2383
- "apply_mode": {
786
+ "object": {
787
+ "type": "object",
788
+ "properties": {
789
+ "id": {
790
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/id"
791
+ },
792
+ "projectId": {
793
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/projectId"
794
+ },
795
+ "objectAddress": {
796
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/objectAddress"
797
+ },
798
+ "objectType": {
799
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/objectType"
800
+ },
801
+ "objectName": {
802
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/objectName"
803
+ },
804
+ "role": {
805
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/role"
806
+ },
807
+ "tags": {
808
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/tags"
809
+ },
810
+ "addedAt": {
811
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/addedAt"
812
+ },
813
+ "metadata": {
814
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/metadata"
815
+ }
816
+ },
817
+ "required": [
818
+ "id",
819
+ "projectId",
820
+ "objectAddress",
821
+ "objectType",
822
+ "objectName",
823
+ "role",
824
+ "tags",
825
+ "addedAt",
826
+ "metadata"
827
+ ],
828
+ "additionalProperties": false,
829
+ "description": "The added project-object relationship."
830
+ }
831
+ },
832
+ "required": [
833
+ "action",
834
+ "object"
835
+ ],
836
+ "additionalProperties": false
837
+ },
838
+ {
839
+ "type": "object",
840
+ "properties": {
841
+ "action": {
2384
842
  "type": "string",
2385
- "enum": [
2386
- "config_override",
2387
- "source_patch"
2388
- ]
843
+ "const": "remove_object"
2389
844
  },
2390
- "override_file": {
845
+ "removed": {
846
+ "type": "boolean",
847
+ "const": true,
848
+ "description": "Always true — confirms removal."
849
+ }
850
+ },
851
+ "required": [
852
+ "action",
853
+ "removed"
854
+ ],
855
+ "additionalProperties": false
856
+ },
857
+ {
858
+ "type": "object",
859
+ "properties": {
860
+ "action": {
2391
861
  "type": "string",
2392
- "description": "Path of the override file written (config_override only)."
862
+ "const": "update_object"
2393
863
  },
2394
- "patch_file": {
864
+ "object": {
865
+ "type": "object",
866
+ "properties": {
867
+ "id": {
868
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/id"
869
+ },
870
+ "projectId": {
871
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/projectId"
872
+ },
873
+ "objectAddress": {
874
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/objectAddress"
875
+ },
876
+ "objectType": {
877
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/objectType"
878
+ },
879
+ "objectName": {
880
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/objectName"
881
+ },
882
+ "role": {
883
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/role"
884
+ },
885
+ "tags": {
886
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/tags"
887
+ },
888
+ "addedAt": {
889
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/addedAt"
890
+ },
891
+ "metadata": {
892
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items/properties/metadata"
893
+ }
894
+ },
895
+ "required": [
896
+ "id",
897
+ "projectId",
898
+ "objectAddress",
899
+ "objectType",
900
+ "objectName",
901
+ "role",
902
+ "tags",
903
+ "addedAt",
904
+ "metadata"
905
+ ],
906
+ "additionalProperties": false,
907
+ "description": "The updated project-object relationship."
908
+ }
909
+ },
910
+ "required": [
911
+ "action",
912
+ "object"
913
+ ],
914
+ "additionalProperties": false
915
+ },
916
+ {
917
+ "type": "object",
918
+ "properties": {
919
+ "action": {
2395
920
  "type": "string",
2396
- "description": "Path of the patch file written (source_patch only)."
2397
- },
2398
- "message": {
2399
- "type": "string"
921
+ "const": "create_version"
2400
922
  },
2401
- "next_action": {
2402
- "type": "string",
2403
- "enum": [
2404
- "get_improvement_queue",
2405
- "get_flywheel_config",
2406
- "none"
923
+ "version": {
924
+ "type": "object",
925
+ "properties": {
926
+ "version": {
927
+ "type": "string",
928
+ "description": "Version tag (e.g. 'v2')."
929
+ },
930
+ "description": {
931
+ "type": [
932
+ "string",
933
+ "null"
934
+ ]
935
+ },
936
+ "createdAt": {
937
+ "type": "number"
938
+ }
939
+ },
940
+ "required": [
941
+ "version",
942
+ "description",
943
+ "createdAt"
2407
944
  ],
2408
- "description": "Next action: check more proposals or view flywheel status."
945
+ "additionalProperties": false
2409
946
  }
2410
947
  },
2411
948
  "required": [
2412
949
  "action",
2413
- "proposal_id",
2414
- "previous_status",
2415
- "new_status",
2416
- "applied",
2417
- "apply_mode",
2418
- "message",
2419
- "next_action"
950
+ "version"
2420
951
  ],
2421
952
  "additionalProperties": false
2422
953
  },
@@ -2425,103 +956,112 @@
2425
956
  "properties": {
2426
957
  "action": {
2427
958
  "type": "string",
2428
- "const": "get_improvement_queue"
959
+ "const": "build_graph"
2429
960
  },
2430
- "total": {
2431
- "type": "integer"
961
+ "nodeCount": {
962
+ "type": "number",
963
+ "description": "Total nodes in the constructed graph."
964
+ },
965
+ "edgeCount": {
966
+ "type": "number",
967
+ "description": "Total edges (after conflict resolution + dedup)."
968
+ },
969
+ "edgesBySource": {
970
+ "type": "object",
971
+ "additionalProperties": {
972
+ "type": "number"
973
+ },
974
+ "description": "Edge counts by source: { internal: N, registrar: N, potential: N }."
975
+ },
976
+ "reputationCount": {
977
+ "type": "number",
978
+ "description": "Number of objects with Registrar reputation data."
2432
979
  },
2433
- "filtered_count": {
2434
- "type": "integer"
980
+ "builtAt": {
981
+ "type": "number",
982
+ "description": "Build timestamp (ms)."
983
+ }
984
+ },
985
+ "required": [
986
+ "action",
987
+ "nodeCount",
988
+ "edgeCount",
989
+ "edgesBySource",
990
+ "reputationCount",
991
+ "builtAt"
992
+ ],
993
+ "additionalProperties": false
994
+ },
995
+ {
996
+ "type": "object",
997
+ "properties": {
998
+ "action": {
999
+ "type": "string",
1000
+ "const": "get_graph"
2435
1001
  },
2436
- "proposals": {
1002
+ "edges": {
2437
1003
  "type": "array",
2438
1004
  "items": {
2439
1005
  "type": "object",
2440
1006
  "properties": {
2441
- "proposal_id": {
2442
- "type": "string"
2443
- },
2444
- "source_diagnosis_id": {
1007
+ "sourceObject": {
2445
1008
  "type": "string"
2446
1009
  },
2447
- "type": {
1010
+ "targetObject": {
2448
1011
  "type": "string"
2449
1012
  },
2450
- "priority": {
2451
- "type": "string"
2452
- },
2453
- "automation": {
2454
- "type": "string",
2455
- "enum": [
2456
- "full",
2457
- "semi",
2458
- "manual"
2459
- ]
2460
- },
2461
- "apply_mode": {
1013
+ "edgeSource": {
2462
1014
  "type": "string",
2463
1015
  "enum": [
2464
- "config_override",
2465
- "source_patch"
1016
+ "internal",
1017
+ "registrar",
1018
+ "potential"
2466
1019
  ]
2467
1020
  },
2468
- "override_category": {
2469
- "type": "string"
2470
- },
2471
- "title": {
1021
+ "relationshipType": {
2472
1022
  "type": "string"
2473
1023
  },
2474
- "description": {
2475
- "type": "string"
2476
- },
2477
- "target": {
2478
- "type": "string"
2479
- },
2480
- "review_status": {
2481
- "type": "string",
2482
- "enum": [
2483
- "pending",
2484
- "approved",
2485
- "rejected",
2486
- "applied"
1024
+ "fieldName": {
1025
+ "type": [
1026
+ "string",
1027
+ "null"
2487
1028
  ]
2488
1029
  },
2489
- "ab_test_recommended": {
1030
+ "depth": {
1031
+ "type": "number"
1032
+ },
1033
+ "verified": {
2490
1034
  "type": "boolean"
2491
1035
  },
2492
- "persisted_at": {
2493
- "type": "string"
1036
+ "weight": {
1037
+ "type": "number"
2494
1038
  },
2495
- "reviewed_at": {
2496
- "type": "string"
1039
+ "direction": {
1040
+ "type": [
1041
+ "string",
1042
+ "null"
1043
+ ]
2497
1044
  }
2498
1045
  },
2499
1046
  "required": [
2500
- "proposal_id",
2501
- "source_diagnosis_id",
2502
- "type",
2503
- "priority",
2504
- "automation",
2505
- "apply_mode",
2506
- "title",
2507
- "description",
2508
- "target",
2509
- "review_status",
2510
- "ab_test_recommended"
1047
+ "sourceObject",
1048
+ "targetObject",
1049
+ "edgeSource",
1050
+ "relationshipType",
1051
+ "fieldName",
1052
+ "depth",
1053
+ "verified",
1054
+ "weight",
1055
+ "direction"
2511
1056
  ],
2512
1057
  "additionalProperties": false
2513
- }
2514
- },
2515
- "summary": {
2516
- "type": "string"
1058
+ },
1059
+ "description": "Persisted graph edges."
2517
1060
  }
2518
1061
  },
2519
1062
  "required": [
2520
1063
  "action",
2521
- "total",
2522
- "filtered_count",
2523
- "proposals",
2524
- "summary"
1064
+ "edges"
2525
1065
  ],
2526
1066
  "additionalProperties": false
2527
1067
  },
@@ -2530,98 +1070,116 @@
2530
1070
  "properties": {
2531
1071
  "action": {
2532
1072
  "type": "string",
2533
- "const": "get_flywheel_config"
1073
+ "const": "evaluate_project"
2534
1074
  },
2535
- "queue_path": {
2536
- "type": "string"
1075
+ "evaluationType": {
1076
+ "type": "string",
1077
+ "enum": [
1078
+ "risk",
1079
+ "trust",
1080
+ "completeness",
1081
+ "value",
1082
+ "worth_buying"
1083
+ ]
2537
1084
  },
2538
- "overrides_dir": {
2539
- "type": "string"
1085
+ "score": {
1086
+ "type": "number",
1087
+ "description": "Overall score (0-100, higher = better). 0 when needsLlm=true."
2540
1088
  },
2541
- "patches_dir": {
1089
+ "summary": {
2542
1090
  "type": "string"
2543
1091
  },
2544
- "total_proposals": {
2545
- "type": "integer"
2546
- },
2547
- "pending_count": {
2548
- "type": "integer"
2549
- },
2550
- "approved_count": {
2551
- "type": "integer"
2552
- },
2553
- "applied_count": {
2554
- "type": "integer"
2555
- },
2556
- "rejected_count": {
2557
- "type": "integer"
2558
- },
2559
- "override_files": {
2560
- "type": "array",
2561
- "items": {
2562
- "type": "string"
2563
- }
2564
- },
2565
- "recent_proposals": {
1092
+ "criterionScores": {
2566
1093
  "type": "array",
2567
1094
  "items": {
2568
1095
  "type": "object",
2569
1096
  "properties": {
2570
- "proposal_id": {
1097
+ "name": {
2571
1098
  "type": "string"
2572
1099
  },
2573
- "type": {
2574
- "type": "string"
1100
+ "score": {
1101
+ "type": "number"
1102
+ },
1103
+ "weight": {
1104
+ "type": "number"
2575
1105
  },
2576
- "priority": {
1106
+ "rationale": {
1107
+ "type": "string"
1108
+ }
1109
+ },
1110
+ "required": [
1111
+ "name",
1112
+ "score",
1113
+ "weight",
1114
+ "rationale"
1115
+ ],
1116
+ "additionalProperties": false
1117
+ },
1118
+ "description": "Per-criterion scores. Empty when needsLlm=true."
1119
+ },
1120
+ "findings": {
1121
+ "type": "array",
1122
+ "items": {
1123
+ "type": "object",
1124
+ "properties": {
1125
+ "criterion": {
2577
1126
  "type": "string"
2578
1127
  },
2579
- "review_status": {
1128
+ "severity": {
2580
1129
  "type": "string",
2581
1130
  "enum": [
2582
- "pending",
2583
- "approved",
2584
- "rejected",
2585
- "applied"
1131
+ "critical",
1132
+ "warning",
1133
+ "info"
2586
1134
  ]
2587
1135
  },
2588
- "title": {
1136
+ "message": {
2589
1137
  "type": "string"
1138
+ },
1139
+ "deduction": {
1140
+ "type": "number"
2590
1141
  }
2591
1142
  },
2592
1143
  "required": [
2593
- "proposal_id",
2594
- "type",
2595
- "priority",
2596
- "review_status",
2597
- "title"
1144
+ "criterion",
1145
+ "severity",
1146
+ "message",
1147
+ "deduction"
2598
1148
  ],
2599
1149
  "additionalProperties": false
2600
- }
1150
+ },
1151
+ "description": "Negative findings (deductions). Empty when needsLlm=true."
1152
+ },
1153
+ "strengths": {
1154
+ "type": "array",
1155
+ "items": {
1156
+ "type": "string"
1157
+ },
1158
+ "description": "Positive evidence. Empty when needsLlm=true."
1159
+ },
1160
+ "needsLlm": {
1161
+ "type": "boolean",
1162
+ "description": "True for worth_buying/value evaluations. When true, process the llmPrompt with an LLM and call save_evaluation to store the result."
2601
1163
  },
2602
- "reflow_status": {
1164
+ "llmPrompt": {
2603
1165
  "type": "string",
2604
- "enum": [
2605
- "active",
2606
- "idle",
2607
- "blocked"
2608
- ],
2609
- "description": "active=pending proposals exist; idle=no proposals; blocked=approved but not applied."
1166
+ "description": "Present when needsLlm=true. Send this prompt to an LLM, parse the JSON response, and call save_evaluation."
1167
+ },
1168
+ "evaluationId": {
1169
+ "type": "string",
1170
+ "description": "ID of the stored evaluation record (for rule-based types). Empty for LLM-assisted types."
2610
1171
  }
2611
1172
  },
2612
1173
  "required": [
2613
1174
  "action",
2614
- "queue_path",
2615
- "overrides_dir",
2616
- "patches_dir",
2617
- "total_proposals",
2618
- "pending_count",
2619
- "approved_count",
2620
- "applied_count",
2621
- "rejected_count",
2622
- "override_files",
2623
- "recent_proposals",
2624
- "reflow_status"
1175
+ "evaluationType",
1176
+ "score",
1177
+ "summary",
1178
+ "criterionScores",
1179
+ "findings",
1180
+ "strengths",
1181
+ "needsLlm",
1182
+ "evaluationId"
2625
1183
  ],
2626
1184
  "additionalProperties": false
2627
1185
  },
@@ -2630,101 +1188,54 @@
2630
1188
  "properties": {
2631
1189
  "action": {
2632
1190
  "type": "string",
2633
- "const": "rollback_stage"
2634
- },
2635
- "success": {
2636
- "type": "boolean",
2637
- "description": "Whether the rollback was executed (or would be, if dry_run=false)."
2638
- },
2639
- "dry_run": {
2640
- "type": "boolean",
2641
- "description": "Whether this was a policy evaluation only (no execution)."
2642
- },
2643
- "target_stage": {
2644
- "type": "integer",
2645
- "minimum": 1,
2646
- "maximum": 5
2647
- },
2648
- "previous_stage": {
2649
- "type": "integer",
2650
- "minimum": 1,
2651
- "maximum": 5
2652
- },
2653
- "allowed": {
2654
- "type": "boolean",
2655
- "description": "Whether the rollback is allowed by policy."
2656
- },
2657
- "block_reason": {
2658
- "type": "string",
2659
- "description": "Present when allowed=false — explains why rollback is blocked."
2660
- },
2661
- "files_to_clean": {
2662
- "type": "array",
2663
- "items": {
2664
- "type": "string"
2665
- },
2666
- "description": "Files/directories that will be (or were) deleted during rollback."
2667
- },
2668
- "files_cleaned": {
2669
- "type": "array",
2670
- "items": {
2671
- "type": "string"
2672
- },
2673
- "description": "Files/directories actually deleted (empty in dry_run mode)."
2674
- },
2675
- "warnings": {
2676
- "type": "array",
2677
- "items": {
2678
- "type": "string"
2679
- },
2680
- "description": "Non-blocking warnings (e.g., data loss reminder)."
1191
+ "const": "save_evaluation"
2681
1192
  },
2682
- "iteration_strategy": {
1193
+ "evaluation": {
2683
1194
  "type": "object",
2684
1195
  "properties": {
2685
- "strategy": {
1196
+ "id": {
1197
+ "type": "string"
1198
+ },
1199
+ "evalType": {
2686
1200
  "type": "string",
2687
1201
  "enum": [
2688
- "in_place",
2689
- "fork"
1202
+ "risk",
1203
+ "trust",
1204
+ "completeness",
1205
+ "value",
1206
+ "worth_buying"
2690
1207
  ]
2691
1208
  },
2692
- "reason": {
2693
- "type": "string"
1209
+ "score": {
1210
+ "type": [
1211
+ "number",
1212
+ "null"
1213
+ ]
2694
1214
  },
2695
- "fork_to_version": {
2696
- "type": "string"
1215
+ "summary": {
1216
+ "type": [
1217
+ "string",
1218
+ "null"
1219
+ ]
2697
1220
  },
2698
- "published_objects": {
2699
- "type": "array",
2700
- "items": {
2701
- "type": "string"
2702
- }
1221
+ "evaluatedAt": {
1222
+ "type": "number"
2703
1223
  }
2704
1224
  },
2705
1225
  "required": [
2706
- "strategy",
2707
- "reason"
1226
+ "id",
1227
+ "evalType",
1228
+ "score",
1229
+ "summary",
1230
+ "evaluatedAt"
2708
1231
  ],
2709
- "additionalProperties": false
2710
- },
2711
- "message": {
2712
- "type": "string",
2713
- "description": "Human-readable summary."
1232
+ "additionalProperties": false,
1233
+ "description": "The stored evaluation record."
2714
1234
  }
2715
1235
  },
2716
1236
  "required": [
2717
1237
  "action",
2718
- "success",
2719
- "dry_run",
2720
- "target_stage",
2721
- "previous_stage",
2722
- "allowed",
2723
- "files_to_clean",
2724
- "files_cleaned",
2725
- "warnings",
2726
- "iteration_strategy",
2727
- "message"
1238
+ "evaluation"
2728
1239
  ],
2729
1240
  "additionalProperties": false
2730
1241
  },
@@ -2733,83 +1244,177 @@
2733
1244
  "properties": {
2734
1245
  "action": {
2735
1246
  "type": "string",
2736
- "const": "get_reversibility"
1247
+ "const": "compare_projects"
2737
1248
  },
2738
- "query": {
2739
- "type": "object",
2740
- "properties": {
2741
- "object_type": {
2742
- "type": "string"
2743
- },
2744
- "lifecycle_state": {
2745
- "type": "string"
2746
- }
2747
- },
2748
- "additionalProperties": false,
2749
- "description": "The query parameters used (empty = full matrix returned)."
1249
+ "evaluationType": {
1250
+ "type": "string",
1251
+ "enum": [
1252
+ "risk",
1253
+ "trust",
1254
+ "completeness",
1255
+ "value",
1256
+ "worth_buying"
1257
+ ]
2750
1258
  },
2751
- "entries": {
1259
+ "ranking": {
2752
1260
  "type": "array",
2753
1261
  "items": {
2754
1262
  "type": "object",
2755
1263
  "properties": {
2756
- "object_type": {
1264
+ "projectId": {
2757
1265
  "type": "string"
2758
1266
  },
2759
- "lifecycle_state": {
2760
- "type": "string",
2761
- "enum": [
2762
- "created",
2763
- "referenced",
2764
- "published",
2765
- "bound"
1267
+ "projectName": {
1268
+ "type": "string"
1269
+ },
1270
+ "score": {
1271
+ "type": [
1272
+ "number",
1273
+ "null"
2766
1274
  ]
2767
1275
  },
2768
- "struct_reversible": {
2769
- "type": "string",
2770
- "enum": [
2771
- "reversible",
2772
- "limited",
2773
- "immutable"
1276
+ "summary": {
1277
+ "type": [
1278
+ "string",
1279
+ "null"
2774
1280
  ]
2775
1281
  },
2776
- "behavior_reversible": {
2777
- "type": "boolean"
1282
+ "evaluatedAt": {
1283
+ "type": [
1284
+ "number",
1285
+ "null"
1286
+ ]
1287
+ }
1288
+ },
1289
+ "required": [
1290
+ "projectId",
1291
+ "projectName",
1292
+ "score",
1293
+ "summary",
1294
+ "evaluatedAt"
1295
+ ],
1296
+ "additionalProperties": false
1297
+ },
1298
+ "description": "Projects sorted by score descending (nulls last)."
1299
+ },
1300
+ "bestProjectId": {
1301
+ "type": [
1302
+ "string",
1303
+ "null"
1304
+ ],
1305
+ "description": "Project ID with the highest score, or null if none have evaluations."
1306
+ }
1307
+ },
1308
+ "required": [
1309
+ "action",
1310
+ "evaluationType",
1311
+ "ranking",
1312
+ "bestProjectId"
1313
+ ],
1314
+ "additionalProperties": false
1315
+ },
1316
+ {
1317
+ "type": "object",
1318
+ "properties": {
1319
+ "action": {
1320
+ "type": "string",
1321
+ "const": "refresh_objects"
1322
+ },
1323
+ "refreshedCount": {
1324
+ "type": "number",
1325
+ "description": "Number of objects re-fetched from chain."
1326
+ },
1327
+ "failedCount": {
1328
+ "type": "number",
1329
+ "description": "Number of objects that failed to refresh."
1330
+ },
1331
+ "refreshedAt": {
1332
+ "type": "number",
1333
+ "description": "Refresh timestamp (ms)."
1334
+ }
1335
+ },
1336
+ "required": [
1337
+ "action",
1338
+ "refreshedCount",
1339
+ "failedCount",
1340
+ "refreshedAt"
1341
+ ],
1342
+ "additionalProperties": false
1343
+ },
1344
+ {
1345
+ "type": "object",
1346
+ "properties": {
1347
+ "action": {
1348
+ "type": "string",
1349
+ "const": "get_object_diff"
1350
+ },
1351
+ "address": {
1352
+ "type": "string"
1353
+ },
1354
+ "fromTime": {
1355
+ "type": "number"
1356
+ },
1357
+ "toTime": {
1358
+ "type": "number"
1359
+ },
1360
+ "changedFields": {
1361
+ "type": "array",
1362
+ "items": {
1363
+ "type": "object",
1364
+ "properties": {
1365
+ "fieldPath": {
1366
+ "type": "string",
1367
+ "description": "Dotted field path (e.g. 'machine', 'sales[0].price')."
2778
1368
  },
2779
- "gas_impact": {
1369
+ "oldValue": {
1370
+ "description": "Previous value (null if field was added)."
1371
+ },
1372
+ "newValue": {
1373
+ "description": "New value (null if field was removed)."
1374
+ },
1375
+ "changeType": {
2780
1376
  "type": "string",
2781
1377
  "enum": [
2782
- "low",
2783
- "medium",
2784
- "high",
2785
- "none"
1378
+ "added",
1379
+ "removed",
1380
+ "modified"
2786
1381
  ]
2787
- },
2788
- "explanation": {
2789
- "type": "string"
2790
1382
  }
2791
1383
  },
2792
1384
  "required": [
2793
- "object_type",
2794
- "lifecycle_state",
2795
- "struct_reversible",
2796
- "behavior_reversible",
2797
- "gas_impact",
2798
- "explanation"
1385
+ "fieldPath",
1386
+ "changeType"
2799
1387
  ],
2800
1388
  "additionalProperties": false
2801
- }
1389
+ },
1390
+ "description": "Changed fields between the two timestamps."
1391
+ }
1392
+ },
1393
+ "required": [
1394
+ "action",
1395
+ "address",
1396
+ "fromTime",
1397
+ "toTime",
1398
+ "changedFields"
1399
+ ],
1400
+ "additionalProperties": false
1401
+ },
1402
+ {
1403
+ "type": "object",
1404
+ "properties": {
1405
+ "action": {
1406
+ "type": "string",
1407
+ "const": "delete_project"
2802
1408
  },
2803
- "total": {
2804
- "type": "integer",
2805
- "description": "Number of matrix entries returned."
1409
+ "deleted": {
1410
+ "type": "boolean",
1411
+ "const": true,
1412
+ "description": "Always true — confirms deletion of the project and all associated objects, evaluations, versions, and graph edges."
2806
1413
  }
2807
1414
  },
2808
1415
  "required": [
2809
1416
  "action",
2810
- "query",
2811
- "entries",
2812
- "total"
1417
+ "deleted"
2813
1418
  ],
2814
1419
  "additionalProperties": false
2815
1420
  },
@@ -2877,6 +1482,85 @@
2877
1482
  "next_action"
2878
1483
  ],
2879
1484
  "additionalProperties": false
1485
+ },
1486
+ {
1487
+ "type": "object",
1488
+ "properties": {
1489
+ "action": {
1490
+ "type": "string",
1491
+ "const": "generate_deployment_doc"
1492
+ },
1493
+ "markdown": {
1494
+ "type": "string",
1495
+ "description": "Generated deployment document markdown content (follows 71-deployment-list-spec)."
1496
+ },
1497
+ "validation": {
1498
+ "type": "object",
1499
+ "properties": {
1500
+ "valid": {
1501
+ "type": "boolean",
1502
+ "description": "True iff no D-check FAIL."
1503
+ },
1504
+ "checks": {
1505
+ "type": "array",
1506
+ "items": {
1507
+ "type": "object",
1508
+ "properties": {
1509
+ "check_id": {
1510
+ "type": "string"
1511
+ },
1512
+ "description": {
1513
+ "type": "string"
1514
+ },
1515
+ "status": {
1516
+ "type": "string",
1517
+ "enum": [
1518
+ "PASS",
1519
+ "FAIL",
1520
+ "WARN"
1521
+ ]
1522
+ },
1523
+ "notes": {
1524
+ "type": "string"
1525
+ }
1526
+ },
1527
+ "required": [
1528
+ "check_id",
1529
+ "description",
1530
+ "status"
1531
+ ],
1532
+ "additionalProperties": false
1533
+ },
1534
+ "description": "D-01..D-18 check results."
1535
+ },
1536
+ "errors": {
1537
+ "type": "array",
1538
+ "items": {
1539
+ "type": "string"
1540
+ },
1541
+ "description": "List of FAIL error messages."
1542
+ }
1543
+ },
1544
+ "required": [
1545
+ "valid",
1546
+ "checks",
1547
+ "errors"
1548
+ ],
1549
+ "additionalProperties": false,
1550
+ "description": "Deployment doc validation result against D-01..D-18."
1551
+ },
1552
+ "saved": {
1553
+ "type": "boolean",
1554
+ "description": "Whether the markdown was persisted to SQLite project_documents table."
1555
+ }
1556
+ },
1557
+ "required": [
1558
+ "action",
1559
+ "markdown",
1560
+ "validation",
1561
+ "saved"
1562
+ ],
1563
+ "additionalProperties": false
2880
1564
  }
2881
1565
  ],
2882
1566
  "description": "Query result — shape depends on action"