Repository navigation
chore(dead-code): remove unused store completion helpers - #45
Conversation
Drop completedSeries, CollectionProgress.isSetComplete, and collectedCosmeticIds. Production uses collectionProgress and SeriesCompletion.isComplete instead; collectedCosmeticIds was only exercised in package tests. Co-authored-by: Uday Chauhan <chauhan.s.uday26@gmail.com>
ucguy4u
left a comment
There was a problem hiding this comment.
Architect comments clear on this head — not an approval
Head reviewed: e0bf923 (base 5eeb347, main; draft). No earlier architect review to supersede.
Verdict: clear, no blocking comments. Pure deletion (+0/-71, 4 files) of three APIs nothing uses. One doc fix is requested before merge (should-fix below). Not security-sensitive, no cross-team architecture change.
- No callers. git grep at this head for
completedSeries,isSetComplete,collectedCosmeticIds(and snake_case / string forms) across app/, every package, tests, docs and scripts: the only remaining hits are TODOS.md lines 53 and 108 (prose). No codegen or dynamic references exist. Public barrel:packages/store/lib/store.dartexports both files wholesale, so these were public — but the package ispublish_to: noneand is a path dependency of amiro only. GitHub code search across the DevelopersCoffee org finds these names only in amiro, and no other repo has a pubspec referencing amiro.melos run analyzeat this head: exit 0, no issues in all 9 packages (app included), so nothing references them. - Not planned. DESIGN.md has nothing on set completion or passport rewards. Open amiro PRs: #44 (docs, 15ebd63) does not touch these APIs and still describes them in TODOS.md; #46 (store test fix) does not use or touch them and its files don't overlap this PR. The set-completion feature they were built for (the "collector's frame", TODOS.md:108) is live and does not depend on them:
app/lib/sharing/collector_frame.dartusesSeriesCompletion.isCompletefrompackages/sharing, fed byown_encounter.dart->collectionProgress()which stays.collectedCosmeticIdshas never had an app caller (the app shares purchased ids viaownedCosmeticsProvider). - The 2 failing store_screen_test.dart tests ('lists every catalog item…', 'series items render after unseriesed items…') are unaffected. #46's fix touches only store_screen.dart, pump_helpers.dart and store_screen_test.dart. CI on main (5eeb347, run 40260955072) and on this head (run 41390032797) both end "160 passed, 2 failed" with byte-identical failure output (
Found 0 widgets with text "Twin Buns"at store_screen_test.dart:53). So the red flutter check here is the same pre-existing failure, not caused by this PR.rustis green. brewstack-style caveat doesn't apply: amiro has Actions on, so a red flutter check is real, but it is the same red as main. - My runs:
melos run analyzeexit 0; packages/store tests 36/36 (40 on main minus the 4 removed); sharing 97, discovery 69, nfc 5, qr 4, avatar_core 7, identity_core 14 all pass. I could NOT run the app's flutter tests locally (native-assets toolchain missing on my box), so app test results rest on the CI run above, which matches main exactly. - Coverage kept: remaining tests still pin free-items-count-as-owned,
isComplete, ordering and catalog-ignoring incollectionProgress, so the deleted "free-only series is complete" test is covered by the existing cases.
Should-fix before merge (small, in this PR): TODOS.md still documents the removed symbols as shipped. Line 108 ("Completion engine (completedSeries, isSetComplete, SeriesCompletion.isComplete)") and line 53 ("… via collectedCosmeticIds") would point at code that no longer exists. Please reword to the surviving mechanism (collectionProgress + SeriesCompletion.isComplete -> collector's frame). #44 also edits TODOS.md but not these lines, so I don't expect a textual conflict; if you'd rather leave it to #44, say so there explicitly.
Nothing pushed, marked ready or merged by me. PR Governor merges only with the owner's yes.
Replace references to completedSeries/isSetComplete/collectedCosmeticIds with collectionProgress, CollectionProgress.isComplete, SeriesCompletion.isComplete, and buildShareUri so the doc stays accurate when dead-code PR #45 lands. Co-authored-by: Uday Chauhan <chauhan.s.uday26@gmail.com>
avatarRarityScore now returns CosmeticRarity? directly; only the highest tier was ever read in production. Co-authored-by: Uday Chauhan <chauhan.s.uday26@gmail.com>
ucguy4u
left a comment
There was a problem hiding this comment.
Architect comments clear on this head — not an approval.
Reviewed exact head ed54f7eedc7496d1dee63fd8e50d4dbfff0deef7 (re-fetched before posting; unchanged). This supersedes review 5732200704, which covered e0bf9237. Only the new commit ed54f7ee (AvatarRarityScore removal) needed fresh review; e0bf9237 is unchanged.
1. Semantics: avatar_screen renders the same rarity as before — verified
- Old: tally rarities in a
countsmap over the slots with a catalog listing, thenhighest= maxrarity.indexover the keys (strict>). New: running max over the same slots with the same strict>. Same slot order, samebyAssetId[json[slot] as String?]lookup, same skip for unlisted ids. - Null/empty: no listed item gives
nullin both. The screen'scurrent == null ? null : …guard is untouched, andhighestRarity != nullgates the label as before. - Ties:
rarityis an enum, so equal tiers are the same value and tie-breaking cannot change the output. Thecountsmap never fedhighestbeyond key presence. - The one-line screen change drops
.highestand nothing else. The variable is stillCosmeticRarity?, and the call sites.labelandrarityLabelStyle(context, highestRarity)are unchanged.
2. Callers — complete
rg over the whole repo at this SHA (app, all packages, tests, generated/part files, non-md): the only references are the definition, the store.dart export, app/lib/avatar/avatar_screen.dart and packages/store/test/rarity_test.dart. No other package, no generated code, no .counts readers. flutter analyze is clean for packages/store and app/lib/avatar on my checkout.
3. Tests and mutants (Flutter 3.47.5 runs on the box for packages/store; app tests can't run here, no C toolchain for thermion_dart, so I used the CI log for those)
packages/store: 36/36 pass at this SHA. Mutants against avatarRarityScore, each run against rarity_test.dart:
- KILLED: lowest wins (
>to<); alwaysnull; first-listed wins; unlisted treated as common; skip the glasses slot; only last 3 slots scanned; break after the first listed; ignore the catalog. - SURVIVED, equivalent:
>to>=(same enum value). - SURVIVED, as expected: skip
body(no listed body item exists) and skiptop(a Common cannot change the max when a Rare is present). - SURVIVED, a real gap: last-listed-wins (
if (true)). In the only multi-tier test, the Rare item (glasses) is the last listed slot inAvatarDefinition.slots, so "last wins" and "max wins" are indistinguishable. The old test had this same blind spot, since its map-key iteration was equally last-wins-compatible, so this PR did not introduce it. But the function was rewritten from two-pass to single-pass, and the only thing now guarding ordering independence is that one test. - The new tests are not tautological: expectations are literal enum values, not derived from the code under test. The old
countsassertions died with the field they tested. - End-to-end coverage:
app/test/avatar/avatar_screen_test.dart"shows the highest equipped rarity next to the valuation" (no 'Rare' label, then toggle glasses and 'Rare' appears) passed in CI at this SHA.
4. CI on the exact SHA (run 41509626242)
rust: success.flutter: completed with failure, not green.melos run analyzesucceeded;melos run testfailed. From the job log, the only failing tests are the two knownapp/test/store/store_screen_test.dartones ("lists every catalog item with buy affordance or owned state" and "series items render after unseriesed items, under their header"). 425 other test lines pass, including all store and avatar tests. The same job also fails on main's head5eeb347c, and amiro#46 is the fix.- No legacy statuses exist; the combined status shows
pendingwith 0 contexts. - So the red is attributable entirely to main, not to this diff. It is still red. Do not treat it as green. A green run should come after #46 merges and this branch is re-run or updated. PR Governor should gate on that, plus the owner's yes.
5. Scope and description
- 7 files, +20/−105. Only dead-code removal plus the signature simplification needed to remove the wrapper class. No behavior additions, no dependency or pubspec changes, no doc edits.
- The PR body matches the diff: both commits are listed with revert commands, the head SHA is named, and 36 store tests and the same 2
store_screen_testfailures as main are reported — all confirmed above. - Non-blocking nits:
- The body's "Candidates" section calls out only
TODOS.mddrift forcompletedSeriesandcollectedCosmeticIds.TODOS.mdline 35 and the plandocs/superpowers/plans/2026-09-26-store-rarity-series.mdline 18 also still sayavatarRarityScorereturns "per-tier counts". Intentional per the no-doc-edits rule, but worth listing. - The
avatarRarityScorename on a function that now returns a singleCosmeticRarity?is a slight misnomer (highestEquippedRaritywould be clearer). It is harmless, and I don't want to churn the signature again in a cleanup PR.
- The body's "Candidates" section calls out only
Recommended, non-blocking follow-up (it can go in this PR or a later one): add one test with a custom catalog where a higher tier sits in an earlier slot than a lower tier. For example, Rare hair plus Uncommon glasses should return Rare. That kills the last-wins mutant.
Verdict: clear on this head. The semantic change is behavior-preserving and every caller is covered. It is still a draft and its CI is red only from main's two pre-existing failures. Merge order: #46 first, then #44 and #45. I did not merge, mark ready or push anything. PR Governor merges only with the owner's yes.
* docs: align READMEs and status docs with shipped sharing and store Co-authored-by: Uday Chauhan <chauhan.s.uday26@gmail.com> * docs: address architect nits on overview, identity-link, TODOS Clarify foundation-era stub wording in overview.md, fix app_links reference to sharing_providers.dart, and align TODOS catalog count and Supabase profile backup wording with #43. Co-authored-by: Uday Chauhan <chauhan.s.uday26@gmail.com> * docs(TODOS): align completion engine credits with shipped APIs Replace references to completedSeries/isSetComplete/collectedCosmeticIds with collectionProgress, CollectionProgress.isComplete, SeriesCompletion.isComplete, and buildShareUri so the doc stays accurate when dead-code PR #45 lands. Co-authored-by: Uday Chauhan <chauhan.s.uday26@gmail.com> * docs(TODOS): fix §9 share history after #18 encounter cutover Replace incorrect live-path claim (buildShareUri) with dated legacy amiro://share wording and current amiro://encounter payload via buildOwnEncounterUri, per architect review. Co-authored-by: Uday Chauhan <chauhan.s.uday26@gmail.com> * docs: align legal copy and worker README with Supabase profile backup (#43) Co-authored-by: Uday Chauhan <chauhan.s.uday26@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Theme
Unused store package functions/getters — API surface in
packages/storethat is exported viastore.dartbut never referenced by the app (or any other package). The live completion/collector flows usecollectionProgress,SeriesCompletion.isComplete, andCollectionProgress.isCompleteinstead.Follows amiro#41 / amiro#42 (merged 2026-10-23); this pass targets what remains on current
main.Removed
completedSeries()packages/store/lib/src/collection_progress.dartcollectionProgress→SeriesCompletioninbuildOwnEncounterPayloadand usesSeriesCompletion.isCompleteincardBorder.CollectionProgress.isSetCompletecompletedSeriesand removed tests; app usesisComplete/ wireSeriesCompletion.isComplete.collectedCosmeticIds()packages/store/lib/src/collection_highlights.dartcollection_highlights_test.dart. Share/encounter paths pass entitlement ids directly (ownedCosmeticsProvider,buildShareUri(..., ownedCosmeticIds: ...)) without this helper.AvatarRarityScoreclass andcountsmappackages/store/lib/src/avatar_valuation.dart.highest(avatar_screen.dart). `rg 'AvatarRarityScoreSearch commands & results (pre-removal, on
main)No matches in Android/iOS manifests,
pubspec.yaml, or generated/part files for the removed symbols.Revert
Two commits on this branch (newest first):
Or reset the branch to
mainand close the PR.Candidates (not removed)
buildShareUri+ownedlist wiring — legacyamiro://sharepath; main share flow uses encounter payloads. Not changed (behavior / scope).TODOS.mdmentionscompletedSeries/collectedCosmeticIds— documentation drift only; per cleanup rules, no doc edits in this PR.Local verification
Head commit:
ed54f7eedc7496d1dee63fd8e50d4dbfff0deef7Environment: Flutter stable (Dart 3.13.7),
melos bootstrap, native deps forthermion_dartper CI.Before (on
main, pre-change)amiro_appfailures on main (unchanged by this PR):app/test/store/store_screen_test.dart: lists every catalog item with buy affordance or owned stateapp/test/store/store_screen_test.dart: series items render after unseriesed items, under their headerAfter (this branch)
Analyze: pass
Affected package tests (
store): passFull workspace
melos run test: fail (pre-existingamiro_appstore screen widget tests on main)