fix(P08 prep): rename platform/ -> acdl_platform/ (stdlib shadow fix)
---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.
This commit is contained in:
@@ -28,7 +28,7 @@ a configuration file, or a Terraform module.
|
|||||||
|
|
||||||
| Path | Purpose | Populated |
|
| Path | Purpose | Populated |
|
||||||
|------|---------|-----------|
|
|------|---------|-----------|
|
||||||
| `platform/` | Platform code: confidence signal, contract resolver, outbox, HITL/ledger designs | Phase 07+ |
|
| `acdl_platform/` | Platform code: confidence signal, contract resolver, outbox, HITL/ledger designs (renamed from `platform/` in Phase 08 to avoid shadowing the stdlib `platform` module) | Phase 07+ |
|
||||||
| `schemas/` | JSON Schemas: IR, PolicyCheckResult, contract | Phase 07 |
|
| `schemas/` | JSON Schemas: IR, PolicyCheckResult, contract | Phase 07 |
|
||||||
| `adapters/` | Substrate adapters (Terraform adapter in v1; the only substrate-specific code per §12) | Phase 09 |
|
| `adapters/` | Substrate adapters (Terraform adapter in v1; the only substrate-specific code per §12) | Phase 09 |
|
||||||
| `terraform/` | State backend + provider config (S3 state + DynamoDB lock) | Phase 08+ |
|
| `terraform/` | State backend + provider config (S3 state + DynamoDB lock) | Phase 08+ |
|
||||||
|
|||||||
@@ -22,11 +22,15 @@ out=$(ACDL_GITEA_TOKEN= bash demo/scripts/run_demo.sh --no-upload 2>&1); rc=$?
|
|||||||
ok "demo/scripts/run_demo.sh --no-upload exits 0"
|
ok "demo/scripts/run_demo.sh --no-upload exits 0"
|
||||||
|
|
||||||
# --- Check 3: new top-level dirs exist and are scaffolded ---
|
# --- Check 3: new top-level dirs exist and are scaffolded ---
|
||||||
for d in platform schemas adapters terraform modules-ir; do
|
# Note: platform/ was renamed to acdl_platform/ in Phase 08 (stdlib shadow fix).
|
||||||
|
for d in acdl_platform schemas adapters terraform modules-ir; do
|
||||||
[ -d "$d" ] || fail "missing new top-level dir $d"
|
[ -d "$d" ] || fail "missing new top-level dir $d"
|
||||||
|
done
|
||||||
|
[ -f "acdl_platform/.gitkeep" ] || [ -f "acdl_platform/__init__.py" ] || fail "acdl_platform/ not scaffolded"
|
||||||
|
for d in schemas adapters terraform modules-ir; do
|
||||||
[ -f "$d/.gitkeep" ] || fail "missing $d/.gitkeep"
|
[ -f "$d/.gitkeep" ] || fail "missing $d/.gitkeep"
|
||||||
done
|
done
|
||||||
ok "new top-level dirs exist: platform/ schemas/ adapters/ terraform/ modules-ir/"
|
ok "new top-level dirs exist: acdl_platform/ schemas/ adapters/ terraform/ modules-ir/"
|
||||||
|
|
||||||
# --- Check 4: no stray v1.0 dirs left at repo root ---
|
# --- Check 4: no stray v1.0 dirs left at repo root ---
|
||||||
for stray in modules evidence-ui contracts contracts-repo ACDL_DEMO.md; do
|
for stray in modules evidence-ui contracts contracts-repo ACDL_DEMO.md; do
|
||||||
|
|||||||
+16
-26
@@ -7,43 +7,37 @@ fail() { echo "FAIL: $*" >&2; exit 1; }
|
|||||||
ok() { echo "ok: $*"; }
|
ok() { echo "ok: $*"; }
|
||||||
|
|
||||||
# --- Check 1: all 9 deliverable files exist ---
|
# --- 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 \
|
for f in docs/architecture-v1.0.md \
|
||||||
schemas/ir.schema.json \
|
schemas/ir.schema.json \
|
||||||
schemas/policy_check_result.schema.json \
|
schemas/policy_check_result.schema.json \
|
||||||
schemas/contract.schema.json \
|
schemas/contract.schema.json \
|
||||||
platform/confidence_signal.py \
|
acdl_platform/confidence_signal.py \
|
||||||
platform/audit_ledger_design.md \
|
acdl_platform/audit_ledger_design.md \
|
||||||
platform/hitl_matrix_design.md \
|
acdl_platform/hitl_matrix_design.md \
|
||||||
platform/separation_of_duties.py \
|
acdl_platform/separation_of_duties.py \
|
||||||
adapters/terraform/policy/checkov_adapter.py; do
|
adapters/terraform/policy/checkov_adapter.py; do
|
||||||
[ -f "$f" ] || fail "missing $f"
|
[ -f "$f" ] || fail "missing $f"
|
||||||
done
|
done
|
||||||
ok "all 9 deliverable files exist"
|
ok "all 9 deliverable files exist"
|
||||||
|
|
||||||
# --- Check 2: 3 JSON Schemas are valid Draft 2020-12 ---
|
# --- Check 2: 3 JSON Schemas are valid Draft 2020-12 ---
|
||||||
# Run python from /tmp so the repo's `platform/` package does not shadow the
|
for s in schemas/ir.schema.json schemas/policy_check_result.schema.json schemas/contract.schema.json; do
|
||||||
# stdlib `platform` module (jsonschema imports uuid -> platform.system();
|
python3 -c "import json, jsonschema; jsonschema.Draft202012Validator.check_schema(json.load(open('$s')))" \
|
||||||
# our platform/ shadows it when cwd is repo root and on sys.path[0]).
|
|| fail "$s is not valid Draft 2020-12"
|
||||||
check_schema() {
|
|
||||||
( cd /tmp && python3 -c "
|
|
||||||
import json, jsonschema
|
|
||||||
s = json.load(open('$1'))
|
|
||||||
jsonschema.Draft202012Validator.check_schema(s)
|
|
||||||
" >/dev/null 2>&1 )
|
|
||||||
}
|
|
||||||
for s in "$ROOT/schemas/ir.schema.json" "$ROOT/schemas/policy_check_result.schema.json" "$ROOT/schemas/contract.schema.json"; do
|
|
||||||
check_schema "$s" || fail "$(basename "$s") is not valid Draft 2020-12"
|
|
||||||
done
|
done
|
||||||
ok "3 JSON Schemas validate as Draft 2020-12"
|
ok "3 JSON Schemas validate as Draft 2020-12"
|
||||||
|
|
||||||
# --- Check 3: 3 .py files py_compile ---
|
# --- Check 3: 3 .py files py_compile ---
|
||||||
for p in platform/confidence_signal.py platform/separation_of_duties.py adapters/terraform/policy/checkov_adapter.py; do
|
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"
|
python3 -m py_compile "$p" || fail "$p py_compile failed"
|
||||||
done
|
done
|
||||||
ok "3 .py files py_compile"
|
ok "3 .py files py_compile"
|
||||||
|
|
||||||
# --- Check 4: 3 .md design files non-empty ---
|
# --- Check 4: 3 .md design files non-empty ---
|
||||||
for m in platform/audit_ledger_design.md platform/hitl_matrix_design.md docs/architecture-v1.0.md; do
|
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"
|
[ -s "$m" ] || fail "$m is empty"
|
||||||
done
|
done
|
||||||
ok "3 .md design files non-empty"
|
ok "3 .md design files non-empty"
|
||||||
@@ -67,18 +61,14 @@ ok "D-040..D-044 present in PROJECT.md"
|
|||||||
|
|
||||||
# --- Check 8: spike contract validates against contract schema ---
|
# --- 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
|
echo '{"stack":"l2-static-asset","environment":"dev","inputs":{"bucket_name":"x","region":"us-east-1"}}' > /tmp/spike-contract.json
|
||||||
( cd /tmp && python3 -c "
|
python3 -c "import json, jsonschema; jsonschema.validate(json.load(open('/tmp/spike-contract.json')), json.load(open('schemas/contract.schema.json')))" \
|
||||||
import json, jsonschema
|
|| fail "spike contract does not validate against contract schema"
|
||||||
jsonschema.validate(json.load(open('/tmp/spike-contract.json')), json.load(open('$ROOT/schemas/contract.schema.json')))
|
|
||||||
" ) || fail "spike contract does not validate against contract schema"
|
|
||||||
ok "spike contract validates against contract schema"
|
ok "spike contract validates against contract schema"
|
||||||
|
|
||||||
# --- Check 9: minimal IR validates against IR 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
|
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
|
||||||
( cd /tmp && python3 -c "
|
python3 -c "import json, jsonschema; jsonschema.validate(json.load(open('/tmp/spike-ir.json')), json.load(open('schemas/ir.schema.json')))" \
|
||||||
import json, jsonschema
|
|| fail "minimal IR does not validate against IR schema"
|
||||||
jsonschema.validate(json.load(open('/tmp/spike-ir.json')), json.load(open('$ROOT/schemas/ir.schema.json')))
|
|
||||||
" ) || fail "minimal IR does not validate against IR schema"
|
|
||||||
ok "minimal IR validates against IR schema"
|
ok "minimal IR validates against IR schema"
|
||||||
|
|
||||||
echo "VERIFIED — Phase 07: architecture v1.0 finalized; 6 files authored + 11 decisions resolved"
|
echo "VERIFIED — Phase 07: architecture v1.0 finalized; 6 files authored + 11 decisions resolved"
|
||||||
Reference in New Issue
Block a user