Ad Actum
Focused Review
Back to Ad Actum

Ad Actum War Room — Representative Report

A representative extract based on an internal codebase analysis. It shows the evidence, prioritization, and remediation scope a study can produce.

Ad Actum War Room

Representative Extract

Critical · Lifecycle failure
Executive synthesis

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. Project-owned records could survive reset, and running jobs could continue against deleted change requests.

Immediate recommendation

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.

Findings
Project reset and delete bypass canonical teardown

Both lifecycle paths duplicated cleanup instead of routing through CrTeardownService.remove(), so they skipped job cancellation, process kill, workspace cleanup, event emission, and unlinking.

Critical
apps/backend/src/projects/project-lifecycle.service.ts apps/backend/src/change-requests/cr-teardown.service.ts
Reset left project-owned data behind

The UI promised an initial-state reset, but Features, Ideas, Initiatives, CodeStudies, BusinessRules, and KnowledgeDocuments survived and polluted future planning runs.

High
apps/backend/src/projects/project-lifecycle.service.ts apps/backend/src/projects/project-cleanup.service.ts apps/frontend/src/components/ProjectApp.tsx
Running jobs and agent processes survived deletion paths

Bypassing teardown allowed BullMQ jobs and long-running agent processes to continue operating against deleted change requests on two user-facing flows.

High
apps/backend/src/projects/project-lifecycle.service.ts apps/backend/src/jobs/handlers/cleanup-jobs.handler.ts
Why this was prioritized

This approach replaces two hand-curated cleanup matrices with one canonical seam. A point fix on resetProject() alone would leave the same orphan and process-residue risk on the delete-project path.

Implementation scope
apps/backend/src/projects/projects.module.ts apps/backend/src/projects/project-lifecycle.service.ts apps/backend/src/projects/project.dto.ts apps/frontend/src/components/ProjectApp.tsx apps/backend/src/change-requests/cr-core.module.ts apps/backend/src/projects/project-reset.coverage.spec.ts
Related follow-up work
  1. Harden RuntimeSession/Event projectId ownership for orphan prevention
  2. Add CodeStudy {status, updatedAt} indexes for stuck-study scanning
  3. Add Spec dependency indexes for graph maintenance