refactor(P57): contract surface redesign + rename + .yml repo-wide

Contract surface redesign:
- New top-level fields: id (3-6 char acronym → stack.name), name (full → stack.title),
  infrastructure (map keyed by module name, replaces module:)
- Drop uses: field (dead reference; version pin lives in CI workflow uses: line)
- Drop top-level module/inputs (now nested under infrastructure map)
- Per-module optional version (defaults to latest published from registry)
- Multi-module contracts: one file deploys N modules in one pipeline run,
  resource IDs namespaced with module name to avoid collisions
- stack.schema.json: add optional title field for display name

Rename:
- pipelines/deploy.yaml → pipelines/contract.yml (declarative spec, not a pipeline)
- pipelines/ci.yaml → pipelines/ci.yml
- All 44 .yaml files → .yml repo-wide (contracts, module examples, kyverno policies)
- .acdl/contract.yaml → .acdl/contract.yml

Resolver (core/contract_resolver.py):
- Rewrite resolve() to loop infrastructure map, default version to latest,
  merge module fragments into one stack with namespaced resource IDs
- _latest_version() picks highest non-deprecated from registry
- _namespace_resources() prefixes IDs + rewrites ref: expressions for multi-module
- Single-module path: unprefixed IDs (backward compatible)

Verification:
- 494 tests pass (0 contract-shape failures)
- Local E2E passes (contract → resolver → adapter → local ECS HTTP 200 → outbox)

