Skip to content

[#337] Allow continuous aliveness checkers - #354

Merged
Yume27 merged 4 commits into
AVSLab:developfrom
Strtus:feature/337-continuous-aliveness
Nov 4, 2026
Merged

Yume27 merged 4 commits into
AVSLab:developfrom
Strtus:feature/337-continuous-aliveness

Conversation

@Strtus

@Strtus Strtus commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Closes #337
Closes #59

Adds continuous=True to @aliveness_checker so failures can interrupt an environment step through Basilisk events. check_rate sets the minimum interval between checks in seconds and defaults to the simulator rate.

Battery charge and reaction wheel speed checks now use continuous checking by default. This catches failures that would otherwise be missed if the state recovers before the environment step ends. Other checkers retain their existing step-level behavior.

Continuous and step-level failures share the same logging function. A continuous failure records the time of death and emits one warning without evaluating the checker again.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How should this pull request be reviewed?

  • By commit
  • All changes at once

How Has This Been Tested?

  • Unit tests cover the bare, empty-parentheses, and configured decorator forms; weak-reference proxies; distinct dynamics/FSW events; explicit and default event rates; failure logging; and preservation of the first death time.
  • Integration tests cover dynamics and FSW checkers with default and explicit check rates, including rates that do not align with simulation timesteps.
  • Transient battery and wheel-speed readings test that the built-in checkers stop a long step when the failure occurs. The same cases with continuous checking disabled reach the end of the step without detecting the failure.
  • Local full suite: 901 passed, 2 skipped on Python 3.12.13 with Basilisk 2.12.0.
  • GitHub Actions passes for Python 3.10–3.13, benchmark smoke tests, documentation, linting, and commit checks.

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation and release notes
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Copilot AI lite review requested due to automatic review settings August 22, 2026 04:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbb3bf7288

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/bsk_rl/sats/satellite.py Resolved
Comment thread src/bsk_rl/sats/satellite.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for “continuous” aliveness checkers so selected @aliveness_checker methods can be evaluated via Basilisk events during integration and immediately interrupt an environment step upon failure, while preserving existing step-level checker behavior.

Changes:

  • Extend @aliveness_checker to accept continuous and check_rate options and expose them on the wrapped checker.
  • Create satellite-level Basilisk events for continuous checkers during simulator initialization.
  • Add unit + integration tests validating decorator metadata and step-level vs continuous interruption behavior.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unittest/utils/test_functional.py Adds unit tests for new decorator defaults and kwargs (continuous, check_rate).
tests/unittest/sats/test_satellite.py Adds unit test verifying continuous checkers create terminal Basilisk events and mark the satellite dead.
tests/integration/sim/test_int_dynamics.py Adds integration test comparing step-level vs continuous termination time.
src/bsk_rl/utils/functional.py Updates aliveness_checker decorator to support optional configuration and store metadata on wrapped callables.
src/bsk_rl/sim/simulator.py Hooks satellite continuous aliveness event setup into simulator initialization.
src/bsk_rl/sim/fsw/init.py Documents the new continuous=True behavior for FSW checkers.
src/bsk_rl/sim/dyn/init.py Documents the new continuous=True behavior for dynamics checkers.
src/bsk_rl/sats/satellite.py Implements setup_aliveness_events() to create terminal Basilisk events for continuous checkers.
docs/source/release_notes.rst Adds release note entry for continuous aliveness checkers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/bsk_rl/sats/satellite.py Resolved
Comment thread src/bsk_rl/sats/satellite.py Resolved
@Yume27
Yume27 self-requested a review August 31, 2026 16:10

@Yume27 Yume27 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this functionality. This helps make the simulation behavior more realistic for operations where failures can occur during a long environment step. That said, I think some existing aliveness checkers would benefit from using this behavior by default. In particular, battery_valid and rw_speeds_valid seem like strong candidates for continuous=True, since transient battery depletion or reaction wheel overspeed should not be missed if they occur mid-step. Could we update those checkers to use continuous aliveness checking by default?

Comment thread src/bsk_rl/sats/satellite.py Resolved
Comment thread tests/unittest/utils/test_functional.py Resolved
Comment thread tests/unittest/sats/test_satellite.py Resolved
Comment thread tests/unittest/sats/test_satellite.py Resolved
@Strtus

Strtus commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @Yume27 I’ve been busy these past few days and haven’t had time to work through the comments yet. I’ll get back to this and update the PR in the next couple of days.

@Yume27
Yume27 requested a review from LorenzzoQM November 3, 2026 22:13
Comment thread src/bsk_rl/sim/simulator.py Resolved
@Yume27
Yume27 force-pushed the feature/337-continuous-aliveness branch from 56db173 to 605d62a Compare November 4, 2026 04:11
@Yume27
Yume27 self-requested a review November 4, 2026 04:26
@Yume27
Yume27 merged commit b26c293 into AVSLab:develop Nov 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants