@mhome/app-facade-protocol 1.155.0 → 1.156.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.
- package/contract/suggestion-v1.md +52 -11
- package/fixtures/suggestion.conformance.json +498 -2
- package/manifest/app-facade.v1.json +1 -1
- package/manifest/authorization.v1.json +1 -1
- package/manifest/host-provision-targets.v1.json +1 -1
- package/manifest/hub-targets.v1.json +1 -1
- package/manifest/pod-targets.v1.json +1 -1
- package/manifest/routing.v1.json +1 -1
- package/manifest/targets.v1.json +1 -1
- package/package.json +1 -1
- package/protocol.json +1 -1
- package/schema/suggestion.v1.schema.json +138 -0
|
@@ -50,6 +50,24 @@ ownership, check enabled settings/model/budget, and restrict reads and validatio
|
|
|
50
50
|
to that Space. Explicit generation additionally checks the requesting user's
|
|
51
51
|
Space access. Shape validation cannot substitute for those checks.
|
|
52
52
|
|
|
53
|
+
## Cloud transport
|
|
54
|
+
|
|
55
|
+
The existing authenticated execution envelope has a `suggestion` family with
|
|
56
|
+
`generate`, `read`, `completed`, `failed` and `cancel` messages. Each carries the
|
|
57
|
+
trusted Suggestion invocation and existing dispatch/session binding, without
|
|
58
|
+
inventing a conversation identity. `generate` freezes the collected input, facts
|
|
59
|
+
and model plan. `completed` carries registered result documents, candidate
|
|
60
|
+
failures and measured usage. Input/result JSON remains opaque to the leaf wire
|
|
61
|
+
crate; the shared generator and Space host validate the registered business
|
|
62
|
+
models. Nested transport facts, plans, errors and usage remain strict.
|
|
63
|
+
|
|
64
|
+
Lion authorizes callback reads against the stored active invocation and dispatch,
|
|
65
|
+
then uses existing Facade authorization. Explicit callbacks retain the requesting
|
|
66
|
+
user. Internal scheduled authorization is a separate host integration; recognizing
|
|
67
|
+
its wire shape does not enable periodic generation or grant service authority.
|
|
68
|
+
Terminal delivery is best-effort with bounded execution deadlines, without a
|
|
69
|
+
second durable outbox, reasoning replay or write replay.
|
|
70
|
+
|
|
53
71
|
## Generic content and validation
|
|
54
72
|
|
|
55
73
|
`SuggestionDraft<C>` contains title, summary, reasons, evidence, optional expiry,
|
|
@@ -102,7 +120,13 @@ The first Automation handler declares `APPLY`: a newly created Automation is
|
|
|
102
120
|
saved and enabled; an update preserves the existing Automation's enabled or
|
|
103
121
|
stopped state within the editing boundary. A deliberately stopped Automation must
|
|
104
122
|
not be re-enabled by applying an update. UI labels state the resulting action.
|
|
105
|
-
|
|
123
|
+
Handling is one-shot. After an admitted action ends, its Suggestion is `RESOLVED`
|
|
124
|
+
regardless of success, partial success, failure or an unknown write outcome. For
|
|
125
|
+
example, saving the new Automation and failing to enable it records a `partial`
|
|
126
|
+
result with its Automation ID and the enable failure. The UI says what succeeded
|
|
127
|
+
and failed and offers the ordinary Automation entrypoint. It does not leave a
|
|
128
|
+
pending Suggestion, retry button, recovery task or compensation workflow.
|
|
129
|
+
Enabling a new task-flow Automation does not mean executing its task immediately.
|
|
106
130
|
|
|
107
131
|
Other type handlers declare their own actions. The common framework does not
|
|
108
132
|
equate acceptance with enabling or running a resource. UI opens the already
|
|
@@ -134,19 +158,27 @@ unbounded run log, a retry service or catch-up runs for every missed period.
|
|
|
134
158
|
|
|
135
159
|
## Suggestion lifecycle and handling
|
|
136
160
|
|
|
137
|
-
`PENDING` means available for review, `RESOLVED` means
|
|
138
|
-
|
|
161
|
+
`PENDING` means available for review, `RESOLVED` means one-shot handling has ended,
|
|
162
|
+
`DISMISSED` records rejection, and `EXPIRED` means no longer applicable.
|
|
139
163
|
Resolved/dismissed records require a backend resolution. Pending/expired records
|
|
140
164
|
have none. Resolution records the action, existing operation ID, time, canonical
|
|
141
|
-
actor
|
|
142
|
-
|
|
165
|
+
actor, resulting resource IDs/feedback, and the full canonical `FacadeResponse`
|
|
166
|
+
in `result`. Handling lifecycle and business outcome are independent: `RESOLVED`
|
|
167
|
+
is not a success claim or proof that a physical device reached its target.
|
|
168
|
+
An unknown outcome uses the existing error/problem representation, not a new
|
|
169
|
+
status or recovery state. New action handlers always write `result`; older receipts
|
|
170
|
+
without it remain readable and must not be inferred to have succeeded. Summary
|
|
171
|
+
`outcome` projects only the recorded result status, without copying its details.
|
|
143
172
|
|
|
144
173
|
Handling and feedback bind `suggestionId` plus `expectedVersion` to what the
|
|
145
174
|
user reviewed. Business authorization and existing prepare/commit or idempotency
|
|
146
175
|
protocols remain authoritative. The backend checks expiry, current resources and
|
|
147
|
-
type-specific preconditions before performing the declared action.
|
|
148
|
-
|
|
149
|
-
|
|
176
|
+
type-specific preconditions before performing the declared action. An invalid or
|
|
177
|
+
unauthorized request is rejected before admission; it does not consume the
|
|
178
|
+
Suggestion. Once admitted, handling may run at most once. Repeated requests return
|
|
179
|
+
the persisted receipt instead of repeating the business action; an unknown outcome
|
|
180
|
+
does not justify write replay. A host must not claim exactly-once execution across
|
|
181
|
+
an unconfirmed storage failure. The model cannot create its own handler or action.
|
|
150
182
|
|
|
151
183
|
Next-run context includes current facts, pending Suggestions and recent decisions
|
|
152
184
|
and actual results, plus a bounded summary. Do not append all old prompts forever
|
|
@@ -167,14 +199,23 @@ The following are contract declarations, not a current support inventory.
|
|
|
167
199
|
| `/app/suggestion/generation/get` | `GenerationGetInput`: optional `runId` | `GenerationGetOutput`: current/latest run, or null before any run |
|
|
168
200
|
| `/app/suggestion/list` | `ListInput`: type/status filters, cursor, limit (default 50, maximum 100) | `ListOutput`: summaries and optional cursor |
|
|
169
201
|
| `/app/suggestion/detail/get` | `DetailInput`: `suggestionId` | Complete typed Suggestion |
|
|
170
|
-
| `/app/suggestion/handle` | `HandleInput`: ID, expected version, declared action |
|
|
202
|
+
| `/app/suggestion/handle` | `HandleInput`: ID, expected version, declared action | Canonical business result, also stored in the resolution |
|
|
171
203
|
| `/app/suggestion/feedback` | `FeedbackInput`: ID, expected version, `DISMISS`, optional comment | Updated Suggestion summary on completed success |
|
|
204
|
+
| `/app/suggestion/settings/get` | Empty input | `SuggestionSettings` |
|
|
205
|
+
| `/app/suggestion/settings/save` | `SuggestionSettings`: explicit `enabled` boolean | Saved `SuggestionSettings` |
|
|
172
206
|
|
|
173
207
|
An explicit unknown or no-longer-retained run ID returns `NOT_FOUND`; it must not
|
|
174
208
|
silently return an unrelated run. Lists are bounded and omit script bundles,
|
|
175
209
|
evidence and resolutions; detail reads return the saved complete content.
|
|
176
|
-
Business errors/partial or unknown outcomes use the canonical Facade result
|
|
177
|
-
must not
|
|
210
|
+
Business errors/partial or unknown outcomes use the canonical Facade result;
|
|
211
|
+
marking handling finished must not replace that result with `success`.
|
|
212
|
+
|
|
213
|
+
Settings belong to the authorized Space. Absent storage defaults to `enabled: true`.
|
|
214
|
+
The switch controls periodic generation only; explicit authorized generation remains
|
|
215
|
+
available. The UI places it in the existing Agent Settings page. Turning it off
|
|
216
|
+
prevents future periodic admissions; it does not delete results or replay/cancel
|
|
217
|
+
an admitted run. Settings follow the Space migration/deletion boundary. This adds
|
|
218
|
+
no per-Suggestion timer, follow-up task or separate scheduler per output type.
|
|
178
219
|
|
|
179
220
|
## Conformance
|
|
180
221
|
|
|
@@ -420,7 +420,7 @@
|
|
|
420
420
|
"value": {
|
|
421
421
|
"type": "AUTOMATION",
|
|
422
422
|
"operation": "CREATE",
|
|
423
|
-
"title": "
|
|
423
|
+
"title": "\ufeff",
|
|
424
424
|
"summary": "Suggest a lower evening brightness",
|
|
425
425
|
"reasons": [
|
|
426
426
|
"Observed manual adjustments after the evening routine"
|
|
@@ -443,6 +443,310 @@
|
|
|
443
443
|
"parseResults": []
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"name": "handled success is terminal",
|
|
449
|
+
"type": "AutomationSuggestion",
|
|
450
|
+
"value": {
|
|
451
|
+
"type": "AUTOMATION",
|
|
452
|
+
"operation": "CREATE",
|
|
453
|
+
"title": "Evening lighting",
|
|
454
|
+
"summary": "Suggest a lower evening brightness",
|
|
455
|
+
"reasons": [
|
|
456
|
+
"Observed manual adjustments after the evening routine"
|
|
457
|
+
],
|
|
458
|
+
"evidence": [
|
|
459
|
+
{
|
|
460
|
+
"sourceType": "BEHAVIOR",
|
|
461
|
+
"sourceId": "fixture-operation-1",
|
|
462
|
+
"occurredAt": 1000,
|
|
463
|
+
"excerpt": "The user selected brightness 30 after brightness 80"
|
|
464
|
+
}
|
|
465
|
+
],
|
|
466
|
+
"script": {
|
|
467
|
+
"script": "name: Contract fixture\ntask: []\n",
|
|
468
|
+
"scripts": {
|
|
469
|
+
"lighting": "// Fixture source bundle\n",
|
|
470
|
+
"empty": ""
|
|
471
|
+
},
|
|
472
|
+
"sdkVersion": "test-sdk-1",
|
|
473
|
+
"parseResults": []
|
|
474
|
+
},
|
|
475
|
+
"id": "fixture-suggestion-1",
|
|
476
|
+
"spaceId": "fixture-space",
|
|
477
|
+
"runId": "fixture-run",
|
|
478
|
+
"version": 1,
|
|
479
|
+
"status": "RESOLVED",
|
|
480
|
+
"createdAt": 2000,
|
|
481
|
+
"updatedAt": 3000,
|
|
482
|
+
"resolution": {
|
|
483
|
+
"action": "APPLY",
|
|
484
|
+
"operationId": "fixture-apply",
|
|
485
|
+
"handledAt": 3000,
|
|
486
|
+
"actor": {
|
|
487
|
+
"kind": "user",
|
|
488
|
+
"userId": "fixture-user"
|
|
489
|
+
},
|
|
490
|
+
"resourceIds": {
|
|
491
|
+
"automationId": "fixture-automation"
|
|
492
|
+
},
|
|
493
|
+
"result": {
|
|
494
|
+
"status": "success",
|
|
495
|
+
"data": {
|
|
496
|
+
"automationId": "fixture-automation",
|
|
497
|
+
"enabled": true
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"name": "summary shows success outcome",
|
|
505
|
+
"type": "SuggestionSummary",
|
|
506
|
+
"value": {
|
|
507
|
+
"id": "fixture-suggestion-1",
|
|
508
|
+
"type": "AUTOMATION",
|
|
509
|
+
"version": 1,
|
|
510
|
+
"title": "Evening lighting",
|
|
511
|
+
"summary": "Suggest a lower evening brightness",
|
|
512
|
+
"status": "RESOLVED",
|
|
513
|
+
"createdAt": 2000,
|
|
514
|
+
"updatedAt": 3000,
|
|
515
|
+
"outcome": "success"
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"name": "handled partial is terminal",
|
|
520
|
+
"type": "AutomationSuggestion",
|
|
521
|
+
"value": {
|
|
522
|
+
"type": "AUTOMATION",
|
|
523
|
+
"operation": "CREATE",
|
|
524
|
+
"title": "Evening lighting",
|
|
525
|
+
"summary": "Suggest a lower evening brightness",
|
|
526
|
+
"reasons": [
|
|
527
|
+
"Observed manual adjustments after the evening routine"
|
|
528
|
+
],
|
|
529
|
+
"evidence": [
|
|
530
|
+
{
|
|
531
|
+
"sourceType": "BEHAVIOR",
|
|
532
|
+
"sourceId": "fixture-operation-1",
|
|
533
|
+
"occurredAt": 1000,
|
|
534
|
+
"excerpt": "The user selected brightness 30 after brightness 80"
|
|
535
|
+
}
|
|
536
|
+
],
|
|
537
|
+
"script": {
|
|
538
|
+
"script": "name: Contract fixture\ntask: []\n",
|
|
539
|
+
"scripts": {
|
|
540
|
+
"lighting": "// Fixture source bundle\n",
|
|
541
|
+
"empty": ""
|
|
542
|
+
},
|
|
543
|
+
"sdkVersion": "test-sdk-1",
|
|
544
|
+
"parseResults": []
|
|
545
|
+
},
|
|
546
|
+
"id": "fixture-suggestion-1",
|
|
547
|
+
"spaceId": "fixture-space",
|
|
548
|
+
"runId": "fixture-run",
|
|
549
|
+
"version": 1,
|
|
550
|
+
"status": "RESOLVED",
|
|
551
|
+
"createdAt": 2000,
|
|
552
|
+
"updatedAt": 3000,
|
|
553
|
+
"resolution": {
|
|
554
|
+
"action": "APPLY",
|
|
555
|
+
"operationId": "fixture-apply",
|
|
556
|
+
"handledAt": 3000,
|
|
557
|
+
"actor": {
|
|
558
|
+
"kind": "user",
|
|
559
|
+
"userId": "fixture-user"
|
|
560
|
+
},
|
|
561
|
+
"resourceIds": {
|
|
562
|
+
"automationId": "fixture-automation"
|
|
563
|
+
},
|
|
564
|
+
"result": {
|
|
565
|
+
"status": "partial",
|
|
566
|
+
"data": {
|
|
567
|
+
"automationId": "fixture-automation",
|
|
568
|
+
"saved": true
|
|
569
|
+
},
|
|
570
|
+
"warnings": [
|
|
571
|
+
{
|
|
572
|
+
"code": "ENABLE_FAILED",
|
|
573
|
+
"message": "Saved, but enabling failed"
|
|
574
|
+
}
|
|
575
|
+
]
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"name": "summary shows partial outcome",
|
|
582
|
+
"type": "SuggestionSummary",
|
|
583
|
+
"value": {
|
|
584
|
+
"id": "fixture-suggestion-1",
|
|
585
|
+
"type": "AUTOMATION",
|
|
586
|
+
"version": 1,
|
|
587
|
+
"title": "Evening lighting",
|
|
588
|
+
"summary": "Suggest a lower evening brightness",
|
|
589
|
+
"status": "RESOLVED",
|
|
590
|
+
"createdAt": 2000,
|
|
591
|
+
"updatedAt": 3000,
|
|
592
|
+
"outcome": "partial"
|
|
593
|
+
}
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
"name": "handled error is terminal",
|
|
597
|
+
"type": "AutomationSuggestion",
|
|
598
|
+
"value": {
|
|
599
|
+
"type": "AUTOMATION",
|
|
600
|
+
"operation": "CREATE",
|
|
601
|
+
"title": "Evening lighting",
|
|
602
|
+
"summary": "Suggest a lower evening brightness",
|
|
603
|
+
"reasons": [
|
|
604
|
+
"Observed manual adjustments after the evening routine"
|
|
605
|
+
],
|
|
606
|
+
"evidence": [
|
|
607
|
+
{
|
|
608
|
+
"sourceType": "BEHAVIOR",
|
|
609
|
+
"sourceId": "fixture-operation-1",
|
|
610
|
+
"occurredAt": 1000,
|
|
611
|
+
"excerpt": "The user selected brightness 30 after brightness 80"
|
|
612
|
+
}
|
|
613
|
+
],
|
|
614
|
+
"script": {
|
|
615
|
+
"script": "name: Contract fixture\ntask: []\n",
|
|
616
|
+
"scripts": {
|
|
617
|
+
"lighting": "// Fixture source bundle\n",
|
|
618
|
+
"empty": ""
|
|
619
|
+
},
|
|
620
|
+
"sdkVersion": "test-sdk-1",
|
|
621
|
+
"parseResults": []
|
|
622
|
+
},
|
|
623
|
+
"id": "fixture-suggestion-1",
|
|
624
|
+
"spaceId": "fixture-space",
|
|
625
|
+
"runId": "fixture-run",
|
|
626
|
+
"version": 1,
|
|
627
|
+
"status": "RESOLVED",
|
|
628
|
+
"createdAt": 2000,
|
|
629
|
+
"updatedAt": 3000,
|
|
630
|
+
"resolution": {
|
|
631
|
+
"action": "APPLY",
|
|
632
|
+
"operationId": "fixture-apply",
|
|
633
|
+
"handledAt": 3000,
|
|
634
|
+
"actor": {
|
|
635
|
+
"kind": "user",
|
|
636
|
+
"userId": "fixture-user"
|
|
637
|
+
},
|
|
638
|
+
"resourceIds": {
|
|
639
|
+
"automationId": "fixture-automation"
|
|
640
|
+
},
|
|
641
|
+
"result": {
|
|
642
|
+
"status": "error",
|
|
643
|
+
"error": {
|
|
644
|
+
"code": "INVALID_SCRIPT",
|
|
645
|
+
"message": "Script validation failed"
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"name": "summary shows error outcome",
|
|
653
|
+
"type": "SuggestionSummary",
|
|
654
|
+
"value": {
|
|
655
|
+
"id": "fixture-suggestion-1",
|
|
656
|
+
"type": "AUTOMATION",
|
|
657
|
+
"version": 1,
|
|
658
|
+
"title": "Evening lighting",
|
|
659
|
+
"summary": "Suggest a lower evening brightness",
|
|
660
|
+
"status": "RESOLVED",
|
|
661
|
+
"createdAt": 2000,
|
|
662
|
+
"updatedAt": 3000,
|
|
663
|
+
"outcome": "error"
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
"name": "handled unknown is terminal",
|
|
668
|
+
"type": "AutomationSuggestion",
|
|
669
|
+
"value": {
|
|
670
|
+
"type": "AUTOMATION",
|
|
671
|
+
"operation": "CREATE",
|
|
672
|
+
"title": "Evening lighting",
|
|
673
|
+
"summary": "Suggest a lower evening brightness",
|
|
674
|
+
"reasons": [
|
|
675
|
+
"Observed manual adjustments after the evening routine"
|
|
676
|
+
],
|
|
677
|
+
"evidence": [
|
|
678
|
+
{
|
|
679
|
+
"sourceType": "BEHAVIOR",
|
|
680
|
+
"sourceId": "fixture-operation-1",
|
|
681
|
+
"occurredAt": 1000,
|
|
682
|
+
"excerpt": "The user selected brightness 30 after brightness 80"
|
|
683
|
+
}
|
|
684
|
+
],
|
|
685
|
+
"script": {
|
|
686
|
+
"script": "name: Contract fixture\ntask: []\n",
|
|
687
|
+
"scripts": {
|
|
688
|
+
"lighting": "// Fixture source bundle\n",
|
|
689
|
+
"empty": ""
|
|
690
|
+
},
|
|
691
|
+
"sdkVersion": "test-sdk-1",
|
|
692
|
+
"parseResults": []
|
|
693
|
+
},
|
|
694
|
+
"id": "fixture-suggestion-1",
|
|
695
|
+
"spaceId": "fixture-space",
|
|
696
|
+
"runId": "fixture-run",
|
|
697
|
+
"version": 1,
|
|
698
|
+
"status": "RESOLVED",
|
|
699
|
+
"createdAt": 2000,
|
|
700
|
+
"updatedAt": 3000,
|
|
701
|
+
"resolution": {
|
|
702
|
+
"action": "APPLY",
|
|
703
|
+
"operationId": "fixture-apply",
|
|
704
|
+
"handledAt": 3000,
|
|
705
|
+
"actor": {
|
|
706
|
+
"kind": "user",
|
|
707
|
+
"userId": "fixture-user"
|
|
708
|
+
},
|
|
709
|
+
"resourceIds": {
|
|
710
|
+
"automationId": "fixture-automation"
|
|
711
|
+
},
|
|
712
|
+
"result": {
|
|
713
|
+
"status": "error",
|
|
714
|
+
"error": {
|
|
715
|
+
"code": "OUTCOME_UNKNOWN",
|
|
716
|
+
"message": "The write outcome is unknown"
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
"name": "summary shows unknown outcome",
|
|
724
|
+
"type": "SuggestionSummary",
|
|
725
|
+
"value": {
|
|
726
|
+
"id": "fixture-suggestion-1",
|
|
727
|
+
"type": "AUTOMATION",
|
|
728
|
+
"version": 1,
|
|
729
|
+
"title": "Evening lighting",
|
|
730
|
+
"summary": "Suggest a lower evening brightness",
|
|
731
|
+
"status": "RESOLVED",
|
|
732
|
+
"createdAt": 2000,
|
|
733
|
+
"updatedAt": 3000,
|
|
734
|
+
"outcome": "error"
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
"name": "explicit periodic settings True",
|
|
739
|
+
"type": "SuggestionSettings",
|
|
740
|
+
"value": {
|
|
741
|
+
"enabled": true
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
"name": "explicit periodic settings False",
|
|
746
|
+
"type": "SuggestionSettings",
|
|
747
|
+
"value": {
|
|
748
|
+
"enabled": false
|
|
749
|
+
}
|
|
446
750
|
}
|
|
447
751
|
],
|
|
448
752
|
"invalid": [
|
|
@@ -918,7 +1222,57 @@
|
|
|
918
1222
|
"value": {
|
|
919
1223
|
"type": "AUTOMATION",
|
|
920
1224
|
"operation": "CREATE",
|
|
921
|
-
"title": "
|
|
1225
|
+
"title": "\u0085",
|
|
1226
|
+
"summary": "Suggest a lower evening brightness",
|
|
1227
|
+
"reasons": [
|
|
1228
|
+
"Observed manual adjustments after the evening routine"
|
|
1229
|
+
],
|
|
1230
|
+
"evidence": [
|
|
1231
|
+
{
|
|
1232
|
+
"sourceType": "BEHAVIOR",
|
|
1233
|
+
"sourceId": "fixture-operation-1",
|
|
1234
|
+
"occurredAt": 1000,
|
|
1235
|
+
"excerpt": "The user selected brightness 30 after brightness 80"
|
|
1236
|
+
}
|
|
1237
|
+
],
|
|
1238
|
+
"script": {
|
|
1239
|
+
"script": "name: Contract fixture\ntask: []\n",
|
|
1240
|
+
"scripts": {
|
|
1241
|
+
"lighting": "// Fixture source bundle\n",
|
|
1242
|
+
"empty": ""
|
|
1243
|
+
},
|
|
1244
|
+
"sdkVersion": "test-sdk-1",
|
|
1245
|
+
"parseResults": []
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
"name": "missing enabled",
|
|
1251
|
+
"type": "SuggestionSettings",
|
|
1252
|
+
"value": {}
|
|
1253
|
+
},
|
|
1254
|
+
{
|
|
1255
|
+
"name": "not boolean",
|
|
1256
|
+
"type": "SuggestionSettings",
|
|
1257
|
+
"value": {
|
|
1258
|
+
"enabled": "true"
|
|
1259
|
+
}
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
"name": "caller-selected Space",
|
|
1263
|
+
"type": "SuggestionSettings",
|
|
1264
|
+
"value": {
|
|
1265
|
+
"enabled": true,
|
|
1266
|
+
"spaceId": "other"
|
|
1267
|
+
}
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
"name": "partial missing data",
|
|
1271
|
+
"type": "AutomationSuggestion",
|
|
1272
|
+
"value": {
|
|
1273
|
+
"type": "AUTOMATION",
|
|
1274
|
+
"operation": "CREATE",
|
|
1275
|
+
"title": "Evening lighting",
|
|
922
1276
|
"summary": "Suggest a lower evening brightness",
|
|
923
1277
|
"reasons": [
|
|
924
1278
|
"Observed manual adjustments after the evening routine"
|
|
@@ -939,8 +1293,150 @@
|
|
|
939
1293
|
},
|
|
940
1294
|
"sdkVersion": "test-sdk-1",
|
|
941
1295
|
"parseResults": []
|
|
1296
|
+
},
|
|
1297
|
+
"id": "fixture-suggestion-1",
|
|
1298
|
+
"spaceId": "fixture-space",
|
|
1299
|
+
"runId": "fixture-run",
|
|
1300
|
+
"version": 1,
|
|
1301
|
+
"status": "RESOLVED",
|
|
1302
|
+
"createdAt": 2000,
|
|
1303
|
+
"updatedAt": 3000,
|
|
1304
|
+
"resolution": {
|
|
1305
|
+
"action": "SAVE",
|
|
1306
|
+
"operationId": "fixture-apply",
|
|
1307
|
+
"handledAt": 3000,
|
|
1308
|
+
"actor": {
|
|
1309
|
+
"kind": "user",
|
|
1310
|
+
"userId": "fixture-user"
|
|
1311
|
+
},
|
|
1312
|
+
"resourceIds": {
|
|
1313
|
+
"automationId": "fixture-automation"
|
|
1314
|
+
},
|
|
1315
|
+
"result": {
|
|
1316
|
+
"status": "partial"
|
|
1317
|
+
}
|
|
942
1318
|
}
|
|
943
1319
|
}
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
"name": "unknown not a canonical status",
|
|
1323
|
+
"type": "AutomationSuggestion",
|
|
1324
|
+
"value": {
|
|
1325
|
+
"type": "AUTOMATION",
|
|
1326
|
+
"operation": "CREATE",
|
|
1327
|
+
"title": "Evening lighting",
|
|
1328
|
+
"summary": "Suggest a lower evening brightness",
|
|
1329
|
+
"reasons": [
|
|
1330
|
+
"Observed manual adjustments after the evening routine"
|
|
1331
|
+
],
|
|
1332
|
+
"evidence": [
|
|
1333
|
+
{
|
|
1334
|
+
"sourceType": "BEHAVIOR",
|
|
1335
|
+
"sourceId": "fixture-operation-1",
|
|
1336
|
+
"occurredAt": 1000,
|
|
1337
|
+
"excerpt": "The user selected brightness 30 after brightness 80"
|
|
1338
|
+
}
|
|
1339
|
+
],
|
|
1340
|
+
"script": {
|
|
1341
|
+
"script": "name: Contract fixture\ntask: []\n",
|
|
1342
|
+
"scripts": {
|
|
1343
|
+
"lighting": "// Fixture source bundle\n",
|
|
1344
|
+
"empty": ""
|
|
1345
|
+
},
|
|
1346
|
+
"sdkVersion": "test-sdk-1",
|
|
1347
|
+
"parseResults": []
|
|
1348
|
+
},
|
|
1349
|
+
"id": "fixture-suggestion-1",
|
|
1350
|
+
"spaceId": "fixture-space",
|
|
1351
|
+
"runId": "fixture-run",
|
|
1352
|
+
"version": 1,
|
|
1353
|
+
"status": "RESOLVED",
|
|
1354
|
+
"createdAt": 2000,
|
|
1355
|
+
"updatedAt": 3000,
|
|
1356
|
+
"resolution": {
|
|
1357
|
+
"action": "SAVE",
|
|
1358
|
+
"operationId": "fixture-apply",
|
|
1359
|
+
"handledAt": 3000,
|
|
1360
|
+
"actor": {
|
|
1361
|
+
"kind": "user",
|
|
1362
|
+
"userId": "fixture-user"
|
|
1363
|
+
},
|
|
1364
|
+
"resourceIds": {
|
|
1365
|
+
"automationId": "fixture-automation"
|
|
1366
|
+
},
|
|
1367
|
+
"result": {
|
|
1368
|
+
"status": "unknown"
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
"name": "result extra fields",
|
|
1375
|
+
"type": "AutomationSuggestion",
|
|
1376
|
+
"value": {
|
|
1377
|
+
"type": "AUTOMATION",
|
|
1378
|
+
"operation": "CREATE",
|
|
1379
|
+
"title": "Evening lighting",
|
|
1380
|
+
"summary": "Suggest a lower evening brightness",
|
|
1381
|
+
"reasons": [
|
|
1382
|
+
"Observed manual adjustments after the evening routine"
|
|
1383
|
+
],
|
|
1384
|
+
"evidence": [
|
|
1385
|
+
{
|
|
1386
|
+
"sourceType": "BEHAVIOR",
|
|
1387
|
+
"sourceId": "fixture-operation-1",
|
|
1388
|
+
"occurredAt": 1000,
|
|
1389
|
+
"excerpt": "The user selected brightness 30 after brightness 80"
|
|
1390
|
+
}
|
|
1391
|
+
],
|
|
1392
|
+
"script": {
|
|
1393
|
+
"script": "name: Contract fixture\ntask: []\n",
|
|
1394
|
+
"scripts": {
|
|
1395
|
+
"lighting": "// Fixture source bundle\n",
|
|
1396
|
+
"empty": ""
|
|
1397
|
+
},
|
|
1398
|
+
"sdkVersion": "test-sdk-1",
|
|
1399
|
+
"parseResults": []
|
|
1400
|
+
},
|
|
1401
|
+
"id": "fixture-suggestion-1",
|
|
1402
|
+
"spaceId": "fixture-space",
|
|
1403
|
+
"runId": "fixture-run",
|
|
1404
|
+
"version": 1,
|
|
1405
|
+
"status": "RESOLVED",
|
|
1406
|
+
"createdAt": 2000,
|
|
1407
|
+
"updatedAt": 3000,
|
|
1408
|
+
"resolution": {
|
|
1409
|
+
"action": "SAVE",
|
|
1410
|
+
"operationId": "fixture-apply",
|
|
1411
|
+
"handledAt": 3000,
|
|
1412
|
+
"actor": {
|
|
1413
|
+
"kind": "user",
|
|
1414
|
+
"userId": "fixture-user"
|
|
1415
|
+
},
|
|
1416
|
+
"resourceIds": {
|
|
1417
|
+
"automationId": "fixture-automation"
|
|
1418
|
+
},
|
|
1419
|
+
"result": {
|
|
1420
|
+
"status": "success",
|
|
1421
|
+
"retry": true
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
"name": "summary rejects invented outcome",
|
|
1428
|
+
"type": "SuggestionSummary",
|
|
1429
|
+
"value": {
|
|
1430
|
+
"id": "fixture-suggestion-1",
|
|
1431
|
+
"type": "AUTOMATION",
|
|
1432
|
+
"version": 1,
|
|
1433
|
+
"title": "Evening lighting",
|
|
1434
|
+
"summary": "Suggest a lower evening brightness",
|
|
1435
|
+
"status": "RESOLVED",
|
|
1436
|
+
"createdAt": 2000,
|
|
1437
|
+
"updatedAt": 3000,
|
|
1438
|
+
"outcome": "unknown"
|
|
1439
|
+
}
|
|
944
1440
|
}
|
|
945
1441
|
]
|
|
946
1442
|
}
|
package/manifest/routing.v1.json
CHANGED
package/manifest/targets.v1.json
CHANGED
package/package.json
CHANGED
package/protocol.json
CHANGED
|
@@ -163,6 +163,16 @@
|
|
|
163
163
|
"type": "null"
|
|
164
164
|
}
|
|
165
165
|
]
|
|
166
|
+
},
|
|
167
|
+
"result": {
|
|
168
|
+
"anyOf": [
|
|
169
|
+
{
|
|
170
|
+
"$ref": "#/$defs/ActionResult"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"type": "null"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
166
176
|
}
|
|
167
177
|
},
|
|
168
178
|
"required": [
|
|
@@ -891,6 +901,21 @@
|
|
|
891
901
|
"type": "null"
|
|
892
902
|
}
|
|
893
903
|
]
|
|
904
|
+
},
|
|
905
|
+
"outcome": {
|
|
906
|
+
"anyOf": [
|
|
907
|
+
{
|
|
908
|
+
"enum": [
|
|
909
|
+
"success",
|
|
910
|
+
"partial",
|
|
911
|
+
"error",
|
|
912
|
+
"cancelled"
|
|
913
|
+
]
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
"type": "null"
|
|
917
|
+
}
|
|
918
|
+
]
|
|
894
919
|
}
|
|
895
920
|
},
|
|
896
921
|
"required": [
|
|
@@ -1208,6 +1233,119 @@
|
|
|
1208
1233
|
"required": [
|
|
1209
1234
|
"run"
|
|
1210
1235
|
]
|
|
1236
|
+
},
|
|
1237
|
+
"ActionResult": {
|
|
1238
|
+
"title": "App Facade final response",
|
|
1239
|
+
"oneOf": [
|
|
1240
|
+
{
|
|
1241
|
+
"type": "object",
|
|
1242
|
+
"additionalProperties": false,
|
|
1243
|
+
"required": [
|
|
1244
|
+
"status"
|
|
1245
|
+
],
|
|
1246
|
+
"properties": {
|
|
1247
|
+
"status": {
|
|
1248
|
+
"const": "success"
|
|
1249
|
+
},
|
|
1250
|
+
"data": true,
|
|
1251
|
+
"warnings": {
|
|
1252
|
+
"type": "array",
|
|
1253
|
+
"items": {
|
|
1254
|
+
"$ref": "#/$defs/ActionResult/$defs/problem"
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
"type": "object",
|
|
1261
|
+
"additionalProperties": false,
|
|
1262
|
+
"required": [
|
|
1263
|
+
"status",
|
|
1264
|
+
"data"
|
|
1265
|
+
],
|
|
1266
|
+
"properties": {
|
|
1267
|
+
"status": {
|
|
1268
|
+
"const": "partial"
|
|
1269
|
+
},
|
|
1270
|
+
"data": true,
|
|
1271
|
+
"warnings": {
|
|
1272
|
+
"type": "array",
|
|
1273
|
+
"items": {
|
|
1274
|
+
"$ref": "#/$defs/ActionResult/$defs/problem"
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
"type": "object",
|
|
1281
|
+
"additionalProperties": false,
|
|
1282
|
+
"required": [
|
|
1283
|
+
"status",
|
|
1284
|
+
"error"
|
|
1285
|
+
],
|
|
1286
|
+
"properties": {
|
|
1287
|
+
"status": {
|
|
1288
|
+
"const": "error"
|
|
1289
|
+
},
|
|
1290
|
+
"error": {
|
|
1291
|
+
"$ref": "#/$defs/ActionResult/$defs/problem"
|
|
1292
|
+
},
|
|
1293
|
+
"data": {
|
|
1294
|
+
"type": "string"
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
},
|
|
1298
|
+
{
|
|
1299
|
+
"type": "object",
|
|
1300
|
+
"additionalProperties": false,
|
|
1301
|
+
"required": [
|
|
1302
|
+
"status"
|
|
1303
|
+
],
|
|
1304
|
+
"properties": {
|
|
1305
|
+
"status": {
|
|
1306
|
+
"const": "cancelled"
|
|
1307
|
+
},
|
|
1308
|
+
"warnings": {
|
|
1309
|
+
"type": "array",
|
|
1310
|
+
"items": {
|
|
1311
|
+
"$ref": "#/$defs/ActionResult/$defs/problem"
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
],
|
|
1317
|
+
"$defs": {
|
|
1318
|
+
"problem": {
|
|
1319
|
+
"type": "object",
|
|
1320
|
+
"additionalProperties": false,
|
|
1321
|
+
"required": [
|
|
1322
|
+
"code",
|
|
1323
|
+
"message"
|
|
1324
|
+
],
|
|
1325
|
+
"properties": {
|
|
1326
|
+
"code": {
|
|
1327
|
+
"type": "string"
|
|
1328
|
+
},
|
|
1329
|
+
"message": {
|
|
1330
|
+
"type": "string"
|
|
1331
|
+
},
|
|
1332
|
+
"details": true
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
},
|
|
1337
|
+
"SuggestionSettings": {
|
|
1338
|
+
"type": "object",
|
|
1339
|
+
"properties": {
|
|
1340
|
+
"enabled": {
|
|
1341
|
+
"type": "boolean",
|
|
1342
|
+
"default": true
|
|
1343
|
+
}
|
|
1344
|
+
},
|
|
1345
|
+
"required": [
|
|
1346
|
+
"enabled"
|
|
1347
|
+
],
|
|
1348
|
+
"additionalProperties": false
|
|
1211
1349
|
}
|
|
1212
1350
|
}
|
|
1213
1351
|
}
|