Skip to content

refactor(cli): extract Petdex mascot cluster into CLIPetMixin (cli.py god-file slice R2) - #79365

Open
andrexibiza wants to merge 1 commit into
NousResearch:mainfrom
andrexibiza:fix/cli-pet-mixin-extract
Open

refactor(cli): extract Petdex mascot cluster into CLIPetMixin (cli.py god-file slice R2)#79365
andrexibiza wants to merge 1 commit into
NousResearch:mainfrom
andrexibiza:fix/cli-pet-mixin-extract

Conversation

@andrexibiza

@andrexibiza andrexibiza commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

cli.py god-file slice R2: extract the Petdex mascot cluster from cli.py (18,485 lines) into hermes_cli/cli_pet_mixin.py (class CLIPetMixin). Part of the repo-wide large-file decomposition (tracker #78647).

What changed and why

  • Petdex cluster (window 5613–5829, 217 lines, 13 members: _PET_FRAME_INTERVAL, _PET_CFG_INTERVAL + 11 methods) moved 218/218 bytes byte-exact into hermes_cli/cli_pet_mixin.py
  • HermesCLI(CLIAgentSetupMixin, CLICommandsMixin, CLIBillingMixin, CLIPetMixin) — mixin appended last; zero __init__ change, zero caller edits; all 7 out-of-cluster call sites resolve through the MRO
  • No-back-import rule: module imports only __future__/threading/time; agent.pet.* + hermes_cli.config stay lazy in-method (as in the original)
  • Double-blind: 2 independent analysts → consensus (R2-CONSENSUS.md, golden sha verified) → implementer → 2 blind re-reviewers (pass A: APPROVED, 0C/0I; pass B adversarial: APPROVED, 0C/0I)

Testing

  • test_cli_pet_mixin_seam.py: 13 identity asserts (getattr(HermesCLI, n) is CLIPetMixin.n), MRO-order/no-shadowing assert, no-back-import subprocess test (sys.modules['cli']=None), import-order permutation, patch-binding-through-seam, anim-loop idempotency, _on_reaction flash
  • Regression battery (test_cli_pet_pane.py + test_cli_status_bar.py + test_cli_init.py + test_cli_active_agent_ref_wiring.py): 50 passed
  • ruff clean · git diff --check clean · LF-only · DCO signed · Windows-tested

Coordination / interlock

Part of #78647
Part of #55136

… god-file slice R2)

Move the 13-member Petdex mascot cluster (banner + _PET_FRAME_INTERVAL,
_PET_CFG_INTERVAL + 11 _pet*/_on_reaction methods, cli.py window 5613-5829
at pin aec3318) byte-verbatim into hermes_cli/cli_pet_mixin.py as
CLIPetMixin, appended last to HermesCLI's base tuple. Identity-preserving
seam: all members resolve via MRO; no __init__ change; zero caller edits
(all 7 out-of-cluster call sites are same-class). Part of NousResearch#55136

Signed-off-by: andrexibiza <84248988+andrexibiza@users.noreply.github.com>
@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Aug 5, 2026
@andrexibiza

Copy link
Copy Markdown
Contributor Author

🔒 This shard is part of the cli.py KILL LOCK — the permanent record of the 18,485-line whole, the mess it caused (#54960 duplicate-tracking chaos, #65303 no ESC-interrupt, #72797 XML-tag loss, #75461 redaction bypass, #76914 unfinalized sessions, #77764 approval truncation, #39446 /reload-mcp blocking, terminal-escape leaks), every shard in the wave, the #12355 block on R1, and every open fixer PR still fighting the surface (#73104 #75476 #77776 #75084 #76804 #76995 #71295 #78871 #74491 #72821 #57453 #61429 #71027 #62027 #65192 #71088 #74038 #69918 #67484 #12355 #75207 #32193 #74281 #37818 #27172 #65785).

Lock: posted on #55136 · Indexed by the Kill All Gods meta-issue #78647.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants