Skip to content

refactor: вынести подготовку прогона из _collect_one - #50

Merged
axisrow merged 6 commits into
mainfrom
ao/wordstat-27/root
Aug 31, 2026
Merged

axisrow merged 6 commits into
mainfrom
ao/wordstat-27/root

Conversation

@axisrow

@axisrow axisrow commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • extract resume validation and fresh-run manifest creation into _prepare_run
  • return explicit _PreparedRun state to _collect_one
  • preserve resume mismatch, no-overwrite, stale-entry pruning, and manifest write behavior

Closes #44

Tests

  • ruff check .
  • pytest -q (190 passed)
  • mutation checks: resume phrase mismatch (red when validation bypassed), initial manifest write (red when removed); an exploratory complete-run guard mutation was not killed because the selected existing tests do not exercise that helper branch.

No tests changed.

@axisrow axisrow left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The fresh-run preparation regresses manifest provenance: source_url is captured before the requested phrase is entered, so this PR is not ready until it is captured after _set_phrase (and region setup) or refreshed before the first manifest write. No other high-confidence findings.

Comment thread src/wordstat/collector.py

@axisrow axisrow left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The URL regression is fixed, but fresh-run updated_at still does not follow the manifest timestamp contract. No other high-confidence findings.

Comment thread src/wordstat/collector.py Outdated

@axisrow axisrow left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. The current head fixes the fresh-run URL provenance issue and now timestamps the post-setup manifest write with updated_at=datetime.now(UTC). I found no remaining high-confidence correctness, security, or error-handling issues in the diff.

@axisrow
axisrow merged commit 9711bc8 into main Aug 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: вынести подготовку прогона из _collect_one

1 participant