docs: proposal for a change gate (module boundaries, function complexity, doubled text) #339

Merged
huanchong-99 merged 1 commit from upstream-pr/339 into main 2026-11-29 19:02:41 +00:00
huanchong-99 commented 2026-11-24 03:26:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by huanchong-99 on 2026-11-24T03:26:43Z.


Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121094134

What and why

Adds one page, docs/change_gate.md: a proposal, for the maintainer's decision, for one deterministic check that blocks what a pull request adds and a diff does not show, and tolerates what is already on main:

  • a new import or include across areas (for example tools/ reaching into tests/semantic through sys.path);
  • a production function grown past the point where it can be changed safely (new functions above complexity 10, changed ones by more than 2, main by more than 5; dispatch functions judged per arm);
  • a block of text doubled by a merge.

Every finding says why it matters, what exactly triggered it and how to fix it. Code duplication and new skips are reported, never blocking.

The numbers are measured at dde82f2, which is in this repository's history, and backtested on the 300 merges that end with it: 48 of the 300 would have been stopped, 68 of the 91 blocking findings were changes that should have been fixed before merge, 2 were tool artefacts, and the check takes about 80 ms per pull request. Section 1.4 shows why it should run by the author and in the merge round and not only in CI: in the original repository 55 of 1,000 pull requests merged on 2026-11-23 had a passing CI run, and of the 40 most recently merged here, 19 had no CI run and 18 a failing CI job.

I first opened this page in the original repository shortly before it went private. This is the same page with its references rewritten for this repository: commit hashes instead of the old pull request numbers.

Nothing else changes; no code. Section 5 lists five questions for the maintainer. An implementation would be its own claim and pull request.

Tested

Docs only. Ran every tests/test_docs_*.py and tests/test_i18n_index.py (what the docs-only path of CI runs) on this branch, based on d478a92: all pass.

GPUs tested: n/a (no GPU code)

The numbers come from a standard-library prototype run offline on a local clone; it is not part of this pull request. No game files.

