@oisincoveney/pipeline 3.11.0 → 3.11.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.
@@ -5,13 +5,13 @@ import { z } from "zod";
5
5
  //#region src/moka-submit.d.ts
6
6
  declare const mokaSubmitDirectHooksSchema: z.ZodRecord<z.ZodEnum<{
7
7
  "workflow.start": "workflow.start";
8
+ "node.finish": "node.finish";
9
+ "node.start": "node.start";
8
10
  "workflow.success": "workflow.success";
9
11
  "workflow.failure": "workflow.failure";
10
12
  "workflow.complete": "workflow.complete";
11
- "node.start": "node.start";
12
13
  "node.success": "node.success";
13
14
  "node.error": "node.error";
14
- "node.finish": "node.finish";
15
15
  "gate.failure": "gate.failure";
16
16
  }> & z.core.$partial, z.ZodDiscriminatedUnion<[z.ZodObject<{
17
17
  failure: z.ZodDefault<z.ZodEnum<{
@@ -94,13 +94,13 @@ declare const mokaSubmitOptionsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
94
94
  }, z.core.$strict>>;
95
95
  hooks: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
96
96
  "workflow.start": "workflow.start";
97
+ "node.finish": "node.finish";
98
+ "node.start": "node.start";
97
99
  "workflow.success": "workflow.success";
98
100
  "workflow.failure": "workflow.failure";
99
101
  "workflow.complete": "workflow.complete";
100
- "node.start": "node.start";
101
102
  "node.success": "node.success";
102
103
  "node.error": "node.error";
103
- "node.finish": "node.finish";
104
104
  "gate.failure": "gate.failure";
105
105
  }> & z.core.$partial, z.ZodDiscriminatedUnion<[z.ZodObject<{
106
106
  failure: z.ZodDefault<z.ZodEnum<{
@@ -207,13 +207,13 @@ declare const mokaSubmitOptionsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
207
207
  }, z.core.$strict>>;
208
208
  hooks: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
209
209
  "workflow.start": "workflow.start";
210
+ "node.finish": "node.finish";
211
+ "node.start": "node.start";
210
212
  "workflow.success": "workflow.success";
211
213
  "workflow.failure": "workflow.failure";
212
214
  "workflow.complete": "workflow.complete";
213
- "node.start": "node.start";
214
215
  "node.success": "node.success";
215
216
  "node.error": "node.error";
216
- "node.finish": "node.finish";
217
217
  "gate.failure": "gate.failure";
218
218
  }> & z.core.$partial, z.ZodDiscriminatedUnion<[z.ZodObject<{
219
219
  failure: z.ZodDefault<z.ZodEnum<{
@@ -1593,6 +1593,17 @@ interface SchedulePlanningContext {
1593
1593
  parentWorkUnits: BacklogWorkUnit[];
1594
1594
  workUnits: BacklogWorkUnit[];
1595
1595
  }
1596
+ /**
1597
+ * A backlog ticket's frontmatter may declare dependencies on sibling tickets
1598
+ * that are not part of this run (e.g. submitting TOVA-766.03 alone when its
1599
+ * frontmatter depends on TOVA-766.01). Those out-of-scope ids must not reach the
1600
+ * planner: it is instructed to preserve Backlog dependency ids as needs edges,
1601
+ * and an edge to a work unit that no node serves fails schedule validation. Prune
1602
+ * each unit's dependencies to the ids actually in scope (parent + work units) —
1603
+ * the same predicate workUnitDependencyIssues applies after generation — so the
1604
+ * planner prompt context and downstream validation stay consistent.
1605
+ */
1606
+ declare function pruneOutOfScopeDependencies(context: SchedulePlanningContext): SchedulePlanningContext;
1596
1607
  declare function parseScheduleArtifact(source: string, sourcePath?: string): ScheduleArtifact;
1597
1608
  declare const ScheduleArtifactError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1598
1609
  readonly _tag: "ScheduleArtifactError";
@@ -1606,4 +1617,4 @@ declare function compileScheduleArtifact(config: PipelineConfig, artifact: Sched
1606
1617
  declare function generateScheduleArtifact(options: GenerateScheduleOptions): Promise<GenerateScheduleResult>;
1607
1618
  declare function scheduleArtifactPath(worktreePath: string, scheduleId: string): string;
1608
1619
  //#endregion
1609
- export { BacklogWorkUnit, CompiledScheduleArtifact, GenerateScheduleOptions, GenerateScheduleResult, ScheduleArtifact, ScheduleArtifactError, SchedulePlanningContext, compileScheduleArtifact, generateScheduleArtifact, parseScheduleArtifact, scheduleArtifactPath };
1620
+ export { BacklogWorkUnit, CompiledScheduleArtifact, GenerateScheduleOptions, GenerateScheduleResult, ScheduleArtifact, ScheduleArtifactError, SchedulePlanningContext, compileScheduleArtifact, generateScheduleArtifact, parseScheduleArtifact, pruneOutOfScopeDependencies, scheduleArtifactPath };
@@ -49,6 +49,27 @@ const scheduleArtifactSchema = z.object({
49
49
  version: z.literal(1),
50
50
  workflows: z.record(z.string().regex(ID_RE), workflowSchema)
51
51
  }).strict();
52
+ /**
53
+ * A backlog ticket's frontmatter may declare dependencies on sibling tickets
54
+ * that are not part of this run (e.g. submitting TOVA-766.03 alone when its
55
+ * frontmatter depends on TOVA-766.01). Those out-of-scope ids must not reach the
56
+ * planner: it is instructed to preserve Backlog dependency ids as needs edges,
57
+ * and an edge to a work unit that no node serves fails schedule validation. Prune
58
+ * each unit's dependencies to the ids actually in scope (parent + work units) —
59
+ * the same predicate workUnitDependencyIssues applies after generation — so the
60
+ * planner prompt context and downstream validation stay consistent.
61
+ */
62
+ function pruneOutOfScopeDependencies(context) {
63
+ const inScope = new Set([...context.parentWorkUnits, ...context.workUnits].map((unit) => unit.id));
64
+ const prune = (unit) => unit.dependencies ? {
65
+ ...unit,
66
+ dependencies: unit.dependencies.filter((id) => inScope.has(id))
67
+ } : unit;
68
+ return {
69
+ parentWorkUnits: context.parentWorkUnits.map(prune),
70
+ workUnits: context.workUnits.map(prune)
71
+ };
72
+ }
52
73
  function parseScheduleArtifact(source, sourcePath = "schedule.yaml") {
53
74
  const document = parseDocument(source, {
54
75
  prettyErrors: false,
@@ -93,7 +114,7 @@ async function generateScheduleArtifact(options) {
93
114
  runId: options.runId,
94
115
  task: options.task
95
116
  });
96
- const planningContext = { ...loadBacklogPlanningContext(options.task, options.worktreePath) };
117
+ const planningContext = pruneOutOfScopeDependencies({ ...loadBacklogPlanningContext(options.task, options.worktreePath) });
97
118
  const generatedArtifact = await planScheduleArtifact(baseline, policy.planner_profile, options, planningContext);
98
119
  assertSchedulePassOrder();
99
120
  const artifact = hydrateScheduleTaskContexts(canonicalizeGeneratedScheduleIds(applyNodeCatalogModelFallbacks(options.config, policy.node_catalog, appendPullRequestDelivery(options.config, integrateParallelWriteFanout(options.config, addGeneratedImplementationCoverage(options.config, generatedArtifact))))), planningContext);
@@ -385,4 +406,4 @@ function flattenWorkflowNodes(nodes) {
385
406
  return flattenNodes(nodes, (node) => node.kind === "parallel" ? node.nodes : void 0);
386
407
  }
387
408
  //#endregion
388
- export { ScheduleArtifactError, compileScheduleArtifact, generateScheduleArtifact, parseScheduleArtifact, scheduleArtifactPath };
409
+ export { ScheduleArtifactError, compileScheduleArtifact, generateScheduleArtifact, parseScheduleArtifact, pruneOutOfScopeDependencies, scheduleArtifactPath };
@@ -11,8 +11,8 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
11
11
  runId: z.ZodString;
12
12
  sequence: z.ZodNumber;
13
13
  type: z.ZodEnum<{
14
- "workflow.start": "workflow.start";
15
14
  "workflow.planned": "workflow.planned";
15
+ "workflow.start": "workflow.start";
16
16
  }>;
17
17
  workflowPlan: z.ZodObject<{
18
18
  edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -58,10 +58,10 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
58
58
  }>;
59
59
  }, z.core.$strip>;
60
60
  type: z.ZodEnum<{
61
- "node.start": "node.start";
62
- "node.finish": "node.finish";
63
61
  "agent.finish": "agent.finish";
64
62
  "agent.start": "agent.start";
63
+ "node.finish": "node.finish";
64
+ "node.start": "node.start";
65
65
  }>;
66
66
  }, z.core.$strip>, z.ZodObject<{
67
67
  at: z.ZodOptional<z.ZodString>;
@@ -189,8 +189,8 @@ declare const runnerEventBatchSchema: z.ZodObject<{
189
189
  runId: z.ZodString;
190
190
  sequence: z.ZodNumber;
191
191
  type: z.ZodEnum<{
192
- "workflow.start": "workflow.start";
193
192
  "workflow.planned": "workflow.planned";
193
+ "workflow.start": "workflow.start";
194
194
  }>;
195
195
  workflowPlan: z.ZodObject<{
196
196
  edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -236,10 +236,10 @@ declare const runnerEventBatchSchema: z.ZodObject<{
236
236
  }>;
237
237
  }, z.core.$strip>;
238
238
  type: z.ZodEnum<{
239
- "node.start": "node.start";
240
- "node.finish": "node.finish";
241
239
  "agent.finish": "agent.finish";
242
240
  "agent.start": "agent.start";
241
+ "node.finish": "node.finish";
242
+ "node.start": "node.start";
243
243
  }>;
244
244
  }, z.core.$strip>, z.ZodObject<{
245
245
  at: z.ZodOptional<z.ZodString>;
package/package.json CHANGED
@@ -127,7 +127,7 @@
127
127
  "prepack": "bun run build:cli"
128
128
  },
129
129
  "type": "module",
130
- "version": "3.11.0",
130
+ "version": "3.11.1",
131
131
  "description": "Config-driven multi-agent pipeline runner for repository work",
132
132
  "main": "./dist/index.js",
133
133
  "types": "./dist/index.d.ts",