Repository navigation
Teach the native agent to author plays: a Play Authoring skill and typed get_play / update_play tools - #3551
Conversation
Pragmatic Code Review: PR #3551Review TypeInitial review (no prior reviews). Reviewed by reading commit f0adb70 against SummaryA net improvement, and a well-scoped one. The tools write only through the typed Legend: ✅ met, Requirements Check
Code Review FindingsCritical IssuesNone. Suggested Improvements1. 🟡 A play whose rules do not decode is reported as having no rules When Failure scenario: a play synced or imported through the unchecked path holds three rules, one of which no longer decodes. Two smaller points in the same function: Recommendation: when decoding fails, don't emit an empty 2. 🟡 The condition loop walks Failure scenario: a rule on Recommendation: resolve the collection's item type with 3. 🟡 Rejections spell the same position three ways, zero-based and one-based A condition's position is named as Failure scenario: a write with a broken path in the first condition and a stale description on the second returns Recommendation: pick one spelling (the ADR-090 §1 form: rule name plus one-based component number) and use it in 4. 🟡 Play Authoring leads a diagnostic question; consider an The control's comment records that "why didn't the play trigger for that story?" now ranks Play Authoring first, 0.887 to 0.863, and the control was written as top-3 rather than rank 1 to accommodate that. The reasoning given (the read tool is still offered, and the turn stays open) is correct as far as it goes, but that turn now shows the model a write-capable skill as candidate 1 for a question that asks for no change, with Recommendation: let the pending decisions eval answer whether that turn ever writes. If the margin matters, the seed table already has the mechanism for exactly this overlap: an Nitpicks
What is done well
Recommendation: APPROVENo blockers. Findings 1 to 3 are worth folding into this PR, since each is small and same-shaped with what it already touches; finding 4 should be answered by the eval run still pending for criterion 7. Criterion 8 is for the merge gate to confirm. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressed (21fec9a)Addressed
Partly addressed
Not changed
Tests: 4,257 Rust tests pass across agent, core and daemon; |
Pragmatic Code Review: PR #3551Review Type: Re-ReviewReviewed Legend: ✅ met, Previous Review Summary
Finding 1 (undecodable rules reported as
The repair write is not blocked by the broken stored rules: Finding 2 (
Both produce Finding 3 (two index bases in rejections): partly addressed, and the reason holds. The error strings are unchanged. Finding 4 (Play Authoring led a diagnostic question): addressed with the mechanism suggested, and both live guards now assert rank 1. See new finding 1 for what the measured cost implies. Nits.
Requirements Check
Code Review FindingsCritical IssuesNone. Suggested Improvements1. 🟡 The exclusion taxes one of Play Authoring's own requests, and by how much it still leads is not recorded
That is different from the precedent. Graph Editing's exclusion has a control that requires identical scores on its intended requests ( Failure scenario: a nearby phrasing ("stop that rule firing for low priority tasks", "make the rule not run on weekends") sits a little closer still to the exclusion. Play Authoring falls below another skill, and the turn has no Recommendation: non-blocking, and for the pending eval run to settle. Add two or three change requests that use "fire" / "run" wording to 2. 🟢 A nested comprehension, and a comprehension inside a
Failure scenario: Recommendation: much rarer than the single-level case the last review raised, so it need not hold the PR. If it is folded in, resolve each collection's item type once, keyed by its iteration variable, and start an inner collection rooted at that variable from the outer item type; in 3. 🟢 The guard is Two related gaps:
Recommendation: decide by decoding the rules on their own rather than by emptiness (a small Nitpicks
What is done well
Recommendation: APPROVEAll four prior findings are resolved or soundly justified, and the new commit introduces no correctness, security or architectural problem. New finding 1 should be answered together with the eval results still owed for criterion 7; findings 2 and 3 are small and can be folded in at the author's discretion. No re-review is needed unless the exclusion's wording changes. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Re-review addressed (12bbf22)1. The exclusion taxed one of the skill's own requests — fixed by rewording it as the diagnosis rather than the verb: "Diagnose why nothing happened for a node: which conditions are still unmet." Measured on the locked embedding model:
3. Nit — the cron test comment now says at least six fields. Not changed
Re-review decision: not needed. The changes are a reworded string with its measurements, a narrower condition in one function, and comments. 3,791 Rust tests pass, clippy clean. |
Eval results (gemma-4-e4b-q4km, n_ctx 32768, 1 rep, fresh isolated daemon per run)
Routing is identical on both arms: load-bearing 8/8, mutating gate 4/4, compound → route_multi 2/2, single intent at length 2/2. Decisions was run in full on main only. The branch run was stopped partway, at the maintainer's call, so there is no complete branch figure. In the nine scenarios it did score, its one failure ( Retrieval (the mechanism by which a new skill can displace others): all 26 |
|
Merge queue: #3551 was taken out of the queue — the merge gate failed on it, on top of main. Reproduce by merging or rebasing |
12bbf22 to
6fd2b86
Compare
…ped get_play / update_play tools (closes #3519) - get_play returns the typed play (rules with descriptions, enabled, suspension) and the schema metadata of every type its rules reference - update_play writes rules, description and enabled through the typed play update; a rejected write returns the errors naming rule, component and field - Play Authoring is a seeded built-in skill linked applies_to -> play, with its procedure in shared rule fragments for both audiences - Agent turn tests, tool tests, a prompt golden and live retrieval guards Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ead from a collection's items, separate the two play skills with an exclusion - get_play no longer reports rules that fail to decode as an empty list: they are returned as stored, under stored_rules, with decode_error - referenced_types follows paths inside a comprehension's body and a .where() predicate, from the collection's item type - Play Authoring carries an exclusion, so a question about why a rule has not fired leads with Play Workflow State; both live guards now assert rank 1, and the seeded link is asserted through find_skills - The repair guidance names both ways a rejection spells a position - update_play's cron example is sent through the tool in a test; params lists node_type and edge_data; the undeclared play_id alias is gone - link_seeded_skills logs a failed link and carries on Not changed: the validation errors still spell a position two ways (by name, one-based; by index, zero-based). Unifying them means rewriting every location string the engine and its tests fingerprint on, which is wider than this change. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…decide undecodable rules by decoding them alone - The exclusion no longer shares the verbs a change request uses: every measured change request scores what it did with no exclusion, and Play Workflow State still leads each question about why a rule has not fired. The guard gains change requests worded with fire and run - get_play decides whether rules decode from the rules alone, and its description names stored_rules and decode_error - Correct a test comment on the cron field count Not changed: a comprehension nested in another, or inside a .where() predicate, is still not followed by referenced_types. It is rarer than the single-level case and its types are reported by validation on a write. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
6fd2b86 to
05df24c
Compare
Closes #3519. Implements ADR-090 §6.
What changed
get_play(seededtool-native): takes a play id and returns the typed play (rules with their descriptions,enabled, the engine's suspension when there is one) plusschemas: the fields and relationships of every type the rules reference. A play whose stored rules no longer decode is still returned, withrules_error.update_play(seededtool-native): takes a play id and any ofrules(whole),description,enabled. It decodes the rest of the call as the typedPlayNodeUpdateand writes throughupdate_play_node, so a call naminglifecycle_status, a suspension field or anything else is refused whole. A rejected write is a tool result the model can repair from: it names the rule, the component and its index, and for a path the name that is wrong. Its parameter schema states the rule shape, descriptions included.applies_to → playon every open (link_seeded_skills). Its body is plain Markdown and holds procedure only: find, read first, check names against the schemas, say what will change and ask, write the list whole, repair a rejection, on/off. Steps that name how they are done are rule fragments with a form per audience, and the two description rules are the fragments the shipped command reference already renders.playbook::referenced_types(core): the types a play's rules reference, through its selectors (and their filters), condition paths,for_eachpaths,{binding}paths and the types its actions create or retype to.Tests
play: a turn that changes a condition writes rules with updated descriptions; a turn whose first write is rejected for a stale description repairs it and succeeds; "turn this play off" setsenabled = false.tests/it/play_tools.rs): the typed play and its schemas, the suspension, non-play ids, each rejection (stale description, broken path, bare condition, missing description) naming what to fix and writing nothing, the switch, the refusal of lifecycle and suspension fields, and the seeded skill's link (made once across repeated opens).Play Authoring, and a newstage2_play_authoringgolden pins the skill's candidate block and its held tool surface,update_play's rule shape included.Retrieval and evals
With the new skill seeded, all 24 existing
live_skill_retrieval_stabilityguards pass on the locked embedding model, so no existing skill lost a place it is guarded on. The routing and decisions eval results (main vs this branch) are posted in a comment below.Notes for review
update_playis inSINGLE_OWNER_BY_DESIGN: likecreate_schema, rule authoring is its own intent with its own guidance, and no other skill is a plausible second home.bun run test:changedcurrently stops atnode-types:checkon this machine because the shared docs checkout'snode-types.mdlists acli_commandfield ontool-nativethat the schema does not declare. This PR changes no node type; the Rust tiers were run directly (4,658 passed) along withskill:check.🤖 Generated with Claude Code