Repository navigation
feat(playbooks): steps name the persona that does them - #380
Conversation
A playbook step may carry `persona: <persona-id>`. playbook_list, the new read-only playbook_read tool, and every step tool return it. A persona that is missing from the library or turned off shows up as a non-blocking entry in `warnings`, never in `issue`, so the definition still starts. The check is shared with propose_crew through personaCatalogProblem. Settings on web and mobile show each step's persona and the warnings. Closes #319 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: Jacksondr5/j5code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID:
Comment |
Jacksondr5
left a comment
There was a problem hiding this comment.
[Review panel: Opus 5.5, Astra, Sonnet 5.5, Sol 6.1]
Approving. All four reviewers agree #380 is ready. Three of us ran it live on a copied database: persona-tagged steps show their persona in the library, a missing persona gives a non-blocking warning, and playbook_read returns the personas.
FORK.md needs no change here. The existing registration.test.ts | A | 4, 45 row and case 4 already cover adding a tool name to the inventory.
…sonas Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
docs/user/playbooks.md keeps the step-persona paragraph ahead of #314's reworded /playbook paragraph. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
instructions.ts keeps the persona authoring line and appends #381's mention bullet. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Problem
A playbook step had no way to say which persona should do it. A
persona:line in the YAML was silently dropped, and the only way an agent could read a playbook's prompts was to start a run. So a Captain couldn't plan a Crew from a playbook. This is the first story of the Crew playbooks milestone (#319); #320, #321, #322, and #323 build on the contract it adds.What I changed
packages/contracts/src/j5/playbook.ts→PlaybookStepgains optionalpersona(anAgentPersonaId). NewPlaybookWarning(persona_missing|persona_disabled|persona_unverified, withstepId,persona,message) andPlaybookReadResponse. Discovery entries gain an optionalwarningslist and steppersona;issuekeeps its meaning.apps/server/src/j5/agents/agentPersonaLibrary.ts→personaCatalogProblem, extracted fromCrewProposalService.validateSeats, which now calls it. One place decides whether a persona is "missing or turned off", so the playbook warning and thepropose_crewrefusal can't disagree.apps/server/src/j5/playbooks/PlaybookStore.ts→stepPersonaWarnings, a lazily cached catalog read perdiscover(only when a step names a persona),definitionPathForshared bystartand the newread. A catalog read failure becomespersona_unverifiedwarnings and never fails a list or read.apps/server/src/j5/playbooks/mcp.ts→ new read-onlyplaybook_read({ name })tool that returns every step's prompt and persona without creating a run.playbook_listand the step tools returnpersonatoo.apps/server/src/j5/a2a/mcp/j5ToolPreapproval.ts→playbook_readjoinsJ5_PREAPPROVED_TOOLS, so Claude and Codex threads can call it without a prompt.apps/server/src/j5/playbooks/instructions.tsandPLAYBOOK_AUTHOR_INSTRUCTIONS→ agents learn aboutplaybook_readandpersona, and Playbook Author callslist_personasbefore writing one.PlaybookLibrarySettings.tsx) and mobile (PlaybookLibrarySettingsScreen.tsx) → each step shows its persona, and warnings appear under the steps without disabling Start or Rename.docs/user/playbooks.md→ the example names a persona on one step, plus a short paragraph on warnings.Before (
j5/main: thepersona:lines are dropped):After (each step shows its persona; the turned-off and missing personas get non-blocking warnings):
Why this shape
issue. Both Settings screens disable Start and Rename wheneverissueis set, and a missing persona shouldn't block a playbook.playbook_readnever touches run state. It takes no permit, runs no SQL, and bumps no revision, so a Captain can read a playbook while its own run is active.warnings ?? [].Invariants
playbook_readcreates no run and no request receipt, and leaves an active run's pointer, run count, and revision unchanged.playbook_readaccepts the same kebab-case names asplaybook_startand resolves only inside<workspace>/.j5/playbooks(real-path containment).issue, never fails a list or read, and never blocksplaybook_start.propose_crew's refusal text and behavior are unchanged; only the lookup moved into the shared helper.PlaybookProgress.stepsstays{ id, title }.Surfaces
playbook_readthroughJ5_PREAPPROVED_TOOLS; other adapters get the same read-only tool under their own policy, as withplaybook_listpackages/contracts)src/j5/playbook.tsapps/server/src/mcp/toolkits/worktree/registration.test.ts(the exact tool inventory), already covered by the FORK.md ledger row for cases 4 and 45; no FORK.md editdocs/user/playbooks.mdOut of scope
@playbook:composer mention (Mention a playbook with @playbook: in the composer #320, which also depends on feat(playbooks): suggest registered names after slash command #314).Upgrade and data
None. No migration. Existing playbooks without
personabehave exactly as before, and YAML withpersona:on an older server just drops the key again.Verification
vp test run packages/contracts/src/j5/playbook.test.ts apps/server/src/j5/playbooks/PlaybookStore.test.ts apps/server/src/j5/playbooks/mcp.test.ts apps/server/src/j5/playbooks/PlaybookLibraryHttp.test.ts apps/server/src/j5/playbooks/PlaybookHttp.test.ts apps/server/src/j5/a2a/mcp/j5ToolPreapproval.test.ts apps/server/src/j5/a2a/mcp/handlers.test.ts apps/server/src/j5/a2a/mcp/tools.test.ts apps/server/src/j5/a2a/mcp/registration.test.ts apps/server/src/mcp/toolkits/worktree/registration.test.ts apps/server/src/j5/a2a/CrewProposalService.test.ts packages/client-runtime/src/j5/playbooks.test.ts: 12 files, 139 tests pass.discoverandreadand through the MCP handlers, withplaybook_startstill succeeding. There's also apersona_unverifiedcase with an unreadable catalog, one test coveringpersonathrough start, current, next, back, and reselect, and a read-isolation test.personaCatalogProblem's missing-persona branch fails both the new store warning test and the existingCrewProposalServicerefusal test.vp exec tsc --noEmit -p .inpackages/contracts,apps/server,packages/client-runtime,apps/web, andapps/mobile: clean.vp linton the changed files: one warning, which predates this change (an unusedfsinagentPersonaLibrary.ts).Review focus
PlaybookStore.readanddefinitionPathFor: name checks and containment, and confirmingreadhas no side effects on run state.personaCatalogProblemextraction inCrewProposalService.validateSeats: missing is still checked before turned-off, and the refusal wording is unchanged.Closes #319
Claude Opus 5.5 via J5 Code (crew: planner, builder, and two reviewers on Claude and Codex)
🤖 Generated with Claude Code