Skip to content

bug: make quick CLI declaration transactional - #356

Merged
codeforester merged 1 commit into
mainfrom
bug/347-20260831-bug-make-base-cli-declare-transactional-when-a-late-row-is-i
Aug 31, 2026
Merged

bug: make quick CLI declaration transactional#356
codeforester merged 1 commit into
mainfrom
bug/347-20260831-bug-make-base-cli-declare-transactional-when-a-late-row-is-i

Conversation

@codeforester

Copy link
Copy Markdown
Collaborator

Summary

  • snapshot the target CLI model before applying table rows and restore it on every late semantic failure
  • remove every partial target-model entry when a new declaration fails
  • validate enum shape and default membership during declaration, and localize the remaining multi-positional scratch array
  • cover model, command, option, positional, alias, enum, boolean, and validator-name rollback failures

Validation

  • shellcheck -S error lib/bash/cli/lib_cli.sh lib/bash/cli/tests/lib_cli.bats
  • bats lib/bash/cli/tests/lib_cli.bats (17 tests)
  • tests/compatibility-matrix.sh
  • tests/artifact-contract.sh (isolated retry after an unrelated transient process-group failure)
  • ./tests/validate.sh (clean rerun: 573 tests plus all extended gates)

Impact

  • Public API: base_cli_declare is now transactional; enum defaults outside the declared enum are rejected with usage status 2
  • Compatibility: rollback uses Bash dynamic scope, not namerefs or eval, preserving Bash 4.2 support
  • Documentation: changelog entry only
  • Demo and security: no changes required

Fixes #347

@codeforester
codeforester merged commit 9898f9e into main Aug 31, 2026
10 checks passed
@codeforester
codeforester deleted the bug/347-20260831-bug-make-base-cli-declare-transactional-when-a-late-row-is-i branch August 31, 2026 04:34
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.

bug: make base_cli_declare transactional when a late row is invalid

1 participant