Repository navigation
Count checkboxes under an Acceptance Criteria heading in the checklist rules - #4402
Merged
Merged
Conversation
Contributor
Author
|
Merge queue: #4402 was taken out of the queue — it conflicts with main in: packages/agent/src/seeds/rules/skill-md/section-create.md. Merge or rebase origin/main, resolve the conflicts, push, and re-run |
mstomar125
force-pushed
the
issue-4396-ac-heading
branch
from
November 27, 2026 08:29
904132a to
3ff1e2d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NodeSpace task: "The checklist rules count checkboxes under an Acceptance Criteria heading, so a task's criteria can sit in a section of their own" (migrated issue 4396).
What changed and why
The checklist rules read a task's direct children only, so a criterion under a heading (a grandchild) was not counted and a task could be finished with criteria open.
node.has_child.exists(h, h.has_child.exists(c, ...)). Path extraction records the enclosing collection (CollectionPath.enclosing). The nested relationship is followed from all items at once. Every item gets an entry, an empty list when it has no children, so one childless heading does not fail the whole condition.node(misspelt relationship, derived attribute on the wrong type are refused). A collection nested deeper than one level is refused rather than saved to never match.core_plays.rs): a criterion is a checkbox that is a direct child, or a child of a direct child header whose text matches^#+\s*(acceptance criteria|ac)\s*$case-insensitively. Used by "Require a completed checklist before finishing a task" (both rules) and "Require success criteria before approving a spec". Refusal messages name the## Acceptance Criteriaheading.section-create,checkbox-item-create(both forms) and the skills Writing a Spec, Splitting into Issues, Creating a Task, Completing a Task, Implementing a Task, Instrumenting a Change say criteria go under## Acceptance Criteria.Shape record
Two seeded Plays change config (
shape-record/current.jsonregenerated) with one change-log entry. Class isreconcile, notadditive: these are existing seeded Plays whose config changes, which the seed system covers (an unedited Play is replaced on open; a user-edited one is kept and the change is recorded for them).additiveis for a new shape absent from an older database. Entry says editedUsersAffected: true, userProducible: true.shape:check,node-types:checkpass.Tests and mutation results
New tests (each mutation-checked individually, reverted afterwards):
an_unchecked_checkbox_under_an_acceptance_criteria_heading_holds_a_task_open(also asserts the refusal names the heading): fails when the nested read is dropped fromhas_unchecked_criterion, when the nested read is not attached, when(?i)is dropped, when the enclosing link is dropped.the_acceptance_criteria_heading_matches_at_any_level_and_case(levels, case,AC, other headings andAcceptance Criteria Draft/ACsnot counted): fails when(?i)is dropped and when the end anchor is dropped.criteria_directly_under_a_task_and_under_the_heading_both_count: passes with the production code, guards the direct-child path and other-heading exclusion together with the tests above.a_checkbox_under_the_heading_satisfies_the_need_for_criteriaanda_spec_with_a_checkbox_under_the_heading_can_be_approved: fail when the nested read is dropped fromhas_no_criterion, and when the nested read is not attached.a_collection_is_followed_one_level_from_its_items_in_one_statement_per_level(resolver): fails when the nested read is not attached, when the unchecked nested read is dropped, when the enclosing link is dropped.a_collection_rooted_at_an_iteration_variable_records_its_enclosing_collection(extractor): fails whenenclosingis not recorded.a_collection_read_from_an_items_relationship_is_validated: fails when nested collections are not validated.a_collection_two_levels_down_from_its_items_is_refused: fails when the depth check is disabled.Cost of the nested read
On a task with 42 children (40 notes, 2 headers) the whole read is 3 statements: one for the children, then one per child node type among them (text, header) for what is under them. The batched walk runs one statement per node type for all roots of that type, so it does not grow with the number of children, but it is per level and per child type, not strictly one per level. Asserted in the resolver test.
Follow-up commit: review fixes
node.has_child.exists(c, ...)andnode.has_child.exists(h, h.has_child...)work in either order. Test with the clauses swapped added (a_collection_is_followed_one_level...). Mutation: restoring the iteration-variable match fails it only together with removing the dedupe; the original-order tests fail with the iteration-variable match alone.git show v0.3.14): v0.3.14graph_resolver.rsskips any collection not rooted atnodeand its extractor does not link a nested collection to its enclosing one, so an item has nohas_child; the nested read raises a missing-key error, whichcel.rsmaps toFail. A failed condition means the reject rule does not fire: an older daemon running the new Plays fails open (does not crash), for a task or spec that has a header child and no directly-unchecked criterion. An older build also replaces an unedited new Play back to its old config on open (seed ping-pong), and edited-Play users keep the old rule. All recorded in the change-log entry. I read the tag source; I did not build or run v0.3.14.create_tasktool is unchanged.a_parent_with_an_open_criterion_under_the_heading_stays_open(fails when the nested unchecked read is dropped). A met item under the heading not excusing an open direct one is covered bycriteria_directly_under_a_task_and_under_the_heading_both_count(fails when the direct read is dropped).skill_rules.rscomment fixed. The skill-retrieval golden digest covers onlyuse_for/not_for, which were not touched;the_recorded_matrix_is_of_the_seeded_textpasses intest:changed.Second follow-up: wording and one test
core_plays.rs: the missing-key error is reached only for a task or spec with a header child named Acceptance Criteria or AC, because'header' in h.type_chain && h.content.matches(...)is evaluated beforeh.has_childis read, so a header with any other name evaluates false first. Clause order is the direct read first, then the heading read: the finishing rule's unchecked condition isdirect unchecked || heading unchecked, so a directly unchecked checkbox is still refused on an older daemon (the||short-circuits before the heading clause), and it fails open only when no direct checkbox is unchecked and an AC header exists; the no-criteria condition isno children || (no direct checkbox && none under the heading), so it fails open only with no direct checkbox and an AC header. The change-log entry now says this.node.has_childunder different variables (greadingmentions,hreadinghas_child). Mutation checks: restricting nested attachment to the iteration variable fails it, and restricting it to nested variablehfails it.current.sha256) is computed from skill titles,use_for,not_forand the matrix requests only; none changed, andthe_recorded_matrix_is_of_the_seeded_textpasses.shape:checkpasses against the committedcurrent.json(only the two Play configVersions changed, regenerated earlier, with the change-log entry).Not covered / follow-ups
create_tasktool writes its checklist as direct children) are not changed: a task whose only criteria sit under the heading may still be listed as needing shaping. Worth a follow-up.🤖 Generated with Claude Code