Skip to content

I3153 — Task start says how far its base is behind the remote's master as last fetched, and stops only on a diverged local master, with the next step

Have start report how far merge-base(HEAD, refs/remotes/origin/master) is behind, with the age of the last fetch from that ref's reflog, warn on a dirty tree, and refuse only when local master is both ahead of and behind refs/remotes/origin/master, naming the command that brings it current; start never fetches and never pushes.

BLOCKED wave 0 · p2 · implementation profile · parallel safe

Part of entry-proves-what-it-handed — An episode records the governance and briefing it was handed, and a change is told.

Blocked. This issue cannot start until milestone:entry-proves-what-it-handed is done. The status is derived from that, not declared.

Objective

Have start report how far merge-base(HEAD, refs/remotes/origin/master) is behind, with the age of the last fetch from that ref's reflog, warn on a dirty tree, and refuse only when local master is both ahead of and behind refs/remotes/origin/master, naming the command that brings it current; start never fetches and never pushes.

Why

The owner asked (2026-09-12) that master be updated at every session start; the safe reading is fetch, verify, stop on divergence, push only through the sanctioned path. The 2026-10-14 incident (worktree create started a remote branch from a stale local master) is fixed on master: worktree create fetches and starts from the remote's trunk (case 3131_a_new_worktree_starts_from_the_remote_trunk), so this issue is the start half. Sources: chatgpt-majordomus:c128#1, chatgpt-majordomus:c128#2.

Current state

environment/vcs.rs reads ahead/behind against the branch's own upstream without fetching; lib/start.sh records mj_git_dirty and reports neither distance nor fetch age; worktree create already starts from <remote>/<trunk> (case 3131).

Desired state

start's verdict names the fetch age, the local and remote heads and the distance of its base.

Scope

  • lib/start.sh
  • apps/majordomus-cli/src/environment/vcs.rs
  • docs/WORKTREES.md
  • apps/majordomus-cli/src/worktree/trunk.rs
  • apps/majordomus-cli/src/worktree/git.rs
  • apps/majordomus-cli/src/commands/worktree.rs
  • apps/majordomus-cli/tests/worktree.rs
  • test/cases/04_start_check.sh

Out of scope

  • Any network call at directory entry
  • Pushing master

Dependencies

None. This issue is a root of the graph.

Acceptance criteria

  • A base behind origin/master is named with the fetch age
  • A diverged local master stops start with a next step; a dirty tree is a warning
  • Cases use real git repositories with a remote
  • Each new case named here takes its number from `scripts/case-numbers next` and is announced on the board before the file is written (ADR 0053); a case number written in this record before that is provisional

Validation

  • bash test/run.sh 04_start_check 3131_a_new_worktree_starts_from_the_remote_trunk

Evidence required

  • case_start_reports_base_divergence

Evidence

None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.

Timeline

started
—
verified
—
completed
—

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I3153.yaml. Read it back with majordomus plan show I3153.

Searches the titles and descriptions of every page this site publishes.