Skip to content

Make spec, plan and decision core types with checklist criteria and seeded rules; remove the installable methodologies - #3618

Merged
mstomar125 merged 1 commit into
mainfrom
issue-3542-spec-plan-decision-core-types
Oct 5, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-3542-spec-plan-decision-core-types

Conversation

@malibio

@malibio malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Closes #3542. Implements ADR-092 §1 to §6 and §9.

Node type sequence

Type Kind Category Content role Structure Participation
spec concrete core type flat name (the title) any / any not embedded, mentionable
plan concrete core type flat name (the title) any / any not embedded, mentionable
decision concrete core type flat name (the title); body is its children any / any not embedded, mentionable

task and project stay flat: a link is not an object field for the category rule.

Fields added

  • spec: objective (text), boundaries (text), spec_status (closed enum draft / approved / superseded, default draft)
  • plan: approach (text), risks (text), plan_status (closed enum draft / approved / superseded, default draft)
  • decision: decision_status (closed enum proposed / accepted / superseded, default proposed)
  • task: pull_request (link), commits (array of link); status gains in_review (order: open, in_progress, in_review, done, cancelled)
  • project: repository (link)

Relationships added (name → target, cardinality, reverse name / cardinality)

  • spec.tasks → task, many, spec / many
  • spec.decisions → decision, many, specs / many
  • plan.spec → spec, one, plans / many
  • plan.tasks → task, many, plan / one
  • task.decisions → decision, many, tasks / many
  • decision.supersedes → decision, many, superseded_by / many

Rules added: six seeded core Plays with fixed ids (spec approval, plan approval, task lineage, task blockers, task criteria, superseded lock). The checklist conditions read each direct checkbox child's derived checked; nothing matches a content prefix.

Behaviour added: started_at is stamped by the write that first moves a task to in_progress or in_review (and on a create that is already started). Nothing stamped it before.

Removed: packages/core/src/methodology/ (install machinery, the three bundles, their skills and views), the ListMethodologies / InstallMethodology RPCs, the Tauri commands, the frontend service and onboarding step, the three bundle reference files and their generator block, and custom:verification_method.

Docs: components/node-types.md (sheets for the three types, task and project fields, registry list), architecture/data-layer.md, components/seeded-nodes.md, components/query-node.md, components/schema-management.md, architecture/playbook-system.md. Pushed to nodespace-docs main just before bun run merge, as the merge gate reads the published sheet.

Things a reviewer should look at

  • Refusing an older database. The shape check gains a second half (packages/core/src/db/core_type_shape.rs): a database with the right tables must also hold this build's core types. It refuses a core type id held by a non-core schema, and a core schema with a difference only another build can have produced (a bare-named field this build does not declare, a missing field core protects, a changed type or core enum values). What a user may do through the schema API is not a difference: a namespaced field, added enum values, and a removed user-protected field. Nothing reads a stored version. A daemon test opens both shapes and asserts the marker, the byte-identical file and the clean exit.
  • No frontend plugin for the three types. They follow project exactly: no plugin, listed in SIDENAV_CORE_TYPES, recorded in the registry test's no-plugin list, opened in the generic schema-driven viewer. The issue says "in the frontend plugin list"; project, the stated model, has none.
  • Not embedded. The three types follow task and project. As installed types they were embedded by title through the default behaviour.
  • Spec approval at create. A spec created already approved is not refused: ADR-092 §6 lists only the status change for specs (it lists the create case for plans).
  • in_review icon. It shows the in-progress icon; the icon's click cycle is unchanged.
  • Proto. The task and project link fields travel as a new OptionalJsonClear wrapper; the three new typed updates travel as update_json, like collection and skill.

Tests

  • bun run test:changed passes on every tier (frontend 318 files / 5,789 tests; scripts; skill; browser; types:check; node-types:check; Rust workspace).
  • New: core_model_plays_test.rs (a rejected and an allowed case for each Play, seeding, an edit surviving a restart, started_at), typed-update tests in core and the daemon, the core-type shape tests, the daemon refusal test, registry and schema pins for ADR-092 §1, §3, §4 and §5.
  • Not run: the live agent tests and evals (they need the generative model), and the e2e adapter contract test. Their sources were updated.
  • Deleted with the bundles: the four methodology_* core test files, the Linear-bundle skill-retrieval tests, and the generated playbook-doc shell test.

🤖 Generated with Claude Code

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Pragmatic Code Review: PR #3618 (issue #3542)

Review Type

Initial review. No prior reviews or comments on the PR. Reviewed at 774a06c22, with the pending docs commit 07ef792 (local, not yet on nodespace-docs main).

What I ran: core_model_plays_test:: (25 of 25 pass), bun run node-types:check against the pending docs commit (passes, 28 types), bun run skill:check, bun run types:check, and the three push-check scanners (literal node types, lifecycle_status reads, Pro boundary), all clean. Not run: the full pyramid, frontend tests, live model tests and evals.

Findings 1, 2 and 3 are traced through the code, not executed, because the review may not add test files. Each names the lines the trace goes through.

Requirements Check

Checklist conditions

  • ✅ Rules read each checkbox child's derived checked, direct children only, no content prefix (core_plays.rs:175; tests cover a text node with the checkbox prefix and a nested checkbox).

Types

  • ✅ spec, plan, decision are CoreNodeType variants with seeded schemas, wire structs, typed updates and regenerated TypeScript; fields and defaults match ADR-092 §1.
  • ✅ Relationships of ADR-092 §3, pinned by the_model_relationships_have_the_decided_shape.
  • ✅ project.repository, task.pull_request, task.commits, all optional.
  • ✅ A list of links is declared with its item shape (tools.rs:1523). The tool-surface golden diff is the status enum only, which is expected: the golden carries no task field_values.
  • ✅ cli.md and the query help describe repository as a link field; skill:check passes.
  • ✅ Five statuses in order, and the surfaces handle in_review. started_at is stamped on the first move, but not on every create path (finding 4).
  • ✅ custom:verification_method is gone from product code. It survives as an arbitrary fixture name in two unit tests (nit).
  • ✅ in substance: the three types have no plugin, as project has none, and are listed in SIDENAV_CORE_TYPES. The issue's wording ("in the frontend plugin list") is not met literally; the PR description says so and the reasoning holds.
  • ✅ node-types.md has a sheet for each type and the check passes against the pending docs commit.

Rules

  • ✅ Six Plays with fixed ids, seeded and enabled. A spec created already approved with no criteria is not refused (finding 5).
  • ✅ Lineage and blocker rules guard in_review.
  • ✅ A plain task moves through every status; with one unchecked checkbox it cannot reach done.
  • ❌ "A superseded spec, plan or decision cannot ... leave superseded": it can, by clearing the status field (finding 1).
  • ✅ Each Play has a rejected and an allowed execution test, matched on the rule's own message.
  • ✅ A user's edit survives a restart. The test edits enabled and description, not rules.

Removal

  • ✅ packages/core/src/methodology/ deleted.
  • ✅ Bundle record, RPCs, Tauri commands and frontend service deleted. One orphaned comment remains (nit).
  • ✅ Onboarding no longer offers a methodology (read from the diff, not driven in the app).
  • ✅ Bundle reference files, generator block and the SKILL.md line removed.
  • ✅ No issue / cycle / story / bug / epic / sprint type, status or Play remains outside test fixtures that create their own.
  • ✅ Subtype and vocabulary-extension tests use their own fixtures.
  • ✅ Agent goldens and live-test sources use the core model. Live tests and evals were not run, as the PR states.
  • ✅ No migration or backfill code.
  • ✅ An older database is refused before any write, with the marker and a byte-identical file, for the two shapes tested. A stored schema this build cannot parse is not refused cleanly (finding 3).

