Skip to content

feat: doctor and adopt #4

Open

Description

@simonostendorf

Goal

A repository whose identity or location is wrong is reported, and the mechanical cases can be
fixed in place.

Context

  • Trigger: fourth milestone, independent of the fleet issue and runnable in parallel with it.
  • Affected: internal/doctor, cmd/gitcd.

This milestone is the fleet wide form of gitcd profile show, which the identity issue already
builds for a single repository. doctor is a loop over scan plus the global include checks.

The riskiest failure the tool exists to prevent is a commit landing under the wrong identity and
nobody noticing until it reaches a work remote. These checks are the last of the four defences
against it, after user.useConfigOnly, the clone read back and profile show.

Acceptance criteria

  • gitcd doctor reports a repository whose effective identity differs from the profile its
    rules imply, and names both.
  • It reports a repository under root sitting at a path the layout would not render.
  • It reports a missing or stale include block in ~/.config/gitcd/includes.gitconfig.
  • It reports a global identity key positioned after the gitcd include, which would win
    silently.
  • It reports a case mismatch between a rendered glob and the on disk spelling.
  • It distinguishes a deliberate pin, marked by gitcd.profile, from stale config.
  • It prints both config homes, ~/.gitcd.yaml and ~/.config/gitcd/, so neither surprises
    the user.
  • gitcd doctor --fix repairs the stale include block, the ordering and the case mismatches,
    and never touches identity keys it did not write.
  • gitcd adopt <path> moves an existing clone into the layout, fixes its config, prints the
    old and the new path, and asks before moving.
  • gitcd adopt refuses a repository with extensions.worktreeConfig enabled rather than
    guessing which config file to write.
  • Exit code is non zero when any finding is reported, so CI and a shell prompt can use it.
  • Tests cover one fixture per finding.
  • task check passes.

Out of scope

  • migrate for a changed layout template. adopt in a loop covers it until the layout changes.
  • status and sync.

Activity

  1. added
    ai: readyScoped + approved for an AI agent to pick up
    and removed
    needs triageNot yet triaged by a maintainer
    on Nov 13, 2026
  2. simonostendorf commented on Nov 13, 2026

    @simonostendorf
    MemberAuthor

    One criterion moves here from #8, because this is the milestone that builds doctor.

    • gitcd doctor reports an identity key in the global git config as a finding, naming the
      profile it would belong in and that it defeats the per remote identity for every
      repository no rule matches.

    Context is in #8: user.useConfigOnly only stops git guessing an identity from username and
    hostname. A global user.email is configuration, so git uses it, and an unmatched repository
    then commits under it. #8 handles the init side of that; this issue handles the reporting
    side.

  3. added
    ai: workingAn AI agent is implementing (incl. committed but not yet pushed)
    ai: reviewingAn AI agent is reviewing the pushed work
    ai: changes requestedAI review requested changes - back to the implement loop
    and removed
    ai: readyScoped + approved for an AI agent to pick up
    ai: workingAn AI agent is implementing (incl. committed but not yet pushed)
    ai: reviewingAn AI agent is reviewing the pushed work
    on Nov 13, 2026
  4. added
    ai: reviewingAn AI agent is reviewing the pushed work
    ai: workingAn AI agent is implementing (incl. committed but not yet pushed)
    and removed
    ai: changes requestedAI review requested changes - back to the implement loop
    ai: reviewingAn AI agent is reviewing the pushed work
    on Nov 14, 2026
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

    ai: workingAn AI agent is implementing (incl. committed but not yet pushed)featureNew feature or capabilitystack: goRelated to Go code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions