Skip to content

refactor(acquisition): retire legacy polling WatchRunner #648

Closed

Description

@Sinity

Problem

The live cursor/freshness cleanup in #620 is about content-aware source progress, but polylogue/pipeline/watch.py still contains a legacy polling abstraction that only loops around sync_fn() and time.sleep(interval).

Decision (2026-05-03)

Delete WatchRunner and the --watch flag together. Per the daemon architecture (#717), watching is what the daemon is. The legacy polling loop adds no content-awareness and has no role post-daemon. Option B (narrowing/renaming) is explicitly rejected — keeping a legacy polling abstraction alive in the codebase contradicts the daemon-owns-all-writes model.

Current state

  • Definition: polylogue/pipeline/watch.py:15-44 — generic sync_fn() + time.sleep(interval) loop
  • Single call site: polylogue/cli/commands/run.py:316,354 — used for polylogue run --watch
  • No other references: no imports in tests, docs, or other modules

The observer pattern (RunObserver, CompositeObserver) lives in polylogue/pipeline/observers.py — that stays regardless.

Deletion surface

  • polylogue/pipeline/watch.py — delete
  • polylogue/cli/commands/run.py:315-358 — remove the if watch: block and the --watch Click option
  • Check polylogue/pipeline/__init__.py for re-exports (likely not exported)

Acceptance criteria

Ref #620
Ref #717

Activity

  1. added
    type:refactor
    on May 1, 2026
  2. Sinity commented on May 2, 2026

    @Sinity
    OwnerAuthor

    Current state (2026-05-02)

    WatchRunner is still wired — it's not dead code yet:

    • Definition: polylogue/pipeline/watch.py:15-44 — generic sync_fn() + time.sleep(interval) loop
    • Single call site: polylogue/cli/commands/run.py:353 — used for polylogue run --watch
    • No other references: no imports in tests, docs, or other modules

    Recommended path

    The --watch flag is the only consumer. Two options:

    A) Delete WatchRunner + the --watch flag together — simplest. The watch loop adds no content-awareness (no cursor tracking, no parser-fingerprint gating, no observation diagnostics beyond a generic observer callback). If nobody uses --watch in practice, kill both.

    B) Narrow the contract — rename to PollingWatchRunner and add a docstring note that it's the legacy polling path, distinct from #620's content-aware live cursors. This avoids confusion for anyone reading the codebase.

    If going with (A), the deletion surface is small:

    • polylogue/pipeline/watch.py — delete
    • polylogue/cli/commands/run.py:315-358 — remove the if watch: block and the --watch Click option
    • Check polylogue/pipeline/__init__.py for re-exports (likely not exported)

    The observer pattern (RunObserver, CompositeObserver, etc.) is separate from WatchRunner and lives in polylogue/pipeline/observers.py — those stay regardless.

  3. Sinity commented on May 3, 2026

    @Sinity
    OwnerAuthor

    Implemented in 5003c52 (refactor(cli): remove WatchRunner and --watch flag). WatchRunner and --watch flag deleted, polylogue/pipeline/watch.py and polylogue/cli/shared/run_watch_workflow.py removed, CLI imports cleaned up.

  4. Sinity commented on May 3, 2026

    @Sinity
    OwnerAuthor

    Reopening after branch reconciliation on 2026-05-03. The closed state is not true on origin/master: WatchRunner and polylogue run --watch are still present, and the local deletion commit I found (5003c52f) mixes the CLI/runtime removal with a large docs/design/mk2/ design pack plus stale docs/tests/snapshots. I am not carrying that branch forward as-is.\n\nNext implementation should be a fresh PR from origin/master with only the WatchRunner/--watch removal, updating docs/generated surfaces/tests/changelog and satisfying the original acceptance criteria. The MK2 design pack belongs separately under #717.

  5. reopened this on May 3, 2026
  6. Sinity commented on May 3, 2026

    @Sinity
    OwnerAuthor

    WatchRunner (polylogue/pipeline/watch.py) was removed in the pre-flight refactor (commit 5003c52f merged via #718). grep -rn WatchRunner polylogue/ --include='*.py' returns empty. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:pipelinetype:refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions