mandrel 1.59.0 → 1.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/README.md +14 -14
- package/.agents/docs/SDLC.md +129 -134
- package/.agents/docs/configuration.md +16 -16
- package/.agents/docs/workflows.md +6 -8
- package/.agents/instructions.md +12 -11
- package/.agents/personas/architect.md +1 -1
- package/.agents/personas/product.md +1 -1
- package/.agents/personas/project-manager.md +14 -14
- package/.agents/personas/technical-writer.md +1 -1
- package/.agents/rules/changelog-style.md +5 -5
- package/.agents/rules/git-conventions.md +3 -3
- package/.agents/schemas/agentrc.schema.json +3 -3
- package/.agents/schemas/dispatch-manifest.json +4 -4
- package/.agents/schemas/epic-spec.schema.json +15 -45
- package/.agents/schemas/lifecycle/README.md +1 -1
- package/.agents/schemas/lifecycle/story.dispatch.end.schema.json +1 -1
- package/.agents/schemas/lifecycle/story.dispatch.start.schema.json +1 -1
- package/.agents/schemas/lifecycle/story.heartbeat.schema.json +1 -1
- package/.agents/schemas/validation-evidence.schema.json +1 -1
- package/.agents/scripts/README.md +1 -1
- package/.agents/scripts/acceptance-eval.js +1 -1
- package/.agents/scripts/acceptance-spec-reconciler.js +2 -2
- package/.agents/scripts/analyze-execution.js +2 -2
- package/.agents/scripts/audit-to-stories.js +1 -1
- package/.agents/scripts/check-doc-links.js +2 -3
- package/.agents/scripts/diagnose-friction.js +1 -1
- package/.agents/scripts/dispatcher.js +2 -2
- package/.agents/scripts/drain-pending-cleanup.js +1 -1
- package/.agents/scripts/epic-audit-prepare.js +3 -3
- package/.agents/scripts/epic-deliver-note-intervention.js +2 -2
- package/.agents/scripts/epic-deliver-preflight.js +6 -6
- package/.agents/scripts/epic-deliver-prepare.js +1 -1
- package/.agents/scripts/epic-execute-record-wave.js +4 -4
- package/.agents/scripts/epic-plan-healthcheck.js +6 -10
- package/.agents/scripts/epic-plan-spec-validate.js +1 -1
- package/.agents/scripts/epic-reconcile.js +11 -29
- package/.agents/scripts/evidence-gate.js +1 -1
- package/.agents/scripts/generate-workflows-doc.js +1 -1
- package/.agents/scripts/hierarchy-gate.js +7 -11
- package/.agents/scripts/lib/ITicketingProvider.js +1 -1
- package/.agents/scripts/lib/audit-suite/selector.js +1 -1
- package/.agents/scripts/lib/audit-to-stories/seed-epic-from-findings.js +2 -2
- package/.agents/scripts/lib/baseline-snapshot.js +7 -7
- package/.agents/scripts/lib/bdd-runner-detect.js +1 -1
- package/.agents/scripts/lib/bdd-scenario-scanner.js +3 -3
- package/.agents/scripts/lib/bootstrap/baselines-layout-migration.js +1 -1
- package/.agents/scripts/lib/bootstrap/branch-protection.js +1 -1
- package/.agents/scripts/lib/bootstrap/ci-workflow-template.js +1 -1
- package/.agents/scripts/lib/bootstrap/commit-push.js +2 -2
- package/.agents/scripts/lib/codebase-snapshot.js +1 -1
- package/.agents/scripts/lib/config/explain.js +1 -1
- package/.agents/scripts/lib/config/runners.js +2 -2
- package/.agents/scripts/lib/config/runtime.js +1 -1
- package/.agents/scripts/lib/config/temp-paths.js +2 -2
- package/.agents/scripts/lib/config-settings-schema-delivery.js +2 -2
- package/.agents/scripts/lib/config-settings-schema-quality.js +1 -1
- package/.agents/scripts/lib/config-settings-schema.js +3 -3
- package/.agents/scripts/lib/duplicate-search.js +1 -1
- package/.agents/scripts/lib/dynamic-workflow/capability.js +1 -1
- package/.agents/scripts/lib/epic-plan-clarity.js +1 -1
- package/.agents/scripts/lib/epic-plan-ideation.js +1 -1
- package/.agents/scripts/lib/feedback-loop/memory-freshness.js +1 -1
- package/.agents/scripts/lib/feedback-loop/prior-feedback-fetcher.js +1 -1
- package/.agents/scripts/lib/findings/classify-finding.js +1 -1
- package/.agents/scripts/lib/findings/promote-finding.js +10 -10
- package/.agents/scripts/lib/label-constants.js +3 -4
- package/.agents/scripts/lib/label-taxonomy.js +3 -8
- package/.agents/scripts/lib/orchestration/acceptance-eval-decision.js +1 -1
- package/.agents/scripts/lib/orchestration/code-review.js +5 -5
- package/.agents/scripts/lib/orchestration/context-hydration-engine.js +8 -9
- package/.agents/scripts/lib/orchestration/dependency-analyzer.js +3 -3
- package/.agents/scripts/lib/orchestration/detectors-phase.js +2 -2
- package/.agents/scripts/lib/orchestration/dispatch-engine.js +30 -38
- package/.agents/scripts/lib/orchestration/dispatch-pipeline.js +9 -25
- package/.agents/scripts/lib/orchestration/epic-cleanup.js +1 -1
- package/.agents/scripts/lib/orchestration/epic-deliver-lease-guard.js +8 -8
- package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/creation.js +1 -1
- package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/dag.js +7 -21
- package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/diagnostics.js +3 -3
- package/.agents/scripts/lib/orchestration/epic-plan-lease-guard.js +26 -13
- package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/plan-epic.js +1 -1
- package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/prompts.js +1 -1
- package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/run-spec-phase.js +2 -2
- package/.agents/scripts/lib/orchestration/epic-plan-state-store.js +1 -1
- package/.agents/scripts/lib/orchestration/epic-run-state-store.js +3 -3
- package/.agents/scripts/lib/orchestration/epic-runner/concurrency-gate.js +4 -4
- package/.agents/scripts/lib/orchestration/epic-runner/deliver-phases.js +3 -3
- package/.agents/scripts/lib/orchestration/epic-runner/phases/build-wave-dag.js +6 -21
- package/.agents/scripts/lib/orchestration/epic-runner/phases/snapshot.js +7 -7
- package/.agents/scripts/lib/orchestration/epic-runner/progress-reporter/composition.js +1 -1
- package/.agents/scripts/lib/orchestration/epic-runner/progress-reporter/signals.js +2 -2
- package/.agents/scripts/lib/orchestration/epic-runner/progress-reporter/transport.js +4 -4
- package/.agents/scripts/lib/orchestration/epic-runner/story-launcher.js +4 -4
- package/.agents/scripts/lib/orchestration/epic-runner/story-run-progress-writer.js +8 -8
- package/.agents/scripts/lib/orchestration/epic-runner/sub-agent-return.js +4 -4
- package/.agents/scripts/lib/orchestration/epic-spec-reconciler-apply.js +7 -15
- package/.agents/scripts/lib/orchestration/epic-spec-reconciler-diff.js +72 -41
- package/.agents/scripts/lib/orchestration/epic-spec-reconciler-ops.js +2 -4
- package/.agents/scripts/lib/orchestration/file-assumptions.js +2 -2
- package/.agents/scripts/lib/orchestration/finalize/close-planning-tickets.js +1 -1
- package/.agents/scripts/lib/orchestration/finalize/open-or-locate-pr.js +2 -2
- package/.agents/scripts/lib/orchestration/finalize/sanitize-skip-ci.js +1 -1
- package/.agents/scripts/lib/orchestration/lease-guard-shared.js +3 -3
- package/.agents/scripts/lib/orchestration/lifecycle/emit-story-dispatch-end.js +1 -1
- package/.agents/scripts/lib/orchestration/lifecycle/emit-story-heartbeat.js +1 -1
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/README.md +1 -1
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/automerge-armer.js +1 -1
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/automerge-predicate.js +1 -1
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/branch-cleaner.js +1 -1
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/finalizer.js +1 -1
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/index.js +1 -1
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/merge-watcher.js +1 -1
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/notify-dispatcher.js +1 -1
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/watcher.js +1 -1
- package/.agents/scripts/lib/orchestration/manifest-builder.js +5 -5
- package/.agents/scripts/lib/orchestration/parked-follow-ons.js +2 -2
- package/.agents/scripts/lib/orchestration/plan-runner/plan-router.js +5 -5
- package/.agents/scripts/lib/orchestration/post-merge/phases/ticket-closure.js +3 -3
- package/.agents/scripts/lib/orchestration/preflight-cache.js +1 -1
- package/.agents/scripts/lib/orchestration/recurring-failure-detector.js +1 -1
- package/.agents/scripts/lib/orchestration/retro/phases/compose-body.js +1 -1
- package/.agents/scripts/lib/orchestration/retro/phases/gather-signals.js +2 -2
- package/.agents/scripts/lib/orchestration/retro-runner.js +3 -3
- package/.agents/scripts/lib/orchestration/review-depth.js +1 -1
- package/.agents/scripts/lib/orchestration/single-story-close/phases/wrong-tree-guard.js +1 -1
- package/.agents/scripts/lib/orchestration/spec-freshness.js +1 -1
- package/.agents/scripts/lib/orchestration/spec-renderer.js +36 -73
- package/.agents/scripts/lib/orchestration/spec-section-validator.js +1 -1
- package/.agents/scripts/lib/orchestration/story-close/baseline-friction-body.js +1 -1
- package/.agents/scripts/lib/orchestration/story-close/phases/locked-pipeline.js +2 -2
- package/.agents/scripts/lib/orchestration/task-body-validator.js +6 -6
- package/.agents/scripts/lib/orchestration/ticket-lease.js +1 -1
- package/.agents/scripts/lib/orchestration/ticket-validator-conflicts.js +2 -2
- package/.agents/scripts/lib/orchestration/ticket-validator-sizing.js +1 -10
- package/.agents/scripts/lib/orchestration/ticket-validator.js +25 -70
- package/.agents/scripts/lib/orchestration/ticketing/bulk.js +5 -12
- package/.agents/scripts/lib/orchestration/ticketing/reads.js +8 -8
- package/.agents/scripts/lib/orchestration/ticketing/state.js +3 -3
- package/.agents/scripts/lib/orchestration/wave-record-notifications.js +2 -2
- package/.agents/scripts/lib/orchestration/wave-record-projection.js +1 -1
- package/.agents/scripts/lib/plan-phase-cleanup.js +1 -1
- package/.agents/scripts/lib/preflight-runner.js +1 -1
- package/.agents/scripts/lib/presentation/dispatch-manifest-render.js +4 -5
- package/.agents/scripts/lib/presentation/manifest-builder.js +28 -34
- package/.agents/scripts/lib/presentation/manifest-formatter.js +3 -4
- package/.agents/scripts/lib/presentation/manifest-helpers.js +1 -1
- package/.agents/scripts/lib/presentation/manifest-procedures.js +4 -4
- package/.agents/scripts/lib/presentation/manifest-render-waves.js +4 -23
- package/.agents/scripts/lib/presentation/manifest-renderer.js +1 -1
- package/.agents/scripts/lib/presentation/manifest-story-views.js +2 -11
- package/.agents/scripts/lib/signals/schema.js +1 -1
- package/.agents/scripts/lib/spec/index.js +1 -1
- package/.agents/scripts/lib/spec/loader.js +2 -2
- package/.agents/scripts/lib/spec/state.js +7 -16
- package/.agents/scripts/lib/story-init/context-resolver.js +3 -3
- package/.agents/scripts/lib/story-init/state-transitioner.js +2 -2
- package/.agents/scripts/lib/story-init/task-graph-builder.js +7 -7
- package/.agents/scripts/lib/story-lifecycle.js +8 -8
- package/.agents/scripts/lib/story-plan.js +1 -1
- package/.agents/scripts/lib/templates/decomposer-prompts.js +59 -52
- package/.agents/scripts/lib/wave-runner/tick.js +1 -1
- package/.agents/scripts/lifecycle-emit-story-dispatch.js +1 -1
- package/.agents/scripts/lifecycle-emit.js +1 -1
- package/.agents/scripts/providers/github/board-add.js +1 -1
- package/.agents/scripts/providers/github/errors.js +1 -1
- package/.agents/scripts/providers/github/mappers.js +2 -2
- package/.agents/scripts/providers/github/tickets.js +4 -4
- package/.agents/scripts/resync-status-column.js +1 -1
- package/.agents/scripts/retro-run.js +2 -2
- package/.agents/scripts/run-lint.js +1 -1
- package/.agents/scripts/single-story-init.js +1 -1
- package/.agents/scripts/stories-wave-tick.js +5 -5
- package/.agents/scripts/story-close.js +1 -1
- package/.agents/scripts/story-init.js +13 -16
- package/.agents/scripts/story-phase.js +5 -5
- package/.agents/scripts/story-plan.js +3 -3
- package/.agents/scripts/sync-branch-from-base.js +1 -1
- package/.agents/scripts/validate-docs-freshness.js +1 -1
- package/.agents/scripts/wave-tick.js +1 -1
- package/.agents/skills/core/analyze-execution/SKILL.md +2 -2
- package/.agents/skills/core/epic-plan-consolidate/SKILL.md +21 -26
- package/.agents/skills/core/epic-plan-decompose-author/SKILL.md +23 -56
- package/.agents/skills/core/epic-plan-spec-author/SKILL.md +4 -4
- package/.agents/skills/core/hydrate-context/SKILL.md +2 -2
- package/.agents/skills/core/idea-refinement/SKILL.md +4 -4
- package/.agents/skills/core/knowledge-transfer/SKILL.md +2 -2
- package/.agents/skills/core/planning-and-task-breakdown/SKILL.md +1 -1
- package/.agents/skills/core/scope-triage/SKILL.md +9 -10
- package/.agents/skills/core/using-agent-skills/SKILL.md +1 -1
- package/.agents/skills/skills.index.json +7 -7
- package/.agents/templates/agent-protocol.md +2 -2
- package/.agents/workflows/agents-update.md +2 -2
- package/.agents/workflows/audit-architecture.md +2 -2
- package/.agents/workflows/audit-clean-code.md +2 -2
- package/.agents/workflows/audit-dependencies.md +1 -1
- package/.agents/workflows/audit-devops.md +1 -1
- package/.agents/workflows/audit-documentation.md +2 -2
- package/.agents/workflows/audit-lighthouse.md +1 -1
- package/.agents/workflows/audit-performance.md +2 -2
- package/.agents/workflows/audit-privacy.md +1 -1
- package/.agents/workflows/audit-quality.md +2 -2
- package/.agents/workflows/audit-security.md +2 -2
- package/.agents/workflows/audit-seo.md +1 -1
- package/.agents/workflows/audit-sre.md +1 -1
- package/.agents/workflows/audit-to-stories.md +10 -10
- package/.agents/workflows/audit-ux-ui.md +1 -1
- package/.agents/workflows/deliver.md +85 -0
- package/.agents/workflows/explain.md +3 -3
- package/.agents/workflows/git-merge-pr.md +1 -1
- package/.agents/workflows/git-pr-all.md +13 -10
- package/.agents/workflows/git-push.md +6 -3
- package/.agents/workflows/helpers/_merge-conflict-template.md +1 -1
- package/.agents/workflows/helpers/acceptance-self-eval.md +1 -1
- package/.agents/workflows/helpers/code-review.md +5 -5
- package/.agents/workflows/{epic-deliver.md → helpers/deliver-epic.md} +43 -43
- package/.agents/workflows/{story-deliver.md → helpers/deliver-stories.md} +25 -25
- package/.agents/workflows/helpers/diagnose.md +1 -1
- package/.agents/workflows/helpers/epic-audit.md +6 -6
- package/.agents/workflows/helpers/epic-deliver-story.md +13 -13
- package/.agents/workflows/helpers/epic-plan-decompose.md +23 -23
- package/.agents/workflows/helpers/epic-plan-spec.md +6 -6
- package/.agents/workflows/helpers/epic-testing.md +3 -3
- package/.agents/workflows/helpers/parallel-tooling.md +1 -1
- package/.agents/workflows/{epic-plan.md → helpers/plan-epic.md} +84 -84
- package/.agents/workflows/{story-plan.md → helpers/plan-story.md} +43 -43
- package/.agents/workflows/helpers/signals.md +1 -1
- package/.agents/workflows/helpers/single-story-deliver.md +11 -11
- package/.agents/workflows/helpers/worktree-lifecycle.md +18 -18
- package/.agents/workflows/onboard.md +17 -17
- package/.agents/workflows/plan.md +89 -0
- package/.agents/workflows/qa-explore.md +1 -1
- package/.agents/workflows/qa-run-harness.md +1 -1
- package/README.md +4 -12
- package/docs/CHANGELOG.md +1149 -0
- package/lib/cli/__tests__/update-changelog-surface.test.js +357 -0
- package/lib/cli/__tests__/update-reexec.test.js +513 -0
- package/lib/cli/init.js +31 -29
- package/lib/cli/update.js +413 -52
- package/package.json +2 -1
- package/.agents/scripts/lib/orchestration/reconciler.js +0 -137
|
@@ -83,9 +83,7 @@ export function printStoryDispatchTable(storyManifest, opts = {}) {
|
|
|
83
83
|
const log = opts.logger?.log ?? ((line) => Logger.info(line));
|
|
84
84
|
if (!storyManifest || storyManifest.length === 0) return;
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
const stories = storyManifest.filter((s) => s.type !== 'feature');
|
|
88
|
-
const features = storyManifest.filter((s) => s.type === 'feature');
|
|
86
|
+
const stories = storyManifest;
|
|
89
87
|
|
|
90
88
|
log('\n┌─────────┬──────────────────────────────────────┬──────┐');
|
|
91
89
|
log('│ 📋 STORY DISPATCH TABLE │');
|
|
@@ -106,14 +104,7 @@ export function printStoryDispatchTable(storyManifest, opts = {}) {
|
|
|
106
104
|
log('└─────────┴──────────────────────────────────────┴──────┘');
|
|
107
105
|
log('');
|
|
108
106
|
log(' 💡 Stories in the same [Wave] can be executed in parallel.');
|
|
109
|
-
log(' 💡 Use /
|
|
107
|
+
log(' 💡 Use /deliver #[Story ID] to execute a Story.');
|
|
110
108
|
|
|
111
|
-
if (features.length > 0) {
|
|
112
|
-
log('');
|
|
113
|
-
log(' 📦 Feature Containers (not directly executable):');
|
|
114
|
-
for (const f of features) {
|
|
115
|
-
log(` #${f.storyId} — ${f.storySlug}`);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
109
|
log('');
|
|
119
110
|
}
|
|
@@ -98,7 +98,7 @@ export const EVENT_KINDS = Object.freeze({
|
|
|
98
98
|
// Story #3819 — per-criterion acceptance self-eval signal emitted by
|
|
99
99
|
// acceptance-eval.js. One record per Story per eval-loop terminus,
|
|
100
100
|
// carrying which acceptance items needed rework and the round count, so
|
|
101
|
-
// the retro and /
|
|
101
|
+
// the retro and /plan Phase 0 feedback fetch can see acceptance
|
|
102
102
|
// churn alongside friction/hotspot data.
|
|
103
103
|
ACCEPTANCE_EVAL: 'acceptance-eval',
|
|
104
104
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* lib/spec/index.js — public surface for the spec I/O module.
|
|
3
3
|
*
|
|
4
4
|
* Re-exports the loader (and, in Wave 1, future spec utilities) so
|
|
5
|
-
* downstream consumers — the reconciler, the rewritten /
|
|
5
|
+
* downstream consumers — the reconciler, the rewritten /plan, the
|
|
6
6
|
* wave-runner — can `import * from '../lib/spec/index.js'` without
|
|
7
7
|
* reaching into individual submodules.
|
|
8
8
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - `temp/epic-<epic-id>/<epic-id>.state.json` — slug→issue mapping (observed)
|
|
9
9
|
*
|
|
10
10
|
* Both files live under the per-Epic ephemeral tree `temp/epic-<id>/`
|
|
11
|
-
* (already gitignored) so /
|
|
11
|
+
* (already gitignored) so /plan reruns don't churn a tracked path
|
|
12
12
|
* and so concurrent Epics never collide on a single shared directory.
|
|
13
13
|
* Tests inject `opts.epicsDir` to point at a sandbox; the default for
|
|
14
14
|
* production callers is derived from `lib/config/temp-paths.js#epicTempDir`.
|
|
@@ -382,7 +382,7 @@ export function writeState(epicId, state, opts = {}) {
|
|
|
382
382
|
* the schema from the file itself.
|
|
383
383
|
*
|
|
384
384
|
* Story #1498 / Task #1525 introduced this writer so the rewritten
|
|
385
|
-
* `/
|
|
385
|
+
* `/plan` halves can persist the spec from the decomposer's
|
|
386
386
|
* ticket-array projection (`renderSpec`) without reaching into raw
|
|
387
387
|
* `js-yaml` calls scattered across the planning scripts.
|
|
388
388
|
*
|
|
@@ -108,7 +108,7 @@ export function sha256Hex(input) {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
|
-
* Hash a spec entry (a
|
|
111
|
+
* Hash a spec entry (a Story object) deterministically.
|
|
112
112
|
* The entry is canonicalised (recursive key-sort), serialised, and
|
|
113
113
|
* sha256'd. Equivalent entries (any key order, equivalent nested order
|
|
114
114
|
* for the object-valued fields) hash to the same digest.
|
|
@@ -126,10 +126,9 @@ export function hashSpecEntry(entry) {
|
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
128
|
* Iterate every slug-bearing entity in the spec. Yields tuples of
|
|
129
|
-
* `[slug, entry]` where `entry` is the raw object as authored in
|
|
130
|
-
* spec
|
|
131
|
-
*
|
|
132
|
-
* mapping iteration.
|
|
129
|
+
* `[slug, entry]` where `entry` is the raw Story object as authored in
|
|
130
|
+
* the spec. Order follows `spec.stories[]` — the natural read order,
|
|
131
|
+
* useful for deterministic mapping iteration.
|
|
133
132
|
*
|
|
134
133
|
* Exported for tests; the reconciler diff path uses `projectMapping`
|
|
135
134
|
* (below) rather than this generator directly.
|
|
@@ -138,17 +137,9 @@ export function hashSpecEntry(entry) {
|
|
|
138
137
|
* @returns {Generator<[string, object]>}
|
|
139
138
|
*/
|
|
140
139
|
export function* iterSpecEntries(spec) {
|
|
141
|
-
if (!spec || !Array.isArray(spec.
|
|
142
|
-
for (const
|
|
143
|
-
if (
|
|
144
|
-
if (!Array.isArray(feature?.stories)) continue;
|
|
145
|
-
for (const story of feature.stories) {
|
|
146
|
-
if (story?.slug) yield [story.slug, story];
|
|
147
|
-
if (!Array.isArray(story?.tasks)) continue;
|
|
148
|
-
for (const task of story.tasks) {
|
|
149
|
-
if (task?.slug) yield [task.slug, task];
|
|
150
|
-
}
|
|
151
|
-
}
|
|
140
|
+
if (!spec || !Array.isArray(spec.stories)) return;
|
|
141
|
+
for (const story of spec.stories) {
|
|
142
|
+
if (story?.slug) yield [story.slug, story];
|
|
152
143
|
}
|
|
153
144
|
}
|
|
154
145
|
|
|
@@ -21,7 +21,7 @@ import { resolveStoryHierarchy } from '../story-lifecycle.js';
|
|
|
21
21
|
* @param {number} deps.input.storyId
|
|
22
22
|
* @param {number|null} [deps.input.recutOf]
|
|
23
23
|
* @param {boolean} [deps.input.dryRun]
|
|
24
|
-
* @returns {Promise<{ story: object, body: string, epicId: number,
|
|
24
|
+
* @returns {Promise<{ story: object, body: string, epicId: number, parentId: number|null }>}
|
|
25
25
|
*/
|
|
26
26
|
export async function resolveContext({ provider, logger, input }) {
|
|
27
27
|
const { storyId, recutOf = null, dryRun = false } = input;
|
|
@@ -43,7 +43,7 @@ export async function resolveContext({ provider, logger, input }) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
let body = story.body ?? '';
|
|
46
|
-
const { epicId,
|
|
46
|
+
const { epicId, parentId } = resolveStoryHierarchy(body);
|
|
47
47
|
|
|
48
48
|
if (!epicId) {
|
|
49
49
|
throw new Error(
|
|
@@ -88,5 +88,5 @@ export async function resolveContext({ provider, logger, input }) {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
return { story, body, epicId,
|
|
91
|
+
return { story, body, epicId, parentId };
|
|
92
92
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* state-transitioner.js — Stage 6 of the story-init pipeline.
|
|
3
3
|
*
|
|
4
4
|
* Flips the Story ticket to `agent::executing` at init time. Under the
|
|
5
|
-
*
|
|
6
|
-
* lifecycle — `/
|
|
5
|
+
* 2-tier hierarchy the Story has inline acceptance and no child Task
|
|
6
|
+
* lifecycle — `/deliver` runs a single Story-implementation phase.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import {
|
|
@@ -14,7 +14,7 @@ import { fetchChildTickets } from '../story-lifecycle.js';
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Detect whether a Story body carries inline acceptance criteria, the
|
|
17
|
-
* structural signal that the Story is authored in the
|
|
17
|
+
* structural signal that the Story is authored in the 2-tier
|
|
18
18
|
* (Story-with-inline-acceptance) shape and therefore should not be expected
|
|
19
19
|
* to enumerate child Task tickets. Recognises both `## Acceptance` and
|
|
20
20
|
* `## Acceptance Criteria` headings, with at least one list bullet under
|
|
@@ -67,15 +67,15 @@ function sortTasksByDependencies(tasks) {
|
|
|
67
67
|
* @param {object} deps.input
|
|
68
68
|
* @param {number} deps.input.storyId
|
|
69
69
|
* @param {string} [deps.input.storyBody] Story body — used to detect
|
|
70
|
-
* whether the Story carries inline acceptance (
|
|
70
|
+
* whether the Story carries inline acceptance (2-tier shape) so the
|
|
71
71
|
* empty-Task-list path is treated as expected rather than as a warning.
|
|
72
72
|
*
|
|
73
73
|
* Task #3154 (Epic #3078) deleted the `planning.hierarchy` flag; the
|
|
74
|
-
*
|
|
75
|
-
* inline acceptance + zero Tasks resolves to `'
|
|
74
|
+
* 2-tier vs 4-tier mode is now derived entirely from the ticket shape —
|
|
75
|
+
* inline acceptance + zero Tasks resolves to `'2-tier'`, otherwise
|
|
76
76
|
* `'4-tier'`.
|
|
77
77
|
*
|
|
78
|
-
* @returns {Promise<{ sortedTasks: Array<object>, mode: '
|
|
78
|
+
* @returns {Promise<{ sortedTasks: Array<object>, mode: '2-tier'|'4-tier' }>}
|
|
79
79
|
*/
|
|
80
80
|
export async function buildTaskGraph({ provider, logger, input }) {
|
|
81
81
|
const { storyId, storyBody = '' } = input;
|
|
@@ -85,13 +85,13 @@ export async function buildTaskGraph({ provider, logger, input }) {
|
|
|
85
85
|
const tasks = await fetchChildTickets(provider, storyId);
|
|
86
86
|
|
|
87
87
|
const inlineAcceptance = hasInlineAcceptance(storyBody);
|
|
88
|
-
const mode = tasks.length === 0 && inlineAcceptance ? '
|
|
88
|
+
const mode = tasks.length === 0 && inlineAcceptance ? '2-tier' : '4-tier';
|
|
89
89
|
|
|
90
90
|
if (tasks.length === 0) {
|
|
91
91
|
if (inlineAcceptance) {
|
|
92
92
|
progress(
|
|
93
93
|
'TASKS',
|
|
94
|
-
`Story #${storyId} has inline acceptance — no child Tasks expected (
|
|
94
|
+
`Story #${storyId} has inline acceptance — no child Tasks expected (2-tier shape).`,
|
|
95
95
|
);
|
|
96
96
|
} else {
|
|
97
97
|
warn(
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* (branch bootstrap, merge, cascade, notifications). Expanding this module to
|
|
11
11
|
* cover those would over-abstract — they are genuinely different concerns.
|
|
12
12
|
*
|
|
13
|
-
* Under the
|
|
13
|
+
* Under the 2-tier hierarchy (Epic #3078) Stories have no child tickets, so
|
|
14
14
|
* `fetchChildTickets` typically returns `[]` — but the helper remains in
|
|
15
15
|
* place so legacy callers still resolve the Story's direct children cleanly.
|
|
16
16
|
*/
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
* Parse the `Epic: #N` and `parent: #N` references from a Story body.
|
|
25
25
|
*
|
|
26
26
|
* @param {string} body Raw Story body Markdown.
|
|
27
|
-
* @returns {{ epicId: number|null,
|
|
27
|
+
* @returns {{ epicId: number|null, parentId: number|null }}
|
|
28
28
|
*/
|
|
29
29
|
export function resolveStoryHierarchy(body) {
|
|
30
30
|
const source = body ?? '';
|
|
@@ -32,17 +32,17 @@ export function resolveStoryHierarchy(body) {
|
|
|
32
32
|
const parentMatch = source.match(/(?:^\s*parent:\s*#(\d+))/im);
|
|
33
33
|
return {
|
|
34
34
|
epicId: epicMatch ? Number.parseInt(epicMatch[1], 10) : null,
|
|
35
|
-
|
|
35
|
+
parentId: parentMatch ? Number.parseInt(parentMatch[1], 10) : null,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Fetch the Story's direct child tickets via the provider.
|
|
41
41
|
*
|
|
42
|
-
* Under the
|
|
42
|
+
* Under the 2-tier hierarchy (Epic #3078) Stories no longer enumerate
|
|
43
43
|
* child Task tickets — acceptance criteria and verification steps live
|
|
44
|
-
* inline on the Story body, and decomposers emit only Epic /
|
|
45
|
-
*
|
|
44
|
+
* inline on the Story body, and decomposers emit only Epic / Story
|
|
45
|
+
* issues. For those Stories this helper resolves to an empty
|
|
46
46
|
* array because `provider.getSubTickets(storyId)` itself returns no
|
|
47
47
|
* rows. The helper is retained as a thin pass-through so the three
|
|
48
48
|
* orchestration callers (`story-init` prepare, `task-graph-builder`,
|
|
@@ -50,7 +50,7 @@ export function resolveStoryHierarchy(body) {
|
|
|
50
50
|
* hydration that is easy to mock in tests and to instrument in the
|
|
51
51
|
* provider layer.
|
|
52
52
|
*
|
|
53
|
-
* Legacy ticket trees that were planned before the
|
|
53
|
+
* Legacy ticket trees that were planned before the 2-tier cutover may
|
|
54
54
|
* still carry sub-tickets (PRD/Tech-Spec links recorded as direct
|
|
55
55
|
* children, for example). The helper deliberately does **not** filter
|
|
56
56
|
* those out — the caller is responsible for classifying anything that
|
|
@@ -59,7 +59,7 @@ export function resolveStoryHierarchy(body) {
|
|
|
59
59
|
*
|
|
60
60
|
* @param {object} provider ITicketingProvider instance.
|
|
61
61
|
* @param {number} storyId Story ticket number to hydrate children for.
|
|
62
|
-
* @returns {Promise<object[]>} Array of child tickets (empty under
|
|
62
|
+
* @returns {Promise<object[]>} Array of child tickets (empty under 2-tier).
|
|
63
63
|
*/
|
|
64
64
|
export async function fetchChildTickets(provider, storyId) {
|
|
65
65
|
return provider.getSubTickets(storyId);
|
|
@@ -2,7 +2,6 @@ import { LIMITS_DEFAULTS } from '../config/limits.js';
|
|
|
2
2
|
import {
|
|
3
3
|
DEFAULT_TASK_SIZING,
|
|
4
4
|
DELIVERABLE_GRANULARITY_GUIDANCE,
|
|
5
|
-
SOFT_STORIES_PER_FEATURE,
|
|
6
5
|
} from '../orchestration/ticket-validator-sizing.js';
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -13,22 +12,23 @@ import {
|
|
|
13
12
|
* resolved value; importing it here means a fallback path (no caller-supplied
|
|
14
13
|
* value) still tracks the framework default in `lib/config/limits.js`.
|
|
15
14
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* asks the planner to
|
|
15
|
+
* 2-tier is the only published hierarchy after Story #4041 removed the
|
|
16
|
+
* Feature tier: the prompt emits Stories only (direct Epic children) and
|
|
17
|
+
* asks the planner to carry acceptance/verify as top-level ticket arrays.
|
|
19
18
|
*/
|
|
20
19
|
export function renderDecomposerSystemPrompt({
|
|
21
20
|
maxTickets = LIMITS_DEFAULTS.maxTickets,
|
|
22
21
|
} = {}) {
|
|
23
|
-
return
|
|
22
|
+
return render2TierPrompt({ maxTickets });
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
|
-
*
|
|
28
|
-
* layer. Acceptance criteria and verification commands live inline
|
|
29
|
-
* Story body so the executing agent has everything it needs in one
|
|
26
|
+
* 2-tier prompt (Story #4041). Decomposes to Stories only — no Feature and
|
|
27
|
+
* no Task layer. Acceptance criteria and verification commands live inline
|
|
28
|
+
* on the Story body so the executing agent has everything it needs in one
|
|
29
|
+
* ticket. Thematic grouping lives as prose in the Epic body / Tech Spec.
|
|
30
30
|
*/
|
|
31
|
-
function
|
|
31
|
+
function render2TierPrompt({ maxTickets }) {
|
|
32
32
|
// Sizing thresholds are sourced from the single DEFAULT_TASK_SIZING constant
|
|
33
33
|
// (ticket-validator-sizing.js) so the prompt and the validator cannot drift.
|
|
34
34
|
const { softFiles, hardFiles, maxAcceptance, softAcceptanceCount } =
|
|
@@ -40,16 +40,16 @@ function render3TierPrompt({ maxTickets }) {
|
|
|
40
40
|
const { definition: granularityDefinition, singleConsumerRule } =
|
|
41
41
|
DELIVERABLE_GRANULARITY_GUIDANCE;
|
|
42
42
|
return `You are an expert Senior Project Manager and Orchestrator.
|
|
43
|
-
Your job is to take a Product Requirements Document (PRD) and a Technical Specification and decompose them into a
|
|
43
|
+
Your job is to take a Product Requirements Document (PRD) and a Technical Specification and decompose them into a flat list of Story tickets for an AI Agent to execute.
|
|
44
44
|
|
|
45
45
|
### HIERARCHY RULES:
|
|
46
|
-
1. **
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
46
|
+
1. **Stories**: Specific user-facing or architectural user stories (e.g., "Implement JWT Token Exchange").
|
|
47
|
+
- Every Story attaches directly to the Epic — there is NO Feature tier and NO Task layer in this hierarchy.
|
|
48
|
+
- **Story-Level Execution**: Each Story will be executed end-to-end on a single branch by a single agent. Acceptance criteria and verification commands live as top-level \`acceptance[]\` / \`verify[]\` arrays on the Story ticket (see STORY BODY SCHEMA below).
|
|
49
|
+
- Thematic grouping is prose in the Epic body / Tech Spec, never a ticket.
|
|
50
50
|
|
|
51
51
|
### LABEL CONVENTIONS:
|
|
52
|
-
- Every ticket must have
|
|
52
|
+
- Every ticket must have the \`type::story\` label. No other type label is allowed — the retired Feature and Task tiers have no labels under this hierarchy.
|
|
53
53
|
- Every ticket must have a \`persona::[engineer|architect|qa-engineer|engineer-web|etc]\` label indicating WHO should execute it.
|
|
54
54
|
|
|
55
55
|
### OUTPUT FORMAT:
|
|
@@ -58,43 +58,52 @@ You MUST respond ONLY with a valid JSON array of objects. No prose, no markdown
|
|
|
58
58
|
### JSON SCHEMA:
|
|
59
59
|
[
|
|
60
60
|
{
|
|
61
|
-
"slug": "
|
|
62
|
-
"type": "
|
|
61
|
+
"slug": "hyphen-case-id",
|
|
62
|
+
"type": "story",
|
|
63
63
|
"title": "Short descriptive title",
|
|
64
|
-
"body": <string
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
64
|
+
"body": <string — see STORY BODY SCHEMA below>,
|
|
65
|
+
"acceptance": ["<testable, observable criterion>", ...],
|
|
66
|
+
"verify": ["<exact command or test path> (<tier>)", ...],
|
|
67
|
+
"labels": ["type::story", "persona::..."],
|
|
68
|
+
"depends_on": ["slug-of-blocking-dependency"] (optional array of Story slugs that block execution)
|
|
68
69
|
}
|
|
69
70
|
]
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
For Features, \`body\` is a brief string under 2 sentences. Features are navigational — the work happens at the Story level — so dense bodies waste output budget.
|
|
72
|
+
**Slug format**: \`^[a-z0-9][a-z0-9-]*\$\` — hyphen-case only. Underscores are rejected by the validator.
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
### STORY BODY SCHEMA (REQUIRED FOR EVERY STORY):
|
|
75
|
+
\`body\` MUST be a **string** — the serialized markdown produced by \`serialize()\` from \`lib/story-body/story-body.js\`. Do NOT emit \`body\` as a JSON object: an object body throws \`StoryBodyParseError\` in the reconciler (Story #3302) and is discarded by the GitHub provider, producing an empty issue body. Stories are consumed by non-interactive sub-agents that must self-verify from the Story ticket alone — so the ticket must carry everything an agent needs to execute and self-verify.
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
- **Operational/compliance work gets its own Feature.** Retention purges, audit-log sweeps, scheduled cleanups, observability emitters, and other operational/compliance chores serve operators and compliance, not end users. Place them in a dedicated \`compliance-and-observability\` or \`data-retention\` Feature — do NOT fold them into a user-facing Feature (e.g. notification flows) merely because they share a cron/scheduled execution shape with user-facing Stories.
|
|
78
|
-
- **Smell test:** if the only thing two Stories have in common is *how* they run (a scheduled job, a request interceptor, a build step) rather than *whom* they serve or *what* capability they deliver, they are mis-grouped. Re-home the operational/compliance Story into its own capability Feature.
|
|
77
|
+
The \`acceptance[]\` and \`verify[]\` arrays live at the **top level** of the Story ticket object (not nested inside \`body\`). The validator reads \`story.acceptance\` and \`story.verify\` directly — nesting them inside the body makes them invisible to the validator and the decompose is rejected.
|
|
79
78
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
79
|
+
The serialized \`body\` string renders these markdown sections (in order):
|
|
80
|
+
|
|
81
|
+
## Goal
|
|
82
|
+
<one sentence — why this Story exists within the Epic>
|
|
83
|
+
|
|
84
|
+
## Changes
|
|
85
|
+
- {"path": "<file path>", "assumption": "creates" | "refactors-existing" | "deletes"}
|
|
86
|
+
- ...
|
|
87
|
+
|
|
88
|
+
## Acceptance
|
|
89
|
+
- [ ] <testable, observable criterion>
|
|
90
|
+
- ...
|
|
91
|
+
|
|
92
|
+
## Verify
|
|
93
|
+
- <exact command or test path> (<tier>)
|
|
94
|
+
- ...
|
|
95
|
+
|
|
96
|
+
## References
|
|
97
|
+
- {"path": "<read-only dependency path>", "assumption": "exists"}
|
|
98
|
+
- ...
|
|
90
99
|
|
|
91
100
|
#### STORY BODY RULES:
|
|
92
101
|
|
|
93
|
-
- **goal
|
|
94
|
-
- **changes
|
|
95
|
-
- **acceptance
|
|
96
|
-
- **verify
|
|
97
|
-
- **estimated_test_files** (optional): Integer estimate of how many test files this Story creates or modifies. Omit when the number is not estimable. Informational only — it does not gate the decompose.
|
|
102
|
+
- **goal** (in body string): One sentence stating WHY this story exists within the Epic.
|
|
103
|
+
- **changes** (in body string): Each entry is an object \`{ path, assumption }\` where \`assumption\` is one of \`creates | refactors-existing | deletes\`. Acceptable path shapes include explicit files (\`src/components/Foo.tsx\`), glob patterns (\`tests/e2e/*.spec.ts\`, \`**/*.astro\`), and module identifiers that resolve to files. Use \`refactors-existing\` for in-place edits to a file already on \`main\`; \`creates\` for net-new files; \`deletes\` for removals.
|
|
104
|
+
- **acceptance** (top-level array on the ticket object): Items MUST be observable from outside the agent. Acceptable shapes: a specific command exits 0, a file exists at a given path, a snapshot test matches, a \`data-testid\` resolves under a given selector, a row count in a fixture matches. UNACCEPTABLE: "verify by reading the diff", "looks good", "matches the spec" — push these down into a \`verify\` command instead.
|
|
105
|
+
- **verify** (top-level array on the ticket object): Each entry MUST name a testing tier in parentheses, drawn from \`unit\` / \`contract\` / \`e2e\` / \`validate\`. Example: \`npm run test -- src/x.test.ts (unit)\`, \`npm run validate (validate)\`. Stories with zero verify entries SHOULD fail validation; if a story is genuinely unverifiable in isolation (e.g., a copy edit auditor will eyeball), the literal entry \`manual:<reason>\` is allowed so the absence is intentional, not lazy. Manual entries without a reason are rejected.
|
|
106
|
+
- **estimated_test_files** (optional, encoded in the \`<!-- meta: {...} -->\` comment appended to the serialized body string — NOT a top-level ticket field): Integer estimate of how many test files this Story creates or modifies. Omit when the number is not estimable. Informational only — it does not gate the decompose.
|
|
98
107
|
|
|
99
108
|
#### STORY SIZING — COHESION FIRST (the numeric ceiling is only a backstop):
|
|
100
109
|
|
|
@@ -104,10 +113,8 @@ The primary question is **cohesion, not count**: *is this one coherent change wi
|
|
|
104
113
|
|
|
105
114
|
- **One Story = one coherent change with one reason to exist.** If you cannot state that reason in a sentence, the Story is probably two Stories — or two Stories that should be one.
|
|
106
115
|
- ${singleConsumerRule}
|
|
107
|
-
- **Split independent, parallelizable work** into sibling Stories
|
|
116
|
+
- **Split independent, parallelizable work** into sibling Stories — but only when the pieces genuinely have separate reasons to exist.
|
|
108
117
|
- **Declare \`wide\` with a one-line reason when a change is legitimately broad** (a cohesive cutover that spans many files for one reason). Declaring \`wide\` lifts the hard file-width ceiling — see below.
|
|
109
|
-
- **Every Feature MUST decompose into at least TWO Stories.** A Feature with a single Story is the work of a Story, not a Feature — collapse it (drop the Feature wrapper and attach its lone Story to a sibling Feature, or merge the Feature into another). The validator HARD-rejects a Feature with fewer than two Stories.
|
|
110
|
-
- **Features typically decompose into ≤${SOFT_STORIES_PER_FEATURE} Stories; otherwise split into a sibling Feature.** A Feature stretching past ${SOFT_STORIES_PER_FEATURE} Stories is a sign the Feature scope is two features.
|
|
111
118
|
|
|
112
119
|
**Numeric backstop (validator-enforced).** These thresholds are sourced from the single \`DEFAULT_TASK_SIZING\` constant in \`ticket-validator-sizing.js\` — there is no second copy to drift:
|
|
113
120
|
|
|
@@ -117,7 +124,7 @@ The primary question is **cohesion, not count**: *is this one coherent change wi
|
|
|
117
124
|
|
|
118
125
|
#### \`wide\` DECLARATION (optional — for legitimately broad changes):
|
|
119
126
|
|
|
120
|
-
A Story whose footprint is legitimately broad declares \`
|
|
127
|
+
A Story whose footprint is legitimately broad declares \`wide\` carrying a one-line human-readable reason. Encode it in the \`<!-- meta: {"wide": {"reason": "..."}} -->\` comment that \`serialize()\` appends to the body string — it is NOT a top-level ticket field:
|
|
121
128
|
|
|
122
129
|
\`\`\`json
|
|
123
130
|
"wide": { "reason": "hard contract cutover: migrate every <X> call site in one PR" }
|
|
@@ -139,11 +146,11 @@ Declaring \`wide\` with a non-empty reason **lifts the \`hardFiles\` rejection**
|
|
|
139
146
|
- Stories that touch user-visible copy, brand assets, or visual style MUST cite the relevant section of \`docs/style-guide.md\` in \`acceptance\` (e.g. \`"acceptance": ["Hero copy matches docs/style-guide.md §3 (voice & tone)"]\`). If \`docs/style-guide.md\` does not exist or has no relevant section, state that explicitly: \`"acceptance": ["docs/style-guide.md absent — copy reviewed against the inline brand brief in PRD §2"]\`. Silence on style sourcing is a smell.
|
|
140
147
|
|
|
141
148
|
### WAVE-0 BDD SCAFFOLD STORY (features-first; emit when the Acceptance Spec has \`new\`-disposition rows):
|
|
142
|
-
The Acceptance Spec's AC table (columns \`AC ID | Outcome | Feature File | Scenario | Disposition\`) tags each row's \`Disposition\` with one of \`new | updated | unchanged\`. A \`new\` row names a \`.feature\` file + scenario that does NOT yet exist on \`main\`. The framework is features-first: implementing Stories reference those \`.feature\` paths in their \`verify[]\` lines, so the files MUST already exist when those Stories run — otherwise verification fails mid-delivery on a missing file.
|
|
149
|
+
The Acceptance Spec's AC table (columns \`AC ID | Outcome | Feature File | Scenario | Disposition\`) tags each row's \`Disposition\` with one of \`new | updated | unchanged\`. A \`new\` row names a \`.feature\` file + scenario that does NOT yet exist on \`main\`. The framework is features-first: implementing Stories reference those \`.feature\` paths in their \`verify[]\` lines, so the files MUST already exist when those Stories run — otherwise verification fails mid-delivery on a missing file. (These Gherkin \`.feature\` files are BDD artifacts, unrelated to any ticket tier.)
|
|
143
150
|
|
|
144
151
|
When the Acceptance Spec contains **one or more \`Disposition: new\` rows**, you MUST emit **exactly one** dedicated wave-0 scaffold Story whose sole job is to create the \`.feature\` files with \`@skip\`-tagged scenarios BEFORE any implementation Story runs:
|
|
145
152
|
|
|
146
|
-
- **goal**: contains the literal token \`bdd-scaffold\` (e.g. "bdd-scaffold: create the @skip-tagged feature files the implementation Stories verify against
|
|
153
|
+
- **goal**: contains the literal token \`bdd-scaffold\` (e.g. "bdd-scaffold: create the @skip-tagged feature files the implementation Stories verify against").
|
|
147
154
|
- **depends_on**: EMPTY (\`[]\`) — it runs first, in wave 0.
|
|
148
155
|
- **changes**: one entry per distinct \`.feature\` file named in a \`new\` row, each \`{ "path": "<feature file path>", "assumption": "creates" }\`.
|
|
149
156
|
- **acceptance**: MUST assert (a) every new \`.feature\` file exists, and (b) every new scenario within them carries an \`@skip\` tag. Keep these observable (a grep/validate command exits 0, a file exists at a path).
|
|
@@ -153,16 +160,16 @@ When the Acceptance Spec contains **one or more \`Disposition: new\` rows**, you
|
|
|
153
160
|
When the Acceptance Spec contains **zero \`new\`-disposition rows** (every row is \`updated\` or \`unchanged\`), do NOT emit a scaffold Story — there is nothing to create.
|
|
154
161
|
|
|
155
162
|
### SCOPE-OVERLAP FLAGGING (docs/runbook downstream of config work):
|
|
156
|
-
When a "docs update" / "runbook" / "README" Story appears downstream of an earlier Story in the same Epic whose AC already covers updating the same document (e.g. a "config + runbook" Story followed by a "docs" Story touching the same runbook), the downstream Story's deliverable may be fully absorbed by the earlier Story. Flag the risk directly in the Story \`
|
|
163
|
+
When a "docs update" / "runbook" / "README" Story appears downstream of an earlier Story in the same Epic whose AC already covers updating the same document (e.g. a "config + runbook" Story followed by a "docs" Story touching the same runbook), the downstream Story's deliverable may be fully absorbed by the earlier Story. Flag the risk directly in the Story's top-level \`acceptance\` array by appending an item of the form:
|
|
157
164
|
"Scope verification note: this story's deliverable may already be satisfied by Story #<slug-or-id>'s AC — before implementing, \`git diff main -- <path>\` against the upstream Story branch and confirm whether a substantive edit is still required, or whether only a cross-reference remains."
|
|
158
165
|
This prevents the executing agent from redoing work the upstream Story already merged.
|
|
159
166
|
|
|
160
|
-
CRITICAL: Dependencies should follow execution blockers.
|
|
161
|
-
IMPORTANT DEPENDENCY RULE:
|
|
167
|
+
CRITICAL: Dependencies should follow execution blockers. Stories attach directly to the Epic — never emit a 'parent_slug' field.
|
|
168
|
+
IMPORTANT DEPENDENCY RULE: Story-to-Story dependencies are expressed via \`depends_on\` (one Story depends_on another Story's slug). Use this to express execution ordering across the plan.
|
|
162
169
|
|
|
163
170
|
### REVIEWABILITY BUDGET (Story #2798):
|
|
164
171
|
\`maxTickets = ${maxTickets}\` is a **reviewability budget**, not a hard authoring cap. It marks the count of tickets a human operator can comfortably review in one planning pass; emitting more than this overflows the operator's review window. Default behaviour:
|
|
165
172
|
- **Stay at or under the budget when possible.** Merge narrow, single-module stories into larger, cohesive capability stories before splitting; small Stories should merge back into siblings rather than spawn their own container.
|
|
166
|
-
- **Do NOT truncate or over-compress to fit.** If the plan genuinely needs more tickets than the budget, emit the full plan anyway and add a compact \`over_budget_rationale\`
|
|
173
|
+
- **Do NOT truncate or over-compress to fit.** If the plan genuinely needs more tickets than the budget, emit the full plan anyway and add a compact \`over_budget_rationale\` note inside the FIRST Story's \`## Goal\` section explaining (a) why the plan exceeds the budget and (b) what was already merged to keep the count down. The operator will then either accept the plan by re-running the decompose with the explicit \`--allow-over-budget\` override flag, or push back and ask for a re-scope.
|
|
167
174
|
- **Never stop mid-array.** Always emit complete JSON — partial arrays are rejected by the validator.`;
|
|
168
175
|
}
|
|
@@ -37,7 +37,7 @@ import { WaveRunnerError } from './wave-runner-error.js';
|
|
|
37
37
|
* totalWaves: number
|
|
38
38
|
*
|
|
39
39
|
* Wave grouping comes from the checkpoint's `state.plan` (the GH-derived
|
|
40
|
-
* dependency-DAG grouping originally seeded by /
|
|
40
|
+
* dependency-DAG grouping originally seeded by /plan).
|
|
41
41
|
*
|
|
42
42
|
* @typedef {object} WaveTickArgs
|
|
43
43
|
* @property {number | { id: number }} epic
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Thin host-loop CLI that appends a single `story.dispatch.start`
|
|
7
7
|
* NDJSON record to `temp/epic-<id>/lifecycle.ndjson`. Invoked by
|
|
8
|
-
* `/
|
|
8
|
+
* `/deliver` Phase 2 immediately BEFORE each per-Story Agent
|
|
9
9
|
* tool call so the lifecycle ledger durably records every dispatch
|
|
10
10
|
* attempt. The `wave-tick.js` reconciler (Story #2891 Task #2901)
|
|
11
11
|
* then derives `nextAction['in-flight']` from this ledger to surface
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Replaces the three single-purpose emit shims
|
|
8
8
|
* (`epic-deliver-finalize.js`, `epic-deliver-automerge.js`,
|
|
9
|
-
* `epic-deliver-cleanup.js`) that the `/
|
|
9
|
+
* `epic-deliver-cleanup.js`) that the `/deliver` workflow markdown
|
|
10
10
|
* invoked in Phase 6, 7.5, and 8. Those shims each did exactly one
|
|
11
11
|
* thing: construct a bus and emit one event. Collapsing them into a
|
|
12
12
|
* single argv-driven CLI lets the workflow stay declarative ("fire
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Story #3822 — single source of truth for the post-create board-add
|
|
5
5
|
* step. Issues created through any create path (`createTicket`,
|
|
6
|
-
* `createIssue` — which backs `/
|
|
6
|
+
* `createIssue` — which backs `/plan` persist and the `/plan`
|
|
7
7
|
* Phase 4 Epic open) must land on the configured Projects V2 board
|
|
8
8
|
* without relying on GitHub's "Auto-add to project" built-in workflow,
|
|
9
9
|
* which is off by default on fresh boards and cannot be enabled via API.
|
|
@@ -109,7 +109,7 @@ export function classifyGithubError(err) {
|
|
|
109
109
|
// callers (paginateRest, getTicket, getNativeSubIssues, …) absorb the same
|
|
110
110
|
// jittered exponential backoff on transient GitHub errors instead of
|
|
111
111
|
// bubbling a one-shot 502/429/ECONNRESET that kills a longer pipeline
|
|
112
|
-
// (e.g. the /
|
|
112
|
+
// (e.g. the /deliver Phase E retro).
|
|
113
113
|
|
|
114
114
|
export const TRANSIENT_RETRY_DEFAULTS = Object.freeze({
|
|
115
115
|
maxAttempts: 6,
|
|
@@ -57,7 +57,7 @@ export function issueToEpic(issue) {
|
|
|
57
57
|
export function subIssueNodeToTicket(node) {
|
|
58
58
|
// Story #3097 (Wave-0 additive, Epic #3078 Strategy B) — return `null`
|
|
59
59
|
// for absent sub-issue nodes instead of dereferencing properties on
|
|
60
|
-
// `null`/`undefined`. In
|
|
60
|
+
// `null`/`undefined`. In 2-tier mode a Story can legitimately have zero
|
|
61
61
|
// Task children, which surfaces as an empty / missing sub-issue node
|
|
62
62
|
// when callers iterate the GraphQL response and pass each entry through
|
|
63
63
|
// this mapper. The legacy 4-tier path also benefits — a transient
|
|
@@ -83,7 +83,7 @@ export function subIssueNodeToTicket(node) {
|
|
|
83
83
|
* any null/undefined entries. Story #3097 (Wave-0 additive, Epic #3078
|
|
84
84
|
* Strategy B) — gives callers a single Storyless-tolerant entry point so
|
|
85
85
|
* the existing per-node mappers can stay strict for the 4-tier path while
|
|
86
|
-
* the
|
|
86
|
+
* the 2-tier path (Storyless: a Story with zero child Tasks) gets a
|
|
87
87
|
* well-defined empty-array result.
|
|
88
88
|
*
|
|
89
89
|
* @param {Array<object|null|undefined>|null|undefined} nodes
|
|
@@ -42,8 +42,8 @@ import {
|
|
|
42
42
|
const SEARCH_PAGE_CAP = 10;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* Compose the final markdown body for a created ticket. Under the
|
|
46
|
-
* hierarchy (Epic →
|
|
45
|
+
* Compose the final markdown body for a created ticket. Under the 2-tier
|
|
46
|
+
* hierarchy (Epic → Story), `body` is always a string supplied
|
|
47
47
|
* by the caller (the decomposer, the spec planner, or the reconciler-apply
|
|
48
48
|
* engine). This helper appends the canonical orchestrator footer
|
|
49
49
|
* (`parent: #<n>` / `Epic: #<m>` / `blocked by #<x>`) byte-stable with the
|
|
@@ -361,8 +361,8 @@ export class TicketGateway {
|
|
|
361
361
|
/**
|
|
362
362
|
* Create a **bare** issue — no `parent: #N` footer composition and no
|
|
363
363
|
* sub-issue link. Serves the standalone create paths that bypass
|
|
364
|
-
* `createTicket`'s Story-shaped body rendering: the `/
|
|
365
|
-
* persist step and the `/
|
|
364
|
+
* `createTicket`'s Story-shaped body rendering: the `/plan`
|
|
365
|
+
* persist step and the `/plan` Phase 4 Epic open
|
|
366
366
|
* (`openEpicFromOnePager`'s `createIssue` port).
|
|
367
367
|
*
|
|
368
368
|
* After the POST, the new issue is added to the configured Project V2
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* resync-status-column.js — re-assert the GitHub Projects v2 Status
|
|
6
6
|
* column for a ticket after auto-merge has fired (Story #2845).
|
|
7
7
|
*
|
|
8
|
-
* The `/single-story-deliver` and `/
|
|
8
|
+
* The `/single-story-deliver` and `/deliver` workflow docs call
|
|
9
9
|
* this CLI after Step 5 confirms `state: "MERGED"` so the orchestrator
|
|
10
10
|
* wins the race against the GitHub built-in `Pull request merged`
|
|
11
11
|
* workflow, which would otherwise overwrite Status to whatever value
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/* node:coverage ignore file */
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* retro-run.js — execute the `/
|
|
5
|
+
* retro-run.js — execute the `/deliver` Phase 6 retro from a CLI.
|
|
6
6
|
*
|
|
7
|
-
* Phase 6 of `/
|
|
7
|
+
* Phase 6 of `/deliver` posts the Epic retro by invoking the
|
|
8
8
|
* in-process retro module (`lib/orchestration/retro-runner.js`'s
|
|
9
9
|
* `runRetro`). That module is a library entry point — it has no CLI
|
|
10
10
|
* wrapper and hard-requires both a GitHub `provider` and a lifecycle
|
|
@@ -64,7 +64,7 @@ const tasks = [
|
|
|
64
64
|
// only the canonical `<axis>::<value>` separator from
|
|
65
65
|
// `lib/label-constants.js` appears. Closes the drift gap that
|
|
66
66
|
// let the original `type/epic` typo land at
|
|
67
|
-
// `.agents/workflows/epic
|
|
67
|
+
// `.agents/workflows/helpers/plan-epic.md:49`.
|
|
68
68
|
name: 'label-vocabulary',
|
|
69
69
|
cmd: 'node',
|
|
70
70
|
args: ['.agents/scripts/lint-label-vocabulary.js'],
|
|
@@ -139,7 +139,7 @@ export function makeGhRunner(cwd) {
|
|
|
139
139
|
export function assertDeliverableStory(story, storyId) {
|
|
140
140
|
if (!story.labels.includes(TYPE_LABELS.STORY)) {
|
|
141
141
|
throw new Error(
|
|
142
|
-
`Issue #${storyId} is not a Story (labels: ${story.labels.join(', ')}). Use /
|
|
142
|
+
`Issue #${storyId} is not a Story (labels: ${story.labels.join(', ')}). Use /deliver or /deliver for Epic-attached work.`,
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
145
|
if (story.state === 'closed') {
|