Skip to content

fix: entire→trace rebrand, hook binary resolution, settings migration, README truth - #66

Merged
Patel230 merged 8 commits into
mainfrom
fix/audit-sweep-2026-08
Aug 16, 2026
Merged

fix: entire→trace rebrand, hook binary resolution, settings migration, README truth#66
Patel230 merged 8 commits into
mainfrom
fix/audit-sweep-2026-08

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Summary

  • Root command rebranded from entire to trace with accurate description.
  • Hook binary resolution now discovers the binary in priority order: explicit path → known exe basename (trace/hawk/entire) → trace on PATH → legacy entire fallback. Wrappers never worse than today.
  • Settings canonical path moved to .trace/ with lazy non-destructive read-compat from .entire/ (first save migrates).
  • README fixed: removed stale claims about standalone binary, aligned config paths, fixed dead CLAUDE.md reference.
  • Ogen generator directive pinned to v1.23.0 (matching go.mod).

Test plan

  • GOWORK=off go build ./...
  • GOWORK=off go test ./cli/... — entire cli tree green
  • New tests for binary resolution order, settings migration

NewRootCmd reported Use: "entire" / Short: "Entire CLI" and its
getting-started help pointed at docs.entire.io, which no longer exists.
The command tree is surfaced as 'hawk trace ...' and as a standalone
'trace' binary (cmd/trace), so the root name now matches the repo
identity:

- Use derives from the new agent.BinaryName constant ("trace")
- Short matches the README tagline
- getting-started help drops the dead docs.entire.io URL
- version banner reads 'Trace CLI'
- hidden-alias deprecation hints point at 'trace ...' commands
- agent-help drill-down pointer derives from the live root name

agent.BinaryName lives in the shared agent package because both the
strategy layer and agent integrations need it and cannot import package
cli without a cycle.
The default git-hook prefix (strategy/hookCmdPrefix) and every production
wrapper probe (agent.WrapProduction*) referenced a binary named entire,
which does not exist in hawk distributions. Hooks installed under hawk
probed 'command -v entire', silently exited 0, and disabled session
capture unless flags or PATH happened to provide the legacy binary.

Resolution now flows through agent.HookCommandPrefix in priority order:

1. an explicitly-configured prefix still wins (local-dev launcher and
   --absolute-git-hook-path are checked first, unchanged);
2. the basename of the running executable when it is a known name:
   trace, entire, or hawk — hawk embeds this CLI as 'hawk trace';
3. 'trace' when a binary of that name is reachable on PATH;
4. legacy 'entire' when only it is on PATH, and as the final fallback,
   matching the historical baked default so existing installs and
   already-installed hooks keep working (never worse than before).

The wrapper generators rewrite the leading legacy binary token of the
wrapped command to the resolved prefix ('hawk trace hooks ...'), and
wrapper recognition accepts every binary-name form so hooks installed
by older builds are still detected for removal and upgrade.

Tests pin resolution via SetHookBinaryResolutionForTesting /
PinLegacyHookBinaryForTesting because hosts may carry unrelated
binaries named trace or entire on PATH.
Follow-ups to the root-command rebrand: agent-help --json now emits
'trace trail'/'trace status' because CommandPath derives from the root
Use field.
The README documents .trace/settings.json and .trace/settings.local.json,
but the code still used the pre-rebrand .entire/ locations. The canonical
settings files now live under .trace/, implemented as a lazy, read-only
compat shim rather than a destructive migration:

- reads (Load, LoadProjectRaw/LoadLocalRaw, IsSetUp, IsSetUpAny, and the
  worktree-root variants) fall back to the legacy .entire/ files when the
  canonical .trace/ file is absent, so existing repositories keep working
  with zero migration steps;
- the first save to a settings file copies the legacy content to the
  canonical location before writing (lazy migration); the legacy file
  itself is never deleted or rewritten;
- exported helper signatures are unchanged (only constant values moved);
- .trace/ is treated as CLI infrastructure (excluded from checkpoints)
  and gets its own .gitignore for settings.local.json;
- enable's local-vs-project target detection and uninstall's directory
  cleanup handle both locations.

Session data keeps using .entire/metadata on the checkpoint branch;
migrating stored data and installed .entire git hooks is deliberately
out of scope.
…ointers

- Quick Start claimed 'no separate trace binary to install' while
  cmd/trace/main.go provides a standalone entrypoint; the text now says
  Trace is a library first (embedded as 'hawk trace ...'), with a
  buildable-but-unreleased cmd/trace entrypoint for contributors.
- The Typical Workflow / Commands examples use 'trace ...'; a note
  clarifies the same commands run as 'hawk trace ...' under Hawk.
- Configuration documents the legacy .entire/ read compat.
- 'See CLAUDE.md for architecture details' pointed at GitNexus
  boilerplate; now points at docs/architecture.md.
The //go:generate directive pinned ogen@v1.20.3 while go.mod requires
v1.23.0, so a bare 'go generate' would regenerate with a different
generator than the module builds against. Pin the directive to v1.23.0
and note that regenerating the oas_*.go files (large diff) is pending.
- cli/agent/hook_command.go, cli/setup.go: gofumpt reformat (CI fmt gate)
- go.mod + CI: Go 1.26.6 — 1.26.5 stdlib has reachable vulns that fail
  govulncheck
@Patel230
Patel230 merged commit 59b437b into main Aug 16, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant