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
-11
View File
@@ -1,11 +0,0 @@
# ACDL sample consumer contract — microservice module (dev)
# Per-environment contract (REQ-105). Promotion = running the dev job;
# no environment field editing. Interpolation resolves against dev.json.
uses: acdl/pipelines/deploy.yaml@v1.9
module: microservice
environment: dev
inputs:
bucket_name: acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
region: ${env.region}
image: public.ecr.aws/docker/library/nginx:latest
port: 80
+14
View File
@@ -0,0 +1,14 @@
# ACDL sample consumer contract — microservice module (dev)
# Per-environment contract (REQ-105). Promotion = running the dev job;
# no environment field editing. Interpolation resolves against dev.json.
id: msvc
name: microservice
environment: dev
infrastructure:
microservice:
version: "1.0.0"
inputs:
bucket_name: acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
region: ${env.region}
image: public.ecr.aws/docker/library/nginx:latest
port: 80
-11
View File
@@ -1,11 +0,0 @@
# ACDL sample consumer contract — microservice module (dr)
# Per-environment contract (REQ-105). Promotion = running the dr job;
# no environment field editing. Interpolation resolves against dr.json.
uses: acdl/pipelines/deploy.yaml@v1.9
module: microservice
environment: dr
inputs:
bucket_name: acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
region: ${env.region}
image: public.ecr.aws/docker/library/nginx:latest
port: 80
+14
View File
@@ -0,0 +1,14 @@
# ACDL sample consumer contract — microservice module (dr)
# Per-environment contract (REQ-105). Promotion = running the dr job;
# no environment field editing. Interpolation resolves against dr.json.
id: msvc
name: microservice
environment: dr
infrastructure:
microservice:
version: "1.0.0"
inputs:
bucket_name: acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
region: ${env.region}
image: public.ecr.aws/docker/library/nginx:latest
port: 80
-11
View File
@@ -1,11 +0,0 @@
# ACDL sample consumer contract — microservice module (prod)
# Per-environment contract (REQ-105). Promotion = running the prod job;
# no environment field editing. Interpolation resolves against prod.json.
uses: acdl/pipelines/deploy.yaml@v1.9
module: microservice
environment: prod
inputs:
bucket_name: acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
region: ${env.region}
image: public.ecr.aws/docker/library/nginx:latest
port: 80
+14
View File
@@ -0,0 +1,14 @@
# ACDL sample consumer contract — microservice module (prod)
# Per-environment contract (REQ-105). Promotion = running the prod job;
# no environment field editing. Interpolation resolves against prod.json.
id: msvc
name: microservice
environment: prod
infrastructure:
microservice:
version: "1.0.0"
inputs:
bucket_name: acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
region: ${env.region}
image: public.ecr.aws/docker/library/nginx:latest
port: 80
-11
View File
@@ -1,11 +0,0 @@
# ACDL sample consumer contract — microservice module (qa)
# Per-environment contract (REQ-105). Promotion = running the qa job;
# no environment field editing. Interpolation resolves against qa.json.
uses: acdl/pipelines/deploy.yaml@v1.9
module: microservice
environment: qa
inputs:
bucket_name: acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
region: ${env.region}
image: public.ecr.aws/docker/library/nginx:latest
port: 80
+14
View File
@@ -0,0 +1,14 @@
# ACDL sample consumer contract — microservice module (qa)
# Per-environment contract (REQ-105). Promotion = running the qa job;
# no environment field editing. Interpolation resolves against qa.json.
id: msvc
name: microservice
environment: qa
infrastructure:
microservice:
version: "1.0.0"
inputs:
bucket_name: acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
region: ${env.region}
image: public.ecr.aws/docker/library/nginx:latest
port: 80
-14
View File
@@ -1,14 +0,0 @@
# ACDL sample consumer contract — microservice module (dev)
#
# Reference example for an ECS Fargate microservice deployment.
# Interpolation (D-081): bucket_name uses the naming pattern that includes
# region, aws account id, and environment:
# acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
uses: acdl/pipelines/deploy.yaml@v1.9
module: microservice
environment: dev
inputs:
bucket_name: acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
region: ${env.region}
image: public.ecr.aws/docker/library/nginx:latest
port: 80
+17
View File
@@ -0,0 +1,17 @@
# ACDL sample consumer contract — microservice module (dev)
#
# Reference example for an ECS Fargate microservice deployment.
# Interpolation (D-081): bucket_name uses the naming pattern that includes
# region, aws account id, and environment:
# acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
id: msvc
name: microservice
environment: dev
infrastructure:
microservice:
version: "1.0.0"
inputs:
bucket_name: acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
region: ${env.region}
image: public.ecr.aws/docker/library/nginx:latest
port: 80
-10
View File
@@ -1,10 +0,0 @@
# ACDL sample consumer contract — static-assets module (dev)
# Per-environment contract (REQ-105). The dev default
# (contracts/static-assets.yaml) remains for backwards compat; this file
# is the explicit per-env dev contract. Interpolation resolves against dev.json.
uses: acdl/pipelines/deploy.yaml@v1.9
module: static-assets
environment: dev
inputs:
bucket_name: acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
region: ${env.region}
+13
View File
@@ -0,0 +1,13 @@
# ACDL sample consumer contract — static-assets module (dev)
# Per-environment contract (REQ-105). The dev default
# (contracts/static-assets.yml) remains for backwards compat; this file
# is the explicit per-env dev contract. Interpolation resolves against dev.json.
id: assets
name: static-assets
environment: dev
infrastructure:
static-assets:
version: "1.0.0"
inputs:
bucket_name: acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
region: ${env.region}
@@ -1,9 +1,12 @@
# ACDL sample consumer contract — static-assets module (dr)
# Per-environment contract (REQ-105). Promotion = running the dr job;
# no environment field editing. Interpolation resolves against dr.json.
uses: acdl/pipelines/deploy.yaml@v1.9
module: static-assets
id: assets
name: static-assets
environment: dr
inputs:
bucket_name: acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
region: ${env.region}
infrastructure:
static-assets:
version: "1.0.0"
inputs:
bucket_name: acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
region: ${env.region}
@@ -1,9 +1,12 @@
# ACDL sample consumer contract — static-assets module (prod)
# Per-environment contract (REQ-105). Promotion = running the prod job;
# no environment field editing. Interpolation resolves against prod.json.
uses: acdl/pipelines/deploy.yaml@v1.9
module: static-assets
id: assets
name: static-assets
environment: prod
inputs:
bucket_name: acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
region: ${env.region}
infrastructure:
static-assets:
version: "1.0.0"
inputs:
bucket_name: acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
region: ${env.region}
@@ -1,9 +1,12 @@
# ACDL sample consumer contract — static-assets module (qa)
# Per-environment contract (REQ-105). Promotion = running the qa job;
# no environment field editing. Interpolation resolves against qa.json.
uses: acdl/pipelines/deploy.yaml@v1.9
module: static-assets
id: assets
name: static-assets
environment: qa
inputs:
bucket_name: acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
region: ${env.region}
infrastructure:
static-assets:
version: "1.0.0"
inputs:
bucket_name: acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
region: ${env.region}
-23
View File
@@ -1,23 +0,0 @@
# ACDL sample consumer contract — static-assets module (dev)
#
# This is the reference example for a consumer contract. It declares:
# uses: the central ACDL deployment pipeline to reference
# module: which module to deploy (must match a registry key)
# environment: which environment to deploy to (dev = autonomous)
# inputs: module-specific inputs
#
# Validated against schemas/contract.schema.json.
# Resolved by core/contract_resolver.py to a Target Stack instance.
#
# Interpolation (D-081): ${env.<field>} + ${contract.<field>} tokens are
# expanded by the resolver from the environment onboarding JSON. The
# bucket_name below demonstrates the naming pattern that includes region,
# aws account id, and environment:
# acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
uses: acdl/pipelines/deploy.yaml@v1.9
module: static-assets
environment: dev
inputs:
bucket_name: acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
region: ${env.region}
+29
View File
@@ -0,0 +1,29 @@
# ACDL sample consumer contract — static-assets module (dev)
#
# This is the reference example for a consumer contract. It declares:
# id: short operational acronym (becomes stack.name for state, tags, evidence)
# name: full human-readable stack name (becomes stack.title for display)
# environment: which environment to deploy to (dev = autonomous)
# infrastructure: map of modules to deploy (keyed by module registry name)
# <module>:
# version: module version pin (defaults to latest published)
# inputs: module-specific inputs
#
# Validated against schemas/contract.schema.json.
# Resolved by core/contract_resolver.py to a Target Stack instance.
#
# Interpolation (D-081): ${env.<field>} + ${contract.<field>} tokens are
# expanded by the resolver from the environment onboarding JSON. The
# bucket_name below demonstrates the naming pattern that includes region,
# aws account id, and environment:
# acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
id: assets
name: static-assets
environment: dev
infrastructure:
static-assets:
version: "1.0.0"
inputs:
bucket_name: acdl-${env.environment}-${contract.id}-${env.account_id}-${env.region}
region: ${env.region}