Skip to content

Drop transitions: the watchdog's state machine no longer fired - #197

Merged
onyks-os merged 3 commits into
mainfrom
fix/watchdog-without-transitions
Nov 30, 2026
Merged

onyks-os merged 3 commits into
mainfrom
fix/watchdog-without-transitions

Conversation

@onyks-os

Copy link
Copy Markdown
Owner

Fixes #193.

Since 0.5.0, supervisor.py drives the watchdog. None of WatchdogFSM's transitions could be reached: production called only initialize() and shutdown(), to open and close the netlink and inotify subscriptions. The package nevertheless required transitions, and the .rpm and PKGBUILD shipped a bundled copy of it.

Changes

Code

  • ttp/watchdog/fsm.py becomes ttp/watchdog/subscriptions.py, a plain class EventSubscriptions with open() and close(). What it does is unchanged:
  • supervisor.py now uses EventSubscriptions and logs the heartbeat itself.
  • The --watchdog preflight (require_watchdog_dependency, INSTALL_HINT, VENDOR_DIR, load_machine) is removed. It refused to start when transitions was missing.
  • pyproject.toml loses the mypy attr-defined override, which existed only for Machine's dynamic triggers. mypy is clean without it.

Dependencies and packaging

  • transitions is removed from pyproject.toml, from oldest-supported.pins and oldest.in, and from the locks. The locks were regenerated with uv pip compile without --upgrade, so the only diff is the removed lines.
  • six was a runtime dependency only because transitions needed it, so it goes too. It stays in CI through rfc3339-validator.
  • .deb: no more python3-transitions.
  • .rpm and PKGBUILD: no bundled wheel, no /usr/lib/transparent-tor-proxy/vendor, no six, no __requires_exclude. bundled-transitions.env is deleted.
  • make_sbom.py: the bundled-component logic is gone. If an .rpm declares bundled(...), the script refuses it rather than describing the package without it.
  • smoke_test.sh checks that the watchdog imports.

Tests

  • test_fsm.py becomes test_watchdog_subscriptions.py. The six tests of dead transitions are removed; the tests for setup, failure containment, readd_watch, flush_event_buffers and cleanup stay.
  • test_watchdog_dependency.py becomes test_teardown_without_watchdog.py. It keeps only the two tests that hold whatever stops the import: stop and stop --restore-only still tear down.
  • New test: no native package may depend on a Python module that TTP does not require. Re-adding python-six to the PKGBUILD makes it fail.
  • Verified separately: ttp.cli, ttp.watchdog, the supervisor and EventSubscriptions all import with transitions and six blocked.

Documentation

  • ADR 0010 is marked Superseded by 0013.
  • Updated: README, ROADMAP, DEPENDENCIES, architecture.md, verification.md, the watchdog explanation, the API reference and the dependencies reference. The dependencies reference now says the AUR package no longer needs python-transitions.
  • CHANGELOG: new Removed section.

🤖 Generated with Claude Code

onyks-os and others added 3 commits November 30, 2026 19:03
Since 0.5.0 supervisor.py drives the watchdog, and none of WatchdogFSM's
transitions were reachable: production only used its netlink and inotify
subscriptions, through initialize() and shutdown(). Those are now a plain
class, EventSubscriptions in ttp/watchdog/subscriptions.py, with the same
setup order (bind, then join NFNLGRP_NFTABLES, #81) and the same
containment when setup fails: killswitch, then raise.

With the machine gone, `transitions` goes from pyproject, the locks and
the oldest-supported pins, and every package format loses it: the .deb's
python3-transitions, the .rpm's and the PKGBUILD's bundled wheel and their
python3-six/python-six. The preflight that refused --watchdog without it
goes too. The SBOM no longer describes a bundle and refuses an .rpm that
declares one. A packaging test now fails if a package depends on a Python
module ttp does not require.

ADR 0010 is marked superseded by ADR 0013.

Fixes #193.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: onyks-os <129986281+onyks-os@users.noreply.github.com>
rpmbuild failed with "Directory not found" once the bundle was gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: onyks-os <129986281+onyks-os@users.noreply.github.com>
…transitions

Signed-off-by: onyks-os <129986281+onyks-os@users.noreply.github.com>
@onyks-os
onyks-os merged commit 5add761 into main Nov 30, 2026
39 checks passed
@onyks-os
onyks-os deleted the fix/watchdog-without-transitions branch November 30, 2026 18:41
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.

The watchdog still depends on transitions, but the supervisor no longer uses its state machine

1 participant