General

  • ✅ Docs updated (pending commit; ADR-076's amendment is already on docs main).
  • ✅ Scanners clean; I did not re-run quality:fix.
  • ✅ Targeted tests pass; test:changed is as reported by the author.

Code Review Findings

🟡 Important

1. The superseded lock is bypassed by clearing the status field. packages/core/src/playbook/core_plays.rs:475

The "cannot be reinstated" rule's second condition is node.<status_field> != 'superseded', with no has() guard. A generic update with {"spec_status": null} passes validation: check_field_value lets null through for every field, and the required check is skipped when the field has a default (crud.rs:3457, crud.rs:3484). A cleared field is left out of a condition's node value (cel.rs:547-558), so the read fails, the condition fails, and on a reject rule that means the write is allowed. After that the spec reads as draft (wire default) and the field locks no longer match either, since they test == 'superseded'.

The typed update refuses null (deserialize_set_only), so this is reachable through the flat path only: nodespace node update, the agent's update_node, and bulk_update. That is the path an agent uses.

The file's own header comment names this hazard ("a missing key fails the whole condition, which on a reject rule means allow, silently") and the plan and lineage rules guard against it. Fix: !has(node.<status_field>) || node.<status_field> != 'superseded', plus an execution test that clears the status of a superseded node. Principle: a reject rule must fail closed on data shape.

2. The new invariants can suspend the shipped roll-up Play for the whole database. packages/core/src/playbook/core_plays.rs:398 and :305, with :110

The parent-task roll-up is reactive and writes status: done to the parent through NodeService::update_node (actions.rs:1856). That write now runs the new invariant rules. When one rejects it, the action fails, and an action failure suspends the Play (engine.rs:1534), with no special case for a rejection by an invariant.

Scenario: a task linked to a spec or plan is broken into sub-tasks, and the sub-tasks carry the checklists. Completing the last sub-task fires the roll-up; reject-done-without-criteria refuses the parent (it has a spec or plan and no checkbox child); the roll-up Play is suspended with ActionFailed and stops completing parents anywhere until the user re-enables it. A parent under a draft plan hits the same path through the lineage rule. Before this PR no shipped rule could reject the roll-up's write.

Fix options: have the roll-up's condition skip a parent the criteria and lineage rules would refuse, or treat a PlayRuleRejected from a reactive action's write as a declined action rather than a failure. Either way, add a test that runs both Plays together; no test does today. Principle: seeded rules are composed in one database and need a test of their interaction.

Related, not introduced here: the roll-up condition is has_child.all(c, c.status == ...), so a parent with any checkbox child never rolls up (a checkbox has no status). With checkbox children now the model for criteria, a parent task with its own checklist never auto-completes. Worth a line in ADR-079 or the task sheet if that is intended.

3. A stored core schema this build cannot parse is an error, not a refusal. packages/core/src/db/core_type_shape.rs:209 and :217

Stored fields are deserialized into SchemaField, which is deny_unknown_fields with a strict SchemaFieldType (nodespace-types/src/schema.rs:300-310). A database from a build with a field type or a SchemaField key this build does not know fails at from_value with a plain anyhow error. SchemaMismatch::find_in does not match it, so the daemon writes no marker and exits non-zero, and its service manager restarts it into the same failure. That is the crash-loop the incompatible-database path exists to prevent, and "another build's core types" is exactly the case this module is for. Two developers switching branches will reach it the next time a field type or schema key is added.

Fix: map an unreadable properties or fields value to a mismatch (an Unreadable difference), with a test that stores a field of an unknown type. Principle: classify a known failure mode; do not let it fall through as a generic error.

4. started_at is not stamped on the hierarchy create paths, though the code and the docs say every path. packages/core/src/services/node_service/crud.rs:2600, bulk.rs:599, bulk.rs:732

stamp_task_started is called from create_node, the four update pipelines, bulk_create and bulk_update. bulk_create_hierarchy and bulk_create_hierarchy_trusted (markdown import, hierarchy creates) re-bucket and validate without it, so a task created in_progress there has no started_at, while the same task through create_node has one. The doc comment says "every write pipeline calls this", and the pending node-types.md says "on every write path". Either call it at the two sites or narrow both statements. Principle: one behaviour per write, whichever path carries it.

🟢 Suggestions

5. Spec approval can be skipped at create. core_plays.rs:207. A spec created with spec_status: "approved" has no children yet and is accepted, and a plan can then be approved against it. The PR description flags this and ADR-092 §6 lists the create case for plans only, so it is in spec. A node_created rule mirroring reject-creating-an-approved-plan would close it in about fifteen lines; if it stays open, say so in the spec sheet.

6. The shape check does not compare relationships. core_type_shape.rs:137. This PR adds or changes six core relationship declarations, and a build that differed only in those would pass the check. It is caught today because task also gained fields. Either compare declared relationships or state the limit in the module doc beside the list of what is compared.

7. One write that edits a field and supersedes is refused. core_plays.rs:447. The field locks read post-write state, so {objective: "...", spec_status: "superseded"} is rejected as an edit to a superseded spec. typed_flat_updates_test.rs (a_spec_update_writes_and_clears_its_fields) makes exactly that write and passes only because it runs without the engine. Adding trigger-side old-status to the field rules is not possible (they trigger on the field), so document it, or have the test not model a write the product refuses.

8. Stale comment on relationship triggers. core_plays.rs:158-162 says an invariant has no trigger on a relationship write. It has: relationship_added / relationship_removed exist and invariants.rs dispatches them. The comment came from the removed module. The design (guard transitions, not links) may still be right, but the stated reason is wrong, and it hides that an approved plan's spec link can be removed or repointed without a check.

9. Stage-1 now matches the common words "plan", "spec" and "decision". packages/agent/src/local_agent/agent_loop.rs:179-181. The updated unit test shows "show the Release Plans" now yields the core plan type ahead of the user's release_plan. Type names in the Stage-1 prompt have shifted routing before, and the live tests were not run. Include a prompt using "plan" in its everyday sense in the next eval run.

Nits

  • Nit: packages/desktop-app/app-lib/src/lib.rs:875-876: the "Methodology playbooks (list + install ...)" comment remains above nothing.
  • Nit: packages/daemon/src/services/node_service.rs:5810: assert_ne!(err.code(), Code::Ok) after expect_err cannot fail. Assert the code the wrong-type refusal returns.
  • Nit: packages/agent/src/skill_pipeline.rs:122: the comment recorded a measurement taken with the Linear bundle installed; rewording it to "a workspace's own guidance skills" describes a setup that was not measured. Say the measurement predates the removal, or drop the figure.
  • Nit: packages/core/src/playbook/cel.rs:1271 and graph_resolver.rs:1401 still use custom:verification_method as their example custom field. Any other name avoids a false hit when someone greps for the removed field.

Recommendation

REQUEST CHANGES.

Finding 1 leaves an acceptance criterion unmet, and finding 2 is a regression in an existing shipped Play under an ordinary use of the new model. Both are small fixes with a test each. Findings 3 and 4 are worth folding into the same pass. The rest of the change is sound: the layers of the node type sequence are all present, the rule tests are matched on each rule's own message with an allowed case beside every rejected one, and the removal is complete.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review: REQUEST CHANGES (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Address-review summary (commit 0016c7154)

bun run test:changed passes on every tier after these changes.

Addressed

  1. Superseded lock bypassed by clearing the status. The status rule's condition is now !has(node.<status>) || node.<status> != 'superseded'. New test a_superseded_status_cannot_be_cleared clears the status of a superseded spec, plan and decision through the flat write path, and checks the field lock still holds afterwards.
  2. The roll-up Play suspended by a rule's refusal. Fixed in the engine, not in the roll-up's condition: an action whose write an invariant rule vetoes now fails with ActionError::RefusedByInvariant, which the rule processor treats as a declined action (logged, no suspension). It applies to update_node, create_node and the relationship actions. New test a_roll_up_the_rules_refuse_leaves_the_roll_up_play_running runs the roll-up beside the criteria rule; I confirmed it fails with the fix disabled.
  3. An unparseable stored core schema. Now a CoreTypeDifference::Unreadable mismatch, so the daemon records the marker and exits cleanly. Tested with a field of an unknown type. (Properties that are not JSON cannot be stored: a table trigger refuses them.)
  4. started_at on the other create paths. Stamped in bulk_create_hierarchy and bulk_create_hierarchy_trusted. Testing this showed bulk_create was not stamped either, because it stores properties flat; the stamp now reads and writes the fields where the write left them. All three are in the started_at test.
  5. Relationships not compared. Stated as a limit in the module doc and in data-layer.md.
  6. Edit and supersede in one write. The typed-update tests no longer make that write; a Play test pins the refusal; the comment in core_plays.rs and the spec sheet say superseding is a write of its own.
  7. Stale comment on relationship triggers. Rewritten: the rules read links when a status changes, and no rule watches a link being added or removed.
  • Nits: orphaned comment removed; the daemon wrong-type assertion now checks InvalidArgument and the message; the skill_pipeline.rs comment says what was measured; the two fixtures use custom:review_notes.

Not changed

  1. A spec created already approved. Left as ADR-092 §6 lists it (the status change only), and now stated in the spec sheet. Adding the create rule would be a rule the ADR does not list; that is a decision for the ADR.
  2. Stage-1 matching "plan", "spec", "decision". No code change. It needs an eval run with the model, which this PR did not do; noted for the next eval.
  • A parent with a checkbox child never rolls up (pre-existing, from the roll-up's .all(...)): not changed here.

Docs (pending commit to nodespace-docs, pushed before merge): the declined-action rule in playbook-system.md, the lock and approval edges in the spec sheet, the unreadable case and the relationship limit in data-layer.md.

Re-Review Decision

Decision: RE-REVIEW NEEDED

Rationale: Findings 1 to 4 were fixed with logic changes, one of them in the Play engine's handling of action failures.

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Pragmatic Code Review: PR #3618 (issue #3542)

Review Type

Re-Review. Scope is 774a06c22..0016c7154 (one commit, 13 files) and the second pending docs commit 9e32b63 (local, not yet on nodespace-docs main).

What I ran, all passing: core_model_plays_test:: and typed_flat_updates_test:: (47 of 47), --lib core_type_shape (6 of 6), --lib playbook::engine playbook::actions (179 of 179), and bun run node-types:check against the pending docs checkout (28 types). Not run: the full pyramid, frontend tests, live model tests, evals.

New findings A, B and C are traced through the code, not executed: the review may not add test files. Each names the lines the trace goes through.

Previous Review Summary

  • Previous recommendations: 13 (9 findings, 4 nits)
  • Addressed: 11 (findings 1, 2, 3, 4, 6, 7, 8 and all 4 nits)
  • Not addressed: 2 (findings 5 and 9, both deliberately; both reasons hold)
  • Addressed incorrectly: 0
  • New issues found: 3 (1 Important, 2 Suggestions) and 2 nits
# First-review finding Status
1 Superseded lock bypassed by clearing the status Addressed. core_plays.rs:483 guards with !has(...). A cleared field is dropped from the condition's node map (cel.rs, the map.retain after bucket precedence), so has() is false and the rule rejects. a_superseded_status_cannot_be_cleared covers all three types through the flat path, re-checks the field lock afterwards, and has a control (a draft's status can be cleared). It fails if the guard is removed.
2 New invariants suspend the roll-up Play Addressed for the shipped Play. NodeServiceError::PlayRuleRejected is produced in exactly one place, a reject action firing (invariants.rs:367), so write_error cannot report a real failure as a refusal: an unresolved condition path, a scope failure or a broken invariant action all stay InvariantRuleFailed, map to ServiceError, and still suspend. The in-transaction executors need no change: update_node_in_tx and the _no_invariant_dispatch create and relationship writes never dispatch invariants, so they cannot see a refusal. The sync repair path (engine.rs:974) only logs any failure, so the new variant is harmless there. The test is not vacuous: the roll-up's condition passes for the governed parent, only reject-done-without-criteria matches, and the plain parent can only reach done if the processor is still running the Play after the refusal (the queue is one FIFO). See new finding A for the cases the shipped Play does not exercise.
3 Unparseable stored core schema is an error, not a refusal Addressed. core_type_shape.rs:224 and :237 push Unreadable and continue. The test stores a field of type duration and would panic on unwrap() if the ? came back. The first branch (properties not JSON) has no test; the author's reason (a table trigger refuses such a row) is acceptable for a defensive arm.
4 started_at not stamped on hierarchy creates Addressed. Every rebucket_and_validate* call site in crud.rs and bulk.rs is now followed by the stamp, and prepare_bulk_hierarchy_nodes is shared with the _in_tx twin. The three new cases fail if their call is removed, and the open row checks nothing is stamped that should not be. See new finding C on the flat branch.
5 Spec approval skipped at create Not changed; reason holds. ADR-092 §6 lists the create case for plans only, and the spec sheet now states the gap. A new rule is an ADR decision.
6 Shape check does not compare relationships Addressed as a stated limit, in the module doc and data-layer.md.
7 Edit and supersede in one write Addressed. Pinned by editing_and_superseding_in_one_write_is_refused (with the two-write path shown to work), documented in the header comment and the spec sheet, and the typed tests no longer make that write.
8 Stale comment on relationship triggers Addressed. The comment now says what the rules do and that none watches a link.
9 Stage-1 matches "plan", "spec", "decision" Not changed; reason holds. It needs a model run this PR does not do. It remains open for the next eval, not resolved.
Nits orphaned comment; daemon assertion; skill_pipeline.rs comment; fixture name All addressed. The daemon test now asserts InvalidArgument and the message.

The related note under finding 2 (a parent with a checkbox child never rolls up, because .all(c, c.status == ...) is false for a checkbox) was left unchanged and is still undocumented. With checkboxes now the model for criteria, a parent task that has its own checklist never auto-completes. One sentence in the task sheet would do.

Code Review Findings

Critical

None.

🟡 Important

A. A declined action silently stops the rest of a for_each and the rest of the rule, on every firing, with the Play shown as healthy. packages/core/src/playbook/actions.rs:1563-1569 and :1602-1605, with packages/core/src/playbook/engine.rs:1492-1502

execute_actions returns on the first error of any kind, so a RefusedByInvariant on item k of a for_each ends the iteration, and one on action n skips every later action. Earlier writes are already committed (no rollback). Before this change that state came with a suspension and a reason on the Play node. Now the engine logs at info! and carries on, so the same prefix is re-applied and the same suffix is skipped each time the rule fires, and nothing a user can see says so.

Concrete case: a user Play "when a plan is approved, for_each of its tasks set in_progress". One blocked task is refused by reject-starting-a-blocked-task; every task after it in the collection is never started, on this firing or any later one.

The shipped roll-up is a single action with no for_each, so it is unaffected, and the fix for finding 2 stands. The gap is in the general rule the PR now documents ("the remaining actions are skipped"). For a for_each, the reasoning behind declining ("nothing is wrong with the rule") applies per item: continue to the next item on a refusal and report the rule as declined at the end. Whether later actions should also run is a judgement call; skipping them is defensible when they bind to the refused action's result. Add a case with two items, the first refused, to the roll-up test's section. Principle: a partial result must not be silent; decline at the granularity the refusal applies to.

🟢 Suggestions

B. A Play whose write can never be accepted now looks like a working Play. packages/core/src/playbook/engine.rs:1495

"The graph may allow the same action next time" is true of the roll-up. It is not true of a reactive rule that creates a plan already approved (always refused by reject-creating-an-approved-plan), or of any write a rule refuses on shape. Those were suspended with action_failed and a message; now the only trace is an info! line without the error_type and rule_index fields every other skip in this loop logs at warn!. Log the decline at warn! with error_type = "refused_by_invariant", rule_index and the refusing rule's name (PlayRuleRejected carries the play id and rule name; write_error drops both with ..). That keeps the roll-up running and makes a permanently refused Play findable.

C. The flat branch of stamp_task_started writes a field where the next update hides it. packages/core/src/services/node_service/crud.rs:2626-2633 and :2654-2662

The branch exists for bulk_create given unbucketed properties. No production code in this repository calls bulk_create (benches and tests only), and the two hierarchy paths normalise through bulk_row_as_node before the stamp, so in practice the branch runs for the new test. What it writes does not last: the first update_node on such a node merges a normalised patch, which adds a task bucket (crud.rs:1484-1489), and from then on readers use the bucket and ignore top-level keys (nodespace-types/src/convert.rs, has_any_bucket), and so does the stamp itself. A task batch-created in_review and later moved to in_progress gets a second started_at, today's, in the bucket; the first is shadowed. That contradicts "only the first start is recorded".

The loss of flat fields on first update predates this PR and applies to status too, so this is not a regression. But the stamp now knows two layouts to serve a shape the write path itself calls not the storage shape (bulk.rs:589-591). Simpler: stamp only the bucket and have the batch test pass bucketed properties, or normalise in bulk_create as the hierarchy paths do. Principle: KISS; one storage shape per field.

Also here: fields clones the whole map and is called up to four times per task write. Returning Option<&Map> avoids it.

Nitpicks

  • Nit: packages/core/tests/it/typed_flat_updates_test.rs:691-692 and :776: the comment says the seeded lock refuses the combined write, but this file builds no Play engine, so nothing here would refuse it. Say the write is split because the product refuses it, and point to the Play test that pins that.
  • Nit: packages/core/src/playbook/core_plays.rs:486: "The change gives it another status, or none" reads oddly as a condition description next to its siblings; "The change leaves it with another status, or with none" matches the comment above it.

What I checked and found sound

  • No real failure is reported as a refusal, and no refusal as a failure (see row 2). VersionConflict is still matched before write_error in execute_update_node.
  • A declined rule does not stop the Play's later rules in the same work item, and later Plays run as before. That is coherent: rules are independent, and only a suspension trips the is_running check.
  • A refusal makes no write, so it emits no event and cannot loop.
  • The lock rule's new condition does not weaken the existing case: a move to any other status still satisfies the second disjunct.
  • Unreadable goes through the same SchemaMismatch path as every other difference, so the marker and clean exit apply without daemon changes.
  • No issue numbers in comments, no lint suppression, no literal node_type comparison outside tests, no compatibility code in the diff.
  • Docs: playbook-system.md states the declined-action rule, data-layer.md the unreadable case and the relationship limit, the spec sheet the lock's edges. They match the code. node-types:check passes against them.

Recommendation

APPROVE.

Both blocking findings of the first review are fixed, each with a test that fails when the behaviour breaks, and findings 3 and 4 are folded in. Nothing new breaks an acceptance criterion or a shipped Play. Finding A is worth fixing in this PR, since it is a small change in the loop this PR just gave new semantics; it affects user-authored Plays only. B and C are optional.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Address-review summary, re-review (commit 4cc32307e)

bun run test:changed passes on every tier.

Addressed

  • A. A refused for_each item stopped the rest. A refusal now declines that item alone: the iteration continues, the first refusal is reported as the rule's outcome once every item has had its turn, and later actions of the rule are skipped (they may bind to what was not written). New test a_refused_item_does_not_stop_the_rest_of_a_for_each: a user Play starts a plan's tasks on approval, with the blocked task first, in the middle and last; the free tasks are started, the blocked ones stay open, the Play is not suspended.
  • B. A permanently refused rule looked healthy. The decline is logged at warn! with error_type = "refused_by_invariant", rule_index and the Play and rule that refused. RefusedByInvariant now carries both.
  • C. Two storage layouts in the started_at stamp. Back to the task bucket only, with no map clone. The batch test passes bucketed properties. A bulk_create handed flat properties stores them as given and is not stamped; it has no production caller, and the doc comment says so.
  • Nits: the typed-test comment says no engine runs there and points to the Play test; the condition description is reworded.
  • A parent with a checklist never rolls up: now stated in the task sheet.

Docs (pending commits to nodespace-docs, pushed before merge): the per-item decline and the warning in playbook-system.md; the roll-up note in the task sheet.

Re-Review Decision

Decision: NO RE-REVIEW NEEDED

Rationale: The re-review approved the PR. This commit implements its finding A as recommended, in one loop, with a test that covers the refused item in each position; B and C are a log level and a simplification back to the first-reviewed shape. All Play, engine and action tests pass (652), and test:changed passes on every tier.

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Merge queue: #3618 was taken out of the queue — the merge gate failed on it, on top of main. Reproduce by merging or rebasing origin/main and running bun run test:changed, fix, push, and re-run bun run merge 3618.

× Adapter contract: live round-trip (HttpAdapter → dev-proxy → daemon) > create → typed spec update → read back carries typed fields 9ms
     → Play rule 'reject-approving-a-spec-without-criteria' (play 3d139d11-c3b7-42d5-b638-f2a2b41e1674) rejected the write to node 2be7b1ba-7468-449b-9df0-ad5a5f5d3463: This spec cannot be approved until it has success criteria. Add each criterion as a checkbox directly under the spec, then approve it.
   ✓ Adapter contract: live round-trip (HttpAdapter → dev-proxy → daemon) > create → typed plan update → read back carries typed fields 5ms
   ✓ Adapter contract: live round-trip (HttpAdapter → dev-proxy → daemon) > create → typed decision update → read back carries the typed status 4ms
   ✓ Adapter contract: live round-trip (HttpAdapter → dev-proxy → daemon) > create → typed query update → read back carries typed fields 10ms
   ✓ Adapter contract: live round-trip (HttpAdapter → dev-proxy → daemon) > create → typed play update → read back carries typed fields 9ms
   ✓ Adapter contract: live round-trip (HttpAdapter → dev-proxy → daemon) > create → typed collection update → read back carries the typed description 7ms
   ✓ Adapter contract: live round-trip (HttpAdapter → dev-proxy → daemon) > create → typed skill update → read back carries typed fields 6ms
   ✓ Adapter contract: live round-trip (HttpAdapter → dev-proxy → daemon) > typed database-settings update → read back carries the typed list 4ms
   ✓ Adapter contract: live round-trip (HttpAdapter → dev-proxy → daemon) > createNode honors an explicit InsertPosition the same way move/reorder do 8ms
   ✓ Adapter contract: live round-trip (HttpAdapter → dev-proxy → daemon) > moveNode honors an explicit InsertPosition (regression: dev-proxy previously ignored it entirely) 11ms
 ✓ src/tests/e2e/node-roundtrip.e2e.ts (11 tests) 497ms
 ✓ src/tests/e2e/watch-stream-isolation.e2e.ts (1 test) 596ms
 ✓ src/tests/e2e/schema-seeding.e2e.ts (7 tests) 458ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯
 FAIL  src/tests/e2e/adapter-contract.e2e.ts > Adapter contract: live round-trip (HttpAdapter → dev-proxy → daemon) > create → typed spec update → read back carries typed fields
BackendError: Play rule 'reject-approving-a-spec-without-criteria' (play 3d139d11-c3b7-42d5-b638-f2a2b41e1674) rejected the write to node 2be7b1ba-7468-449b-9df0-ad5a5f5d3463: This spec cannot be approved until it has success criteria. Add each criterion as a checkbox directly under the spec, then approve it.
 ❯ handleResponse src/lib/services/http-response.ts:70:11
     68|     }
     69| 
     70|     throw new BackendError(
       |           ^
     71|       errorData?.message || fallbackMessage,
     72|       errorData?.code,
 ❯ HttpAdapter.updateSpecNode src/lib/services/backend-adapter.ts:629:12
 ❯ src/tests/e2e/adapter-contract.e2e.ts:224:21
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
 Test Files  1 failed | 7 passed (8)
      Tests  1 failed | 55 passed (56)
   Start at  15:32:18
   Duration  9.73s (transform 279ms, setup 26ms, collect 373ms, tests 8.99s, environment 0ms, prepare 161ms)
error: script "test:e2e" exited with code 1
error: script "test:e2e" exited with code 1
[stage exited with code 1]

  full output: /var/folders/yj/_2dcl_l16cl6dr1bp7h1j6hw0000gn/T/nodespace-gate-logs/_gate-merge-2026-10-05T13-21-24-525Z/test-e2e-headless-daemon-round-trip.log

✗ test:e2e (headless daemon round-trip) failed — merge blocked.
  Fix the failure, push, and re-run: bun run merge <PR#>

…eeded rules; remove the installable methodologies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make spec, plan and decision core types with checklist criteria and seeded rules; remove the installable methodologies

2 participants