AI-assisted: yes. The measurements, the backtest and the page were done with a coding agent; I reviewed the result.

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: no translator change.)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465512416 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/339). Originally posted by [huanchong-99](https://github.com/huanchong-99) on 2026-11-24T03:26:43Z. --- Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121094134 ### What and why Adds one page, `docs/change_gate.md`: a proposal, for the maintainer's decision, for one deterministic check that blocks what a pull request adds and a diff does not show, and tolerates what is already on `main`: - a new import or include across areas (for example `tools/` reaching into `tests/semantic` through `sys.path`); - a production function grown past the point where it can be changed safely (new functions above complexity 10, changed ones by more than 2, `main` by more than 5; dispatch functions judged per arm); - a block of text doubled by a merge. Every finding says why it matters, what exactly triggered it and how to fix it. Code duplication and new skips are reported, never blocking. The numbers are measured at `dde82f2`, which is in this repository's history, and backtested on the 300 merges that end with it: 48 of the 300 would have been stopped, 68 of the 91 blocking findings were changes that should have been fixed before merge, 2 were tool artefacts, and the check takes about 80 ms per pull request. Section 1.4 shows why it should run by the author and in the merge round and not only in CI: in the original repository 55 of 1,000 pull requests merged on 2026-11-23 had a passing CI run, and of the 40 most recently merged here, 19 had no CI run and 18 a failing CI job. I first opened this page in the original repository shortly before it went private. This is the same page with its references rewritten for this repository: commit hashes instead of the old pull request numbers. Nothing else changes; no code. Section 5 lists five questions for the maintainer. An implementation would be its own claim and pull request. ### Tested Docs only. Ran every `tests/test_docs_*.py` and `tests/test_i18n_index.py` (what the docs-only path of CI runs) on this branch, based on `d478a92`: all pass. GPUs tested: n/a (no GPU code) The numbers come from a standard-library prototype run offline on a local clone; it is not part of this pull request. No game files. AI-assisted: yes. The measurements, the backtest and the page were done with a coding agent; I reviewed the result. ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (Not applicable: no translator change.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
huanchong-99 commented 2026-11-24 05:54:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by huanchong-99 on 2026-11-24T05:54:07Z.


@ubiquitarianism This page needs a decision from you rather than a code review. Section 5 has five questions: the module boundaries, the complexity numbers, blocking from day one, running it in the merge round, and the runtime/src ↔ runtime/shims direction. One line per question is enough, and "no" is a fine answer: I'd rather hear no than build something you don't want.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7123381660 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/339#issuecomment-7123381660). Originally posted by [huanchong-99](https://github.com/huanchong-99) on 2026-11-24T05:54:07Z. --- @ubiquitarianism This page needs a decision from you rather than a code review. Section 5 has five questions: the module boundaries, the complexity numbers, blocking from day one, running it in the merge round, and the runtime/src ↔ runtime/shims direction. One line per question is enough, and "no" is a fine answer: I'd rather hear no than build something you don't want.
zmasi commented 2026-11-28 23:48:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:48:12Z.


Native Windows 11 Verification (98ac9ea777) — PASS

Diff-audited docs/change_gate.md (+313/-0) and verified merged onto origin/main (a9e247cd69) on Windows 11 (10.0.26200, Python 3.12.10 with -I).

Results

  • Full Documentation & Repository-Path Verification (PR #339 merged onto origin/main):
    • Verified 0 PR-introduced issues across all 13 documentation test suites:
      • tests/test_docs_repo_paths.py (rc=0 — every tools/, scripts/, tests/, and runtime/ file path referenced in docs/change_gate.md resolves on current origin/main)
      • tests/test_docs_adjacent_fenced_blocks.py (rc=0)
      • tests/test_docs_design_rows.py (rc=0)
      • tests/test_docs_encoding.py (rc=0)
      • tests/test_docs_env_vars.py (rc=0)
      • tests/test_docs_list_items.py (rc=0)
      • tests/test_docs_pr_template.py (rc=0)
      • tests/test_docs_python_deps.py (rc=0)
      • tests/test_docs_repeated_lines.py (rc=0)
      • tests/test_docs_table_ids.py (rc=0)
      • tests/test_docs_table_rows.py (rc=0)
      • tests/test_docs_links.py & tests/test_docs_cli_flags.py (0 issues in docs/change_gate.md)
    • tests/test_ci_registration.py (18/18), tests/test_text_write_line_endings.py (3/3), and scripts/check_no_game_data.py: OK.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247673655 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/339#issuecomment-7247673655). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T23:48:12Z. --- ### Native Windows 11 Verification (`98ac9ea777`) — PASS Diff-audited `docs/change_gate.md` (`+313/-0`) and verified merged onto `origin/main` (`a9e247cd69`) on Windows 11 (`10.0.26200`, Python `3.12.10` with `-I`). #### Results - **Full Documentation & Repository-Path Verification (`PR #339` merged onto `origin/main`)**: - Verified **`0` PR-introduced issues** across all 13 documentation test suites: - `tests/test_docs_repo_paths.py` (`rc=0` — every `tools/`, `scripts/`, `tests/`, and `runtime/` file path referenced in `docs/change_gate.md` resolves on current `origin/main`) - `tests/test_docs_adjacent_fenced_blocks.py` (`rc=0`) - `tests/test_docs_design_rows.py` (`rc=0`) - `tests/test_docs_encoding.py` (`rc=0`) - `tests/test_docs_env_vars.py` (`rc=0`) - `tests/test_docs_list_items.py` (`rc=0`) - `tests/test_docs_pr_template.py` (`rc=0`) - `tests/test_docs_python_deps.py` (`rc=0`) - `tests/test_docs_repeated_lines.py` (`rc=0`) - `tests/test_docs_table_ids.py` (`rc=0`) - `tests/test_docs_table_rows.py` (`rc=0`) - `tests/test_docs_links.py` & `tests/test_docs_cli_flags.py` (`0` issues in `docs/change_gate.md`) - `tests/test_ci_registration.py` (`18/18`), `tests/test_text_write_line_endings.py` (`3/3`), and `scripts/check_no_game_data.py`: **`OK`**. AI-assisted.
TheGeogeo commented 2026-11-29 17:12:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T17:12:35Z.


Tested 98ac9ea77 merged (no commit) with main 0bc6e21a1: Python 3.12.4, Windows 11 10.0.26300, CPU only.

  • The change is docs only (docs/change_gate.md), so no test can show a red.
  • No regression: the 13 tests/test_docs_*.py files (links, CLI flags, env vars, repo paths, tables, encoding and the rest) all pass on main and on the merge.
  • No game data check passes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7259509642 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/339#issuecomment-7259509642). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T17:12:35Z. --- Tested 98ac9ea77 merged (no commit) with main 0bc6e21a1: Python 3.12.4, Windows 11 10.0.26300, CPU only. - The change is docs only (`docs/change_gate.md`), so no test can show a red. - No regression: the 13 `tests/test_docs_*.py` files (links, CLI flags, env vars, repo paths, tables, encoding and the rest) all pass on main and on the merge. - No game data check passes. AI-assisted (Claude Code).
MoonEyes commented 2026-11-29 19:02:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T19:02:38Z.


Merging. Head 98ac9ea77 has red/green verdicts from reviewers other than the author (above), merges cleanly with main 35390e722, does not force a rebase of #2566, and carries a claim ID. Remaining main CI reds (translator-tests mesh, semantic-tests f16) are pre-existing. Merged by MoonEyes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7260960730 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/339#issuecomment-7260960730). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T19:02:38Z. --- Merging. Head `98ac9ea77` has red/green verdicts from reviewers other than the author (above), merges cleanly with `main` `35390e722`, does not force a rebase of #2566, and carries a claim ID. Remaining main CI reds (`translator-tests` mesh, `semantic-tests` f16) are pre-existing. Merged by MoonEyes. AI-assisted (Claude Code).
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!339
No description provided.