refactor(cli): centralize declaration attribute allowlists - #411
Open
codeforester wants to merge 1 commit into
Open
Conversation
codeforester
force-pushed
the
enhancement/393-20260903-lib-cli-sh-option-positional-attribute-allowlist-duplicated
branch
3 times, most recently
from
September 3, 2026 18:37
970a323 to
2e7e525
Compare
codeforester
force-pushed
the
enhancement/393-20260903-lib-cli-sh-option-positional-attribute-allowlist-duplicated
branch
from
September 3, 2026 18:42
2e7e525 to
ff57cc5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Define one per-kind declaration attribute table and use it for imperative validation, quick-row validation, and runtime attribute propagation. This removes the duplicated option/positional allowlists while preserving declaration and parsing behavior.
Issue
Fixes #393
Validation
git diff --checkshfmt -d -ln bash -i 4 -sr lib/bash/cli/lib_cli.shbats lib/bash/cli/tests/lib_cli.bats(28/28)env -u BASE_HOME BASE_CACHE_DIR=/private/tmp/base-bash-train-393 ./tests/validate.sh(616 BATS tests and all repository contracts passed)Demo Impact
None.
Docs Impact
None; the existing declaration contract remains unchanged.
API Impact
Internal refactor only. Imperative and quick declaration paths now derive their accepted attributes from the same table, preventing future parity drift.
CI Impact
Adds a parity test covering all shared model, command, option, and positional attributes across both declaration APIs.
Security Notes
No new execution or evaluation paths; the existing no-
evaldeclarative runtime and validation boundaries remain intact.Notes
Structural fields stay in the table for quick rows but are excluded when copying runtime attributes into imperative calls.
Checklist
<category>/<issue>-<YYYYMMDD>-<slug>.Fixes #393.