Skip to content

pm-stack Phase 3: consolidation — merge aggregator, quota gatherer, fleet-feed collector and projector into one pm-core service (dispatch stays separate) #8570

Open

Description

@dezren39

Phase 3 — consolidation: the glued-together tools become one core service

Design: pm-stack-notifications-design-2026-11-11.md (goal keep-the-four-repos-healthy, files/). Siblings: #8568 (Phase 1, producers), #8569 (Phase 2, edge relay). Context: #5082 (board dies with empty replies while siblings struggle), the pending pm-projector socket-activation work.

What recon established

The "five tools" are already ONE Bun/TypeScript monorepo (pm-stack/ in this repo) deployed as separate laptop processes from one checkout:

Process today Reality
pm-aggregator (:4870) bun run aggregator/src/server.ts — board, quota views, attention, alert throat + push engine
quota-gatherer (timer) bun run aggregator/scripts/gather-quota.ts — a script in the aggregator package, writes quota-current.json
fleet-feed-collector (timer) bun run aggregator/scripts/collect-fleet-feed.ts — same package, writes fleet-feed.json
pm-projector (:7801) bun run projector/src/index.ts — GitHub webhook intake + reconcile; disposable projection DB; aggregator reads it over HTTP (PM_PROJECTOR_URL)
pm-dispatch (:4879) separate Bun app, public via tunnel (dispatch.security.cab), holds session-launch authority

State passes between them as files in ~/.local/state/pm-aggregator/ and one HTTP hop — which is how the board 503s when a sibling is unhealthy, and why every deploy/restart story is five stories.

The merged shape

  • pm-core (one process): the aggregator server with the gatherer and feed collector folded in as in-process schedulers (same code, no file-polling handoff — freshness becomes in-memory, the JSON files remain as audit/debug artifacts written by the process, not read by it), the notification engine (already in-process), and the projector as a module: its webhook listener keeps its own port (public intake is a different trust surface) but runs in the same process, and the board reads projections in-process instead of over HTTP. The pending projector socket-activation work is absorbed into the core's listener story instead of being solved a second time.
  • pm-dispatch stays separate: public ingress + session-launch authority is a different security posture, and it was just rebuilt under the item-5 work.
  • Kaneo + the Cloudflare Tunnel stay as they are (upstream container; ingress).

Net: 5 laptop processes in the pm family → 2 (pm-core, pm-dispatch), one restart story, one deploy story.

Acceptance (Drew's terms)

  • One service restart moves board + quota + feed + projections together; there is no sibling process left whose bad day makes /board return 503.
  • systemctl --user shows pm-core + pm-dispatch (+ tunnel) as the whole pm family; the two timer units are gone, replaced by in-process schedules with the same cadences (quota ~15 min ticks, feed ~5 min).
  • Killing the projection module's GitHub intake degrades board link data visibly (provenance chips say so) — it does not take the board down.
  • All pre-existing machine surfaces keep their shapes: /api/board.json, /api/quota.json, /api/attention.json, /api/alerts.json, /api/needs-drew.json byte-compatible for current consumers (fleet minder, steward, globalping watch).

Activity

  1. added
    kind/featureNew feature or capability request
    priority/normalOrdinary priority (the default)
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 11, 2026
  2. developing-today commented on Nov 11, 2026

    @developing-today
    Contributor
  3. added
    design/pm-notificationsDesign: pm-notifications - all issues of this effort carry it
    epic/pm-stackReprioritization program epic (2026-11-12)
    on Nov 12, 2026
  4. added this to the PM stack coherence milestone on Nov 12, 2026
  5. added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    on Nov 17, 2026
  6. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged — task 18690 (lane code-e)

  7. removed their assignment
    on Nov 20, 2026
  8. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: in_progress
    task: 20173
    lane: agent-next-01
    worker: agent-next-01
    origin: fleet-agent-next

    Delivered the schedulers-first vertical slice in PR #12905 (commit 2006080): quota and fleet-feed jobs are now importable without changing their CLI entry points, and a tested pm-core scheduler seam defines 15-minute quota / 5-minute feed cadences, single-flight guards, and write-only audit records. Verification: targeted Bun tests 3/3 pass, bunx tsc --noEmit passes, and git diff --check passes. The remaining projector in-process read and systemd unit cutover are explicitly left as the next slices.

  9. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor
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

    app/pm-stackpm-stack (Pad/Grist) in developing-today/codedesign/pm-notificationsDesign: pm-notifications - all issues of this effort carry iteffort/lLarge: multi-day or open-ended; expect staged check-insepic/pm-stackReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)queue/queuedHas a queued queue tasktask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions