content_definitions: roll back failed input counts (CONTENT-COUNTS-ATOMIC) #1180

Open
github-bot wants to merge 1 commit from github-bot/gh-1180 into main AGit
Owner

@⁠Taffyyy-ops on GitHub · 2026-11-24 19:41 UTC · original
Taffyyy-ops:fix/content-counts-atomic → main · +63 −0 · 2 files · 1 commits · open

Claimed in the coordination issue as: CONTENT-COUNTS-ATOMIC

What and why

When a directory yields valid documents and then fails, its partial counts are currently included despite the input being marked failed. Restore the pre-input counters on failure while preserving completed inputs and the existing error status.

Tested

  • python -I tests/test_content_counts_atomic.py: 2 tests passed; baseline reproduces three failure cases.
  • python -I tests/test_content_definitions.py: 12 tests passed.
  • python -I tests/test_text_write_line_endings.py: 3 tests passed.
  • python -I scripts/check_no_game_data.py and git diff --check: passed.
  • Synthetic inputs only; Windows 11, Python standard library. GPU not required.

AI-assisted: yes.

**@⁠Taffyyy-ops** on GitHub · 2026-11-24 19:41 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1180) `Taffyyy-ops:fix/content-counts-atomic` → `main` · +63 −0 · 2 files · 1 commits · open Claimed in the coordination issue as: CONTENT-COUNTS-ATOMIC ### What and why When a directory yields valid documents and then fails, its partial counts are currently included despite the input being marked failed. Restore the pre-input counters on failure while preserving completed inputs and the existing error status. ### Tested - python -I tests/test_content_counts_atomic.py: 2 tests passed; baseline reproduces three failure cases. - python -I tests/test_content_definitions.py: 12 tests passed. - python -I tests/test_text_write_line_endings.py: 3 tests passed. - python -I scripts/check_no_game_data.py and git diff --check: passed. - Synthetic inputs only; Windows 11, Python standard library. GPU not required. AI-assisted: yes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:41:46 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 19:42 UTC · original · approved these changes

Reviewed and verified. Ensures atomic counting semantics in tools/content_definitions.py by rolling back in-progress counts when an input member fails midway, preventing partial contributions from corrupting aggregate statistics while keeping error reporting intact. Verified with tests/test_content_counts_atomic.py. 100% clean-room.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 19:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1180#pullrequestreview-6046148284) · **approved these changes** Reviewed and verified. Ensures atomic counting semantics in `tools/content_definitions.py` by rolling back in-progress counts when an input member fails midway, preventing partial contributions from corrupting aggregate statistics while keeping error reporting intact. Verified with `tests/test_content_counts_atomic.py`. 100% clean-room.
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:09 UTC · original

Recommendation: [MERGE]

Reasoning: content_definitions rolls back an input's partial counts when that input later fails, so failed inputs no longer inflate the totals. Tiny tool fix (+4) with tests that reproduce the three failure cases. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 2/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1180#issuecomment-7143126026) **Recommendation:** [MERGE] **Reasoning:** `content_definitions` rolls back an input's partial counts when that input later fails, so failed inputs no longer inflate the totals. Tiny tool fix (+4) with tests that reproduce the three failure cases. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 2/10
Author
Owner

@⁠Taffyyy-ops on GitHub · 2026-11-25 10:45 UTC · original

@⁠abnalstlll-byte @⁠Deedlyy Thanks for the review and [MERGE] recommendation! No further changes needed on my side — ready once CI finishes.

**@⁠Taffyyy-ops** on GitHub · 2026-11-25 10:45 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1180#issuecomment-7160128214) @⁠abnalstlll-byte @⁠Deedlyy Thanks for the review and `[MERGE]` recommendation! No further changes needed on my side — ready once CI finishes.
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/1180/head:github-bot/gh-1180'
git switch 'github-bot/gh-1180'

Merge

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