# Secure Delivery and Rollback — Assignment 8 The active application starts with the instructor's Startup Pricing Service v1 from `Examples.zip`, `Examples/dosSecureDelivery/v1/`. The deployment starters come from that bundle's `ansible/` directory. The task follows Chapter 6 of instructor manual version 1.43. `app/` contains the Flask/Gunicorn service, nine exact direct/transitive dependencies, and a pinned Python 3.13 Alpine base digest for Linux/amd64. The inventory selects The-Ocean's dedicated deploy account. The example release record remains explicitly an example; real registry digests will be generated by Jenkins after the source has been reviewed and merged. Run the tests from `app/` after installing its requirements into the selected Linux test environment. The expected v1 result for three units is USD 30. The later v2 source/test change will be a separate reviewed commit and will return USD 36. The source commit must be baked into each built image. Deployment work uses a dedicated trusted Jenkins agent, immutable images in the existing Gitea registry, and separate Ansible-managed staging and production Compose projects. The agent requires Docker build capability, Python, Ansible, the Docker collection, and the selected security scanners. Registry publication, staging deployment, approval, production promotion, and both recovery exercises require dated execution evidence. ## Attribution and preparation record On 14 November 2026 Vincent asked Codex to review the assignment and begin preparation while he started Docker Desktop. Codex checked the repository's AI requirements and usage guide, read Chapter 6 and the example sources, verified remote main `8beefde`, and created branch `codex/assignment8-secure-delivery`. It copied the v1 and Ansible starters without changing their contents and checked Python syntax. This preparation record will be consolidated into the manual's AI assistance log when the assignment chapter is authored. The instructor retains authorship of the starter application and playbook. ## Verified preparation, 14 November 2026 The existing two pricing tests, three new Flask tests and twelve release/control tests passed. The deliberate wrong-price assertion failed as intended; the synthetic secret fixture blocked its gate. Pip-audit passed for the nine locked application dependencies. The full Trivy runtime-image gate reported no HIGH or CRITICAL findings. Earlier failed scans remain in ignored local evidence; no scanner exception was introduced. A non-root Gunicorn container passed health, identity, pricing and invalid-input checks with a 64 MiB memory cap. The droplet now has 2 GiB RAM and its original 25 GB plan disk. Vincent resized it and installed package updates. The existing seven service containers and their HTTPS routes were verified after maintenance. The trusted laptop node `ssw590-vince-delivery` is online over outbound HTTPS/WebSocket, with one exclusive executor and label `delivery-trusted`. [Agent prerequisite build 1](https://ci.yebilly.me/job/secure-delivery/job/agent-preflight/1/) passed using the dedicated deploy key, pinned host key and root sudo. Its non-secret tool inventory is versioned in `evidence/agent-preflight-1.txt`. The `secure-delivery/pricing` job loads `delivery/Jenkinsfile` from protected main and is disabled pending reviewed source. Release credentials are scoped to that Jenkins folder; the PR job does not bind them or the Docker socket. The deployment account has root-only passwordless sudo: effective host administration privileges, restricted to reviewed delivery code. Distinct package-write and package-read tokens under `vsun1` are stored in Jenkins and root's target Docker configuration respectively. No values are in Git. Local agent identity and workspace live in named Docker volumes outside Git. Run `./delivery/bootstrap/start-agent.ps1` with Docker Desktop and the SSH key loaded in Windows ssh-agent to reconnect. Stop with `docker compose -f delivery/agent/compose.yaml stop` when unused. Ansible syntax, agent Compose configuration, and the installed Jenkins controller's declarative parser checks passed. These are preparation checks; **v1/v2 registry releases, promotion and recovery are not yet demonstrated**. ## Remaining checkpoints Vincent creates the issue, commits/pushes this branch, and obtains Billy's PR review. Keep main protection. Billy/domain owner must add A records `staging` and `app`, both pointing to `147.182.178.136`; distinct DNS names are required. The prepared Caddy additions are not yet applied to the server. Enable the release job after the reviewed source reaches main, then follow `RUNBOOKS.md`. Keep the laptop awake during runs. Production approval requires an authorized human; an agent must not approve unattended. `SECURITY.md` defines the gate policy. `bootstrap/` makes administrator setup reviewable; its one-time script refuses to overwrite existing deployment state. Raw local reports remain under ignored `build/evidence/assignment8-local/`. The manual records material AI assistance and distinguishes pending work from actual evidence. This preparation is not ready for assignment submission.