Skip to content

feat: Perch Pilot — deterministic next-action engine for the notch - #2

Merged
NitinKumar004 merged 12 commits into
mainfrom
feat/perch-pilot
Oct 11, 2026
Merged

NitinKumar004 merged 12 commits into
mainfrom
feat/perch-pilot

Conversation

@NitinKumar004

Copy link
Copy Markdown
Owner

Perch Pilot — your single highest-leverage next action (deterministic, no AI)

Pilot turns the glance into the next move. It composes the actionable dev signals Perch already produces — your PRs, review requests, CI builds, deploy health — ranks the implied actions on one shared priority scale, and surfaces the single most urgent next action on the pill plus the ranked list (each tappable) in the panel.

Examples it shows: Merge #120 — approved + green · CI failing on main → look · 2 to resolve #118 → your move · Review #42 · Deploy degraded → check.

All logic is pure code — no LLM. Prioritisation is a named PilotPriority scale + a deterministic ranker.

How it fits the architecture

  • New aggregator module (pilot.actions) that mirrors CombinedModule: it runs existing modules as members and folds their output — changing none of them.
  • Adds actions(for:context:) to NotchModule as a defaulted protocol method (every existing module compiles unchanged), threaded through ModuleRender next to detail.
  • Each signal module maps its own typed state to actions. PRs are queue-aware (one action per PR) via a shared classify so status(for:) output stays bit-identical.
  • Registered as one ModuleSpecs entry; the catalog, picker and factory all follow.

Honest at the edges (the "it never lies" promise)

  • Checking… until every source has reported (no premature green).
  • All clear only when ready and nothing is pending.
  • N unavailable when a configured source can't be read or isn't set up (e.g. CI toggled on with no repo) — never a false "All clear".
  • Retains the last good actions across a transient stale/error, flagged honestly.

Scope

  • v1 actions are navigation only (tap opens the PR / run / deploy). Read-only — no GitHub writes.
  • No Pilot notifications / no auto-open (opensPanelOnCritical: false): the standalone PR/Build modules already alert, so Pilot stays a calm, glanceable to-do. Write-actions (merge, re-run) and opt-in alerts are a clean v2 seam.
  • Defaults: My PRs + Reviews on (work with zero config); CI builds + deploy off until you set a repo / URL.

Concurrency

Aggregation runs in a task group; an actor accumulator owns the continuation and yields in-actor, so emissions are serialized and ordered; the risky reduce logic is a pure, table-tested function.

Testing

swift build clean · 327 tests pass (+12 new): ranker, the pure reducer (reported/unavailable/retention), PR/Build/Deploy action mappings, pill/panel honesty, render threading, factory resolution, and end-to-end streaming.

Process

Built per docs/engineering-workflow.md: the plan was approved after 4 independent Sonnet review rounds, and the code after 2 (concurrency, output-preserving classify, no false "All clear"). One commit per file.

@NitinKumar004
NitinKumar004 merged commit 5b5d90b into main Oct 11, 2026
1 check passed
@NitinKumar004
NitinKumar004 deleted the feat/perch-pilot branch October 11, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant