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

Open
opened 2026-11-26 20:17:44 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/339
Author: @huanchong-99
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: docs/change-gate-proposal


📝 Commits (1)

  • 98ac9ea docs: propose a change gate for module boundaries, function complexity and doubled text

📊 Changes

1 file changed (+313 additions, -0 deletions)

View changed files

➕ docs/change_gate.md (+313 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/339 **Author:** [@huanchong-99](https://github.com/huanchong-99) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `docs/change-gate-proposal` --- ### 📝 Commits (1) - [`98ac9ea`](https://github.com/ubiquitarianism/leonida/commit/98ac9ea7775c5e7ed8d552824386bed2b4bafbc0) docs: propose a change gate for module boundaries, function complexity and doubled text ### 📊 Changes **1 file changed** (+313 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `docs/change_gate.md` (+313 -0) </details> ### 📄 Description 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#390
No description provided.