Repository navigation
#1044 A duplicated attention lane in the engine's answer is summed twice - #5
Merged
Tevin2119 merged 2 commits intoOct 7, 2026
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Done when
Opened by the delivery engine after a person's approval. Merging is a separate step.