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

Merged
abnalstlll-byte merged 4 commits from upstream-pr/703 into main 2026-11-28 10:59:34 +00:00
abnalstlll-byte commented 2026-11-24 12:24:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T12:24:54Z.


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).
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5472096540 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/703). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T12:24:54Z. --- ### 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).
PierreEbele commented 2026-11-24 19:34:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-24T19:34:33Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142293873 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/703#issuecomment-7142293873). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-24T19:34:33Z. --- 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.
abnalstlll-byte commented 2026-11-25 16:27:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-25T16:27:30Z.


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)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7168013159 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/703#issuecomment-7168013159). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-25T16:27:30Z. --- 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 commented 2026-11-25 21:31:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-25T21:31:41Z.


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)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7175196165 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/703#issuecomment-7175196165). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-25T21:31:41Z. --- 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)
MoonEyes commented 2026-11-28 10:59:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T10:59:29Z.


Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 23 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7238252547 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/703#issuecomment-7238252547). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T10:59:29Z. --- Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18). Targeted batch of 23 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13. AI-assisted (Claude Code, Claude Opus 5.5)
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!703
No description provided.