Skip to content

Restrict goal-state transitions to an explicit allow-list - #19

Open
destogl wants to merge 11 commits into
masterfrom
feat/specific-profile-switching
Open

Restrict goal-state transitions to an explicit allow-list#19
destogl wants to merge 11 commits into
masterfrom
feat/specific-profile-switching

Conversation

@destogl

@destogl destogl commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

Each goal state can declare allowed_transitions: the list of goal states it may switch to next. Any other requested transition is rejected. Empty (the default) stays unrestricted, so existing scenarios are unaffected.

  • SystemGoal.allowed_transitions: List[str], parsed from each goal_states entry, with validation that listed targets are declared goals.
  • Enforced in ForemanEngine.request_goal() — domain logic, no ROS involved. Skipped when there is no current goal yet (e.g. the first request from AutostartAdapter).
  • New example config scenario_profile_switching.yaml: idleall_broadcastersactive, with active allowed to loop back to all_broadcasters or stay active.

Based on feat/foreman-autostart since it builds on that branch.

Test plan

  • colcon build --packages-select foreman
  • colcon test --packages-select foreman — 51/51 passed
  • pre-commit clean on all changed files

habartakh and others added 11 commits May 25, 2026 13:54
# Conflicts:
#	foreman/foreman/adapters/__init__.py
#	foreman/foreman/node.py
#	foreman/foreman/parser.py
isort import ordering and trailing whitespace, on top of the manual
merge conflict resolution.
Same goal states as scenario.yaml, with autostart_goal_state set to
"running" to demonstrate starting directly into the running state.
Each goal state can declare allowed_transitions: the set of goal
states it may switch to next. Empty (the default) stays unrestricted,
so existing scenarios are unaffected. Enforced in
ForemanEngine.request_goal, since it's domain logic.

Adds scenario_profile_switching.yaml as a worked example: idle can
only go to all_broadcasters, all_broadcasters only to active, and
active can go to all_broadcasters or stay active.
Base automatically changed from feat/foreman-autostart to master August 13, 2026 10:59
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.

2 participants