@vibesdotdev/traversal 0.0.0-stage → 1.0.0-rc.1

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 (52) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +2 -2
  3. package/dist/execution-schemas.d.ts +2373 -0
  4. package/dist/execution-schemas.d.ts.map +1 -0
  5. package/dist/execution-schemas.js +102 -0
  6. package/dist/execution-schemas.js.map +1 -0
  7. package/dist/graph-schemas.d.ts +17 -0
  8. package/dist/graph-schemas.d.ts.map +1 -0
  9. package/dist/graph-schemas.js +9 -0
  10. package/dist/graph-schemas.js.map +1 -0
  11. package/dist/index.d.ts +4 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +4 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/plugin.d.ts +3 -0
  16. package/dist/plugin.d.ts.map +1 -0
  17. package/dist/plugin.js +23 -0
  18. package/dist/plugin.js.map +1 -0
  19. package/dist/schemas.d.ts +60 -0
  20. package/dist/schemas.d.ts.map +1 -0
  21. package/dist/schemas.js +11 -0
  22. package/dist/schemas.js.map +1 -0
  23. package/dist/strategies.d.ts +16 -0
  24. package/dist/strategies.d.ts.map +1 -0
  25. package/dist/strategies.js +76 -0
  26. package/dist/strategies.js.map +1 -0
  27. package/dist/svelte/GraphRunSection.svelte +56 -0
  28. package/dist/svelte/GraphRunSection.svelte.d.ts +8 -0
  29. package/dist/svelte/GraphRunSection.svelte.d.ts.map +1 -0
  30. package/dist/svelte/GraphRunView.svelte +222 -0
  31. package/dist/svelte/GraphRunView.svelte.d.ts +11 -0
  32. package/dist/svelte/GraphRunView.svelte.d.ts.map +1 -0
  33. package/dist/svelte/index.d.ts +3 -0
  34. package/dist/svelte/index.d.ts.map +1 -0
  35. package/dist/svelte/index.js +2 -0
  36. package/dist/tracking/index.d.ts +2 -0
  37. package/dist/tracking/index.d.ts.map +1 -0
  38. package/dist/tracking/index.js +2 -0
  39. package/dist/tracking/index.js.map +1 -0
  40. package/dist/tracking/selected-traversal.d.ts +9 -0
  41. package/dist/tracking/selected-traversal.d.ts.map +1 -0
  42. package/dist/tracking/selected-traversal.js +40 -0
  43. package/dist/tracking/selected-traversal.js.map +1 -0
  44. package/dist/tracking/traversal-view.d.ts +68 -0
  45. package/dist/tracking/traversal-view.d.ts.map +1 -0
  46. package/dist/tracking/traversal-view.js +253 -0
  47. package/dist/tracking/traversal-view.js.map +1 -0
  48. package/dist/tracking-schemas.d.ts +56 -0
  49. package/dist/tracking-schemas.d.ts.map +1 -0
  50. package/dist/tracking-schemas.js +33 -0
  51. package/dist/tracking-schemas.js.map +1 -0
  52. package/package.json +86 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-schemas.d.ts","sourceRoot":"","sources":["../src/execution-schemas.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,qBAAqB,IAAI,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAGrG,eAAO,MAAM,eAAe;;;iBAK1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;iBAU5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,2HAA2H;AAC3H,eAAO,MAAM,sBAAsB;;;;;;iBAMjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;iBAO/B,CAAC;AAEH,oDAAoD;AACpD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa9B,CAAC;AAEH,6HAA6H;AAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,102 @@
1
+ /** Neutral persisted graph results; scheduling remains owned by Runbooks and Workers. */
2
+ import * as z from 'zod/v4';
3
+ import { JsonValueSchema, JsonObjectSchema, keyedRecordSchema } from '@vibesdotdev/kernel/schemas/json';
4
+ import { FailureFactsSchema, OutcomeSchema } from '@vibesdotdev/runnable/schemas/outcome';
5
+ import { RunnableAttemptSchema as TraversalAttemptSchema } from '@vibesdotdev/runnable/schemas/runs';
6
+ import { GraphNodeSchema } from "./graph-schemas.js";
7
+ export const GraphPlanSchema = z.object({
8
+ /** Tiers in execution order; each tier lists cohorts, each cohort lists node ids. */
9
+ tiers: z.array(z.array(z.array(z.string()))),
10
+ /** Cohorts of more than one node: the graph's real cycles. */
11
+ cycles: z.array(z.array(z.string()))
12
+ });
13
+ export const NodeOutcomeSchema = z.object({
14
+ id: z.string(),
15
+ tier: z.number().int().nonnegative(),
16
+ status: z.enum(['succeeded', 'failed', 'skipped']),
17
+ output: JsonValueSchema.optional(),
18
+ /** Value-free failure facts for a failed node; the blocking dependency for a skipped one. */
19
+ failure: JsonValueSchema.optional(),
20
+ blockedBy: z.array(z.string()).optional(),
21
+ /** The top-level node an expanded nested node belongs to. */
22
+ parent: z.string().optional()
23
+ });
24
+ /** A failed node's recorded facts: a typed refusal's code, reason, message and details, or a failure's value-free name. */
25
+ export const NodeFailureFactsSchema = z.object({
26
+ name: z.string(),
27
+ code: z.string().optional(),
28
+ reason: z.string().optional(),
29
+ message: z.string().optional(),
30
+ details: JsonValueSchema.optional()
31
+ });
32
+ export const GraphExecutionSchema = z.object({
33
+ plan: GraphPlanSchema,
34
+ outcomes: z.array(NodeOutcomeSchema),
35
+ /** What the after-tier hook reported after each tier it ran on, in tier order. */
36
+ tierReports: z.array(JsonValueSchema).default([]),
37
+ /** The after-tier hook stopped the run; the nodes after it were skipped. */
38
+ stopped: z.boolean().default(false)
39
+ });
40
+ /** What graph-execute hands its after-tier hook. */
41
+ export const TierHookInputSchema = z.object({
42
+ tier: z.number().int().nonnegative(),
43
+ /** The tier's nodes (with their data), in run order. */
44
+ nodes: z.array(z.object({ id: z.string(), data: JsonValueSchema.optional() })),
45
+ outcomes: z.array(NodeOutcomeSchema),
46
+ /** Earlier nodes and outcomes, so a parent coordinator can rework an unresolved earlier failure. */
47
+ previous: z.object({
48
+ nodes: z.array(z.object({ id: z.string(), data: JsonValueSchema.optional() })),
49
+ outcomes: z.array(NodeOutcomeSchema)
50
+ }).default({ nodes: [], outcomes: [] }),
51
+ /** The hook's own reports from earlier tiers. */
52
+ reports: z.array(JsonValueSchema),
53
+ input: JsonValueSchema.nullable()
54
+ });
55
+ /** What an after-tier hook returns: the tier's outcomes (replacing those it ran with), whether to stop, a report to keep. */
56
+ export const TierHookResultSchema = z.object({
57
+ outcomes: z.array(NodeOutcomeSchema),
58
+ /** Reworked earlier failed nodes only; ids and original tiers are validated by graph-execute. */
59
+ updates: z.array(NodeOutcomeSchema).default([]),
60
+ stop: z.boolean().default(false),
61
+ report: JsonValueSchema.optional()
62
+ });
63
+ export const GraphSummarySchema = z.object({
64
+ total: z.number().int(),
65
+ succeeded: z.number().int(),
66
+ failed: z.number().int(),
67
+ skipped: z.number().int(),
68
+ tiers: z.number().int(),
69
+ cycles: z.array(z.array(z.string())),
70
+ failedNodes: z.array(z.string()),
71
+ skippedNodes: z.array(z.string())
72
+ });
73
+ /** Runnable visit results, distinct from legacy GraphExecution's transport result array. */
74
+ export { TraversalAttemptSchema };
75
+ export const TraversalExecutionSchema = z.object({
76
+ outcomes: keyedRecordSchema(OutcomeSchema),
77
+ tiers: z.array(z.array(z.string())),
78
+ blockedBy: keyedRecordSchema(z.array(z.string())),
79
+ coordination: OutcomeSchema.optional(),
80
+ /** Native execution/admission failures remain separate from semantic truth and review feedback. */
81
+ failures: keyedRecordSchema(FailureFactsSchema).default({}),
82
+ attempts: keyedRecordSchema(z.array(TraversalAttemptSchema)).default({}),
83
+ reports: z.array(JsonValueSchema)
84
+ });
85
+ export const TierInputSchema = z.object({
86
+ step: z.number().int().nonnegative(),
87
+ ids: z.array(z.string()),
88
+ nodes: z.array(GraphNodeSchema),
89
+ outcomes: keyedRecordSchema(OutcomeSchema),
90
+ failures: keyedRecordSchema(FailureFactsSchema).default({}),
91
+ attempts: keyedRecordSchema(z.array(TraversalAttemptSchema)).default({}),
92
+ waitedOn: keyedRecordSchema(keyedRecordSchema(OutcomeSchema)),
93
+ previous: z.object({ nodes: z.array(GraphNodeSchema), outcomes: keyedRecordSchema(OutcomeSchema) }),
94
+ reports: z.array(JsonValueSchema)
95
+ });
96
+ export const TierResultSchema = z.object({
97
+ next: z.enum(['continue', 'stop']),
98
+ outcomes: keyedRecordSchema(OutcomeSchema),
99
+ rework: z.array(z.object({ id: z.string().min(1), input: JsonObjectSchema, reason: z.string().min(1) })).optional(),
100
+ report: JsonValueSchema.optional()
101
+ });
102
+ //# sourceMappingURL=execution-schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-schemas.js","sourceRoot":"","sources":["../src/execution-schemas.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EAAE,qBAAqB,IAAI,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,qFAAqF;IACrF,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5C,8DAA8D;IAC9D,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;CACpC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,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CAAC,CAAC,QAAQ,EAAE;IACnH,MAAM,EAAE,eAAe,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import * as z from 'zod/v4';
2
+ export declare const GraphNodeSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ dependsOn: z.ZodDefault<z.ZodArray<z.ZodString>>;
5
+ data: z.ZodOptional<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
6
+ }, z.core.$strip>;
7
+ export type GraphNode = z.infer<typeof GraphNodeSchema>;
8
+ export declare const GraphSchema: z.ZodObject<{
9
+ nodes: z.ZodArray<z.ZodObject<{
10
+ id: z.ZodString;
11
+ dependsOn: z.ZodDefault<z.ZodArray<z.ZodString>>;
12
+ data: z.ZodOptional<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
13
+ }, z.core.$strip>>;
14
+ }, z.core.$strip>;
15
+ export type Graph = z.infer<typeof GraphSchema>;
16
+ export type GraphInput = z.input<typeof GraphSchema>;
17
+ //# sourceMappingURL=graph-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-schemas.d.ts","sourceRoot":"","sources":["../src/graph-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,eAAe;;;;iBAI1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,eAAO,MAAM,WAAW;;;;;;iBAAgD,CAAC;AACzE,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAChD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import * as z from 'zod/v4';
2
+ import { JsonValueSchema } from '@vibesdotdev/kernel/schemas/json';
3
+ export const GraphNodeSchema = z.object({
4
+ id: z.string().min(1),
5
+ dependsOn: z.array(z.string().min(1)).default([]),
6
+ data: JsonValueSchema.optional()
7
+ });
8
+ export const GraphSchema = z.object({ nodes: z.array(GraphNodeSchema) });
9
+ //# sourceMappingURL=graph-schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-schemas.js","sourceRoot":"","sources":["../src/graph-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACjD,IAAI,EAAE,eAAe,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './schemas.ts';
2
+ export { strategyKind } from './strategies.ts';
3
+ export { default as plugin } from './plugin.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./schemas.js";
2
+ export { strategyKind } from "./strategies.js";
3
+ export { default as plugin } from "./plugin.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const plugin: import("@vibesdotdev/kernel").RuntimePlugin;
2
+ export default plugin;
3
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,MAAM,6CAYV,CAAC;AACH,eAAe,MAAM,CAAC"}
package/dist/plugin.js ADDED
@@ -0,0 +1,23 @@
1
+ import { createRuntimePlugin, loader } from '@vibesdotdev/kernel';
2
+ import { strategyKind } from "./strategies.js";
3
+ const descriptors = [
4
+ { kind: 'traversal/strategy', id: 'traversal.package-graph', source: 'package-graph' },
5
+ { kind: 'traversal/strategy', id: 'traversal.file-graph', source: 'file-graph' },
6
+ { kind: 'traversal/strategy', id: 'traversal.findings', source: 'findings' },
7
+ { kind: 'traversal/strategy', id: 'traversal.list', source: 'list' }
8
+ ];
9
+ const plugin = createRuntimePlugin({
10
+ id: 'traversal',
11
+ name: 'Traversal graph strategies',
12
+ description: 'Build package, file, finding and list graphs; execution stays with Runbooks and Workers.',
13
+ kinds: [strategyKind],
14
+ descriptors,
15
+ loaders: [
16
+ loader('traversal.package-graph', { kind: 'traversal/strategy' }, async () => ({ impl: (await import("./strategies.js")).PackageGraphStrategy })),
17
+ loader('traversal.file-graph', { kind: 'traversal/strategy' }, async () => ({ impl: (await import("./strategies.js")).FileGraphStrategy })),
18
+ loader('traversal.findings', { kind: 'traversal/strategy' }, async () => ({ impl: (await import("./strategies.js")).FindingsStrategy })),
19
+ loader('traversal.list', { kind: 'traversal/strategy' }, async () => ({ impl: (await import("./strategies.js")).ListStrategy }))
20
+ ]
21
+ });
22
+ export default plugin;
23
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,WAAW,GAAyB;IACzC,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE,EAAE,yBAAyB,EAAE,MAAM,EAAE,eAAe,EAAE;IACtF,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE,EAAE,sBAAsB,EAAE,MAAM,EAAE,YAAY,EAAE;IAChF,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE,EAAE,oBAAoB,EAAE,MAAM,EAAE,UAAU,EAAE;IAC5E,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE;CACpE,CAAC;AAEF,MAAM,MAAM,GAAG,mBAAmB,CAAC;IAClC,EAAE,EAAE,WAAW;IACf,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,0FAA0F;IACvG,KAAK,EAAE,CAAC,YAAY,CAAC;IACrB,WAAW;IACX,OAAO,EAAE;QACR,MAAM,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,oBAAoB,EAAE,CAAC,CAAC;QACjJ,MAAM,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAC3I,MAAM,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAC;QACxI,MAAM,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;KAChI;CACD,CAAC,CAAC;AACH,eAAe,MAAM,CAAC"}
@@ -0,0 +1,60 @@
1
+ import * as z from 'zod/v4';
2
+ export { GraphNodeSchema, GraphSchema, type GraphNode, type Graph, type GraphInput } from './graph-schemas.ts';
3
+ import type { Graph } from './graph-schemas.ts';
4
+ export declare const TraversalSourceKindSchema: z.ZodEnum<{
5
+ list: "list";
6
+ "package-graph": "package-graph";
7
+ "file-graph": "file-graph";
8
+ findings: "findings";
9
+ }>;
10
+ export type TraversalSourceKind = z.infer<typeof TraversalSourceKindSchema>;
11
+ export declare const StrategyDescriptorSchema: z.ZodObject<{
12
+ id: z.ZodString;
13
+ name: z.ZodOptional<z.ZodString>;
14
+ description: z.ZodOptional<z.ZodString>;
15
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
16
+ hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
17
+ enabled: z.ZodOptional<z.ZodBoolean>;
18
+ priority: z.ZodOptional<z.ZodNumber>;
19
+ capabilityId: z.ZodOptional<z.ZodString>;
20
+ requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
+ optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
+ config: z.ZodOptional<z.ZodUnknown>;
23
+ retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
24
+ maxAgeDays: z.ZodOptional<z.ZodNumber>;
25
+ maxEntries: z.ZodOptional<z.ZodNumber>;
26
+ maxBytes: z.ZodOptional<z.ZodNumber>;
27
+ cascadeFrom: z.ZodOptional<z.ZodString>;
28
+ ageField: z.ZodOptional<z.ZodString>;
29
+ reason: z.ZodString;
30
+ enforcedBy: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>]>>;
32
+ kind: z.ZodLiteral<"traversal/strategy">;
33
+ source: z.ZodEnum<{
34
+ list: "list";
35
+ "package-graph": "package-graph";
36
+ "file-graph": "file-graph";
37
+ findings: "findings";
38
+ }>;
39
+ }, z.core.$strip>;
40
+ export type StrategyDescriptor = z.infer<typeof StrategyDescriptorSchema>;
41
+ /** Callbacks stay inside the caller; only the built JSON graph crosses job boundaries. */
42
+ export interface TraversalSource<T> {
43
+ kind: TraversalSourceKind;
44
+ /** Source-owner label recorded with the initial plan, independent of strategy selection. */
45
+ name?: string;
46
+ items(): T[] | Promise<T[]>;
47
+ id(item: T): string;
48
+ dependsOn?(item: T): string[];
49
+ }
50
+ export interface StrategyImplementation {
51
+ build<T>(source: TraversalSource<T>): Promise<Graph>;
52
+ }
53
+ declare module '@vibesdotdev/kernel/schemas/asset' {
54
+ interface RuntimeAssetSchemaRegistry {
55
+ 'traversal/strategy': StrategyDescriptor;
56
+ }
57
+ }
58
+ export * from './execution-schemas.ts';
59
+ export * from './tracking-schemas.ts';
60
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.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escriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
3
+ export { GraphNodeSchema, GraphSchema } from "./graph-schemas.js";
4
+ export const TraversalSourceKindSchema = z.enum(['package-graph', 'file-graph', 'findings', 'list']);
5
+ export const StrategyDescriptorSchema = RuntimeDescriptorSchema.extend({
6
+ kind: z.literal('traversal/strategy'),
7
+ source: TraversalSourceKindSchema
8
+ });
9
+ export * from "./execution-schemas.js";
10
+ export * from "./tracking-schemas.js";
11
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,WAAW,EAA+C,MAAM,oBAAoB,CAAC;AAG/G,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAErG,MAAM,CAAC,MAAM,wBAAwB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IACtE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IACrC,MAAM,EAAE,yBAAyB;CACjC,CAAC,CAAC;AAsBH,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type RuntimeKindDescriptorRecord } from '@vibesdotdev/kernel';
2
+ import { type Graph, type StrategyImplementation, type TraversalSource } from './schemas.ts';
3
+ export declare class PackageGraphStrategy implements StrategyImplementation {
4
+ build<T>(source: TraversalSource<T>): Promise<Graph>;
5
+ }
6
+ export declare class FileGraphStrategy implements StrategyImplementation {
7
+ build<T>(source: TraversalSource<T>): Promise<Graph>;
8
+ }
9
+ export declare class ListStrategy implements StrategyImplementation {
10
+ build<T>(source: TraversalSource<T>): Promise<Graph>;
11
+ }
12
+ export declare class FindingsStrategy implements StrategyImplementation {
13
+ build<T>(source: TraversalSource<T>): Promise<Graph>;
14
+ }
15
+ export declare const strategyKind: RuntimeKindDescriptorRecord<StrategyImplementation>;
16
+ //# sourceMappingURL=strategies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strategies.d.ts","sourceRoot":"","sources":["../src/strategies.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAGxF,OAAO,EAAyC,KAAK,KAAK,EAAkB,KAAK,sBAAsB,EAAE,KAAK,eAAe,EAA4B,MAAM,cAAc,CAAC;AAyB9K,qBAAa,oBAAqB,YAAW,sBAAsB;IAC5D,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC;CAI1D;AAED,qBAAa,iBAAkB,YAAW,sBAAsB;IACzD,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC;CAI1D;AAED,qBAAa,YAAa,YAAW,sBAAsB;IACpD,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC;CAI1D;AAKD,qBAAa,gBAAiB,YAAW,sBAAsB;IACxD,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC;CAqB1D;AAQD,eAAO,MAAM,YAAY,EAAE,2BAA2B,CAAC,sBAAsB,CAE5E,CAAC"}
@@ -0,0 +1,76 @@
1
+ import * as z from 'zod/v4';
2
+ import { CapabilityError } from '@vibesdotdev/kernel';
3
+ import { JsonValueSchema } from '@vibesdotdev/kernel/schemas/json';
4
+ import { DagInputSchema, patternsOverlap } from '@vibesdotdev/shared/schemas';
5
+ import { GraphSchema, StrategyDescriptorSchema } from "./schemas.js";
6
+ function requireSource(source, kind) {
7
+ if (source.kind !== kind) {
8
+ throw new CapabilityError('The traversal strategy does not support this source.', 'INVALID_INPUT', {
9
+ reason: 'traversal-source-mismatch', details: { expected: kind, received: source.kind }
10
+ });
11
+ }
12
+ }
13
+ function validateGraph(nodes) {
14
+ const graph = GraphSchema.parse({ nodes });
15
+ DagInputSchema.parse(graph);
16
+ return graph;
17
+ }
18
+ async function graphOf(source, dependencies) {
19
+ const items = await source.items();
20
+ return validateGraph(items.map((item) => ({
21
+ id: source.id(item),
22
+ dependsOn: dependencies ? source.dependsOn?.(item) ?? [] : [],
23
+ data: JsonValueSchema.parse(item)
24
+ })));
25
+ }
26
+ export class PackageGraphStrategy {
27
+ async build(source) {
28
+ requireSource(source, 'package-graph');
29
+ return graphOf(source, true);
30
+ }
31
+ }
32
+ export class FileGraphStrategy {
33
+ async build(source) {
34
+ requireSource(source, 'file-graph');
35
+ return graphOf(source, true);
36
+ }
37
+ }
38
+ export class ListStrategy {
39
+ async build(source) {
40
+ requireSource(source, 'list');
41
+ return graphOf(source, false);
42
+ }
43
+ }
44
+ /** Rule owners may add fields; grouping preserves the complete JSON finding. */
45
+ const FindingSchema = z.object({ rule: z.string().min(1), file: z.string().optional() }).loose();
46
+ export class FindingsStrategy {
47
+ async build(source) {
48
+ requireSource(source, 'findings');
49
+ const groups = new Map();
50
+ for (const item of await source.items()) {
51
+ const value = JsonValueSchema.parse(item);
52
+ const finding = FindingSchema.parse(value);
53
+ const group = groups.get(finding.rule) ?? { files: [], findings: [] };
54
+ group.files.push(finding.file);
55
+ group.findings.push(value);
56
+ groups.set(finding.rule, group);
57
+ }
58
+ const rules = [...groups.keys()].sort();
59
+ const overlaps = (left, right) => groups.get(left).files.some((first) => groups.get(right).files.some((second) => first === undefined || second === undefined || patternsOverlap(first, second)));
60
+ return validateGraph(rules.map((rule, index) => ({
61
+ id: rule,
62
+ dependsOn: rules.slice(0, index).filter((previous) => overlaps(previous, rule)),
63
+ data: { rule, findings: groups.get(rule).findings }
64
+ })));
65
+ }
66
+ }
67
+ /** A missing implementation is a refusal; each shipped strategy has its own owner loader. */
68
+ class UnimplementedStrategy {
69
+ async build(_source) {
70
+ throw new CapabilityError('Traversal strategy has no registered implementation.', 'UNAVAILABLE', { reason: 'traversal-strategy-unimplemented' });
71
+ }
72
+ }
73
+ export const strategyKind = {
74
+ id: 'traversal/strategy', descriptorSchema: StrategyDescriptorSchema, defaultImplementation: UnimplementedStrategy
75
+ };
76
+ //# sourceMappingURL=strategies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strategies.js","sourceRoot":"","sources":["../src/strategies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAoC,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAA2G,MAAM,cAAc,CAAC;AAE9K,SAAS,aAAa,CAAI,MAA0B,EAAE,IAAyB;IAC9E,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAC1B,MAAM,IAAI,eAAe,CAAC,sDAAsD,EAAE,eAAe,EAAE;YAClG,MAAM,EAAE,2BAA2B,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE;SACvF,CAAC,CAAC;IACJ,CAAC;AACF,CAAC;AAED,SAAS,aAAa,CAAC,KAAkB;IACxC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3C,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO,KAAK,CAAC;AACd,CAAC;AAED,KA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AAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YAChD,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC/E,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,QAAQ,EAAE;SACpD,CAAC,CAAC,CAAC,CAAC;IACN,CAAC;CACD;AAED,6FAA6F;AAC7F,MAAM,qBAAqB;IAC1B,KAAK,CAAC,KAAK,CAAI,OAA2B;QACzC,MAAM,IAAI,eAAe,CAAC,sDAAsD,EAAE,aAAa,EAAE,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAClJ,CAAC;CACD;AACD,MAAM,CAAC,MAAM,YAAY,GAAwD;IAChF,EAAE,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,qBAAqB;CAClH,CAAC"}
@@ -0,0 +1,56 @@
1
+ <script lang="ts">
2
+ import { CapabilityError, CaughtFailureSchema, settle, settleNow } from '@vibesdotdev/kernel';
3
+ import { Alert, AlertTitle, AlertDescription } from '@vibesdotdev/kit/components/ui/alert';
4
+ import type { RunsStore } from '@vibesdotdev/runnable/svelte';
5
+ import type { RunnableWatchSnapshot } from '@vibesdotdev/runnable';
6
+ import { followTraversalRecords, selectedTraversalRunId, selectedTraversalViews } from '../tracking/selected-traversal.js';
7
+ import GraphRunView from './GraphRunView.svelte';
8
+
9
+ let { store }: { store: RunsStore } = $props();
10
+ let subtree = $state.raw<{ id: string; snapshot: RunnableWatchSnapshot } | null>(null);
11
+ let readFailure = $state.raw<unknown>(null);
12
+ let loading = $state(false);
13
+ let readGeneration = 0;
14
+ const graphRunId = $derived(selectedTraversalRunId(store.selected));
15
+
16
+ $effect(() => {
17
+ const source = store.source;
18
+ const id = graphRunId;
19
+ const generation = ++readGeneration;
20
+ subtree = null;
21
+ readFailure = null;
22
+ loading = false;
23
+ if (store.projection === 'records' || id === null) return;
24
+
25
+ loading = true;
26
+ const stop = followTraversalRecords(source, id, snapshot => {
27
+ subtree = { id, snapshot };
28
+ loading = false;
29
+ }, cause => {
30
+ readFailure = cause;
31
+ loading = false;
32
+ });
33
+ return () => {
34
+ void stop().catch(cause => {
35
+ if (readGeneration === generation && store.selectedId === id) readFailure = cause;
36
+ });
37
+ };
38
+ });
39
+
40
+ const records = $derived(store.projection === 'records' ? store.snapshot
41
+ : subtree?.id === store.selectedId ? subtree.snapshot : null);
42
+ const projection = $derived.by(() => settleNow(() => selectedTraversalViews(store.selected, records)));
43
+ const failure = $derived(readFailure !== null ? CapabilityError.from(CaughtFailureSchema.parse(readFailure))
44
+ : projection.ok ? null : CapabilityError.from(CaughtFailureSchema.parse(projection.cause)));
45
+
46
+ async function select(id: string) {
47
+ // RunsStore retains admission errors under its own selection generation.
48
+ await settle(() => store.select(id));
49
+ }
50
+ </script>
51
+
52
+ {#if failure}
53
+ <Alert variant="destructive"><AlertTitle>{failure.message}</AlertTitle><AlertDescription><code>{failure.code}</code> {failure.reason ?? ''}</AlertDescription></Alert>
54
+ {:else if loading}<p role="status">Loading recorded graph visits…</p>
55
+ {:else if projection.ok}<GraphRunView traversals={projection.value} onselect={select} />
56
+ {/if}
@@ -0,0 +1,8 @@
1
+ import type { RunsStore } from '@vibesdotdev/runnable/svelte';
2
+ type $$ComponentProps = {
3
+ store: RunsStore;
4
+ };
5
+ declare const GraphRunSection: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type GraphRunSection = ReturnType<typeof GraphRunSection>;
7
+ export default GraphRunSection;
8
+ //# sourceMappingURL=GraphRunSection.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphRunSection.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/GraphRunSection.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAK7D,KAAK,gBAAgB,GAAI;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AA4D/C,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}