loopgraph 0.1.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 (95) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -0
  3. package/dist/adapters/agenthub/extract.d.ts +63 -0
  4. package/dist/adapters/agenthub/extract.js +144 -0
  5. package/dist/adapters/agenthub/facts.d.ts +27 -0
  6. package/dist/adapters/agenthub/facts.js +89 -0
  7. package/dist/adapters/agenthub/index.d.ts +13 -0
  8. package/dist/adapters/agenthub/index.js +18 -0
  9. package/dist/adapters/registry.d.ts +4 -0
  10. package/dist/adapters/registry.js +17 -0
  11. package/dist/adapters/types.d.ts +40 -0
  12. package/dist/adapters/types.js +2 -0
  13. package/dist/cache/content-cache.d.ts +46 -0
  14. package/dist/cache/content-cache.js +123 -0
  15. package/dist/cli/args.d.ts +7 -0
  16. package/dist/cli/args.js +26 -0
  17. package/dist/cli/assets/agent-kit.d.ts +15 -0
  18. package/dist/cli/assets/agent-kit.js +167 -0
  19. package/dist/cli/commands/check.d.ts +38 -0
  20. package/dist/cli/commands/check.js +70 -0
  21. package/dist/cli/commands/import.d.ts +6 -0
  22. package/dist/cli/commands/import.js +34 -0
  23. package/dist/cli/commands/init.d.ts +13 -0
  24. package/dist/cli/commands/init.js +70 -0
  25. package/dist/cli/commands/inspect.d.ts +23 -0
  26. package/dist/cli/commands/inspect.js +35 -0
  27. package/dist/cli/commands/snapshot.d.ts +121 -0
  28. package/dist/cli/commands/snapshot.js +0 -0
  29. package/dist/cli/commands/view.d.ts +34 -0
  30. package/dist/cli/commands/view.js +45 -0
  31. package/dist/cli/index.d.ts +3 -0
  32. package/dist/cli/index.js +19 -0
  33. package/dist/cli/run.d.ts +11 -0
  34. package/dist/cli/run.js +329 -0
  35. package/dist/loader/find-yaml-files.d.ts +26 -0
  36. package/dist/loader/find-yaml-files.js +51 -0
  37. package/dist/loader/index.d.ts +4 -0
  38. package/dist/loader/index.js +4 -0
  39. package/dist/loader/load-model.d.ts +32 -0
  40. package/dist/loader/load-model.js +54 -0
  41. package/dist/loader/model-graph.d.ts +43 -0
  42. package/dist/loader/model-graph.js +78 -0
  43. package/dist/mcp/server.d.ts +5 -0
  44. package/dist/mcp/server.js +53 -0
  45. package/dist/query/diff.d.ts +47 -0
  46. package/dist/query/diff.js +130 -0
  47. package/dist/query/effective-constraints.d.ts +48 -0
  48. package/dist/query/effective-constraints.js +81 -0
  49. package/dist/query/index.d.ts +7 -0
  50. package/dist/query/index.js +7 -0
  51. package/dist/query/queries.d.ts +111 -0
  52. package/dist/query/queries.js +172 -0
  53. package/dist/query/run-query.d.ts +16 -0
  54. package/dist/query/run-query.js +181 -0
  55. package/dist/query/side-channel.d.ts +25 -0
  56. package/dist/query/side-channel.js +46 -0
  57. package/dist/query/slice.d.ts +57 -0
  58. package/dist/query/slice.js +124 -0
  59. package/dist/query/summary.d.ts +9 -0
  60. package/dist/query/summary.js +180 -0
  61. package/dist/schema/index.d.ts +3 -0
  62. package/dist/schema/index.js +3 -0
  63. package/dist/schema/model.d.ts +661 -0
  64. package/dist/schema/model.js +183 -0
  65. package/dist/schema/status.d.ts +18 -0
  66. package/dist/schema/status.js +28 -0
  67. package/dist/staleness.d.ts +57 -0
  68. package/dist/staleness.js +148 -0
  69. package/dist/validate/anchor.d.ts +4 -0
  70. package/dist/validate/anchor.js +32 -0
  71. package/dist/validate/baseline.d.ts +11 -0
  72. package/dist/validate/baseline.js +18 -0
  73. package/dist/validate/checks.d.ts +59 -0
  74. package/dist/validate/checks.js +303 -0
  75. package/dist/validate/index.d.ts +6 -0
  76. package/dist/validate/index.js +6 -0
  77. package/dist/validate/inv1/check.d.ts +36 -0
  78. package/dist/validate/inv1/check.js +96 -0
  79. package/dist/validate/inv1/config.d.ts +75 -0
  80. package/dist/validate/inv1/config.js +63 -0
  81. package/dist/validate/inv1/scan.d.ts +49 -0
  82. package/dist/validate/inv1/scan.js +172 -0
  83. package/dist/validate/t0.d.ts +27 -0
  84. package/dist/validate/t0.js +31 -0
  85. package/dist/validate/types.d.ts +16 -0
  86. package/dist/validate/types.js +4 -0
  87. package/dist/validate/unregistered.d.ts +70 -0
  88. package/dist/validate/unregistered.js +111 -0
  89. package/dist/views/flow-mermaid.d.ts +30 -0
  90. package/dist/views/flow-mermaid.js +89 -0
  91. package/dist/views/index.d.ts +3 -0
  92. package/dist/views/index.js +3 -0
  93. package/dist/views/validate-mermaid.d.ts +39 -0
  94. package/dist/views/validate-mermaid.js +110 -0
  95. package/package.json +46 -0
@@ -0,0 +1,661 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * IDs are re-used verbatim from the source research documents so that the
4
+ * drift test (test/drift.test.ts) can diff model IDs against IDs extracted
5
+ * straight out of the PR tables, with no hand-maintained translation layer.
6
+ */
7
+ export declare const LoopId: z.ZodString;
8
+ export type LoopId = z.infer<typeof LoopId>;
9
+ export declare const FlowId: z.ZodString;
10
+ export type FlowId = z.infer<typeof FlowId>;
11
+ export declare const FeatureId: z.ZodString;
12
+ export type FeatureId = z.infer<typeof FeatureId>;
13
+ export declare const JunctionId: z.ZodString;
14
+ export type JunctionId = z.infer<typeof JunctionId>;
15
+ export declare const ScenarioId: z.ZodString;
16
+ export type ScenarioId = z.infer<typeof ScenarioId>;
17
+ /**
18
+ * Max length of `Evidence.note`. `note` exists only to help a reader
19
+ * *locate* the anchored evidence (a line range, a function name, a test-name
20
+ * fragment) — NOT to narrate causal reasoning or historical background.
21
+ * The cap is a mechanical backstop for that intent: prose explanations run
22
+ * long, pointers stay short. Kept as a named const so the schema test and
23
+ * any future review tooling reference the same number.
24
+ */
25
+ export declare const EVIDENCE_NOTE_MAX = 200;
26
+ /**
27
+ * Evidence is embedded inside Junction (evidence: Evidence[]) rather than
28
+ * a standalone top-level file — it only makes sense bound to the claim it
29
+ * proves. Scenario does NOT carry Evidence directly: its `verified_by`
30
+ * field holds plain test/E2E anchor strings instead, since GWT→test
31
+ * binding is a simpler 1:many mapping than Junction's need for typed,
32
+ * multi-kind evidence.
33
+ *
34
+ * `kind` taxonomy:
35
+ * - Runtime/code evidence: test / durable_event / e2e / metric / trace /
36
+ * log / code — an anchor that resolves to a projection or observation of
37
+ * the running system.
38
+ * - Intent/planning evidence (Proposal 006 A1): `spec` points at a
39
+ * requirement/design statement (a spec section, an ADR line), `issue`
40
+ * points at a tracked work item (a GitHub issue/PR reference). These let
41
+ * a junction cite "this handoff is deliberately deferred, see #NNNN" or
42
+ * "the poller's settled≠done semantics is specified here" without dressing
43
+ * a planning pointer up as a runtime observation. Because they are the
44
+ * easiest kind to smuggle prose into, `note` on these is held to the same
45
+ * anchor-only, pointer-not-narrative discipline as every other kind (see
46
+ * `EVIDENCE_NOTE_MAX`); reviewers of any content PR treat a `spec`/`issue`
47
+ * note that argues causation or recounts history as a defect.
48
+ */
49
+ export declare const Evidence: z.ZodObject<{
50
+ id: z.ZodString;
51
+ kind: z.ZodEnum<["test", "durable_event", "e2e", "metric", "trace", "log", "code", "spec", "issue"]>;
52
+ anchor: z.ZodString;
53
+ source: z.ZodOptional<z.ZodString>;
54
+ transport: z.ZodOptional<z.ZodEnum<["direct", "relay", "durable_event"]>>;
55
+ binding: z.ZodOptional<z.ZodObject<{
56
+ image_revision: z.ZodEnum<["required", "optional"]>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ image_revision: "required" | "optional";
59
+ }, {
60
+ image_revision: "required" | "optional";
61
+ }>>;
62
+ confidence: z.ZodOptional<z.ZodEnum<["high", "medium", "low"]>>;
63
+ note: z.ZodOptional<z.ZodString>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ anchor: string;
66
+ id: string;
67
+ kind: "code" | "test" | "durable_event" | "e2e" | "metric" | "trace" | "log" | "spec" | "issue";
68
+ source?: string | undefined;
69
+ transport?: "durable_event" | "direct" | "relay" | undefined;
70
+ binding?: {
71
+ image_revision: "required" | "optional";
72
+ } | undefined;
73
+ confidence?: "high" | "medium" | "low" | undefined;
74
+ note?: string | undefined;
75
+ }, {
76
+ anchor: string;
77
+ id: string;
78
+ kind: "code" | "test" | "durable_event" | "e2e" | "metric" | "trace" | "log" | "spec" | "issue";
79
+ source?: string | undefined;
80
+ transport?: "durable_event" | "direct" | "relay" | undefined;
81
+ binding?: {
82
+ image_revision: "required" | "optional";
83
+ } | undefined;
84
+ confidence?: "high" | "medium" | "low" | undefined;
85
+ note?: string | undefined;
86
+ }>;
87
+ export type Evidence = z.infer<typeof Evidence>;
88
+ /**
89
+ * Loop covers both ordinary top-level loops (L1, N19, ...) and the
90
+ * "(内嵌)" embedded submachines (L1a/L1b/L3a/L20a) that share a parent's
91
+ * boundary but carry their own state. Dormant/unwired loops like N8
92
+ * ("M2 休眠") have owner: null and dormant: true instead of being dropped.
93
+ */
94
+ export declare const Loop: z.ZodObject<{
95
+ id: z.ZodString;
96
+ kind: z.ZodLiteral<"loop">;
97
+ title: z.ZodString;
98
+ boundary: z.ZodString;
99
+ owner: z.ZodNullable<z.ZodString>;
100
+ section: z.ZodOptional<z.ZodString>;
101
+ parent: z.ZodOptional<z.ZodString>;
102
+ embedded: z.ZodOptional<z.ZodBoolean>;
103
+ dormant: z.ZodOptional<z.ZodBoolean>;
104
+ status: z.ZodDefault<z.ZodEnum<["conformant", "unimplemented", "unverified", "drifted", "unregistered", "deprecated"]>>;
105
+ anchors: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
106
+ /**
107
+ * pg-boss queue names this loop CONSUMES (Proposal 006 C2 root-fix). A queue is
108
+ * defined at its producer/enqueue site (e.g. a shared `services.ts` registry)
109
+ * but its lifecycle belongs to the consuming loop, which may live in a
110
+ * different file. Declaring the names here lets reconciliation register a queue
111
+ * fact by NAME — so a producer-registry definition is not a false "unregistered"
112
+ * just because its file carries no anchor. This is an explicit modeling
113
+ * assertion ("this loop consumes order:process"), verified against the
114
+ * consumer's queue handler; it is NOT a way to silence facts (that would be a
115
+ * dormant loop) and NOT a synthetic node (a registry file is not a loop).
116
+ */
117
+ consumes_queues: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
118
+ scenarios: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
119
+ notes: z.ZodOptional<z.ZodString>;
120
+ }, "strip", z.ZodTypeAny, {
121
+ status: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated";
122
+ id: string;
123
+ kind: "loop";
124
+ title: string;
125
+ boundary: string;
126
+ owner: string | null;
127
+ anchors: string[];
128
+ consumes_queues: string[];
129
+ scenarios: string[];
130
+ section?: string | undefined;
131
+ parent?: string | undefined;
132
+ embedded?: boolean | undefined;
133
+ dormant?: boolean | undefined;
134
+ notes?: string | undefined;
135
+ }, {
136
+ id: string;
137
+ kind: "loop";
138
+ title: string;
139
+ boundary: string;
140
+ owner: string | null;
141
+ status?: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated" | undefined;
142
+ section?: string | undefined;
143
+ parent?: string | undefined;
144
+ embedded?: boolean | undefined;
145
+ dormant?: boolean | undefined;
146
+ anchors?: string[] | undefined;
147
+ consumes_queues?: string[] | undefined;
148
+ scenarios?: string[] | undefined;
149
+ notes?: string | undefined;
150
+ }>;
151
+ export type Loop = z.infer<typeof Loop>;
152
+ /**
153
+ * Flow = composite flow (C1..C9). `traverses` is the ordered loop sequence;
154
+ * `guarded_by` holds watchdog loops (e.g. C1's L9) that don't sit in the
155
+ * primary sequence but cover it; `references` holds sub-flow composition
156
+ * (e.g. C1 references C2/C3 as expandable sub-chains).
157
+ */
158
+ export declare const Flow: z.ZodObject<{
159
+ id: z.ZodString;
160
+ kind: z.ZodLiteral<"flow">;
161
+ title: z.ZodString;
162
+ traverses: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
163
+ guarded_by: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
164
+ crosses: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
165
+ references: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
166
+ risk_notes: z.ZodOptional<z.ZodString>;
167
+ status: z.ZodDefault<z.ZodEnum<["conformant", "unimplemented", "unverified", "drifted", "unregistered", "deprecated"]>>;
168
+ }, "strip", z.ZodTypeAny, {
169
+ status: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated";
170
+ id: string;
171
+ kind: "flow";
172
+ title: string;
173
+ traverses: string[];
174
+ guarded_by: string[];
175
+ crosses: string[];
176
+ references: string[];
177
+ risk_notes?: string | undefined;
178
+ }, {
179
+ id: string;
180
+ kind: "flow";
181
+ title: string;
182
+ status?: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated" | undefined;
183
+ traverses?: string[] | undefined;
184
+ guarded_by?: string[] | undefined;
185
+ crosses?: string[] | undefined;
186
+ references?: string[] | undefined;
187
+ risk_notes?: string | undefined;
188
+ }>;
189
+ export type Flow = z.infer<typeof Flow>;
190
+ export declare const Junction: z.ZodObject<{
191
+ id: z.ZodString;
192
+ kind: z.ZodLiteral<"junction">;
193
+ title: z.ZodOptional<z.ZodString>;
194
+ risk_class: z.ZodEnum<["handoff", "idempotency", "projection", "failure_propagation", "watchdog"]>;
195
+ between: z.ZodArray<z.ZodString, "many">;
196
+ scenarios: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
197
+ evidence: z.ZodDefault<z.ZodArray<z.ZodObject<{
198
+ id: z.ZodString;
199
+ kind: z.ZodEnum<["test", "durable_event", "e2e", "metric", "trace", "log", "code", "spec", "issue"]>;
200
+ anchor: z.ZodString;
201
+ source: z.ZodOptional<z.ZodString>;
202
+ transport: z.ZodOptional<z.ZodEnum<["direct", "relay", "durable_event"]>>;
203
+ binding: z.ZodOptional<z.ZodObject<{
204
+ image_revision: z.ZodEnum<["required", "optional"]>;
205
+ }, "strip", z.ZodTypeAny, {
206
+ image_revision: "required" | "optional";
207
+ }, {
208
+ image_revision: "required" | "optional";
209
+ }>>;
210
+ confidence: z.ZodOptional<z.ZodEnum<["high", "medium", "low"]>>;
211
+ note: z.ZodOptional<z.ZodString>;
212
+ }, "strip", z.ZodTypeAny, {
213
+ anchor: string;
214
+ id: string;
215
+ kind: "code" | "test" | "durable_event" | "e2e" | "metric" | "trace" | "log" | "spec" | "issue";
216
+ source?: string | undefined;
217
+ transport?: "durable_event" | "direct" | "relay" | undefined;
218
+ binding?: {
219
+ image_revision: "required" | "optional";
220
+ } | undefined;
221
+ confidence?: "high" | "medium" | "low" | undefined;
222
+ note?: string | undefined;
223
+ }, {
224
+ anchor: string;
225
+ id: string;
226
+ kind: "code" | "test" | "durable_event" | "e2e" | "metric" | "trace" | "log" | "spec" | "issue";
227
+ source?: string | undefined;
228
+ transport?: "durable_event" | "direct" | "relay" | undefined;
229
+ binding?: {
230
+ image_revision: "required" | "optional";
231
+ } | undefined;
232
+ confidence?: "high" | "medium" | "low" | undefined;
233
+ note?: string | undefined;
234
+ }>, "many">>;
235
+ status: z.ZodDefault<z.ZodEnum<["conformant", "unimplemented", "unverified", "drifted", "unregistered", "deprecated"]>>;
236
+ }, "strip", z.ZodTypeAny, {
237
+ status: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated";
238
+ id: string;
239
+ kind: "junction";
240
+ scenarios: string[];
241
+ risk_class: "handoff" | "idempotency" | "projection" | "failure_propagation" | "watchdog";
242
+ between: string[];
243
+ evidence: {
244
+ anchor: string;
245
+ id: string;
246
+ kind: "code" | "test" | "durable_event" | "e2e" | "metric" | "trace" | "log" | "spec" | "issue";
247
+ source?: string | undefined;
248
+ transport?: "durable_event" | "direct" | "relay" | undefined;
249
+ binding?: {
250
+ image_revision: "required" | "optional";
251
+ } | undefined;
252
+ confidence?: "high" | "medium" | "low" | undefined;
253
+ note?: string | undefined;
254
+ }[];
255
+ title?: string | undefined;
256
+ }, {
257
+ id: string;
258
+ kind: "junction";
259
+ risk_class: "handoff" | "idempotency" | "projection" | "failure_propagation" | "watchdog";
260
+ between: string[];
261
+ status?: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated" | undefined;
262
+ title?: string | undefined;
263
+ scenarios?: string[] | undefined;
264
+ evidence?: {
265
+ anchor: string;
266
+ id: string;
267
+ kind: "code" | "test" | "durable_event" | "e2e" | "metric" | "trace" | "log" | "spec" | "issue";
268
+ source?: string | undefined;
269
+ transport?: "durable_event" | "direct" | "relay" | undefined;
270
+ binding?: {
271
+ image_revision: "required" | "optional";
272
+ } | undefined;
273
+ confidence?: "high" | "medium" | "low" | undefined;
274
+ note?: string | undefined;
275
+ }[] | undefined;
276
+ }>;
277
+ export type Junction = z.infer<typeof Junction>;
278
+ /**
279
+ * Selector for effective-constraints propagation (Decision record 004,
280
+ * 技术点 2): decides which nodes an Invariant-flavored Scenario applies
281
+ * to automatically, without hand-listing the scenario id in every
282
+ * relevant node's `scenarios` array. Resolved at query time by
283
+ * src/query/effective-constraints.ts, never materialized — see that
284
+ * module for match semantics (owner_match is substring containment with
285
+ * optional `*` wildcard, NOT prefix-anchored or POSIX glob).
286
+ */
287
+ export declare const AppliesTo: z.ZodObject<{
288
+ nodes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
289
+ owner_match: z.ZodOptional<z.ZodString>;
290
+ }, "strip", z.ZodTypeAny, {
291
+ nodes: string[];
292
+ owner_match?: string | undefined;
293
+ }, {
294
+ nodes?: string[] | undefined;
295
+ owner_match?: string | undefined;
296
+ }>;
297
+ export type AppliesTo = z.infer<typeof AppliesTo>;
298
+ export declare const Scenario: z.ZodObject<{
299
+ id: z.ZodString;
300
+ kind: z.ZodLiteral<"scenario">;
301
+ given: z.ZodString;
302
+ when: z.ZodString;
303
+ then: z.ZodString;
304
+ level: z.ZodEnum<["unit", "focused-integration", "contract", "integration", "e2e", "operational"]>;
305
+ verified_by: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
306
+ applies_to: z.ZodOptional<z.ZodObject<{
307
+ nodes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
308
+ owner_match: z.ZodOptional<z.ZodString>;
309
+ }, "strip", z.ZodTypeAny, {
310
+ nodes: string[];
311
+ owner_match?: string | undefined;
312
+ }, {
313
+ nodes?: string[] | undefined;
314
+ owner_match?: string | undefined;
315
+ }>>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ then: string;
318
+ id: string;
319
+ kind: "scenario";
320
+ given: string;
321
+ when: string;
322
+ level: "e2e" | "unit" | "focused-integration" | "contract" | "integration" | "operational";
323
+ verified_by: string[];
324
+ applies_to?: {
325
+ nodes: string[];
326
+ owner_match?: string | undefined;
327
+ } | undefined;
328
+ }, {
329
+ then: string;
330
+ id: string;
331
+ kind: "scenario";
332
+ given: string;
333
+ when: string;
334
+ level: "e2e" | "unit" | "focused-integration" | "contract" | "integration" | "operational";
335
+ verified_by?: string[] | undefined;
336
+ applies_to?: {
337
+ nodes?: string[] | undefined;
338
+ owner_match?: string | undefined;
339
+ } | undefined;
340
+ }>;
341
+ export type Scenario = z.infer<typeof Scenario>;
342
+ export declare const Feature: z.ZodObject<{
343
+ id: z.ZodString;
344
+ kind: z.ZodLiteral<"feature">;
345
+ title: z.ZodString;
346
+ contains: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
347
+ status: z.ZodDefault<z.ZodEnum<["conformant", "unimplemented", "unverified", "drifted", "unregistered", "deprecated"]>>;
348
+ }, "strip", z.ZodTypeAny, {
349
+ status: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated";
350
+ id: string;
351
+ kind: "feature";
352
+ title: string;
353
+ contains: string[];
354
+ }, {
355
+ id: string;
356
+ kind: "feature";
357
+ title: string;
358
+ status?: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated" | undefined;
359
+ contains?: string[] | undefined;
360
+ }>;
361
+ export type Feature = z.infer<typeof Feature>;
362
+ /**
363
+ * DebtEntry is deliberately a different shape from Loop: the 6
364
+ * dead-state-machine tables and 2 deferred loops from the seed baseline describe
365
+ * something that LOOKS like a loop (has a status column / was scoped as
366
+ * a loop) but fails the "independent advance mechanism" test — they are
367
+ * baseline debt, not behavior to model as Loop nodes.
368
+ */
369
+ export declare const DebtId: z.ZodString;
370
+ export type DebtId = z.infer<typeof DebtId>;
371
+ export declare const DebtEntry: z.ZodObject<{
372
+ id: z.ZodString;
373
+ kind: z.ZodLiteral<"debt">;
374
+ category: z.ZodEnum<["dead_state_machine", "deferred", "other"]>;
375
+ subject: z.ZodString;
376
+ claim: z.ZodOptional<z.ZodString>;
377
+ reality: z.ZodString;
378
+ owner: z.ZodOptional<z.ZodString>;
379
+ removal_condition: z.ZodOptional<z.ZodString>;
380
+ }, "strip", z.ZodTypeAny, {
381
+ id: string;
382
+ kind: "debt";
383
+ category: "dead_state_machine" | "deferred" | "other";
384
+ subject: string;
385
+ reality: string;
386
+ owner?: string | undefined;
387
+ claim?: string | undefined;
388
+ removal_condition?: string | undefined;
389
+ }, {
390
+ id: string;
391
+ kind: "debt";
392
+ category: "dead_state_machine" | "deferred" | "other";
393
+ subject: string;
394
+ reality: string;
395
+ owner?: string | undefined;
396
+ claim?: string | undefined;
397
+ removal_condition?: string | undefined;
398
+ }>;
399
+ export type DebtEntry = z.infer<typeof DebtEntry>;
400
+ export declare const ModelNode: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
401
+ id: z.ZodString;
402
+ kind: z.ZodLiteral<"feature">;
403
+ title: z.ZodString;
404
+ contains: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
405
+ status: z.ZodDefault<z.ZodEnum<["conformant", "unimplemented", "unverified", "drifted", "unregistered", "deprecated"]>>;
406
+ }, "strip", z.ZodTypeAny, {
407
+ status: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated";
408
+ id: string;
409
+ kind: "feature";
410
+ title: string;
411
+ contains: string[];
412
+ }, {
413
+ id: string;
414
+ kind: "feature";
415
+ title: string;
416
+ status?: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated" | undefined;
417
+ contains?: string[] | undefined;
418
+ }>, z.ZodObject<{
419
+ id: z.ZodString;
420
+ kind: z.ZodLiteral<"flow">;
421
+ title: z.ZodString;
422
+ traverses: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
423
+ guarded_by: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
424
+ crosses: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
425
+ references: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
426
+ risk_notes: z.ZodOptional<z.ZodString>;
427
+ status: z.ZodDefault<z.ZodEnum<["conformant", "unimplemented", "unverified", "drifted", "unregistered", "deprecated"]>>;
428
+ }, "strip", z.ZodTypeAny, {
429
+ status: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated";
430
+ id: string;
431
+ kind: "flow";
432
+ title: string;
433
+ traverses: string[];
434
+ guarded_by: string[];
435
+ crosses: string[];
436
+ references: string[];
437
+ risk_notes?: string | undefined;
438
+ }, {
439
+ id: string;
440
+ kind: "flow";
441
+ title: string;
442
+ status?: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated" | undefined;
443
+ traverses?: string[] | undefined;
444
+ guarded_by?: string[] | undefined;
445
+ crosses?: string[] | undefined;
446
+ references?: string[] | undefined;
447
+ risk_notes?: string | undefined;
448
+ }>, z.ZodObject<{
449
+ id: z.ZodString;
450
+ kind: z.ZodLiteral<"loop">;
451
+ title: z.ZodString;
452
+ boundary: z.ZodString;
453
+ owner: z.ZodNullable<z.ZodString>;
454
+ section: z.ZodOptional<z.ZodString>;
455
+ parent: z.ZodOptional<z.ZodString>;
456
+ embedded: z.ZodOptional<z.ZodBoolean>;
457
+ dormant: z.ZodOptional<z.ZodBoolean>;
458
+ status: z.ZodDefault<z.ZodEnum<["conformant", "unimplemented", "unverified", "drifted", "unregistered", "deprecated"]>>;
459
+ anchors: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
460
+ /**
461
+ * pg-boss queue names this loop CONSUMES (Proposal 006 C2 root-fix). A queue is
462
+ * defined at its producer/enqueue site (e.g. a shared `services.ts` registry)
463
+ * but its lifecycle belongs to the consuming loop, which may live in a
464
+ * different file. Declaring the names here lets reconciliation register a queue
465
+ * fact by NAME — so a producer-registry definition is not a false "unregistered"
466
+ * just because its file carries no anchor. This is an explicit modeling
467
+ * assertion ("this loop consumes order:process"), verified against the
468
+ * consumer's queue handler; it is NOT a way to silence facts (that would be a
469
+ * dormant loop) and NOT a synthetic node (a registry file is not a loop).
470
+ */
471
+ consumes_queues: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
472
+ scenarios: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
473
+ notes: z.ZodOptional<z.ZodString>;
474
+ }, "strip", z.ZodTypeAny, {
475
+ status: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated";
476
+ id: string;
477
+ kind: "loop";
478
+ title: string;
479
+ boundary: string;
480
+ owner: string | null;
481
+ anchors: string[];
482
+ consumes_queues: string[];
483
+ scenarios: string[];
484
+ section?: string | undefined;
485
+ parent?: string | undefined;
486
+ embedded?: boolean | undefined;
487
+ dormant?: boolean | undefined;
488
+ notes?: string | undefined;
489
+ }, {
490
+ id: string;
491
+ kind: "loop";
492
+ title: string;
493
+ boundary: string;
494
+ owner: string | null;
495
+ status?: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated" | undefined;
496
+ section?: string | undefined;
497
+ parent?: string | undefined;
498
+ embedded?: boolean | undefined;
499
+ dormant?: boolean | undefined;
500
+ anchors?: string[] | undefined;
501
+ consumes_queues?: string[] | undefined;
502
+ scenarios?: string[] | undefined;
503
+ notes?: string | undefined;
504
+ }>, z.ZodObject<{
505
+ id: z.ZodString;
506
+ kind: z.ZodLiteral<"junction">;
507
+ title: z.ZodOptional<z.ZodString>;
508
+ risk_class: z.ZodEnum<["handoff", "idempotency", "projection", "failure_propagation", "watchdog"]>;
509
+ between: z.ZodArray<z.ZodString, "many">;
510
+ scenarios: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
511
+ evidence: z.ZodDefault<z.ZodArray<z.ZodObject<{
512
+ id: z.ZodString;
513
+ kind: z.ZodEnum<["test", "durable_event", "e2e", "metric", "trace", "log", "code", "spec", "issue"]>;
514
+ anchor: z.ZodString;
515
+ source: z.ZodOptional<z.ZodString>;
516
+ transport: z.ZodOptional<z.ZodEnum<["direct", "relay", "durable_event"]>>;
517
+ binding: z.ZodOptional<z.ZodObject<{
518
+ image_revision: z.ZodEnum<["required", "optional"]>;
519
+ }, "strip", z.ZodTypeAny, {
520
+ image_revision: "required" | "optional";
521
+ }, {
522
+ image_revision: "required" | "optional";
523
+ }>>;
524
+ confidence: z.ZodOptional<z.ZodEnum<["high", "medium", "low"]>>;
525
+ note: z.ZodOptional<z.ZodString>;
526
+ }, "strip", z.ZodTypeAny, {
527
+ anchor: string;
528
+ id: string;
529
+ kind: "code" | "test" | "durable_event" | "e2e" | "metric" | "trace" | "log" | "spec" | "issue";
530
+ source?: string | undefined;
531
+ transport?: "durable_event" | "direct" | "relay" | undefined;
532
+ binding?: {
533
+ image_revision: "required" | "optional";
534
+ } | undefined;
535
+ confidence?: "high" | "medium" | "low" | undefined;
536
+ note?: string | undefined;
537
+ }, {
538
+ anchor: string;
539
+ id: string;
540
+ kind: "code" | "test" | "durable_event" | "e2e" | "metric" | "trace" | "log" | "spec" | "issue";
541
+ source?: string | undefined;
542
+ transport?: "durable_event" | "direct" | "relay" | undefined;
543
+ binding?: {
544
+ image_revision: "required" | "optional";
545
+ } | undefined;
546
+ confidence?: "high" | "medium" | "low" | undefined;
547
+ note?: string | undefined;
548
+ }>, "many">>;
549
+ status: z.ZodDefault<z.ZodEnum<["conformant", "unimplemented", "unverified", "drifted", "unregistered", "deprecated"]>>;
550
+ }, "strip", z.ZodTypeAny, {
551
+ status: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated";
552
+ id: string;
553
+ kind: "junction";
554
+ scenarios: string[];
555
+ risk_class: "handoff" | "idempotency" | "projection" | "failure_propagation" | "watchdog";
556
+ between: string[];
557
+ evidence: {
558
+ anchor: string;
559
+ id: string;
560
+ kind: "code" | "test" | "durable_event" | "e2e" | "metric" | "trace" | "log" | "spec" | "issue";
561
+ source?: string | undefined;
562
+ transport?: "durable_event" | "direct" | "relay" | undefined;
563
+ binding?: {
564
+ image_revision: "required" | "optional";
565
+ } | undefined;
566
+ confidence?: "high" | "medium" | "low" | undefined;
567
+ note?: string | undefined;
568
+ }[];
569
+ title?: string | undefined;
570
+ }, {
571
+ id: string;
572
+ kind: "junction";
573
+ risk_class: "handoff" | "idempotency" | "projection" | "failure_propagation" | "watchdog";
574
+ between: string[];
575
+ status?: "conformant" | "unimplemented" | "unverified" | "drifted" | "unregistered" | "deprecated" | undefined;
576
+ title?: string | undefined;
577
+ scenarios?: string[] | undefined;
578
+ evidence?: {
579
+ anchor: string;
580
+ id: string;
581
+ kind: "code" | "test" | "durable_event" | "e2e" | "metric" | "trace" | "log" | "spec" | "issue";
582
+ source?: string | undefined;
583
+ transport?: "durable_event" | "direct" | "relay" | undefined;
584
+ binding?: {
585
+ image_revision: "required" | "optional";
586
+ } | undefined;
587
+ confidence?: "high" | "medium" | "low" | undefined;
588
+ note?: string | undefined;
589
+ }[] | undefined;
590
+ }>, z.ZodObject<{
591
+ id: z.ZodString;
592
+ kind: z.ZodLiteral<"scenario">;
593
+ given: z.ZodString;
594
+ when: z.ZodString;
595
+ then: z.ZodString;
596
+ level: z.ZodEnum<["unit", "focused-integration", "contract", "integration", "e2e", "operational"]>;
597
+ verified_by: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
598
+ applies_to: z.ZodOptional<z.ZodObject<{
599
+ nodes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
600
+ owner_match: z.ZodOptional<z.ZodString>;
601
+ }, "strip", z.ZodTypeAny, {
602
+ nodes: string[];
603
+ owner_match?: string | undefined;
604
+ }, {
605
+ nodes?: string[] | undefined;
606
+ owner_match?: string | undefined;
607
+ }>>;
608
+ }, "strip", z.ZodTypeAny, {
609
+ then: string;
610
+ id: string;
611
+ kind: "scenario";
612
+ given: string;
613
+ when: string;
614
+ level: "e2e" | "unit" | "focused-integration" | "contract" | "integration" | "operational";
615
+ verified_by: string[];
616
+ applies_to?: {
617
+ nodes: string[];
618
+ owner_match?: string | undefined;
619
+ } | undefined;
620
+ }, {
621
+ then: string;
622
+ id: string;
623
+ kind: "scenario";
624
+ given: string;
625
+ when: string;
626
+ level: "e2e" | "unit" | "focused-integration" | "contract" | "integration" | "operational";
627
+ verified_by?: string[] | undefined;
628
+ applies_to?: {
629
+ nodes?: string[] | undefined;
630
+ owner_match?: string | undefined;
631
+ } | undefined;
632
+ }>, z.ZodObject<{
633
+ id: z.ZodString;
634
+ kind: z.ZodLiteral<"debt">;
635
+ category: z.ZodEnum<["dead_state_machine", "deferred", "other"]>;
636
+ subject: z.ZodString;
637
+ claim: z.ZodOptional<z.ZodString>;
638
+ reality: z.ZodString;
639
+ owner: z.ZodOptional<z.ZodString>;
640
+ removal_condition: z.ZodOptional<z.ZodString>;
641
+ }, "strip", z.ZodTypeAny, {
642
+ id: string;
643
+ kind: "debt";
644
+ category: "dead_state_machine" | "deferred" | "other";
645
+ subject: string;
646
+ reality: string;
647
+ owner?: string | undefined;
648
+ claim?: string | undefined;
649
+ removal_condition?: string | undefined;
650
+ }, {
651
+ id: string;
652
+ kind: "debt";
653
+ category: "dead_state_machine" | "deferred" | "other";
654
+ subject: string;
655
+ reality: string;
656
+ owner?: string | undefined;
657
+ claim?: string | undefined;
658
+ removal_condition?: string | undefined;
659
+ }>]>;
660
+ export type ModelNode = z.infer<typeof ModelNode>;
661
+ //# sourceMappingURL=model.d.ts.map