Skip to content

Refactor R1: EmailService takes one deps object #314

Closed

Description

@Silthus

Part of #291

Question

Refactor slice R1 from the accepted brief: EmailService takes one EmailServiceDeps object and builds its submodules inside; none is injected (C2). Update every construction site. Behavior-preserving; the S1 and S2 suites stay green unchanged. Comment changes ride with the code they move (C12, brief section 11).

Activity

  1. Silthus commented on Oct 6, 2026

    @Silthus
    OwnerAuthor

    Runtime: T3 delegate_task (app-owned child of the conductor thread)
    Task: wf291-implement-314-r1
    Cast: codex / gpt-6.1-sol, reasoning high (behavior-preserving refactor); review: claude -p claude-opus-5-5, or qa-swarm if merge-risk names a danger area
    Branch: refactor/workflows-email-service-deps (stacked on fix/workflows-email-sent-stays-sent, PostHog#112870)
    CodeRabbit slot: 1 of 3
    Cap: 150 min wall time from 20:04 UTC

  2. self-assigned this
    on Oct 6, 2026
  3. Silthus commented on Oct 6, 2026

    @Silthus
    OwnerAuthor

    Note

    🤖 GPT-6.1 Sol responding on behalf of Michael

    Draft PR: PostHog#112885

    The green-before/after proof, assertion-level diff and local gate are linked in the PR description. The pre-push hook passed without a bypass. QA panel and read-only Opus review follow.

  4. Silthus commented on Oct 6, 2026

    @Silthus
    OwnerAuthor

    Note

    🤖 GPT-6.1 Sol responding on behalf of Michael

    Resolved

    Draft PR PostHog/posthog#112885 is ready for Michael's review. Reviewed and pushed head: 3737711a04b8e0e21243d129598759598fd0f280.

    EmailService takes one EmailServiceDeps object. All 12 construction sites use named dependencies; optional workflow and team limiters default to off. SES client and recipient-token service construction stay inside the service. All ten send-service methods remain byte-for-byte unchanged, including their comments. No new tests, assertion edits, mock edits or skips.

    Stacked on PostHog#112870, on PostHog#112859, PostHog#112850, PostHog#112831, PostHog#112820, PostHog#112316 and PostHog#112295. The PR targets master and carries the parent commits until they merge. Only refactor/workflows-email-service-deps was pushed; no parent branch or PR changed. The PR is linked to this worker and the conductor T3 thread.

    Proof

    • Green before and green after: 513 existing email, helper, S1, S2 and worker E2E tests pass on both trees, none skipped. The worker E2E suite includes the real-SDK SES throttle round-trip.
    • Assertion-level diff and re-runnable comparison: all six changed test/helper files preserve dependency expressions and every non-constructor token, including all assertions.
    • Local gate: hogli test on all five touched test files passes 360 tests; full Node lint and typecheck pass. Strict preflight against upstream/master and through the pre-push hook both exit 0. No hook bypass.
    • Environment wrapper: explicit test databases and Flox native library path. Development commands used the new worktree's .codex/with-flox. The healthy local SES fake stayed running; no Docker service was restarted or stopped.

    Merge risk is medium, a one-way door because a sent email cannot be unsent. The danger area is real-send dependency wiring. The unchanged send methods and S1/S2 safety net limit it. Own increment: production +43/-21, test/helper +128/-122 across eight files.

    Reviews and outcomes

    • CodeRabbit first: cr auth status --agent returned not_authenticated. CLI review skipped under the AFK rule. No bot review or unresolved review thread appeared during the panel.
    • QA panel, round 1: three read-only T3 delegate_task calls, provider codex, model gpt-6.1-sol, correctness, risk and design. Each cleared all eight files with FINDINGS: (none). Zero fixes and zero rejections.
    • Cross-family review: one read-only claude -p --model claude-opus-5-5 --allowedTools Read,Grep,Glob --tools Read,Grep,Glob run, awaited through exit 0. It cleared all eight files with no findings.
    • Every review excluded the parent commits from the diff against upstream/master at 1d9e48c7e23e3. No review-driven source changes or second round were needed. Local, remote, reviewed and proven heads match.

    Gaps and follow-ups

    Upstream fork CI is action_required until a maintainer approves it; it is outside this handoff. GitHub denied the upstream assignee update. The PR stays a draft and awaits human review.

    Fresh-worktree setup needed local package builds. The hook scans against the fork's older master; the actual-upstream-base check also passed. These existing tooling issues remain outside this map and were reported through hogli devex:feedback. Broader suites use the repo's existing --forceExit convention for pre-existing open handles; test assertions and teardown did not change.

    No new follow-up tickets proposed. No pending decisions. R2 remains the next accepted slice; no downstream work was dispatched.

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions