Skip to content

音楽的な判断を Jev に任せる (v0.2) - #1

Merged
mrmt merged 11 commits into
mainfrom
claude/jev
Sep 19, 2026
Merged

mrmt merged 11 commits into
mainfrom
claude/jev

Conversation

@mrmt

@mrmt mrmt commented Sep 19, 2026

Copy link
Copy Markdown
Owner

概要

elevator-two の判断 (手元の乱数と種) を、TypeSafe の Jev に文脈つきで問い合わせるようにした。設計は docs/DESIGN.md の D-3〜D-9。

  • 中継の Worker (worker/, D-3): api.typesafe.ai は CORS で弾かれるので、POST /decide だけを受ける Worker を置いた。質問文は Worker 側の表 (KINDS) だけが持つ。kind・質問 id・選択肢の形とサイズ、オリジン、IP ごとの回数を絞る。キーは TYPESAFE_API_KEY の secret
  • 数小節先に問い合わせる (D-4): onBar() はその場で応答を待てないので、planSpark / planDub と同じ予約の形にした。間に合わなければ two と同じ判断に戻る。3回続けて失敗したら32小節休む
  • 分布から引く (D-5): 最大確率は取らない。jev スライダー (既定 0.8) の割合で Jev の分布から引き、残りは手元で引く。0 なら two と同じ
  • 任せる判断 (D-8):
    • 次のシーン・遷移の方式・シーンの長さ
    • キーと進行・平行移動の転調・lush
    • フレーズ型・第3層イベント・ダブ
    • リフの旋律 (6つの候補から選ぶ)
  • monitor (D-9): 状態・応答時間・Jev と手元で決めた数・直近の判断を出す。開発用に ?jev=0 / ?jevurl= / ?jevlog / ?scenebars= を足した

確かめたこと

  • npm test: 93 passed / 2 skipped。新しい tests/jev.spec.js 7件を含む。Worker の応答は page.route で差し替えた
  • npm run test:worker: 9 passed
  • wrangler dev (キーなし) に実際のクライアントから要求を送った。scene / phrase / riff は検証を通って 503 (jev not configured) が返った
  • harmony を含む全種類の実際の要求を parseRequest に通した。すべて通り、最大でも約2KB
  • wrangler deploy --dry-run が通る

まだのこと

  • 本物の Jev での試聴。TypeSafe の API キーがまだ無い (early access の waitlist)
  • Worker のデプロイと、elevator-noise.com の /three/ への配置。プライバシーポリシーも「通信しない」前提なので見直す

🤖 Generated with Claude Code

https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb

mrmt and others added 11 commits September 19, 2026 10:11
POST /decide だけを受け、質問文は Worker 側の表から組み立てる。
形とサイズ、オリジン、回数を絞り、確率と confidence だけを返す。

Co-authored-by: Claude Code <claude@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb
シーンの展開、キーと和声、フレーズとイベント、リフの旋律を、数小節先に問い合わせて
その小節で使う。応答が無ければ two と同じ手元の判断に戻る。jev スライダーで任せる割合を決める。

Co-authored-by: Claude Code <claude@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb
push は main だけで起動する。PR のブランチで push と pull_request の2本が走っていた。
Node 22 の node --test はディレクトリを受けないので、ファイルを glob で渡す。

Co-authored-by: Claude Code <claude@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb
v5 は node20 で動き、廃止の警告が出ていた。v6 以降は node24。

Co-authored-by: Claude Code <claude@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb
(edit) が付くと陰陽が波に従わなくなる。jev は判断の任せ方で、雰囲気の操作ではない。

Co-authored-by: Claude Code <claude@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb
何を問い、何が返り、そのうち何を使ったかを1件3行で、新しい順に5件まで出す。

Co-authored-by: Claude Code <claude@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb
ヘッダーのタグライン、about のフッター、package.json の説明。

Co-authored-by: Claude Code <claude@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb
プライバシーポリシーで「中継はログを残さない」と書くので、既定に頼らず設定で保証する。

Co-authored-by: Claude Code <claude@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb
滑らかに寄せる current.jev は 0 にならず、0 にしても問い合わせが続いていた。
問い合わせるかどうかは目標値 target.jev で決める。

Co-authored-by: Claude Code <claude@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb
desc.html と knowledge-model.html を three として書き直した。音源と規則は two と同じまま、
判断の重み付けを Jev に相談する層を足した節と、各節の該当箇所を直した。
誤ってコミットしていた desc.md / knowledge-model.md を消した。

SCENES.md の two の決定番号の置換漏れを直し、ARCHITECTURE.md の古い記述
(まだ無いもの、control の群) と Jev の節 (D-11 / D-12)、開発用の指定を更新した。
タグラインを agentic electro music player にした。

Co-authored-by: Claude Code <claude@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb
Co-authored-by: Claude Code <claude@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eh8BhqRx1yK8ANC5BXmJbb
@mrmt mrmt self-assigned this Sep 19, 2026
@mrmt
mrmt merged commit af2f2dd into main Sep 19, 2026
1 check passed
@mrmt
mrmt deleted the claude/jev branch September 19, 2026 02:43
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.

1 participant