Skip to content

refactor(m5h): games routines split by what they do - #1591

Merged
rudolphpienaar merged 3 commits into
mainfrom
sec/m5h
Dec 3, 2026
Merged

rudolphpienaar merged 3 commits into
mainfrom
sec/m5h

Conversation

@rudolphpienaar

@rudolphpienaar rudolphpienaar commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

M-5h: the games lane of the complexity and nesting pass. All 46 functions that failed a shape measure in trek, brasa's game builtins, menu's games and argus's trek bridge now pass all three (cognitive ≤ 15, cyclomatic ≤ 15, depth ≤ 3), and so does every helper split from them.

  • trek: sprintf, snova, attack, abandon, nova, phaser, events and the rest are split by what each part does. arg_take stays lazy and in order. trek has no shape findings left.
  • brasa: magic_derive is an ordered signature table; qr_encode, functions_draw, hangman_run and the others are split into named steps.
  • argus: question_control is a data map; event_play, lrs_draw and readout_build are split.
  • menu: aquarium, brain and tetris. Tables keyed by typed input use own-key lookups, so constructor and __proto__ fall to the default.
  • The one-time --moved-from flag from M-5.0 is removed.

Behaviour pinned first on unsplit code, recorded on an archive of main and unchanged after:

  • 40 bot-driven trek games, hashed;
  • mixed printf formats, for argument order and laziness;
  • every magic kind;
  • every QR version and mask;
  • menu's game keys;
  • five games through argus's bridge, hashing the page at every question.

The 18 C fixture transcripts are byte-identical. Shape ceilings lowered for trek, menu, brasa and argus.

@rudolphpienaar
rudolphpienaar merged commit bc8dbbb into main Dec 3, 2026
3 checks passed
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.

1 participant