Skip to content

fix(posture): honor effective env layers - #525

Merged
gfargo merged 1 commit into
mainfrom
refactor/posture-effective-env
Aug 28, 2026
Merged

fix(posture): honor effective env layers#525
gfargo merged 1 commit into
mainfrom
refactor/posture-effective-env

Conversation

@gfargo

@gfargo gfargo commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Summary

Advance #248 by making posture's required_vars check evaluate each stack's effective default environment instead of grepping only the project-level .env file.

Changes

  • resolve stack-level .env before the project-level fallback
  • reconstruct common, base, topology host, and generated stack/host layers in deployment precedence
  • isolate each stack's env and topology state in a command-substitution boundary
  • reserve evaluator stdout for missing variable names and keep loader diagnostics on stderr
  • validate required names before env lookup using deployment's shell-identifier grammar
  • preserve existing posture findings, no-env warning text, counters, JSON shape, and exit thresholds
  • leave repository-wide placeholder/git hygiene checks and named --env semantics unchanged

Validation

  • bats tests/test_posture.bats tests/test_validate.bats tests/test_utils.bats tests/test_env_gen_layer.bats tests/test_topology.bats tests/test_cli_resolve.bats </dev/null — 215 passed
  • bats tests/ </dev/null — 2,650 passed, 2 expected skips
  • direct fixtures for stack/common/host layering, cross-stack isolation, stderr-only diagnostics, and malformed names with and without an env file
  • shellcheck -x -S warning lib/cmd_posture.sh
  • bash -n lib/cmd_posture.sh
  • git diff --check
  • semantic review approved with no actionable findings

Advances #248.

@gfargo
gfargo merged commit 0332497 into main Aug 28, 2026
3 checks passed
@gfargo
gfargo deleted the refactor/posture-effective-env branch August 28, 2026 17:54
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