---ci---
project: acdl
phase: 57
milestone: v1.10.2
status: execute
---/ci---
This commit is contained in:
Jon Chery
2026-07-27 21:37:40 +00:00
parent 7f36df5610
commit 031887ec56
127 changed files with 1597 additions and 1100 deletions
+34 -27
View File
@@ -41,13 +41,16 @@ The pattern references these primitives:
Define a contract referencing this module:
```yaml
uses: acdl/pipelines/deploy.yaml@v1.6
module: microservice
environment: dev
inputs:
image: 581513795199.dkr.ecr.us-east-1.amazonaws.com/acdl-microservice:latest
port: 8080
region: us-east-1
id: msvc
infrastructure:
microservice:
inputs:
image: 581513795199.dkr.ecr.us-east-1.amazonaws.com/acdl-microservice:latest
port: 8080
region: us-east-1
version: 1.0.0
name: microservice
```
## Compliance extension points
@@ -72,37 +75,41 @@ pipeline validates them against `schemas/contract.schema.json`.
A minimal deployment (minimal Fargate, no ALB):
[`examples/simple.yaml`](examples/simple.yaml)
[`examples/simple.yml`](examples/simple.yml)
```yaml
# Simple microservice deployment (minimal Fargate, no ALB)
uses: acdl/pipelines/deploy.yaml@v1.6
module: microservice
environment: dev
inputs:
bucket_name: my-microservice-demo
region: us-east-1
image: public.ecr.aws/docker/library/nginx:latest
port: 80
id: msvc
infrastructure:
microservice:
inputs:
bucket_name: my-microservice-demo
image: public.ecr.aws/docker/library/nginx:latest
port: 80
region: us-east-1
version: 1.0.0
name: microservice
```
### Complex
A production deployment with optional inputs (ALB + env vars + health check):
[`examples/complex.yaml`](examples/complex.yaml)
[`examples/complex.yml`](examples/complex.yml)
```yaml
# Complex microservice with ALB + env vars + health check
uses: acdl/pipelines/deploy.yaml@v1.6
module: microservice
environment: dev
inputs:
bucket_name: my-production-microservice
region: us-east-1
image: public.ecr.aws/docker/library/nginx:latest
port: 8080
env:
LOG_LEVEL: info
ENVIRONMENT: production
id: msvc
infrastructure:
microservice:
inputs:
bucket_name: my-production-microservice
env:
ENVIRONMENT: production
LOG_LEVEL: info
image: public.ecr.aws/docker/library/nginx:latest
port: 8080
region: us-east-1
version: 1.0.0
name: microservice
```
## Versioning
@@ -1,12 +0,0 @@
# Complex microservice with ALB + env vars + health check
uses: acdl/pipelines/deploy.yaml@v1.6
module: microservice
environment: dev
inputs:
bucket_name: my-production-microservice
region: us-east-1
image: public.ecr.aws/docker/library/nginx:latest
port: 8080
env:
LOG_LEVEL: info
ENVIRONMENT: production
@@ -0,0 +1,15 @@
# Complex microservice with ALB + env vars + health check
environment: dev
id: msvc
infrastructure:
microservice:
inputs:
bucket_name: my-production-microservice
env:
ENVIRONMENT: production
LOG_LEVEL: info
image: public.ecr.aws/docker/library/nginx:latest
port: 8080
region: us-east-1
version: 1.0.0
name: microservice
@@ -1,9 +0,0 @@
# Simple microservice deployment (minimal Fargate, no ALB)
uses: acdl/pipelines/deploy.yaml@v1.6
module: microservice
environment: dev
inputs:
bucket_name: my-microservice-demo
region: us-east-1
image: public.ecr.aws/docker/library/nginx:latest
port: 80
@@ -0,0 +1,12 @@
# Simple microservice deployment (minimal Fargate, no ALB)
environment: dev
id: msvc
infrastructure:
microservice:
inputs:
bucket_name: my-microservice-demo
image: public.ecr.aws/docker/library/nginx:latest
port: 80
region: us-east-1
version: 1.0.0
name: microservice
+39 -31
View File
@@ -38,12 +38,15 @@ Define a contract referencing this module (the production stack —
S3 + CloudFront + WAF):
```yaml
uses: acdl/pipelines/deploy.yaml@v1.6
module: static-assets
environment: dev
inputs:
bucket_name: my-static-assets
region: us-east-1
id: assets
infrastructure:
static-assets:
inputs:
bucket_name: my-static-assets
region: us-east-1
version: 1.0.0
name: static-assets
```
The composition wires the s3 bucket regional domain name to the
@@ -56,12 +59,15 @@ For a simple S3-only static asset site (no CDN, no WAF), a consumer can
declare a contract that references the `s3` primitive directly:
```yaml
uses: acdl/pipelines/deploy.yaml@v1.6
module: s3
environment: dev
inputs:
bucket_name: my-static-assets
region: us-east-1
id: assets
infrastructure:
static-assets:
inputs:
bucket_name: my-static-assets
region: us-east-1
version: 1.0.0
name: static-assets
```
This deploys a single S3 bucket (no CloudFront edge, no WAF). Use this
@@ -102,37 +108,39 @@ pipeline validates them against `schemas/contract.schema.json`.
A minimal deployment (S3 bucket only — no CloudFront/WAF):
[`examples/simple.yaml`](examples/simple.yaml)
[`examples/simple.yml`](examples/simple.yml)
```yaml
# Simple static-assets deployment (S3 bucket only — no CloudFront/WAF)
# This is the simplest way to deploy a static site: just an S3 bucket.
uses: acdl/pipelines/deploy.yaml@v1.6
module: static-assets
environment: dev
inputs:
bucket_name: my-static-site
region: us-east-1
id: assets
infrastructure:
static-assets:
inputs:
bucket_name: my-static-site
region: us-east-1
version: 1.0.0
name: static-assets
```
### Complex
A production deployment with optional inputs (S3 + CloudFront + WAF):
[`examples/complex.yaml`](examples/complex.yaml)
[`examples/complex.yml`](examples/complex.yml)
```yaml
# Complex static-assets deployment (S3 + CloudFront + WAF)
# The full production stack: S3 origin + CloudFront CDN edge + WAF protection.
uses: acdl/pipelines/deploy.yaml@v1.6
module: static-assets
environment: dev
inputs:
bucket_name: my-production-static-site
region: us-east-1
price_class: PriceClass_100
viewer_protocol_policy: redirect-to-https
default_ttl: 3600
max_ttl: 86400
waf_enabled: true
id: assets
infrastructure:
static-assets:
inputs:
bucket_name: my-production-static-site
default_ttl: 3600
max_ttl: 86400
price_class: PriceClass_100
region: us-east-1
viewer_protocol_policy: redirect-to-https
waf_enabled: true
version: 1.0.0
name: static-assets
```
## Versioning
@@ -1,13 +0,0 @@
# Complex static-assets deployment (S3 + CloudFront + WAF)
# The full production stack: S3 origin + CloudFront CDN edge + WAF protection.
uses: acdl/pipelines/deploy.yaml@v1.6
module: static-assets
environment: dev
inputs:
bucket_name: my-production-static-site
region: us-east-1
price_class: PriceClass_100
viewer_protocol_policy: redirect-to-https
default_ttl: 3600
max_ttl: 86400
waf_enabled: true
@@ -0,0 +1,16 @@
# Complex static-assets deployment (S3 + CloudFront + WAF)
# The full production stack: S3 origin + CloudFront CDN edge + WAF protection.
environment: dev
id: assets
infrastructure:
static-assets:
inputs:
bucket_name: my-production-static-site
default_ttl: 3600
max_ttl: 86400
price_class: PriceClass_100
region: us-east-1
viewer_protocol_policy: redirect-to-https
waf_enabled: true
version: 1.0.0
name: static assets
@@ -1,8 +1,11 @@
# Simple static-assets deployment (S3 bucket only — no CloudFront/WAF)
# This is the simplest way to deploy a static site: just an S3 bucket.
uses: acdl/pipelines/deploy.yaml@v1.6
module: static-assets
environment: dev
inputs:
bucket_name: my-static-site
region: us-east-1
id: assets
infrastructure:
static-assets:
inputs:
bucket_name: my-static-site
region: us-east-1
version: 1.0.0
name: static assets