Files
acdl/tests/test_consumer_guide_per_env_section.py
T
Jon Chery 2397336cbb
acdl-ci / Lint (push) Successful in 9s
acdl-ci / Test (push) Successful in 2m9s
acdl-ci / Platform check-only (offline) (push) Successful in 10s
verify(P57): code review — 3 P0 auto-fixed, 2 P1+ flagged
Multi-persona review of the contract surface redesign (031887e + 10b87a6).

P0-1 (auto-fixed): scripts/run_platform.sh:437 read the uptime_enabled
feature flag from the OLD top-level contract.inputs.uptime_enabled path,
which P57 removed. With the new contract shape c.get('inputs',{}) returns
{} so the flag silently always defaulted to True — a consumer setting
uptime_enabled:false under infrastructure.<module>.inputs could NOT
disable uptime monitoring. Fixed to scan
infrastructure.<module>.inputs.uptime_enabled (any module false wins).

P0-2 (auto-fixed): docs/consumer-guide.md:417,472 documented the
${contract.module} interpolation token, but P57 dropped the `module`
field. _expand_vars fails loud (D-081) on unknown tokens, so a consumer
following the documented bucket_name example
(acdl-${env.environment}-${contract.module}-...) hit a hard ValueError
at resolve time. Replaced with ${contract.id} (the surviving short
acronym field) in both the example and the interpolation reference table.

P0-3 (auto-fixed): core/regression_verify.py CAP-006 and
tests/test_consumer_guide_per_env_section.py both asserted the dropped
${contract.module} token. Updated CAP-006 to use ${contract.id} and the
doc test to assert ${contract.id} present / ${contract.module} absent.

P1+ flags (post-hoc):
- P1: _namespace_resources does not rewrite ref: targets in
  stack.outputs[].from for cross-module refs (within-module is handled;
  multi-module refs across fragments are not wired today, but no
  contract uses them yet).
- P1: _latest_version raises ValueError (not a clear message) on a
  malformed semver string in the registry; the schema pins version to
  ^\d+\.\d+\.\d+$ so this is unreachable from a contract, but registry
  authors have no guardrail.
- P2: docs/consumer-guide.md:407 example path uses .yaml extension while
  the repo-wide rename standardized on .yml (consumer-repo paths, not
  platform, so non-blocking).

---ci---
project: acdl
phase: 57
milestone: v1.10.2
status: verify
lessons:
  - P0 fix applied: uptime_enabled read path migrated to infrastructure.<module>.inputs (was stale top-level contract.inputs)
  - P0 fix applied: docs + tests migrated off dropped ${contract.module} interpolation token to ${contract.id}
---/ci---
2026-07-28 12:04:34 +00:00

48 lines
1.6 KiB
Python

"""REQ-106: consumer guide documents per-env caller workflows."""
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
GUIDE = ROOT / "docs" / "consumer-guide.md"
def test_consumer_guide_has_per_env_section():
text = GUIDE.read_text()
assert "Per-environment deployment" in text
assert "promotion-without-editing" in text.lower() or "promotion = running the matching job" in text.lower()
def test_consumer_guide_has_four_caller_examples():
text = GUIDE.read_text()
assert "deploy-dev" in text
assert "deploy-qa" in text
assert "deploy-prod" in text
assert "deploy-dr" in text
def test_consumer_guide_documents_environment_input():
text = GUIDE.read_text()
assert "environment" in text
assert "workflow input" in text.lower() or "workflow_call" in text.lower() or "environment:" in text
def test_consumer_guide_documents_hitl_gates():
text = GUIDE.read_text()
assert "approve_qa" in text
assert "approve_prod" in text
assert "approve_dr" in text
assert "separation-of-duties" in text.lower() or "separation of duties" in text.lower()
def test_consumer_guide_has_interpolation_reference():
text = GUIDE.read_text()
assert "${env.environment}" in text
assert "${env.account_id}" in text
# P57: contract.module was dropped in favor of contract.id (short acronym)
assert "${contract.id}" in text
# The old token must not survive the P57 contract redesign
assert "${contract.module}" not in text
def test_consumer_guide_states_no_field_editing():
text = GUIDE.read_text()
assert "no" in text.lower() and "environment" in text.lower() and "editing" in text.lower()