feat(commands): establish Telegram projection contract - #97169
andrexibiza wants to merge 1 commit into
Conversation
c209d9c to
83f6736
Compare
Overall: Establishes Telegram projection contract (PR-8 under #96692) — deterministic, revision-aware, test-heavy. What it does
Non-blocking notes
No runtime wiring in this PR (bounded seam only) — correct narrow-waist approach. Non-blocking — please use your judgment. |
|
Producer exact-object closure receipt for PR8 (no self-review). Re-verified live on exact submitted head Landing-edge cross-check: live Every surviving PR commit is therefore hosted-green and the producer-side execution/landing-edge gate is current. I am not submitting a review on my own code; independent acceptance remains separate from this producer receipt. |
What does this PR do?
PR8 establishes the Telegram projection boundary for the unified slash-command architecture in #96692.
Telegram currently has three platform-specific concerns that must not become a second command authority:
/command@bot args, while the command plane must authorize and execute the same canonical command as/command args;This PR isolates those concerns behind three bounded modules. The canonical command catalog remains the semantic authority; Telegram receives an immutable projection of that catalog, normalizes Telegram-specific syntax back to canonical identity, and reconciles native menu state with exact ordered read-back before settlement.
The approach is intentionally dependency-light and independently landable. Current
maindoes not yet expose the merged PR1/PR2 catalog/dispatcher ABIs, so PR8 consumes the catalog object/JSON shape without defining a competing schema or invocation/result contract. When #97143 and #97153 land, the Telegram adapter can compose this seam directly rather than absorbing more command semantics into the existing adapter.Invariants
command_idis authoritative; canonical name is the explicit current-v1 compatibility fallback./command@HermesBot argsand/command argssettle to the same canonical command when the bot target matches.NOOPin another.Deliberate non-goals
plugins/platforms/telegram/adapter.pyin this slice.hermes_cli/commands.py.CommandCatalog,CommandInvocation, orCommandResultABI.Related Issue
Part of #96692 — this PR is PR8 of the unified slash-command decomposition and must not close the parent architecture issue by itself.
Interlocks:
Type of Change
Changes Made
hermes_cli/telegram_command_projection.pyHIDDEN,NATIVE_NAME_INVALID, andNATIVE_LIMITomissions.hermes_cli/telegram_command_normalization.pyNOT_COMMAND,KNOWN_COMMAND,UNKNOWN_COMMAND,NOT_FOR_THIS_BOT, andINVALID_COMMANDoutcomes./command@bot argsand/command argsto the same canonical command identity for the addressed bot.hermes_cli/telegram_menu_reconciliation.pyNOOP,ADOPT, andSETplanning for one Telegram command scope.SETplans.tests/hermes_cli/test_telegram_command_projection.pytests/hermes_cli/test_telegram_command_normalization.pytests/hermes_cli/test_telegram_menu_reconciliation.pyExact object and footprint
9978706e9303dbf990d90e744b131361449d73b983f67367f80bcd48aaa734fbb14907f8954b3f857188455480e071a0aafd3d6b5e87b7cf40915937Exact blob identities:
hermes_cli/telegram_command_projection.py897ff75623b2b99a1e7dc0c29512e1d9562e9c1ahermes_cli/telegram_command_normalization.py8b3616e9a3893613a197ad59f811e7177db47fcahermes_cli/telegram_menu_reconciliation.pyb3af37d4c709c6261c1be9eb3fe84d4ddcb0632ftests/hermes_cli/test_telegram_command_projection.py4cffb4e17f29a4741733d166ce4e800803ad39e3tests/hermes_cli/test_telegram_command_normalization.py0dae01a42f52f528e1a804a524df4ede3ca2a855tests/hermes_cli/test_telegram_menu_reconciliation.py0440522406fef959e175a88e57db496e3f0a7aadHow to Test
Run the focused PR8 characterization suite:
Expected receipt: 26 passed.
Run repository Python validation against the exact head. Hosted CI already executed the full Python test matrix, E2E suite, Ruff enforcement, Ruff +
tydifferential, Windows footgun gate, macOS-only tests, Windows-only tests, supply-chain checks, attribution checks, and common-ancestor checks successfully.Verify exact-head packaging/system acceptance:
All required checks passCharacterization points worth checking explicitly:
/status@HermesBot Mixed CASE --Flagand/status Mixed CASE --Flagproduce the same command identity and canonical input.foo-bar/foo_barnative-name collisions fail closed instead of depending on catalog order.NOOPin another scope.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/A — N/A: behavior is defined by bounded module docstrings and characterization tests; no user-facing command behavior is wired in this slicecli-config.yaml.exampleif I added/changed config keys — or N/A — N/A: no configuration keys added or changedCONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A — N/A: no contributor workflow or repository instruction contract changedScreenshots / Logs
No UI surface is changed in PR8, so screenshots are not applicable.
Focused characterization receipt:
Hosted acceptance for the exact submitted head
83f67367f80bcd48aaa734fbb14907f8954b3f85:Every commit in the submitted PR topology is green.