Skip to content

Rename node_type "playbook" to "play" and instance-level identifiers in code - #2572

Merged
mstomar125 merged 1 commit into
mainfrom
issue-2569-playbook-rename
Sep 11, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-2569-playbook-rename

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Summary

Addresses #2569. Follows the already-completed docs rename (nodespace-docs commit 175836f) that split "Playbook" into two concepts: the Playbook engine/subsystem (unchanged name) and a Play — a single automation rule-set node instance. This PR does the mechanical code-side rename so the terminology stops disagreeing with the docs.

  • node_type: "playbook" → node_type: "play" at every site that identifies a single rule-set instance's node type (cron_runner.rs, lifecycle.rs, engine.rs match guards, tests.rs fixtures, crud.rs checks, plus query_nodes_by_type("playbook", …) call sites in engine.rs/validation.rs/context_ops.rs that weren't in the issue's line list but query the same node_type and would silently return zero rows post-rename otherwise).
  • validate_playbook_rules → validate_play_rules; its underlying validate_playbook → validate_play (a second, un-listed function found while implementing — validate_play_rules calls it directly).
  • NodeServiceError::PlaybookValidationFailed → PlayValidationFailed, including the daemon's gRPC status-mapping test.
  • Instance-scoped types/functions in packages/core/src/playbook/{types,validation,lifecycle,engine,logging}.rs: ParsedPlaybook→ParsedPlay, PlaybookStatus→PlayStatus, PlaybookParseError→PlayParseError, PlaybookValidationError→PlayValidationError, PlaybookErrorType→PlayErrorType, AffectedPlaybook→AffectedPlay (schema-drift-impact struct), the lifecycle manager's per-instance activate/deactivate/disable/reenable/get_playbook methods, OrderedRuleRef's playbook_id/playbook_created_at fields → play_id/play_created_at, and matching test-fixture/helper renames.
  • Prose/doc-comments throughout the touched files updated from "playbook" to "play" wherever they described the single-instance concept (mirroring the docs diff's own wording), while leaving engine-describing prose alone.

Explicitly left unrenamed (per the issue and cross-checked against the docs diff's "kept" set): PlaybookEngine, PlaybookLifecycleManager, PlaybookExecutionContext, the active_playbooks/ActivePlaybooks registry field+accessor, source_playbook_id, the playbook_context envelope field, the "playbook_engine" source_client_id literal, the "playbook_log" node type and everything namespaced under it, scoped_for_playbook, and the packages/core/src/playbook/ module path. Also left unrenamed: PlaybookInfo and WorkspaceContext::active_playbooks in ops/context_ops.rs — packages/agent's prompt-assembly snapshot tests golden-match this struct's "ACTIVE PLAYBOOKS:" output verbatim, and touching it would require editing packages/agent fixtures, which is out of scope here. No packages/agent files were touched.

Test plan

  • cargo check clean for nodespace-core (incl. --tests --benches), nodespace-daemon, nodespace-agent
  • Targeted cargo test runs: all 238 playbook:: module tests, services::error/crud/context_ops/schema tests, and the daemon's error_mapping_play_validation_failed_returns_invalid_argument gRPC-mapping test — all green
  • bun run quality:fix — 0 errors/warnings (eslint, svelte-check, tsc, cargo fmt, cargo clippy -D warnings -D clippy::unused-async)
  • bun run test:all — full green (4925 frontend tests, 91 script tests, skill tests, full Rust workspace incl. daemon's 204 tests and desktop-app's Tauri-seam e2e suite)
  • Pre-push gate (scripts/test-gate.ts) reran the whole suite plus cargo build --bin nodespaced and test:e2e — green, "All tests passed — pushing."
  • Re-grepped packages/ for "playbook" (case-insensitive) post-change — every remaining hit is one of the explicitly-kept engine/subsystem identifiers above, a crate::playbook:: module-path reference, or pre-existing packages/agent prose describing the untouched PlaybookInfo — no stray instance-level reference remains

🤖 Generated with Claude Code

The engine/subsystem keeps the name "Playbook" (PlaybookEngine,
PlaybookLifecycleManager, PlaybookExecutionContext, the ActivePlaybooks
registry, source_playbook_id, the playbook_log node type, and the
packages/core/src/playbook/ module path all unchanged). Only the
individual rule-set node instance renames: node_type "playbook" ->
"play", and instance-scoped functions/types/fields follow suit
(validate_playbook -> validate_play, ParsedPlaybook -> ParsedPlay,
PlaybookStatus -> PlayStatus, PlaybookParseError -> PlayParseError,
PlaybookValidationError -> PlayValidationError, PlaybookErrorType ->
PlayErrorType, AffectedPlaybook -> AffectedPlay, OrderedRuleRef's
playbook_id/playbook_created_at -> play_id/play_created_at, and the
lifecycle-manager's per-instance activate/deactivate/disable/reenable/
get_playbook methods -> ...play).

NodeServiceError::PlaybookValidationFailed -> PlayValidationFailed,
with the daemon's gRPC status-mapping test updated to match. The
namespace-nested properties lookup (properties["playbook"]["rules"])
now checks properties["play"]["rules"] to match the renamed node_type,
and every query_nodes_by_type("playbook", ...) call site now queries
"play". PlaybookInfo/WorkspaceContext::active_playbooks in
ops/context_ops.rs are left unrenamed since packages/agent's prompt
snapshot tests golden-match their "ACTIVE PLAYBOOKS:" output verbatim
and that package is out of scope for this change.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@mstomar125
mstomar125 merged commit 28d5a74 into main Sep 11, 2026
@mstomar125
mstomar125 deleted the issue-2569-playbook-rename branch September 11, 2026 09:08
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.

1 participant