Skip to content

feat(relay): relay tell-invoked command output and Market's direct announcements - #58

Merged
zznathans merged 2 commits into
mainfrom
feat/relay-tell-and-market-output
Aug 4, 2026
Merged

feat(relay): relay tell-invoked command output and Market's direct announcements#58
zznathans merged 2 commits into
mainfrom
feat/relay-tell-and-market-output

Conversation

@zznathans

Copy link
Copy Markdown
Owner

Summary

  • Consolidates the relay_command_output() hook in output_destination() to fire for both TELL and PG channel replies (previously PG-only), so command output sent via /tell also relays to the mesh hub.
  • Hooks Market.php's announce()/announce_background(), which call send_pgroup() directly and previously bypassed output_destination() entirely.

Follow-up to #56, based on live testing on the production mesh: enabling Relay.RelayCommandOutput and running !market status inside a spoke bot's own group relayed correctly, but running it via /tell to that bot did not, and Market's own "X used market Y" activity-log line never relayed either.

Test plan

  • New Tests/Commodities/BasePassiveModuleTest.php covering TELL/PG/GC channel behavior and no-double-relay when both TELL and PG bits are set.
  • New tests in Tests/Modules/Ao/MarketTest.php covering announce()/announce_background() relay gating.
  • Tests/README.md regenerated (by hand, no local PHP in this environment) to match.
  • CI (unit tests, docs-check, lint, CodeQL) - pending on this PR.
  • Manual verification after release+deploy: /tell a spoke bot a market command and confirm it relays to Beuroman; trigger a Market activity announcement and confirm it relays too.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

…nouncements

Two gaps left by the previous relay_command_output() hook (PG-only), found
via live testing on the mesh:

- Commands run via /tell only ever set the TELL bit in
  output_destination(), never PG, so they never hit the relay hook.
  Consolidate the hook to fire once for either TELL or PG.
- Market.php's announce()/announce_background() call send_pgroup()
  directly, bypassing output_destination() entirely. Hook both call sites
  the same way.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation market Market module (Modules/Ao/Market.php) anarchy-online Anarchy Online specific code core Core bot framework (Main/**) module-ao-market tests PHPUnit test suite changes commodity-base-passive-module labels Aug 4, 2026
…PassiveModule

find_source_file() looks for a file literally named "BasePassiveModule.php",
but the real file is "00_BasePassiveModule.php" (numeric prefix), so it's
never found and the generator emits an unlinked class name - correct the
hand-edited README to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@zznathans
zznathans merged commit addff5b into main Aug 4, 2026
15 checks passed
@zznathans
zznathans deleted the feat/relay-tell-and-market-output branch August 4, 2026 20:43
zznathans pushed a commit that referenced this pull request Aug 4, 2026
This whole feature (relaying a bot's own command output/activity lines
across the mesh, added across #56/#58, partially reverted in #60) turned
out to be more scope and code-base churn than it was worth for what's
actually needed. Fully removing it:

- Modules/Relay.php: drop relay_command_output() and the
  Relay.RelayCommandOutput setting.
- Modules/Ao/Market.php: announce()/announce_background() go back to
  their original single send_pgroup() call - local private-channel
  logging stays exactly as it was before any of this, just no longer
  relayed across bots.
- Commodities/00_BasePassiveModule.php: drop the leftover explanatory
  comment from the #60 revert.
- Tests/Stubs/FakeMarketBot.php, Tests/Stubs/FakeRelayBot.php,
  Tests/Modules/Ao/MarketTest.php, Tests/Modules/RelayTest.php,
  Tests/README.md: back to their pre-#56 state.

Confirmed via `git diff` against the commit before #56 that every touched
file is now byte-identical to its pre-feature state.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

anarchy-online Anarchy Online specific code commodity-base-passive-module core Core bot framework (Main/**) documentation Improvements or additions to documentation market Market module (Modules/Ao/Market.php) module-ao-market tests PHPUnit test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant