Repository navigation
Rename node_type "playbook" to "play" and instance-level identifiers in code - #2572
Merged
Merged
Conversation
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]>
7 tasks
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.
Summary
Addresses #2569. Follows the already-completed docs rename (
nodespace-docscommit175836f) 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, plusquery_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 underlyingvalidate_playbook→validate_play(a second, un-listed function found while implementing —validate_play_rulescalls it directly).NodeServiceError::PlaybookValidationFailed→PlayValidationFailed, including the daemon's gRPC status-mapping test.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-instanceactivate/deactivate/disable/reenable/get_playbookmethods,OrderedRuleRef'splaybook_id/playbook_created_atfields →play_id/play_created_at, and matching test-fixture/helper renames.Explicitly left unrenamed (per the issue and cross-checked against the docs diff's "kept" set):
PlaybookEngine,PlaybookLifecycleManager,PlaybookExecutionContext, theactive_playbooks/ActivePlaybooksregistry field+accessor,source_playbook_id, theplaybook_contextenvelope field, the"playbook_engine"source_client_idliteral, the"playbook_log"node type and everything namespaced under it,scoped_for_playbook, and thepackages/core/src/playbook/module path. Also left unrenamed:PlaybookInfoandWorkspaceContext::active_playbooksinops/context_ops.rs—packages/agent's prompt-assembly snapshot tests golden-match this struct's"ACTIVE PLAYBOOKS:"output verbatim, and touching it would require editingpackages/agentfixtures, which is out of scope here. Nopackages/agentfiles were touched.Test plan
cargo checkclean fornodespace-core(incl.--tests --benches),nodespace-daemon,nodespace-agentcargo testruns: all 238playbook::module tests,services::error/crud/context_ops/schematests, and the daemon'serror_mapping_play_validation_failed_returns_invalid_argumentgRPC-mapping test — all greenbun 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)scripts/test-gate.ts) reran the whole suite pluscargo build --bin nodespacedandtest:e2e— green, "All tests passed — pushing."packages/for"playbook"(case-insensitive) post-change — every remaining hit is one of the explicitly-kept engine/subsystem identifiers above, acrate::playbook::module-path reference, or pre-existingpackages/agentprose describing the untouchedPlaybookInfo— no stray instance-level reference remains🤖 Generated with Claude Code