Skip to content

fix: validate caller-owned output attributes - #521

Merged
codeforester merged 3 commits into
mainfrom
bug/509-20260917-bug-define-and-enforce-attributes-for-caller-owned-output-va
Sep 30, 2026
Merged

codeforester merged 3 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.

@codeforester

Copy link
Copy Markdown
Collaborator Author

The failing nocasematch validation is resolved in dependent PR #525.

That PR is based on this branch and adds the missing case-sensitive array-kind
classification plus regression coverage. Its complete hosted validation is
green, including both Validate (ubuntu-24.04) and Validate (macos-14), as
well as quality, release, compatibility, downstream, and branch-policy gates.

Merge #525 into this branch before merging #521.

Fixes #524\n\nMerge the validated nocasematch follow-up into #521.
@codeforester
codeforester merged commit a545940 into main Sep 30, 2026
11 checks passed
@codeforester
codeforester deleted the bug/509-20260917-bug-define-and-enforce-attributes-for-caller-owned-output-va branch September 30, 2026 14:01
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