@punks/cli 3.3.6 → 4.0.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/AGENTS.md +1 -1
- package/dist/BASELINE_CHANGELOG.md +11 -2
- package/dist/CHANGELOG.md +20 -0
- package/dist/baseline/scaffold-baseline/baseline.json +5 -5
- package/dist/baseline/scaffold-baseline/data/catalog/packs.json +9 -3
- package/dist/baseline/scaffold-baseline/data/catalog/skills.json +32 -0
- package/dist/baseline/scaffold-baseline/data/subagents/manifest.mjs +1 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/SKILL.md +20 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +14 -9
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/backlog-sync.md +61 -29
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +25 -6
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/SKILL.md +10 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/readiness.md +4 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +20 -1
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +20 -3
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/wayfinder/SKILL.md +13 -36
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/SKILL.md +57 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/agents/openai.yaml +4 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/references/audit-portfolio.md +47 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/references/implement-suite.md +40 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/references/route-api-design.md +21 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/references/user-journey-design.md +21 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/EXAMPLES.md +42 -26
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/REFERENCE.md +80 -97
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/SKILL.md +93 -96
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +43 -52
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/story-shape.md +70 -136
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/backlog-initialization.md +88 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/business-projection.md +31 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/delivery-status.md +66 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/fog-intake.md +72 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/functional-projection.md +27 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/issue-reconciliation.md +76 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/normalization.md +105 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/project-context.md +43 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/providers/github.md +168 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/providers/linear.md +190 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/technical-projection.md +65 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/scripts/validate-task-blocker-graph.mjs +137 -0
- package/dist/baseline/scaffold-baseline/skills/phases/business-finder/SKILL.md +30 -0
- package/dist/baseline/scaffold-baseline/skills/phases/business-finder/agents/openai.yaml +2 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/backlog.md +10 -3
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/closeout.md +12 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/implement.md +21 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +8 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/artifact-state.md +18 -3
- package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/backlog.md +9 -1
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/AUTHORING-HANDOFF.md +276 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/SKILL.md +43 -51
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/agents/openai.yaml +1 -1
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/adopt-business-path.md +52 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/business-grilling.md +68 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/ensure-fog.md +43 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/functional-grilling.md +53 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/handback.md +36 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/prototype.md +40 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/reconcile.md +52 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/research.md +38 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/return-target.md +42 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/router.md +64 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/technical-grilling.md +67 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/entrypoint-contract.md +38 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/root-routing.md +14 -27
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/runtime-handoff.md +62 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/state-graph.md +60 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/scripts/finder-contract.mjs +383 -0
- package/dist/baseline/scaffold-baseline/skills/phases/functional-finder/SKILL.md +78 -0
- package/dist/baseline/scaffold-baseline/skills/phases/functional-finder/agents/openai.yaml +2 -0
- package/dist/baseline/scaffold-baseline/skills/phases/technical-finder/SKILL.md +74 -0
- package/dist/baseline/scaffold-baseline/skills/phases/technical-finder/agents/openai.yaml +2 -0
- package/dist/baseline/scaffold-baseline.json +5 -5
- package/dist/baseline/scaffold-baseline.tgz +0 -0
- package/dist/data/subagents/manifest.mjs +1 -0
- package/dist/index.js +6 -6
- package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +20 -4
- package/dist/skills/agnostic/planning/create-plan/SKILL.md +14 -9
- package/dist/skills/agnostic/planning/create-plan/references/backlog-sync.md +61 -29
- package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +25 -6
- package/dist/skills/agnostic/planning/create-spec/SKILL.md +10 -4
- package/dist/skills/agnostic/planning/create-spec/references/readiness.md +4 -0
- package/dist/skills/agnostic/planning/implement-spec/SKILL.md +20 -1
- package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +20 -3
- package/dist/skills/agnostic/planning/wayfinder/SKILL.md +13 -36
- package/dist/skills/agnostic/quality/make-tsuite/SKILL.md +57 -0
- package/dist/skills/agnostic/quality/make-tsuite/agents/openai.yaml +4 -0
- package/dist/skills/agnostic/quality/make-tsuite/references/audit-portfolio.md +47 -0
- package/dist/skills/agnostic/quality/make-tsuite/references/implement-suite.md +40 -0
- package/dist/skills/agnostic/quality/make-tsuite/references/route-api-design.md +21 -0
- package/dist/skills/agnostic/quality/make-tsuite/references/user-journey-design.md +21 -0
- package/dist/skills/agnostic/requirements/write-backlog/EXAMPLES.md +42 -26
- package/dist/skills/agnostic/requirements/write-backlog/REFERENCE.md +80 -97
- package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +93 -96
- package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +43 -52
- package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/story-shape.md +70 -136
- package/dist/skills/agnostic/requirements/write-backlog/references/backlog-initialization.md +88 -0
- package/dist/skills/agnostic/requirements/write-backlog/references/business-projection.md +31 -0
- package/dist/skills/agnostic/requirements/write-backlog/references/delivery-status.md +66 -0
- package/dist/skills/agnostic/requirements/write-backlog/references/fog-intake.md +72 -0
- package/dist/skills/agnostic/requirements/write-backlog/references/functional-projection.md +27 -0
- package/dist/skills/agnostic/requirements/write-backlog/references/issue-reconciliation.md +76 -0
- package/dist/skills/agnostic/requirements/write-backlog/references/normalization.md +105 -0
- package/dist/skills/agnostic/requirements/write-backlog/references/project-context.md +43 -0
- package/dist/skills/agnostic/requirements/write-backlog/references/providers/github.md +168 -0
- package/dist/skills/agnostic/requirements/write-backlog/references/providers/linear.md +190 -0
- package/dist/skills/agnostic/requirements/write-backlog/references/technical-projection.md +65 -0
- package/dist/skills/agnostic/requirements/write-backlog/scripts/validate-task-blocker-graph.mjs +135 -0
- package/dist/skills/phases/business-finder/SKILL.md +30 -0
- package/dist/skills/phases/business-finder/agents/openai.yaml +2 -0
- package/dist/skills/phases/delivery-phase/phases/backlog.md +10 -3
- package/dist/skills/phases/delivery-phase/phases/closeout.md +12 -0
- package/dist/skills/phases/delivery-phase/phases/implement.md +21 -0
- package/dist/skills/phases/delivery-phase/phases/router.md +8 -0
- package/dist/skills/phases/delivery-phase/references/artifact-state.md +18 -3
- package/dist/skills/phases/design-phase/phases/backlog.md +9 -1
- package/dist/skills/phases/finder-phase/AUTHORING-HANDOFF.md +276 -0
- package/dist/skills/phases/finder-phase/SKILL.md +43 -51
- package/dist/skills/phases/finder-phase/agents/openai.yaml +1 -1
- package/dist/skills/phases/finder-phase/phases/adopt-business-path.md +52 -0
- package/dist/skills/phases/finder-phase/phases/business-grilling.md +68 -0
- package/dist/skills/phases/finder-phase/phases/ensure-fog.md +43 -0
- package/dist/skills/phases/finder-phase/phases/functional-grilling.md +53 -0
- package/dist/skills/phases/finder-phase/phases/handback.md +36 -0
- package/dist/skills/phases/finder-phase/phases/prototype.md +40 -0
- package/dist/skills/phases/finder-phase/phases/reconcile.md +52 -0
- package/dist/skills/phases/finder-phase/phases/research.md +38 -0
- package/dist/skills/phases/finder-phase/phases/return-target.md +42 -0
- package/dist/skills/phases/finder-phase/phases/router.md +64 -0
- package/dist/skills/phases/finder-phase/phases/technical-grilling.md +67 -0
- package/dist/skills/phases/finder-phase/references/entrypoint-contract.md +38 -0
- package/dist/skills/phases/finder-phase/references/root-routing.md +14 -27
- package/dist/skills/phases/finder-phase/references/runtime-handoff.md +62 -0
- package/dist/skills/phases/finder-phase/references/state-graph.md +60 -0
- package/dist/skills/phases/finder-phase/scripts/finder-contract.mjs +383 -0
- package/dist/skills/phases/functional-finder/SKILL.md +78 -0
- package/dist/skills/phases/functional-finder/agents/openai.yaml +2 -0
- package/dist/skills/phases/technical-finder/SKILL.md +74 -0
- package/dist/skills/phases/technical-finder/agents/openai.yaml +2 -0
- package/package.json +4 -2
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/convergence.md +0 -39
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/frontier-lifecycle.md +0 -76
- package/dist/skills/phases/finder-phase/references/convergence.md +0 -39
- package/dist/skills/phases/finder-phase/references/frontier-lifecycle.md +0 -76
package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/scripts/finder-contract.mjs
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
const DEPTHS = ["Business", "Functional", "Technical"];
|
|
2
|
+
const CONFLICT_IDENTITIES = ["ambiguous", "duplicate", "conflict"];
|
|
3
|
+
const isStableIdentity = (value) => typeof value === "string" && value.trim().length > 0;
|
|
4
|
+
|
|
5
|
+
const hasExactBusinessProjection = (child) =>
|
|
6
|
+
isStableIdentity(child?.projectedProductArea) &&
|
|
7
|
+
isStableIdentity(child.projectedInitiative) &&
|
|
8
|
+
isStableIdentity(child.projectedEpic) &&
|
|
9
|
+
child.hierarchyReadback === "exact";
|
|
10
|
+
|
|
11
|
+
const businessChildCollectionConflicts = (children) => {
|
|
12
|
+
if (!Array.isArray(children)) return false;
|
|
13
|
+
return (
|
|
14
|
+
children.length > 1 ||
|
|
15
|
+
children.some(
|
|
16
|
+
(child) =>
|
|
17
|
+
!child ||
|
|
18
|
+
child.identity !== "exact" ||
|
|
19
|
+
(child.status === "accepted" &&
|
|
20
|
+
child.scope === "in-scope" &&
|
|
21
|
+
child.projection === "read-back" &&
|
|
22
|
+
!hasExactBusinessProjection(child)),
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const deriveBusinessStageRoute = (state) => {
|
|
28
|
+
if (!Array.isArray(state.businessChildren)) {
|
|
29
|
+
return state.business === "accepted" ? "human-steering" : "business-grilling";
|
|
30
|
+
}
|
|
31
|
+
if (state.businessChildren.length === 0) {
|
|
32
|
+
return state.business === "accepted" ? "human-steering" : "business-grilling";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const [child] = state.businessChildren;
|
|
36
|
+
if (child.status !== "accepted" || child.scope !== "in-scope") {
|
|
37
|
+
return "business-grilling";
|
|
38
|
+
}
|
|
39
|
+
if (child.resolution !== "immutable") return "human-steering";
|
|
40
|
+
if (child.projection !== "read-back") return "reconcile";
|
|
41
|
+
if (!hasExactBusinessProjection(child)) return "human-steering";
|
|
42
|
+
return "ready";
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const childCollectionConflicts = (children, foreignKey) => {
|
|
46
|
+
if (!Array.isArray(children)) return false;
|
|
47
|
+
|
|
48
|
+
const seen = new Set();
|
|
49
|
+
for (const child of children) {
|
|
50
|
+
if (!child || CONFLICT_IDENTITIES.includes(child.identity)) return true;
|
|
51
|
+
const key = child[foreignKey];
|
|
52
|
+
if (!isStableIdentity(key)) return true;
|
|
53
|
+
if (seen.has(key)) return true;
|
|
54
|
+
seen.add(key);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return false;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const functionalProjectionConflicts = (children, businessChildren) => {
|
|
61
|
+
if (!Array.isArray(children)) return false;
|
|
62
|
+
|
|
63
|
+
const projectedEpic = businessChildren?.[0]?.projectedEpic;
|
|
64
|
+
const stories = new Set();
|
|
65
|
+
for (const child of children) {
|
|
66
|
+
if (
|
|
67
|
+
child?.status !== "accepted" ||
|
|
68
|
+
child.scope !== "in-scope" ||
|
|
69
|
+
child.projection !== "read-back"
|
|
70
|
+
) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (
|
|
74
|
+
!isStableIdentity(projectedEpic) ||
|
|
75
|
+
!isStableIdentity(child.projectedStory) ||
|
|
76
|
+
child.projectedStoryParentEpic !== projectedEpic ||
|
|
77
|
+
!isStableIdentity(child.projectedStoryMilestone) ||
|
|
78
|
+
child.projectedStoryMilestoneKind !== "V*" ||
|
|
79
|
+
child.projectedStoryFogLink !== "exact" ||
|
|
80
|
+
child.projectedStorySourceLink !== "exact" ||
|
|
81
|
+
child.projectedStoryMembershipReadback !== "exact"
|
|
82
|
+
) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
if (stories.has(child.projectedStory)) return true;
|
|
86
|
+
stories.add(child.projectedStory);
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const hasExactWriterTaskGraphValidation = (state, projectedTasks) => {
|
|
92
|
+
const validation = state.taskGraphValidation;
|
|
93
|
+
const result = validation?.result;
|
|
94
|
+
if (
|
|
95
|
+
!isStableIdentity(state.providerSnapshotIdentity) ||
|
|
96
|
+
validation?.validator !== "write-backlog/validate-task-blocker-graph" ||
|
|
97
|
+
validation.scope !== "full-reachable" ||
|
|
98
|
+
validation.milestoneOrderReadback !== "exact" ||
|
|
99
|
+
validation.providerSnapshotIdentity !== state.providerSnapshotIdentity ||
|
|
100
|
+
result?.ok !== true ||
|
|
101
|
+
!Array.isArray(result.taskIds) ||
|
|
102
|
+
!Array.isArray(result.edges)
|
|
103
|
+
) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const validatedTaskIds = new Set();
|
|
108
|
+
for (const taskId of result.taskIds) {
|
|
109
|
+
if (!isStableIdentity(taskId) || validatedTaskIds.has(taskId)) return false;
|
|
110
|
+
validatedTaskIds.add(taskId);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const validatedEdges = new Set();
|
|
114
|
+
for (const edge of result.edges) {
|
|
115
|
+
if (
|
|
116
|
+
!isStableIdentity(edge?.blockedTaskId) ||
|
|
117
|
+
!isStableIdentity(edge.blockingTaskId) ||
|
|
118
|
+
!validatedTaskIds.has(edge.blockedTaskId) ||
|
|
119
|
+
!validatedTaskIds.has(edge.blockingTaskId)
|
|
120
|
+
) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
const key = `${edge.blockedTaskId}\u0000${edge.blockingTaskId}`;
|
|
124
|
+
if (validatedEdges.has(key)) return false;
|
|
125
|
+
validatedEdges.add(key);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const projectedTaskIds = new Set(projectedTasks.map((task) => task.id));
|
|
129
|
+
const projectedEdges = new Set();
|
|
130
|
+
for (const task of projectedTasks) {
|
|
131
|
+
if (!validatedTaskIds.has(task.id)) return false;
|
|
132
|
+
for (const blockingTaskId of task.blockedBy) {
|
|
133
|
+
if (!validatedTaskIds.has(blockingTaskId)) return false;
|
|
134
|
+
projectedEdges.add(`${task.id}\u0000${blockingTaskId}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if ([...projectedEdges].some((edge) => !validatedEdges.has(edge))) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
if (
|
|
141
|
+
[...validatedEdges].some((edge) => {
|
|
142
|
+
const [blockedTaskId] = edge.split("\u0000");
|
|
143
|
+
return projectedTaskIds.has(blockedTaskId) && !projectedEdges.has(edge);
|
|
144
|
+
})
|
|
145
|
+
) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return true;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const technicalProjectionConflicts = (state) => {
|
|
153
|
+
const children = state.technicalChildren;
|
|
154
|
+
const functionalChildren = state.functionalChildren;
|
|
155
|
+
if (!Array.isArray(children)) return false;
|
|
156
|
+
|
|
157
|
+
const storyMilestones = new Map(
|
|
158
|
+
(Array.isArray(functionalChildren) ? functionalChildren : [])
|
|
159
|
+
.filter(
|
|
160
|
+
(child) =>
|
|
161
|
+
child?.status === "accepted" &&
|
|
162
|
+
child.scope === "in-scope" &&
|
|
163
|
+
child.projection === "read-back" &&
|
|
164
|
+
isStableIdentity(child.projectedStory) &&
|
|
165
|
+
isStableIdentity(child.projectedStoryMilestone),
|
|
166
|
+
)
|
|
167
|
+
.map((child) => [child.projectedStory, child.projectedStoryMilestone]),
|
|
168
|
+
);
|
|
169
|
+
const taskIds = new Set();
|
|
170
|
+
const tasks = [];
|
|
171
|
+
for (const child of children) {
|
|
172
|
+
if (
|
|
173
|
+
child?.status !== "accepted" ||
|
|
174
|
+
child.scope !== "in-scope" ||
|
|
175
|
+
child.projection !== "read-back"
|
|
176
|
+
) {
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
const storyMilestone = storyMilestones.get(child.story);
|
|
180
|
+
if (
|
|
181
|
+
!isStableIdentity(storyMilestone) ||
|
|
182
|
+
child.taskGraphReadback !== "exact" ||
|
|
183
|
+
!Array.isArray(child.projectedTasks) ||
|
|
184
|
+
child.projectedTasks.length !== child.taskIntentCount
|
|
185
|
+
) {
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
for (const task of child.projectedTasks) {
|
|
189
|
+
if (
|
|
190
|
+
!task ||
|
|
191
|
+
!isStableIdentity(task.id) ||
|
|
192
|
+
task.story !== child.story ||
|
|
193
|
+
task.milestone !== storyMilestone ||
|
|
194
|
+
task.readback !== "exact" ||
|
|
195
|
+
!Array.isArray(task.blockedBy) ||
|
|
196
|
+
task.blockedBy.some((identity) => !isStableIdentity(identity)) ||
|
|
197
|
+
taskIds.has(task.id)
|
|
198
|
+
) {
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
taskIds.add(task.id);
|
|
202
|
+
tasks.push(task);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (tasks.length === 0) return false;
|
|
206
|
+
|
|
207
|
+
for (const task of tasks) {
|
|
208
|
+
if (
|
|
209
|
+
new Set(task.blockedBy).size !== task.blockedBy.length ||
|
|
210
|
+
task.blockedBy.includes(task.id)
|
|
211
|
+
) {
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return !hasExactWriterTaskGraphValidation(state, tasks);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const technicalSelectionConflicts = ({
|
|
219
|
+
selectedStoryIntents,
|
|
220
|
+
selectedStories,
|
|
221
|
+
functionalChildren,
|
|
222
|
+
}) => {
|
|
223
|
+
if (!Array.isArray(selectedStories) || selectedStories.length === 0) {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const selectedIntents = new Set(Array.isArray(selectedStoryIntents) ? selectedStoryIntents : []);
|
|
228
|
+
const selectedFunctionalChildren = (
|
|
229
|
+
Array.isArray(functionalChildren) ? functionalChildren : []
|
|
230
|
+
).filter(
|
|
231
|
+
(child) =>
|
|
232
|
+
selectedIntents.has(child.storyIntent) &&
|
|
233
|
+
child.status === "accepted" &&
|
|
234
|
+
child.scope === "in-scope" &&
|
|
235
|
+
child.projection === "read-back",
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
return (
|
|
239
|
+
new Set(selectedStories).size !== selectedStories.length ||
|
|
240
|
+
selectedStories.some(
|
|
241
|
+
(story) =>
|
|
242
|
+
!isStableIdentity(story) ||
|
|
243
|
+
selectedFunctionalChildren.filter((child) => child.projectedStory === story).length !== 1,
|
|
244
|
+
)
|
|
245
|
+
);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const deriveChildStageRoute = ({
|
|
249
|
+
selected,
|
|
250
|
+
children,
|
|
251
|
+
foreignKey,
|
|
252
|
+
grillingRoute,
|
|
253
|
+
validateAcceptedChild = () => true,
|
|
254
|
+
}) => {
|
|
255
|
+
if (!Array.isArray(selected)) return grillingRoute;
|
|
256
|
+
if (selected.length === 0) return grillingRoute;
|
|
257
|
+
if (new Set(selected).size !== selected.length) return "human-steering";
|
|
258
|
+
|
|
259
|
+
const matchesBySelected = selected.map((selectedIdentity) =>
|
|
260
|
+
(Array.isArray(children) ? children : []).filter(
|
|
261
|
+
(child) => child[foreignKey] === selectedIdentity,
|
|
262
|
+
),
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
if (
|
|
266
|
+
matchesBySelected.some(
|
|
267
|
+
(matches) =>
|
|
268
|
+
matches.length > 1 || matches.some((child) => CONFLICT_IDENTITIES.includes(child.identity)),
|
|
269
|
+
)
|
|
270
|
+
) {
|
|
271
|
+
return "human-steering";
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (
|
|
275
|
+
matchesBySelected
|
|
276
|
+
.filter(
|
|
277
|
+
(matches) =>
|
|
278
|
+
matches.length === 1 &&
|
|
279
|
+
matches[0].status === "accepted" &&
|
|
280
|
+
matches[0].scope === "in-scope",
|
|
281
|
+
)
|
|
282
|
+
.some(
|
|
283
|
+
([child]) =>
|
|
284
|
+
child.identity !== "exact" ||
|
|
285
|
+
child.resolution !== "immutable" ||
|
|
286
|
+
!validateAcceptedChild(child),
|
|
287
|
+
)
|
|
288
|
+
) {
|
|
289
|
+
return "human-steering";
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (
|
|
293
|
+
matchesBySelected
|
|
294
|
+
.filter(
|
|
295
|
+
(matches) =>
|
|
296
|
+
matches.length === 1 &&
|
|
297
|
+
matches[0].status === "accepted" &&
|
|
298
|
+
matches[0].scope === "in-scope",
|
|
299
|
+
)
|
|
300
|
+
.some(([child]) => child.projection !== "read-back")
|
|
301
|
+
) {
|
|
302
|
+
return "reconcile";
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (
|
|
306
|
+
matchesBySelected.some(
|
|
307
|
+
(matches) =>
|
|
308
|
+
matches.length !== 1 || matches[0].status !== "accepted" || matches[0].scope !== "in-scope",
|
|
309
|
+
)
|
|
310
|
+
) {
|
|
311
|
+
return grillingRoute;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return "ready";
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
export const deriveFinderRoute = (state) => {
|
|
318
|
+
if (!DEPTHS.includes(state.targetDepth)) return "human-steering";
|
|
319
|
+
if (state.humanSteering === "required") return "human-steering";
|
|
320
|
+
if (CONFLICT_IDENTITIES.includes(state.fogIdentity)) {
|
|
321
|
+
return "human-steering";
|
|
322
|
+
}
|
|
323
|
+
if (
|
|
324
|
+
businessChildCollectionConflicts(state.businessChildren) ||
|
|
325
|
+
childCollectionConflicts(state.functionalChildren, "storyIntent") ||
|
|
326
|
+
childCollectionConflicts(state.technicalChildren, "story") ||
|
|
327
|
+
functionalProjectionConflicts(state.functionalChildren, state.businessChildren) ||
|
|
328
|
+
technicalProjectionConflicts(state)
|
|
329
|
+
) {
|
|
330
|
+
return "human-steering";
|
|
331
|
+
}
|
|
332
|
+
if (state.fogIdentity !== "exact") return "ensure-fog";
|
|
333
|
+
if (CONFLICT_IDENTITIES.includes(state.businessIdentity)) {
|
|
334
|
+
return "human-steering";
|
|
335
|
+
}
|
|
336
|
+
if (state.acceptedEvidence === "conflict") return "human-steering";
|
|
337
|
+
if (state.scopeExpansion === "approval-required") {
|
|
338
|
+
return "scope-expansion-checkpoint";
|
|
339
|
+
}
|
|
340
|
+
if (state.support === "research") return "research";
|
|
341
|
+
if (state.support === "prototype") return "prototype";
|
|
342
|
+
if (state.businessEvidenceScope === "out-of-scope") {
|
|
343
|
+
return "business-grilling";
|
|
344
|
+
}
|
|
345
|
+
if (state.business !== "accepted") {
|
|
346
|
+
if (
|
|
347
|
+
state.targetDepth !== "Business" &&
|
|
348
|
+
state.business === "missing" &&
|
|
349
|
+
state.businessPathIdentity === "exact" &&
|
|
350
|
+
state.businessPathDecision === "reuse-unchanged"
|
|
351
|
+
) {
|
|
352
|
+
return "adopt-business-path";
|
|
353
|
+
}
|
|
354
|
+
return "business-grilling";
|
|
355
|
+
}
|
|
356
|
+
const businessRoute = deriveBusinessStageRoute(state);
|
|
357
|
+
if (businessRoute !== "ready") return businessRoute;
|
|
358
|
+
if (state.targetDepth === "Business") return "return-target";
|
|
359
|
+
|
|
360
|
+
const functionalRoute = deriveChildStageRoute({
|
|
361
|
+
selected: state.selectedStoryIntents,
|
|
362
|
+
children: state.functionalChildren,
|
|
363
|
+
foreignKey: "storyIntent",
|
|
364
|
+
grillingRoute: "functional-grilling",
|
|
365
|
+
});
|
|
366
|
+
if (functionalRoute !== "ready") return functionalRoute;
|
|
367
|
+
if (state.targetDepth === "Functional") return "return-target";
|
|
368
|
+
if (technicalSelectionConflicts(state)) return "human-steering";
|
|
369
|
+
|
|
370
|
+
const technicalRoute = deriveChildStageRoute({
|
|
371
|
+
selected: state.selectedStories,
|
|
372
|
+
children: state.technicalChildren,
|
|
373
|
+
foreignKey: "story",
|
|
374
|
+
grillingRoute: "technical-grilling",
|
|
375
|
+
validateAcceptedChild: (child) =>
|
|
376
|
+
child.specReadiness === "agent-ready" &&
|
|
377
|
+
child.stableBlob === "verified" &&
|
|
378
|
+
Number.isInteger(child.taskIntentCount) &&
|
|
379
|
+
child.taskIntentCount > 0,
|
|
380
|
+
});
|
|
381
|
+
if (technicalRoute !== "ready") return technicalRoute;
|
|
382
|
+
return "return-target";
|
|
383
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: functional-finder
|
|
3
|
+
description: Define shippable product behavior through cumulative Business and Functional grilling.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Functional Finder
|
|
8
|
+
|
|
9
|
+
Human entrypoint for a technical or proficient nontechnical user. Use precise
|
|
10
|
+
project language. Define product behavior one level below Business scope and
|
|
11
|
+
stop before engineering design or Task decomposition.
|
|
12
|
+
|
|
13
|
+
## Inputs
|
|
14
|
+
|
|
15
|
+
- one product-behavior request
|
|
16
|
+
- optional stable provider or durable wiki Fog identity
|
|
17
|
+
- optional exact accepted Business child and Product Area -> Initiative -> Epic
|
|
18
|
+
path
|
|
19
|
+
- product context, constraints, dependencies, and milestone preference supplied
|
|
20
|
+
by the human
|
|
21
|
+
|
|
22
|
+
## Composition
|
|
23
|
+
|
|
24
|
+
Directly compose [the Finder engine](../finder-phase/SKILL.md) with target
|
|
25
|
+
depth: `Functional`. This is cumulative Business and Functional depth over one
|
|
26
|
+
Fog; this adapter supplies only its audience, presentation, and return profile.
|
|
27
|
+
|
|
28
|
+
Reuse a fresh accepted Business child. When none exists, an exact existing
|
|
29
|
+
Product Area -> Initiative -> Epic path from provider readback plus the
|
|
30
|
+
human's explicit `reuse-unchanged` decision takes the fast path without
|
|
31
|
+
changing business scope. Its Business-path adoption gate creates the required
|
|
32
|
+
Business child and immutable resolution without a Business grill. Otherwise
|
|
33
|
+
let the engine complete Business grilling
|
|
34
|
+
before Functional grilling. When accepted lower-stage evidence needs repair,
|
|
35
|
+
the engine may enrich existing Business structures before it continues. The
|
|
36
|
+
engine's
|
|
37
|
+
[Functional gate](../finder-phase/phases/functional-grilling.md) composes atomic
|
|
38
|
+
`$grilling` and resolves one Functional child per accepted Story intent.
|
|
39
|
+
|
|
40
|
+
## Presentation
|
|
41
|
+
|
|
42
|
+
Before grilling, use the smallest authoritative `$show-me` view to show the
|
|
43
|
+
current Business path, relevant existing Stories and `V*` milestones, and the
|
|
44
|
+
requested product behavior. Continue to use `$show-me` at each decision about:
|
|
45
|
+
|
|
46
|
+
- the observable workflow
|
|
47
|
+
- the Story split and Story boundaries
|
|
48
|
+
- an alternate path or failure path
|
|
49
|
+
- a product dependency
|
|
50
|
+
- the milestone iteration
|
|
51
|
+
- the final Story write
|
|
52
|
+
|
|
53
|
+
When terminology or behavior does not land, use `$wait-what`: pause, repitch in
|
|
54
|
+
plain language with accepted project terms, and ask again. Preserve the user's
|
|
55
|
+
language when it already matches those terms.
|
|
56
|
+
|
|
57
|
+
## Functional depth
|
|
58
|
+
|
|
59
|
+
For each proposed Story, settle the actor, trigger, observable workflow and
|
|
60
|
+
result, applicable business rules, visible alternate or failure paths,
|
|
61
|
+
product-level edge cases, acceptance signals, Story boundaries, known product
|
|
62
|
+
dependencies, and unresolved engineering questions.
|
|
63
|
+
|
|
64
|
+
Assign exactly one contextual `V*` milestone to each Story. Reuse a fitting
|
|
65
|
+
existing `V*` milestone before proposing a new one. Show and obtain approval
|
|
66
|
+
before moving accepted work to another milestone.
|
|
67
|
+
|
|
68
|
+
After immutable Functional evidence is accepted, hand semantic projection
|
|
69
|
+
intent to `$write-backlog`. It is the physical mutation authority and must
|
|
70
|
+
write and read back exactly one Story per accepted Functional child.
|
|
71
|
+
|
|
72
|
+
## Return
|
|
73
|
+
|
|
74
|
+
Return the exact Fog identity, accepted Business child identity and resolution
|
|
75
|
+
pointer, selected Functional child identities and resolution pointers, the
|
|
76
|
+
resolved Product Area -> Initiative -> Epic path, exact Story provider
|
|
77
|
+
identities and readback, milestone membership, unresolved decisions, and the
|
|
78
|
+
durable Finder handoff. Stop at the engine's `target_depth_reached` outcome.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: technical-finder
|
|
3
|
+
description: Resolve Story delivery through cumulative Business, Functional, and Technical grilling.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Technical Finder
|
|
8
|
+
|
|
9
|
+
Human entrypoint for a technical user. Close technical requirements for
|
|
10
|
+
accepted Stories without taking ownership of implementation or provider writes.
|
|
11
|
+
|
|
12
|
+
## Composition
|
|
13
|
+
|
|
14
|
+
Directly compose [the Finder engine](../finder-phase/SKILL.md) with target
|
|
15
|
+
depth: `Technical`. This is cumulative Business, Functional, and Technical
|
|
16
|
+
depth over one Fog; this adapter supplies only its audience, presentation, and
|
|
17
|
+
return profile. The engine's [Technical gate](../finder-phase/phases/technical-grilling.md)
|
|
18
|
+
owns the executable per-Story sequence and durable state.
|
|
19
|
+
|
|
20
|
+
## Story-scoped presentation
|
|
21
|
+
|
|
22
|
+
Let the engine validate and reuse fresh accepted Business and Functional
|
|
23
|
+
stages. It resumes the first missing or invalidated stage and selects one Story
|
|
24
|
+
at a time for Technical resolution.
|
|
25
|
+
|
|
26
|
+
Present the selected gate's evidence in its authoritative order:
|
|
27
|
+
|
|
28
|
+
1. Reuse or allocate the durable Technical child identity for the exact Fog,
|
|
29
|
+
Stage `Technical`, and stable Story identity; show the `$write-backlog`
|
|
30
|
+
child-shell ensure and exact readback.
|
|
31
|
+
2. Open or resume exactly one durable full `$requirements-grill` once per Story.
|
|
32
|
+
3. Show the immutable accepted resolution persisted on that Technical child.
|
|
33
|
+
4. Show `$create-spec` returning `readiness: agent-ready` and a verified stable
|
|
34
|
+
blob URL.
|
|
35
|
+
5. Show the nonempty Task intent derived from that specification.
|
|
36
|
+
6. Show the `$write-backlog` Technical projection and exact Task/relation
|
|
37
|
+
readback.
|
|
38
|
+
7. Re-enter the Finder router so accepted pending projection reconciles before
|
|
39
|
+
the next Story is selected.
|
|
40
|
+
|
|
41
|
+
A Technical child shell exists before `$requirements-grill` and cannot
|
|
42
|
+
authorize projection. Preserve the same child and requirements artifacts on
|
|
43
|
+
resume. A duplicate or ambiguous child returns zero writes and human steering.
|
|
44
|
+
`spec-not-ready`, a missing verified blob, or an empty Task intent returns zero
|
|
45
|
+
Technical projection through the engine's declared handback route.
|
|
46
|
+
|
|
47
|
+
This wrapper advances none of those steps itself. `$requirements-grill` owns
|
|
48
|
+
decision closure, `$create-spec` owns specification compilation, and
|
|
49
|
+
`$write-backlog` remains the sole physical provider mutation and readback
|
|
50
|
+
authority.
|
|
51
|
+
|
|
52
|
+
## Task projection
|
|
53
|
+
|
|
54
|
+
The semantic intent carries the exact Story and milestone, immutable Technical
|
|
55
|
+
resolution and specification URL, a nonempty Task set, and the complete intended
|
|
56
|
+
blocker graph. Each proposed responsibility must be atomic and independently
|
|
57
|
+
owner-ready. `$write-backlog` validates the full reachable graph, same-`V*`
|
|
58
|
+
membership, cross-Story or cross-Epic blockers, and provider representation
|
|
59
|
+
before it writes anything.
|
|
60
|
+
|
|
61
|
+
Use `$show-me` to present the Story boundary, accepted specification, proposed
|
|
62
|
+
Task split, parallel work, and blocker topology. Preserve writer-owned approval
|
|
63
|
+
gates and return its exact rejection, partial-write, or readback evidence to the
|
|
64
|
+
Finder engine without implementing provider mechanics here.
|
|
65
|
+
|
|
66
|
+
## Return
|
|
67
|
+
|
|
68
|
+
At `target_depth_reached`, return the exact Fog identity, all stage children and
|
|
69
|
+
their immutable pointers, resolved product path and Stories, specification URLs,
|
|
70
|
+
Task IDs and URLs, blocker edges, milestone membership, exact readback, support
|
|
71
|
+
evidence, unresolved decisions, and durable Finder handoff.
|
|
72
|
+
|
|
73
|
+
Reaching Technical depth does not complete the Fog. Return its remaining
|
|
74
|
+
production-evidence obligations so delivery can prove completion later.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"channel": "stable",
|
|
4
|
-
"version": "2026.08.
|
|
5
|
-
"tag": "baseline/stable/2026.08.
|
|
6
|
-
"commit": "
|
|
4
|
+
"version": "2026.08.27-3fa9f3ef",
|
|
5
|
+
"tag": "baseline/stable/2026.08.27-3fa9f3ef",
|
|
6
|
+
"commit": "3fa9f3efa578fc81f1cb2d6d38acc74c3518fd11",
|
|
7
7
|
"archive": "scaffold-baseline.tgz",
|
|
8
|
-
"archiveSha256": "
|
|
8
|
+
"archiveSha256": "bc8dfb3d985696f0b61bd4e6ad620ea884c57b11f3e663a00c555c87f8206332",
|
|
9
9
|
"compatibility": {
|
|
10
|
-
"cliVersionRange": ">=
|
|
10
|
+
"cliVersionRange": ">=4.0.1 <4.1.0"
|
|
11
11
|
}
|
|
12
12
|
}
|
|
Binary file
|