Skip to content

Phase 5: workflow unification via PagedScrapeRunner (functional refactor plan)#75

Merged
astar-development-jb merged 2 commits into
mainfrom
phase-5-workflow-unification
Jul 6, 2026
Merged

Phase 5: workflow unification via PagedScrapeRunner (functional refactor plan)#75
astar-development-jb merged 2 commits into
mainfrom
phase-5-workflow-unification

Conversation

@jaybarden1

Copy link
Copy Markdown
Contributor

Summary

Phase 5 of docs/wallpaper-scrapper-functional-refactor-plan.md: SubscriptionsWorkflow and TopWallpapersWorkflow refactored to the Phase 4 SearchWorkflow shape, with the shared page loop extracted into a single generic PagedScrapeRunner.

  • New PagedScrapeRunner + PagedScrapePlan — one page-loop skeleton (cancel check → delay → record progress → save config → load page → get links → process links, fail-fast on first failure); the three workflows are now thin configurations of it.
  • SubscriptionsWorkflow / TopWallpapersWorkflowTask<Result<Unit, ScrapeError>> RunAsync, injected IDelayStrategy, Serilog.ILogger, failures logged via LogFailure and returned instead of thrown. Frozen quirks preserved: reset-to-page-1 + retry-once initial load, discarded per-page-load results, post-loop clear-all when PageCount > 0.
  • SearchWorkflow — page loop delegates to the runner; all pre-existing test assertions unchanged.
  • DelayKind.PageNavigation now derives from configuration (ImagePauseInSeconds) per plan decision §2; hard-coded 2s ScrapperConstants.PageNavigationDelay removed.
  • DI — both workflows + PagedScrapeRunner + SearchConfiguration registered; resolvability pinned by new tests (UI wiring stays out of scope per plan).

Deviations (plan-approved)

  • Result error channel replaces thrown InvalidOperationException in the two workflows.
  • PageNavigation delay: fixed 2s → configured ImagePauseInSeconds window.
  • Serilog.Core.LoggerSerilog.ILogger.
  • Runner adds a per-page ct.ThrowIfCancellationRequested() (pinned by test; same exception semantics).

Test plan

  • TDD: failing tests committed first (cdd3364), implementation second (f173824).
  • dotnet test AStar.Dev.Web.Scrapper.slnx: 583 passed, 1 pre-existing skip, 0 failed.
  • Reviewed by c-sharp-reviewer; MAJOR finding (unresolvable SearchConfiguration in DI) fixed + regression-tested.

🤖 Generated with Claude Code

jaybarden1 and others added 2 commits July 6, 2026 19:09
…tion

TDD red state: tests pin PagedScrapeRunner/PagedScrapePlan, Result-based
SubscriptionsWorkflow/TopWallpapersWorkflow, configured PageNavigation delay.
Build fails only on the not-yet-existing Phase 5 types.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…lan)

- New PagedScrapeRunner + PagedScrapePlan: shared page loop (delay ->
  record progress -> save config -> load page -> get links -> process)
- SubscriptionsWorkflow and TopWallpapersWorkflow refactored to the
  Phase 4 shape: Result<Unit, ScrapeError> RunAsync, injected
  IDelayStrategy, Serilog.ILogger; frozen quirks preserved
- SearchWorkflow page loop delegates to the runner
- DelayKind.PageNavigation now configuration-driven (ImagePauseInSeconds)
  per plan decision; ScrapperConstants.PageNavigationDelay removed
- Workflows + SearchConfiguration registered in DI, resolution pinned
  by tests

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jaybarden1 jaybarden1 requested a review from a team July 6, 2026 18:51
@astar-development-jb astar-development-jb enabled auto-merge (squash) July 6, 2026 18:54
@astar-development-jb astar-development-jb merged commit 4e917c4 into main Jul 6, 2026
6 checks passed
@astar-development-jb astar-development-jb deleted the phase-5-workflow-unification branch July 6, 2026 18:54
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.

2 participants