feat(P67): fix adapter dedup defect + 2 probe bugs -> 22/22 Verified
--- ci--- project: acdl phase: 67 milestone: v1.12 status: execute --- /ci--- CAP-013 (REQ-129): adapter dedup logic collapsed multi-resource L1s (ecs-service, alb) to one module block named after the first sub-resource id, but stack outputs + cross-module refs used the expanded sub-ids (e.g. service-service, alb-targetgroup). terraform validate failed: 'No module call name'. Fix: name merged module by the composition child id (common-prefix heuristic), build id_remap, rewrite stack-output 'from' ids + ref: input targets through id_remap before emitting. terraform validate now succeeds for the microservice stack. Adapter 236->192 lines (still < 200 line gate). CAP-017 (REQ-130): regression probe required locals.tf for every L1 module, but the rds module legitimately omits it (no local.* refs). Fix: make locals.tf conditional on the module referencing local.* values. CAP-018 (REQ-130): regression probe called LocalLambdaStub() with no args, but the dataclass requires an outbox field (since P53). Fix: construct a FlatFileOutbox and pass it. Regression gate (D-091) re-run: 22/22 Verified, 0 Broken. The decks can now honestly claim 22/22 Verified (PRE_MORTEM.md FM-3 mitigation).
This commit is contained in:
@@ -441,10 +441,15 @@ def _check_lifecycle_module_terraform(module: str) -> Tuple[Status, str]:
|
||||
tf_dir = ROOT / "modules" / "l1" / module / "terraform"
|
||||
if not tf_dir.is_dir():
|
||||
return "Broken", f"modules/l1/{module}/terraform/ does not exist"
|
||||
required = ["versions.tf", "variables.tf", "locals.tf", "main.tf", "outputs.tf"]
|
||||
required = ["versions.tf", "variables.tf", "main.tf", "outputs.tf"]
|
||||
missing = [f for f in required if not (tf_dir / f).is_file()]
|
||||
if missing:
|
||||
return "Broken", f"missing terraform files: {missing}"
|
||||
# locals.tf is only required when the module references local.* values
|
||||
# (CAP-017 fix, v1.12). Single-resource modules may legitimately omit it.
|
||||
tf_text = "".join((tf_dir / f).read_text() for f in ["variables.tf", "main.tf", "outputs.tf"] if (tf_dir / f).is_file())
|
||||
if "local." in tf_text and not (tf_dir / "locals.tf").is_file():
|
||||
return "Broken", "missing terraform files: ['locals.tf'] (referenced by module)"
|
||||
for ex in ["simple", "complex"]:
|
||||
contract = ROOT / "modules" / "l1" / module / "examples" / f"{ex}.yml"
|
||||
if not contract.is_file():
|
||||
@@ -482,11 +487,13 @@ def _check_cap_017_dynamodb() -> Tuple[Status, str]:
|
||||
|
||||
def _check_cap_018_lambda() -> Tuple[Status, str]:
|
||||
"""CAP-018: Lambda contract-ingestor. Evidence = local Lambda stub
|
||||
(CAP-011) + L1 lifecycle pipeline green for the platform terraform."""
|
||||
(CAP-011) + L1 lifecycle pipeline green for the platform terraform.
|
||||
The stub requires an outbox arg (CAP-018 fix, v1.12)."""
|
||||
rc, out, err = _run_subprocess([
|
||||
"python3", "-c",
|
||||
"from core.local_emulators import LocalLambdaStub; "
|
||||
"stub = LocalLambdaStub(); "
|
||||
"from core.local_emulators import LocalLambdaStub, FlatFileOutbox; "
|
||||
"import tempfile; "
|
||||
"stub = LocalLambdaStub(outbox=FlatFileOutbox(tempfile.mkdtemp(prefix='acdl_stub_'))); "
|
||||
"print('LocalLambdaStub instantiates OK')",
|
||||
])
|
||||
if rc != 0:
|
||||
|
||||
Reference in New Issue
Block a user