Skip to content

fix: module/team selection enables the flags its stacks need - #42

Merged
Robobc merged 3 commits into
mainfrom
fix/module-prereqs
Aug 25, 2026
Merged

fix: module/team selection enables the flags its stacks need#42
Robobc merged 3 commits into
mainfrom
fix/module-prereqs

Conversation

@Robobc

@Robobc Robobc commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What

Usability-review blocker 4: deploy --module C selects <prefix>-networking and --module E selects <prefix>-security, but those stacks only exist in the synthesized app when their feature flags are on — so cdk failed with "No stacks match" after bootstrap had already run. --team agent had the same problem with the A2A runtimes. Module 8 carried an ad-hoc special case; this generalizes it.

Fix

A module/team definition now owns both its stack names and the flags those stacks need:

MODULE_FLAGS[8]=ENABLE_A2A  MODULE_FLAGS[C]=ENABLE_NETWORKING  MODULE_FLAGS[E]=ENABLE_SECURITY
TEAM_FLAGS[agent]=ENABLE_A2A  TEAM_FLAGS[platform]=ENABLE_NETWORKING  TEAM_FLAGS[security]=ENABLE_SECURITY

One worker (apply_flags) exports a flag only when unset — explicit env vars and platform.yaml values win — logs how to make the selection permanent, and rebuilds the context args. Applied after target resolution for --module/--team, and per-module in the workshop loop, replacing the module-8 special case. Side benefit: destroy/synth/diff with --module C/E now also see the selected stack.

One deliberate behavior change

The old module-8 special case unconditionally forced ENABLE_A2A=true in the workshop. Now an explicit ENABLE_A2A=false (env or manifest) wins uniformly — same precedence rule as everywhere else in the script.

Check

Check (s) in check-deploy-config.sh: module C exports its flag when unset, an explicit false survives the selection, module 8 and team agent set A2A, and a module with no entry exports nothing.

Verified

All 23 deploy-config checks and the 5 workshop-flow checks green; workshop dry-run for multi-agent shows module 8's flag arriving via the generic path; shellcheck clean.

Known follow-up (out of scope for the smallest diff): check_org_id runs before selection flags are applied, so its networking/ORG_ID warning does not fire for --module C.

Usability review blocker 4: `deploy --module C` selects ${PREFIX}-networking
and `--module E` selects ${PREFIX}-security, but those stacks only exist in
the synthesized app when ENABLE_NETWORKING / ENABLE_SECURITY are true — so
cdk failed with "No stacks match" after bootstrap had already run. Same for
`--team agent` (A2A runtime stacks behind ENABLE_A2A).

Generalizes the module-8 special case in the workshop loop: MODULE_FLAGS /
TEAM_FLAGS tables next to MODULE_MAP/TEAM_MAP make a selection own both its
stack names and the feature flags those stacks need. apply_selection_flags
runs after target resolution and rebuilds CONTEXT_ARGS; the workshop loop
now uses the same apply_module_flags per module (ad-hoc module-8 line
removed).

Precedence: an explicit env var (or platform.yaml, applied earlier) still
wins — a flag is only exported when currently unset/empty. The log line
points at platform.yaml to make the flag permanent.

Verified:
- scripts/check-deploy-config.sh: all checks PASS incl. new (s) — module C
  exports ENABLE_NETWORKING=true when unset; explicit =false survives;
  module 8 / team agent set ENABLE_A2A; module 3 exports nothing.
- scripts/check-workshop-flow.sh: all PASS (greenfield dry run unchanged).
- `workshop --dry-run --profile multi-agent`: module 8 logs the flag and
  prints its A2A stacks via the generic path.
- shellcheck --severity=warning on both files: clean.
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

Commit: 30e0d0e | Updated: 2026-08-25 13:45:43 UTC

Security Scan Results

Scanner S C H M L I Time Action Result Thresh
bandit 0 0 0 0 0 0 554ms 0 PASSED MED (g)
cdk-nag 0 0 0 0 0 0 7.4s 0 PASSED MED (g)
cfn-nag 0 0 0 0 0 0 8ms 0 PASSED MED (g)
checkov 0 0 0 0 0 0 6.4s 0 PASSED MED (g)
detect-secrets 0 5 0 0 0 0 800ms 5 FAILED MED (g)
grype 0 0 0 0 0 0 1m 2s 0 PASSED MED (g)
npm-audit 0 0 0 0 0 0 170ms 0 PASSED MED (g)
opengrep 0 0 0 0 0 0 17.3s 0 PASSED MED (g)
semgrep 0 0 0 0 0 0 <1ms 0 MISSING MED (g)
syft 0 0 0 0 0 0 3.3s 0 PASSED MED (g)

Robobc added 2 commits August 25, 2026 15:21
shellcheck 0.9 (the CI runner) raises SC2218 error on calling a function
defined later in the file; 0.11 locally does not. Definition order now
matches call order; behavior identical (checks 23/23 green).
The CI runner's shellcheck pairs check (s)'s late stub with the earlier
eval'd call and raises SC2218; defining the stub via eval keeps both
invisible, like every other extracted function in this file.
@Robobc
Robobc merged commit 866c709 into main Aug 25, 2026
8 of 9 checks passed
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