@workflow-cannon/workspace-kit 0.16.1 → 0.18.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.
- package/dist/core/config-metadata.js +53 -0
- package/dist/core/workspace-kit-config.js +7 -2
- package/dist/modules/planning/artifact.d.ts +19 -0
- package/dist/modules/planning/artifact.js +72 -0
- package/dist/modules/planning/index.js +265 -0
- package/dist/modules/planning/question-engine.d.ts +23 -0
- package/dist/modules/planning/question-engine.js +277 -0
- package/dist/modules/planning/types.d.ts +9 -0
- package/dist/modules/planning/types.js +39 -0
- package/dist/modules/task-engine/index.js +272 -8
- package/dist/modules/task-engine/planning-config.d.ts +3 -0
- package/dist/modules/task-engine/planning-config.js +7 -0
- package/dist/modules/task-engine/strict-task-validation.d.ts +3 -0
- package/dist/modules/task-engine/strict-task-validation.js +52 -0
- package/dist/modules/task-engine/task-type-validation.d.ts +10 -0
- package/dist/modules/task-engine/task-type-validation.js +26 -0
- package/dist/modules/task-engine/types.d.ts +1 -1
- package/package.json +3 -2
- package/schemas/compatibility-matrix.schema.json +64 -0
- package/schemas/parity-evidence.schema.json +60 -0
- package/schemas/task-engine-run-contracts.schema.json +560 -0
- package/schemas/task-engine-state.schema.json +41 -0
- package/schemas/workspace-kit-profile.schema.json +55 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
const BASE_QUESTIONS = {
|
|
2
|
+
"task-breakdown": [
|
|
3
|
+
{
|
|
4
|
+
id: "goal",
|
|
5
|
+
prompt: "What is the primary goal of this work?",
|
|
6
|
+
examples: ["Improve release reliability", "Deliver planning module CLI flow"],
|
|
7
|
+
whyItMatters: "Clarifies what success looks like before decomposition.",
|
|
8
|
+
critical: true
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: "constraints",
|
|
12
|
+
prompt: "What constraints must we respect?",
|
|
13
|
+
examples: ["No breaking changes", "Single release", "CLI-first"],
|
|
14
|
+
whyItMatters: "Prevents planning paths that cannot be delivered safely.",
|
|
15
|
+
critical: true
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "successSignals",
|
|
19
|
+
prompt: "How will we know the plan worked?",
|
|
20
|
+
examples: ["All gates pass", "Operators complete flow in under 5 minutes"],
|
|
21
|
+
whyItMatters: "Anchors acceptance criteria and evidence quality.",
|
|
22
|
+
critical: true
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"sprint-phase": [
|
|
26
|
+
{
|
|
27
|
+
id: "goal",
|
|
28
|
+
prompt: "What is the phase objective?",
|
|
29
|
+
examples: ["Ship planning module v1", "Complete stabilization hardening"],
|
|
30
|
+
whyItMatters: "Defines what this phase must deliver.",
|
|
31
|
+
critical: true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "timeline",
|
|
35
|
+
prompt: "What timeline window should this phase target?",
|
|
36
|
+
examples: ["Single release train", "Two sprint sequence"],
|
|
37
|
+
whyItMatters: "Sets ordering and scope pressure explicitly.",
|
|
38
|
+
critical: true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "criticalPath",
|
|
42
|
+
prompt: "What dependencies define the critical path?",
|
|
43
|
+
examples: ["Scaffold before adaptive engine", "Rules before artifact generation"],
|
|
44
|
+
whyItMatters: "Avoids deadlocks and unrealistic sequencing.",
|
|
45
|
+
critical: true
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"task-ordering": [
|
|
49
|
+
{
|
|
50
|
+
id: "goal",
|
|
51
|
+
prompt: "What outcome should ordering optimize for?",
|
|
52
|
+
examples: ["Risk reduction first", "Fastest path to demo"],
|
|
53
|
+
whyItMatters: "Provides ranking criteria for sequencing choices.",
|
|
54
|
+
critical: true
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "dependencyIntent",
|
|
58
|
+
prompt: "What dependency constraints are mandatory?",
|
|
59
|
+
examples: ["T347 depends on T345", "Validation follows schema contracts"],
|
|
60
|
+
whyItMatters: "Ensures ordering respects hard blockers.",
|
|
61
|
+
critical: true
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "riskPriority",
|
|
65
|
+
prompt: "Which risks should be front-loaded?",
|
|
66
|
+
examples: ["Policy approval edge cases", "Migration complexity"],
|
|
67
|
+
whyItMatters: "Improves confidence and rollback safety.",
|
|
68
|
+
critical: true
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"new-feature": [
|
|
72
|
+
{
|
|
73
|
+
id: "featureGoal",
|
|
74
|
+
prompt: "What user problem should the feature solve?",
|
|
75
|
+
examples: ["Guide planning interviews", "Improve dashboard visibility"],
|
|
76
|
+
whyItMatters: "Prevents building features disconnected from need.",
|
|
77
|
+
critical: true
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "placement",
|
|
81
|
+
prompt: "Where should this feature be surfaced?",
|
|
82
|
+
examples: ["CLI command", "Extension dashboard panel", "Admin-only view"],
|
|
83
|
+
whyItMatters: "Drives architecture, permissions, and UX decisions.",
|
|
84
|
+
critical: true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "technology",
|
|
88
|
+
prompt: "What technology/runtime constraints apply?",
|
|
89
|
+
examples: ["TypeScript + CLI runtime", "No new native dependencies"],
|
|
90
|
+
whyItMatters: "Bounds implementation options early.",
|
|
91
|
+
critical: true
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "targetAudience",
|
|
95
|
+
prompt: "Who is the target audience?",
|
|
96
|
+
examples: ["AI Agent Operators", "Developers", "Maintainers"],
|
|
97
|
+
whyItMatters: "Shapes defaults and interaction style.",
|
|
98
|
+
critical: true
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"change": [
|
|
102
|
+
{
|
|
103
|
+
id: "changeGoal",
|
|
104
|
+
prompt: "What behavior or system change is needed?",
|
|
105
|
+
examples: ["Replace brittle flow", "Refactor planning config handling"],
|
|
106
|
+
whyItMatters: "Separates desired outcome from implementation details.",
|
|
107
|
+
critical: true
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: "compatibilityRisk",
|
|
111
|
+
prompt: "What compatibility risks exist?",
|
|
112
|
+
examples: ["CLI contract changes", "state schema shifts"],
|
|
113
|
+
whyItMatters: "Supports migration-safe release planning.",
|
|
114
|
+
critical: true
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "rollbackPlan",
|
|
118
|
+
prompt: "What rollback strategy is available?",
|
|
119
|
+
examples: ["Feature flag off switch", "Revert to prior command behavior"],
|
|
120
|
+
whyItMatters: "Maintains trustworthiness under failure.",
|
|
121
|
+
critical: true
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
};
|
|
125
|
+
const BASE_ADAPTIVE_QUESTIONS = {
|
|
126
|
+
"task-breakdown": [
|
|
127
|
+
{
|
|
128
|
+
id: "handoffRisk",
|
|
129
|
+
prompt: "Where is handoff risk highest in this breakdown?",
|
|
130
|
+
examples: ["Schema-to-runtime boundary", "CLI-to-extension behavior"],
|
|
131
|
+
whyItMatters: "Highlights where extra tests or review checks are needed.",
|
|
132
|
+
critical: false
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"sprint-phase": [
|
|
136
|
+
{
|
|
137
|
+
id: "phaseExitSignal",
|
|
138
|
+
prompt: "What is the explicit exit signal for this phase?",
|
|
139
|
+
examples: ["All tasks completed and release gates pass", "PR merged with parity evidence"],
|
|
140
|
+
whyItMatters: "Prevents ambiguous “done” states.",
|
|
141
|
+
critical: false
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
"task-ordering": [
|
|
145
|
+
{
|
|
146
|
+
id: "parallelization",
|
|
147
|
+
prompt: "Which work items can run in parallel safely?",
|
|
148
|
+
examples: ["Docs in parallel with runtime hardening", "UI after API contracts are stable"],
|
|
149
|
+
whyItMatters: "Improves throughput without violating dependencies.",
|
|
150
|
+
critical: false
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"new-feature": [
|
|
154
|
+
{
|
|
155
|
+
id: "decisionRationale",
|
|
156
|
+
prompt: "What major technical decision is most likely and why?",
|
|
157
|
+
examples: ["CLI-first before UI for safer rollout", "Reuse existing module config patterns"],
|
|
158
|
+
whyItMatters: "Captures rationale for later review and refinement.",
|
|
159
|
+
critical: false
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"change": [
|
|
163
|
+
{
|
|
164
|
+
id: "migrationNotes",
|
|
165
|
+
prompt: "What migration or rollout notes should operators receive?",
|
|
166
|
+
examples: ["No migration required", "Enable setting X before command Y"],
|
|
167
|
+
whyItMatters: "Protects compatibility and operator trust.",
|
|
168
|
+
critical: false
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
};
|
|
172
|
+
function asRecord(value) {
|
|
173
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
174
|
+
? value
|
|
175
|
+
: null;
|
|
176
|
+
}
|
|
177
|
+
function parseQuestionList(value) {
|
|
178
|
+
if (!Array.isArray(value)) {
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
const parsed = [];
|
|
182
|
+
for (const entry of value) {
|
|
183
|
+
const row = asRecord(entry);
|
|
184
|
+
if (!row)
|
|
185
|
+
continue;
|
|
186
|
+
const id = typeof row.id === "string" ? row.id.trim() : "";
|
|
187
|
+
const prompt = typeof row.prompt === "string" ? row.prompt.trim() : "";
|
|
188
|
+
const whyItMatters = typeof row.whyItMatters === "string" ? row.whyItMatters.trim() : "";
|
|
189
|
+
if (!id || !prompt || !whyItMatters)
|
|
190
|
+
continue;
|
|
191
|
+
parsed.push({
|
|
192
|
+
id,
|
|
193
|
+
prompt,
|
|
194
|
+
whyItMatters,
|
|
195
|
+
examples: Array.isArray(row.examples)
|
|
196
|
+
? row.examples.filter((x) => typeof x === "string")
|
|
197
|
+
: [],
|
|
198
|
+
critical: row.critical === true
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
return parsed;
|
|
202
|
+
}
|
|
203
|
+
function parseDepth(value) {
|
|
204
|
+
if (value === "minimal" || value === "guided" || value === "adaptive") {
|
|
205
|
+
return value;
|
|
206
|
+
}
|
|
207
|
+
return "adaptive";
|
|
208
|
+
}
|
|
209
|
+
export function resolvePlanningConfig(config) {
|
|
210
|
+
const planning = asRecord(config?.planning);
|
|
211
|
+
const depth = parseDepth(planning?.defaultQuestionDepth);
|
|
212
|
+
const hardBlockCriticalUnknowns = planning?.hardBlockCriticalUnknowns !== false;
|
|
213
|
+
const rulesRoot = asRecord(planning?.rulePacks);
|
|
214
|
+
const rulePacks = {};
|
|
215
|
+
if (rulesRoot) {
|
|
216
|
+
for (const workflowType of Object.keys(BASE_QUESTIONS)) {
|
|
217
|
+
const pack = asRecord(rulesRoot[workflowType]);
|
|
218
|
+
if (!pack)
|
|
219
|
+
continue;
|
|
220
|
+
const baseQuestions = parseQuestionList(pack.baseQuestions);
|
|
221
|
+
const adaptiveQuestions = parseQuestionList(pack.adaptiveQuestions);
|
|
222
|
+
if (baseQuestions.length === 0 && adaptiveQuestions.length === 0)
|
|
223
|
+
continue;
|
|
224
|
+
rulePacks[workflowType] = {
|
|
225
|
+
baseQuestions: baseQuestions.length > 0 ? baseQuestions : BASE_QUESTIONS[workflowType],
|
|
226
|
+
adaptiveQuestions
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return { depth, hardBlockCriticalUnknowns, rulePacks };
|
|
231
|
+
}
|
|
232
|
+
export function resolvePlanningRulePack(planningType, config) {
|
|
233
|
+
const resolved = resolvePlanningConfig(config);
|
|
234
|
+
const override = resolved.rulePacks[planningType];
|
|
235
|
+
return {
|
|
236
|
+
baseQuestions: override?.baseQuestions ?? BASE_QUESTIONS[planningType],
|
|
237
|
+
adaptiveQuestions: override?.adaptiveQuestions ?? BASE_ADAPTIVE_QUESTIONS[planningType]
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
export function nextPlanningQuestions(planningType, answers, config) {
|
|
241
|
+
const { depth } = resolvePlanningConfig(config);
|
|
242
|
+
const rules = resolvePlanningRulePack(planningType, config);
|
|
243
|
+
const base = rules.baseQuestions;
|
|
244
|
+
const missingCritical = base.filter((q) => {
|
|
245
|
+
const value = answers[q.id];
|
|
246
|
+
return !(typeof value === "string" && value.trim().length > 0);
|
|
247
|
+
});
|
|
248
|
+
if (depth === "minimal") {
|
|
249
|
+
return { missingCritical, adaptiveFollowups: [] };
|
|
250
|
+
}
|
|
251
|
+
const adaptiveFollowups = [...rules.adaptiveQuestions];
|
|
252
|
+
if (depth === "guided") {
|
|
253
|
+
return { missingCritical, adaptiveFollowups };
|
|
254
|
+
}
|
|
255
|
+
const complexity = typeof answers.complexity === "string" ? answers.complexity.toLowerCase() : "";
|
|
256
|
+
if (complexity === "high") {
|
|
257
|
+
adaptiveFollowups.push({
|
|
258
|
+
id: "mitigationPlan",
|
|
259
|
+
prompt: "What mitigation strategy addresses high complexity risks?",
|
|
260
|
+
examples: ["Ship in slices", "Add parity checks before release"],
|
|
261
|
+
whyItMatters: "Reduces probability of destabilizing execution.",
|
|
262
|
+
critical: false
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
if (planningType === "new-feature" && !answers["decisionRationale"]) {
|
|
266
|
+
if (!adaptiveFollowups.some((q) => q.id === "decisionRationale")) {
|
|
267
|
+
adaptiveFollowups.push({
|
|
268
|
+
id: "decisionRationale",
|
|
269
|
+
prompt: "What major technical decision is most likely and why?",
|
|
270
|
+
examples: ["CLI-first before UI for safer rollout", "Reuse existing module config patterns"],
|
|
271
|
+
whyItMatters: "Captures rationale for later review and refinement.",
|
|
272
|
+
critical: false
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return { missingCritical, adaptiveFollowups };
|
|
277
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const PLANNING_WORKFLOW_TYPES: readonly ["task-breakdown", "sprint-phase", "task-ordering", "new-feature", "change"];
|
|
2
|
+
export type PlanningWorkflowType = (typeof PLANNING_WORKFLOW_TYPES)[number];
|
|
3
|
+
export type PlanningWorkflowDescriptor = {
|
|
4
|
+
type: PlanningWorkflowType;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
outcomeFocus: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const PLANNING_WORKFLOW_DESCRIPTORS: PlanningWorkflowDescriptor[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export const PLANNING_WORKFLOW_TYPES = [
|
|
2
|
+
"task-breakdown",
|
|
3
|
+
"sprint-phase",
|
|
4
|
+
"task-ordering",
|
|
5
|
+
"new-feature",
|
|
6
|
+
"change"
|
|
7
|
+
];
|
|
8
|
+
export const PLANNING_WORKFLOW_DESCRIPTORS = [
|
|
9
|
+
{
|
|
10
|
+
type: "task-breakdown",
|
|
11
|
+
title: "Task Breakdown",
|
|
12
|
+
description: "Break work into coherent, reviewable slices with explicit acceptance criteria.",
|
|
13
|
+
outcomeFocus: "Clear decomposition into actionable units."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: "sprint-phase",
|
|
17
|
+
title: "Sprint / Phase Plan",
|
|
18
|
+
description: "Define phase goals, sequencing, and completion checkpoints.",
|
|
19
|
+
outcomeFocus: "Time-ordered delivery framing with clear phase boundaries."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: "task-ordering",
|
|
23
|
+
title: "Task Ordering",
|
|
24
|
+
description: "Prioritize and sequence tasks with dependency awareness.",
|
|
25
|
+
outcomeFocus: "Deterministic ordering with explicit dependency intent."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: "new-feature",
|
|
29
|
+
title: "New Feature",
|
|
30
|
+
description: "Guide discovery for new feature goals, architecture choices, and rollout fit.",
|
|
31
|
+
outcomeFocus: "High-confidence feature direction and constraints."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: "change",
|
|
35
|
+
title: "Change / Refactor",
|
|
36
|
+
description: "Assess behavior-impacting changes and migration/compatibility risks.",
|
|
37
|
+
outcomeFocus: "Safe, justified change plan with risk controls."
|
|
38
|
+
}
|
|
39
|
+
];
|