Summary
Add template variable rendering to hook scripts so they can reference task/workspace context dynamically.
Parent issue: #392
Scope
Add to core/hooks.py
-
Template rendering function:
def render_hook_template(script: str, context: dict[str, str]) -> str
-
Supported variables:
{{task_id}} — current task ID
{{task_title}} — current task title
{{task_status}} — current task status
{{workspace_path}} — absolute workspace path
{{batch_id}} — batch ID (if in batch execution, else empty)
{{engine}} — execution engine (react/plan)
-
Rendering rules (following Symphony's strict approach):
- Unknown variables raise an error (strict mode)
- Empty/None values render as empty string
- No nested template evaluation
-
Integrate rendering into run_hook() before shell execution
Acceptance Criteria
Dependencies
Summary
Add template variable rendering to hook scripts so they can reference task/workspace context dynamically.
Parent issue: #392
Scope
Add to
core/hooks.pyTemplate rendering function:
Supported variables:
{{task_id}}— current task ID{{task_title}}— current task title{{task_status}}— current task status{{workspace_path}}— absolute workspace path{{batch_id}}— batch ID (if in batch execution, else empty){{engine}}— execution engine (react/plan)Rendering rules (following Symphony's strict approach):
Integrate rendering into
run_hook()before shell executionAcceptance Criteria
TemplateRenderErrorDependencies