@zelari/core 1.26.0 → 1.27.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.
package/dist/index.d.ts CHANGED
@@ -12,4 +12,5 @@ export * from './council/index.js';
12
12
  export * from './skills/index.js';
13
13
  export * from './memory/types.js';
14
14
  export * from './state/index.js';
15
+ export * from './kraken/index.js';
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,mBAAmB,CAAC;AAGlC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,mBAAmB,CAAC;AAGlC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -19,4 +19,6 @@ export * from './skills/index.js';
19
19
  export * from './memory/types.js';
20
20
  // Durable state contract (file-backed store lives in the CLI)
21
21
  export * from './state/index.js';
22
+ // Kraken graph engine (pure DAG primitives; orchestration lives in the CLI)
23
+ export * from './kraken/index.js';
22
24
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qCAAqC;AACrC,cAAc,mBAAmB,CAAC;AAElC,eAAe;AACf,cAAc,kBAAkB,CAAC;AAEjC,aAAa;AACb,cAAc,oBAAoB,CAAC;AAEnC,sCAAsC;AACtC,cAAc,oBAAoB,CAAC;AAEnC,oBAAoB;AACpB,cAAc,mBAAmB,CAAC;AAElC,4DAA4D;AAC5D,cAAc,mBAAmB,CAAC;AAElC,8DAA8D;AAC9D,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qCAAqC;AACrC,cAAc,mBAAmB,CAAC;AAElC,eAAe;AACf,cAAc,kBAAkB,CAAC;AAEjC,aAAa;AACb,cAAc,oBAAoB,CAAC;AAEnC,sCAAsC;AACtC,cAAc,oBAAoB,CAAC;AAEnC,oBAAoB;AACpB,cAAc,mBAAmB,CAAC;AAElC,4DAA4D;AAC5D,cAAc,mBAAmB,CAAC;AAElC,8DAA8D;AAC9D,cAAc,kBAAkB,CAAC;AAEjC,4EAA4E;AAC5E,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Kraken graph engine — scope-overlap detection & parallelism policy (pure).
3
+ *
4
+ * Decides whether two graph nodes may run concurrently. Read-only kinds
5
+ * (explore/verify) are always parallel-safe; writers (general/fix) may run in
6
+ * parallel only when their path scopes are provably disjoint. Conservative by
7
+ * design: any ambiguity resolves to "not parallel". No CLI dependencies.
8
+ *
9
+ * @since v0.10.x — Kraken graph engine (F1)
10
+ */
11
+ import type { TaskNode } from './graph.js';
12
+ /** Normalize a path/glob for comparison: forward slashes, no `./` or trailing `/`. */
13
+ export declare function normalizeScopePath(p: string): string;
14
+ /**
15
+ * Decide whether two scope paths could match a common file (i.e. their allowed
16
+ * sets are NOT provably disjoint). Comparison is segment-wise so that
17
+ * `src/auth` and `src/authz` do NOT overlap, while `src/auth` and
18
+ * `src/auth/jwt.ts` DO (ancestor/descendant). A `**` segment overlaps anything
19
+ * at or below its position.
20
+ *
21
+ * Conservative: returns true (overlap) on any ambiguity.
22
+ */
23
+ export declare function pathsOverlap(a: string, b: string): boolean;
24
+ /**
25
+ * True when two scope allowlists are provably disjoint (no pair overlaps).
26
+ * Empty/absent scopes are treated as "whole tree" → NOT disjoint.
27
+ */
28
+ export declare function disjointScopeSets(scopeA: string[] | undefined, scopeB: string[] | undefined): boolean;
29
+ /**
30
+ * May two nodes execute concurrently?
31
+ * - read-only kinds (explore/verify) are always parallel-safe;
32
+ * - a `merge` node is never parallel (it must serialize on its branch);
33
+ * - two writers (general/fix) run in parallel only if both declare scopes and
34
+ * those scopes are provably disjoint;
35
+ * - any missing scope on a writer → conservative "not parallel".
36
+ */
37
+ export declare function canRunParallel(a: TaskNode, b: TaskNode): boolean;
38
+ /**
39
+ * From a set of candidate nodes, pick the largest prefix (in input order) that
40
+ * can ALL run concurrently with each other. Used by the executor to form a
41
+ * parallel wave. The first node is always included.
42
+ */
43
+ export declare function selectParallelWave(candidates: TaskNode[]): TaskNode[];
44
+ //# sourceMappingURL=conflict.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conflict.d.ts","sourceRoot":"","sources":["../../src/kraken/conflict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAC;AAQzD,sFAAsF;AACtF,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAWpD;AA+CD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAkB1D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,GAC3B,OAAO,CAST;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAWhE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAMrE"}
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Kraken graph engine — scope-overlap detection & parallelism policy (pure).
3
+ *
4
+ * Decides whether two graph nodes may run concurrently. Read-only kinds
5
+ * (explore/verify) are always parallel-safe; writers (general/fix) may run in
6
+ * parallel only when their path scopes are provably disjoint. Conservative by
7
+ * design: any ambiguity resolves to "not parallel". No CLI dependencies.
8
+ *
9
+ * @since v0.10.x — Kraken graph engine (F1)
10
+ */
11
+ /** Kinds that never mutate the workspace (read-only / read+bash). */
12
+ const READ_ONLY_KINDS = ['explore', 'verify'];
13
+ /** Kinds that mutate the workspace and therefore need disjoint scopes. */
14
+ const WRITER_KINDS = ['general', 'fix'];
15
+ /** Normalize a path/glob for comparison: forward slashes, no `./` or trailing `/`. */
16
+ export function normalizeScopePath(p) {
17
+ let s = p.trim().replace(/\\/g, '/');
18
+ // Strip a leading `./`.
19
+ if (s.startsWith('./'))
20
+ s = s.slice(2);
21
+ // Collapse duplicate slashes.
22
+ s = s.replace(/\/{2,}/g, '/');
23
+ // Strip trailing slash (but keep a bare `/` as-is → becomes '').
24
+ if (s.length > 1 && s.endsWith('/'))
25
+ s = s.slice(0, -1);
26
+ // A lone `.` means "the current dir / whole tree" → normalize to root.
27
+ if (s === '.')
28
+ s = '';
29
+ return s;
30
+ }
31
+ /** Split a normalized path into segments (drops empty segments). */
32
+ function segments(p) {
33
+ return normalizeScopePath(p)
34
+ .split('/')
35
+ .filter((s) => s.length > 0);
36
+ }
37
+ /** Does a segment contain a glob wildcard? */
38
+ function isGlobSegment(seg) {
39
+ return seg.includes('*') || seg.includes('?') || seg.includes('[');
40
+ }
41
+ /** Escape regex-special chars in a literal string. */
42
+ function escapeRegex(s) {
43
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
44
+ }
45
+ /**
46
+ * Match a single path segment against another, honoring glob wildcards.
47
+ * `*` matches any run within the segment, `?` matches one char, `[...]` is a
48
+ * char class. If both segments are globs we conservatively assume they CAN
49
+ * match the same name (→ potential overlap).
50
+ */
51
+ function segmentMatches(a, b) {
52
+ if (a === b)
53
+ return true;
54
+ if (a === '**' || b === '**')
55
+ return true;
56
+ const aGlob = isGlobSegment(a);
57
+ const bGlob = isGlobSegment(b);
58
+ if (aGlob && bGlob)
59
+ return true; // ambiguous → assume overlap (conservative)
60
+ if (aGlob)
61
+ return globSegmentToRegex(a).test(b);
62
+ if (bGlob)
63
+ return globSegmentToRegex(b).test(a);
64
+ return false; // two distinct literals
65
+ }
66
+ /** Compile a single glob segment to an anchored RegExp (`*`→`.*`, `?`→`.`). */
67
+ function globSegmentToRegex(seg) {
68
+ let re = '';
69
+ for (const ch of seg) {
70
+ if (ch === '*')
71
+ re += '.*';
72
+ else if (ch === '?')
73
+ re += '.';
74
+ else
75
+ re += escapeRegex(ch);
76
+ }
77
+ return new RegExp(`^${re}$`);
78
+ }
79
+ /**
80
+ * Decide whether two scope paths could match a common file (i.e. their allowed
81
+ * sets are NOT provably disjoint). Comparison is segment-wise so that
82
+ * `src/auth` and `src/authz` do NOT overlap, while `src/auth` and
83
+ * `src/auth/jwt.ts` DO (ancestor/descendant). A `**` segment overlaps anything
84
+ * at or below its position.
85
+ *
86
+ * Conservative: returns true (overlap) on any ambiguity.
87
+ */
88
+ export function pathsOverlap(a, b) {
89
+ const segA = segments(a);
90
+ const segB = segments(b);
91
+ // Two empty/root scopes both mean "the whole tree" → overlap.
92
+ if (segA.length === 0 && segB.length === 0)
93
+ return true;
94
+ const len = Math.min(segA.length, segB.length);
95
+ for (let i = 0; i < len; i++) {
96
+ const sa = segA[i];
97
+ const sb = segB[i];
98
+ if (sa === '**' || sb === '**')
99
+ return true; // globstar swallows the rest
100
+ if (!segmentMatches(sa, sb))
101
+ return false; // diverged → disjoint
102
+ }
103
+ // All compared segments matched. If one path is an ancestor of the other
104
+ // (or they are equal), their sets overlap.
105
+ return true;
106
+ }
107
+ /**
108
+ * True when two scope allowlists are provably disjoint (no pair overlaps).
109
+ * Empty/absent scopes are treated as "whole tree" → NOT disjoint.
110
+ */
111
+ export function disjointScopeSets(scopeA, scopeB) {
112
+ if (!scopeA || scopeA.length === 0)
113
+ return false;
114
+ if (!scopeB || scopeB.length === 0)
115
+ return false;
116
+ for (const a of scopeA) {
117
+ for (const b of scopeB) {
118
+ if (pathsOverlap(a, b))
119
+ return false;
120
+ }
121
+ }
122
+ return true;
123
+ }
124
+ /**
125
+ * May two nodes execute concurrently?
126
+ * - read-only kinds (explore/verify) are always parallel-safe;
127
+ * - a `merge` node is never parallel (it must serialize on its branch);
128
+ * - two writers (general/fix) run in parallel only if both declare scopes and
129
+ * those scopes are provably disjoint;
130
+ * - any missing scope on a writer → conservative "not parallel".
131
+ */
132
+ export function canRunParallel(a, b) {
133
+ if (a.kind === 'merge' || b.kind === 'merge')
134
+ return false;
135
+ if (READ_ONLY_KINDS.includes(a.kind) || READ_ONLY_KINDS.includes(b.kind)) {
136
+ return true;
137
+ }
138
+ // Both are writers (general/fix): require provably disjoint scopes.
139
+ if (WRITER_KINDS.includes(a.kind) && WRITER_KINDS.includes(b.kind)) {
140
+ return disjointScopeSets(a.scope, b.scope);
141
+ }
142
+ // Unknown kind combination → conservative.
143
+ return false;
144
+ }
145
+ /**
146
+ * From a set of candidate nodes, pick the largest prefix (in input order) that
147
+ * can ALL run concurrently with each other. Used by the executor to form a
148
+ * parallel wave. The first node is always included.
149
+ */
150
+ export function selectParallelWave(candidates) {
151
+ const wave = [];
152
+ for (const node of candidates) {
153
+ if (wave.every((w) => canRunParallel(w, node)))
154
+ wave.push(node);
155
+ }
156
+ return wave;
157
+ }
158
+ //# sourceMappingURL=conflict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conflict.js","sourceRoot":"","sources":["../../src/kraken/conflict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH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AAc,CAAC,CAAW,EAAE,CAAW;IACrD,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3D,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACzE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,oEAAoE;IACpE,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACnE,OAAO,iBAAiB,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IACD,2CAA2C;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAsB;IACvD,MAAM,IAAI,GAAe,EAAE,CAAC;IAC5B,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Kraken graph engine — pure DAG model & validation (no CLI dependencies).
3
+ *
4
+ * This module is intentionally dependency-free so it lives in @zelari/core
5
+ * and is unit-testable without the CLI. Orchestration (LLM planner, executor,
6
+ * worktree/world-model wiring) lives in the CLI (`src/cli/kraken/`) and imports
7
+ * these primitives. See `.zelari/docs/kraken-graph-engine-plan.md` (CORREZIONE-1).
8
+ *
9
+ * @since v0.10.x — Kraken graph engine (F1)
10
+ */
11
+ /** What a graph node does. Mirrors taskTool kinds plus graph-only kinds. */
12
+ export type TaskNodeKind = 'explore' | 'general' | 'verify' | 'fix' | 'merge';
13
+ /** Lifecycle state of a node within an executing graph. */
14
+ export type TaskNodeStatus = 'pending' | 'running' | 'done' | 'error' | 'skipped';
15
+ /** States that mean "this node will not run (again)". */
16
+ export declare const TERMINAL_STATUSES: readonly TaskNodeStatus[];
17
+ /** A single unit of work in a Kraken task graph. */
18
+ export interface TaskNode {
19
+ /** Unique id within the graph (e.g. `e1`, `g2`, `fix-g1-1`). */
20
+ id: string;
21
+ kind: TaskNodeKind;
22
+ /** Short human label (for radio / status UI). */
23
+ label: string;
24
+ /** Full self-contained prompt handed to the sub-agent. */
25
+ prompt: string;
26
+ /** Optional path/glob allowlist (contract). Required for parallel general/fix. */
27
+ scope?: string[];
28
+ /** Optional acceptance checklist (contract). */
29
+ acceptance?: string[];
30
+ /** Ids of predecessor nodes that must be `done` before this one may start. */
31
+ deps: string[];
32
+ status: TaskNodeStatus;
33
+ /** How many times this node has been retried after a failure. */
34
+ retryCount: number;
35
+ /** Max retries before a fix-node is spawned (or permanent failure). */
36
+ maxRetries: number;
37
+ /** Final sub-agent conclusion (set when `done`). */
38
+ result?: string;
39
+ /** Last error message (set when `error`). */
40
+ error?: string;
41
+ }
42
+ /** A directed acyclic graph of task nodes, keyed by node id. */
43
+ export interface TaskGraph {
44
+ id: string;
45
+ nodes: Map<string, TaskNode>;
46
+ }
47
+ /** Result of {@link validateGraph}. */
48
+ export type GraphValidation = {
49
+ ok: true;
50
+ } | {
51
+ ok: false;
52
+ errors: string[];
53
+ };
54
+ export interface ValidateGraphOptions {
55
+ /** Anti-explosion bound on node count. Default 24 (ZELARI_KRAKEN_MAX_NODES). */
56
+ maxNodes?: number;
57
+ }
58
+ /** Default anti-explosion bound for graph size. */
59
+ export declare const DEFAULT_MAX_NODES = 24;
60
+ /** Build a graph from a flat list of nodes (indexing by id). */
61
+ export declare function createGraph(id: string, nodes: TaskNode[]): TaskGraph;
62
+ /**
63
+ * Validate structural integrity of a graph:
64
+ * - node ids are unique and non-empty
65
+ * - every dep references an existing node
66
+ * - no dependency cycles (the graph is a DAG)
67
+ * - node count within `maxNodes`
68
+ *
69
+ * Pure and side-effect free. Returns all detected errors (not just the first).
70
+ */
71
+ export declare function validateGraph(graph: TaskGraph, opts?: ValidateGraphOptions): GraphValidation;
72
+ /**
73
+ * Nodes that may start now: status `pending` with every dep already `done`.
74
+ * (Deps in `error`/`skipped` do NOT satisfy readiness — the executor decides
75
+ * whether to skip downstream nodes.)
76
+ */
77
+ export declare function getReadyNodes(graph: TaskGraph): TaskNode[];
78
+ /**
79
+ * Group node ids into topological levels (Kahn's algorithm). Level 0 has no
80
+ * deps; level N depends only on levels < N. Useful for ASCII rendering and
81
+ * coarse scheduling. Nodes in a cycle are omitted (validateGraph rejects them).
82
+ */
83
+ export declare function topoLevels(graph: TaskGraph): string[][];
84
+ /** True when no node is `pending` or `running` (execution has settled). */
85
+ export declare function isSettled(graph: TaskGraph): boolean;
86
+ /** True when every node finished successfully (`done` or `skipped`). */
87
+ export declare function isConverged(graph: TaskGraph): boolean;
88
+ /** Ids of nodes in a terminal failure state. */
89
+ export declare function failedNodeIds(graph: TaskGraph): string[];
90
+ /** Count nodes by status (for status UI: "graph 3/8 · 2↑"). */
91
+ export declare function countByStatus(graph: TaskGraph): Record<TaskNodeStatus, number>;
92
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/kraken/graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4EAA4E;AAC5E,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;AAE9E,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,SAAS,GACT,MAAM,GACN,OAAO,GACP,SAAS,CAAC;AAEd,yDAAyD;AACz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C3B,KAAK,EAAE,SAAS,EAChB,IAAI,GAAE,oBAAyB,GAC9B,eAAe,CAoCjB;AAoDD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,QAAQ,EAAE,CAQ1D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,EAAE,EAAE,CAgCvD;AAED,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAKnD;AAED,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAMrD;AAED,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,EAAE,CAMxD;AAED,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAU9E"}
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Kraken graph engine — pure DAG model & validation (no CLI dependencies).
3
+ *
4
+ * This module is intentionally dependency-free so it lives in @zelari/core
5
+ * and is unit-testable without the CLI. Orchestration (LLM planner, executor,
6
+ * worktree/world-model wiring) lives in the CLI (`src/cli/kraken/`) and imports
7
+ * these primitives. See `.zelari/docs/kraken-graph-engine-plan.md` (CORREZIONE-1).
8
+ *
9
+ * @since v0.10.x — Kraken graph engine (F1)
10
+ */
11
+ /** States that mean "this node will not run (again)". */
12
+ export const TERMINAL_STATUSES = [
13
+ 'done',
14
+ 'error',
15
+ 'skipped',
16
+ ];
17
+ /** Default anti-explosion bound for graph size. */
18
+ export const DEFAULT_MAX_NODES = 24;
19
+ /** Build a graph from a flat list of nodes (indexing by id). */
20
+ export function createGraph(id, nodes) {
21
+ const map = new Map();
22
+ for (const n of nodes)
23
+ map.set(n.id, n);
24
+ return { id, nodes: map };
25
+ }
26
+ /**
27
+ * Validate structural integrity of a graph:
28
+ * - node ids are unique and non-empty
29
+ * - every dep references an existing node
30
+ * - no dependency cycles (the graph is a DAG)
31
+ * - node count within `maxNodes`
32
+ *
33
+ * Pure and side-effect free. Returns all detected errors (not just the first).
34
+ */
35
+ export function validateGraph(graph, opts = {}) {
36
+ const maxNodes = opts.maxNodes ?? DEFAULT_MAX_NODES;
37
+ const errors = [];
38
+ const nodes = graph.nodes;
39
+ if (nodes.size === 0) {
40
+ errors.push('graph is empty (no nodes)');
41
+ }
42
+ if (nodes.size > maxNodes) {
43
+ errors.push(`graph has ${nodes.size} nodes, exceeding maxNodes=${maxNodes}`);
44
+ }
45
+ for (const [id, node] of nodes) {
46
+ if (!id || id.trim() === '') {
47
+ errors.push('node with empty id');
48
+ continue;
49
+ }
50
+ if (node.id !== id) {
51
+ errors.push(`node keyed "${id}" has mismatching node.id "${node.id}"`);
52
+ }
53
+ for (const dep of node.deps) {
54
+ if (!nodes.has(dep)) {
55
+ errors.push(`node "${id}" depends on unknown node "${dep}"`);
56
+ }
57
+ if (dep === id) {
58
+ errors.push(`node "${id}" depends on itself`);
59
+ }
60
+ }
61
+ }
62
+ const cycle = findCycle(nodes);
63
+ if (cycle) {
64
+ errors.push(`dependency cycle detected: ${cycle.join(' -> ')}`);
65
+ }
66
+ return errors.length === 0 ? { ok: true } : { ok: false, errors };
67
+ }
68
+ /**
69
+ * Detect a dependency cycle via iterative DFS with white/gray/black coloring.
70
+ * Returns one cycle as an id path (e.g. ['a','b','a']) or null if acyclic.
71
+ */
72
+ function findCycle(nodes) {
73
+ const WHITE = 0;
74
+ const GRAY = 1;
75
+ const BLACK = 2;
76
+ const color = new Map();
77
+ for (const id of nodes.keys())
78
+ color.set(id, WHITE);
79
+ for (const start of nodes.keys()) {
80
+ if (color.get(start) !== WHITE)
81
+ continue;
82
+ // Stack of [nodeId, nextDepIndex]; path tracks the current DFS chain.
83
+ const stack = [[start, 0]];
84
+ const path = [];
85
+ color.set(start, GRAY);
86
+ path.push(start);
87
+ while (stack.length > 0) {
88
+ const top = stack[stack.length - 1];
89
+ const [id, idx] = top;
90
+ const node = nodes.get(id);
91
+ const deps = node ? node.deps : [];
92
+ if (idx < deps.length) {
93
+ top[1] = idx + 1;
94
+ const dep = deps[idx];
95
+ if (!nodes.has(dep))
96
+ continue; // unknown dep — reported by validateGraph
97
+ const c = color.get(dep);
98
+ if (c === GRAY) {
99
+ // Back edge → cycle. Slice the path from the first occurrence of dep.
100
+ const at = path.indexOf(dep);
101
+ return [...path.slice(at), dep];
102
+ }
103
+ if (c === WHITE) {
104
+ color.set(dep, GRAY);
105
+ path.push(dep);
106
+ stack.push([dep, 0]);
107
+ }
108
+ }
109
+ else {
110
+ color.set(id, BLACK);
111
+ path.pop();
112
+ stack.pop();
113
+ }
114
+ }
115
+ }
116
+ return null;
117
+ }
118
+ /**
119
+ * Nodes that may start now: status `pending` with every dep already `done`.
120
+ * (Deps in `error`/`skipped` do NOT satisfy readiness — the executor decides
121
+ * whether to skip downstream nodes.)
122
+ */
123
+ export function getReadyNodes(graph) {
124
+ const ready = [];
125
+ for (const node of graph.nodes.values()) {
126
+ if (node.status !== 'pending')
127
+ continue;
128
+ const depsReady = node.deps.every((d) => graph.nodes.get(d)?.status === 'done');
129
+ if (depsReady)
130
+ ready.push(node);
131
+ }
132
+ return ready;
133
+ }
134
+ /**
135
+ * Group node ids into topological levels (Kahn's algorithm). Level 0 has no
136
+ * deps; level N depends only on levels < N. Useful for ASCII rendering and
137
+ * coarse scheduling. Nodes in a cycle are omitted (validateGraph rejects them).
138
+ */
139
+ export function topoLevels(graph) {
140
+ const nodes = graph.nodes;
141
+ const indegree = new Map();
142
+ const dependents = new Map();
143
+ for (const [id, node] of nodes) {
144
+ indegree.set(id, node.deps.filter((d) => nodes.has(d)).length);
145
+ for (const dep of node.deps) {
146
+ if (!nodes.has(dep))
147
+ continue;
148
+ const arr = dependents.get(dep) ?? [];
149
+ arr.push(id);
150
+ dependents.set(dep, arr);
151
+ }
152
+ }
153
+ const levels = [];
154
+ let frontier = [...nodes.keys()].filter((id) => (indegree.get(id) ?? 0) === 0);
155
+ const visited = new Set();
156
+ while (frontier.length > 0) {
157
+ levels.push([...frontier].sort());
158
+ const next = [];
159
+ for (const id of frontier) {
160
+ visited.add(id);
161
+ for (const child of dependents.get(id) ?? []) {
162
+ const d = (indegree.get(child) ?? 0) - 1;
163
+ indegree.set(child, d);
164
+ if (d === 0)
165
+ next.push(child);
166
+ }
167
+ }
168
+ frontier = next;
169
+ }
170
+ return levels;
171
+ }
172
+ /** True when no node is `pending` or `running` (execution has settled). */
173
+ export function isSettled(graph) {
174
+ for (const node of graph.nodes.values()) {
175
+ if (node.status === 'pending' || node.status === 'running')
176
+ return false;
177
+ }
178
+ return true;
179
+ }
180
+ /** True when every node finished successfully (`done` or `skipped`). */
181
+ export function isConverged(graph) {
182
+ if (graph.nodes.size === 0)
183
+ return false;
184
+ for (const node of graph.nodes.values()) {
185
+ if (node.status !== 'done' && node.status !== 'skipped')
186
+ return false;
187
+ }
188
+ return true;
189
+ }
190
+ /** Ids of nodes in a terminal failure state. */
191
+ export function failedNodeIds(graph) {
192
+ const out = [];
193
+ for (const node of graph.nodes.values()) {
194
+ if (node.status === 'error')
195
+ out.push(node.id);
196
+ }
197
+ return out;
198
+ }
199
+ /** Count nodes by status (for status UI: "graph 3/8 · 2↑"). */
200
+ export function countByStatus(graph) {
201
+ const counts = {
202
+ pending: 0,
203
+ running: 0,
204
+ done: 0,
205
+ error: 0,
206
+ skipped: 0,
207
+ };
208
+ for (const node of graph.nodes.values())
209
+ counts[node.status] += 1;
210
+ return counts;
211
+ }
212
+ //# sourceMappingURL=graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.js","sourceRoot":"","sources":["../../src/kraken/graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,yDAAyD;AACzD,MAAM,CAAC,MAAM,iBAAiB,GAA8B;IAC1D,MAAM;IACN,OAAO;IACP,SAAS;CACV,CAAC;AA4CF,mDAAmD;AACnD,MA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EAAE,CAAC;QACR,OAAO,EAAE,CAAC;KACX,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClE,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Kraken graph engine — public surface (pure DAG primitives).
3
+ *
4
+ * Orchestration (planner/executor/worktree/world-model wiring) lives in the
5
+ * CLI and is NOT exported here. See `.zelari/docs/kraken-graph-engine-plan.md`.
6
+ */
7
+ export * from './graph.js';
8
+ export * from './conflict.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kraken/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Kraken graph engine — public surface (pure DAG primitives).
3
+ *
4
+ * Orchestration (planner/executor/worktree/world-model wiring) lives in the
5
+ * CLI and is NOT exported here. See `.zelari/docs/kraken-graph-engine-plan.md`.
6
+ */
7
+ export * from './graph.js';
8
+ export * from './conflict.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/kraken/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zelari/core",
3
- "version": "1.26.0",
3
+ "version": "1.27.1",
4
4
  "description": "Zelari Code core library — provider-neutral agent loop (AgentHarness), multi-agent council orchestration, and built-in skills. Used by the zelari-code CLI; consumable by other agent frontends.",
5
5
  "author": "Anathema Studio <https://anathema-studio.com/>",
6
6
  "license": "MIT",