Skip to content

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

Merged
vinceblock99 merged 5 commits into
test/cli-command-harnessfrom
fix/cli-behavior-from-harness
Jul 28, 2026
Merged

vinceblock99 merged 5 commits into
test/cli-command-harnessfrom
fix/cli-behavior-from-harness

Conversation

@vinceblock99

@vinceblock99 vinceblock99 commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Prevented Unicode text from crashing query output.
  • Made push, pull, and clone return failure when any step fails.
  • Made push and pull honor the configured default remote.
  • Fixed agent hook edge cases for enable --all and disable --global codex.
  • Made delete commands check that the target exists before prompting.

Why

The command harness found cases where the CLI crashed, ignored configuration, or returned success after a failure. These fixes make the CLI match its documented behavior and work reliably in scripts and CI.

Test

  • cargo fmt --all -- --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace
  • Manually verified Unicode output, failure exit codes, remote selection, and delete prompt order.

Depends on #128.

- 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.
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.
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.
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".
@vinceblock99 vinceblock99 changed the title fix(cli): behavior defects surfaced by the command harness [draft]fix(cli): behavior defects surfaced by the command harness Jul 27, 2026
@vinceblock99 vinceblock99 changed the title [draft]fix(cli): behavior defects surfaced by the command harness fix(cli): correct behavior found by the command harness Jul 27, 2026
@vinceblock99
vinceblock99 merged commit 32223ed into test/cli-command-harness Jul 28, 2026
vinceblock99 added a commit that referenced this pull request Jul 28, 2026
* 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 added a commit that referenced this pull request Jul 28, 2026
* fix(cli): validate project before delete confirmation

* test(cli): validate every public command surface (#128)

* 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
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