exe_checklist: handle bare list markers, nested item continuations, and code fences (OLD-8385) #703

Open
github-bot wants to merge 4 commits from github-bot/gh-703 into main AGit
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 12:24 UTC · original
abnalstlll-byte:feat/exe-checklist-list-items → main · +149 −3 · 2 files · 4 commits · open

Summary

Restores old upstream PR 8385 (OLD-8385).

Refines markdown parsing in \ ools/exe_checklist.py:

  1. Allow bare empty markers at end-of-line by matching (?:\s+|$)\ in \LIST_ITEM.
  2. Track list item base indentation so nested sub-items (e.g. \ + ...\ or \ 1. ...) under a note are retained as continuations rather than falsely treated as sibling delimiters.
  3. Skip fenced code blocks (\) so code containing +\ or numbered markers does not truncate notes or trigger false notes.
  4. Add synthetic unit tests for bare markers, nested items, prose continuations, and code fences.

Verification

  • Tested with standard library: \python -I tests/test_exe_checklist.py\ (16/16 PASS).
  • Clean-room check: \python -I scripts/check_no_game_data.py\ clean.
  • Zero dependencies outside the Python standard library. No game files, retail binaries, or keys.
  • AI-assisted (Claude Code).
**@⁠abnalstlll-byte** on GitHub · 2026-11-24 12:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/703) `abnalstlll-byte:feat/exe-checklist-list-items` → `main` · +149 −3 · 2 files · 4 commits · open ### Summary Restores old upstream PR 8385 (OLD-8385). Refines markdown parsing in \ ools/exe_checklist.py\: 1. Allow bare empty markers at end-of-line by matching \(?:\s+|$)\ in \LIST_ITEM\. 2. Track list item base indentation so nested sub-items (e.g. \ + ...\ or \ 1. ...\) under a note are retained as continuations rather than falsely treated as sibling delimiters. 3. Skip fenced code blocks (\\\) so code containing \+\ or numbered markers does not truncate notes or trigger false notes. 4. Add synthetic unit tests for bare markers, nested items, prose continuations, and code fences. ### Verification - Tested with standard library: \python -I tests/test_exe_checklist.py\ (16/16 PASS). - Clean-room check: \python -I scripts/check_no_game_data.py\ clean. - Zero dependencies outside the Python standard library. No game files, retail binaries, or keys. - AI-assisted (Claude Code).
In tools/exe_checklist.py:doc_notes(), LIST_ITEM defines regex
^(?:[-*+]|\d+[.)])\s+ for list items. However, the continuation loop
that collects multi-line notes only checked startswith(("- ", "* ", "#", "|")).

When a document used ordered numbered lists (e.g. '1. ', '2. ', '3) ')
or '+ ' list items, the loop failed to stop at subsequent items,
concatenating them into the prior note text and leaving leading item
numbers in the note text.

Align the continuation termination check to not LIST_ITEM.match(lines[end].lstrip())
and strip prefixes using LIST_ITEM.sub("", ...).

Cover with unit tests in tests/test_exe_checklist.py.
No game files. AI-assisted (Gemini).
Address reviewer feedback from @tupacfan04:
1. Allow bare empty markers at end-of-line by matching (?:\s+|$) in LIST_ITEM.
2. Track list item base indentation so nested sub-items (e.g. '  + ...' or '  1. ...') under a note are retained as continuations rather than falsely treated as sibling delimiters.
3. Skip fenced code blocks (`) so code containing '+' or numbered markers does not truncate notes or trigger false notes.
4. Add synthetic unit tests for bare markers, nested items, prose continuations, and code fences.

No game data. AI-assisted (Gemini).
Address review feedback from @PierreEbele:
When a list item contains indented sub-items, stopping continuation only at
curr_indent <= base_indent caused nested items starting their own marker
(e.g. - **VERIFY:** child note under a parent note) to be included in the
parent note text as well as being parsed as an independent note.

Check DOC_MARK.match() on the nested item body so continuation stops when
a nested note begins. Add regression unit test in tests/test_exe_checklist.py.

AI-assisted (Claude Code)
Address review feedback from @PierreEbele:
1. Support ~~~ fenced code blocks alongside \\\ in closed_code_fences().
2. Ensure unclosed code fences do not hide later notes in the file.
3. Add regression unit tests in tests/test_exe_checklist.py; 19/19 tests pass.

AI-assisted (Claude Code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:17:06 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-24 19:34 UTC · original

Reviewed 1f52164: python3 -I tests/test_exe_checklist.py 16/16 OK (Ubuntu 24.04 arm64, Python 3.12.3). One
regression against main: a nested note is now reported twice and its marker ends up in the parent's text.
- **VERIFY:** parent note / - **VERIFY:** child note / - next gives on main
[(1, 'parent note'), (2, 'child note')], here [(1, 'parent note - **VERIFY:** child note'), (2, 'child note')].
Stopping the continuation at a nested item that starts its own marker would fix it; worth a test.
Smaller: an unclosed ``` fence now hides every later note in the file (main still reports them), and ~~~ fences
aren't recognised. AI-assisted review.

**@⁠PierreEbele** on GitHub · 2026-11-24 19:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/703#issuecomment-7142293873) Reviewed 1f52164: `python3 -I tests/test_exe_checklist.py` 16/16 OK (Ubuntu 24.04 arm64, Python 3.12.3). One regression against main: a nested note is now reported twice and its marker ends up in the parent's text. `- **VERIFY:** parent note` / ` - **VERIFY:** child note` / `- next` gives on main `[(1, 'parent note'), (2, 'child note')]`, here `[(1, 'parent note - **VERIFY:** child note'), (2, 'child note')]`. Stopping the continuation at a nested item that starts its own marker would fix it; worth a test. Smaller: an unclosed ``` fence now hides every later note in the file (main still reports them), and `~~~` fences aren't recognised. AI-assisted review.
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-25 16:27 UTC · original

Thank you for the review and catching that @⁠PierreEbele! Addressed in commit 522e36f72:

  • Added DOC_MARK.match(curr_body) check on nested list items so continuation immediately halts when a nested item begins with its own marker (**VERIFY:**, **NOTE:**, etc.).
  • Added regression unit test test_doc_notes_nested_item_with_own_marker_stops_continuation in tests/test_exe_checklist.py; all 17 tests pass.

AI-assisted (Claude Code)

**@⁠abnalstlll-byte** on GitHub · 2026-11-25 16:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/703#issuecomment-7168013159) Thank you for the review and catching that @⁠PierreEbele! Addressed in commit `522e36f72`: - Added `DOC_MARK.match(curr_body)` check on nested list items so continuation immediately halts when a nested item begins with its own marker (`**VERIFY:**`, `**NOTE:**`, etc.). - Added regression unit test `test_doc_notes_nested_item_with_own_marker_stops_continuation` in `tests/test_exe_checklist.py`; all 17 tests pass. AI-assisted (Claude Code)
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-25 21:31 UTC · original

Thanks @⁠PierreEbele! Updated in 35bae64b5:

  • Replaced the single-pass code fence toggle with \closed_code_fences()\ matching closed blocks of either \\ or ~~~\ fences.
  • Ensured unclosed fences never hide subsequent notes in the file.
  • Added regression unit tests \ est_doc_notes_tilde_fences_are_recognised\ and \ est_doc_notes_unclosed_fence_does_not_hide_later_notes\ in \ ests/test_exe_checklist.py\ (all 19 tests pass).
  • Rebased cleanly onto latest \main\ (\e34ff17e9).

AI-assisted (Claude Code)

**@⁠abnalstlll-byte** on GitHub · 2026-11-25 21:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/703#issuecomment-7175196165) Thanks @⁠PierreEbele! Updated in 35bae64b5: - Replaced the single-pass code fence toggle with \closed_code_fences()\ matching closed blocks of either \\\ or \~~~\ fences. - Ensured unclosed fences never hide subsequent notes in the file. - Added regression unit tests \ est_doc_notes_tilde_fences_are_recognised\ and \ est_doc_notes_unclosed_fence_does_not_hide_later_notes\ in \ ests/test_exe_checklist.py\ (all 19 tests pass). - Rebased cleanly onto latest \main\ (\e34ff17e9\). AI-assisted (Claude Code)
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/703/head:github-bot/gh-703'
git switch 'github-bot/gh-703'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-703'
git switch 'github-bot/gh-703'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-703'
git switch 'github-bot/gh-703'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-703'
git switch 'main'
git merge --squash 'github-bot/gh-703'
git switch 'main'
git merge --ff-only 'github-bot/gh-703'
git switch 'main'
git merge 'github-bot/gh-703'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.