@mhome/app-facade-protocol 1.156.0 → 1.157.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.
@@ -60,8 +60,18 @@ An already absent and cleaned definition is a completed delete target.
60
60
  completed before the stop request keeps its actual outcome; ordinary success
61
61
  may already have discarded its details. Already performed effects are not undone.
62
62
  A started external call without a result is uncertain, not a confirmed failure.
63
- - `/app/automation/diagnostic/get` takes `{automationId}` and lists retained
64
- execution metadata across all threads, newest first. Bodies are read separately.
63
+ - `/app/automation/diagnostic/get` takes `{automationId, cursor?, limit?}` and returns
64
+ `{diagnostics, nextCursor}`. The default page size is 50, with a maximum of 100.
65
+ Follow `nextCursor` until absent, including when a filtered page is empty.
66
+ Cursors are opaque and bound to the authorized Space and Automation. Metadata
67
+ is ordered by availability (or capture time for active records), newest first.
68
+ Bodies are read separately; expired records are unavailable even before physical cleanup.
69
+ Terminal metadata includes `availableAt` and `expiresAt`. Retain failed/interrupted,
70
+ DEBUG and explicitly stopped/captured executions for 24 hours on cloud and 72 hours
71
+ locally, from the first completed publication. Reads and retries do not extend expiry.
72
+ Active captures and pending terminal publication are protected. Ordinary successful
73
+ runs create no run-history event and retain no completed execution detail; their
74
+ checkpoint objects are reclaimed asynchronously. Last-run state remains separate.
65
75
  - `/app/automation/diagnostic/read` takes the execution identity and optional
66
76
  `cursor`, and returns `{logs, nextCursor}`. Follow the opaque cursor for older
67
77
  events. Pages contain up to 100 events with a target size of 256 KiB; a single
@@ -77,9 +87,9 @@ storage uses epoch milliseconds; Essential renders timestamps in Home time witho
77
87
  changing stored instants. Agent fetches source through the standard source interface;
78
88
  execution records never duplicate the original Plan or source.
79
89
 
80
- Normal success discards details. Failures/interruption, DEBUG and explicit capture
81
- retain at most ten instances per thread across revisions. Activity summaries have
82
- separate retention. Checkpoints persist only new immutable JSONL segments and a
90
+ Execution records follow the time-based retention above, with no retained-count cap.
91
+ Management events and last-run state remain separate; ordinary completed runs do not
92
+ append activity history. Checkpoints persist only new immutable JSONL segments and a
83
93
  constant-size head reference, plus runtime memory. An empty segment is not written.
84
94
  The Plan is fetched by automation/thread and must match the run's revision; a missing
85
95
  or changed Plan ends the old run. Generation and ownership checks still apply.
@@ -224,3 +224,23 @@ The execution identity has a separate shared corpus in conversation-api.
224
224
  These tests cover shape, multiple types, complete bundles, backend-field rejection,
225
225
  status invariants and payment selection. They do not prove runtime authorization,
226
226
  script compilation, billing settlement, persistence or local/cloud integration.
227
+
228
+ ## Space migration
229
+
230
+ The `suggestion/data` DataSync category transfers portable values, not storage keys:
231
+ `SETTINGS` carries `tenantId`, `spaceId` and settings; `STATE` carries that owner,
232
+ `current` (run, trusted invocation, optional focus and observed usage), and optional
233
+ `contextSummary`; `SUGGESTION` carries `tenantId` and the full typed `item`, whose
234
+ `spaceId` supplies its Space owner. The shared `suggestion.migration.json` fixture
235
+ covers disabled settings, retained context, complete source bundles and a partial
236
+ handling receipt. Internal dispatch bindings, object addresses and handling claims
237
+ are never transferred.
238
+
239
+ Existing Space migration fencing owns the handoff. An active run or unfinished
240
+ handling claim cannot be exported as a portable snapshot. Validate every incoming
241
+ record, exact bundle ownership, duplicate singleton/item identities, registered
242
+ content and terminal run state before replacing any category. Import preserves
243
+ IDs, versions, timestamps and business outcomes; it does not generate, apply or
244
+ replay Suggestions. Cloud content uploads precede metadata replacement. A failed
245
+ migration follows the existing lifecycle's explicit retry, with no Suggestion-specific
246
+ retry service or cross-store transaction.
@@ -353,9 +353,12 @@
353
353
  "revision": 3,
