Skip to content

feat(activation): license a demo song and name first-run next actions - #1009

Open
seonghobae wants to merge 96 commits into
developfrom
feat/licensed-demo-first-run
Open

feat(activation): license a demo song and name first-run next actions#1009
seonghobae wants to merge 96 commits into
developfrom
feat/licensed-demo-first-run

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Product outcome

A musician who opens BandScope with no song loaded can start tonight's rehearsal from the empty workspace. The buyer sees Try the demo and Use my own song. The original CC0 Late Night Set package enters the same downstream local-audio bootstrap/analysis contract as a user-selected file after stricter immutable-resource validation.

This is the licensed-demo slice of #964. It does not close first-run measurement, role/goal onboarding, or #770 MIR acceptance; #828 still owns #770.

Exact current identity

  • Protected target: develop@749511c3ad4000090048718f685c6bee6b3d2c25.
  • Branch: feat/licensed-demo-first-run.
  • Exact current head: d25512e9a8b8eb50713398d850b7b629015e05d1.
  • All predecessor-head checks and reviews are historical only.

Current root-cause repairs

  • Local, demo, YouTube, and Open Project intake share one synchronous workspaceIntakeInFlightRef authority. Competing handlers fail closed before awaiting native work; failed replacement preserves the prior valid selection.
  • Concurrency regressions cover duplicate picker calls, project-open/source races, YouTube-vs-picker racing, and stale replacement analysis.
  • The canonical demo package is synchronized across WAV, provenance, supplemental inventory, runtime byte/PCM contract, and cross-file regression coverage. No temporary self-modifying/source-fix workflow remains.
  • parseDemoProvenanceManifest preserves the established provenance wire contract at one anti-corruption boundary while translating generic external keys to semantic runtime names.
  • Licensed-demo identity uses bounded currentLicensedDemoProjectId / currentLicensedDemoJobId fallback authority and renderer-reload continuity.
  • Exact-head audit found dormant apps/desktop/src/lib/job_runner.ts synthesizing successful browser analysis despite the repository fail-closed contract. c5bc6c8e060771f601bcae98db654b128efe431e added the RED regression; 11d454029c366159ed414e13dae2d851927c6892 removed synthetic browser enqueue/retry/cancel success and translated touched organization-owned generic locals to semantic multiword names while preserving IPC wire keys at the bridge; f1013db6581a028cca9229d6e99027ab70e78815 recorded the behavior in CHANGELOG.md.
  • Current-head review then proved native local-source validation overwrites the licensed-demo request label with late-night-set.wav, while the engine builds the ready progress label from that validated source label. d9d2614cb7eab063bb1e3ab08ca53cf0dd318a0c adds the RED native-bridge regression requiring both the start response and later polling to display Analysis ready for Late Night Set; 61dd36a11a50c1dc92526d7af709cafc07469d5c normalizes only an authenticated licensed-demo job's ready-state progress label/result title in the renderer, preserving ordinary local-audio authority and native IPC compatibility; d25512e9a8b8eb50713398d850b7b629015e05d1 records the buyer-visible correction in CHANGELOG.md.
  • The corresponding actionable review thread is resolved. The separate observation about process-crash restoration is a future native persistence prerequisite: current native job/project state is session-scoped and feat(activation): license a demo song and name first-run next actions #1009 claims ordinary renderer reload continuity, not process-crash recovery.
  • PR docs(gap): refresh product-technical baseline (74 repos, live census) #1116 remains the single canonical owner of docs/product-technical-gap-baseline.md; its live PR metadata was refreshed with the 74-repository / 2,915-open-PR census and this feat(activation): license a demo song and name first-run next actions #1009 repair evidence. No checks or approvals transfer between PRs.

Security Notes

Bundled resources, file paths, URLs, IPC payloads, and provenance are treated as untrusted at their owning boundaries. Browser-only execution must not manufacture production analysis success. The demo resource is fixed-size and structure validated; provenance is not filesystem authority. Renderer title normalization is restricted to the previously authenticated licensed-demo job identity and never permits arbitrary renderer-provided labels to override normal local-source metadata. No telemetry, demo download, generic exec capability, vulnerability suppression, pull_request_target, administrative bypass, or force-push is introduced.

