Approving a scheme only promotes community to user; AI and hand-edited schemes keep their original source #99
Labels
No labels
area/ai
area/backend
area/frontend
area/infra
area/scheduler
area/wled
good-first-issue
priority/high
priority/low
priority/medium
type/bug
type/chore
type/ci-cd
type/docs
type/feature
type/qa
v1.0.0
v1.1.0
v1.2.0
v2.0.0
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/Iris-WLED#99
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?
Found during #7's operational dry run.
What happens
approve_schemepromotessourcefor exactly one case —backend/app/routers/schemes.py:102:And
PUT /schemes/{scheme_id}never touchessourceat all. So a scheme whose colours, effect, speed, brightness and label the user has entirely rewritten still reports the source of the template it started from.Concretely, tonight I authored
late_summer_moon_2026_midfrom scratch throughPUT— every colour,fx,sxand the label replaced, nothing of the tag-fallback template surviving — then approved it. It still reportssource: "builtin". Same forlabor_day_2026_mid.Why it matters
One of the three is a straight spec violation; two are arguable.
1. AI → user is specified and not implemented. Spec §3.3, source layer 4:
Only
communityis handled, so an approved AI scheme stayssource: "ai"permanently.The visible consequence is in the review workflow: the calendar's "AI-sourced" filter matches
s.source === "ai"(CalendarPage.tsx:39,YearCalendar.tsx:63). A scheme the user has reviewed and adopted keeps appearing there forever — so the filter never drains and stops working as a review queue, which is the only thing it's for.2. The provenance badge is wrong.
SidePanel.tsx:50shows the "success" badge onsource.includes("user"). An approved, hand-edited scheme shows as builtin/AI instead.3. Editing doesn't mark a scheme user-authored. Arguably the sharpest: after a complete rewrite,
sourcestill names a template that contributed nothing to the result.What is not affected
Cross-year reuse is fine — I checked before filing so this isn't over-scoped.
_find_approved_for_key(scheme_generator.py:65) filters onapproved == Trueonly, not on source, so an approved builtin/AI scheme is carried forward to the next occurrence of itsevent_key. This is a provenance and UI-labelling defect, not a scheme-reuse one.Suggested fix
community,aiandfallback→user.PUT /schemes/{id}, when segments or label change, setsource = "user".builtin. Spec source 1 is "schemes the user has explicitly saved or approved", which reads as covering it — but keepingbuiltinlegible as "came from the curated library and was accepted unchanged" is also defensible. Whichever way it goes, code and spec should agree; today they don't.Acceptance criteria
source: userand it leaves the "AI-sourced" filteruserbuiltinpromotesbuiltin/community/ai/fallback× approve / edit)