@punks/cli 4.0.1 → 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 +34 -0
- package/dist/CHANGELOG.md +24 -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 +2 -3
- package/dist/baseline/scaffold-baseline/data/catalog/skills.json +8 -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/research/parallel-research/DURABLE-REPORT.md +5 -12
- package/dist/baseline/scaffold-baseline/skills/agnostic/research/parallel-research/SKILL.md +7 -8
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/SKILL.md +97 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/agents/openai.yaml +4 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/references/infrastructure-deployment.md +29 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/security/architect-pipeline/references/security-by-design.md +22 -0
- 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/provider-upgrade/SKILL.md +10 -7
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-best-practices/SKILL.md +19 -53
- package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-component/SKILL.md +36 -88
- 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/agnostic/research/parallel-research/DURABLE-REPORT.md +5 -12
- package/dist/skills/agnostic/research/parallel-research/SKILL.md +7 -8
- package/dist/skills/agnostic/security/architect-pipeline/SKILL.md +97 -0
- package/dist/skills/agnostic/security/architect-pipeline/agents/openai.yaml +4 -0
- package/dist/skills/agnostic/security/architect-pipeline/references/infrastructure-deployment.md +29 -0
- package/dist/skills/agnostic/security/architect-pipeline/references/security-by-design.md +22 -0
- package/dist/skills/frameworks/pulumi/provider-upgrade/SKILL.md +10 -7
- package/dist/skills/frameworks/pulumi/pulumi-best-practices/SKILL.md +10 -42
- package/dist/skills/frameworks/pulumi/pulumi-component/SKILL.md +18 -58
- 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
package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/runtime-handoff.md
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
# Runtime Handoff
|
|
2
2
|
|
|
3
3
|
Store the current record at
|
|
4
|
-
`.devpunks/finder-phase/handoffs/<durable-wiki-fog-id>.md`.
|
|
5
|
-
|
|
6
|
-
After exact provider readback, add the stable provider Fog identity without
|
|
7
|
-
replacing the wiki identity.
|
|
4
|
+
`.devpunks/finder-phase/handoffs/<durable-wiki-fog-id>.md`. Allocate the durable
|
|
5
|
+
wiki identity once before provider creation and retain it across retries.
|
|
8
6
|
|
|
9
7
|
```text
|
|
10
8
|
Phase:
|
|
@@ -17,46 +15,26 @@ UI Evidence:
|
|
|
17
15
|
Next suggested route:
|
|
18
16
|
Blockers:
|
|
19
17
|
Resume identity:
|
|
20
|
-
|
|
21
|
-
Finder target depth:
|
|
22
18
|
Durable wiki Fog identity:
|
|
23
19
|
Provider Fog identity:
|
|
24
20
|
Provider snapshot identity:
|
|
21
|
+
Immutable original intake lens:
|
|
25
22
|
Selected gate or outcome:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Intended projection:
|
|
31
|
-
Exact readback
|
|
32
|
-
|
|
33
|
-
Functional Story placement readback:
|
|
34
|
-
Technical Task graph readback:
|
|
35
|
-
Technical Task graph validator result:
|
|
36
|
-
Support evidence:
|
|
37
|
-
Checkpoint or blocker:
|
|
23
|
+
Generic Grilling child identities:
|
|
24
|
+
Support child identities and supported-child relations:
|
|
25
|
+
Immutable evidence or verdict pointers:
|
|
26
|
+
Projection ceiling:
|
|
27
|
+
Intended optional projection:
|
|
28
|
+
Exact optional projection readback:
|
|
29
|
+
Unresolved decisions:
|
|
38
30
|
Last verified at:
|
|
39
31
|
```
|
|
40
32
|
|
|
41
|
-
Discover by exact durable wiki or provider Fog identity. Conflicting
|
|
42
|
-
records for one identity
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
`Finder state` is the workflow-specific domain-state field. `UI Evidence` is
|
|
46
|
-
optional and records any retained `$show-me` artifact. `Next suggested route`
|
|
47
|
-
is advisory.
|
|
48
|
-
|
|
49
|
-
Each gate updates only fields it proves. Preserve prior exact identities and
|
|
50
|
-
immutable pointers. Record checkpoint, blocked, skip, target-return, and
|
|
51
|
-
`human_steering_required` outcomes before stopping.
|
|
33
|
+
Discover the handoff by exact durable wiki or provider Fog identity. Conflicting
|
|
34
|
+
valid records for one identity route to `human_steering_required`. Current
|
|
35
|
+
evidence may supersede `Next suggested route`.
|
|
52
36
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
each Task, its parent Story, the same `V*` milestone as that Story, and the exact
|
|
58
|
-
provider snapshot. Technical Task graph validator result preserves the
|
|
59
|
-
successful `write-backlog/validate-task-blocker-graph` result over every
|
|
60
|
-
reachable Story and Task, the resolved milestone-order readback, and its bound
|
|
61
|
-
provider snapshot identity. It covers every returned Task and outgoing edge;
|
|
62
|
-
connected blockers may live under other Stories or Epics.
|
|
37
|
+
Each gate updates only the fields it proves. Preserve prior exact identities,
|
|
38
|
+
the immutable original intake lens, and retained evidence pointers. Record every
|
|
39
|
+
blocked, skipped, checkpoint, bounded-return, and human-steering outcome before
|
|
40
|
+
stopping.
|
package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/state-graph.md
CHANGED
|
@@ -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.
|
package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/scripts/finder-contract.mjs
CHANGED
|
@@ -1,383 +1,64 @@
|
|
|
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
|
-
);
|
|
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
|
-
}
|
|
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";
|
|
273
25
|
|
|
26
|
+
if (childConflict(state.grillingChildren)) return "human-steering";
|
|
27
|
+
if (state.selection?.decision === "ambiguous") return "human-steering";
|
|
274
28
|
if (
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
)
|
|
29
|
+
state.selection?.decision === "reuse" &&
|
|
30
|
+
!state.grillingChildren?.some((child) => child.id === state.selection.childId)
|
|
288
31
|
) {
|
|
289
32
|
return "human-steering";
|
|
290
33
|
}
|
|
291
34
|
|
|
292
|
-
if (
|
|
293
|
-
|
|
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
|
-
) {
|
|
35
|
+
if (state.support?.decision === "ambiguous") return "human-steering";
|
|
36
|
+
if (["requested", "pending"].includes(state.support?.status)) {
|
|
330
37
|
return "human-steering";
|
|
331
38
|
}
|
|
332
|
-
if (state.
|
|
333
|
-
|
|
39
|
+
if (state.support?.status === "unresolved") {
|
|
40
|
+
if (!state.grillingChildren?.some((child) => child.id === state.support.supports)) {
|
|
41
|
+
return "human-steering";
|
|
42
|
+
}
|
|
43
|
+
if (state.support.kind === "Research") return "research";
|
|
44
|
+
if (state.support.kind === "Prototype") return "prototype";
|
|
334
45
|
return "human-steering";
|
|
335
46
|
}
|
|
336
|
-
|
|
337
|
-
if (state.
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
return "business-grilling";
|
|
344
|
-
}
|
|
345
|
-
if (state.business !== "accepted") {
|
|
47
|
+
|
|
48
|
+
if (state.projection?.status === "ambiguous") return "human-steering";
|
|
49
|
+
if (["pending", "read-back"].includes(state.projection?.status)) {
|
|
50
|
+
const ceiling =
|
|
51
|
+
state.targetLens === "Business"
|
|
52
|
+
? new Set(["ProductArea", "Initiative"])
|
|
53
|
+
: new Set(["ProductArea", "Initiative", "Epic"]);
|
|
346
54
|
if (
|
|
347
|
-
state.
|
|
348
|
-
state.
|
|
349
|
-
state.businessPathIdentity === "exact" &&
|
|
350
|
-
state.businessPathDecision === "reuse-unchanged"
|
|
55
|
+
!Array.isArray(state.projection.kinds) ||
|
|
56
|
+
state.projection.kinds.some((kind) => !ceiling.has(kind))
|
|
351
57
|
) {
|
|
352
|
-
return "
|
|
58
|
+
return "human-steering";
|
|
353
59
|
}
|
|
354
|
-
return "business-grilling";
|
|
355
60
|
}
|
|
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";
|
|
61
|
+
if (state.projection?.status === "pending") return "reconcile";
|
|
62
|
+
if (state.boundedResult === "ready") return "return-target";
|
|
63
|
+
return "grilling";
|
|
383
64
|
};
|