@prometheus-ags/entity-graph-core 3.0.5 → 3.2.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.
@@ -0,0 +1,37 @@
1
+ # DevTools inspection fixtures
2
+
3
+ `entity-inspection-v1.json` is the normative, versioned conformance fixture for
4
+ the transport-independent entity-inspection projection. The byte-identical copy
5
+ under `packages/entity_graph_flutter/fixtures/devtools/` is consumed by the
6
+ Dart/Flutter implementation. The assembled integration gate must reject drift
7
+ between the two copies.
8
+
9
+ The fixture freezes these cross-runtime semantics:
10
+
11
+ - `canonical` is the server-confirmed original, `patch` is the local overlay,
12
+ and `merged` is the live value rendered by graph consumers.
13
+ - `dirtyReasons` explains field-level local changes and entity-level sync state;
14
+ `dirty` is true when that array is non-empty.
15
+ - All wire timestamps are UTC ISO-8601 strings. Missing values are explicit
16
+ `null`; omitted fields are not interchangeable with `null`.
17
+ - View identities are stable host-provided strings. Membership is represented
18
+ in both view-to-entity and entity-to-view directions and must agree.
19
+ - `subscriberCount` is the number of active rendered registrations for a view;
20
+ it is independent of the cumulative `renderCount`.
21
+ - Relationships come only from the existing entity schema registry and expose
22
+ unresolved foreign keys as `missing-target` rather than inventing entities.
23
+ - A preview receipt owns the exact prior patch and the entity revision produced
24
+ by preview application. Restore succeeds only at that revision; any later
25
+ canonical or patch mutation returns the typed conflict receipt unchanged.
26
+
27
+ The JSON document is data, not a second graph state or a persistence format.
28
+ Production projections are derived on demand from the owning graph store.
29
+
30
+ `time-travel-v1.json` is the normative cross-runtime contract for controller-
31
+ owned snapshot history. Its byte-identical Flutter copy freezes the complete
32
+ five-field graph data shape, stable cursor and expiry semantics, rewind/live
33
+ receipts, mutation-while-rewound ordering, and inert/confirmed import flow.
34
+ The conformance harness attaches the fixture to the declared `time-a` store;
35
+ consumers must attach that store ID or replace it consistently before import.
36
+ Snapshot values remain local controller data; the fixture is conformance input,
37
+ not a persistence or unbounded history format.
@@ -0,0 +1,304 @@
1
+ {
2
+ "fixture": "prometheus.entity-graph.devtools.entity-inspection",
3
+ "fixtureVersion": 1,
4
+ "protocol": "prometheus.entity-graph.devtools",
5
+ "protocolVersion": 1,
6
+ "storeId": "fixture-store",
7
+ "capturedAt": "2026-08-29T15:04:05.000Z",
8
+ "entityRecords": [
9
+ {
10
+ "key": "Project:p1",
11
+ "type": "Project",
12
+ "id": "p1",
13
+ "presence": "present",
14
+ "canonical": {
15
+ "id": "p1",
16
+ "name": "Apollo",
17
+ "ownerId": "u1",
18
+ "status": "active"
19
+ },
20
+ "patch": {
21
+ "name": "Apollo RC",
22
+ "status": "review"
23
+ },
24
+ "merged": {
25
+ "id": "p1",
26
+ "name": "Apollo RC",
27
+ "ownerId": "u1",
28
+ "status": "review"
29
+ },
30
+ "dirty": true,
31
+ "dirtyReasons": [
32
+ {
33
+ "kind": "local-patch",
34
+ "field": "name",
35
+ "change": "changed"
36
+ },
37
+ {
38
+ "kind": "local-patch",
39
+ "field": "status",
40
+ "change": "changed"
41
+ },
42
+ {
43
+ "kind": "sync-state",
44
+ "field": null,
45
+ "change": "unsynced"
46
+ }
47
+ ],
48
+ "entityState": {
49
+ "isFetching": false,
50
+ "lastFetchedAt": "2026-08-29T15:03:00.000Z",
51
+ "stale": false,
52
+ "error": null
53
+ },
54
+ "sync": {
55
+ "synced": false,
56
+ "origin": "optimistic",
57
+ "updatedAt": "2026-08-29T15:04:00.000Z"
58
+ },
59
+ "revision": 15,
60
+ "viewIds": [
61
+ "project-detail:p1",
62
+ "project-list:active"
63
+ ]
64
+ },
65
+ {
66
+ "key": "Project:p2",
67
+ "type": "Project",
68
+ "id": "p2",
69
+ "presence": "present",
70
+ "canonical": {
71
+ "id": "p2",
72
+ "name": "Hermes",
73
+ "ownerId": "u-missing",
74
+ "status": "active"
75
+ },
76
+ "patch": null,
77
+ "merged": {
78
+ "id": "p2",
79
+ "name": "Hermes",
80
+ "ownerId": "u-missing",
81
+ "status": "active"
82
+ },
83
+ "dirty": false,
84
+ "dirtyReasons": [],
85
+ "entityState": {
86
+ "isFetching": false,
87
+ "lastFetchedAt": "2026-08-29T15:02:00.000Z",
88
+ "stale": true,
89
+ "error": {
90
+ "kind": "entity-fetch",
91
+ "message": "Background refresh failed",
92
+ "retryable": true
93
+ }
94
+ },
95
+ "sync": {
96
+ "synced": true,
97
+ "origin": "server",
98
+ "updatedAt": "2026-08-29T15:02:00.000Z"
99
+ },
100
+ "revision": 8,
101
+ "viewIds": [
102
+ "project-list:active"
103
+ ]
104
+ },
105
+ {
106
+ "key": "User:u1",
107
+ "type": "User",
108
+ "id": "u1",
109
+ "presence": "present",
110
+ "canonical": {
111
+ "id": "u1",
112
+ "displayName": "Ada"
113
+ },
114
+ "patch": null,
115
+ "merged": {
116
+ "id": "u1",
117
+ "displayName": "Ada"
118
+ },
119
+ "dirty": false,
120
+ "dirtyReasons": [],
121
+ "entityState": {
122
+ "isFetching": false,
123
+ "lastFetchedAt": null,
124
+ "stale": false,
125
+ "error": null
126
+ },
127
+ "sync": {
128
+ "synced": true,
129
+ "origin": "server",
130
+ "updatedAt": "2026-08-29T14:59:00.000Z"
131
+ },
132
+ "revision": 3,
133
+ "viewIds": []
134
+ }
135
+ ],
136
+ "views": [
137
+ {
138
+ "viewId": "project-detail:p1",
139
+ "label": "Project detail",
140
+ "kind": "entity",
141
+ "entityType": "Project",
142
+ "queryKey": null,
143
+ "registeredAt": "2026-08-29T15:00:00.000Z",
144
+ "lastRenderedAt": "2026-08-29T15:04:04.000Z",
145
+ "renderCount": 12,
146
+ "subscriberCount": 1,
147
+ "membership": [
148
+ {
149
+ "type": "Project",
150
+ "id": "p1"
151
+ }
152
+ ],
153
+ "list": null
154
+ },
155
+ {
156
+ "viewId": "project-list:active",
157
+ "label": "Active projects",
158
+ "kind": "list",
159
+ "entityType": "Project",
160
+ "queryKey": "[\"projects\",{\"status\":\"active\"}]",
161
+ "registeredAt": "2026-08-29T14:58:00.000Z",
162
+ "lastRenderedAt": "2026-08-29T15:04:03.000Z",
163
+ "renderCount": 31,
164
+ "subscriberCount": 1,
165
+ "membership": [
166
+ {
167
+ "type": "Project",
168
+ "id": "p1"
169
+ },
170
+ {
171
+ "type": "Project",
172
+ "id": "p2"
173
+ }
174
+ ],
175
+ "list": {
176
+ "visibleCount": 2,
177
+ "graphCount": 2,
178
+ "total": 2,
179
+ "isFetching": false,
180
+ "isFetchingMore": false,
181
+ "stale": false,
182
+ "hasNextPage": false,
183
+ "hasPreviousPage": false
184
+ }
185
+ }
186
+ ],
187
+ "entityViewMembership": [
188
+ {
189
+ "type": "Project",
190
+ "id": "p1",
191
+ "viewIds": [
192
+ "project-detail:p1",
193
+ "project-list:active"
194
+ ]
195
+ },
196
+ {
197
+ "type": "Project",
198
+ "id": "p2",
199
+ "viewIds": [
200
+ "project-list:active"
201
+ ]
202
+ },
203
+ {
204
+ "type": "User",
205
+ "id": "u1",
206
+ "viewIds": []
207
+ }
208
+ ],
209
+ "relationships": [
210
+ {
211
+ "relation": "owner",
212
+ "cardinality": "belongsTo",
213
+ "direction": "outgoing",
214
+ "source": {
215
+ "type": "Project",
216
+ "id": "p1",
217
+ "field": "ownerId"
218
+ },
219
+ "target": {
220
+ "type": "User",
221
+ "id": "u1"
222
+ },
223
+ "status": "resolved"
224
+ },
225
+ {
226
+ "relation": "projects",
227
+ "cardinality": "hasMany",
228
+ "direction": "reverse",
229
+ "source": {
230
+ "type": "User",
231
+ "id": "u1",
232
+ "field": null
233
+ },
234
+ "target": {
235
+ "type": "Project",
236
+ "id": "p1"
237
+ },
238
+ "status": "resolved"
239
+ },
240
+ {
241
+ "relation": "owner",
242
+ "cardinality": "belongsTo",
243
+ "direction": "outgoing",
244
+ "source": {
245
+ "type": "Project",
246
+ "id": "p2",
247
+ "field": "ownerId"
248
+ },
249
+ "target": {
250
+ "type": "User",
251
+ "id": "u-missing"
252
+ },
253
+ "status": "missing-target"
254
+ }
255
+ ],
256
+ "previewReceipts": {
257
+ "applied": {
258
+ "previewId": "preview-p1-1",
259
+ "entity": {
260
+ "type": "Project",
261
+ "id": "p1"
262
+ },
263
+ "priorPatch": {
264
+ "name": "Apollo RC",
265
+ "status": "review"
266
+ },
267
+ "previewPatch": {
268
+ "status": "paused"
269
+ },
270
+ "appliedPatch": {
271
+ "name": "Apollo RC",
272
+ "status": "paused"
273
+ },
274
+ "baselineRevision": 14,
275
+ "previewRevision": 15,
276
+ "appliedAt": "2026-08-29T15:04:00.000Z"
277
+ },
278
+ "restored": {
279
+ "previewId": "preview-p1-1",
280
+ "status": "restored",
281
+ "restoredPatch": {
282
+ "name": "Apollo RC",
283
+ "status": "review"
284
+ },
285
+ "observedRevision": 15,
286
+ "restoredAt": "2026-08-29T15:04:06.000Z"
287
+ },
288
+ "conflict": {
289
+ "previewId": "preview-p1-2",
290
+ "status": "conflict",
291
+ "reason": "entity-changed-since-preview",
292
+ "expectedRevision": 19,
293
+ "observedRevision": 20,
294
+ "currentPatch": {
295
+ "name": "Apollo Final",
296
+ "status": "review"
297
+ },
298
+ "priorPatch": {
299
+ "name": "Apollo RC",
300
+ "status": "review"
301
+ }
302
+ }
303
+ }
304
+ }
@@ -0,0 +1,110 @@
1
+ {
2
+ "fixture": "prometheus.entity-graph.devtools.time-travel",
3
+ "fixtureVersion": 1,
4
+ "protocol": "prometheus.entity-graph.devtools",
5
+ "protocolVersion": 1,
6
+ "storeId": "time-a",
7
+ "retention": {
8
+ "countLimit": 2,
9
+ "byteLimit": 1048576,
10
+ "baselineCursor": 40,
11
+ "retainedCursors": [41, 42],
12
+ "expiredBaseline": {
13
+ "status": "expired-history",
14
+ "cursor": 40,
15
+ "reason": "evicted",
16
+ "oldestCursor": 41,
17
+ "newestCursor": 42,
18
+ "latestCursor": 42
19
+ }
20
+ },
21
+ "snapshots": [
22
+ {
23
+ "cursor": 41,
24
+ "capturedAt": "2026-08-29T19:58:00.000Z",
25
+ "eventSequence": 7,
26
+ "data": {
27
+ "entities": {
28
+ "Task": {
29
+ "one": { "id": "one", "value": 1, "title": "First" }
30
+ }
31
+ },
32
+ "patches": {},
33
+ "entityStates": {},
34
+ "syncMetadata": {},
35
+ "lists": {}
36
+ }
37
+ },
38
+ {
39
+ "cursor": 42,
40
+ "capturedAt": "2026-08-29T19:59:00.000Z",
41
+ "eventSequence": 8,
42
+ "data": {
43
+ "entities": {
44
+ "Task": {
45
+ "one": { "id": "one", "value": 2, "title": "Second" }
46
+ }
47
+ },
48
+ "patches": {
49
+ "Task": {
50
+ "one": { "title": "Second draft" }
51
+ }
52
+ },
53
+ "entityStates": {},
54
+ "syncMetadata": {},
55
+ "lists": {}
56
+ }
57
+ }
58
+ ],
59
+ "rewind": {
60
+ "status": "rewound",
61
+ "cursor": 41,
62
+ "source": "retained",
63
+ "previousCursor": null,
64
+ "previousSource": null
65
+ },
66
+ "returnToLive": {
67
+ "status": "live",
68
+ "cursor": null,
69
+ "previousCursor": 41,
70
+ "previousSource": "retained",
71
+ "reason": "command"
72
+ },
73
+ "mutationWhileRewound": {
74
+ "eventOrder": ["time-travel:live:mutation", "mutation"],
75
+ "newLiveValue": 20,
76
+ "returnAfterMutation": null
77
+ },
78
+ "validImport": {
79
+ "protocol": "prometheus.entity-graph.devtools",
80
+ "version": 1,
81
+ "storeId": "time-a",
82
+ "exportedAt": "2026-08-29T20:00:00.000Z",
83
+ "snapshots": [
84
+ {
85
+ "cursor": 9001,
86
+ "capturedAt": "2026-08-29T19:59:30.000Z",
87
+ "eventSequence": null,
88
+ "data": {
89
+ "entities": {
90
+ "Task": {
91
+ "one": { "id": "one", "value": 9001, "title": "Imported" }
92
+ }
93
+ },
94
+ "patches": {},
95
+ "entityStates": {},
96
+ "syncMetadata": {},
97
+ "lists": {}
98
+ }
99
+ }
100
+ ]
101
+ },
102
+ "importExpectations": {
103
+ "inspectionStatus": "awaiting-confirmation",
104
+ "inspectionMutatesGraph": false,
105
+ "confirmationRequired": true,
106
+ "restoreStatus": "rewound",
107
+ "restoreSource": "import",
108
+ "candidateIsOneShot": true
109
+ }
110
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prometheus-ags/entity-graph-core",
3
- "version": "3.0.5",
3
+ "version": "3.2.0",
4
4
  "description": "Framework-agnostic normalized entity graph store (zero React) — the core of the Prometheus entity-graph ecosystem.",
5
5
  "author": "Travis James <travis@prometheus.dev>",
6
6
  "license": "MIT",
@@ -8,6 +8,13 @@
8
8
  "main": "./dist/index.cjs",
9
9
  "module": "./dist/index.mjs",
10
10
  "types": "./dist/index.d.ts",
11
+ "typesVersions": {
12
+ "*": {
13
+ "devtools": [
14
+ "dist/devtools.d.ts"
15
+ ]
16
+ }
17
+ },
11
18
  "exports": {
12
19
  ".": {
13
20
  "import": {
@@ -18,11 +25,28 @@
18
25
  "types": "./dist/index.d.cts",
19
26
  "default": "./dist/index.cjs"
20
27
  }
28
+ },
29
+ "./devtools": {
30
+ "import": {
31
+ "types": "./dist/devtools.d.ts",
32
+ "default": "./dist/devtools.mjs"
33
+ },
34
+ "require": {
35
+ "types": "./dist/devtools.d.cts",
36
+ "default": "./dist/devtools.cjs"
37
+ }
38
+ },
39
+ "./devtools/fixtures/entity-inspection-v1.json": {
40
+ "default": "./fixtures/devtools/entity-inspection-v1.json"
41
+ },
42
+ "./devtools/fixtures/time-travel-v1.json": {
43
+ "default": "./fixtures/devtools/time-travel-v1.json"
21
44
  }
22
45
  },
23
46
  "sideEffects": false,
24
47
  "files": [
25
48
  "dist",
49
+ "fixtures",
26
50
  "README.md",
27
51
  "CHANGELOG.md"
28
52
  ],