Repository navigation
Description
Overview
../nodespace-docs/architecture/playbook-system.md and playbook-engine.md were updated to distinguish two concepts that were previously both called "playbook": the Playbook engine/subsystem (unchanged name) and a Play — a single automation rule-set node instance (trigger → conditions → actions), previously also called "a playbook." The docs rename is committed (nodespace-docs 175836f). Code still uses the old, now-ambiguous terminology throughout.
Problem Statement
Code currently uses "playbook" as both the node_type string for a single rule-set instance AND as the prefix for the engine/subsystem's own types (PlaybookEngine, PlaybookLifecycleManager). Per the docs rename, only the former should change — the engine-level names are correct as-is and should NOT be touched. Left unrenamed, the code and docs now disagree on what "playbook" refers to at the instance level, which will confuse anyone implementing #2562 (which wires the engine into daemon startup) against the current code.
Proposed Solution
Rename instance-level identifiers only, following the docs' precedent exactly: node_type: "playbook" → node_type: "play", and function/type names that refer to a single rule-set instance (not the engine/subsystem) get renamed to use "play". Engine/subsystem-level names (PlaybookEngine, PlaybookLifecycleManager, the packages/core/src/playbook/ module path, PlaybookExecutionContext, ActivePlaybooks, etc.) are explicitly not renamed — they correctly describe the engine, which keeps the name "Playbook".
Architecture Impact
This issue implements the terminology already established in ../nodespace-docs/architecture/playbook-system.md and playbook-engine.md (renamed in nodespace-docs commit 175836f). It does not reverse or supersede any ADR — it's a code/docs consistency fix following an already-made naming decision.
Implementation Approach
Rename: node_type string literal
"playbook" → "play" everywhere it identifies the node type of a single rule-set instance:
packages/core/src/playbook/cron_runner.rs:390—node_type: "playbook".to_string()packages/core/src/playbook/lifecycle.rs:409—node_type: "playbook".to_string()packages/core/src/playbook/engine.rs:177,181,187— threenode_type == "playbook"match guardspackages/core/src/playbook/tests.rs:19— test fixturenode_type: "playbook".to_string()packages/core/src/services/node_service/crud.rs:140,225,1063— threenode.node_type == "playbook"/updated.node_type == "playbook"checks
Rename: functions and error types referring to a single instance
validate_playbook_rules→validate_play_rules(packages/core/src/services/node_service/crud.rs, and its declaration/call sites — checkpackages/core/src/ops/mod.rsandpackages/core/src/services/error.rsfor thePlaybookValidationFailederror variant, which should becomePlayValidationFailed, andpackages/daemon/src/services/node_service.rsfor its gRPC-status error-mapping)- Any other function/variable named for a single playbook instance (not the engine) discovered while implementing — e.g. check
packages/core/src/playbook/validation.rsandpackages/core/src/playbook/types.rsfor instance-scoped naming (aPlaybookstruct representing one parsed instance, if one exists, would becomePlay) PlaybookId(if used as "the id of one instance" rather than an engine-internal type) — verify usage at each call site before deciding; do not rename blindly
Explicitly do NOT rename
PlaybookEngine,PlaybookLifecycleManager(packages/core/src/playbook/engine.rs,lifecycle.rs) — these name the engine/subsystem, which keeps the name "Playbook"PlaybookExecutionContext,ActivePlaybooksregistry,source_playbook_id(cycle-detection/log-attribution fields) — engine-internal, not instance-identifying in the sense this rename targets; use judgment per the docs' own precedent (the docs rename kept these — seeplaybook-engine.md's diff for exactly which identifiers stayed vs. changed)- The
packages/core/src/playbook/module path itself — stays as-is, it's the engine's module enable_playbook/disable_playbookMCP-tool-name references in stale doc sections already being reworked separately by Expose playbook lifecycle and get-workflow-state via CLI and skill guidance #2563 — do not preemptively rename CLI verb names here; Expose playbook lifecycle and get-workflow-state via CLI and skill guidance #2563 designs those fresh
Verification
- Re-grep
packages/for"playbook"(case-insensitive) after changes; every remaining hit should be an engine/subsystem-level identifier correctly left alone (cross-check against../nodespace-docs/architecture/playbook-engine.md's "Deliberately left unchanged" precedent) — not a stray instance-level reference - No frontend changes needed — confirmed zero "playbook" references in
packages/desktop-app/src(no Svelte component exists for this concept yet)
Acceptance Criteria
-
node_type: "playbook"no longer appears anywhere inpackages/— all sites use"play" -
validate_playbook_rulesrenamed tovalidate_play_rules, all call sites updated -
PlaybookValidationFailederror variant renamed toPlayValidationFailed(or equivalent), gRPC status mapping inpackages/daemon/src/services/node_service.rsupdated to match -
PlaybookEngine,PlaybookLifecycleManager, and other genuinely engine-level identifiers are verified unchanged (explicit check, not just "didn't touch them") - Existing playbook/play tests (
packages/core/src/playbook/tests.rs) pass under the new naming with no behavior change -
bun run test:allpasses with no new failures - Code passes
bun run quality:fix
Technical Specifications
Reference Files
packages/core/src/playbook/cron_runner.rs,lifecycle.rs,engine.rs,tests.rs,validation.rs,types.rs— instance-levelnode_typeand struct/function namingpackages/core/src/services/node_service/crud.rs—node_type == "playbook"checks,validate_playbook_rulespackages/core/src/ops/mod.rs,packages/core/src/services/error.rs—PlaybookValidationFailederror variantpackages/daemon/src/services/node_service.rs— gRPC error-status mapping for the above../nodespace-docs/architecture/playbook-system.md,playbook-engine.md— the already-completed docs rename; use their diffs as the precedent for exactly which terms changed vs. stayed
Dependencies
- None — this is a prerequisite for Wire playbook engine into daemon startup, hard-gated to local-only events #2562, not dependent on it. Should land before Wire playbook engine into daemon startup, hard-gated to local-only events #2562 is implemented so that issue is built against correct terminology from the start.
Related Issues
- Blocks Wire playbook engine into daemon startup, hard-gated to local-only events #2562 (should land first, per user decision, so engine-wiring work uses correct terminology)
- Related to Expose playbook lifecycle and get-workflow-state via CLI and skill guidance #2563, Implement derived identity for playbook action outputs #2565 (both reference
"playbook"node_type/terminology in their own descriptions matching current code; once this issue lands, their descriptions should be read with "play" substituted for instance-level references — no edit needed to those issues unless implementation surfaces a real ambiguity)
Non-Goals
- Renaming anything in
strategy/docs (nodespace-docs) — left untouched per the docs rename's own scope, a product-positioning decision, not a code concern - Designing or renaming CLI verb names (
nodespace playbook ...vsnodespace play ...) — that's Expose playbook lifecycle and get-workflow-state via CLI and skill guidance #2563's scope, done fresh - Any change to the future
PlaybookNodebundle-record concept (not yet designed, separate ADR/issue)
Activity
mstomar125 commentedon Sep 11, 2026
Implemented in #2572.
Renamed — `node_type: "playbook"` → `"play"` at every instance-identifying site (including three `query_nodes_by_type("playbook", …)` call sites not in the original line list, in `engine.rs`, `validation.rs`, and `ops/context_ops.rs`, which would have silently matched zero rows post-rename otherwise); `validate_playbook_rules`→`validate_play_rules` and the underlying `validate_playbook`→`validate_play` (a second function found while implementing); `NodeServiceError::PlaybookValidationFailed`→`PlayValidationFailed` (+ daemon gRPC status-mapping test); `ParsedPlaybook`→`ParsedPlay`, `PlaybookStatus`→`PlayStatus`, `PlaybookParseError`→`PlayParseError`, `PlaybookValidationError`→`PlayValidationError`, `PlaybookErrorType`→`PlayErrorType`, `AffectedPlaybook`→`AffectedPlay`; the lifecycle manager's per-instance `activate/deactivate/disable/reenable/get_playbook` methods and `OrderedRuleRef`'s `playbook_id`/`playbook_created_at` fields; plus matching test/benchmark identifiers and doc-comment prose throughout.
No `PlaybookId` type exists in the codebase — that conditional item in the issue was moot.
Left unrenamed (verified against the docs diff's own "kept" set): `PlaybookEngine`, `PlaybookLifecycleManager`, `PlaybookExecutionContext`, the `active_playbooks`/`ActivePlaybooks` registry, `source_playbook_id`, `playbook_context`, the `"playbook_engine"` client-id literal, the `"playbook_log"` node type, `scoped_for_playbook`, and the `packages/core/src/playbook/` module path — all explicitly named in the issue. Additionally left unrenamed: `PlaybookInfo`/`WorkspaceContext::active_playbooks` in `ops/context_ops.rs`, because `packages/agent`'s prompt-assembly snapshot tests golden-match its `"ACTIVE PLAYBOOKS:"` output verbatim, and touching it would mean editing `packages/agent` fixtures — out of scope here. Zero `packages/agent` files were touched.
Verification — re-grepped `packages/` for `"playbook"` (case-insensitive) after the change; every remaining hit is one of the kept identifiers above, a `crate::playbook::` module-path reference, or pre-existing `packages/agent` prose around the untouched `PlaybookInfo`.
bun run test:allandbun run quality:fixboth green, including the pre-push gate's full re-run.Leaving this open for review per convention — will close manually once merged.