refactor(agent): drop pass-through methods, free functions are the surface #1

Merged
mathew merged 2 commits from agent-drop-thunks into main 2026-06-03 17:24:16 +00:00
Owner

The agent/ composition root claimed in its module docstring that "the actual work lives in focused submodules," but the Agent class still carried ten pass-through methods (_heartbeat_loop, _dispatch, _handle_garage_refresh, etc.) that only forwarded to those submodules.

Production code already called the free functions directly; the thunks survived as a test-compat shim left over from the earlier agent.py → agent/ refactor. This commit finishes the job: the ten thunks are gone, Agent is now __init__ + run(), and ~25 test call sites switched to calling loops.heartbeat_loop(agent, ws), dispatch.dispatch_message(agent, ws, raw), etc. directly.

While renaming, twelve instance attrs lost their leading underscore (config, registry, garage_state, ...) since the submodules read them across module boundaries by design; the three cryptographic attrs (_secret, _nonce_store, _ssl_ctx) keep their underscore as a deliberate sigil meaning "handle with care."

Net -41 lines, 1128/1128 tests pass, fitness and import-linter green.

The agent/ composition root claimed in its module docstring that "the actual work lives in focused submodules," but the Agent class still carried ten pass-through methods (`_heartbeat_loop`, `_dispatch`, `_handle_garage_refresh`, etc.) that only forwarded to those submodules. Production code already called the free functions directly; the thunks survived as a test-compat shim left over from the earlier agent.py → agent/ refactor. This commit finishes the job: the ten thunks are gone, Agent is now `__init__` + `run()`, and ~25 test call sites switched to calling `loops.heartbeat_loop(agent, ws)`, `dispatch.dispatch_message(agent, ws, raw)`, etc. directly. While renaming, twelve instance attrs lost their leading underscore (`config`, `registry`, `garage_state`, ...) since the submodules read them across module boundaries by design; the three cryptographic attrs (`_secret`, `_nonce_store`, `_ssl_ctx`) keep their underscore as a deliberate sigil meaning "handle with care." Net -41 lines, 1128/1128 tests pass, fitness and import-linter green.
refactor(agent): drop pass-through methods, free functions are the surface
Some checks failed
Tests / test (pull_request) Failing after 16s
Tests / fitness (pull_request) Failing after 15s
987c7acb22
fix ci cd
Some checks failed
Tests / test (pull_request) Has been cancelled
Tests / fitness (pull_request) Has been cancelled
3a1479a946
mathew merged commit 703d599e13 into main 2026-06-03 17:24:16 +00:00
mathew deleted branch agent-drop-thunks 2026-06-03 17:54:57 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
official-public/storm-pulse!1
No description provided.