bee9d02f01
---ci---
project: acdl
phase: 40
milestone: v1.9
status: execute
---/ci---
Phase 40 — contract-interpolation (REQ-103, REQ-104, D-081):
Interpolation:
- core/contract_resolver.py: _expand_vars(value, context) recursively
expands ${env.<field>} + ${contract.<field>} tokens (dotted paths
supported, e.g. ${env.state_backend.bucket}). Unknown tokens raise
ValueError (fail loud). Expansion is post-schema-validation,
pre-IR-resolution.
- resolve() accepts environment_override (D-088) — overrides the
contract's environment field BEFORE schema validation so interpolation
context is consistent.
- env context loaded via _load_env (self-contained, works as script +
package import); 'environment' alias for env 'name' so
${env.environment} resolves.
Environment schema + bindings:
- schemas/environment.schema.json (draft 2020-12): name, account_id,
region, state_backend, network, runner_role_arn, autonomy, confidence_threshold.
- core/environments/qa.json, prod.json, dr.json placeholder bindings
(attested, thresholds 0.75/0.90/0.95, placeholder account_id with
stderr warning at load).
- core/environment_check.py: load(env_name) helper + placeholder warning.
Sample contracts:
- contracts/static-assets.yaml + microservice.yaml use
acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
naming pattern (region + account id + environment).
Tests: +35 (test_environment_schema.py, test_interpolation.py,
test_sample_contracts_interpolate.py). 406 passed; run_ci.sh green;
run_platform.sh --check-only green. Existing fixture-based tests
preserved (instance.json static fixtures unaffected).
23 lines
1.0 KiB
YAML
23 lines
1.0 KiB
YAML
# 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.6
|
|
module: static-assets
|
|
environment: dev
|
|
inputs:
|
|
bucket_name: acdl-${env.environment}-${contract.module}-${env.account_id}-${env.region}
|
|
region: ${env.region} |