From 6997da3a582919dabff0526d5e612de9b1e3f552 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Thu, 15 Oct 2026 16:41:32 -0500 Subject: [PATCH] chore(engine): retire appctl_engine_v2.py backward-compatibility shim - Remove unused 16-line re-export shim scripts/appctl_engine_v2.py - Update implementation inventory in docs/plans/p4-readiness-plan.md - Confirm zero active callers across scripts, tests, and configuration --- docs/plans/p4-readiness-plan.md | 5 +++-- scripts/appctl_engine_v2.py | 16 ---------------- 2 files changed, 3 insertions(+), 18 deletions(-) delete mode 100755 scripts/appctl_engine_v2.py diff --git a/docs/plans/p4-readiness-plan.md b/docs/plans/p4-readiness-plan.md index f97a6a2..404fd35 100644 --- a/docs/plans/p4-readiness-plan.md +++ b/docs/plans/p4-readiness-plan.md @@ -46,8 +46,8 @@ This plan resolves the six architectural prerequisites necessary to implement P4 | :--- | :--- | :--- | :--- | | [`scripts/appctl`](../../scripts/appctl) | Bash | **Active CLI Client** | CLI entry point; secret environment sourcing (`homeserver.env`, `traefik-deployments.env`); resolves metadata via engine; directly runs `docker compose` and `git pull` subprocesses. | | [`scripts/appctl_engine.py`](../../scripts/appctl_engine.py) | Python 3 | **Authoritative Engine** | Domain models (`SitesApp`, `CoreService`); schema v1.0 parsing (`core_manifest.py`); two-axis inspection (`provenance.py`); SSL cert inspection; Homepage compilation; metadata serialization (`resolve`). | -| [`scripts/appctl_engine_v2.py`](../../scripts/appctl_engine_v2.py) | Python 3 | **Compatibility Shim** | Thin backward-compatibility wrapper re-exporting all symbols from `appctl_engine.py`. No unique domain logic. | | [`scripts/core_manifest.py`](../../scripts/core_manifest.py) | Python 3 | **Schema Library** | Strongly-typed Manifest dataclasses; transport validation (`https://`, `ssh://`, `git@`); ref semantics classification (`branch`, `tag`, `commit`). | + | [`scripts/provenance.py`](../../scripts/provenance.py) | Python 3 | **Provenance Library** | Two-axis status engine; local checkout inspection (`git status`, commit SHA); bounded upstream query (`git ls-remote` with 10s timeout). | | [`scripts/gitops_dispatcher.py`](../../scripts/gitops_dispatcher.py) | Python 3 | **Independent Service** | Webhook listener (port 9000); HMAC validation; flock serialization; independent AST validation; executes its own `docker compose` and `git pull` subprocesses. | @@ -84,7 +84,8 @@ This plan resolves the six architectural prerequisites necessary to implement P4 ### D. Architectural Findings & Migration Deductions -1. **V1 Engine is Fully Superseded**: `scripts/appctl_engine.py` is now identical to the modern dataclass implementation. `scripts/appctl_engine_v2.py` is merely an alias and can be deprecated/retired once the daemon is active. +1. **V1 Engine is Fully Superseded & V2 Shim Retired**: `scripts/appctl_engine.py` is the single authoritative metadata engine. The `scripts/appctl_engine_v2.py` compatibility shim has been retired. + 2. **Duplicated Operational Logic in GitOps**: `scripts/gitops_dispatcher.py` and `scripts/appctl` maintain **separate, duplicate implementations** of `git pull` and `docker compose up`. This violates Invariant #1 (*Single Operational Truth*). In P4, GitOps webhook handlers must delegate execution to the control-plane daemon via its internal client. 3. **Environment Injection Vulnerability in Bash**: The current Bash CLI constructs shell exports dynamically using `eval "$(python3 ...)"`. The daemon replaces this subprocess string interpolation with in-process, typed dictionary manipulation. diff --git a/scripts/appctl_engine_v2.py b/scripts/appctl_engine_v2.py deleted file mode 100755 index aa0fda0..0000000 --- a/scripts/appctl_engine_v2.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 -""" -appctl_engine_v2.py - Backward-compatibility shim pointing to appctl_engine.py. -""" -from __future__ import annotations - -import sys -from pathlib import Path - -sys.path.insert(0, str(Path(__file__).resolve().parent)) - -from appctl_engine import * -from appctl_engine import main - -if __name__ == "__main__": - main()