feat(tools): warn when a pull request adds a technical debt entry over 1000 characters #6757

Merged
LeandroLP23 merged 1 commit from upstream-pr/6757 into main 2026-10-19 10:17:55 +00:00
LeandroLP23 commented 2026-10-16 09:47:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-16T09:47:32Z.


What

Proposal 2 of #6755. A new debt-length rule in tools/check_conventions.py, at warning level: a line a pull request adds or edits in docs/dev/TechnicalDebt.md or docs/dev/debt/*.md that starts an entry (- ) and is over 1000 characters is annotated. The annotation asks to state the gap first and keep only the behaviour the gap needs. Warnings don't fail the job: output() already counts only errors.

The goal is that an edit shortens an entry instead of extending it. On main the median entry is 564 characters, 177 of 984 are over 1000, and the longest is 5478. Over the 289 first-parent commits since 2026-10-13 that touched the debt files, 108 added or edited at least one entry over the limit.

  • The check is its own method, Check.debt_entries, with the test long_debt_entry as a function, so it doesn't touch the docs() lines #6723 changes.
  • Only lines the pull request adds are checked. Existing entries warn only once someone edits them.
  • Sub-bullets and prose lines aren't entries and aren't checked.

Tested

  • New conventions_debt_length (registered in CMakeLists.txt). It checks the threshold boundary, that prose lines are ignored, and a temporary repository whose second commit adds a long entry: one finding on the right line, and output() returns 0. With the rule set to error or the limit doubled, the test fails.
  • All other tools/tests/test_check_conventions_*.py pass, including all six comments shards.
  • tools/check_conventions.py --base origin/main passes on this branch.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4886527459 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6757). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-16T09:47:32Z. --- ### What Proposal 2 of #6755. A new `debt-length` rule in `tools/check_conventions.py`, at warning level: a line a pull request adds or edits in `docs/dev/TechnicalDebt.md` or `docs/dev/debt/*.md` that starts an entry (`- `) and is over 1000 characters is annotated. The annotation asks to state the gap first and keep only the behaviour the gap needs. Warnings don't fail the job: `output()` already counts only errors. The goal is that an edit shortens an entry instead of extending it. On `main` the median entry is 564 characters, 177 of 984 are over 1000, and the longest is 5478. Over the 289 first-parent commits since 2026-10-13 that touched the debt files, 108 added or edited at least one entry over the limit. - The check is its own method, `Check.debt_entries`, with the test `long_debt_entry` as a function, so it doesn't touch the `docs()` lines #6723 changes. - Only lines the pull request adds are checked. Existing entries warn only once someone edits them. - Sub-bullets and prose lines aren't entries and aren't checked. ### Tested - New `conventions_debt_length` (registered in `CMakeLists.txt`). It checks the threshold boundary, that prose lines are ignored, and a temporary repository whose second commit adds a long entry: one finding on the right line, and `output()` returns 0. With the rule set to `error` or the limit doubled, the test fails. - All other `tools/tests/test_check_conventions_*.py` pass, including all six `comments` shards. - `tools/check_conventions.py --base origin/main` passes on this branch. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code)
github-actions[bot] commented 2026-10-16 10:24:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T10:24:23Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 674 CMakeLists.txt
PR 1835 CMakeLists.txt
PR 5021 CMakeLists.txt
PR 6044 CMakeLists.txt
PR 6746 CMakeLists.txt
PR 6879 CMakeLists.txt
PR 6946 CMakeLists.txt
PR 6947 CMakeLists.txt
PR 7039 CMakeLists.txt
PR 7201 CMakeLists.txt
PR 7332 CMakeLists.txt
PR 7642 CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6213407809 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6757#issuecomment-6213407809). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T10:24:23Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 674](https://www.github.com/boykopovar/AnyPS5/pull/674) | `CMakeLists.txt` | | [PR 1835](https://www.github.com/boykopovar/AnyPS5/pull/1835) | `CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `CMakeLists.txt` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `CMakeLists.txt` | | [PR 6746](https://www.github.com/boykopovar/AnyPS5/pull/6746) | `CMakeLists.txt` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `CMakeLists.txt` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `CMakeLists.txt` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `CMakeLists.txt` | | [PR 7039](https://www.github.com/boykopovar/AnyPS5/pull/7039) | `CMakeLists.txt` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `CMakeLists.txt` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `CMakeLists.txt` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `CMakeLists.txt` |
adriadam10 commented 2026-10-19 10:18:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T10:18:38Z.


Checked the debt-length rule: it only reports added lines starting an entry (- ) in TechnicalDebt.md / docs/dev/debt/*.md, stays at warning level so output() still returns 0, and conventions_debt_length is registered in ctest and passes (boundary, prose ignored, temporary repo with one long entry). Merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6264941600 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6757#issuecomment-6264941600). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T10:18:38Z. --- Checked the `debt-length` rule: it only reports added lines starting an entry (`- `) in `TechnicalDebt.md` / `docs/dev/debt/*.md`, stays at warning level so `output()` still returns 0, and `conventions_debt_length` is registered in ctest and passes (boundary, prose ignored, temporary repo with one long entry). Merged.
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
boykopovar/AnyPS5!6757
No description provided.