review-state: Artifacts accumulate with duplicates and lack relevance ordering #200
Labels
No labels
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#200
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The
review-state update --append-artifactmechanism has two issues that degrade the dashboard experience during multi-phase workflows:1. Duplicate artifacts from blind append
ReviewStateUpdater.mergeArraywithArrayMergeMode.Appendblindly concatenates new items — no deduplication by path. The ag-implement workflow appends the same artifact from multiple transition points:"implement:Start Implementation:ag-implement"get appended every phase in Step 6bAfter a few phases, the artifacts array has multiple identical entries.
2. No relevance signal — current phase artifacts buried at bottom
Even without duplicates, a 5-phase issue accumulates ~15+ artifacts in chronological order. The artifacts the reviewer needs NOW (current phase context, review packet) are at the bottom, requiring scrolling past all historical artifacts.
Proposed Solution
Part 1: Upsert semantics for append
Change
--append-artifact(and--append-badge,--append-action) to deduplicate by natural key:pathidlabelWhen an item with the same key already exists, replace it in-place rather than creating a duplicate.
Part 2: Attention artifacts
Add a separate top-level
attention_artifactsarray (2-3 items) toreview-state.jsonalongside the fullartifactsarray. This separates "what you should look at now" from "full history":attention_artifactsprominently at the topartifactslist available for browsing (collapsed or secondary)attention_artifactsat each phase transition with only the current phase's key documentsNew CLI flags:
--attention-artifact "label:path"(replace mode) to set the current attention set.Affected Code
.iw/core/model/ReviewStateUpdater.scala—mergeArrayfunction (line 166-186).iw/commands/review-state/update.scala— CLI flag parsingschemas/review-state.schema.json— addattention_artifactsfieldNotes
--append-artifactcalls just stop producing duplicatesartifactsarray accumulation is intentional for reviewer context — we're adding a relevance layer on top, not removing the history