Skip to content

Wire PR engine into the daemon (built but unwired) #86

@Pritom14

Description

@Pritom14

Problem

The PR observation subsystem is fully implemented and unit tested, but it is not wired into the running daemon:

  • daemon constructs the Lifecycle Manager with lifecycle.New(store, nil) and a noopMessenger, so PR nudges (and human /send) are silently dropped in production.
  • Nothing produces PR observations: service/pr.Manager and scm/github.Provider.Observe exist but no poller calls them. The polling loop was parked as a follow-up (referenced as Tracker observer loop: poll + ApplyTrackerFacts into LCM #35 in the provider docstring).

Net effect: a session can open a PR, CI can fail, and the agent is never nudged because the whole observation path is dark.

Goal

Make the PR engine live end to end in the daemon, with graceful degradation when no GitHub token is configured.

Approach (branch self-discovery)

domain.SessionMetadata already stores Branch, so a poller can self-discover each session's PR by its branch via the GitHub API. This avoids needing a hook-based PR-URL capture path.

  1. Real runtime messenger backing both human /send and lifecycle nudges.
  2. FindPRForBranch discovery primitive on the GitHub provider.
  3. A PR poller (the parked loop) that discovers, observes, persists, and reacts.
  4. Daemon wiring: provider + PR service + poller goroutine with lifecycle-managed shutdown.

Acceptance

  • Daemon wires a real messenger, provider, PR service, and poller goroutine.
  • No GitHub token: poller is disabled with a warning, daemon still starts.
  • gofmt, go vet, go build clean; race tests green for all touched packages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions