Skip to content

feat(automation): surface structured-region body steps in run observability (#1505)#1580

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/region-step-logs
Jun 4, 2026
Merged

feat(automation): surface structured-region body steps in run observability (#1505)#1580
xuyushun441-sys merged 1 commit into
mainfrom
feat/region-step-logs

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

Resolves the ADR-0031 follow-up #1505 (the TODO(#1479) in engine.ts).

Problem

loop / parallel / try_catch executed their body / branch / handler regions via AutomationEngine.runRegion(), which ran them against a region-local StepLogEntry[] that was discarded. Run logs (listRuns / getRun) therefore showed the container as a single opaque step — the per-iteration / per-branch / handler steps that actually ran were invisible for debugging and audit.

Change

  • runRegion() now returns its body steps instead of dropping them.
  • A new optional NodeExecutionResult.childSteps lets a container node hand those steps back; executeNode() appends them to the parent run log right after the container's own step.
  • Three new optional fields on ExecutionStepLogSchema (spec) and the engine's StepLogEntry tag each surfaced step with its immediate container:
    • parentNodeId — the enclosing loop / parallel / try_catch node
    • iteration — zero-based loop iteration or parallel branch index
    • regionKindloop-body | parallel-branch | try | catch

Tagging fills only fields left undefined, so nested regions keep each step's innermost container. A failed try-region attempt's partial steps stay unsurfaced, preserving try_catch retry semantics. Fully additive — existing run logs/consumers unaffected.

Tests

+4 (162 total in service-automation): loop surfaces per-iteration steps with index; parallel tags branch index; try_catch tags try and catch regions. @objectstack/spec execution + automation suites green.

🤖 Generated with Claude Code

…bility (#1505)

loop / parallel / try_catch ran their body, branch and handler regions against
a region-local step log that was discarded, so listRuns/getRun showed the
container as a single opaque step. runRegion() now RETURNS its body steps and the
container folds them into the parent run log via a new NodeExecutionResult.childSteps
field, appended right after the container's own step.

Each surfaced step is tagged with its immediate container via three new optional
fields on ExecutionStepLogSchema (and the engine's StepLogEntry):
- parentNodeId: enclosing loop/parallel/try_catch node
- iteration: zero-based loop iteration or parallel branch index
- regionKind: loop-body | parallel-branch | try | catch

Tagging fills only undefined fields, so nested regions keep each step's innermost
container. Failed try-attempt partial steps stay unsurfaced (preserves try_catch
retry semantics). Fully additive. +4 tests across loop/parallel/try_catch.

Resolves the ADR-0031 #1505 / TODO(#1479) follow-up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 4, 2026 1:30pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/m labels Jun 4, 2026
@xuyushun441-sys xuyushun441-sys merged commit 3306d2f into main Jun 4, 2026
12 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/region-step-logs branch June 4, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants