Skip to content

feat(apps): add Mood Music, songs that match how you feel - #37035

Closed
iamwhatever wants to merge 1 commit into
mainfrom
feat/mood-music
Closed

iamwhatever wants to merge 1 commit into
mainfrom
feat/mood-music

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Say how you feel, or name a song that moved you, and Kiro Crew finds songs with the same feeling and plays them.

Music players pick by genre and play history, not by how you feel. When one song moves you, you cannot ask for "more like this feeling", and nothing says why a pick fits.

Why it matters

People want music that meets their mood in the moment. Kiro Crew already has agents that can search the web; this turns that into a small, pretty app anyone can switch on.

Not a goal

  • No sign-in to any music service, no playlists synced to an account, no downloads.
  • No playback inside the agent-browser side panel (see below for why).
  • No new agent tool: the agent gets taste from the page's message, not from a tool.

What changed (motivation → approach → change)

A new opt-in builtin app, Mood Music (mood-music, defaultEnabled: false).

Part What it does
Page /mood-music Mood text box, five mood chips, the DJ's one question, now playing with "why it fits", like / skip / more like this, an up-next queue, and a Moments tab
DJ agent mood-music-dj + skill mood-music Tools are web_search and web_fetch only. Replies end with one mood-music JSON block: picks, or a single question
Backend /api/apps/mood-music/* Stores moments, the queue and like/skip feedback in the app's data folder. Every route is owner-only and refuses while the app is off
Playback YouTube plays in a sandboxed iframe on https://www.youtube-nocookie.com/embed/<id>. bilibili opens in a new tab of your own browser
Look Two soft glows drift slowly behind the page; their hue follows the mood and is mixed into the theme's --bg, so light and dark both work. A pause button stops the drift; reduced motion keeps it still

How a turn works: the page sends the mood plus a short taste summary (liked, skipped, recent moods) to one hidden worker slot, polls it, and reads the reply's block. Every link is checked twice, in website/src/apps/mood-music/links.ts and again in backend/links.py: a YouTube pick keeps only an id matching ^[A-Za-z0-9_-]{11}$; a bilibili pick must be https on exactly www.bilibili.com, m.bilibili.com or b23.tv, with no user info or port. One bad pick makes the backend refuse the whole queue.

Why bilibili is not in the side panel: the agent-browser panel is a screen cast with no sound, and the browser tool cannot be limited to "navigate only" on a browser that may be signed in to the person's account. A plain link to their own browser plays sound and gives the agent no account access.

What the CSP opens. frame-src in src/kiro_crew/dashboard/server.py gains one source, https://www.youtube-nocookie.com/embed/, path-scoped, no wildcard. Any page in the dashboard could now frame that path; it opens no new way out, since img-src already admits every https host.

Also: the slot uses memory_mode: temporary and its own worker mode (seams.py), so feelings typed here stay out of Kiro Crew memory and the chat sidebar. Docs in src/kiro_crew/docs/apps.md and index.md list the app. The app is registered in builtinRegistry.ts, builtinIcons.tsx and components/appstore/appManifest.ts; its strings are in every catalog under website/src/i18n/locales/.

Backwards compatibility

Compatible: a new app that is off by default; the CSP only adds a source.

Removes nothing: no existing route, key, field or behaviour is removed or tightened.

Tests

  • mood_music/tests/test_links.py: 11-char ids only; 12-char id, http://, bilibili.com.evil.com, user info, ports, backslashes refused.
  • mood_music/tests/test_routes.py: the full mood → queue → feedback path; each bad pick refuses the whole queue and writes nothing; empty mood refused; an unknown mood word is plain text; non-owner, no-app-claim and disabled callers get 403 on every route.
  • mood_music/tests/test_store.py: bounds, feedback kept after the queue moves on, a damaged file moved aside, not overwritten.
  • test/test_dashboard_security_headers.py: frame-src carries exactly one YouTube source, the nocookie embed path.
  • website/src/apps/mood-music/*.test.ts(x): link checks, mood→theme mapping, reply parsing, and the page end to end on fake timers (taste sent, bad link dropped, nocookie src and sandbox, bilibili rel="noopener noreferrer", question flow, skip, pause control, reduced motion, dark theme through variables only).

Determinism: backend tests passed 3 runs in a row (-n 2); frontend tests passed 3 runs with --sequence.shuffle.

Manual verification

Rendered the page with a stubbed API in light and dark, for four moods, a bilibili pick and the Moments tab (screenshots below). The YouTube embed loaded in the page. Not run: a live turn against a real agent.

Screenshots / video

Light and dark, "missing someone":

dark, missing

light, missing

More moods, bilibili, Moments

dark, calm

light, happy

dark, fired up, bilibili pick

light, moments

Related Issues

Closes #36991

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — 🔴 changes requested (blocking)

GPT 6.1 found at least one blocking issue that must be resolved before merging 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42. 2 of 5 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

This comment is updated in place on each push.

BLOCKING -- src/kiro_crew/apps/builtins/init.py:18 -- New app expands the closed built-in set

"mood_music",
Trigger: Gateway startup iterates BUILTIN_NAMES, registers Mood Music’s routes, and installs its manifest with lifecycle="locked"; the frontend registry adds its bundled page.
Outcome: Every installation carries another non-uninstallable app coupled to core releases, violating the closed built-in distribution contract.
Anchor: no-new-builtin-apps
Fix: Ship the app from a dedicated repository listed in the official registry, using generic App Kit seams for any missing host capabilities.

BLOCKING -- src/kiro_crew/apps/builtins/mood_music/backend/routes.py:47 -- Separate request locks allow successful writes to discard data

return MoodStore(app_data_dir(APP_NAME) / "state.json")
Trigger: Two dashboard tabs submit moments concurrently; _handle_add_moment offloads each operation to a thread with a separate MoodStore, so both can read the same document before writing.
Outcome: Both requests return 201, but the last atomic replacement discards the other moment. Concurrent feedback and queue writes have the same lost-update problem.
Anchor: residual/crash-data-loss-corruption
Fix: Share a store or lock per resolved state path and hold it across the entire read-modify-write operation.

BLOCKING -- website/src/apps/mood-music/MoodMusicPage.tsx:122 -- Failed answer submission discards the unsent draft

setQuestion('')
Trigger: A person submits an answer to the DJ’s question and moodApi.openSlot() fails; submitAnswer clears both question and answer before awaiting ask, while run only records the rejection.
Outcome: The unsent answer disappears and its question form unmounts, preventing a retry of that answer.
Anchor: residual/crash-data-loss-corruption
Fix: Preserve the question and answer on rejection; clear them only after successful submission.

BLOCKING -- website/src/apps/mood-music/NowPlaying.tsx:83 -- Three peer actions exceed the two-control limit

<Btn onClick={onMore} disabled={busy}>
Trigger: A queued pick renders NowPlaying, placing Like, Skip and More like this in the same horizontal action group.
Outcome: The new group presents three peer actions and wraps under width pressure instead of using the required overflow layout.
Anchor: max-two-buttons-per-row
Fix: Keep at most two controls, counting the overflow trigger, and move remaining actions into its menu or a separate region.

BLOCKING -- website/src/apps/mood-music/MoodMusicPage.tsx:278 -- Error notice lacks the required hand-off decision

<ErrorNotice className="mt-2" message={errorText} />
Trigger: A state-load or action request fails; its catch handler sets error, rendering this notice with the default askAgent=false and no sanctioned hand-off decision.
Outcome: The failure surface omits agent recovery without recording the draft-preservation decision required by the blocking rule.
Anchor: errors-use-error-notice
Fix: Keep hand-off disabled and add the required No hand-off comment naming the unsaved mood and answer drafts.

[BLOCK-MERGE] 2c19635
[GPT-REVIEWED] 2c19635

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1: UPHOLD. The finding is tied to no-new-builtin-apps, which is blocking: true in the base snapshot (.review-base-rules/AUTOSDE.yaml:946). I confirmed "mood_music" is added to the built-in list at src/kiro_crew/apps/builtins/__init__.py:18. The rule outranks any weighing of harm against fix cost.

F4: UPHOLD. The finding is tied to max-two-buttons-per-row, which is blocking: true in the base snapshot (website-AUTOSDE.yaml:372). I confirmed three peer buttons (Like, Skip, More like this) in one row at website/src/apps/mood-music/NowPlaying.tsx:75-86.

F5: UPHOLD. The finding is tied to errors-use-error-notice, which is blocking: true in the base snapshot (website-AUTOSDE.yaml:676). I confirmed ErrorNotice is rendered at MoodMusicPage.tsx:278 with no hand-off decision.

F2 (fenced): UPHOLD-FENCED. The lock in store.py:45 belongs to each store object, and routes.py:47 builds a new store on every request, so no two requests ever share a lock. Every write route runs its read-modify-write this way (routes.py:186,213,230). This path is reached whenever two writes overlap, and nothing recovers the lost write.

F3 (fenced): UPHOLD-FENCED. MoodMusicPage.tsx:122-123 clears the question and the answer before the request is sent. On failure, run's error handler at :95-97 only records the error and restores neither. Any network error or failed slot open on an ordinary answer submission reaches this, so it is not an extreme condition.

[ADJUDICATION] 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42 total=3 uphold=3 downgrade=0
UPHOLD F1 src/kiro_crew/apps/builtins/__init__.py:18 reason=autosde-blocking-rule
UPHOLD F4 website/src/apps/mood-music/NowPlaying.tsx:83 reason=autosde-blocking-rule
UPHOLD F5 website/src/apps/mood-music/MoodMusicPage.tsx:278 reason=autosde-blocking-rule
[GPT-ADJUDICATED] 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42

[ADJUDICATION-FENCED] 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42 fenced=2 flagged=0
UPHOLD-FENCED F2 src/kiro_crew/apps/builtins/mood_music/backend/routes.py:47 -- Each request gets its own MoodStore and therefore its own lock, so any two overlapping writes can silently lose one, and nothing recovers it.
UPHOLD-FENCED F3 website/src/apps/mood-music/MoodMusicPage.tsx:122 -- The draft is cleared before the request is sent and not restored on failure, so an ordinary network error loses the typed answer and its question.
[GPT-ADJUDICATED-FENCED] 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42 false-positive: <reason, 20 to 500 characters>

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/i18n/locales/*.json, src/kiro_crew/docs/index.md and dashboard/slot_persistence since this head was built (2f4e88a -> f9ebf3a); CI re-running. Same push fixes the Source Gates comment-history finding (routes.py:73 docstring).

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🔴 BLOCK

Premise-level review of 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: BLOCK

The whole app is added as a new built-in in core. AGENTS.md "No built-in apps" and the 2026-11-01 decision forbid that. A dedicated repo listed in kirodotdev/KiroCrewApps already does the job.

What this change ships

Inventory (8 items) — 1 justified

Intent: say a mood, or name a song, and get matching songs played. ADDITION.

  1. New off-by-default "Mood Music" app page at /mood-music — duplicate of the external app-repo and registry route
  2. New mood-music-dj agent and mood-music skill shipped in the wheel — duplicate of the external app-repo and registry route
  3. New owner-only /api/apps/mood-music/* routes storing moments, queue and feedback — duplicate of the external app-repo and registry route
  4. mood_music added to BUILTIN_NAMES, builtinRegistry.ts, builtinIcons.tsx and appManifest.ts — duplicate of the external app-repo and registry route
  5. Dashboard CSP frame-src now admits https://www.youtube-nocookie.com/embed/ on every page — oversized
  6. New worker-slot mode registered through seams.py — rides along with item 1
  7. Strings for the app in all 13 locale catalogs — rides along with item 1
  8. apps.md and index.md list the app — justified

Blockers

The new built-in app is a second way to ship an app — duplicate of the external app-repo and registry route
Trigger: the diff adds 14 files under src/kiro_crew/apps/builtins/mood_music/. It adds "mood_music", to BUILTIN_NAMES and '/mood-music': {...} to BUILTIN_COMPONENT_REGISTRY. It adds 9 files under website/src/apps/mood-music/. AGENTS.md says: "Never add an app under src/kiro_crew/apps/builtins/ … a per-app row in a core built-in table." The blocking no-new-builtin-apps rule in AUTOSDE.yaml says the same. The description calls this "A new opt-in builtin app".
Outcome: the set of built-ins is meant to be closed and shrinking, and this grows it. The app rides in every install and can't be uninstalled. Core now names the app, including in the dashboard CSP comment at server.py:622. All of it has to be moved back out later under #26967.
Subtraction: delete apps/builtins/mood_music/, website/src/apps/mood-music/, website/public/app-assets/mood-music/, the four registry rows, the locale keys and the YouTube frame-src source, and ship the app from its own repo listed in kirodotdev/KiroCrewApps. If the app needs something core doesn't offer, that's a gap in the generic App Kit seams.
Clears when: no Mood Music code, asset, registry row or CSP source remains in core, or a maintainer records /ai-review override first-principles 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42 builtin-app: <decision>.

[FIRST-PRINCIPLES-REVIEWED] 2c19635

Description read

[DESCRIPTION-READ] 7bcf34c58d5d8c458545450c8f7bbfac1ba9fca1c18872a8ede6f3045196530b

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

Design-level review of 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Kiro Crew no longer accepts new built-in apps, and this PR adds one: a new BUILTIN_NAMES row, a package under apps/builtins/mood_music/, and a per-app page under website/src/apps/mood-music/.

Blockers

Mood Music ships as a new built-in app in core
Trigger: the diff adds "+ \"mood_music\"," to BLOCKING BUILTIN_NAMES, adds src/kiro_crew/apps/builtins/mood_music/** (app.json, backend routes, agent, skill), and adds per-app entries in website/src/apps/builtinRegistry.ts, builtinIcons.tsx and website/src/apps/mood-music/*. The description calls it "A new opt-in builtin app".
Outcome: AGENTS.md "No built-in apps" and decision 2026-11-01 forbid this → core takes on an app's backend, UI, CSP exception and 14 locale catalogs while #26967 is moving the existing built-ins out → the app would have to be extracted again, and every core release carries its upkeep.
Fix: ship Mood Music from its own GitHub repository listed in the kirodotdev/KiroCrewApps registry, using App Kit seams. If the app needs something it can't get from outside core, such as the youtube-nocookie frame-src source, add that as a generic, app-agnostic App Kit seam (for example, a manifest-declared frame source) in a separate core PR.
Clears when: the PR adds nothing under src/kiro_crew/apps/builtins/ or website/src/apps/<app>/, and no row to BUILTIN_NAMES, builtinRegistry.ts, builtinIcons.tsx or appManifest.ts; any core change is limited to an app-agnostic seam.

Notes

  • As written, the CSP change hard-codes one app's embed origin into the dashboard-wide frame-src. Once the app lives outside core, that origin should be declared by the app through a seam, not set globally in server.py.

[DESIGN-REVIEWED] 2c19635

Description read

[DESCRIPTION-READ] 6eb7dc31cc1f3be3e051abc1dcf22557474a1269b1302749156e343bf24dcc12

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🔴 BLOCK

UX-level review of 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: BLOCK

Clicking a mood chip only changes the background colour; no new songs come up. The pause icon in the header stops the background motion, not the music. The DJ's question, the loading state and the empty state appear in no screenshot.

Blockers

Mood chips look like they pick songs, but they only change the colour
Trigger: someone clicks "Happy" or "Calm" expecting songs for that mood.
Outcome: the chip handler only runs setChip(...) and setLook(...). Nothing is fetched until the person also presses "Find songs". Shots 3–4 show this: the song, the "missing someone" description and the queue stay the same. The blind reader expected the chip to "pick songs for that mood" and then said: "I can't tell whether picking 'calm' did anything apart from changing the background tint." The chips are on the main path, so this hits every session.
Fix: send the request as soon as a chip is clicked when the text box is empty, or show the chips as tags of the text field so they clearly need "Find songs".

A pause icon on a music page pauses the background, not the music
Trigger: someone wants to stop the music and clicks the Pause icon at the top right.
Outcome: setMotionPaused stops only the glow drift and the YouTube player keeps playing. The blind reader said: "maybe pause… no idea… wouldn't dare click." It's on screen all the time.
Fix: drop the toggle, since reduced motion already stops the drift. Otherwise give it a visible label and a non-media icon.

Evidence gaps

  • The DJ's question card ("The DJ asks", the answer box and the "Answer" button). It's in no screenshot. Attach one of the question being asked.
  • The "Finding songs that fit…" loading state, with the busy "Find songs" button. Attach a screenshot taken mid-turn.
  • The "Nothing playing yet" empty state on first visit, and the "No moments yet" empty Moments tab.
  • The error notices (unreadable reply, timeout) and the notice about songs left out because their link can't play.
  • A skipped song in the "Up next" list (shown faded at 50% opacity).

Notes

  • error_generic "Something went wrong ({{code}})" shows a raw code and gives no next step. Say what failed and tell the person to try again.
  • MoodBackdrop adds a decorative radial-gradient fill to the page background, against the flat-fill rule in theming-contract.md. Use solid token washes instead.
  • "Up next" lists the song already playing. Leave out current or label that row "Playing".

[UX-REVIEWED] 2c19635

Description read

[DESCRIPTION-READ] 1f951bd722059c6adc0c78ba53eaa4f04527cc7034a1fd4cf1a860fe0e670ee5

That sha256 names everything this verdict read: the PR description, plus the 9 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — 🔴 changes requested (blocking)

Reviewed 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42 — this comment is updated in place on each push.

This PR adds a new built-in app (Mood Music) to core, which the blocking no-new-builtin-apps rule forbids. Its store also loses concurrent writes.

BLOCKING — src/kiro_crew/apps/builtins/init.py:18

+    "mood_music",

Trigger: The PR adds a new src/kiro_crew/apps/builtins/mood_music/ tree with its own app.json. It also adds a per-app page under website/src/apps/mood-music/, per-app rows in website/src/apps/builtinRegistry.ts, builtinIcons.tsx and appManifest.ts, assets under website/public/app-assets/mood-music/, and a frame-src CSP widening in dashboard/server.py that applies to every dashboard page.
Outcome: A new first-party app ships inside the core wheel. It cannot be uninstalled and is tied to Kiro Crew's release cadence, which is exactly what the closed built-in set forbids.
Anchor: no-new-builtin-apps
Fix: Ship Mood Music from its own GitHub repository listed in kirodotdev/KiroCrewApps. Remove the BUILTIN_NAMES row, the apps/builtins/mood_music/ tree, website/src/apps/mood-music/, the registry, icon and manifest rows, the app-assets directory and the app-specific CSP host.

BLOCKING — src/kiro_crew/apps/builtins/mood_music/backend/routes.py:268

+    return MoodStore(app_data_dir(APP_NAME) / "state.json")

Trigger: Every handler calls _store(), and each call builds a new MoodStore that has its own threading.Lock() (store.py __init__). Picture a like or skip (_handle_feedback) arriving while the poll's _handle_set_queue or a _handle_add_moment is running. Each runs in its own asyncio.to_thread worker, takes a different lock, and does a read-modify-write of the same state.json.
Outcome: The last atomic_write wins and silently drops the other write: a recorded moment, a like/skip feedback entry, or the new queue. The class docstring promises the document sits "behind a lock", but that lock never excludes another request.
Anchor: residual/crash-data-loss-corruption
Fix: Serialise all writers on one lock: a module-level lock in store.py, or one cached MoodStore per path.

[BLOCK-MERGE] 2c19635
[OPUS-REVIEWED] 2c19635

Verdict parsed from the review's SHA-scoped output markers for commit 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 2c19635d2eabdb58478c6bf5fabc1bba0cc41f42 false-positive: <reason, 20 to 500 characters>

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Moving Mood Music out of core: the plan

This PR adds Mood Music as a built-in, which AGENTS.md "No built-in apps" and the 2026-11-01 decision do not allow. First Principles and Design are right. No override will be asked for. The app moves to its own repository, and core gets one small app-agnostic seam. This PR does not get more builtin fixes.

1. The app repository

It is first-party, so it starts from KiroCrewCaptain/kirocrew-app-template and follows the layout kirocrew-app-personal-shopper already uses. Where the repository lives is still open: the owner decides.

kirocrew-app-mood-music/
├── app.json                 name "mood-music"; ui.entry dist/index.mjs; ui.pages /apps/mood-music;
│                            backend.hooks.routes; agents; skills; ui.frameSources (section 2)
├── agents/dj.json           mood-music-dj, tools web_search + web_fetch only
├── skills/mood-music/SKILL.md
├── backend/
│   ├── _host.py             the only App Kit touchpoints: route records, ctx.require_owner, ctx.health
│   ├── links.py             video id / bilibili host checks (unchanged)
│   ├── store.py             JSON store under the app data dir (unchanged)
│   └── routes.py            relative AppRoute paths: /state /moments /queue /queue/{id}/feedback
├── ui/
│   ├── src/                 MoodMusicPage, NowPlaying, MomentsTab, MoodBackdrop, links.ts, moods.ts,
│   │                        replyParse.ts, request.prompt.ts, hostSdk.ts (app-sdk via __kirocrew_modules)
│   ├── i18n/                the 51 strings per locale from this PR
│   └── dist/index.mjs       committed build
├── assets/                  icon, hero light/dark, screenshot-main.png
├── tests/                   test_links, test_store, test_routes, test_owner_gate,
│                            test_no_host_imports, test_manifest_contract
├── capture/ + docs/media/   README screenshots and recording (template harness)
├── README.md, CHECKLIST.md, LICENSE, NOTICE, .github/workflows/ci.yml

What changes when the code leaves core:

Concern Built-in (this PR) App repo
Routes register_routes(app) with full paths backend.hooks.routes returns relative AppRoute records
Owner gate require_owner_dashboard_request import ctx.require_owner(request, op); refuses everyone when missing
Page builtinRegistry.ts row ui.entry ESM bundle at /apps/mood-music
Strings 13 core locale catalogs ui/i18n/ in the app
Hidden worker slot seams.py worker-slot mode not reachable from an installed app (core reads modes once at import). The slot becomes an app-owned named slot (embed_app). It shows in the chat sidebar under the app's folder, which is acceptable
Trust exempt, ships in the wheel the user trusts the app at enable; the README says so
YouTube iframe hard-coded frame-src in server.py declared by the manifest (section 2)

The UX fixes the UX lane asked for are already written locally (a chip starts a search, and the motion toggle reads "Pause background motion" as text). They ride into the app repository, not onto this PR.

2. The core seam: a manifest declares its frame origins

The page plays YouTube in an iframe, and ui.pages run in the dashboard document, so the dashboard frame-src decides. Core gets one generic field, in its own PR:

  • ui.frameSources: string[]: at most 8 entries. Each must be an exact https://host origin: no path, no port, no wildcard, no user info, no IP literal, no localhost, and no public suffix (HOST_RE + PUBLIC_SUFFIXES from apps/app_hosts.py). The manifest validator refuses anything else.
  • The gateway adds the declared origins to the dashboard frame-src only for apps that are installed, enabled and trusted. The set is computed on enable, disable, trust and uninstall and cached; the CSP middleware never reads a manifest per request.
  • It opens no capability the app lacks: a trusted ui.pages module already runs in the dashboard document, and img-src already admits every https host.
  • Tests: validator refusals (path, port, http:, wildcard, IP, public suffix, too many); frame-src carries an enabled app's origin and drops it on disable; a disabled or untrusted app adds nothing; existing CSP pins stay green.
  • Docs: manifest-reference.md gets a ui.frameSources row; app-kit-platform.md records the CSP rule.

Mood Music then declares "frameSources": ["https://www.youtube-nocookie.com"].

3. How this PR ends

  1. Open the core seam PR (section 2) from fresh main. It names no app.
  2. Build the app repository once the owner names where it lives, with the README, tests and CI the template asks for.
  3. Request the listing through the App Store listing request; a maintainer authors the catalog/official-registry.json entry in KiroCrewApps.
  4. Close this PR without merging, with a comment linking the seam PR and the app repository. Issue Mood Music: an app that plays songs matching how you feel #36991 stays open until the listing ships, and is retitled to the app repository plan.

Nothing in this PR is pushed again in the meantime.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 14, 2026
iamwhatever added a commit to iamwhatever/kirocrew-app-mood-music that referenced this pull request Nov 14, 2026
Ported from the Kiro Crew built-in draft (kirodotdev/KiroCrew#37035) to an
external app: backend.hooks.routes with ctx.require_owner, the page as a
committed ESM bundle, strings in ui/i18n, and ui.frameSources declaring
https://www.youtube-nocookie.com for the in-page player. Includes the UX
fixes from that PR's review: a mood chip starts a search, and the motion
toggle says it pauses the background.

Co-authored-by: zejiangg <zejiangg@amazon.com>
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Closing in favour of the standalone app, per the migration plan above and AGENTS.md "No built-in apps".

  • App repository: iamwhatever/kirocrew-app-mood-music (CI green on main at 1e1a2f81ed). It carries this PR's code ported to App Kit hooks, plus the two UX fixes the UX lane asked for.
  • Catalog listing: kirodotdev/KiroCrewApps#78.
  • Core seam: the ui.frameSources change is a separate core PR; the listing names it once it is open.

The feat/mood-music branch is kept. Issue #36991 stays open until the listing ships.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mood Music: an app that plays songs matching how you feel

1 participant