Skip to content

Rework agent onboarding: introduce_yourself + warmup_verse (practice slots) - #13

Merged
keepkalm merged 1 commit into
mainfrom
cursor/onboarding-rework-9f20
Sep 30, 2026
Merged

keepkalm merged 1 commit into
mainfrom
cursor/onboarding-rework-9f20

Conversation

@keepkalm

Copy link
Copy Markdown
Owner

What

Implements build-order step 1 of the onboarding plan in docs/AGENT_ONBOARDING.md (PR #12): the front-door onboarding rework. Fixes the core complaint — today a newcomer is pushed straight into a live battle against the seeded house MC, so the only listenable thing is Rift's verse and battles stall with no opponent.

Changes

  • introduce_yourself (new MCP tool): one guided call that names the agent, sets its voice, and drops its intro rhyme — folds register_agent + set_voice + submit_intro into a single step and returns a playable intro. Idempotent: re-calling updates voice / fills a missing intro and never mints a second identity.
  • warmup_verse (new MCP tool): spit a solo verse over a beat into the agent's own practice slot — no opponent needed — so a newcomer produces a listenable take of its own before challenging anyone. Practice does not score (prevents farming) and the slot is not joinable.
  • battles.kind column ('battle' | 'practice') added idempotently via ensureSchema(). Guards added to join_battle (can't join a practice slot) and submit_verse (can't verse into one); practice slots excluded from list_battles and the home page (renderHome).
  • Onboarding narrative (src/onboarding.ts) and nextOnboardingStep updated to the new front door (introduce_yourself → warmup_verse → call/battle).
  • Existing tools (register_agent, set_voice, submit_intro, call_to_stage, challenge_agent, join_battle, submit_verse) remain fully backward compatible.

Verification

npm run typecheck passes. End-to-end tested against wrangler dev --local by driving the full MCP OAuth flow (dynamic client registration → PKCE consent → token) and calling the tools over the real JSON-RPC /mcp transport. 13/13 assertions passed:

  • introduce_yourself returns ok, sets has_intro, points to warmup_verse; idempotent re-call returns the same agent id and preserves the existing intro.
  • warmup_verse opens a practice slot, stores the verse, reports scored: false; second round into the same slot works; duplicate round is rejected.
  • Practice slot is retrievable via get_battle and renders at /battle/{id} (HTTP 200, verse visible), but is excluded from list_battles and the home page.
  • A different, fully-onboarded agent is refused when trying to join_battle a practice slot.

Testing note: MCP tokens are bound to resourceMetadata.resource (https://rapbattle.lol/mcp), so auth can't validate over 127.0.0.1. For the local E2E only, I temporarily disabled resourceMetadata, ran the tests, then reverted it — that change is not part of this PR (the server boots on the unmodified production config). The audience binding is OAuth infrastructure, orthogonal to the tool logic under test.

TTS audio is generated by Workers AI, which has no local emulator, so intro/verse audio_url is null under wrangler dev --local; text + records persist and pages render. Audio works in deployed environments.

Follow-ups (later build-order steps)

issue_challenge / accept_challenge / duck, the beat marketplace, mixtape, and agent-only monetization remain as described in docs/AGENT_ONBOARDING.md.

Open in Web Open in Cursor 

…slots)

Implements build-order step 1 of docs/AGENT_ONBOARDING.md.

- introduce_yourself: one guided call that names the agent, sets voice, and
  drops the intro rhyme (folds register_agent + set_voice + submit_intro).
  Idempotent; never mints a second identity.
- warmup_verse: solo practice verse over a beat into the agent's own
  'practice' battle, so a newcomer produces a listenable take before ever
  challenging anyone. Practice slots are not joinable, never scored, and are
  hidden from list_battles and the home page.
- battles.kind column ('battle' | 'practice') via ensureSchema; guards in
  join_battle and submit_verse; exclusions in list_battles and renderHome.
- Onboarding narrative + nextOnboardingStep updated to the new front door.

Existing tools (register_agent, set_voice, submit_intro, call_to_stage,
challenge_agent, join_battle) remain fully backward compatible.

Co-authored-by: Kyle Alm <keepkalm@gmail.com>
@cursor

cursor Bot commented Sep 30, 2026

Copy link
Copy Markdown

Follow-up / status:

This PR implements build-order step 1 of the onboarding plan in #12 — the front-door rework:

  • introduce_yourself (name + voice + intro in one idempotent call)
  • warmup_verse (solo practice slot so a newcomer has a listenable take before challenging anyone)
  • battles.kind = battle | practice, with practice slots non-joinable, unscored, and hidden from list_battles + the home page

Verification: npm run typecheck passes; end-to-end tested against wrangler dev --local by driving the real MCP OAuth flow (dynamic client reg → PKCE consent → token) over the JSON-RPC /mcp transport — 13/13 assertions green (intro→warmup routing, practice storage/retrieval, list_battles/home exclusion, join refusal by another agent, idempotent re-registration). Details in the PR description.

Not blocking review, worth knowing:

  • MCP tokens are bound to resourceMetadata.resource (https://rapbattle.lol/mcp), so local auth over 127.0.0.1 was only possible by temporarily disabling that block during the E2E; it was reverted and is not in this diff.
  • Workers AI (TTS) has no local emulator, so audio_url is null under --local; audio works when deployed.

Next up (per #12): issue_challenge / accept_challenge / duck, then the beat marketplace, then the daily mixtape and agent-only monetization (Phase 1 stubbed money rail).

Ready for review — happy to adjust naming or the practice-slot semantics before I build the next step.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
rapbattle ff0deb4 Sep 30 2026, 04:14 PM

@keepkalm
keepkalm marked this pull request as ready for review September 30, 2026 17:08
@keepkalm
keepkalm merged commit d1b9115 into main Sep 30, 2026
2 checks passed
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.

2 participants