@principal-ai/subsystems-react 0.56.31 → 0.56.32

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,479 @@
1
+ {
2
+ "components": [
3
+ {
4
+ "alias": "subsystem-model-view",
5
+ "name": "SubsystemModelView",
6
+ "construct": "function",
7
+ "framework": "react",
8
+ "stereotype": "component",
9
+ "role": "entry",
10
+ "process": "subsystems-studio/renderer",
11
+ "module": "packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx",
12
+ "file": "packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx",
13
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx",
14
+ "symbol": "SubsystemModelView",
15
+ "purpose": "Renders the subsystem graph tab and loads the persisted audit into its diagnostics list."
16
+ },
17
+ {
18
+ "alias": "audit-issues",
19
+ "name": "auditReportToIssues",
20
+ "construct": "function",
21
+ "process": "subsystems-studio/renderer",
22
+ "module": "packages/subsystems-studio/src/mainview/subsystemIssues.ts",
23
+ "file": "packages/subsystems-studio/src/mainview/subsystemIssues.ts",
24
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/mainview/subsystemIssues.ts",
25
+ "symbol": "auditReportToIssues",
26
+ "purpose": "Maps a persisted audit report into the presentational issues the diagnostics list renders."
27
+ },
28
+ {
29
+ "alias": "regular-audit-subscribers",
30
+ "name": "regularAuditChangeSubscribers",
31
+ "construct": "store",
32
+ "process": "subsystems-studio/renderer",
33
+ "module": "packages/subsystems-studio/src/mainview/rpc.ts",
34
+ "file": "packages/subsystems-studio/src/mainview/rpc.ts",
35
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/mainview/rpc.ts",
36
+ "symbol": "regularAuditChangeSubscribers",
37
+ "purpose": "Holds renderer callbacks registered for regular-audit status pushes."
38
+ },
39
+ {
40
+ "alias": "audit-model",
41
+ "name": "auditSubsystemModel",
42
+ "construct": "function",
43
+ "process": "subsystems-studio/host",
44
+ "module": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
45
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
46
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
47
+ "symbol": "auditSubsystemModel",
48
+ "purpose": "Runs the dry-run deterministic audit: graphify caches, files, per-component construct and signature, and mechanical boundary membership."
49
+ },
50
+ {
51
+ "alias": "verify-files",
52
+ "name": "verifyModelFiles",
53
+ "construct": "function",
54
+ "process": "subsystems-studio/host",
55
+ "module": "packages/subsystems-studio/src/bun/subsystem-model-store.ts",
56
+ "file": "packages/subsystems-studio/src/bun/subsystem-model-store.ts",
57
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/subsystem-model-store.ts",
58
+ "symbol": "verifyModelFiles",
59
+ "purpose": "Checks every component file exists and resolves each trail site against its repo checkout."
60
+ },
61
+ {
62
+ "alias": "verify-component",
63
+ "name": "verifySubsystemComponent",
64
+ "construct": "function",
65
+ "process": "subsystems-studio/host",
66
+ "module": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
67
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
68
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
69
+ "symbol": "verifySubsystemComponent",
70
+ "purpose": "Verifies one component against disk plus its graphify anchor."
71
+ },
72
+ {
73
+ "alias": "ensure-graphify-caches",
74
+ "name": "ensureCurrentGraphifyCachesForModel",
75
+ "construct": "function",
76
+ "process": "subsystems-studio/host",
77
+ "module": "packages/subsystems-studio/src/bun/graphify-store.ts",
78
+ "file": "packages/subsystems-studio/src/bun/graphify-store.ts",
79
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/graphify-store.ts",
80
+ "symbol": "ensureCurrentGraphifyCachesForModel",
81
+ "purpose": "Ensures each component purl has a graphify cache at the current HEAD slot."
82
+ },
83
+ {
84
+ "alias": "graphify-readiness",
85
+ "name": "assessSubsystemGraphifyReadiness",
86
+ "construct": "function",
87
+ "process": "subsystems-studio/host",
88
+ "module": "packages/subsystems-studio/src/bun/graphify-store.ts",
89
+ "file": "packages/subsystems-studio/src/bun/graphify-store.ts",
90
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/graphify-store.ts",
91
+ "symbol": "assessSubsystemGraphifyReadiness",
92
+ "purpose": "Reports current-slot graphify cache readiness for each distinct component purl."
93
+ },
94
+ {
95
+ "alias": "build-fingerprint",
96
+ "name": "buildAuditFingerprint",
97
+ "construct": "function",
98
+ "process": "subsystems-studio/host",
99
+ "module": "packages/subsystems-studio/src/bun/audit-report-store.ts",
100
+ "file": "packages/subsystems-studio/src/bun/audit-report-store.ts",
101
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/audit-report-store.ts",
102
+ "symbol": "buildAuditFingerprint",
103
+ "purpose": "Builds a stable fingerprint of the model's claims plus the current graphify slot identity."
104
+ },
105
+ {
106
+ "alias": "save-audit",
107
+ "name": "saveSubsystemModelAudit",
108
+ "construct": "function",
109
+ "process": "subsystems-studio/host",
110
+ "module": "packages/subsystems-studio/src/bun/audit-report-store.ts",
111
+ "file": "packages/subsystems-studio/src/bun/audit-report-store.ts",
112
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/audit-report-store.ts",
113
+ "symbol": "saveSubsystemModelAudit",
114
+ "purpose": "Persists the audit report with its fingerprint so badges and the issues list survive relaunches."
115
+ },
116
+ {
117
+ "alias": "load-audit",
118
+ "name": "loadSubsystemModelAudit",
119
+ "construct": "function",
120
+ "process": "subsystems-studio/host",
121
+ "module": "packages/subsystems-studio/src/bun/audit-report-store.ts",
122
+ "file": "packages/subsystems-studio/src/bun/audit-report-store.ts",
123
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/audit-report-store.ts",
124
+ "symbol": "loadSubsystemModelAudit",
125
+ "purpose": "Reads the persisted audit report for a model."
126
+ },
127
+ {
128
+ "alias": "apply-fix",
129
+ "name": "applySubsystemModelAuditFix",
130
+ "construct": "function",
131
+ "process": "subsystems-studio/host",
132
+ "module": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
133
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
134
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
135
+ "symbol": "applySubsystemModelAuditFix",
136
+ "purpose": "Applies a deterministic one-click audit fix, then re-audits the model."
137
+ },
138
+ {
139
+ "alias": "regular-audit-scheduler",
140
+ "name": "createRegularAuditScheduler",
141
+ "construct": "function",
142
+ "role": "entry",
143
+ "process": "subsystems-studio/host",
144
+ "module": "packages/subsystems-studio/src/bun/regular-audit.ts",
145
+ "file": "packages/subsystems-studio/src/bun/regular-audit.ts",
146
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/regular-audit.ts",
147
+ "symbol": "createRegularAuditScheduler",
148
+ "purpose": "Runs the dry-run audit over every stored model on a timeout chain while Studio is open."
149
+ },
150
+ {
151
+ "alias": "regular-audit-run",
152
+ "name": "reauditSubsystemModelQuietly",
153
+ "construct": "function",
154
+ "process": "subsystems-studio/host",
155
+ "module": "packages/subsystems-studio/src/bun/index.ts",
156
+ "file": "packages/subsystems-studio/src/bun/index.ts",
157
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts",
158
+ "symbol": "reauditSubsystemModelQuietly",
159
+ "purpose": "Quietly re-audits one model and tells every surface its audit changed."
160
+ },
161
+ {
162
+ "alias": "audit-stage-fixes",
163
+ "name": "auditAndStageOneClickFixes",
164
+ "construct": "function",
165
+ "process": "subsystems-studio/host",
166
+ "module": "packages/subsystems-studio/src/bun/index.ts",
167
+ "file": "packages/subsystems-studio/src/bun/index.ts",
168
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts",
169
+ "symbol": "auditAndStageOneClickFixes",
170
+ "purpose": "Audits a model, then stages any one-click fixes it found for user confirmation."
171
+ },
172
+ {
173
+ "alias": "regular-audit-status",
174
+ "name": "broadcastRegularAuditChanged",
175
+ "construct": "function",
176
+ "process": "subsystems-studio/host",
177
+ "module": "packages/subsystems-studio/src/bun/index.ts",
178
+ "file": "packages/subsystems-studio/src/bun/index.ts",
179
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts",
180
+ "symbol": "broadcastRegularAuditChanged",
181
+ "purpose": "Pushes the scheduler's live status to the renderer over RPC."
182
+ },
183
+ {
184
+ "alias": "broadcast-changed",
185
+ "name": "broadcastSubsystemModelChanged",
186
+ "construct": "function",
187
+ "process": "subsystems-studio/host",
188
+ "module": "packages/subsystems-studio/src/bun/index.ts",
189
+ "file": "packages/subsystems-studio/src/bun/index.ts",
190
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts",
191
+ "symbol": "broadcastSubsystemModelChanged",
192
+ "purpose": "Tells every surface a model changed so the canvas and lists reload."
193
+ }
194
+ ],
195
+ "trails": [
196
+ {
197
+ "id": "tl-host-audit",
198
+ "title": "Run the deterministic host audit",
199
+ "steps": [
200
+ {
201
+ "from": "audit-model",
202
+ "to": "ensure-graphify-caches",
203
+ "mechanism": "calls",
204
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
205
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
206
+ "symbol": "auditSubsystemModel",
207
+ "annotation": "Ensure the current-HEAD graphify cache for every component purl.",
208
+ "span": {
209
+ "startLine": 1003,
210
+ "endLine": 1003,
211
+ "contentHash": "storybook-fixture"
212
+ }
213
+ },
214
+ {
215
+ "from": "audit-model",
216
+ "to": "verify-files",
217
+ "mechanism": "calls",
218
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
219
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
220
+ "symbol": "auditSubsystemModel",
221
+ "annotation": "Check every component file and trail site resolves.",
222
+ "span": {
223
+ "startLine": 1216,
224
+ "endLine": 1216,
225
+ "contentHash": "22c9e227add5fcdace4ffc6789afad07"
226
+ }
227
+ },
228
+ {
229
+ "from": "audit-model",
230
+ "to": "verify-component",
231
+ "mechanism": "calls",
232
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
233
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
234
+ "symbol": "auditSubsystemModel",
235
+ "annotation": "Dry-run each source component against its graphify anchor.",
236
+ "span": {
237
+ "startLine": 1159,
238
+ "endLine": 1159,
239
+ "contentHash": "storybook-fixture"
240
+ }
241
+ },
242
+ {
243
+ "from": "verify-component",
244
+ "to": "graphify-readiness",
245
+ "mechanism": "calls",
246
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
247
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
248
+ "symbol": "verifySubsystemComponent",
249
+ "annotation": "Read the current-slot cache readiness for the component's purl.",
250
+ "span": {
251
+ "startLine": 586,
252
+ "endLine": 588,
253
+ "contentHash": "fd0883df22210fd04a4054c2620a68d2"
254
+ }
255
+ }
256
+ ]
257
+ },
258
+ {
259
+ "id": "tl-persist-audit",
260
+ "title": "Persist the audit report and its fingerprint",
261
+ "steps": [
262
+ {
263
+ "from": "audit-model",
264
+ "to": "graphify-readiness",
265
+ "mechanism": "calls",
266
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
267
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
268
+ "symbol": "auditSubsystemModel",
269
+ "annotation": "Capture current readiness to feed the fingerprint.",
270
+ "span": {
271
+ "startLine": 1643,
272
+ "endLine": 1643,
273
+ "contentHash": "storybook-fixture"
274
+ }
275
+ },
276
+ {
277
+ "from": "audit-model",
278
+ "to": "build-fingerprint",
279
+ "mechanism": "calls",
280
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
281
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
282
+ "symbol": "auditSubsystemModel",
283
+ "annotation": "Fingerprint the claims plus the graphify slot identity.",
284
+ "span": {
285
+ "startLine": 2002,
286
+ "endLine": 2006,
287
+ "contentHash": "5ffb36a0e2c7e4e8fc5b1b10bce2ff01"
288
+ }
289
+ },
290
+ {
291
+ "from": "audit-model",
292
+ "to": "save-audit",
293
+ "mechanism": "writes",
294
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
295
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
296
+ "symbol": "auditSubsystemModel",
297
+ "annotation": "Persist the report so badges and the issues list survive a relaunch.",
298
+ "span": {
299
+ "startLine": 1650,
300
+ "endLine": 1650,
301
+ "contentHash": "storybook-fixture"
302
+ }
303
+ }
304
+ ]
305
+ },
306
+ {
307
+ "id": "wt-regular-audit",
308
+ "title": "Background regular audit pass",
309
+ "steps": [
310
+ {
311
+ "from": "regular-audit-scheduler",
312
+ "to": "regular-audit-run",
313
+ "mechanism": "calls",
314
+ "file": "packages/subsystems-studio/src/bun/index.ts",
315
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts",
316
+ "symbol": "auditOne",
317
+ "annotation": "Hand the next stored model to the quiet re-audit once the timer fires.",
318
+ "span": {
319
+ "startLine": 3146,
320
+ "endLine": 3146,
321
+ "contentHash": "f3504f402572afd5f91f48a25cda389c"
322
+ }
323
+ },
324
+ {
325
+ "from": "regular-audit-run",
326
+ "to": "audit-stage-fixes",
327
+ "mechanism": "calls",
328
+ "file": "packages/subsystems-studio/src/bun/index.ts",
329
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts",
330
+ "symbol": "reauditSubsystemModelQuietly",
331
+ "annotation": "Run the audit then stage any one-click fixes it found.",
332
+ "span": {
333
+ "startLine": 3098,
334
+ "endLine": 3098,
335
+ "contentHash": "5c7b11e69cf79b1cf4c5ecb8f522ce4d"
336
+ }
337
+ },
338
+ {
339
+ "from": "audit-stage-fixes",
340
+ "to": "audit-model",
341
+ "mechanism": "calls",
342
+ "file": "packages/subsystems-studio/src/bun/index.ts",
343
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts",
344
+ "symbol": "auditAndStageOneClickFixes",
345
+ "annotation": "Re-run the deterministic dry-run audit.",
346
+ "span": {
347
+ "startLine": 2954,
348
+ "endLine": 2954,
349
+ "contentHash": "storybook-fixture"
350
+ }
351
+ },
352
+ {
353
+ "from": "regular-audit-run",
354
+ "to": "broadcast-changed",
355
+ "mechanism": "calls",
356
+ "file": "packages/subsystems-studio/src/bun/index.ts",
357
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts",
358
+ "symbol": "reauditSubsystemModelQuietly",
359
+ "annotation": "Tell every surface the model changed so badges and the canvas reload.",
360
+ "span": {
361
+ "startLine": 2996,
362
+ "endLine": 2996,
363
+ "contentHash": "storybook-fixture"
364
+ }
365
+ },
366
+ {
367
+ "from": "regular-audit-scheduler",
368
+ "to": "regular-audit-status",
369
+ "mechanism": "produces",
370
+ "file": "packages/subsystems-studio/src/bun/index.ts",
371
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/index.ts",
372
+ "symbol": "onStatusChange",
373
+ "annotation": "Emit scheduler status on every enable, tick and pass finish.",
374
+ "span": {
375
+ "startLine": 3149,
376
+ "endLine": 3149,
377
+ "contentHash": "59a09a10b075afa60fe37cbc25c75a5d"
378
+ }
379
+ },
380
+ {
381
+ "from": "regular-audit-status",
382
+ "to": "regular-audit-subscribers",
383
+ "mechanism": "feeds",
384
+ "file": "packages/subsystems-studio/src/mainview/rpc.ts",
385
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/mainview/rpc.ts",
386
+ "symbol": "regularAuditChanged",
387
+ "annotation": "Fan the pushed status out to every registered renderer callback.",
388
+ "span": {
389
+ "startLine": 168,
390
+ "endLine": 168,
391
+ "contentHash": "storybook-fixture"
392
+ }
393
+ }
394
+ ]
395
+ },
396
+ {
397
+ "id": "tl-renderer-issues",
398
+ "title": "Load the persisted audit into diagnostics",
399
+ "steps": [
400
+ {
401
+ "from": "subsystem-model-view",
402
+ "to": "load-audit",
403
+ "mechanism": "calls",
404
+ "file": "packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx",
405
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx",
406
+ "symbol": "loadAudit",
407
+ "annotation": "Read the persisted report and its live staleness over RPC.",
408
+ "span": {
409
+ "startLine": 170,
410
+ "endLine": 170,
411
+ "contentHash": "storybook-fixture"
412
+ }
413
+ },
414
+ {
415
+ "from": "subsystem-model-view",
416
+ "to": "audit-issues",
417
+ "mechanism": "uses",
418
+ "file": "packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx",
419
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx",
420
+ "symbol": "SubsystemModelView",
421
+ "annotation": "Map report findings into the diagnostics issues list.",
422
+ "span": {
423
+ "startLine": 485,
424
+ "endLine": 485,
425
+ "contentHash": "storybook-fixture"
426
+ }
427
+ }
428
+ ]
429
+ },
430
+ {
431
+ "id": "tl-apply-fix",
432
+ "title": "Apply a one-click audit fix",
433
+ "steps": [
434
+ {
435
+ "from": "subsystem-model-view",
436
+ "to": "apply-fix",
437
+ "mechanism": "calls",
438
+ "file": "packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx",
439
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/mainview/views/SubsystemModelView.tsx",
440
+ "symbol": "onApplyIssueFix",
441
+ "annotation": "Apply the deterministic fix for a finding.",
442
+ "span": {
443
+ "startLine": 536,
444
+ "endLine": 536,
445
+ "contentHash": "storybook-fixture"
446
+ }
447
+ },
448
+ {
449
+ "from": "apply-fix",
450
+ "to": "verify-component",
451
+ "mechanism": "calls",
452
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
453
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
454
+ "symbol": "applySubsystemModelAuditFix",
455
+ "annotation": "Re-verify the component to re-derive the fix premise.",
456
+ "span": {
457
+ "startLine": 1733,
458
+ "endLine": 1733,
459
+ "contentHash": "storybook-fixture"
460
+ }
461
+ },
462
+ {
463
+ "from": "apply-fix",
464
+ "to": "audit-model",
465
+ "mechanism": "calls",
466
+ "file": "packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
467
+ "purl": "pkg:github/principal-ai/subsystem-modeling#packages/subsystems-studio/src/bun/verify-subsystem-component.ts",
468
+ "symbol": "applySubsystemModelAuditFix",
469
+ "annotation": "Re-audit after the fix lands so the report is fresh.",
470
+ "span": {
471
+ "startLine": 1769,
472
+ "endLine": 1769,
473
+ "contentHash": "storybook-fixture"
474
+ }
475
+ }
476
+ ]
477
+ }
478
+ ]
479
+ }
@@ -289,7 +289,7 @@ const KIND_LABEL: Record<string, string> = {
289
289
  signature_mismatch: 'Construct signature mismatch',
290
290
  signature_unconfirmed: 'Construct signature unconfirmed',
291
291
  repo_unresolved: 'No repository clone',
292
- graphify_unavailable: 'Graphify cache unavailable',
292
+ graphify_unavailable: 'Source verification unavailable',
293
293
  boundary_module_file_mismatch: 'Declaration file outside module',
294
294
  boundary_process_nest_disagree: 'Module spans multiple process contexts',
295
295
  // C4 process verification (labels read as boundary states, since the layer
@@ -112,6 +112,7 @@ import {
112
112
  EDGE_LABEL_CLOUD_PATH,
113
113
  EDGE_LABEL_CLOUD_EXTRA_TOP,
114
114
  } from '../utils/edgeLabel';
115
+ import { graphGeometryBounds } from '../utils/elkLayout';
115
116
 
116
117
  /** Context passed to `renderTrailViewer` when a flow/step is focused. */
117
118
  export interface TrailViewerContext {
@@ -778,6 +779,43 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
778
779
  edges: [],
779
780
  absoluteRects: new Map(),
780
781
  });
782
+ const fitGraphContents = useCallback(
783
+ (duration = 300) => {
784
+ const edges = built.edges.map((edge) => {
785
+ const data = edge.data as
786
+ | {
787
+ labelX?: number;
788
+ labelY?: number;
789
+ elkPathPoints?: { x: number; y: number }[];
790
+ }
791
+ | undefined;
792
+ return {
793
+ points: data?.elkPathPoints,
794
+ labelCenter:
795
+ data?.labelX != null && data.labelY != null
796
+ ? { x: data.labelX, y: data.labelY }
797
+ : undefined,
798
+ };
799
+ });
800
+ const bounds = graphGeometryBounds(
801
+ built.absoluteRects.values(),
802
+ edges,
803
+ { width: EDGE_LABEL_WIDTH, height: EDGE_LABEL_HEIGHT },
804
+ );
805
+ if (!bounds) {
806
+ fitView({
807
+ padding: 0.1,
808
+ includeHiddenNodes: false,
809
+ minZoom: 0.05,
810
+ maxZoom: 2,
811
+ duration,
812
+ });
813
+ return;
814
+ }
815
+ fitBounds(bounds, { padding: 0.1, duration });
816
+ },
817
+ [built.absoluteRects, built.edges, fitBounds, fitView],
818
+ );
781
819
  const [layoutReady, setLayoutReady] = useState(false);
