Skip to content

fix: make runtime cleanup and transitions consistent - #122

Open
jaagut wants to merge 2 commits into
fix/parser-structure-validationfrom
fix/runtime-lifecycle
Open

jaagut wants to merge 2 commits into
fix/parser-structure-validationfrom
fix/runtime-lifecycle

Conversation

@jaagut

@jaagut jaagut commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Makes runtime transitions iterative and ensures discarded frames are cleaned exactly once, including interrupts and behavior reloads. Callbacks that mutate the stack cancel stale traversal; cleanup runs before a chain successor is initialized, and cleanup errors do not skip the remaining detached frames. Behavior parse/binding failures leave the active behavior intact, and activation parameters are independent copies.

Retains existing action-chain timing, root-pop behavior, suppression scope, and ordinary log-and-continue errors. Exposes the first tick error as last_error and replaces library sys.exit with ValueError for invalid decision outcomes. Debug publishing runs after execution, cannot prevent actions from running, and publishes the current-action state to late subscribers. Discovery restores sys.path on failure and fixes init.py discovery. The execution contract is documented in docs/runtime.md; local comments explain callback mutation guards, cleanup ordering, and chain suppression.

Validation: 161 tests and strict core/example typing pass, including deep decision traversal, cleanup/reload/mutation regressions, nested/cyclic debug data, and a real localhost DDS test for all debug topics and late subscribers. Pre-commit passes. No robot/hardware execution was performed.

Open choices are tracked in #115 (failure/outcome policy), #116 (integration/registration boundaries), and #121 (root chains/suppression); this PR preserves the relevant compatibility behavior.

Stack: based on #120 → #119 → #118 → #114. Visualization regression tests and documentation polish follow in #123.

I am working on behalf of @jaagut.

Full stack, bottom to top: #114 → #118 → #119 → #120 → #122 → #123. Merge in that order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant