Skip to content

fix: validate caller-owned output attributes - #521

Open
codeforester wants to merge 2 commits into
mainfrom
bug/509-20260917-bug-define-and-enforce-attributes-for-caller-owned-output-va
Open

codeforester wants to merge 2 commits into
mainfrom
bug/509-20260917-bug-define-and-enforce-attributes-for-caller-owned-output-va

Conversation

@codeforester

Copy link
Copy Markdown
Collaborator

Closes #509

Summary

  • Define scalar, integer, indexed-array, and associative-array output contracts across public APIs.
  • Reject readonly/nameref outputs and attributes that would coerce values before publication.
  • Document the output contracts and add cross-module regression coverage, including shell-option and nameref edge cases.

Validation

  • All eight affected BATS module suites pass individually.
  • tests/bash-option-contract.sh passes for every configured shell-option combination.
  • tests/docs-contract.sh, tests/lint-warnings.sh, ShellCheck, shfmt on modified Bash files, and git diff --check pass.
  • Full pinned-Docker shfmt contract could not run locally because the Docker daemon is unavailable; hosted CI will run it.

Comment thread lib/bash/app/lib_app.sh Outdated
Comment thread lib/bash/std/lib_std.sh
@codeforester

Copy link
Copy Markdown
Collaborator Author

Confirmed fixed. base_app_config_get now dynamically resolves integer vs scalar output kind from the config's declared type — verified a declare -i destination for an integer-typed config value now populates correctly instead of erroring. The array-kind check no longer uses a plain substring match; verified under shopt -s nocasematch that both directions (associative array claimed as indexed, and vice versa) are now correctly rejected while genuine matches still pass.

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: define and enforce attributes for caller-owned output variables

1 participant