Both lifecycle paths duplicated cleanup instead of routing through CrTeardownService.remove(), so they skipped job cancellation, process kill, workspace cleanup, event emission, and unlinking.
Ad Actum War Room — Ejemplo Real Redactado
Extraído de una ejecución real de Ad Actum War Room contra un monorepo privado. La identidad del repo está redactada; el hallazgo, la urgencia y el alcance de remediación son reales.
Extracto Real Redactado
Both resetProject() and purgeProject() bypassed the canonical teardown seam, duplicating ad-hoc cleanup that skipped job cancellation, agent process termination, workspace cleanup, event emission, and CodeStudy unlinking. That left 19 entity types orphaned after reset, let running jobs operate against deleted change requests, and preserved stale project cost data on two user-facing paths.
Consolidate project lifecycle cleanup through canonical CR teardown: route both resetProject() and purgeProject() through CrTeardownService.remove(), then run one project-scoped sweep for the remaining project-owned data.
The UI promised an initial-state reset, but Features, Ideas, Initiatives, CodeStudies, BusinessRules, and KnowledgeDocuments survived and polluted future planning runs.
Bypassing teardown allowed BullMQ jobs and long-running agent processes to continue operating against deleted change requests on two live user-facing flows.
This was the highest-leverage fix because it replaced two hand-curated cleanup matrices with one canonical seam. A point fix on resetProject() alone would have left the same orphan and process-residue bug alive on the delete-project path.
- Harden RuntimeSession/Event projectId ownership for orphan prevention
- Add CodeStudy {status, updatedAt} indexes for stuck-study scanning
- Add Spec dependency indexes for graph maintenance