Skip to content

chore(cli): delete no-op and unimplemented command surface - #130

Merged
vinceblock99 merged 4 commits into
fix/cli-behavior-from-harnessfrom
chore/delete-noop-cli-surface
Jul 28, 2026
Merged

vinceblock99 merged 4 commits into
fix/cli-behavior-from-harnessfrom
chore/delete-noop-cli-surface

Conversation

@vinceblock99

@vinceblock99 vinceblock99 commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Stacks on #132.

Why

Some CLI options were accepted even though they were ignored or only returned “not implemented.” That made the help output misleading and allowed tests to appear successful for behavior that did not exist.

This PR removes that unsupported surface instead of adding new behavior.

What

  • Removes unimplemented inputs such as log --path, stash show --patch, and unrecord <change>.
  • Removes ignored flags from diff, change, insert, and tag.
  • Removes redundant output flags and rejects unsupported flag combinations.
  • Keeps the deprecated but working atomic vault intent path until embedded skills migrate, with an end-to-end compatibility test.
  • Updates CLI docs and tests to match the supported command surface.

Tests

  • cargo test -p atomic-cli
  • cargo test -p atomic-cli --test cli_surface_integration_test
  • cargo clippy -p atomic-cli --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • ATOMIC_BIN="$PWD/target/debug/atomic" bash tests/harness/14_vault_kg.sh
  • ATOMIC_BIN="$PWD/target/debug/atomic" bash tests/harness/16_vault_pull_bootstrap.sh

@vinceblock99
vinceblock99 force-pushed the test/cli-command-harness branch from 837a988 to daec0df Compare July 24, 2026 17:50
@vinceblock99
vinceblock99 force-pushed the chore/delete-noop-cli-surface branch from ad01a55 to 6ac6b50 Compare July 24, 2026 17:50
@vinceblock99
vinceblock99 changed the base branch from test/cli-command-harness to fix/cli-behavior-from-harness July 24, 2026 17:51
Per the project rule: if a command surface doesn't work, delete it
rather than implement it. Every removal below was verified against the
real binary — the flag either had no effect, always errored, or printed
a not-implemented notice.

Removed:
- log --path: parsed, printed 'not yet fully implemented', never filtered
- stash show --patch: printed 'Full diff output not yet implemented'
- unrecord [CHANGE]: positional always errored 'not yet supported'
- diff --cached (hidden) and diff --view: parsed but never read
- change --show-hunks: parsed but never read (hunks always print)
- insert/from-view/tag/pick --deps: SetTrue with default_value=true is
  an inert toggle; dependency-following stays always on
- insert pick --allow-conflicts: run_pick never read it (kept for the
  other insert modes, where it works)
- tag create --author/--view: parsed but never read; tag always used
  the current view and identity author (parse_author was test-only)
- identity default --clear --usage: warned 'not yet supported'; the
  combination is now a clap conflict error instead of a silent no-op
- vault summaries --json: output is always JSON; flag did nothing

Deliberately NOT removed: the deprecated 'vault intent' family — it
works, the embedded vault skills/prompts installed into every new
project still teach it, and the canonical 'atomic intent' commands are
not output-compatible. Removing it needs a migration PR that also
updates the embedded skill content (vault_defaults.rs). Harness suites
14/16 were still migrated to the canonical commands, which coexist.

Surface test: 198 public command paths / 169 leaves, unchanged.
Three module-doc usage blocks still listed flags removed in this commit:
change --show-hunks, log --path, vault summaries --json. Leaving them
documented is the same advertise-what-does-not-work problem the
deletions exist to fix.

Also correct intent/mod.rs and intent/show.rs, which described the
`atomic vault intent` tree as removed. Review reversed that removal --
the tree still ships, marked DEPRECATED, and cannot go until a
migration updates the vault skills embedded in vault_defaults.rs.
@vinceblock99
vinceblock99 force-pushed the chore/delete-noop-cli-surface branch from 6ac6b50 to c43fd8a Compare July 24, 2026 19:23
* chore(cli): remove data-loss surface and refuse destructive moves

Stop-the-bleeding for verified data-loss paths (deeper behavior fixes
for revise rollback and stash deletion capture are tracked separately):

- move --force removed: disk rename ran before the tracking update,
  which always fails on a tracked destination — the destination file
  was deleted from disk, unrecoverable for add-only/untracked targets.
- move now refuses ANY existing file at the resolved destination,
  tracked or untracked — fs::rename replaced it silently with exit 0.
  Moving into an existing directory still works (the check runs on the
  resolved <dir>/<filename> path). Run-level regression tests cover the
  untracked-destination, tracked-destination, and move-into-directory
  cases.
- stash --include-untracked/-u removed: copied untracked files into the
  stash sidecar but never cleaned them from the working copy, while
  printing 'restored to clean state'. Untracked files are now simply
  left alone (suite 06 pins the behavior and rejects the removed flag).
- memory new --id errors when the id already exists instead of silently
  replacing a possibly-attested memory; regression test asserts the
  original content survives. Follow-up: fold the existence check into
  the vault_store transaction to close the check-then-write window.

Verified kept: view switch --stash works end-to-end for modified files;
it inherits stash's missing deletion capture (behavior-fix PR).

* fix(cli): close two holes in the move destination guard

The guard added alongside the --force removal used Path::exists(), which
is wrong in two directions.

Case-only rename regressed. On case-insensitive filesystems (APFS, NTFS)
'file.txt' exists whenever 'File.txt' does, so 'atomic move File.txt
file.txt' returned exit 2. It worked before this stack -- is_tracked is
case-sensitive and rename(2) handles case-only renames -- and --force was
removed in the same commit, leaving no way through. Canonicalize both
sides and allow the move when they resolve to the same entry.

Dangling symlinks were still clobbered. exists() follows the link and
reports false for a broken one, so rename destroyed it -- contradicting
the guard's own 'refuse ANY existing file' comment. Use symlink_metadata.

Both reproduced against the built binary before and after. Regression
tests added for each; the untracked- and tracked-destination guards are
unchanged and still refuse (exit 2, contents intact).

* docs(cli): simplify safety comments
@vinceblock99
vinceblock99 merged commit 1f057d8 into fix/cli-behavior-from-harness Jul 28, 2026
@vinceblock99
vinceblock99 deleted the chore/delete-noop-cli-surface branch August 12, 2026 13:14
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