354
354
  "startedAt": 90,
355
355
  "finishedAt": 100,
356
- "captured": false
356
+ "captured": false,
357
+ "availableAt": 100,
358
+ "expiresAt": 86400100
357
359
  }
358
- ]
360
+ ],
361
+ "nextCursor": null
359
362
  },
360
363
  "essential": {
361
364
  "diagnostics": [
@@ -376,9 +379,12 @@
376
379
  "revision": 3,
377
380
  "startedAt": "1970-01-01 00:00:00.090 +00:00 (UTC)",
378
381
  "finishedAt": "1970-01-01 00:00:00.100 +00:00 (UTC)",
379
- "captured": false
382
+ "captured": false,
383
+ "availableAt": "1970-01-01 00:00:00.100 +00:00 (UTC)",
384
+ "expiresAt": "1970-01-02 00:00:00.100 +00:00 (UTC)"
380
385
  }
381
- ]
386
+ ],
387
+ "nextCursor": null
382
388
  }
383
389
  },
384
390
  {
@@ -1581,5 +1581,94 @@
1581
1581
  },
1582
1582
  "status": "success"
1583
1583
  }
1584
+ },
1585
+ {
1586
+ "target": "/app/suggestion/generate",
1587
+ "input": {
1588
+ "focus": "private household detail"
1589
+ },
1590
+ "outcome": {
1591
+ "status": "success",
1592
+ "data": {
1593
+ "accepted": true,
1594
+ "run": {
1595
+ "runId": "run",
1596
+ "status": "RUNNING"
1597
+ }
1598
+ }
1599
+ },
1600
+ "expected": {
1601
+ "event": "suggestion.generate",
1602
+ "accepted": true,
1603
+ "run": {
1604
+ "runId": "run",
1605
+ "status": "RUNNING"
1606
+ },
1607
+ "status": "success"
1608
+ }
1609
+ },
1610
+ {
1611
+ "target": "/app/suggestion/handle",
1612
+ "input": {
1613
+ "suggestionId": "s",
1614
+ "expectedVersion": 1,
1615
+ "action": "APPLY"
1616
+ },
1617
+ "outcome": {
1618
+ "status": "partial",
1619
+ "data": {
1620
+ "automationId": "a",
1621
+ "enabled": false
1622
+ }
1623
+ },
1624
+ "expected": {
1625
+ "event": "suggestion.handle",
1626
+ "suggestionId": "s",
1627
+ "expectedVersion": 1,
1628
+ "action": "APPLY",
1629
+ "automationId": "a",
1630
+ "enabled": false,
1631
+ "status": "partial"
1632
+ }
1633
+ },
1634
+ {
1635
+ "target": "/app/suggestion/feedback",
1636
+ "input": {
1637
+ "suggestionId": "s",
1638
+ "expectedVersion": 1,
1639
+ "decision": "DISMISS",
1640
+ "comment": "private"
1641
+ },
1642
+ "outcome": {
1643
+ "status": "success",
1644
+ "data": {
1645
+ "id": "s",
1646
+ "status": "DISMISSED"
1647
+ }
1648
+ },
1649
+ "expected": {
1650
+ "event": "suggestion.dismiss",
1651
+ "suggestionId": "s",
1652
+ "expectedVersion": 1,
1653
+ "id": "s",
1654
+ "status": "success"
1655
+ }
1656
+ },
1657
+ {
1658
+ "target": "/app/suggestion/settings/save",
1659
+ "input": {
1660
+ "enabled": false
1661
+ },
1662
+ "outcome": {
1663
+ "status": "success",
1664
+ "data": {
1665
+ "enabled": false
1666
+ }
1667
+ },
1668
+ "expected": {
1669
+ "event": "suggestion.settings",
1670
+ "enabled": false,
1671
+ "status": "success"
1672
+ }
1584
1673
  }
1585
1674
  ]
@@ -0,0 +1,154 @@
1
+ [
2
+ {
3
+ "kind": "SETTINGS",
4
+ "tenantId": "tenant",
5
+ "spaceId": "space",
6
+ "settings": {
7
+ "enabled": false
8
+ }
9
+ },
10
+ {
11
+ "kind": "STATE",
12
+ "tenantId": "tenant",
13
+ "spaceId": "space",
14
+ "current": {
15
+ "run": {
16
+ "runId": "run",
17
+ "status": "SUCCEEDED",
18
+ "startedAt": 1000,
19
+ "finishedAt": 2500,
20
+ "suggestionIds": [
21
+ "pending",
22
+ "resolved"
23
+ ]
24
+ },
25
+ "invocation": {
26
+ "space": {
27
+ "tenant_id": "tenant",
28
+ "space_id": "space"
29
+ },
30
+ "runId": "run",
31
+ "operationId": "generate",
32
+ "trigger": {
33
+ "type": "EXPLICIT",
34
+ "userId": "alice"
35
+ },
36
+ "deadlineUnixMs": 9000
37
+ },
38
+ "focus": null,
39
+ "usage": {
40
+ "model_requests": 0,
41
+ "reported_model_requests": 0,
42
+ "input_tokens": 0,
43
+ "output_tokens": 0,
44
+ "cached_input_tokens": null,
45
+ "reasoning_output_tokens": null,
46
+ "peak_input_tokens": 0,
47
+ "credits": null,
48
+ "tool_calls": 0,
49
+ "window_truncations": 0,
50
+ "trimmed_messages": 0
51
+ }
52
+ },
53
+ "contextSummary": "Previous successful review"
54
+ },
55
+ {
56
+ "kind": "SUGGESTION",
57
+ "tenantId": "tenant",
58
+ "item": {
59
+ "type": "AUTOMATION",
60
+ "operation": "CREATE",
61
+ "title": "Evening lighting",
62
+ "summary": "Suggest a lower evening brightness",
63
+ "reasons": [
64
+ "Observed manual adjustments after the evening routine"
65
+ ],
66
+ "evidence": [
67
+ {
68
+ "sourceType": "BEHAVIOR",
69
+ "sourceId": "fixture-operation-1",
70
+ "occurredAt": 1000,
71
+ "excerpt": "The user selected brightness 30 after brightness 80"
72
+ }
73
+ ],
74
+ "script": {
75
+ "script": "name: Contract fixture\ntask: []\n",
76
+ "scripts": {
77
+ "lighting": "// Fixture source bundle\n",
78
+ "empty": ""
79
+ },
80
+ "sdkVersion": "test-sdk-1",
81
+ "parseResults": []
82
+ },
83
+ "id": "pending",
84
+ "spaceId": "space",
85
+ "runId": "run",
86
+ "version": 1,
87
+ "status": "PENDING",
88
+ "createdAt": 2000,
89
+ "updatedAt": 2000
90
+ }
91
+ },
92
+ {
93
+ "kind": "SUGGESTION",
94
+ "tenantId": "tenant",
95
+ "item": {
96
+ "type": "AUTOMATION",
97
+ "operation": "CREATE",
98
+ "title": "Evening lighting",
99
+ "summary": "Suggest a lower evening brightness",
100
+ "reasons": [
101
+ "Observed manual adjustments after the evening routine"
102
+ ],
103
+ "evidence": [
104
+ {
105
+ "sourceType": "BEHAVIOR",
106
+ "sourceId": "fixture-operation-1",
107
+ "occurredAt": 1000,
108
+ "excerpt": "The user selected brightness 30 after brightness 80"
109
+ }
110
+ ],
111
+ "script": {
112
+ "script": "name: Contract fixture\ntask: []\n",
113
+ "scripts": {
114
+ "lighting": "// Fixture source bundle\n",
115
+ "empty": ""
116
+ },
117
+ "sdkVersion": "test-sdk-1",
118
+ "parseResults": []
119
+ },
120
+ "id": "resolved",
121
+ "spaceId": "space",
122
+ "runId": "run",
123
+ "version": 1,
124
+ "status": "RESOLVED",
125
+ "createdAt": 2000,
126
+ "updatedAt": 3000,
127
+ "resolution": {
128
+ "action": "APPLY",
129
+ "operationId": "fixture-apply",
130
+ "handledAt": 3000,
131
+ "actor": {
132
+ "kind": "user",
133
+ "userId": "fixture-user"
134
+ },
135
+ "resourceIds": {
136
+ "automationId": "fixture-automation"
137
+ },
138
+ "result": {
139
+ "status": "partial",
140
+ "data": {
141
+ "automationId": "fixture-automation",
142
+ "saved": true
143
+ },
144
+ "warnings": [
145
+ {
146
+ "code": "ENABLE_FAILED",
147
+ "message": "Saved, but enabling failed"
148
+ }
149
+ ]
150
+ }
151
+ }
152
+ }
153
+ }
154
+ ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.v1",
3
- "contractVersion": "1.156.0",
3
+ "contractVersion": "1.157.0",
4
4
  "callSchema": "schema/facade-call.v1.schema.json",
5
5
  "routing": "manifest/routing.v1.json",
6
6
  "routingSchema": "schema/routing.v1.schema.json",
@@ -535,7 +535,17 @@
535
535
  },
536
536
  "suggestion": {
537
537
  "schema": "schema/suggestion.v1.schema.json",
538
- "contract": "contract/suggestion-v1.md"
538
+ "contract": "contract/suggestion-v1.md",
539
+ "requestTargets": [
540
+ "/app/suggestion/generate",
541
+ "/app/suggestion/generation/get",
542
+ "/app/suggestion/list",
543
+ "/app/suggestion/detail/get",
544
+ "/app/suggestion/handle",
545
+ "/app/suggestion/feedback",
546
+ "/app/suggestion/settings/get",
547
+ "/app/suggestion/settings/save"
548
+ ]
539
549
  }
540
550
  },
541
551
  "authorization": "manifest/authorization.v1.json",
@@ -1,5 +1,5 @@
1
1
  {
2
- "contractVersion": "1.156.0",
2
+ "contractVersion": "1.157.0",
3
3
  "operations": {
4
4
  "/app/agent/context/get": "spaceRead",
5
5
  "/app/agent/conversation/get": "spaceRead",
@@ -382,7 +382,15 @@
382
382
  "/app/wave/discover": "spaceManage",
383
383
  "/app/wave/list": "spaceManage",
384
384
  "/app/wave/refresh": "spaceManage",
385
- "/app/wave/remove": "spaceManage"
385
+ "/app/wave/remove": "spaceManage",
386
+ "/app/suggestion/detail/get": "spaceRead",
387
+ "/app/suggestion/feedback": "spaceWrite",
388
+ "/app/suggestion/generate": "spaceWrite",
389
+ "/app/suggestion/generation/get": "spaceRead",
390
+ "/app/suggestion/handle": "spaceWrite",
391
+ "/app/suggestion/list": "spaceRead",
392
+ "/app/suggestion/settings/get": "spaceRead",
393
+ "/app/suggestion/settings/save": "spaceWrite"
386
394
  },
387
395
  "nodePrefix": "/app/plugin/",
388
396
  "serviceOperations": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.host-provision.targets.v1",
3
- "contractVersion": "1.156.0",
3
+ "contractVersion": "1.157.0",
4
4
  "contract": "contract/host-provisioning-v1.md",
5
5
  "localTargets": [
6
6
  "/local/host/provision/start",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.hub.targets.v1",
3
- "contractVersion": "1.156.0",
3
+ "contractVersion": "1.157.0",
4
4
  "appTargets": [
5
5
  "/app/hub/get",
6
6
  "/app/hub/remove"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.pod.targets.v1",
3
- "contractVersion": "1.156.0",
3
+ "contractVersion": "1.157.0",
4
4
  "contract": "contract/pod-commissioning-v1.md",
5
5
  "localTargets": [
6
6
  "/local/pod/discovery/start",
@@ -52,7 +52,9 @@
52
52
  "ms": [
53
53
  "diagnostics.*.timestamp",
54
54
  "diagnostics.*.startedAt",
55
- "diagnostics.*.finishedAt"
55
+ "diagnostics.*.finishedAt",
56
+ "diagnostics.*.availableAt",
57
+ "diagnostics.*.expiresAt"
56
58
  ]
57
59
  },
58
60
  "/app/group/list": {
@@ -509,5 +511,40 @@
509
511
  "results.*.items.*.latest.event.timestamp",
510
512
  "results.*.items.*.latest.log.timestamp"
511
513
  ]
514
+ },
515
+ "/app/suggestion/generate": {
516
+ "ms": [
517
+ "run.startedAt",
518
+ "run.finishedAt"
519
+ ]
520
+ },
521
+ "/app/suggestion/generation/get": {
522
+ "ms": [
523
+ "run.startedAt",
524
+ "run.finishedAt"
525
+ ]
526
+ },
527
+ "/app/suggestion/list": {
528
+ "ms": [
529
+ "items.*.createdAt",
530
+ "items.*.updatedAt",
531
+ "items.*.expiresAt"
532
+ ]
533
+ },
534
+ "/app/suggestion/detail/get": {
535
+ "ms": [
536
+ "createdAt",
537
+ "updatedAt",
538
+ "expiresAt",
539
+ "evidence.*.occurredAt",
540
+ "resolution.handledAt"
541
+ ]
542
+ },
543
+ "/app/suggestion/feedback": {
544
+ "ms": [
545
+ "createdAt",
546
+ "updatedAt",
547
+ "expiresAt"
548
+ ]
512
549
  }
513
550
  }
@@ -232,6 +232,50 @@
232
232
  ],
