Skip to content

#1044 A duplicated attention lane in the engine's answer is summed twice - #5

Merged
Tevin2119 merged 2 commits into
fix/mobile-board-exitfrom
delivery/1044-a-duplicated-attention-lane-in-the-engin-9775c43c56
Oct 7, 2026
Merged

Tevin2119 merged 2 commits into
fix/mobile-board-exitfrom
delivery/1044-a-duplicated-attention-lane-in-the-engin-9775c43c56

Conversation

@Tevin2119

Copy link
Copy Markdown
Owner

Task pingdotgg#1044, run run-9775c43c56. Approved by Tevin Tendai Muparadzi for commit 626fa70, which passed its checks and the QA gate.

What was asked

Found by qa-attack (zhipu) while testing task task-820b4cc07e.

Steps: Run pnpm exec vp test run .qa/attack-count.test.ts (first test): a /api/lanes body with lane 'needs-decision' listed twice, 2 cards each, and an empty 'human-review'.
Expected: The reading is malformed (an engine lists each lane once) and should be rejected as null, like every other malformation boardAttentionCount guards against.
Actual: It returns 4, double-counting the 2 tasks; the badge would show an inflated number.

  • Finding: find-aec2380b94, not blocking, in scope of the task it was found on, in the code that change delivered
  • Run: run-15ebfccf0b
  • Candidate tested: e367548
  • Evidence: /Users/tevinmuparadzi/.paperclip/polymania/runs/run-15ebfccf0b/evidence

Done when

  1. boardAttentionCount returns null for a development/all reading that lists 'needs-decision' twice (2 cards each) with an empty 'human-review', not 4.
  2. boardAttentionCount returns null for a development/all reading that lists 'human-review' twice alongside one 'needs-decision'.
  3. A well-formed reading with each attention lane listed once still returns the sum of their cards (for example 2 in 'needs-decision' and 1 in 'human-review' gives 3).
  4. A well-formed reading with both attention lanes empty still returns 0, not null.
  5. apps/web/src/lib/deliveryBoard.test.ts has a test for the duplicated attention lane case, and the existing boardAttentionCount tests in that file still pass.
  6. With a duplicated attention lane in the engine's answer, the sidebar Board badge shows no number rather than an inflated one.

Opened by the delivery engine after a person's approval. Merging is a separate step.

delivery engine added 2 commits October 5, 2026 01:49
boardAttentionCount now returns null unless each attention lane ('needs-decision', 'human-review') is listed exactly once, so a duplicated lane is no longer summed twice. useBoardAttention now stores every fresh answer's count including null, so a malformed answer clears the sidebar Board badge instead of keeping the last number; transport failures still keep the current count (null after a malformed answer) and environment isolation is unchanged. Tests added for duplicated lanes in the helper and the hook; three existing hook expectations flipped to null and one test renamed, as planned.

Task task-7c43415dc1, revision 2, run run-9775c43c56.
Addressed the lead's review. useBoardAttention now identifies a reading by its body together with its readAt time instead of by body alone, so a fresh successful answer whose body is null is distinguished from an absent or old reading and clears the count rather than keeping an earlier positive one. Transport-failure retention (null stays null after a malformed answer) and environment isolation are preserved. Added a hook test for valid positive -> successful null body -> transport failure -> valid recovery, expecting null after both the null answer and the failure; it fails against the previous hook (expected 3 to be null) and passes now. The duplicate-lane rejection in boardAttentionCount and its tests from the previous round are unchanged.

Task task-7c43415dc1, revision 2, run run-9775c43c56.
@Tevin2119
Tevin2119 merged commit ca37bbd into fix/mobile-board-exit Oct 7, 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.

1 participant