Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

fix(roadmap): exclude withdrawn work from summaries [N26]

Corey Olson0fcb266b1fa1
diff --git a/docs/api.md b/docs/api.md
index 15d6f5a9..c0b8bcfe 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -352,7 +352,7 @@ The local board state and events responses include `eventLogVersion`, which iden
The coordinator maintains the roadmap with `milestone add <name> [--note ...] [--items 1,2,3]`, `milestone items <name> --add|--remove ids`, `milestone move <name> --before <other>`, `milestone edit <name> [--name <new>] [--note <text>] [--target <date and time>|none]`, `milestone ship <name> [--next <name>]`, and `milestone remove <name>`. A milestone stores its name, optional note, optional target, its shipment once shipped, and ordered item ids in `board_meta`; removing a milestone leaves its items untouched. A target is stored as ISO time; `--target none` clears it. A `repo#id` reference uses a registered repo's display name (or its folder name) before `#`; its status is read from that board when the repo is registered on this machine.
-An item counts as done only once it has landed on main: it is verified and its merge commit is recorded. `pullboard roadmap` prints milestones in order as `N/M landed`, with the target, `past target` for an unshipped milestone whose target has passed, or the commit it shipped at, and each item as `landed`, `accepted` (verified, not landed) or its status. Its JSON results and API state use `{ name, note, target, pastTarget, shipped, items: [{ id, title, status, state }], landed, done, total }` for each milestone: `target` is ISO text or `null`, `shipped` is `{ commit, at, by }` or `null`, `state` is `landed`, `accepted` or the status, and `done` equals `landed`. Each milestone also carries `summary: { total, left, landed, landing, review, building, held, waiting, needsYou, pace: { last6h, last2h }, estimate }`. The six state counts are exclusive and sum to `total`: landed, accepted but not landed, submitted, live claimed, held, then waiting (including expired claims and unresolved references), in that order of precedence. `left` is total minus landed. Holds include item and lane holds. `needsYou` contains local milestone item ids linked to unanswered person decisions by typed item evidence or explicit local `#N` tokens in the question; repo-qualified and URL references do not link local items. Pace counts this board's distinct currently landed items at the first merged event for their current merge commit, with windows excluding the exact lower boundary. `estimate` is `{ low, high }` hours, from left divided by each window's hourly rate, sorted and rounded to the nearest half hour. A zero two-hour rate uses the positive six-hour rate for both bounds. The estimate is `null` with fewer than three landings in six hours or after shipping. Unshipped milestones print one summary line, including the estimate when available; shipment, targets and item states retain their existing fields.
+An item counts as done only once it has landed on main: it is verified and its merge commit is recorded. `pullboard roadmap` prints milestones in order as `N/M landed`, with the target, `past target` for an unshipped milestone whose target has passed, or the commit it shipped at, and each item as `landed`, `accepted` (verified, not landed) or its status. Its JSON results and API state use `{ name, note, target, pastTarget, shipped, items: [{ id, title, status, state }], landed, done, total }` for each milestone: `target` is ISO text or `null`, `shipped` is `{ commit, at, by }` or `null`, `state` is `landed`, `accepted` or the status, and `done` equals `landed`. Each milestone also carries `summary: { total, left, landed, landing, review, building, held, waiting, needsYou, pace: { last6h, last2h }, estimate }`. Only non-withdrawn members participate in the summary: its `total`, `left`, six state counts and `needsYou` exclude withdrawn work, while the existing milestone `items`, `total`, `landed` and `done` fields retain their original membership semantics. The six summary state counts are exclusive and sum to summary `total`: landed, accepted but not landed, submitted, live claimed, held, then waiting (including expired claims and unresolved references), in that order of precedence. `left` is total minus landed. Holds include item and lane holds. `needsYou` contains local milestone item ids linked to unanswered person decisions by typed item evidence or explicit local `#N` tokens in the question; repo-qualified and URL references do not link local items. Pace counts this board's distinct currently landed items at the first merged event for their current merge commit, with windows excluding the exact lower boundary. `estimate` is `{ low, high }` hours, from left divided by each window's hourly rate, sorted and rounded to the nearest half hour. A zero two-hour rate uses the positive six-hour rate for both bounds. The estimate is `null` with fewer than three landings in six hours or after shipping. Unshipped milestones print one summary line, including the estimate when available; shipment, targets and item states retain their existing fields.
`milestone ship` is the coordinator's move. It records the milestone as shipped at the main checkout's commit and moves every local item that has not landed into the next unshipped milestone after it, or into `--next`, recording a `milestone_moved` event on each moved item's thread. A withdrawn local item stays in place. A `repo#id` reference also stays in place because its board belongs to another repository; every such reference is listed in `notMoved` in JSON and named as “not moved across boards” in text output. Its JSON result is `{ milestone, into, moved, notMoved }`. A shipped milestone takes no new items: `milestone items <name> --add` refuses `MILESTONE_SHIPPED`. Shipping refuses `NO_NEXT_MILESTONE` when unlanded local items have nowhere to go, and `MILESTONE_COMMIT` when main has no commit. Targets and shipping are engine 45 moves.
diff --git a/src/roadmap.js b/src/roadmap.js
index c56a034d..07c22a52 100644
--- a/src/roadmap.js
+++ b/src/roadmap.js
@@ -62,11 +62,12 @@ export function milestoneRoadmap(root, board, options = {}) {
const pace = landingPace(board, items, now);
const needsYou = personDecisionItems(board);
return milestones.map(milestone => {
- const summary = { total: milestone.total, left: milestone.total - milestone.landed,
+ const active = milestone.items.filter(entry => entry.status !== 'withdrawn');
+ const summary = { total: active.length, left: active.length - milestone.landed,
landed: 0, landing: 0, review: 0, building: 0, held: 0, waiting: 0,
- needsYou: milestone.items.filter(entry => typeof entry.id === 'number' && needsYou.has(entry.id)).map(entry => entry.id),
+ needsYou: active.filter(entry => typeof entry.id === 'number' && needsYou.has(entry.id)).map(entry => entry.id),
pace: { ...pace }, estimate: null };
- for (const entry of milestone.items) {
+ for (const entry of active) {
const local = typeof entry.id === 'number' ? items.get(entry.id) : null;
const external = externalItems.get(entry.id);
const item = local ?? external?.item;
diff --git a/test/roadmap.test.js b/test/roadmap.test.js
index 1aa0c79e..cd33bb10 100644
--- a/test/roadmap.test.js
+++ b/test/roadmap.test.js
@@ -87,20 +87,23 @@ test('[N26] each milestone sums its items by state with an estimate', async t =>
const building = box.item('building');
const held = box.item('held');
const waiting = box.item('waiting');
- const ids = [landings.at(-1), landing, review, building, held, waiting];
+ const withdrawn = box.item('waiting');
+ store.withdraw(box.board, withdrawn, { agentId: 'coordinator', reason: 'No longer planned' });
+ const ids = [landings.at(-1), landing, review, building, held, waiting, withdrawn];
store.addMilestone(box.board, { agentId: 'coordinator', name: 'A', items: ids });
const ask = store.shout(box.board, { from: 'coordinator', to: store.PERSON, lanes: ['web'], decision: true,
- text: `Choose for #${waiting}, #${waiting}; foreign#${review} and https://example.invalid/#${landing} are outside`,
+ text: `Choose for #${waiting}, #${waiting}, #${withdrawn}; foreign#${review} and https://example.invalid/#${landing} are outside`,
evidence: { kind: 'attempt', outcome: 'Needs judgment', item: held, commit: box.commit } });
const expected = { total: 6, left: 5, landed: 1, landing: 1, review: 1, building: 1, held: 1, waiting: 1,
needsYou: [held, waiting], pace: { last6h: 5, last2h: 3 }, estimate: { low: 3.5, high: 6 } };
assert.deepEqual((await box.run()).milestones[0].summary, expected);
assert.match(await box.run(false), /^ 5 left of 6: 1 landed, 1 landing, 1 in review, 1 building, 1 waiting, 1 held; about 3.5 to 6 h at today's pace\.$/m);
const direct = milestoneRoadmap(box.repo, box.board, { projects: () => [] })[0];
- assert.equal(direct.total, 6);
+ assert.equal(direct.total, 7, 'legacy milestone membership still includes withdrawn work');
+ assert.equal(direct.items.at(-1).status, 'withdrawn');
assert.equal(direct.done, 1);
assert.deepEqual(direct.items.map(entry => entry.id), ids, 'existing roadmap fields stay intact');
- assert.equal(['landed', 'landing', 'review', 'building', 'held', 'waiting'].reduce((sum, key) => sum + direct.summary[key], 0), direct.total);
+ assert.equal(['landed', 'landing', 'review', 'building', 'held', 'waiting'].reduce((sum, key) => sum + direct.summary[key], 0), direct.summary.total);
store.shout(box.board, { from: store.PERSON, to: 'coordinator', lanes: ['web'], answers: ask, text: 'Choose it' });
assert.deepEqual((await box.run()).milestones[0].summary.needsYou, [], 'answered questions no longer need the person');
box.at(now + 2 * HOUR);