Skip to content

fix(dashboard): the flow page counts the items the work fold forgot - #20088

Merged
javenciu merged 2 commits into
mainfrom
fix/flow-page-counts-forgotten-items
Oct 23, 2026
Merged

javenciu merged 2 commits into
mainfrom
fix/flow-page-counts-forgotten-items

Conversation

@javenciu

@javenciu javenciu commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The flow dashboard page shows true accepted, still-open and rejected counts on a long goal.

The builtin flow page draws its three tiles from the work fold's items alone (src/kiro_crew/dashboard_templates/builtin/flow/template.html, the kpi_accepted tile: done over list.length). The fold keeps the open items and the newest closed ones; every older closed item leaves items and is counted in work.forgotten. So on a long goal the accepted tile reads a smaller "of N" than the board holds, and the other two tiles drop the forgotten rejected and abandoned items. goal-board and kirocrew-conductor already bind forgotten and add it; this page does not.

Why it matters

A crewmate opens flow to see how far a goal has got. Once more closed items exist than the fold keeps, the accepted tile stops growing with the work and the three tiles no longer add up to the board.

Not a goal

  • No change to the work fold or to how it forgets items.
  • No change to goal-board, kirocrew-conductor or any other builtin page. Eight other builtins bind work.items without work.forgotten (office, org-chart, pr-watch, project-report, roadmap, standup, swimlane, timeline); their audit was tracked in #21035, which fix(dashboard): standup and pr-watch count the items the work fold forgot #22856 closed by fixing standup and pr-watch.
  • No change to the burndown or the cumulative-flow chart. Both are drawn from each listed item's own created_at and closed_at, and a forgotten item no longer carries them.
  • No change to the "item(s) counted / not shown" line under the charts, which describes what the charts drew.

What changed (motivation → approach → change)

Symptom: the accepted tile reads 2 of 3 for a board of 3 listed items plus 4 forgotten ones (3 of them accepted); it should read 5 of 7. Cause: the page never bound work.forgotten. Change:

  • flow/manifest.json binds {"fold": "work", "path": "forgotten"} exactly as goal-board/manifest.json does. The loader requires a page to bind exactly its manifest's fields, so flow/template.html also gains the hidden data-dashboard-field="forgotten" cell.
  • flow/template.html gains a forgotten() reader that mirrors goal-board's: a missing, null, string, array, negative or non-numeric value reads as zero.
  • The tiles add it the way goal-board's drawLoop does: accepted = listed accepted + forgotten.accepted, total = listed + forgotten.items, and "rejected or left" = listed + forgotten.rejected + forgotten.abandoned. The "still open" tile is unchanged in value, because a forgotten item is always closed. All three tiles now test the same total for "no board yet", so an empty board still draws a dash.
  • test/test_dashboard_templates_builtin.py gains TestFlowCountsTheItemsTheFoldForgot: one case pins the binding against goal-board's, and the rest RUN the page's script under node over a field bag and read the tiles (helpers _flow_tiles, _flow_item, a minimal DOM in _FLOW_DOM; _flow_tiles calls pytest.fail when node is absent, so it fails rather than skips). CI runs this file in the backend-test job's eight Linux shards and the backend-test-windows job's eight Windows shards; the Linux runners provide node, and setup-windows-tests verifies Node and installs Node 24 on self-hosted Windows runners.
  • test/test_dashboard_template_flow.py updates its pin of the empty-board guard (list.length ? done : null becomes total ? done : null). The behaviour it protects, a dash rather - test/fixtures/dashboard_templates/sample_work-kanban.json: no change needed any more. fix(dashboard): standup and pr-watch count the items the work fold forgot #22856 already added the forgotten key the real fold carries, so the rebase on main dropped this PR's copy of it.capture; the capture already carries the key.

Rejected alternative: pin the new arithmetic as source text only, the way test_dashboard_template_goal-board.py pins its own. A source pattern is satisfied by a page that never adds the count, so the script is run instead.

Backwards compatibility

Compatible: the new field is read-only and optional. A gateway whose fold has no forgotten gives zeros, and the tiles read exactly as before; the manifest version goes from 1 to 2, so a flow page adopted before this fix reads stale and the operator can re-adopt it (an adopted copy reads fields through the manifest it froze at adopt). #22856 did the same for standup and pr-watch; test/test_dashboard_templates_forgotten_footer.py::TestAnAdoptedCopyOfTheOldFooterTurnsStale now covers flow too, red at version 1 and green at 2.

Removes nothing: the change adds one bound field and adds counts to three tiles.

Tests

Red on origin/main source (3 of 3 runs, -n0), the new class:

AssertionError: flow does not bind the work fold's forgotten counts
AssertionError: assert ('2', 'of 3') == ('5', 'of 7')
AssertionError: assert '1' == '4'

The other five cases of the class (missing or odd forgotten reads as zeros) pass on both sides: they pin that a board without the field renders as before.

Green on the fix: the new class passed on 3 consecutive runs, and test/test_dashboard_templates_builtin.py passed on 3 consecutive runs at -n0. Every test file that loads a builtin template or reads the sample fixture also passes in one -n0 run, as do the wait-discipline, flake-pattern, pid-reader and tmpdir ratchets.

Mutants, each failing only its own case: dropping done += gone.accepted fails the accepted-tile case; dropping the manifest binding while the page still binds the cell makes load_template refuse the page.

The new cases patch no module global and write no file.

In short: the page's script is run over a board with forgotten items and the tiles read the whole board; red before, green after.

Manual verification

Not rendered in a browser. The three tiles' text and bar width are asserted by running the page's own script under node over a field bag.

Screenshots / video

Why no screenshot: layout, labels and styling are unchanged. Only the numbers in three tiles change, and only on a board whose work fold has forgotten closed items; the test asserts those values by executing the page's script.

Related Issues

Fixes #20023

Follow-up to #19068 and #19902.

Pattern harvest

Rule candidate: review-prompt
Pattern: a builtin page that draws a whole-board count from work.items without adding work.forgotten.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@javenciu
javenciu requested review from a team and KiroCrewCaptain as code owners October 14, 2026 03:28
@javenciu
javenciu requested a review from mbriones98 October 14, 2026 03:28
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of e16016960a0d1a80e4ffbc2ef45d41c271534174 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing to check.

What this change ships

Inventory (4 items) — 4 justified

Intent: a crewmate reading the flow page sees true accepted, open and rejected counts on a long goal. This is a FIX.

  1. The accepted tile's count and "of N" now include closed items the work fold forgot — justified
  2. The "rejected or left" tile now includes forgotten rejected and abandoned items — justified
  3. The flow manifest binds work.forgotten through a hidden page cell — justified
  4. The manifest version goes from 1 to 2, so adopted flow copies read stale — justified

[FIRST-PRINCIPLES-REVIEWED] e160169

Description read

[DESCRIPTION-READ] f26031e2cf15468791ddbb64da088139faf5a8100dee78fbb6c14b7f086334f3

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision e16016960a0d1a80e4ffbc2ef45d41c271534174 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of e16016960a0d1a80e4ffbc2ef45d41c271534174 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change binds the fold's forgotten counts the same way goal-board does, and the version bump marks adopted copies stale.

Notes

  • With this change the tiles count the whole board, but the burndown, the cumulative-flow chart and the "item(s) counted" line still count only listed items. On a long goal the tiles and charts will show different totals. The PR says so (charts are out of scope); a later follow-up could add a short label so a crewmate reading both understands why the numbers differ.

[DESIGN-REVIEWED] e160169

Description read

[DESCRIPTION-READ] 8ee7f251088b7120da27ffdf7e6f78eae35fc5db7d0ceb733fb285e7f9490df9

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed e16016960a0d1a80e4ffbc2ef45d41c271534174 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] e160169

Verdict parsed from the review's SHA-scoped output markers for commit e16016960a0d1a80e4ffbc2ef45d41c271534174.

False positive or not applicable? A repository writer can comment:
/ai-review override fable e16016960a0d1a80e4ffbc2ef45d41c271534174: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of e16016960a0d1a80e4ffbc2ef45d41c271534174 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] e160169

False positive or not applicable? A repository writer can comment:
/ai-review override gpt e16016960a0d1a80e4ffbc2ef45d41c271534174: <one-sentence reason>

@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Oct 14, 2026
@javenciu
javenciu force-pushed the fix/flow-page-counts-forgotten-items branch from 30984cc to 7e2df47 Compare October 14, 2026 04:24
@javenciu

Copy link
Copy Markdown
Contributor Author

span=f805a21211f8

  • New skip makes the tile-count assertions optional. fixed 7e2df47: _flow_tiles now calls pytest.fail(...) when node is not on PATH, naming Node as a required prerequisite, so the seven tile cases can no longer be silently skipped. Witness: with the venv's node hidden from PATH the seven cases FAIL (7 failed, 5 passed); with node present all twelve pass.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@javenciu

Copy link
Copy Markdown
Contributor Author

Closing and reopening so CI runs on hosted runners: same-repo runs from this account queue on the fleet label without a runner (details on #19683).

@javenciu javenciu closed this Oct 14, 2026
@javenciu javenciu reopened this Oct 14, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@javenciu
javenciu force-pushed the fix/flow-page-counts-forgotten-items branch from 7e2df47 to 7f65722 Compare October 14, 2026 06:08
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@javenciu

Copy link
Copy Markdown
Contributor Author

Closing and reopening so CI runs on hosted runners: same-repo runs from this account queue on the fleet label without a runner (details on #19683).

@javenciu javenciu closed this Oct 14, 2026
@javenciu javenciu reopened this Oct 14, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@javenciu
javenciu force-pushed the fix/flow-page-counts-forgotten-items branch from 7f65722 to 6dc2ba8 Compare October 14, 2026 11:10
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@javenciu

Copy link
Copy Markdown
Contributor Author

Closing and reopening so CI runs on hosted runners: same-repo runs from this account queue on the fleet label without a runner (details on #19683).

@github-actions github-actions Bot added the readiness: passed Eligible automated validation passed for the current revision label Oct 14, 2026
@javenciu
javenciu enabled auto-merge (squash) October 14, 2026 14:47

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES (untracked follow-up) at 6dc2ba8.

The fix itself is sound. The flow page now binds work.forgotten and adds its accepted/rejected/abandoned counts to the tiles, the same way goal-board does (template.html L275-L281). The new tests run the page script and were red before the fix.

What needs to change before approval:

  • Not a goal says eight other builtins bind work.items without work.forgotten, and that whether they undercount "was not checked here". First Principles points at standup L207 as a likely case. Please open an issue for that audit (or fix standup here) and link it in the description.
  • Please answer the two PASS punchlines at this head. One is the standup question above. The other is from Design: the description says the node tile tests are "skipped when node is absent", but _flow_tiles now calls pytest.fail. Please correct the description.

CI: the hosted run on this head is green and PR Readiness is green. Sensitive Change Review and the "Publish readiness signal" job are still queued with no runner. Neither is required, and this PR touches no sensitive file.

— crew-pr-reviewer (r100)

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 14, 2026
@javenciu

Copy link
Copy Markdown
Contributor Author

Thanks for the review. The two requested follow-ups are prepared.

  1. First-Principles PASS / standup question. The tracking-issue draft inventories all eight builtin templates, with each exact data-dashboard-field="items" binding line. It includes src/kiro_crew/dashboard_templates/builtin/standup/template.html:66; the likely Finished-column seam is :207, where the header uses String(list.length) from the listed items. Standup remains out of scope for this PR. The Not a goal section now links [#21035](https://github.com/kirodotdev/KiroCrew/issues/21035) for the publisher to substitute.

  2. Design PASS / node-test description. The description now says that _flow_tiles in test/test_dashboard_templates_builtin.py:679-686 calls pytest.fail when node is absent, so it does not skip. The flow coverage remains in TestFlowCountsTheItemsTheFoldForgot, including test_it_binds_forgotten_the_way_goal_board_binds_it, test_the_accepted_tile_adds_the_forgotten_items, test_the_rejected_tile_adds_the_forgotten_rejected_and_abandoned, and test_a_missing_or_odd_forgotten_reads_as_zeros.

@javenciu

Copy link
Copy Markdown
Contributor Author
  • Node-backed tile tests need a CI Node prerequisite. fixed: corrected the description to say _flow_tiles fails when node is absent and named the backend-test and backend-test-windows jobs, .github/workflows/ci.yml:626.

@javenciu

Copy link
Copy Markdown
Contributor Author

The builtin flow page drew its accepted, still-open and rejected tiles
from the work fold's items alone. The fold keeps the open items and the
newest closed ones and counts every older closed item in forgotten, so
on a long goal each tile shrank and the accepted tile read a smaller
"of N" than the board holds.

Bind work.forgotten the way goal-board does and add it to the tiles:
accepted gains forgotten.accepted, the total gains forgotten.items, and
the rejected-or-left tile gains forgotten.rejected and abandoned. A
missing or non-numeric forgotten reads as zeros.

The page script is run under node over a field bag, so the tile values
are asserted rather than a source pattern. The flow page's own test
pins the new empty-board guard, and the hand-written work sample gains
the forgotten key the real fold carries.
@iamwhatever
iamwhatever force-pushed the fix/flow-page-counts-forgotten-items branch from 6dc2ba8 to 3096fbb Compare October 22, 2026 22:39
@iamwhatever

Copy link
Copy Markdown
Contributor

Reply to the CHANGES_REQUESTED review (crew-pr-reviewer r100 at 6dc2ba8), point by point. Rebased on main; new head is 3096fbb.

  1. Audit of the other builtins (standup). Done. Issue Audit built-in dashboard templates for forgotten work items #21035 tracks the audit of the eight other builtins. It is now closed by fix(dashboard): standup and pr-watch count the items the work fold forgot #22856, which fixed standup and pr-watch the same way. This PR stays flow-only, and the Not a goal section links Audit built-in dashboard templates for forgotten work items #21035.
  2. Design punchline: node tests "skipped". Done. The description now says _flow_tiles calls pytest.fail when node is absent, so it fails rather than skips, and names the CI jobs that provide node.
  3. Rebase note. fix(dashboard): standup and pr-watch count the items the work fold forgot #22856 already added the forgotten key to test/fixtures/dashboard_templates/sample_work-kanban.json, so the rebase dropped this PR's copy of that change. The description says so.

Local check on the new head: test/test_dashboard_template*.py 894 passed, and test/test_dashboard_templates_builtin.py + test/test_dashboard_template_flow.py 111 passed (-n0). Waiting on CI.

I cannot dismiss the review myself; a maintainer needs to dismiss it once CI is green.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 22, 2026
An adopted copy reads fields through the manifest it froze at adopt and turns
stale only when the registry version is higher (instance._state_of). With flow
still at version 1, every copy adopted before this fix kept reading no
forgotten field and stayed live. flow 1->2, and the stale test that #22856
added for standup and pr-watch now covers flow too.
@iamwhatever

Copy link
Copy Markdown
Contributor
  • Existing flow instances never receive the new binding (manifest.json:17). fixed in e160169: flow/manifest.json version 1 -> 2, so a copy adopted at version 1 reads stale (instance._state_of) and can be re-adopted with the forgotten binding. TestAnAdoptedCopyOfTheOldFooterTurnsStale (added by fix(dashboard): standup and pr-watch count the items the work fold forgot #22856 for standup and pr-watch) now includes flow; it fails with version 1 and passes with 2. test/test_dashboard_template*.py: 895 passed locally. Description's Backwards compatibility section updated.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 22, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE at e160169.

The flow page now binds work.forgotten and adds its accepted, rejected and abandoned counts to the tiles the way goal-board does (template.html L275-L281), and a missing or malformed value reads as zero. The manifest version bump makes adopted copies read stale, and the new tests run the page's script under node.

Our r100 points are resolved: the builtin audit is tracked in #21035, which #22856 closed after fixing standup and pr-watch, and the description now says the node tests fail rather than skip. All current-head AI lanes pass and every check on this head is green.

Minor, not blocking: the test_dashboard_template_flow.py bullet in What changed runs into the fixture bullet mid-sentence ("a dash rather - test/fixtures/..."), so that paragraph is garbled.

I read the diff and CI results; I did not run the tests locally.

— crew-pr-reviewer (r122)

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head e16016960a0d1a80e4ffbc2ef45d41c271534174 as Tier 2. Deep review found no blocking issue.

Security check: the matched manifest only adds a read-only count binding. It adds no permission, secret, network, or cross-session access. Auto-merge remains subject to branch protection.

@javenciu
javenciu merged commit 9fd79b6 into main Oct 23, 2026
111 of 119 checks passed
@javenciu
javenciu deleted the fix/flow-page-counts-forgotten-items branch October 23, 2026 17:27
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flow dashboard page undercounts its accepted tile once the work fold forgets closed items

3 participants