fix-cargo-install

Fix: cargo install in workgraph dir should warn if checked out on non-main branch

Metadata

Statusdone
Assignedagent-2279
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Modelcodex:gpt-5.5
Created2026-05-04T14:56:37.741416532+00:00
Started2026-05-04T14:57:44.710033081+00:00
Completed2026-05-04T15:17:30.107501953+00:00
Tagsfix,dev,ux,workflow, eval-scheduled
Eval score0.89
└ blocking impact0.95
└ completeness0.95
└ coordination overhead0.90
└ correctness0.90
└ downstream usability0.85
└ efficiency0.85
└ intent fidelity0.91
└ style adherence0.90

Description

Description

User's /home/erik/workgraph working directory periodically ends up checked out on an abandoned agent worktree branch (e.g., wg/agent-1398/fix-tui-perf). cargo install --path . from that state silently builds a binary missing all the recently-merged work on main. User then hits 'why isn't the fix working' bugs that are actually 'I built from the wrong branch.'

This has happened multiple times this week. Each time, the chat agent (me) initially missed it because I assumed cwd = main.

Fix

  • During cargo install --path . in the workgraph repo: detect non-main branch + warn
  • OR: a small wg dev-check command that checks 'are you on main, is your binary current with main HEAD' and warns if drift detected
  • Or: hook into wg quickstart to add this check as part of session-start orientation

Recommend option 2 (wg dev-check) so it's opt-in and doesn't fight with legitimate cases (developer is intentionally on a feature branch). Then quickstart mentions it.

Validation

  • wg dev-check (or whatever it's named) prints branch + binary mtime + main HEAD; warns if mismatched
  • Live smoke: from main, run check — green. From a non-main branch with stale binary, run — warns.
  • cargo build + cargo test pass
  • cargo install --path . was run before claiming done

Depends on

Required by

Log