The Restart That Ate the Refactor: A Cold-Start Postmortem for Coding Agents
说明与用途
冷启动检查脚本防止服务器重启后删除生成文件,确保 CI 稳定性。
问题
A coding agent deleted a generated artifact after a server restart, causing a CI failure because the artifact was not persisted in the repository.
结果
The cold‑start check prevented silent deletion of generated artifacts, ensuring CI stability on transient servers.
工作流
- 1. Create an artifact manifest (.agent/artifacts.json) listing required generated files and a regenerate command.
- 2. Add a preflight script (cold_start_check.sh) that: a) ensures the repo is clean, b) verifies each listed artifact exists, c) runs the build with a clean output directory.
- 3. Instruct the agent to run the cold‑start check before reporting task completion, and to regenerate artifacts if the check fails.
- 4. Run the cold‑start check on every server restart to catch persistence issues early.
证据
First, reproduce from a pristine tree before blaming the agent, because a dirty workspace can mask any number of environment sins.
Here is the cold-start check I now run before any agent task, together with a small manifest that declares which artifacts must exist.
- 记录日期: 2026-09-09T03:00:15.440Z