#631 Implement tools.scriptplan - Advanced Scheduling Tool
Description
Edit## Overview
Implement tools.scriptplan as a native Highway tool for advanced scheduling using the ScriptPlan library (TaskJuggler-compatible). This provides Layer 3 scheduling capabilities beyond the built-in durable_cron.
## Architecture Decisions
1. Tool, NOT App - Lives in engine/tools/scriptplan.py (native primitive)
2. No custom DB tables - All state in workflow variables (ctx.get/set_variable)
3. Uses existing patterns - State reset pattern from durable_cron.py
4. Pre-computed schedules - Compile once, cache execution times list
5. Interruptible waits - wait_for_event() with timeout for schedule updates
## Tool API
- compile_schedule(definition, task_id, count=100) -> list[str]
- get_next_execution(definition, task_id, after=None) -> str|None
- scriptplan_scheduler(ctx, definition, task_id, target_task, ...) -> dict
## State Variables (via ctx.get/set_variable)
- execution_times: list[str] - Pre-computed ISO timestamps
- last_run: str - Last execution ISO timestamp
- schedule_hash: str - Hash for change detection
- scheduler_id: str - Unique ID for event-based wake
## Implementation Steps
1. Add scriptplan dependency to pyproject.toml
2. Create engine/tools/scriptplan.py with core functions
3. Implement scriptplan_scheduler with state reset pattern
4. Register tool in engine/tools/__init__.py
5. Add DSL template example
6. Write unit tests
7. Integration test with durable scheduler
8. Update RAG documentation
## Dependencies
- ScriptPlan library from ../rodmena-resource-management
- Existing: durable_context.py, absurd_client.py
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...