Repository navigation
Require a description on every play rule, condition and action, and reject stale ones - #3529
Conversation
Pragmatic Code Review — PR #3529Review Type: Initial review (no prior reviews or comments on the PR). Read-only: diffs and code were read; no builds or tests were run (the author reports SummaryThe change does what ADR-090 §1 and §7 specify, in the right layers: the shape lives once in Requirements Check (issue #3517)
Questions the author asked to have checked
Code Review Findings🔴 CriticalNone. 🟡 Important1. Duplicate rule names make the stale check compare against the wrong rule
The error message is also ambiguous, since it identifies the rule by name alone. Recommendation: reject duplicate rule names in 🟢 Suggestions2. A whitespace-only edit counts as a rewritten description Descriptions are compared with 3. One shipped description understates the rule it describes The legal moves are unset → future, future or unset → active, active → closed ( 4. The reset exemption trusts a client-writable marker
5.
Nit: Nit: Nit: What was verified and how
Recommendation: APPROVEThe change is a clear net improvement and matches the spec. Finding 1 is worth folding into this PR because it is small and belongs to the same check; the rest are optional. |
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 (commits 'Address review…' and 'Regenerate the Jira playbook reference')Addressed
Skipped
|
Pragmatic Code Review — PR #3529Review Type: Re-Review. Scope: Previous Review Summary
Status of each previous finding
Questions asked for this re-reviewIs the duplicate-name rejection correct? Yes.
Could it wrongly block anything? No case found.
Is the trimmed comparison right? Yes. Both the stored and the incoming text are trimmed before comparing, so padding in either direction is not a rewrite, and the blank check already trimmed. A change of case or inner spacing still counts as a rewrite; the first review noted the check cannot stop a determined writer, and that remains true and acceptable. Findings🔴 CriticalNone. 🟡 ImportantNone. 🟢 Suggestions (all optional)Nit: a duplicate name can also produce an unrelated stale error in the same rejection On an update, the second rule of a duplicated name is still matched against the first stored rule with that name, so the rejection may list a stale error for it next to the duplicate-name error. The write is rejected either way and fixing the name clears both, so this is only extra text in an agent's repair message. Skipping the stale comparison for a rule already reported as a duplicate would remove it. Nit:
Nit: the play's own summary and its reject message still name only two moves The play-level description ("any sprint_status change other than future → active or active → closed") and the message shown on a rejection ("A sprint moves only from future to active, and from active to closed") still leave out the first setting to future and the start from no status. Neither is a rule, condition or action description, so they are outside ADR-090 §1 and outside finding 3; mentioned only because the rule text next to them is now more precise than they are. What was verified and how
Recommendation: APPROVEEvery finding from the first review is addressed or skipped with a sound reason, the duplicate-name check is correct and runs only at the save-time gate, and the two commits introduce no new problem. The three nits are optional. |
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 addressedThe re-review approved with three optional nits; all three are skipped, so there are no new commits.
Re-review decision: NO RE-REVIEW NEEDED — nothing changed since the reviewed head |
…eject stale ones (closes #3517) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…mmed - Two rules of a play sharing a name are rejected: a rule is matched to the stored rule by name, so a name has to identify one rule - Padding a stored description is not a rewrite of it - The Jira transition rule's descriptions name the start from no status - Say what the reset exemption relaxes, and pin `rules: null` with a test - serde_path_to_error is declared in the workspace dependency table Skipped: renaming SchemaRule (belongs with the play-authoring skill that uses it), and reporting description and schema errors in one pass. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
347f2bc to
d4a5c06
Compare
Closes #3517. Implements ADR-090 §1 and §7.
The type change
playis a structured core type; its kind and category are unchanged. The change is to the nestedRuleDefinitionvalue stored inplay.rules:RuleDefinition.descriptionRuleDefinition.conditionsstring[](CEL)RuleCondition[]:{ expr, description }, both requiredActionvariantaction_type,params,for_eachdescriptionTriggerNo field, relationship or structural rule of the
playschema changes, sonode-types.mdalready matches (node-types:checkpasses). Generated TypeScript is regenerated (rule-condition.tsis new). Pre-release: no migration of stored plays; reset the database.Validation
rule[0] ('greet'): conditions[0]: invalid type: string …, expected an object { "expr": …, "description": … }. Stored rules and the typed update report the same text. This usesserde_path_to_error, a new direct dependency ofnodespace-types(already in the lockfile).playbook/descriptions.rs, called fromvalidate_play_rules) rejects a blank description, and on a write that changesrules, a stale one: a changed conditionexpr, a changed action (action_type,params,for_each), or a changed ruletrigger/classthat keeps its stored description. Rules match byname, components by index; an unmatched component or a renamed rule is new. Messages readrulecomplete parent, condition 2: its expression changed and its description didn't. ….rulesalone runs neither check, so a play can still be switched off.playbook-system.mdnow say it (nodespace-docs 572303e).The engine, CEL compiler,
get_workflow_stateand graph resolution work on compiled rules, so the only reader that changed isparse_rule, which now compilescondition.expr.Seeds, CLI and skill docs
_seed.default_rules. Tests check each through the description checks; the install tests take them through the rest of save-time validation.node update --property rules=…. A new integration test covers the round trip and both rejections over gRPC.play-rule-descriptions,play-stale-description) in agent and skill forms, tied by anchors and a shared JSON example that is decoded as a realRuleDefinition. The skill form is rendered into a new generated region ofreferences/cli.md.SKILL.mdis unchanged (it is at its size cap). The agent forms are not included by any seeded skill yet; the play-authoring skill will include them.Testing
bun run test:changedpassed on every tier (frontend, scripts, skill, browser,types:check,node-types:check, Rust workspace) before the final commit. After it,quality:fixfound one e2e fixture in the old shape and one clippy lint, both fixed; the e2e tier itself runs only in the merge gate.Test fixtures were converted mechanically (placeholder descriptions such as "Test rule"); the production seeds were written by hand.
🤖 Generated with Claude Code