Skip to content

#418 step 2: Move issue effects and reads out of shared execution files #434

Closed

Description

@tannerpolley

Part of #418. Step 2 of 4. Depends on step 1. Full scope, tests and done criteria are in the canonical plan: #418 (comment) (item 2).

Scope: extract the issue effect handlers and locks from EffectWorker. Consolidate issue-only reads and projection updates through the existing owned modules, without moving commit ownership.

Preserve: lane concurrency, retry classification, drain, comment markers and snapshot freshness.

Tests: extend IssueCommentEffects, IssueWorkProjection/Store and the relevant EffectWorker/EventSink tests to cover:

  • retry after a remote write;
  • a stale attempt;
  • rollback;
  • startup replay.

Done:

  • the shared worker keeps its execution mechanics, with small typed hooks;
  • no after-commit claim writes;
  • fewer EffectWorker and ProjectionStore issue hunks.

Activity

  1. tannerpolley commented on Nov 17, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code status: Done

    Issue: #434 #418 step 2: Move issue effects and reads out of shared execution files

    Thread: thread:delegated-task:command%3Amcp%3A53eed4d4-49de-4205-ba6f-a35a0b15b7c9%3Adelegate-task%3Aissue-434-418-step2-2026-11-17

    Model: claude-opus-5-5

    Branch: issue-434-418-step-2-move-issue-effects-and-reads

    Updated: 2026-11-17T20:50:52.689Z

  2. tannerpolley commented on Nov 17, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: waiting_on_sub_issues

    Issue: #434 #418 step 2: Move issue effects and reads out of shared execution files
    Thread: thread:delegated-task:command%3Amcp%3A53eed4d4-49de-4205-ba6f-a35a0b15b7c9%3Adelegate-task%3Aissue-434-418-step2-2026-11-17
    Model: claude-opus-5-5
    Branch: issue-434-418-step-2-move-issue-effects-and-reads
    Completed: 2026-11-17T20:33:00.033Z

    Waiting on the fail-check run (bj0owvg8x). Its watcher bl4mdy3au wakes me when it finishes.

  3. tannerpolley commented on Nov 17, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: done

    Issue: #434 #418 step 2: Move issue effects and reads out of shared execution files
    Thread: thread:delegated-task:command%3Amcp%3A53eed4d4-49de-4205-ba6f-a35a0b15b7c9%3Adelegate-task%3Aissue-434-418-step2-2026-11-17
    Model: claude-opus-5-5
    Branch: issue-434-418-step-2-move-issue-effects-and-reads
    Completed: 2026-11-17T20:50:53.128Z

    I opened draft PR #459. It closes #434 and references #418. The issue effects now live in their own module, the touched focused tests pass, and this branch fails exactly the same tests as main. It is not merged.

    What changed

    • New module apps/server/src/issues/IssueEffects.ts now handles issue changes, suspension interrupt and notice, the usage-sprint notice, status refresh and GitHub comment writes. It also holds the per-issue write lock and the issue retry rules.
    • EffectWorker keeps the shared execution mechanics. It passes issue requests to the new module through one small typed check and wraps their errors, including GitHub's retry deadline.
    • Issue comment reads left the shared ProjectionStore interface. They are now plain reads in IssueWorkProjection.ts, with the same queries.
    • Issue projection updates go through one call in ProjectionStore instead of three. A comment receipt still updates its thread's last-updated time, as before.
    • Kept as they were: the separate issue worker lanes, retry rules, drain, comment markers and status freshness. EventSink still owns commits, and status refresh stays on EventSink. There are no after-commit claim writes, no schema change and no change to model-facing text.

    Fork footprint against upstream 7d32075e37 (whole-file lines added/removed, not issue-only counts):

    File Before After
    EffectWorker.ts +359 / −16 +92 / −14
    ProjectionStore.ts +450 / −43 +408 / −43

    Two issue reads stay in ProjectionStore because IssueLinks uses them to keep its cached issue list fresh, and its tests stub them. Completion and recovery reads are step 3; the PR body lists every remaining hunk and its owner.

    Tests

    • New test in IssueCommentEffects.test.ts, run against the real executor and a real database:
      • Rollback: a forced failure after GitHub accepted the comment leaves no receipt and no recorded event.
      • Retry: the retry writes again with the same marker, which is how GitHub finds the earlier comment, and records one receipt.
      • Startup replay: a fresh executor sees the saved receipt and does not write again.
      • Stale attempt: an older status write is skipped and the latest one is written.
    • Extended test: the existing retry-until-done test in EffectWorker.fork.test.ts now also covers the issue suspension interrupt.
    • The new assertions can fail: removing the receipt check, and separately removing the stale-write check, each makes the new test fail.
    • Focused run: 158 tests passed across 14 files.
    • vp run check:changed: format, lint, both knip checks, GraphQL and the typecheck of 3 packages pass. Tests: 100 passed, 3 failed.

    Baseline comparison (main 2178125d7c; the branch is rebased onto it):

    Test file Main This branch
    Orchestrator.control-reads.test.ts (#449) 2 failed same 2
    FoundationPersistence.test.ts (#449) 9 failed same 9
    ProjectionStore.fork.test.ts 3 failed same 3

    The 3 ProjectionStore.fork.test.ts failures were the only failures in check:changed. They fail the same way on main, but #449 doesn't track them yet.

    PR #459, head 5e195d0, checks and reviews: none reported yet.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions