Description
Provide a repository-owned, idempotent setup script for Codex Cloud tasks so manual environment setup installs the task tracker and the complete validation toolchain required by this repository.
Acceptance Criteria
- #1 The setup installs the pinned Backlog.md CLI and makes the backlog command available to cloud task agents
- #2 The setup prepares Go dependencies and every tool needed by the documented make gate without relying on automatic setup
- #3 The setup is safe to rerun in a cached Codex Cloud container and documents how to configure it
Definition of Done
- #1 make gate
- #2 go test -tags acceptance ./internal/app/ (only if a §9 acceptance seam changed)
Implementation Plan
-
Add an idempotent Codex Cloud setup script that persists PATH changes, installs the pinned Backlog.md CLI and IaC validators, and prefetches repository Go and Makefile-managed tooling.
-
Document the one-line manual setup configuration and validate reruns plus the full repository gate.
-
Rename the entry point to scripts/cloud-environment-setup.sh, add the required local-agent warning at the top, and document the same script for Codex Cloud and Claude Code cloud environments.
Implementation Notes
Validated the setup from a populated cached-container state: it completed successfully, reported Backlog.md 1.50.1, OpenTofu 1.10.6, TFLint 0.59.1, and Checkov 3.2.495, and persisted PATH entries in ~/.bashrc. The subsequent make gate passed.
Follow-up validation passed: bash -n scripts/cloud-environment-setup.sh, git diff –check, and make gate. The setup entry point was intentionally not executed because its new header instructs non-cloud agents not to run it.
Final Summary
Added and documented the idempotent Codex Cloud manual setup. It installs Backlog.md and the full gate toolchain, prefetches dependencies/assets for restricted-network agent execution, and was verified by rerunning the setup plus make gate.
Follow-up renamed the entry point to scripts/cloud-environment-setup.sh, added the required local-agent warning, made apt installation work both as Claude cloud root and as a sudo-capable Codex user, and documented configuration for both platforms.