|
| 1 | +# Seed prompt — SimpleAudit Studio agent-safe lifecycle verification |
| 2 | + |
| 3 | +You are the lead coding and verification agent for `SimulaMet/SimpleAuditStudio`. |
| 4 | +Read `AGENTS.md`, then examine the current `main` branch and the attached |
| 5 | +`simpleaudit_agent_safe_lifecycle.patch`. My ChatGPT session could read the |
| 6 | +repo but its GitHub connector returned **HTTP 403 on branch creation**, so |
| 7 | +this patch has NOT been pushed. You must use your own authenticated Git checkout |
| 8 | +and push a feature branch. |
| 9 | + |
| 10 | +## Task |
| 11 | + |
| 12 | +1. Create/switch to `feat/agent-safe-dev-lifecycle` from current `main` (do not |
| 13 | + overwrite another person's work). Run `git apply --check |
| 14 | + simpleaudit_agent_safe_lifecycle.patch`, review the changes, then apply the |
| 15 | + patch. If `main` advanced and the patch needs adjustment, reconcile it |
| 16 | + carefully; do not force-apply or overwrite unrelated changes. |
| 17 | +2. Review and correct the implementation thoroughly, not just the unit tests. |
| 18 | + Keep both CLI surfaces minimal and consistent: |
| 19 | + `dev|spin [status|down|restart|reset|uninstall|help|agent-info]`. |
| 20 | + Preserve existing startup options. `agent-info` must work without starting |
| 21 | + Django, migrating a database, or claiming a port. `dev`/`spin` called twice |
| 22 | + must reuse the existing instance instead of restarting/killing it. |
| 23 | +3. Worktrees must isolate Caddy's public port, Django internal port, Open WebUI |
| 24 | + port/data/managed venv, embedded Hatchet state, Django database, and optional |
| 25 | + pipelines. Do not silently connect different branches to one SQLite file. |
| 26 | + Verify one normal checkout plus TWO Git worktrees can run concurrently. |
| 27 | +4. Validate all lifecycle transitions and recovery paths (normal exit, |
| 28 | + repeated start, SIGTERM, PID reuse, child crash, stale pid files, port |
| 29 | + takeover, same-port race, incompatible migrations, restarts). No command may |
| 30 | + kill an unrelated process or another worktree. Rewrite `devctl.sh` cleanly |
| 31 | + to remove all dead legacy kill-by-port code; do not merely bypass it. |
| 32 | +5. Reload model: confirm Django Python autoreload and template refresh. The |
| 33 | + initial patch **does not implement worker-only hot reload**: `dev_server` |
| 34 | + currently runs Hatchet worker in the owning parent. Implement isolated |
| 35 | + worker reload only if it is safe with the SDK's embedded handshake and |
| 36 | + running audits, else explicitly report the limitation and propose a |
| 37 | + separate phase. Never promise independent worker restart while killing the |
| 38 | + entire stack instead. |
| 39 | +6. For `reset` and `uninstall`, test only with throwaway state/data and mock |
| 40 | + uv executables. Confirm custom data locations, external DBs, symlinks, |
| 41 | + unrelated tools, shared caches and source trees cannot be deleted. |
| 42 | + `uninstall` should clean only Studio-related uv wheel cache when no other |
| 43 | + Studio instance needs it. Document that uvx temporary environments may |
| 44 | + survive package-specific `uv cache clean`. |
| 45 | +7. Run formatting, `uv run ruff check .`, targeted lifecycle tests, existing |
| 46 | + relevant CLI tests, `uv run pytest -m 'not embedded_hatchet'`, and serial |
| 47 | + embedded-Hatchet tests where practical. Actually start full stack locally |
| 48 | + with no real commercial model API calls; inspect health and browser pages. |
| 49 | + Test `spin` as an installed wheel/uvx entry point, not only `dev`. |
| 50 | +8. Update README, `AGENTS.md`, and developer lifecycle docs. Ensure every |
| 51 | + new command has useful `help`, human-readable errors, and --yes only for |
| 52 | + authorized destructive operations. |
| 53 | +9. Commit the verified changes on `feat/agent-safe-dev-lifecycle`, push to |
| 54 | + `origin`, and provide the branch URL and concise test results. Do NOT merge. |
| 55 | + |
| 56 | +## Mandatory safety checks |
| 57 | + |
| 58 | +- Never use `pkill`, broad process-name matches, `kill -9`, or global |
| 59 | + `uv cache clean` to resolve conflicts. |
| 60 | +- Never reset/uninstall real development, remote, shared, or production data. |
| 61 | + Use isolated temporary HOME / XDG_STATE_HOME and a throwaway checkout. |
| 62 | +- Never run migrations automatically against shared PostgreSQL from parallel |
| 63 | + branches. Confirm mode/environment before starting Django. |
| 64 | +- Do not pass worker reload as finished unless demonstrated with active jobs. |
| 65 | +- Show exact owner PID, worktree identity, ports, and data directory in status. |
| 66 | +- A failed integration test must block the push or be clearly labeled as |
| 67 | + unresolved if it is environmental; do not claim success based on stubs. |
| 68 | + |
| 69 | +## Deliverable |
| 70 | + |
| 71 | +A pushed feature branch with code, tests, user documentation, and a concise |
| 72 | +report separating verified behavior from still-unimplemented capabilities. |
0 commit comments