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
+9 -9
View File
@@ -32,17 +32,17 @@ class TestEnvironmentCheck:
assert "IAM role" in msg
def test_contract_with_dev_environment_passes(self):
ok, msg = check(contract_path=str(ROOT / "contracts/static-assets.yaml"), root=ROOT)
ok, msg = check(contract_path=str(ROOT / "contracts/static-assets.yml"), root=ROOT)
assert ok is True
assert "dev" in msg
def test_contract_with_missing_environment_fails(self, tmp_path):
contract = tmp_path / "contract.yaml"
contract = tmp_path / "contract.yml"
contract.write_text(
"uses: acdl/pipelines/deploy.yaml@v1.6\n"
"module: static-assets\n"
"id: assets\n"
"name: static-assets-test\n"
"environment: no-such-env\n"
"inputs:\n bucket_name: x\n region: us-east-1\n"
"infrastructure:\n static-assets:\n version: \"1.0.0\"\n inputs:\n bucket_name: x\n region: us-east-1\n"
)
ok, msg = check(contract_path=str(contract), root=ROOT)
assert ok is False
@@ -53,11 +53,11 @@ class TestEnvironmentCheck:
assert ok is False
def test_contract_without_environment_field_returns_false(self, tmp_path):
contract = tmp_path / "contract.yaml"
contract = tmp_path / "contract.yml"
contract.write_text(
"uses: acdl/pipelines/deploy.yaml@v1.6\n"
"module: static-assets\n"
"inputs:\n bucket_name: x\n region: us-east-1\n"
"id: assets\n"
"name: static-assets-test\n"
"infrastructure:\n static-assets:\n version: \"1.0.0\"\n inputs:\n bucket_name: x\n region: us-east-1\n"
)
ok, msg = check(contract_path=str(contract), root=ROOT)
assert ok is False