233
233
  "output": [],
234
234
  "hook": "circadianDelete"
235
+ },
236
+ {
237
+ "target": "/app/suggestion/generate",
238
+ "event": "suggestion.generate",
239
+ "input": [],
240
+ "output": [
241
+ "accepted",
242
+ "run"
243
+ ]
244
+ },
245
+ {
246
+ "target": "/app/suggestion/handle",
247
+ "event": "suggestion.handle",
248
+ "input": [
249
+ "suggestionId",
250
+ "expectedVersion",
251
+ "action"
252
+ ],
253
+ "output": [
254
+ "automationId",
255
+ "enabled"
256
+ ]
257
+ },
258
+ {
259
+ "target": "/app/suggestion/feedback",
260
+ "event": "suggestion.dismiss",
261
+ "input": [
262
+ "suggestionId",
263
+ "expectedVersion"
264
+ ],
265
+ "output": [
266
+ "id",
267
+ "status"
268
+ ]
269
+ },
270
+ {
271
+ "target": "/app/suggestion/settings/save",
272
+ "event": "suggestion.settings",
273
+ "input": [
274
+ "enabled"
275
+ ],
276
+ "output": [
277
+ "enabled"
278
+ ]
235
279
  }
236
280
  ],
237
281
  "deviceCommands": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.app-facade.routing.v1",
3
- "contractVersion": "1.156.0",
3
+ "contractVersion": "1.157.0",
4
4
  "targetPrefix": "/app/",
5
5
  "default": {
6
6
  "execution": "spaceMode"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.messaging.targets.v1",
3
- "contractVersion": "1.156.0",
3
+ "contractVersion": "1.157.0",
4
4
  "requestTargets": [
5
5
  "/app/messaging/provider/list",
6
6
  "/app/messaging/provider-account/list",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhome/app-facade-protocol",
3
- "version": "1.156.0",
3
+ "version": "1.157.0",
4
4
  "description": "Build-time protocol artifacts for mhome.app-facade",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/protocol.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "protocol": "mhome.app-facade",
3
- "contractVersion": "1.156.0",
3
+ "contractVersion": "1.157.0",
4
4
  "manifest": "manifest/app-facade.v1.json",
5
5
  "schemas": {
6
6
  "dashboardCardAuthoring": "schema/dashboard-card-authoring.v1.schema.json",