Skip to content

fix(cli): validate project before delete confirmation - #127

Merged
vinceblock99 merged 2 commits into
devfrom
fix/cli-project-delete-validation
Jul 28, 2026
Merged

vinceblock99 merged 2 commits into
devfrom
fix/cli-project-delete-validation

Conversation

@vinceblock99

Copy link
Copy Markdown
Contributor

Summary

  • Check that an interactive project-delete target exists before asking for confirmation.
  • Return the existing not-found error immediately when the project is invalid.
  • Keep --force on the existing single-DELETE request path.
  • Add a regression test that verifies a 404 GET never invokes the confirmation callback.

Test Coverage

All new behavior paths have test coverage. One regression test was added.

Pre-Landing Review

No issues found.

Design Review

No frontend files changed, design review skipped.

Eval Results

No prompt-related files changed, evals skipped.

Plan Completion

No plan file detected.

Test plan

  • cargo test -p atomic-cli missing_project_is_rejected_before_confirmation -- --nocapture
  • cargo test -p atomic-cli (1,652 tests, 0 failures)
  • cargo fmt --all -- --check
  • cargo clippy -p atomic-cli --all-targets -- -D warnings
  • cargo build -p atomic-cli
  • Real target/debug/atomic project delete against a one-shot local mock proxy: only GET was received, CLI returned 404 without prompting, and no DELETE was sent.

vinceblock99 added a commit that referenced this pull request Jul 24, 2026
Align workspace/org/team/intent delete with the project delete semantics
from #127: the existence precheck runs only before the interactive
confirmation, so scripted --force deletes stay a single request.
vinceblock99 added a commit that referenced this pull request Jul 28, 2026
* fix(cli): resolve command-surface defects found by harness review

- query search/neighbors: truncate summaries on char boundaries instead
  of byte indexes; long CJK/emoji summaries no longer panic (exit 101).
  Adds truncate_display() with unit tests, and fixes the same latent
  byte-slicing in plan-exec output.
- agent enable --all: error out when no agents are detected instead of
  installing hooks for every registered agent.
- agent disable --global: add the missing codex path
  (~/.codex/hooks.json), restoring enable/disable symmetry.
- push/pull: honor the remote configured via 'atomic remote default';
  an explicit CLI argument still wins, with "origin" as the final
  fallback. REMOTE arg is now optional with no clap default.
- git push: exit non-zero when the underlying git push fails (the
  commit is kept and the user is told how to retry).
- pull/clone: exit non-zero when downloads, applies, or materialize
  fail; partial results are kept on disk.
- project/workspace/org/team/intent delete: verify the target exists
  before showing the destructive confirmation prompt.

* test(cli): use escaped unicode in truncation regression tests

Replace raw CJK/emoji string literals with \u{20ac} and \u{1f680}
escape sequences so the source stays ASCII-only while keeping the
same multi-byte char-boundary coverage. Also tighten the loose
assertions in the no-panic case.

* fix(cli): skip delete existence prechecks under --force

Align workspace/org/team/intent delete with the project delete semantics
from #127: the existence precheck runs only before the interactive
confirmation, so scripted --force deletes stay a single request.

* docs(cli): correct push/pull remote resolution help text

The --help text promised 'falling back to "origin"' but
resolve_remote_name delegates to RemoteConfig::get_default, which also
returns the sole configured remote when exactly one is registered. A
repo with a single remote named something other than origin therefore
resolves to that remote, contradicting the documented behavior.

Document the real order: marked default > "origin" > sole remote >
literal "origin".

* docs(cli): simplify behavior comments
* test(cli): validate every public command surface

* test(harness): distinguish skipped suites from passes

* docs(cli): document command harness

* test(harness): eliminate fake greens in vault suite, skip logic, and diff filter

- 14_vault_kg.sh: every assertion now checks exit code and expected output
  shape via run_cmd/assert_ran; previously 20 if/else sites passed in both
  branches and 4 more passed unconditionally, so the suite stayed green
  even with /usr/bin/true as the binary (now: 40/44 fail, suite exits 1).
  Also fixes a wrong vault show path and broken \| alternations in ERE
  patterns that made match branches unreachable.
- helpers.sh: skip_suite exits 1 when assertions already failed — a
  mid-suite skip (e.g. network loss after real failures) can no longer
  mask a failing suite as skipped in the runner summary.
- 09_semantic_diff_pairing.sh: extract_atomic_change_lines now drops only
  the +++/--- file headers instead of requiring a non-+/- second
  character, which silently excluded added/deleted blank lines and change
  lines whose content starts with + or -.

* fix(cli): correct behavior found by the command harness (#132)

* fix(cli): resolve command-surface defects found by harness review

- query search/neighbors: truncate summaries on char boundaries instead
  of byte indexes; long CJK/emoji summaries no longer panic (exit 101).
  Adds truncate_display() with unit tests, and fixes the same latent
  byte-slicing in plan-exec output.
- agent enable --all: error out when no agents are detected instead of
  installing hooks for every registered agent.
- agent disable --global: add the missing codex path
  (~/.codex/hooks.json), restoring enable/disable symmetry.
- push/pull: honor the remote configured via 'atomic remote default';
  an explicit CLI argument still wins, with "origin" as the final
  fallback. REMOTE arg is now optional with no clap default.
- git push: exit non-zero when the underlying git push fails (the
  commit is kept and the user is told how to retry).
- pull/clone: exit non-zero when downloads, applies, or materialize
  fail; partial results are kept on disk.
- project/workspace/org/team/intent delete: verify the target exists
  before showing the destructive confirmation prompt.

* test(cli): use escaped unicode in truncation regression tests

Replace raw CJK/emoji string literals with \u{20ac} and \u{1f680}
escape sequences so the source stays ASCII-only while keeping the
same multi-byte char-boundary coverage. Also tighten the loose
assertions in the no-panic case.

* fix(cli): skip delete existence prechecks under --force

Align workspace/org/team/intent delete with the project delete semantics
from #127: the existence precheck runs only before the interactive
confirmation, so scripted --force deletes stay a single request.

* docs(cli): correct push/pull remote resolution help text

The --help text promised 'falling back to "origin"' but
resolve_remote_name delegates to RemoteConfig::get_default, which also
returns the sole configured remote when exactly one is registered. A
repo with a single remote named something other than origin therefore
resolves to that remote, contradicting the documented behavior.

Document the real order: marked default > "origin" > sole remote >
literal "origin".

* docs(cli): simplify behavior comments
@vinceblock99
vinceblock99 merged commit 1b281e2 into dev Jul 28, 2026
8 checks passed
@vinceblock99
vinceblock99 deleted the fix/cli-project-delete-validation 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