@punks/cli 4.0.2 → 4.0.3
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/BASELINE_CHANGELOG.md +24 -0
- package/dist/CHANGELOG.md +17 -0
- package/dist/baseline/scaffold-baseline/baseline.json +5 -5
- package/dist/baseline/scaffold-baseline/data/catalog/lint-assets.json +10 -4
- package/dist/baseline/scaffold-baseline/data/catalog/packs.json +0 -1
- package/dist/baseline/scaffold-baseline/data/catalog/skills.json +0 -8
- package/dist/baseline/scaffold-baseline/data/hooks/format-edited-file.mjs +602 -101
- package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.d.ts +11 -0
- package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.mjs +103 -0
- package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.test.ts +144 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/claude.mjs +1 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/codex.mjs +1 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/cursor.mjs +1 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/opencode.mjs +1 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/contract.ts +24 -33
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/core.mjs +4 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/core.test.ts +61 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/lint-feedback.test.ts +123 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/claude/actions.json +1 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/codex/actions.json +2 -1
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/cursor/projection.json +1 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/opencode/projection.json +1 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/SKILL.md +2 -2
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/SKILL.md +32 -32
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +7 -7
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/readiness.md +14 -13
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +26 -19
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/SKILL.md +2 -2
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/scripts/autoreview +3 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/brainstorm/SKILL.md +12 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +2 -1
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/EXAMPLES.md +9 -9
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/REFERENCE.md +43 -55
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/SKILL.md +68 -63
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +26 -29
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/story-shape.md +5 -5
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +1 -1
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +2 -2
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +1 -1
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +2 -2
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/business-projection.md +19 -24
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/delivery-status.md +17 -13
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/fog-intake.md +45 -48
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/functional-projection.md +16 -21
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/normalization.md +14 -14
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/project-context.md +32 -27
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/providers/github.md +105 -150
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/providers/linear.md +111 -181
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/references/technical-projection.md +51 -47
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/scripts/validate-task-blocker-graph.mjs +49 -35
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md +1 -1
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-update-insights/references/update-insights-schema.md +2 -6
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/SKILL.md +6 -7
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-best-practices/SKILL.md +1 -3
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-component/SKILL.md +2 -14
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/best-practices.md +7 -1
- package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/devtools-setup.tsx +4 -0
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/best-practices.md +7 -1
- package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/devtools-setup.tsx +4 -0
- package/dist/baseline/scaffold-baseline/skills/languages/typescript/quality-types/SKILL.md +1 -3
- package/dist/baseline/scaffold-baseline/skills/phases/business-finder/SKILL.md +29 -16
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +10 -8
- package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/backlog.md +26 -17
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/AUTHORING-HANDOFF.md +51 -261
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/SKILL.md +22 -25
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/ensure-fog.md +13 -23
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/grilling.md +40 -0
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/handback.md +11 -18
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/prototype.md +13 -21
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/reconcile.md +21 -35
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/research.md +13 -18
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/return-target.md +14 -25
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/router.md +22 -56
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/entrypoint-contract.md +25 -26
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/root-routing.md +12 -20
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/runtime-handoff.md +17 -39
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/state-graph.md +27 -49
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/scripts/finder-contract.mjs +40 -359
- package/dist/baseline/scaffold-baseline/skills/phases/functional-finder/SKILL.md +29 -62
- package/dist/baseline/scaffold-baseline/skills/phases/requirements-phase/SKILL.md +49 -13
- package/dist/baseline/scaffold-baseline.json +5 -5
- package/dist/baseline/scaffold-baseline.tgz +0 -0
- package/dist/data/hooks/format-edited-file.d.mts +21 -0
- package/dist/data/hooks/format-edited-file.mjs +588 -98
- package/dist/data/scripts/commit-gate-runner.mjs +103 -0
- package/dist/data/scripts/harness-projection/adapters/claude.mjs +1 -0
- package/dist/data/scripts/harness-projection/adapters/codex.mjs +1 -0
- package/dist/data/scripts/harness-projection/adapters/cursor.mjs +1 -0
- package/dist/data/scripts/harness-projection/adapters/opencode.mjs +1 -0
- package/dist/data/scripts/harness-projection/core.mjs +4 -0
- package/dist/data/scripts/harness-projection/test-fixtures/claude/actions.json +1 -0
- package/dist/data/scripts/harness-projection/test-fixtures/codex/actions.json +2 -1
- package/dist/data/scripts/harness-projection/test-fixtures/cursor/projection.json +1 -0
- package/dist/data/scripts/harness-projection/test-fixtures/opencode/projection.json +1 -0
- package/dist/index.js +73 -58
- package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +2 -2
- package/dist/skills/agnostic/planning/create-spec/SKILL.md +32 -32
- package/dist/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +7 -7
- package/dist/skills/agnostic/planning/create-spec/references/readiness.md +14 -13
- package/dist/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +26 -19
- package/dist/skills/agnostic/quality/autoreview/SKILL.md +2 -2
- package/dist/skills/agnostic/quality/autoreview/scripts/autoreview +3 -0
- package/dist/skills/agnostic/requirements/brainstorm/SKILL.md +12 -0
- package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +2 -1
- package/dist/skills/agnostic/requirements/write-backlog/EXAMPLES.md +9 -9
- package/dist/skills/agnostic/requirements/write-backlog/REFERENCE.md +43 -55
- package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +68 -63
- package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +26 -29
- package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/story-shape.md +5 -5
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +1 -1
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +2 -2
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +1 -1
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +2 -2
- package/dist/skills/agnostic/requirements/write-backlog/references/business-projection.md +19 -24
- package/dist/skills/agnostic/requirements/write-backlog/references/delivery-status.md +17 -13
- package/dist/skills/agnostic/requirements/write-backlog/references/fog-intake.md +45 -48
- package/dist/skills/agnostic/requirements/write-backlog/references/functional-projection.md +16 -21
- package/dist/skills/agnostic/requirements/write-backlog/references/normalization.md +14 -14
- package/dist/skills/agnostic/requirements/write-backlog/references/project-context.md +32 -27
- package/dist/skills/agnostic/requirements/write-backlog/references/providers/github.md +97 -142
- package/dist/skills/agnostic/requirements/write-backlog/references/providers/linear.md +106 -176
- package/dist/skills/agnostic/requirements/write-backlog/references/technical-projection.md +51 -47
- package/dist/skills/agnostic/requirements/write-backlog/scripts/validate-task-blocker-graph.mjs +55 -31
- package/dist/skills/phases/business-finder/SKILL.md +29 -16
- package/dist/skills/phases/delivery-phase/phases/router.md +10 -8
- package/dist/skills/phases/design-phase/phases/backlog.md +26 -17
- package/dist/skills/phases/finder-phase/AUTHORING-HANDOFF.md +51 -261
- package/dist/skills/phases/finder-phase/SKILL.md +22 -25
- package/dist/skills/phases/finder-phase/phases/ensure-fog.md +13 -23
- package/dist/skills/phases/finder-phase/phases/grilling.md +40 -0
- package/dist/skills/phases/finder-phase/phases/handback.md +11 -18
- package/dist/skills/phases/finder-phase/phases/prototype.md +13 -21
- package/dist/skills/phases/finder-phase/phases/reconcile.md +21 -35
- package/dist/skills/phases/finder-phase/phases/research.md +13 -18
- package/dist/skills/phases/finder-phase/phases/return-target.md +14 -25
- package/dist/skills/phases/finder-phase/phases/router.md +22 -56
- package/dist/skills/phases/finder-phase/references/entrypoint-contract.md +25 -26
- package/dist/skills/phases/finder-phase/references/root-routing.md +12 -20
- package/dist/skills/phases/finder-phase/references/runtime-handoff.md +17 -39
- package/dist/skills/phases/finder-phase/references/state-graph.md +27 -49
- package/dist/skills/phases/finder-phase/scripts/finder-contract.mjs +44 -357
- package/dist/skills/phases/functional-finder/SKILL.md +29 -62
- package/dist/skills/phases/requirements-phase/SKILL.md +49 -13
- package/package.json +7 -5
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/adopt-business-path.md +0 -52
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/business-grilling.md +0 -68
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/functional-grilling.md +0 -53
- package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/technical-grilling.md +0 -67
- package/dist/baseline/scaffold-baseline/skills/phases/technical-finder/SKILL.md +0 -74
- package/dist/baseline/scaffold-baseline/skills/phases/technical-finder/agents/openai.yaml +0 -2
- package/dist/skills/phases/finder-phase/phases/adopt-business-path.md +0 -52
- package/dist/skills/phases/finder-phase/phases/business-grilling.md +0 -68
- package/dist/skills/phases/finder-phase/phases/functional-grilling.md +0 -53
- package/dist/skills/phases/finder-phase/phases/technical-grilling.md +0 -67
- package/dist/skills/phases/technical-finder/SKILL.md +0 -74
- package/dist/skills/phases/technical-finder/agents/openai.yaml +0 -2
|
@@ -1,60 +1,38 @@
|
|
|
1
1
|
# Finder State Graph
|
|
2
2
|
|
|
3
|
-
## Evidence
|
|
3
|
+
## Evidence authority
|
|
4
4
|
|
|
5
|
-
1. Current direct provider,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
1. Current direct evidence: exact provider objects, relations, immutable
|
|
6
|
+
evidence, and the human's current decision.
|
|
7
|
+
2. Fresh workflow-native artifacts within the current Fog scope.
|
|
8
|
+
3. A committed runtime handoff consistent with current evidence.
|
|
9
|
+
4. A suggested route, which is advisory only.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
Stale, out-of-scope, ambiguous, or conflicting evidence satisfies no positive
|
|
12
|
+
guard. Recompute from this order on every entry and cold resume.
|
|
12
13
|
|
|
13
14
|
## Topology
|
|
14
15
|
|
|
15
16
|
```text
|
|
16
17
|
ensure-fog
|
|
17
|
-
->
|
|
18
|
-
-> reconcile
|
|
19
|
-
-> return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
->
|
|
23
|
-
-> technical-grilling per Story <-> research | prototype
|
|
24
|
-
-> reconcile
|
|
25
|
-
-> return-target [Technical]
|
|
26
|
-
|
|
27
|
-
any identity or authority conflict -> handback -> human_steering_required
|
|
28
|
-
scope boundary expansion -> scope-expansion-checkpoint -> router re-entry
|
|
18
|
+
-> grilling <-> research | prototype
|
|
19
|
+
-> optional reconcile
|
|
20
|
+
-> bounded return
|
|
21
|
+
|
|
22
|
+
identity, lens, selection, or ceiling conflict
|
|
23
|
+
-> handback -> human_steering_required
|
|
29
24
|
```
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
child identity; immutable resolution pointer; supported-by relations; intended
|
|
45
|
-
semantic projection; and exact provider readback. Accepted state without an
|
|
46
|
-
exact child identity or immutable pointer is an authority conflict. Business
|
|
47
|
-
completion requires exactly one valid Business child from the fresh complete
|
|
48
|
-
direct-child collection and exact Product Area -> Initiative -> Epic identity
|
|
49
|
-
and hierarchy readback. Functional completion requires each Story's exact
|
|
50
|
-
parent Epic, contextual `V*` milestone membership, and Fog/source links. Every
|
|
51
|
-
selected Technical Story must equal the distinct projected Story of one
|
|
52
|
-
selected accepted Functional child. Technical completion also requires every
|
|
53
|
-
Task to retain its Story milestone and the exact successful result of
|
|
54
|
-
`write-backlog`'s provider-neutral validator over the full reachable Task
|
|
55
|
-
graph, resolved milestone order, and current provider snapshot. The result must
|
|
56
|
-
cover every projected Task and outgoing edge. It rejects future-iteration,
|
|
57
|
-
self, missing-target, duplicate, and cyclic edges while preserving valid
|
|
58
|
-
same-or-earlier-milestone blockers across Stories and Epics. Invalid stage
|
|
59
|
-
evidence routes to that stage again. Accepted evidence without readback routes
|
|
60
|
-
to reconciliation.
|
|
26
|
+
One Fog retains its immutable original Business or Functional intake lens.
|
|
27
|
+
Generic Grilling children have no fixed count and no staged ordering. Research
|
|
28
|
+
and Prototype are direct Fog children linked to the Grilling child they support.
|
|
29
|
+
|
|
30
|
+
The wrapper decides whether optional structure is useful and supplies the
|
|
31
|
+
ceiling. Business permits Product Area and Initiative. Functional permits that
|
|
32
|
+
Business structure plus Epic. Missing or unresolved optional projection never
|
|
33
|
+
invalidates an otherwise valid Fog return.
|
|
34
|
+
|
|
35
|
+
Historical Business, Functional, or Technical Stage fields remain read-only
|
|
36
|
+
compatibility evidence and are not a current gate, prerequisite, or migration
|
|
37
|
+
trigger. On bounded return the Fog remains open; delivery evidence owns later
|
|
38
|
+
completion truth.
|
|
@@ -1,383 +1,70 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const isStableIdentity = (value) => typeof value === "string" && value.trim().length > 0;
|
|
1
|
+
const LENSES = ["Business", "Functional"];
|
|
2
|
+
const CONFLICTS = ["ambiguous", "conflict", "duplicate"];
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
isStableIdentity(child.projectedInitiative) &&
|
|
8
|
-
isStableIdentity(child.projectedEpic) &&
|
|
9
|
-
child.hierarchyReadback === "exact";
|
|
4
|
+
const conflicts = (value) => CONFLICTS.includes(value);
|
|
5
|
+
const stable = (value) => typeof value === "string" && value.trim().length > 0;
|
|
10
6
|
|
|
11
|
-
const
|
|
12
|
-
if (!Array.isArray(children)) return
|
|
13
|
-
|
|
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();
|
|
7
|
+
const childConflict = (children) => {
|
|
8
|
+
if (!Array.isArray(children)) return true;
|
|
9
|
+
const ids = new Set();
|
|
49
10
|
for (const child of children) {
|
|
50
|
-
if (!child ||
|
|
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
|
-
) {
|
|
11
|
+
if (!child || child.identity !== "exact" || !stable(child.id) || ids.has(child.id)) {
|
|
83
12
|
return true;
|
|
84
13
|
}
|
|
85
|
-
|
|
86
|
-
stories.add(child.projectedStory);
|
|
14
|
+
ids.add(child.id);
|
|
87
15
|
}
|
|
88
16
|
return false;
|
|
89
17
|
};
|
|
90
18
|
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
);
|
|
19
|
+
export const deriveFinderRoute = (state) => {
|
|
20
|
+
if (!LENSES.includes(state.targetLens)) return "human-steering";
|
|
21
|
+
if (state.humanSteering === "required") return "human-steering";
|
|
22
|
+
if (conflicts(state.fogIdentity)) return "human-steering";
|
|
23
|
+
if (state.fogIdentity !== "exact") return "ensure-fog";
|
|
24
|
+
if (!LENSES.includes(state.intakeLens)) return "human-steering";
|
|
264
25
|
|
|
26
|
+
if (childConflict(state.grillingChildren)) return "human-steering";
|
|
27
|
+
if (state.selection?.decision === "ambiguous") return "human-steering";
|
|
265
28
|
if (
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
29
|
+
state.selection?.decision === "reuse" &&
|
|
30
|
+
!state.grillingChildren?.some(
|
|
31
|
+
(child) => child.id === state.selection.childId,
|
|
269
32
|
)
|
|
270
33
|
) {
|
|
271
34
|
return "human-steering";
|
|
272
35
|
}
|
|
273
36
|
|
|
274
|
-
if (
|
|
275
|
-
|
|
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
|
-
) {
|
|
37
|
+
if (state.support?.decision === "ambiguous") return "human-steering";
|
|
38
|
+
if (["requested", "pending"].includes(state.support?.status)) {
|
|
289
39
|
return "human-steering";
|
|
290
40
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
(matches) =>
|
|
296
|
-
matches.length === 1 &&
|
|
297
|
-
matches[0].status === "accepted" &&
|
|
298
|
-
matches[0].scope === "in-scope",
|
|
41
|
+
if (state.support?.status === "unresolved") {
|
|
42
|
+
if (
|
|
43
|
+
!state.grillingChildren?.some(
|
|
44
|
+
(child) => child.id === state.support.supports,
|
|
299
45
|
)
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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)) {
|
|
46
|
+
) {
|
|
47
|
+
return "human-steering";
|
|
48
|
+
}
|
|
49
|
+
if (state.support.kind === "Research") return "research";
|
|
50
|
+
if (state.support.kind === "Prototype") return "prototype";
|
|
334
51
|
return "human-steering";
|
|
335
52
|
}
|
|
336
|
-
|
|
337
|
-
if (state.
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
return "business-grilling";
|
|
344
|
-
}
|
|
345
|
-
if (state.business !== "accepted") {
|
|
53
|
+
|
|
54
|
+
if (state.projection?.status === "ambiguous") return "human-steering";
|
|
55
|
+
if (["pending", "read-back"].includes(state.projection?.status)) {
|
|
56
|
+
const ceiling =
|
|
57
|
+
state.targetLens === "Business"
|
|
58
|
+
? new Set(["ProductArea", "Initiative"])
|
|
59
|
+
: new Set(["ProductArea", "Initiative", "Epic"]);
|
|
346
60
|
if (
|
|
347
|
-
state.
|
|
348
|
-
state.
|
|
349
|
-
state.businessPathIdentity === "exact" &&
|
|
350
|
-
state.businessPathDecision === "reuse-unchanged"
|
|
61
|
+
!Array.isArray(state.projection.kinds) ||
|
|
62
|
+
state.projection.kinds.some((kind) => !ceiling.has(kind))
|
|
351
63
|
) {
|
|
352
|
-
return "
|
|
64
|
+
return "human-steering";
|
|
353
65
|
}
|
|
354
|
-
return "business-grilling";
|
|
355
66
|
}
|
|
356
|
-
|
|
357
|
-
if (
|
|
358
|
-
|
|
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";
|
|
67
|
+
if (state.projection?.status === "pending") return "reconcile";
|
|
68
|
+
if (state.boundedResult === "ready") return "return-target";
|
|
69
|
+
return "grilling";
|
|
383
70
|
};
|
|
@@ -1,78 +1,45 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: functional-finder
|
|
3
|
-
description:
|
|
3
|
+
description: Develop uncertain product behavior nontechnically and optionally project structure through Epic.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Functional Finder
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Explicit human entrypoint for a functional colleague. It includes every
|
|
10
|
+
Business Finder capability and adds nontechnical product-behavior guidance.
|
|
11
|
+
It does not require Business Finder to have run first.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Intake profile
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- product context, constraints, dependencies, and milestone preference supplied
|
|
20
|
-
by the human
|
|
15
|
+
Capture the Business profile plus actor, trigger, workflow, observable result,
|
|
16
|
+
applicable domain rules, visible alternate and failure paths, acceptance
|
|
17
|
+
signals, boundaries, known product dependencies, technical handoff questions,
|
|
18
|
+
and target `V*` milestone context. Unknown values remain explicit.
|
|
21
19
|
|
|
22
|
-
|
|
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
|
|
20
|
+
This profile does not require architecture, APIs, data models, component
|
|
21
|
+
boundaries, code structure, Tasks, commands, workers, or implementation design.
|
|
41
22
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
23
|
+
Use `$wait-what` when terminology or behavior does not land. Use `$show-me` at
|
|
24
|
+
each decision about the observable workflow, an alternate or failure path, a
|
|
25
|
+
product dependency, milestone context, and final Epic projection. Presentation
|
|
26
|
+
informs the human and grants no mutation authority.
|
|
45
27
|
|
|
46
|
-
|
|
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.
|
|
28
|
+
## Composition
|
|
63
29
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
30
|
+
Compose [the shared Finder engine](../finder-phase/SKILL.md) with immutable
|
|
31
|
+
intake lens `Functional`, this presentation profile, and projection ceiling
|
|
32
|
+
`Epic`. The engine alone owns the Fog lifecycle, generic support work, resume
|
|
33
|
+
routing, and durable handoff.
|
|
67
34
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
35
|
+
Optional structure may reuse, enrich, or create Product Areas, Initiatives,
|
|
36
|
+
and Epics through `$write-backlog`. The ceiling is Epic: Functional Finder
|
|
37
|
+
never projects Stories or Tasks. Skipping projection, or returning an
|
|
38
|
+
unresolved projection, never blocks a valid Fog result.
|
|
71
39
|
|
|
72
|
-
##
|
|
40
|
+
## Bounded return
|
|
73
41
|
|
|
74
|
-
Return the exact Fog identity,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
durable Finder handoff. Stop at the engine's `target_depth_reached` outcome.
|
|
42
|
+
Return the exact Fog identity, immutable Functional intake lens, generic
|
|
43
|
+
support work and evidence, optional exact Product Area, Initiative, and Epic
|
|
44
|
+
readback, unresolved decisions, and durable Finder handoff. Return control
|
|
45
|
+
without asserting that the Fog is resolved or complete.
|