Repository navigation
feat(j5): agents draft persona edits, and the Owner saves them - #938
Jacksondr5 merged 14 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
This review includes 47 billable files and costs up to $11.75. Or wait 52 seconds for your next included review. View limit details
|
tyler-barton-horizon
left a comment
There was a problem hiding this comment.
Automated review of this layer of stack pingdotgg#933 (diff against its base branch). Findings were not individually verified against the source, so please treat them as likely issues and push back on any that are wrong.
🤖 Generated with Claude Code
| export default Effect.gen(function* () { | ||
| const sql = yield* SqlClient.SqlClient; | ||
| yield* sql` | ||
| CREATE TABLE j5_persona_draft ( |
There was a problem hiding this comment.
j5_persona_draft rows are never pruned, and each stores a summary of up to 64 KiB plus fields_json.
j5_propose_persona is pre-approved in every runtime mode. An agent that redrafts after each reply, or loops, adds rows of up to roughly 128 KiB each with no cleanup, so statev2.sqlite keeps growing.
There was a problem hiding this comment.
No expiry is deliberate for now. Drafts are one-use, each one is capped by the 64 KiB definition limit, and drafting means an agent asking a person, not a background loop. Happy to add cleanup if it shows up in real databases.
|
The stack needs a restack before review. None of #932–#938 contains its base branch's current head. Each upper layer was built on an earlier commit of the layer below, and the review fixes pushed to the lower layers afterwards never reached the layers above. The tip,
For example, at the tip This matters for the merge as well as the review. Each upper layer's diff against its base currently reverses the fixes below it. So Please rebase each layer onto the current head of the one below it, bottom to top, and push. GitHub's Posted by Claude Opus 5.5. |
15fa40c to
1083a9d
Compare
|
Thanks again, you were right. The upper layers were cut from older heads of the layers below, so the tip was missing those 13 fixes and a top-down merge would've dropped them. Restacked bottom to top: #937 is now at 0d6b550, and #938 sits on it at 1083a9d, with the post-restack review fixes on top (head 18f85e0). Ready for the panel. |
|
Jackson's calls on two behaviour changes in this stack. He's keeping both as built:
The panel's code review and live test are running on Posted by Claude Opus 5.5 for Jackson. |
|
Panel review of the stack (#931 → #938) at Blocking1. Allow this once isn't bound to the launch the Owner allowed (#937; A grant is checked against the caller and the persona only. It doesn't record which model or access level was refused, or which definition. So a retry can ask for more than the Owner saw, under the same
Suggested fix: store what the refusal showed: the definition digest, the access level and the model entry or entries. A retry that asks for anything broader is refused. Keep the caller and persona binding and the single-use update you already have. Should fix2. A mention inside a code block counts as the person's pick (#931;
Suggested fix: treat CommonMark's code forms as quoted together: backtick and tilde fences, and indented blocks. Adding them one at a time leaves the same gap open. 3. A Crew seat naming an invalid persona is told it's missing (#937; Crew prevalidation uses Suggested fix: drop that existence preflight and let Considered and not raised
Checked and found sound
Jackson's two product calls are in the comment above. Posted by Claude Opus 5.5. |
j5_read_persona reads a persona as Export YAML with its digest and origin. j5_propose_persona validates a create or edit like Settings and stores a draft. An ask with persona_draft_id carries the draft's trusted summary (changed fields with an instruction line diff, or the full definition, plus both override warnings for a folder persona). The Owner-only j5.inbox.savePersonaDraft RPC saves it once, through editImported, a new folder override, or createPersona, and answers the ask. Migration 054 adds the drafts table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Allow this once becomes OwnerAskAction, which shows an ask's one Owner action: Allow this once for an escalation, or Save persona for a draft, in the Inbox and the Captain's dock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Inbox renders an ask as markdown, so the instruction diff and the warnings ran together. The summary now uses paragraphs, a fenced diff block for the instructions, and a fenced YAML block for a create. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The catalog entry carries overridesFolder for an imported copy over a folder persona. Agent Setup shows "Overrides <folder>" instead of "Personal", and its tooltip, or the line under the name on mobile, says it hides the team version for everyone on this server and that Remove, then Restore, brings it back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A drafted name or description with a line break is refused, and the summary shows names, descriptions and models as inline code, so Markdown in an agent's value can't style the part of the ask the Owner trusts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If the library write succeeded but marking the draft saved did not, the retry saw a changed digest and said nothing was saved. It now recognizes the persona already holding the draft's fields, marks the draft, and answers the ask. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A persona_draft_id ask now sets freshAsk, as an escalation ask does, so it is refused before anything is written when the agent already has an ask open with that person, instead of landing on an exchange that carries another draft or an escalation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
J5's summary of a draft rides on personaDraft as data instead of being appended to the agent's message, so the agent's markup can't hide, swallow or imitate it. The web Inbox and dock show it with J5RecordPanel, and the mobile Inbox as plain text under the ask, as the escalation record does. The summary is plain text now: quoted values and indented blocks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since #924 an ask to a person always opens its own exchange, so a draft ask no longer needs freshAsk. Its record must still stay on the ask that opened the Inbox item. j5_send_message refuses persona_draft_id on a regarding follow-up to another ask, and authorizeAsk refuses a draft whose ask is still open, naming that ask: follow up there, or clear it and ask again. On a follow-up to the ask the draft already sits on, the id is dropped and the follow-up goes. One check covers escalation_id and persona_draft_id. A revised draft goes as a new ask. The tool description and docs say the same in place of "fresh exchange". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The persona contract's section bodies drop their issue links and credits, which move to its History lines. The user guide drops the provider and access checks from switching a worker's model and the list of whose work an independent reviewer reviews, keeping what the person does and sees. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5df3396 to
eb0bbbc
Compare
|
Taking over the rebase onto #924 (Jackson's call, 2026-11-07). Bryant, thanks for the stack. Jackson asked us to finish the rebase so it can land before the upstream 0.1.7 build. All six layers are force-pushed onto
Resolutions
Verification
Mobile follow-ups from the iOS pass are in #962, #836 and #967. They wait for 0.1.7. Jackson's docs and UI sign-off stands, and I'll merge the stack once CI is green. |
Summary
Changing a persona always meant opening Agent Setup and filling in the form by hand. No agent tool could read a full definition or save one, so "make the code reviewer stricter about tests" went nowhere in a conversation. Now an agent drafts the create or edit, asks me, and an Owner saves it with Save persona on the ask. Closes #786.
Read.
j5_read_personareturns:folderwith its file, orimported, which covers personal personas too since they're stored the same way;It's read-only.
Draft.
j5_propose_personatakescreatewith every Settings field, oreditwith the read'sexpected_digestand only the fields that change. The id is fixed on edit.createdDefinition/editedDefinitionhelpers in the library.j5_persona_draft(migration 054) and returns adraft_id, the summary, and any warnings.Ask. The proposer, or as a Captain a member's proposer, asks me with
j5_send_message(expect_reply,persona_draft_id). The ask has to open its own exchange, the same as feat(j5): a blocked persona escalates, and the Owner can allow it once #937's escalation asks: if the agent already has an ask open with me, it's refused before anything is written. J5's summary rides on the Inbox item, not in the agent's words, and shows as plain text in feat(j5): a blocked persona escalates, and the Owner can allow it once #937's Recorded by J5 panel:An ask carries
escalation_idorpersona_draft_id, never both, so it has at most one Owner action. Nothing the agent writes can hide or imitate the summary. Values show quoted, and a drafted name or description with a line break is refused, so it can't fake a line of the summary either.Save.
j5.inbox.savePersonaDraft(AuthSettingsWriteScopeplusrequireOwner) saves first, then answers the ask with a fixed reply.editImportedwith the draft's digest.overrideSource: an imported copy with the same id, on or off as the folder persona was, after checking the folder definition's digest. The folder file is never written.createPersona, and the id must still be free.Button. Personas: a blocked persona escalates, and I can allow it once #785's Allow this once button becomes
OwnerAskAction. It shows an ask's one Owner action, Allow this once or Save persona, in the web/desktop Inbox and the Captain's dock. Mobile shows the ask without it, as with Personas: a blocked persona escalates, and I can allow it once #785.Override badge. In Agent Setup, an imported copy that overrides a folder persona reads Overrides instead of Personal. The catalog entry gets an optional
overridesFolderthat old clients ignore. The tooltip on web and desktop, and the line under the name on mobile, says it hides the team version for everyone on this server, and that the way back is Remove, then Restore. The label choice is tested inagentPersonas.test.ts.Guidance. One bullet in the standing instructions covers drafting, asking, and save suggestions. A suggestion never blocks work, goes through the Captain inside a Crew, and nothing saves without the ask. The tool descriptions state the override meaning, and say that remove, restore, on/off and folders stay in Settings.
Live testing
Pass, at 09f3171 plus the summary-format fix (346d9d1), on a
setup-agent-live-test.tshome (no flags), with 3 Claude Haiku 5.5 turns.Ask. In a new thread I asked in plain words, without naming any tool, for the haiku-helper persona to run
pnpm testbefore it says it's done, and to send me the change to approve. haiku-helper is a folder persona in the test home. The agent read it, drafted the edit, and asked me withpersona_draft_id, and it warned me about the override in its own words. The Inbox item showed J5's appended summary with both warnings, and Save persona.Typed reply. I answered in words, asking for the failing test names too. Nothing was saved: there was no imported file, and the first draft stayed open on its answered ask. The agent drafted again and asked again (turn 2).
Save. I pressed Save persona as the Owner. The ask closed with the fixed reply, and the agent summed it up correctly (turn 3). The test home then showed:
saved, with the Owner assaved_by;haiku-helperat version 2, enabled as the folder persona was;Way back. Remove, then Restore, in Agent Setup brought the folder version back (Folder · personas). No imports were left, and the folder file was still untouched.
Found and fixed. The Inbox renders an ask as markdown, and the first summary's instruction diff and warnings ran together into one bulleted paragraph. 346d9d1 fixed that by fencing the diff. The summary has since moved out of the message into the Recorded by J5 panel (18f85e0), so the first two captures below show the earlier in-message rendering. I haven't re-run the summary live since then; the J5RecordPanel test and the server tests cover it.
Not live:
These are covered by tests.
Evidence
agentPersonaDrafts.test.ts, "an edit of a team persona warns first, then saves as an override the folder never sees": the summary has the instruction diff and both warnings, and drafting writes nothing. After the save, the override is imported, still off, at the next version, and the folder file is byte-identical. A second save writes nothing. The override's Export YAML loads through a folder library unchanged. Remove plus restore brings the team version back.agentPersonaDrafts.test.ts:<details>,**and a link reach the panel's text exactly as written. The refusal test also turns down a description with\n\n**J5:** …;handlers.test.ts, the send test: a draft ask's message is just the agent's words, and it setsfreshAsk.SendService.test.ts(feat(j5): a blocked persona escalates, and the Owner can allow it once #937) shows a refused fresh ask writes no events.lineDiff.agentPersonaLibrary.test.ts, "an override of a folder persona is what every launch on the server loads". The library has no per-person view, so a guest's launch loads the override like anyone's. The test also covers a stale digest and a second override, both refused.ClientActionsService.test.ts, "saves a persona draft for the Owner, once, and never on an answered ask": the fixed reply, and a retry reusing the same answer command. An ask already answered is refused and the draft stays open. An ask without a draft is refused.handlers.test.ts:j5_read_personaandj5_propose_personathrough the toolkit, with the library and the folder file unchanged afterwards;persona_draft_idcarries the summary, and one with both ids is refused.clientRpcPermissions.test.tsandwsRpc.test.tslistj5.inbox.savePersonaDraftas Owner-only, so an operate-only client is refused;outsideAgent.test.tsrefusesj5_propose_personafrom an outside agent;vp test run src/j5/agents/agentPersonaDrafts.test.ts src/j5/a2a/ClientActionsService.test.ts src/j5/agents/agentPersonaLibrary.test.ts src/j5/a2a/mcp/handlers.test.ts src/j5/wsRpc.test.ts(fromapps/server)vp run check:changed: format, lint, knip, typecheck (32 packages) and tests (48 files, 623 tests) all pass.reactCompilerCoverage.test.tspasses (1427 tests) withOwnerAskAction, which has no??=.vp test run src/reactCompilerCoverage.test.ts(fromapps/web)mcp-tool-useorchestration cases at head (09f3171), 2 samples per case and a 3rd where they disagreed.opus-review-too-via-delegate0 of 2 (it failed on Personas: a blocked persona escalates, and I can allow it once #785's base too) andthread-mention-without-link-after-read2 of 3.delegates-then-new-thread-with-modelpassed 2 of 2.node --env-file-if-exists=../.env mcp-tool-use/run.ts --cases mcp-tool-use/cases/orchestration.jsonl --model claude-sonnet-5-5 --out runs/786-head(fromevals/)Not verified:
mcp-tool-useharness has no J5 tools (Evals: a J5-owned suite that offers J5's tools #936).UI changes
A new Save persona button next to Answer, in the Inbox item and the Captain's dock, in the same slot as #785's Allow this once. It only shows for an Owner, on an ask carrying an open draft. Its tooltip says who the save affects, and for a team persona that it hides later team updates.
Captured at 1280x800 on the live test above (346d9d1), as the Owner:
I took the Agent Setup shot at bffb9e8 on the same home after a restart. Remove plus Restore had cleared the saved override, so I recreated it with Import → Persona file over the team file. No agent turns. The dock button wasn't captured (see Live testing).
Merge Danger
Door: two-way for code. Migration 054 only adds a table; a revert leaves it and any draft rows behind unused. A persona someone saved stays in the library after a revert, and Settings can still edit or remove it.
Blast Radius: the persona library's write paths (
editImportedandcreatePersonanow share their definition builders with drafts), the Inbox and dock answer row, andj5_send_messageasks. If saving is wrong, an Owner's approved draft could fail to save, or land as an override when it shouldn't.After merge: nothing.
Restack. This sits on #937's final head (0d6b550) after the bottom-to-top restack.
Checklist
FORK.md(case text and file-table row) in this PR (none touched)docs/j5/product/upstream.md(none)AGENTS.md)docs/j5/product/and user docs rewritten where this changes themSurfaces walked:
persona_draft_idonj5_send_message; the button in the Inbox and the dock. Settings' own editor is unchanged.j5_propose_personais a coordination tool, since it writes only a draft.overridesFolderon the persona catalog entry, an optionalpersonaDraftonHumanInboxItem,AgentPersonaDraftView, and the new action RPC.Made with Claude Opus 5.5 in Claude Code (J5 Code).
🤖 Generated with Claude Code
After the rebase onto #924
The Recorded by J5 panel sits above #924's follow-ups:
A follow-up carrying the record's own id keeps the record in place, and the summary names providers as Claude and Codex:
A person's model switch on iOS, with the next turn running on GPT-6 Luna: