fix-dir-flag

Fix: --dir flag's clap default_value still says .workgraph (missed by fix-replace-stale)

Metadata

Statusabandoned
Assignedagent-1381
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-05-01T18:49:09.358273337+00:00
Started2026-05-01T18:49:49.081206336+00:00
Tagsfix,docs,paths,cli, eval-scheduled

Description

Description

fix-replace-stale (commit 785bc5a32) updated docs/COMMANDS.md, bundled quickstart, agent-guide, etc. to use .wg/ instead of .workgraph/. But it missed the clap CLI annotation for the -d / --dir flag, which still emits:

$ wg --help
  -d, --dir <PATH>    Workgraph directory [default: .workgraph]

This is misleading: the actual project-discovery resolver prefers .wg/ (per wg init --help's 'Resolver precedence: --dir > $WG_DIR > project discovery (.wg preferred, legacy .workgraph accepted) > global (~/.wg preferred) > ./.wg'). The clap default_value is essentially dead — the resolver overrides it for project-local discovery — but agents reading --help see .workgraph and infer that's the canonical layout.

User report 2026-05-01: a codex agent in another project read wg --help, assumed .workgraph was the directory, ran commands against a non-existent path, then had to backtrack and pass --dir .wg explicitly. The user's reaction: 'thought .workgraph was purged?'

Fix

Find the clap definition of the --dir flag (likely src/cli.rs) and update:

  • default_value = ".workgraph" → either default_value = ".wg" (matches new canonical) OR remove the default entirely and let the resolver own all discovery (cleaner — there's no reason for clap to advertise a default that the resolver overrides)

Update help text from:

  • Workgraph directory [default: .workgraph]Workgraph directory (default: discovers .wg or legacy .workgraph in project root)

Make the help text accurate to the actual resolver behavior, not a misleading static default.

Validation

  • wg --help shows -d, --dir <PATH> WITHOUT mentioning '.workgraph' as the default
  • Help text accurately describes the resolver: 'discovers .wg or legacy .workgraph'
  • grep across the codebase: zero default_value = ".workgraph" (or equivalent string-literal) remaining in source
  • Live smoke: run wg list in /home/erik/workgraph (which has .wg/) without --dir flag — works fine (resolver finds .wg/)
  • Live smoke: run wg list in a directory with neither .wg/ nor .workgraph/ — gets a clear error pointing at wg init
  • No regression of any other flag's help text
  • cargo build + cargo test pass
  • cargo install --path . was run before claiming done

Process note

This is the second 'doc-sync missed a thing' bug today (after .workgraph paths in COMMANDS.md). The doc-sync function template should be amended to include 'grep src/cli.rs and other clap-annotated source files for stale path references' as part of audit-terminology-consistency. That amendment is small enough to fold in here OR file separately. Recommend folding in: this task adds a one-line addition to .wg/functions/doc-sync.yaml so future doc-sync runs catch this regression class.

Depends on

Required by

Log