A merged card still shows the In Progress badge, because no phase command removes one #606

Closed
opened 2026-09-22 06:11:51 +00:00 by claude · 0 comments
Member

Found during IW-601 phase 4, which asked how long a badge it wrote would stay on the card.

WHAT HAPPENED. After all four IW-601 phases merged, project-management/issues/IW-601/review-state.json reads:

status: phase_merged
badges: [Medium] [In Progress] [Complete]

The card is merged and still says In Progress. The dashboard shows both states at once, and one of them is false.

ROOT CAUSE. Every phase-lifecycle command appends its badge and removes nothing:

  • core/commands/PhaseStart.scala:155 appends In Progress
  • core/commands/PhasePr.scala:697 appends Review Needed
  • core/commands/PhaseAdvance.scala:277 appends Complete
  • core/commands/PhaseMergedCard.scala:61-67 appends Complete, and Phase NN: CI not judged when the merged head carried no verdict

All four use ArrayMergeMode.Append. The only remover in the codebase is the human-facing --clear-badges flag (core/commands/ReviewState.scala:578).

NOT A PILE-UP. mergeArray de-duplicates by label (core/model/ReviewStateUpdater.scala:161-171), so four phases give one In Progress, not four. The defect is that the badge never leaves, not that it multiplies.

WHY IT SURFACED NOW. IW-601 phase 4 adds a warning badge for a merged head with no CI verdict. No command removes a badge, so a badge reading CI not judged would stay on the card and become false in every later phase. The phase worked around this by labelling it Phase NN: CI not judged, which stays true forever. The workaround is sound; the gap it works around is not fixed.

REQUESTED FIX. Decide the lifecycle of a lifecycle badge. The phase-lifecycle badges (In Progress, Review Needed, Complete) describe one mutually exclusive state, so a transition should replace them rather than add to them; badges that record a fact about a specific phase (Phase NN: CI not judged) are cumulative and must stay. A per-badge choice at each write site, or an owned-set replace for the lifecycle family, both satisfy this — the decision is which.

This matters for the dashboard work: a card whose badges contradict each other cannot be read at a glance.


Type: bug
Filed from: /home/mph/Devel/iw/iw-cli-IW-601 on branch IW-601

Found during IW-601 phase 4, which asked how long a badge it wrote would stay on the card. WHAT HAPPENED. After all four IW-601 phases merged, `project-management/issues/IW-601/review-state.json` reads: status: phase_merged badges: [Medium] [In Progress] [Complete] The card is merged and still says In Progress. The dashboard shows both states at once, and one of them is false. ROOT CAUSE. Every phase-lifecycle command appends its badge and removes nothing: - `core/commands/PhaseStart.scala:155` appends `In Progress` - `core/commands/PhasePr.scala:697` appends `Review Needed` - `core/commands/PhaseAdvance.scala:277` appends `Complete` - `core/commands/PhaseMergedCard.scala:61-67` appends `Complete`, and `Phase NN: CI not judged` when the merged head carried no verdict All four use `ArrayMergeMode.Append`. The only remover in the codebase is the human-facing `--clear-badges` flag (`core/commands/ReviewState.scala:578`). NOT A PILE-UP. `mergeArray` de-duplicates by `label` (`core/model/ReviewStateUpdater.scala:161-171`), so four phases give one `In Progress`, not four. The defect is that the badge never leaves, not that it multiplies. WHY IT SURFACED NOW. IW-601 phase 4 adds a warning badge for a merged head with no CI verdict. No command removes a badge, so a badge reading `CI not judged` would stay on the card and become false in every later phase. The phase worked around this by labelling it `Phase NN: CI not judged`, which stays true forever. The workaround is sound; the gap it works around is not fixed. REQUESTED FIX. Decide the lifecycle of a lifecycle badge. The phase-lifecycle badges (`In Progress`, `Review Needed`, `Complete`) describe one mutually exclusive state, so a transition should replace them rather than add to them; badges that record a fact about a specific phase (`Phase NN: CI not judged`) are cumulative and must stay. A per-badge choice at each write site, or an owned-set replace for the lifecycle family, both satisfy this — the decision is which. This matters for the dashboard work: a card whose badges contradict each other cannot be read at a glance. --- **Type:** bug **Filed from:** `/home/mph/Devel/iw/iw-cli-IW-601` on branch `IW-601`
mph closed this issue 2026-09-23 15:03:18 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#606
No description provided.