782
820
  const transparentCanvas = canvasBackground === 'transparent';
783
821
 
@@ -993,15 +1031,9 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
993
1031
  if (!layoutReady || !refitAfterLayoutRef.current) return;
994
1032
  refitAfterLayoutRef.current = false;
995
1033
  requestAnimationFrame(() => {
996
- fitView({
997
- padding: 0.1,
998
- includeHiddenNodes: false,
999
- minZoom: 0.05,
1000
- maxZoom: 2,
1001
- duration: LAYOUT_FLIP_NODE_MS,
1002
- });
1034
+ fitGraphContents(LAYOUT_FLIP_NODE_MS);
1003
1035
  });
1004
- }, [built, layoutReady, fitView]);
1036
+ }, [built, layoutReady, fitGraphContents]);
1005
1037
 
1006
1038
  // Persist the choice so a model reopens the way it was left.
1007
1039
  useEffect(() => {
@@ -2104,10 +2136,10 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
2104
2136
  // mount/edit fit would otherwise fire mid-flip and fight it.
2105
2137
  if (layoutFlipping) return;
2106
2138
  const t = setTimeout(() => {
2107
- fitView({ padding: 0.1, includeHiddenNodes: false, minZoom: 0.05, maxZoom: 2, duration: 200 });
2139
+ fitGraphContents(200);
2108
2140
  }, 200);
2109
2141
  return () => clearTimeout(t);
2110
- }, [baseNodesKey, baseEdgesKey, fitView]);
2142
+ }, [baseNodesKey, baseEdgesKey, fitGraphContents, layoutFlipping]);
2111
2143
 
2112
2144
  // When the file drawer opens or closes the canvas is resized but the
2113
2145
  // camera stays put — no refit/zoom. Spotlight + dimming already convey
@@ -2477,17 +2509,13 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
2477
2509
  );
2478
2510
 
2479
2511
  // Zoom back out to the full diagram after the last expanded trail
2480
- // closes (visibility restores non-flow nodes that were hidden).
2512
+ // closes (visibility restores non-flow nodes that were hidden). `fitView`
2513
+ // only considers node rectangles, but routed edges and their label chips can
2514
+ // extend beyond those rectangles; include their ELK geometry in the frame.
2481
2515
  const fitOverview = useCallback(() => {
2482
2516
  if (!zoomOnTrailFocus) return;
2483
- fitView({
2484
- padding: 0.1,
2485
- includeHiddenNodes: false,
2486
- minZoom: 0.05,
2487
- maxZoom: 2,
2488
- duration: 300,
2489
- });
2490
- }, [fitView, zoomOnTrailFocus]);
2517
+ fitGraphContents(300);
2518
+ }, [fitGraphContents, zoomOnTrailFocus]);
2491
2519
 
2492
2520
  // Focus an entire flow: hide everything but the flow's nodes and edges, and
2493
2521
  // frame the flow on the canvas. Selection state is cleared — the graph now
@@ -14,6 +14,7 @@ import {
14
14
  calculatePathMidpoint,
15
15
  pointAlongPath,
16
16
  fractionAlongPath,
17
+ graphGeometryBounds,
17
18
  planCompoundGroups,
18
19
  getElkOptions,
19
20
  absoluteBoundsOf,
@@ -103,6 +104,38 @@ describe('absolute coordinate space', () => {
103
104
  });
104
105
  });
105
106
 
107
+ describe('graph camera bounds', () => {
108
+ test('includes routed edge points and label boxes beyond the node bounds', () => {
109
+ const nodes = [
110
+ { x: 0, y: 0, width: 100, height: 60 },
111
+ { x: 300, y: 0, width: 100, height: 60 },
112
+ ];
113
+ const bounds = graphGeometryBounds(nodes, [{
114
+ labelCenter: { x: 180, y: 150 },
115
+ points: [
116
+ { x: 100, y: 30 },
117
+ { x: 180, y: 30 },
118
+ { x: 180, y: 150 },
119
+ { x: 300, y: 30 },
120
+ ],
121
+ }], { width: 140, height: 40 });
122
+
123
+ expect(bounds).toEqual({
124
+ x: 0,
125
+ y: 0,
126
+ width: 400,
127
+ height: 170,
128
+ });
129
+ });
130
+
131
+ test('returns undefined when there is no finite graph geometry', () => {
132
+ expect(graphGeometryBounds([], [{ points: [{ x: Number.NaN, y: 1 }] }], {
133
+ width: 140,
134
+ height: 40,
135
+ })).toBeUndefined();
136
+ });
137
+ });
138
+
106
139
  /**
107
140
  * A card's FLIP offset is the difference between where it was and where the new
108
141
  * layout puts it. If this is computed in the wrong space the card slides to a