4.1 KiB
4.1 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |||
|---|---|---|---|---|---|---|---|---|---|
| 09-remove-legacy-diagnostics | Remove legacy diagnostics | completed | 6 |
|
plan.md | ../../specs/platform/requirements/diagnostic-logging.md |
Task 09: Remove legacy diagnostics
Acceptance
- Backend logging no longer allocates or writes the process-wide structured ring buffer, and no product path imports it.
- System Logs list/tail/individual-download APIs and their frontend hooks/state/components are removed after the bundle UI has replaced them.
- Dev-only
/api/v1/system/debug/exportis removed; runtime metadata comes from bundle manifests. - Improve Kandev creates an authenticated all-sources browser job. Its owner-verified lease endpoint copies the ready/partial ZIP for 24 hours and gives the agent that path instead of separate snapshots; bootstrap never waits for frontend collection.
- Bootstrap writes a server-owned identity marker; lease authorization checks that marker and bundle ownership rather than trusting the submitted temp path.
scripts/kandev-logsno longer calls debug export or tails the isolated stderr convention; the focused agent-guidance task can finalize its UX on the source-selectable bundle API.
Verification
cd apps/backend
go test ./internal/common/logger ./internal/debug ./internal/improvekandev ./internal/system/...
cd apps
pnpm --filter @kandev/web test -- \
components/improve-kandev-dialog-helpers.test.ts \
lib/api/domains/improve-kandev-api.test.ts \
lib/state/slices/system/system-slice.test.ts
rg -n "buffer\\.Default|BufferSnapshot|debug/export|logs/tail|buildLogDownloadUrl|useLogTail" \
apps/backend apps/web scripts
Files likely touched
apps/backend/internal/common/logger/logger.goapps/backend/internal/common/logger/logger_test.goapps/backend/internal/common/logger/buffer/apps/backend/internal/debug/export.goapps/backend/internal/debug/export_test.goapps/backend/internal/system/logs/apps/backend/internal/system/system.goapps/backend/internal/backendapp/helpers.goapps/backend/internal/improvekandev/bundle.goapps/backend/internal/improvekandev/handler.goapps/backend/internal/improvekandev/*_test.goapps/web/hooks/domains/system/use-log-files.tsapps/web/hooks/domains/system/use-log-tail.tsapps/web/lib/state/slices/system/apps/web/components/improve-kandev-dialog-helpers.tsapps/web/components/improve-kandev-dialog-create.tsxapps/web/lib/api/domains/improve-kandev-api.tsscripts/kandev-logs
Dependencies
- Task 07 supplies the shared bundle service and manifest metadata.
- Task 08 replaces the Logs page and supplies browser capture.
- Task 10 establishes the replacement authenticated agent workflow before the debug export disappears.
Parallelism
Sequential. It removes compatibility paths only after all consumers have migrated.
Inputs
- Spec: Agent diagnostics, legacy route removal, Improve Kandev reuse, and out-of-scope viewer/query behavior.
- Plan: Legacy-path removal and Improve Kandev migration.
- Existing patterns: logger buffer core, debug export, System Logs service/hooks/store, and Improve Kandev temp bundle.
Risks
- Removal spans Go and TypeScript consumers; source scans must distinguish unrelated ring buffers used by agents, terminals, or plugins.
- The new
internal/system/frontenderrorspackage is explicitly retained while the legacyinternal/system/logslist/tail/download package is removed. - Improve Kandev agents need a readable ZIP path and updated instructions to extract it before diagnosis.
- The 24-hour Improve Kandev task-context lease must not weaken the public bundle API's 15-minute expiry or leak files beyond its existing cleanup window.
Output contract
Report removed APIs/buffer consumers, Improve Kandev migration and expiry
behavior, files changed, exact tests/source scans, blockers/risks, and update
this task plus plan.md status in the same conversation.