Verification boundary

Fresh repository and central checks must be evaluated only on unchanged exact head d25512e9a8b8eb50713398d850b7b629015e05d1. Queued/pending checks are non-passing. Historical COMMENTED reviews and predecessor successes do not qualify as last-push approval.

Merge gate

Keep unmerged until the unchanged exact head has every applicable required CI/security/SAST/SBOM/coverage/review gate terminal-success, zero valid unresolved findings/review threads, a qualifying independent non-author approval current for the last push, and ordinary branch protection accepts the merge. Never self-approve, bypass protection, weaken a gate, suppress findings, manufacture status, or transfer predecessor evidence.

A clean launch now offers Try the demo and Use my own song. The bundled
Late Night Set package is original CC0 audio with provenance hashes and
enters through the same local-audio bootstrap as a user-selected file.
Browser fallback fails closed. #828 still owns #770; do not mix with
#811, #897, or #828. Canonical npm HIGH findings remain #783-owned.
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

첫 실행 빈 작업공간에 CC0 Late Night Set 데모와 사용자 파일 선택을 추가했습니다. 데모 provenance와 고정 PCM WAV를 검증한 뒤 로컬 오디오 부트스트랩으로 연결합니다. 브라우저에서는 데모 선택과 분석을 fail-closed로 처리합니다.

Changes

라이선스 데모 오디오

Layer / File(s) Summary
데모 패키지 계약과 provenance
apps/desktop/src/lib/demo.ts, apps/desktop/src/lib/demo.test.ts, apps/desktop/src-tauri/resources/demo/*, scripts/generate_licensed_demo_wav.py, apps/desktop/core/src/lib.rs, services/analysis-engine/tests/*
provenance 매니페스트, CC0 자산, WAV 생성기와 고정 PCM 검증을 추가했습니다. 데모 길이, 세그먼트 구조, 공급망 자산 체크섬도 검증합니다.
Rust 오디오 검증과 Tauri 명령
apps/desktop/src-tauri/src/main.rs, apps/desktop/src-tauri/tauri.conf.json, apps/desktop/src-tauri/capabilities/main.json, apps/desktop/src-tauri/permissions/autogenerated/select_demo_audio_source.toml, apps/desktop/src-tauri/tests/demo_resource_contract.rs
번들 WAV를 검증하고 select_demo_audio_source로 프로젝트 부트스트랩을 생성합니다.
분석 브리지와 첫 실행 UI
apps/desktop/src/lib/analysis.ts, apps/desktop/src/lib/analysis.test.ts, apps/desktop/src/App.tsx, apps/desktop/src/App.test.tsx, apps/desktop/src/features/workspace/*, apps/desktop/src/locales/*, apps/desktop/vite.config.ts
데모 선택, 소스별 안내, 분석 제목 보정, 브라우저 fail-closed 동작과 UI 테스트를 추가했습니다.
소스 선택 직렬화
apps/desktop/src/App.tsx, apps/desktop/src/App.localSelectionConcurrency.test.tsx
데모, 로컬, YouTube, 프로젝트 열기 작업을 하나의 in-flight 경계로 직렬화합니다.
문서와 공급망 기록
AGENTS.md, ARCHITECTURE.md, CHANGELOG.md, CLAUDE.md, docs/activation/licensed-demo.md, supply-chain/supplemental-component-inventory.json, .jules/palette.md, .github/workflows/materialize_demo_asset.yml
데모 흐름, 라이선스, 리소스 패키징, 체크섬 갱신 절차와 접근성 기록을 갱신합니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: 🟡 Moderate · up to d806a

The new Try the demo flow currently cannot initialize because the packaged audio size conflicts with the native validation contract, making the advertised first-run action unavailable. The package validation workflow also accepts a changed license checksum as trusted metadata, so these issues should be corrected or explicitly accepted before merging.

Sequence Diagram(s)

sequenceDiagram
  participant EmptyState
  participant App
  participant AnalysisBridge
  participant TauriCommand
  participant RustValidator
  participant LocalAudioBootstrap

  EmptyState->>App: Try the demo 클릭
  App->>AnalysisBridge: selectDemoAudioSource 호출
  AnalysisBridge->>TauriCommand: select_demo_audio_source invoke
  TauriCommand->>RustValidator: 번들 WAV 검증
  RustValidator-->>TauriCommand: LocalAudioSourcePayload
  TauriCommand->>LocalAudioBootstrap: 프로젝트 부트스트랩 생성
  LocalAudioBootstrap-->>App: ProjectBootstrapSummary
  App-->>EmptyState: 분석 시작 안내 표시
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 15 files. (1 skipped: 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 CC0 데모 곡 라이선스와 첫 실행 동작 이름 지정이라는 PR의 주요 변경 사항을 정확히 요약합니다.
Full details: Docstring Coverage

Explanation

Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 15 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/licensed-demo-first-run

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

devin-ai-integration[bot]

This comment was marked as resolved.

github-code-quality[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

seonghobae commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Repair the current-head licensed-demo WAV structural-validation defect on the existing feat/licensed-demo-first-run branch only. Exact current head 127db192c1e65752a6eac443ea1d8e36e0a9fa2e, protected base develop@acdbea6344fe1231c39535b575f4de35e4c607c9. Current validate_demo_audio_source in apps/desktop/core/src/lib.rs verifies path authority, exact expected file size, and only the first 12 RIFF/WAVE bytes; current tests can construct a mostly-zero fixed-size file that passes. The valid current review finding is PRRT_kwDORjvEXs6bh-xP: malformed same-size resources with missing/invalid RIFF size, fmt , or data structure can be admitted and fail later in analysis.

Use TDD on this same branch. First strengthen/retain a realistic RED regression proving malformed chunk structure is rejected while the actual bundled apps/desktop/src-tauri/resources/demo/late-night-set.wav is accepted. Then make the narrowest dependency-free Rust fix at validate_demo_audio_source: boundedly parse the bundled WAV container, verify the RIFF declared size is consistent with the file, require a valid fmt chunk and a bounded non-empty data chunk, reject duplicate/out-of-bounds/truncated required chunks, and validate the generator's fixed PCM contract (channels/sample rate/bits/sample format) where those values are authoritative. Preserve the existing symlink/canonical-path/filename/exact-byte-size fail-closed checks; do not add a decoder dependency, touch package/lock files, suppress security findings, or alter #783 ownership. While editing that exact core boundary, move the misplaced score-path Security Notes/rustdoc back onto resolve_existing_score_pdf and give the demo validator its own accurate trust-boundary doc, addressing PRRT_kwDORjvEXs6bh9NU without changing score behavior.

The same exact head also has a repository release failure that must be cleaned before exact-head verification. Release run 32667144321, job 97262243061 checked out the PR merge for this head and reported desktop 207 passed / 4 failed. Treat these as stale test-contract/harness failures, not reasons to change stable production semantics:

  • App.test.tsx: expected select_demo_audio_source as a one-argument invoke, but the canonical invokeAnalysis(command, args?) helper already passes undefined as the second argument on protected develop; update the expectation rather than changing the bridge.
  • analysis.test.ts: expected failed browser AnalysisJobStatus.result to be null, while the shared type is optional result?: RehearsalSong and current fail-closed status omits it; update the test to the canonical optional contract.
  • Workspace.test.tsx: Korean empty-state test still expects old heading 분석 준비 완료; this branch intentionally changed first-run copy to 오늘 합주를 시작하세요; update the stale expectation.
  • WorkspaceStates.test.tsx: the action-oriented error test calls render() repeatedly and then getByRole("alert"), leaving two alerts mounted. Use one render plus rerender() (or explicit cleanup) so the test verifies one state at a time.

After the WAV/root-cause repair, apply only those test-contract corrections that still reproduce on the successor exact head. Run focused core/Tauri tests, desktop targeted tests, cargo fmt --check, typecheck, and the applicable canonical quickcheck/full gates. Commit only to this existing branch, report the resulting exact head/evidence, and do not merge or force-push.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Continue the existing feat/licensed-demo-first-run owner branch from exact head 5bddc15bde2612400a108b2148a7abdcdd67bb20 only; re-fetch before writing and preserve the just-landed CC0 clarification and provenance-order docs. Repair the validated current-head demo intake correctness boundary before cosmetic findings. apps/desktop/core/src/lib.rs::validate_demo_audio_source currently accepts any exact-size file with bytes 0..4=RIFF and 8..12=WAVE; the existing write_sized_demo_wav test helper proves this by constructing an otherwise zero-filled 88,244-byte file that demo_audio_validation_accepts_the_licensed_wav_contract accepts. This means a corrupt bundled resource can pass bootstrap and fail only later in analysis. Add the smallest realistic REDs first: malformed RIFF length, missing/invalid fmt chunk, missing/invalid data chunk, and a success path against structurally valid bundled/demo-equivalent WAV bytes. Then make validate_demo_audio_source fail closed on those structural defects while retaining fixed resource name, symlink rejection, bounded reads/size checks, and payload-free DEMO_UNAVAILABLE_MESSAGE. Do not add a new decoder dependency unless the existing Rust/audio stack cannot express the bounded parser. Also preserve #783 dependency-security ownership; no suppressions or lockfile workarounds. After the validator is GREEN, address the same branch's validated duplicate-demo-request race (handleTryDemo can issue multiple select_demo_audio_source calls before any pending state is set) with a synchronous single-flight guard plus realistic rapid-click regression. Run focused Rust/desktop tests, full quickcheck, rust-check, SAST/security/package gates, and report the resulting exact head/checkout evidence. Do not resolve unrelated threads or self-approve.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator Author

@OpenCode Continue this canonical branch in place from exact head c8015b804e1559a40331d205f57988eb9ce3672e; do not create a competing PR/branch and do not touch dependency/security ownership (#783 remains canonical).

Use systematic debugging + TDD + verification-before-completion. Current predecessor CI 32678578923 / job 97291104954 had 5 desktop failures. Three have now been causally repaired on this branch: stale LICENSE provenance metadata, failed-status result null-vs-absent assertion, and WorkspaceStates accumulated-render test isolation. Finish only the still-current items after refetching the live head:

  1. Verify/fix the stale App integration expectation for demo intake: invokeAnalysis intentionally calls the Tauri shim as (command, args) even when args is undefined, so the demo test should match the established bridge contract rather than change production just to satisfy the test.
  2. Verify/fix the Korean empty-state test: current locale authority is workspaceReadyToAnalyzeTitle = "오늘 합주를 시작하세요"; do not revert buyer copy to the predecessor heading.
  3. Then address the still-valid MAJOR review finding in apps/desktop/core/src/lib.rs: validate_demo_audio_source currently accepts any exact-size file with only RIFF/WAVE magic. First add the smallest realistic RED regressions for inconsistent RIFF size and missing/invalid required fmt / data chunks (plus success against the real bundled WAV), then implement a bounded fail-closed RIFF/WAV chunk validation at this existing trust boundary. Do not introduce unbounded reads, generated/demo-only success stubs, or loosen exact-size/symlink/path checks.
  4. Verify the current duplicate-demo-selection review finding; if still live, add a rapid-double-activation RED regression and a synchronous single-flight guard so one in-flight demo selection creates at most one bootstrap root.

After each fix, run focused tests and the canonical quickcheck, refetch exact head/base, and resolve only addressed review threads. Do not suppress inherited nanoid/pdfjs-dist/undici findings or weaken any gate.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@opencode-agent

Copy link
Copy Markdown
Contributor

Queued @opencode-agent for PR #1009 at head 0200dca1feae7bf0cf931435fa254c887e6a08ea. Central exact-name Actions artifacts are the durable dispatch ledger; existing review workflows remain authoritative for the final verdict and failure evidence.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 0 new potential issues.

Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae seonghobae added area: ui-ux Frontend, interaction, design, or user experience priority: high High-priority or P1 work status: needs-review Open pull request requiring current-head review or checks type: feature New or expanded product capability labels Sep 2, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui-ux Frontend, interaction, design, or user experience enhancement New feature or request priority: high High-priority or P1 work status: needs-review Open pull request requiring current-head review or checks type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants