- 
                Notifications
    
You must be signed in to change notification settings  - Fork 54
 
feat: Introduce new Runbook execution engine #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
852aff0    to
    8714476      
    Compare
  
    4e5e389    to
    99fb965      
    Compare
  
    Add PartialEq and Eq trait implementations to all block types and the Block enum to enable comparison for change detection in document updates. HttpResponse and HttpOutput only implement PartialEq (not Eq) due to their f64 duration field, which cannot implement Eq. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Sculptor <sculptor@imbue.com>
Implement document update logic that efficiently handles insertions, deletions, moves, and updates in a single pass: - Drain existing blocks into HashMap for O(1) lookup - Iterate new blocks once, building final list in correct order - Detect content changes and position moves - Track minimum rebuild index for passive context updates - Handle deletions by checking remaining HashMap entries Also make rebuild_passive_contexts synchronous by spawning event emission in a separate tokio task, avoiding blocking. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Sculptor <sculptor@imbue.com>
Update open_document and update_document commands to use the new DocumentHandle::put_document() method. Remove BlockChange enum and related code, replacing granular change tracking with full document state updates. Update frontend to send complete document state on changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Sculptor <sculptor@imbue.com>
b8fee19    to
    34ce8f1      
    Compare
  
    Add `MACOSX_DEPLOYMENT_TARGET="10.13"` to Rust analyzer environment to enable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ellie Reqwest offers several features for TLS handling, which should we set it to in order to match the behavior of the other TLS stuff?
https://docs.rs/reqwest/latest/reqwest/index.html#optional-features
| 
           native-tls is the one! Can elaborate later but it was really difficult to get enterprise cert chains working properly with rustls  | 
    
bd3d3a1    to
    299d9a9      
    Compare
  
    
Overview
This PR implements a persistent document context system that fundamentally changes how runbook execution state is managed. Instead of maintaining global state across executions, each block now derives its context from the blocks above it in the document, creating a clear "chain of causality" for execution.
Motivation
Previously, execution context was scoped to a single execution flow (#135), requiring global state management across runs. This made issues like #82 difficult to resolve and created ambiguity about which blocks set contextual data.
The new architecture:
mktemp -doutput)Architecture
Core Runtime System (
backend/src/runtime)Document&DocumentActorDocumentcontains a vector ofBlockobjects with associatedBlockContextsDocumentActormanages document lifecycle and handles commands via message passingDocumentHandlewhich sendsDocumentCommandsBlock Execution Model
Replaced the
BlockHandlerpattern withBlockBehaviortrait:async fn passive_context(&self, &ContextResolver, Option<&BlockLocalValueProvider>) -> Result<Option<BlockContext>>— Defines passively set context (cwd, env vars, ssh host, template variables). UsesBlockLocalValueProviderfor local-only storage access.async fn execute(self, ExecutionContext) -> Result<Option<ExecutionHandle>>— Executes block usingExecutionContext, consuming self. Returns optionalExecutionHandlefor long-running operations.BlockContextDocumentCwd,DocumentEnvVar,SshHost, etc.)BlockContexts from blocks above itContextResolverpassive_context()Frontend Integration
ClientMessageChannelResolvedContextupdates to frontend per block as document changesBlockLocalValueProviderlocal-varandlocal-directoryblocksFrontend Pattern
useBlockContext(blockId)hook to receive resolved contextuseBlockKvValue()for local-only data viaBlockLocalValueProviderTODO: