--- phase: 14 name: l2-microservice-and-contract-schema milestone: v1.2 requirements: [REQ-32] type: feat branch: phase/14-l2-microservice-and-contract-schema --- # Phase 14 — l2-microservice-and-contract-schema (v1.2) PLAN ## Goal Author `l2-microservice` thin-composition (6 ECS L1s, depth ≤ 5), extend the contract schema for microservice inputs, extend the resolver for child→child wiring, and verify contract→IR resolution yields a complete target stack. ## Tasks ### T-14.1 — l2-microservice composition Create `modules-ir/l2/l2-microservice/composition.json` + `README.md`. Register in `modules-ir/registry.json` at 1.0.0. 6 children: vpc, cluster, ecr, roles, alb, service. Wires: contract→child passthrough (name, cidr, azs, image, port, cpu, memory, env, protocol) + child→child refs (cluster.cluster_arn→service.cluster_arn, vpc.subnet_ids→service.subnets + alb.subnets, alb.target_group_arn→service.lb_target_group_arn, roles.role_arn→service.security_group). Wire format: `"source": "child:."` for child→child. ### T-14.2 — Contract schema extension Extend `schemas/contract.schema.json`: `inputs.additionalProperties` allows objects too (for env map + healthcheck). Add optional `healthcheck` top-level field (object). Create `contracts/microservice.yaml` (dev, l2-microservice, inputs: name/cidr/azs/image/port/cpu/memory). ### T-14.3 — Resolver child→child wiring Extend `acdl_platform/contract_resolver.py`: second pass for wires with `"source": "child:."` → emit `"ref:."` string in the child's inputs. Handle multi-resource L1s: iterate the L1's `resources` array, emit one IR resource per entry (prefix id with child id). Adapter translates `ref:X.Y` → `${..}`. ### T-14.4 — Verify `contracts/microservice.yaml` → resolver → IR (all 6 L1s' resources) → adapter → `terraform validate`. v1.1 spike regression. `scripts/verify_phase14.sh`. ## Ship Merge → `main` (--no-ff). Tag `v1.2.4`.