Repository navigation
Closed
Labels
Description
Overview
Two small generic gaps stand between the Play engine and the rules ADR-092 ships. A rule cannot read whether a checkbox is checked except by matching its text, and the CLI's update and status commands cannot say which version of a node they are changing, so two agents can both start the same task. This issue closes both.
Problem Statement
- Checked state is only in the content. A checkbox stores
- [x]or- [x]as a prefix of its content, and its checked state is derived from that. A Play condition or a query filter that needs "is this checked" has to match the prefix as a string. No shipped rule does this today, and a prefix match is fragile (- [X], leading whitespace). - Single-node writes carry no version. The daemon refuses a write that names a stale version, but
nodespace node updateandnodespace node set-statussend none, so the daemon applies them to whatever is current. Two sessions that both read an open task and both set it toin_progressboth succeed.
Proposed Solution
- Derived attributes are declared and readable. Each primitive type's derived attributes are declared in the type registry. A Play condition reads one by name on a node map (
c.checked), and a query filter can name one.checkboxdeclareschecked. - Writes can name a version.
nodespace node updateandnodespace node set-statusaccept the version the caller read. A stale version is refused with the version conflict the daemon already produces, and the message says the node changed and what its version is now.
Both are generic: neither knows about tasks or checklists.
Documentation
- ADR-094 §5 (derived attributes are readable) and §6 (a write names the version it read); Build order step 3
- ADR-092 §2, §6 and §7 - checklists as criteria, the rules that read
checked, and claiming a task by version - ADR-086 - the registry; primitive types have no schema fields and their attributes are derived from content by one pure function each
- Node Types §3 - primitive types and what each derives
- Playbook system - what a condition can read
- Updates:
components/node-types.md(derived attributes are readable by rules and queries),architecture/playbook-system.md(conditions read derived attributes),packages/skill/references/cli.mdandSKILL.md(the version flag and what a conflict means)
Architecture Impact
Implements ADR-094 §5 and §6. Derived attributes stay derived: nothing is stored, in line with ADR-086.
Acceptance Criteria
Derived attributes
- The registry declares a primitive type's derived attributes;
checkboxdeclareschecked(boolean), computed by one function. Onlycheckedis declared: the other derived values (a header's level, a code block's language) stay undeclared until a rule or query reads them - A Play condition reads
checkedon a checkbox reached throughhas_child:node.has_child.exists(c, c.checked == false)is true for a node with an unchecked checkbox child and false otherwise - Save-time validation accepts a derived attribute on the type that declares it and refuses it on a type that does not
- A query filter can name a derived attribute; "nodes with a checkbox child that is not checked" can be written and returns the right nodes
- The derived value follows the content: editing a checkbox's prefix changes what the condition and the filter see, with nothing stored
- A derived attribute cannot be written; a write naming one is refused
- The engine has no content-prefix matching for checked state; one function decides it
Version on writes
-
nodespace node updateandnodespace node set-statusaccept a version; with one, the write succeeds only if the node is still at that version - A stale version exits non-zero with a message that names the node, the version given and the current version;
--jsoncarries the same as structured output - Without a version the commands behave as today
- Two writes that name the same version: the first succeeds and the second is refused; a test runs them concurrently
- The built-in agent's update tool accepts a version the same way
General
-
references/cli.mdandSKILL.mddocument the version flag and tell the agent to re-read a node after a conflict before deciding what to do;bun run skill:checkpasses - Docs updated as listed under Documentation
- Code passes
bun run quality:fix - Tests pass (
bun run test:changed)
Technical Specifications
Reference Files
packages/nodespace-types/src/-CoreNodeTypeand the registry entriespackages/core/src/behaviors/mod.rs- the checkbox behaviour and its derived statepackages/core/src/playbook/cel.rs-node_to_cel_value_at_scope,is_core_key;packages/core/src/playbook/graph_resolver.rs- related-node values;packages/core/src/playbook/validation.rs- save-time path checkspackages/core/src/services/query_service/mod.rs- filter targetspackages/cli/src/commands/node.rs-updateandset_status, which passversion: Nonetoday; delete already takes a versionpackages/core/src/services/error.rs-VersionConflictpackages/proto/proto/node_service.proto- the update request's version
Implementation Details
- A derived attribute is declared once, in the registry, and both the CEL value builder and the query service read that declaration. Do not special-case
checkboxin either. - In SQL the attribute has to be computed from
content; keep the expression next to the Rust function and test that the two agree on the same inputs. - The daemon already maps a version conflict to an error; the CLI needs to print it usefully, not as a generic RPC failure.
Related Issues
- Make spec, plan and decision core types with checklist criteria and seeded rules; remove the installable methodologies #3542 (the rules that read
checkedand the claim that uses the version) - Run a saved query by id or title, narrow it at run time, negate filters, and filter into link and object values #3554 (the saved-query forms a derived-attribute filter combines with)
Non-Goals
- Recording which session holds a task
- A lock across devices
Activity
malibio commentedon Oct 5, 2026
Baseline — Frontend: 317 test files passed, 5733 tests passed
Let rules and queries read a checkbox's checked state; let update and…