merge: integrate official game audio into main

This commit is contained in:
2026-09-21 16:36:19 +08:00
28 changed files with 1874 additions and 41 deletions

View File

@@ -0,0 +1,58 @@
# Task: Implement official game audio client
## Identity
- Task ID: 20260921-game-audio-client-b74d9f31
- Mode: Feature
- Branch: codex/20260921-game-audio-client-b74d9f31-game-audio-client
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260921-game-audio-client-b74d9f31
- Base commit: d222d175000008bad5f344577679256d22a636c2
- Owner: codex
- Status: Ready for Integration
## Scope
- GA-03 offline implementation of ML-GAME-AUDIO-001: typed Main audio client, durable delivery, adapter, bundled resources/project-wide catalog, composition and focused tests/README. Preserve image generation, Data Service, local packages and selected-model Web Search. No root workspace, server, deployment or paid-provider writes.
## Intent And Constraints
- Concurrent Task Gate PASS: bundled start exited 0; status matches this task, feature mode, owner codex, exact branch/worktree/base. Root retains three foreign untracked records. Peer records were read at registry-derived paths; planning peers are old read-only reviews/undefined records and separate WeChat diagnosis. Undefined scopes remain unknown context, not ownership authority; no concrete overlapping audio implementation decision found. Completed image delivery is a read-only prerequisite.
- Project Context Loaded: entry/read-before-planning, planning-gate, memory-index, own record, positioning (placeholder; AGENTS/README establish actual product), current-state integrated snapshot, decision index/system overview, module map/data flow, domain rules/glossary/success criteria, relevant evidence/reflection/commitment/stale indexes and ADR-008. Approved server-side design at f6eabf253a4b4cd27f7f31fdf8e93afe21d7fcdd is the audio authority.
- Planning Gate Passed: one optional bundled project-wide plugin; current Plugin sheet stays in Project Configuration (older /plugins design route is superseded by actual integrated routing). Main owns Works auth, exact admission, durable identity, polling and all-output delivery. Child remains empty; no partner gate, picker, new store authority, Provider credentials, remote playback URLs, second save confirmation, or local generation rerun.
- Plan: client public HTTP contract TDD; durable pre-submit receipt/query-only recovery and sequential materialization with shared lease; adapter/manifest/static operations; composition/startup resume; focused image/Plugin regressions, typecheck/build and relevant Electron proof. No subagents.
- External limits: no authorized paid Meowa call or production activation; real response/media samples and PG proof remain separate. Routine client compatibility floor will be 2.0.1, paired with server migration 0093; no package publication implied.
## Outcome
- GA-03 offline implementation complete. Main-only typed client uses fixed server routes, closed receipts, bounded streamed bodies, frozen account epoch and one same-body 401 refresh. Nullable hosted amounts normalize to the generic capability receipt's omitted optional field.
- Durable intent is saved before POST; lost response uses by-operation only. Saved outputs and missing indices persist in userData. Startup/account reconnect resumes original jobs; transient download/status errors schedule query/delivery-only recovery. Definite pre-submit rejections remain not_started, while unknown post-submit failures cannot claim no charge. Shared local-project lease covers only writes/tracker, never generation/network waiting. Every output uses wx semantics in the frozen original project and no second confirmation.
- New adapter + one official optional bundled game-audio plugin expose music full, explicit music preview, sound single/pack/variants, cancel. Native price/release/project/request authority stays in Main. Four static tool-operation mappings, project-wide parent availability and empty child scope; no new picker/store/partner gate or provider secrets.
- Result card displays saved relative paths/MIME/bytes and loads local audio only after a click, with native controls/no autoplay. Reuses bounded project media reader through a receipt/account-owned Host route; no Provider URL or audio payload enters model messages. Composition shares leases/tracker and resumes receipts. Registry manifest duplicate checks now use plugin/capability/operation identity (global tool names remain unique), permitting two distinct audio capabilities to both name operation generate.
- Additional owned paths beyond the initial outline: read-only saved-audio Host route and composition service port, export of existing media reader, Chat progress/preview component and test, relevant effective-resolver/manifest/Registry/artifact assertions, one synthetic-audio Electron case reusing the existing first-chat fixture, README and package version 2.0.1. No plugin navigation/store authority changes.
- Packaged continuation corrected two actual pre-existing artifact-check assumptions in the already-owned verifier: schema-2 skill_only project-scaffold legitimately has no adapter/tools, while hosted plugins still require tools; current Renderer uses plugin-tab-available/plugin-tab-installed rather than deleted introductory copy. Tests cover the real shipped scaffold and negative hosted-without-tools case. No application/Plugin UI code changed in this continuation.
## Verification
- 2026-09-21 continuation: same task start/status PASS, original base/branch/ownership retained. Reused unchanged project context and audio design, re-read AGENTS/own record and active peer scopes (read-only/undefined reviews and WeChat diagnosis). Planning Gate Passed for local packaged artifact verification only. Build output remains ignored and unpublished; no root workspace, user installation, production API or paid-generation changes.
- TDD RED→GREEN at transport, delivery, adapter/Registry seams; tests cover literal confirmation, fixed mode/pricing/identity, streamed bounds, account change, lost response, automatic recovery without repeat POST, partial restart, owner-only local preview, no fake not_started after submission and nullable receipt normalization.
- Final focused set before the normalization refinement: 7 files / 45 passed. Final refined transport/adapter/delivery slice: 3 files / 13 passed. Typecheck PASS. Full lint PASS (0 errors, 8 existing CloudAgents/CloudCosts/Home/Makelore warnings); final scoped ESLint includes the added Electron test, PASS.
- Full initial unit run: 2,133 passed / 2 skipped / 1 failed (unchanged pi-managed-worker-opener test expects runtime-v6, unchanged runtime is v7). Subsequent broad run excluding only that stale test file and isolated pressure: 244 files / 2,136 passed / 2 skipped; pressure 1/1 PASS. Later additions tested in focused runs; no false full-clean claim.
- Initial Vite Renderer/Main/Preload/utility build PASS. Artifact verifier requires game-audio ID and hosted route. The continuation below builds and checks a Windows installer; real-provider GA-04 acceptance remains open.
- Actual built Electron synthetic-audio test PASS 1/1 (2.5s): saved result→expand process/tool→explicit preview→native audio duration 0.25s and paused/no autoplay; screenshot visually inspected. It mocks the existing Host seam with a synthetic PCM WAV, not Meowa generation or live billing. First run only needed opening the existing collapsed process group in the test.
- Existing plugin-marketplace/project-plugins Electron diagnostics 4/4 FAIL on stale assertions (removed introductory copy, old local/bundled buttons, old scope=project URL). Those test files and Plugins/ProjectConfiguration product modules have no task diff; current base uses 可选/已安装 tabs and scope=all. These failures are recorded, not hidden or repaired as part of audio.
- Windows continuation: `corepack pnpm run package:win` PASS with --publish never; installer release/Makelore-2.0.1-win-x64.exe (212375107 bytes) and win-unpacked/Makelore.exe produced locally. Product source is committed 09e0ce5cf3d113b3bb7b128b2b04bc355d16173b; at build time only this task record was dirty. Later continuation changes are verifier/test/documentation only. Packaged metadata has no embedded gitCommit; the runtime verifier reports source HEAD as fallback, so this is not represented as embedded commit attestation.
- `node scripts/verify-packaged-electron-runtime.mjs --allow-dirty --manifest release/game-audio-artifact-verification.json` PASS: Electron 43.4.0 / Node 24.18.1, native/Unicode-copy checks, self-contained Python/uv/npm and installer existence. --allow-dirty covered the owned task record only at that time. Existing verifier SHA256 output for the installer: 27741ADBD9CFD45C10701D1146A88866CAF7ED2F6B541EA41AED54FC849C9F32. No new checksum mechanism was added.
- `node scripts/verify-pi-product-artifact.mjs --report release/game-audio-pi-verification.json` PASS on that actual unpacked product after the two verifier corrections: shipped audio manifest/Skill/four tools, main-reachable hosted route, all bundled resources and pinned Pi 0.84.2 closure/worker/session tests. Its global cross-platform runtime aggregation remains partial (no Linux run here; macOS/prior Provider waivers are not new acceptance). `node scripts/verify-publish-runtime.mjs` PASS for packaged npm 11.6.2; this command verifies only and does not publish.
- Final verifier unit tests 18/18 PASS; scoped ESLint and final typecheck PASS; task-aware doc drift and diff-check PASS. Raw artifact reports stay under ignored release/. Paired server task separately verified real PostgreSQL 16.13 migrations and concurrent billing with synthetic Meowa responses. No real Meowa generation, user-machine install, signing/distribution claim, merge, push or production activation occurred.
## Follow-ups
- GA-00/GA-04 HOLD: real Meowa final result shape, MIME/size/count/expiry/charge and paired live accepted-generation journey remain unverified. Scoped PostgreSQL concurrency and Windows packaging are now verified separately, not substitutes for that journey. No new fee/rate invented and no live generation, publication, install, push, deploy or merge.
- A real accepted generation using the paired server and packaged client still requires separately bounded paid-canary authorization, plus actual price activation by Operations. The playable synthetic Electron fixture is not a substitute.
- Unrelated base runtime-v6 and old plugin-page E2E assertions need their own maintenance task; no source reset/stash/clean or root worktree writes performed.
## Promotion Candidates
- Target: current-state/module-map/domain rules at integration. Add project-wide Game Audio >=2.0.1, single confirmation→internal polling→all-file auto-save, separate job/delivery/billing phases and receipt-owned local preview. Evidence: public seams, actual built Electron test and paired server record. No conflict with image delivery, Data Service or selected-model Web Search; shared IDs and protocol remain unchanged.
- Target: evidence/commitments. Promote scoped Windows package and paired PostgreSQL evidence; preserve real-provider/end-to-end activation holds and exact baseline diagnostic failures. Human confirmation required for paid canary/activation; no canonical promotion in this feature worktree.