727c87339b
---ci---
project: acdl
phase: 8
milestone: v1.1
status: plan-as-execute
persona: lead-developer
task: T-8.0
type: prerequisite-fix
---/ci---
The Phase 07 P1 ('platform/ package shadows stdlib platform module')
became a Phase 08 blocker: boto3 imports uuid -> platform.system(),
which fails when the repo's platform/ package is on sys.path[0]. Renamed
platform/ -> acdl_platform/ (the verifier's recommended v1.2 fix, pulled
forward because Phase 08 needs boto3).
- git mv platform/ acdl_platform/ (history preserved)
- verify_phase07.sh: updated paths; removed the /tmp workaround (no
longer needed; the shadow is gone)
- verify_phase06.sh: updated the new-dirs check for the rename
- README.md: layout table updated
Both verify_phase06.sh and verify_phase07.sh still pass; confidence_signal
now imports + runs correctly from the repo root. boto3 imports clean.
74 lines
3.6 KiB
Bash
Executable File
74 lines
3.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# scripts/verify_phase07.sh - Phase 07 architecture-v1-finalization gate.
|
|
set -u
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$ROOT"
|
|
fail() { echo "FAIL: $*" >&2; exit 1; }
|
|
ok() { echo "ok: $*"; }
|
|
|
|
# --- Check 1: all 9 deliverable files exist ---
|
|
# Note: platform/ was renamed to acdl_platform/ in Phase 08 to avoid
|
|
# shadowing the stdlib platform module (boto3 imports uuid ->
|
|
# platform.system()).
|
|
for f in docs/architecture-v1.0.md \
|
|
schemas/ir.schema.json \
|
|
schemas/policy_check_result.schema.json \
|
|
schemas/contract.schema.json \
|
|
acdl_platform/confidence_signal.py \
|
|
acdl_platform/audit_ledger_design.md \
|
|
acdl_platform/hitl_matrix_design.md \
|
|
acdl_platform/separation_of_duties.py \
|
|
adapters/terraform/policy/checkov_adapter.py; do
|
|
[ -f "$f" ] || fail "missing $f"
|
|
done
|
|
ok "all 9 deliverable files exist"
|
|
|
|
# --- Check 2: 3 JSON Schemas are valid Draft 2020-12 ---
|
|
for s in schemas/ir.schema.json schemas/policy_check_result.schema.json schemas/contract.schema.json; do
|
|
python3 -c "import json, jsonschema; jsonschema.Draft202012Validator.check_schema(json.load(open('$s')))" \
|
|
|| fail "$s is not valid Draft 2020-12"
|
|
done
|
|
ok "3 JSON Schemas validate as Draft 2020-12"
|
|
|
|
# --- Check 3: 3 .py files py_compile ---
|
|
for p in acdl_platform/confidence_signal.py acdl_platform/separation_of_duties.py adapters/terraform/policy/checkov_adapter.py; do
|
|
python3 -m py_compile "$p" || fail "$p py_compile failed"
|
|
done
|
|
ok "3 .py files py_compile"
|
|
|
|
# --- Check 4: 3 .md design files non-empty ---
|
|
for m in acdl_platform/audit_ledger_design.md acdl_platform/hitl_matrix_design.md docs/architecture-v1.0.md; do
|
|
[ -s "$m" ] || fail "$m is empty"
|
|
done
|
|
ok "3 .md design files non-empty"
|
|
|
|
# --- Check 5: all 11 decision IDs + OpenTofu in PROJECT.md ---
|
|
for id in W1.A W1.B W2.A W3.D W3.E BA.A BA.B BA.C BA.D BA.E BA.F; do
|
|
grep -q "$id" .ciagent/PROJECT.md || fail "missing $id in PROJECT.md"
|
|
done
|
|
grep -qi "opentofu" .ciagent/PROJECT.md || fail "missing OpenTofu in PROJECT.md"
|
|
ok "all 11 decision IDs + OpenTofu present in PROJECT.md"
|
|
|
|
# --- Check 6: docs/architecture-v1.0.md status is v1.0 ---
|
|
grep -q "v1.0" docs/architecture-v1.0.md || fail "architecture-v1.0.md missing v1.0"
|
|
ok "docs/architecture-v1.0.md status is v1.0"
|
|
|
|
# --- Check 7: D-040..D-044 present in PROJECT.md ---
|
|
for d in D-040 D-041 D-042 D-043 D-044; do
|
|
grep -q "$d" .ciagent/PROJECT.md || fail "missing $d in PROJECT.md"
|
|
done
|
|
ok "D-040..D-044 present in PROJECT.md"
|
|
|
|
# --- Check 8: spike contract validates against contract schema ---
|
|
echo '{"stack":"l2-static-asset","environment":"dev","inputs":{"bucket_name":"x","region":"us-east-1"}}' > /tmp/spike-contract.json
|
|
python3 -c "import json, jsonschema; jsonschema.validate(json.load(open('/tmp/spike-contract.json')), json.load(open('schemas/contract.schema.json')))" \
|
|
|| fail "spike contract does not validate against contract schema"
|
|
ok "spike contract validates against contract schema"
|
|
|
|
# --- Check 9: minimal IR validates against IR schema ---
|
|
echo '{"version":"1.0.0","stack":{"name":"l2-static-asset","kind":"l2","depth":1},"resources":[{"id":"s3","type":"aws:s3:bucket","module":"l1-s3@1.0.0","inputs":{"bucket_name":"x","region":"us-east-1"}}]}' > /tmp/spike-ir.json
|
|
python3 -c "import json, jsonschema; jsonschema.validate(json.load(open('/tmp/spike-ir.json')), json.load(open('schemas/ir.schema.json')))" \
|
|
|| fail "minimal IR does not validate against IR schema"
|
|
ok "minimal IR validates against IR schema"
|
|
|
|
echo "VERIFIED — Phase 07: architecture v1.0 finalized; 6 files authored + 11 decisions resolved" |