Skip to content

Add the git adapter for working-tree and base-branch ground truth #1038

Description

@williamthorsen

Problem

Lane state derives only from emitted events. The trust model makes deterministic sources ground truth, but working-tree state and base-branch advance are invisible, and an abnormally ended session (no session.ended hook fired) persists indefinitely.

Context

Proposed solution

First implementation of the server-side adapter pattern: poll repositories discovered from lane data (git -C), surfacing checked-out branch, working-tree dirty state, and ahead/behind against the base branch — behind > 0 is base-branch advance. Includes the worktree-existence backstop: a lane whose cwd no longer exists closes as worktree-gone.

Observations enter derivation as server-side enrichment merged at snapshot time, not as transition events: git state is re-probeable ground truth, so persisting it would cache what a probe answers, and session files carry only session-attributed events. The adapter is a read-only observer — it never fetches or otherwise mutates a repository; base-branch advance is measured against the local remote-tracking ref, which worktrees share.

Acceptance criteria

Must have

  • Base-branch advance and working-tree state surface on the lane within one poll interval.
  • A lane whose worktree no longer exists closes as worktree-gone.
  • The adapter never mutates a repository and never contacts the network.
  • An unreadable repository degrades that lane's git data, not the app.
  • New behavior is covered by tests.
  • Documentation reflects the new configuration surface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureAdded or improved external functionalityscope:fleet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions