From e048acd4dd58388cd0e1c405b295bfda1bee2c34 Mon Sep 17 00:00:00 2001 From: Jon Chery Date: Sat, 1 Aug 2026 12:20:40 +0000 Subject: [PATCH] =?UTF-8?q?verify(P3):=20dead-code-and-stale-prefix-cleanu?= =?UTF-8?q?p=20=E2=80=94=204-layer=20verify=20PASS=20+=20ship?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VERIFY: structural — dead export + stale comments + prefixes gone; behavioral — 616 tests + CI PASS; quality — env-override test updated. ---ci--- project: acdl phase: 3 milestone: v1.16 status: complete phase_role: execution requirements: covered: [REQ-167] partial: [] ---/ci--- --- core/local_emulators.py | 12 ++++++------ core/regression_verify.py | 10 +++++----- scripts/run_l2_lifecycle_destroy.sh | 6 +++--- scripts/run_l2_lifecycle_test.sh | 8 +++----- scripts/run_lifecycle_destroy.sh | 8 ++++---- scripts/run_lifecycle_test.sh | 6 +++--- scripts/run_pattern_plan.sh | 2 +- scripts/run_platform.sh | 3 +-- scripts/run_primitive_plan.sh | 2 +- scripts/run_regression.sh | 2 +- tests/test_deploy_workflow_env_input.py | 5 +++-- 11 files changed, 31 insertions(+), 33 deletions(-) diff --git a/core/local_emulators.py b/core/local_emulators.py index 59d9011..13b3745 100644 --- a/core/local_emulators.py +++ b/core/local_emulators.py @@ -13,7 +13,8 @@ evidence event) runs end-to-end against the local tier with no AWS: Each adapter exposes the same interface as the live counterpart so the caller code path is unchanged; only the I/O target swaps. Selection is gated on the NOVA_LOCAL_TIER env var (set by run_platform.sh --local). -Dual-read via core/env.py: NOVA_* preferred, ACDL_* fallback until P5. +Env vars read via core/env.py (NOVA_* only; the ACDL_* fallback was +removed in v1.15 P5, REQ-164). """ from __future__ import annotations @@ -68,7 +69,7 @@ class FlatFileOutbox: @classmethod def create(cls, dir: Optional[Path] = None) -> "FlatFileOutbox": - d = Path(dir) if dir else Path(tempfile.mkdtemp(prefix="acdl_outbox_")) + d = Path(dir) if dir else Path(tempfile.mkdtemp(prefix="nova_outbox_")) d.mkdir(parents=True, exist_ok=True) out = cls(dir=d) # Re-read the chain tail if the file already exists. @@ -249,7 +250,7 @@ class LocalS3StateBackend: @classmethod def create(cls, dir: Optional[Path] = None) -> "LocalS3StateBackend": - d = Path(dir) if dir else Path(tempfile.mkdtemp(prefix="acdl_tfstate_")) + d = Path(dir) if dir else Path(tempfile.mkdtemp(prefix="nova_tfstate_")) d.mkdir(parents=True, exist_ok=True) return cls(state_dir=d) @@ -499,9 +500,8 @@ def run_local_e2e(contract_path: str, repo_root: Optional[Path] = None) -> Dict[ if __name__ == "__main__": contract = sys.argv[1] if len(sys.argv) > 1 else "contracts/microservice.yml" - # Set both so the dual-read in is_local_tier() finds NOVA_* (preferred); - # the ACDL_* alias stays for any unmigrated reader until P5. + # Set so is_local_tier() finds NOVA_LOCAL_TIER (NOVA_* only; the + # ACDL_* alias was removed in v1.15 P5, REQ-164). os.environ["NOVA_LOCAL_TIER"] = "1" - # P5 (REQ-164): ACDL_LOCAL_TIER legacy alias removed (NOVA_* only) result = run_local_e2e(contract) print(json.dumps(result, indent=2)) \ No newline at end of file diff --git a/core/regression_verify.py b/core/regression_verify.py index e475323..4092023 100755 --- a/core/regression_verify.py +++ b/core/regression_verify.py @@ -180,7 +180,7 @@ def _check_resolver_microservice() -> Tuple[Status, str]: def _check_adapter_emits_terraform() -> Tuple[Status, str]: """CAP-005: terraform adapter compiles a resolved stack to .tf files.""" - work = tempfile.mkdtemp(prefix="acdl_regr_") + work = tempfile.mkdtemp(prefix="nova_regr_") stack_path = os.path.join(work, "stack.json") tf_dir = os.path.join(work, "tf") os.makedirs(tf_dir, exist_ok=True) @@ -211,7 +211,7 @@ def _check_interpolation() -> Tuple[Status, str]: "import sys; sys.path.insert(0,'.'); " "from core.contract_resolver import _expand_vars; " "ctx={'env':{'environment':'qa','account_id':'123'},'contract':{'id':'assets'}}; " - "assert _expand_vars('acdl-${env.environment}-${contract.id}', ctx)=='acdl-qa-assets'; " + "assert _expand_vars('nova-${env.environment}-${contract.id}', ctx)=='nova-qa-assets'; " "print('interpolation ok')", ]) @@ -231,7 +231,7 @@ def _check_confidence_signal() -> Tuple[Status, str]: def _check_outbox_writer() -> Tuple[Status, str]: """CAP-008: outbox_writer writes a hash-chained event to a temp file.""" - work = tempfile.mkdtemp(prefix="acdl_outbox_") + work = tempfile.mkdtemp(prefix="nova_outbox_") event_path = os.path.join(work, "event.json") event = { "contractId": "regression-test", "eventType": "CONFIDENCE_COMPUTED", @@ -315,7 +315,7 @@ def _load_aws_env() -> Dict[str, str]: continue if "=" in line: k, v = line.split("=", 1) - # P5 (REQ-164): dual-read fallback removed — NOVA_* only. + # NOVA_* only (ACDL_* fallback removed in v1.15 P5, REQ-164). if k == "NOVA_AWS_ACCESS_KEY_ID": env["AWS_ACCESS_KEY_ID"] = v elif k == "NOVA_AWS_SECRET_ACCESS_KEY": @@ -330,7 +330,7 @@ def _check_live_terraform_plan_microservice() -> Tuple[Status, str]: microservice stack (D-093 live-AWS tier of the headline E2E). Requires AWS credentials (NOVA_AWS_ACCESS_KEY_ID etc. in .env.secrets; - dual-read NOVA_* first, ACDL_* fallback per G-106). + NOVA_* only — the ACDL_* fallback was removed in v1.15 P5, REQ-164). Runs in a temp dir; does NOT apply (plan only).""" import tempfile, os work = tempfile.mkdtemp(prefix="nova_regr_live_") diff --git a/scripts/run_l2_lifecycle_destroy.sh b/scripts/run_l2_lifecycle_destroy.sh index e9dfdcb..78b058d 100755 --- a/scripts/run_l2_lifecycle_destroy.sh +++ b/scripts/run_l2_lifecycle_destroy.sh @@ -14,8 +14,8 @@ # parity with the L1 matrix, but $2 is accepted-but-ignored here (documented, # not a bug). # -# Lifecycle mode (REQ-134): NOVA_LIFECYCLE_MODE (dual-read NOVA_* preferred, -# ACDL_* fallback until P5) default "plan" = no-op +# Lifecycle mode (REQ-134): NOVA_LIFECYCLE_MODE (NOVA_* only; ACDL_* +# fallback removed in v1.15 P5) default "plan" = no-op # (plan mode never applies resources, so there is nothing to destroy). # Set to "full" for the real `--destroy` against live AWS. set -euo pipefail @@ -25,7 +25,7 @@ cd "$ROOT" MODULE="$1" # Lifecycle mode: "plan" (default) skips destroy; "full" runs the real destroy. -# Dual-read: NOVA_* preferred, ACDL_* fallback (removed in P5). +# NOVA_* env vars only (ACDL_* fallback removed in v1.15 P5, REQ-164). LIFECYCLE_MODE="${NOVA_LIFECYCLE_MODE:-plan}" if [ "$LIFECYCLE_MODE" != "full" ]; then diff --git a/scripts/run_l2_lifecycle_test.sh b/scripts/run_l2_lifecycle_test.sh index 48960b9..ae4d090 100755 --- a/scripts/run_l2_lifecycle_test.sh +++ b/scripts/run_l2_lifecycle_test.sh @@ -17,8 +17,8 @@ # positional args for parity with the L1 matrix, but $3 is accepted-but- # ignored here (documented, not a bug). # -# Lifecycle mode (REQ-134): NOVA_LIFECYCLE_MODE (dual-read NOVA_* preferred, -# ACDL_* fallback until P5) default "plan" runs +# Lifecycle mode (REQ-134): NOVA_LIFECYCLE_MODE (NOVA_* only; ACDL_* +# fallback removed in v1.15 P5) default "plan" runs # `run_platform.sh --plan-only` (fast, no AWS mutation). Set to "full" for # the real `--apply` against live AWS. set -euo pipefail @@ -29,14 +29,12 @@ MODULE="$1" EXAMPLE="$2" # simple or complex # Lifecycle mode: "plan" (default, fast) or "full" (real apply against AWS). -# Dual-read: NOVA_* preferred, ACDL_* fallback (removed in P5). +# NOVA_* env vars only (ACDL_* fallback removed in v1.15 P5, REQ-164). LIFECYCLE_MODE="${NOVA_LIFECYCLE_MODE:-plan}" CONTRACT="modules/l2/${MODULE}/examples/${EXAMPLE}.yml" # Point terraform_remote_state to the CI VPC state (not the platform VPC). -# Set both NOVA_* (preferred by the dual-read helper) and ACDL_* (legacy -# fallback) so any unmigrated reader finds the key until P5. export NOVA_REMOTE_STATE_KEY="spike/ci-vpc/terraform.tfstate" diff --git a/scripts/run_lifecycle_destroy.sh b/scripts/run_lifecycle_destroy.sh index 43c380e..292ffe9 100755 --- a/scripts/run_lifecycle_destroy.sh +++ b/scripts/run_lifecycle_destroy.sh @@ -6,8 +6,8 @@ # For VPC-dependent modules, injects CI VPC outputs into the complex contract # before destroy (so terraform can find the resources in the right VPC). # -# Lifecycle mode (REQ-134): NOVA_LIFECYCLE_MODE (dual-read NOVA_* preferred, -# ACDL_* fallback until P5) default "plan" = no-op +# Lifecycle mode (REQ-134): NOVA_LIFECYCLE_MODE (NOVA_* only; ACDL_* +# fallback removed in v1.15 P5) default "plan" = no-op # (plan mode never applies resources, so there is nothing to destroy; the # script exits 0 so the pipeline matrix cell stays green). Set to "full" # for the real `--destroy` against live AWS. @@ -20,7 +20,7 @@ CI_VPC_OUTPUTS="${2:-}" # Lifecycle mode: "plan" (default) skips destroy (nothing was applied); # "full" runs the real terraform destroy. -# Dual-read: NOVA_* preferred, ACDL_* fallback (removed in P5). +# NOVA_* env vars only (ACDL_* fallback removed in v1.15 P5, REQ-164). LIFECYCLE_MODE="${NOVA_LIFECYCLE_MODE:-plan}" if [ "$LIFECYCLE_MODE" != "full" ]; then @@ -33,7 +33,7 @@ CONTRACT="modules/l1/${MODULE}/examples/complex.yml" VPC_DEPENDENT="alb ecs-service rds uptime" if echo "$VPC_DEPENDENT" | grep -qw "$MODULE" && [ -n "$CI_VPC_OUTPUTS" ] && [ -f "$CI_VPC_OUTPUTS" ]; then - TMP_CONTRACT="/tmp/acdl-lifecycle-${MODULE}-complex.yml" + TMP_CONTRACT="/tmp/nova-lifecycle-${MODULE}-complex.yml" python3 -c " import yaml, json diff --git a/scripts/run_lifecycle_test.sh b/scripts/run_lifecycle_test.sh index 2567112..82f5f1f 100755 --- a/scripts/run_lifecycle_test.sh +++ b/scripts/run_lifecycle_test.sh @@ -11,7 +11,7 @@ # from the long-lived platform VPC. # # Lifecycle mode (REQ-134): the NOVA_LIFECYCLE_MODE env var selects the -# tier (dual-read NOVA_* preferred, ACDL_* fallback until P5). Default +# tier (NOVA_* only; ACDL_* fallback removed in v1.15 P5). Default # "plan" runs `run_platform.sh --plan-only` (fast, no AWS # mutation, validates the contract->resolver->adapter->plan chain for # every module). Set to "full" to run the real `--apply` (terraform apply @@ -26,7 +26,7 @@ EXAMPLE="$2" # simple or complex CI_VPC_OUTPUTS="${3:-}" # Lifecycle mode: "plan" (default, fast) or "full" (real apply against AWS). -# Dual-read: NOVA_* preferred, ACDL_* fallback (removed in P5). +# NOVA_* env vars only (ACDL_* fallback removed in v1.15 P5, REQ-164). LIFECYCLE_MODE="${NOVA_LIFECYCLE_MODE:-plan}" CONTRACT="modules/l1/${MODULE}/examples/${EXAMPLE}.yml" @@ -38,7 +38,7 @@ VPC_DEPENDENT="alb ecs-service rds uptime" # (only meaningful in full mode; plan mode ignores VPC outputs) if [ "$LIFECYCLE_MODE" = "full" ] && echo "$VPC_DEPENDENT" | grep -qw "$MODULE" && [ -n "$CI_VPC_OUTPUTS" ] && [ -f "$CI_VPC_OUTPUTS" ]; then # Generate a temporary contract with CI VPC outputs injected - TMP_CONTRACT="/tmp/acdl-lifecycle-${MODULE}-${EXAMPLE}.yml" + TMP_CONTRACT="/tmp/nova-lifecycle-${MODULE}-${EXAMPLE}.yml" python3 -c " import yaml, json, sys diff --git a/scripts/run_pattern_plan.sh b/scripts/run_pattern_plan.sh index b0fba07..1347ce0 100755 --- a/scripts/run_pattern_plan.sh +++ b/scripts/run_pattern_plan.sh @@ -26,7 +26,7 @@ done CONTRACT="contracts/$MODULE.yaml" [ -f "$CONTRACT" ] || { echo "FAIL: no sample contract at $CONTRACT for module '$MODULE'" >&2; exit 1; } -WORK="/tmp/acdl_pattern_plan_$MODULE" +WORK="/tmp/nova_pattern_plan_$MODULE" rm -rf "$WORK"; mkdir -p "$WORK" echo "=== Pattern plan: $MODULE ===" diff --git a/scripts/run_platform.sh b/scripts/run_platform.sh index 966031a..fd83e5c 100755 --- a/scripts/run_platform.sh +++ b/scripts/run_platform.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# scripts/run_platform.sh - the ACDL platform pipeline. +# scripts/run_platform.sh - the Nova platform pipeline. # # Usage: # run_platform.sh (full e2e with AWS) @@ -150,7 +150,6 @@ rm -rf "$WORK"; mkdir -p "$TF_DIR" echo "=== Step 0: environment onboarding check ===" if [ -n "$ENVIRONMENT_OVERRIDE" ]; then export NOVA_ENVIRONMENT_OVERRIDE="$ENVIRONMENT_OVERRIDE" - export ACDL_ENVIRONMENT_OVERRIDE="$ENVIRONMENT_OVERRIDE" # legacy fallback, removed in P5 python3 core/environment_check.py --env="$ENVIRONMENT_OVERRIDE" || { echo "FAIL: environment not bound — see the onboarding prompt above" >&2 exit 1 diff --git a/scripts/run_primitive_plan.sh b/scripts/run_primitive_plan.sh index aea9ad9..746dd5a 100755 --- a/scripts/run_primitive_plan.sh +++ b/scripts/run_primitive_plan.sh @@ -26,7 +26,7 @@ done INSTANCE="modules/l1/$PRIMITIVE/instance.json" [ -f "$INSTANCE" ] || { echo "FAIL: no instance.json for primitive '$PRIMITIVE'" >&2; exit 1; } -WORK="/tmp/acdl_primitive_plan_$PRIMITIVE" +WORK="/tmp/nova_primitive_plan_$PRIMITIVE" rm -rf "$WORK"; mkdir -p "$WORK" echo "=== Primitive plan: $PRIMITIVE ===" diff --git a/scripts/run_regression.sh b/scripts/run_regression.sh index a13e34f..d11625a 100755 --- a/scripts/run_regression.sh +++ b/scripts/run_regression.sh @@ -19,7 +19,7 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$ROOT" echo "=== Nova Regression VERIFY (D-091) ===" -# Dual-read: NOVA_* preferred, ACDL_* fallback (removed in P5). +# NOVA_* env vars only (ACDL_* fallback removed in v1.15 P5, REQ-164). echo "milestone: ${NOVA_REGRESSION_MILESTONE:-v1.10} phase: ${NOVA_REGRESSION_PHASE:-52}" echo "" diff --git a/tests/test_deploy_workflow_env_input.py b/tests/test_deploy_workflow_env_input.py index d5d8553..ba94984 100644 --- a/tests/test_deploy_workflow_env_input.py +++ b/tests/test_deploy_workflow_env_input.py @@ -78,6 +78,7 @@ def test_run_platform_sh_has_environment_flag(): text = (ROOT / "scripts" / "run_platform.sh").read_text() assert "--environment" in text assert "ENVIRONMENT_OVERRIDE" in text - # P2 (REQ-159): NOVA_* preferred; ACDL_* kept as dual-read fallback until P5. + # P3 (REQ-167): NOVA_* only; the dead ACDL_ENVIRONMENT_OVERRIDE export + # (comment said "removed in P5" but the line was present) is gone. assert "NOVA_ENVIRONMENT_OVERRIDE" in text - assert "ACDL_ENVIRONMENT_OVERRIDE" in text # legacy fallback, removed in P5 \ No newline at end of file + assert "ACDL_ENVIRONMENT_OVERRIDE" not in text \ No newline at end of file