feat(logging): build-config debug logging + task traceability #8

Open
claude wants to merge 8 commits from feature/debug-logging-traceability into main
Owner

Summary

Build-configuration-driven logging so debugging is rich locally while the installed app stays quiet.

  • New ClaudeDo.Logging library: BuildConfig.IsDebug (runtime DebuggableAttribute check, no #if DEBUG), DefaultTaskIdEnricher, and LoggingSetup.Configure (the single shared Serilog setup both processes call).
  • Debug builds (Rider run button): Debug level, console + file. Release builds (installed app): Warning level, file only.
  • Worker + App/Ui now write ONE shared rolling file ~/.todo-app/logs/claudedo-.log (retain 2), each line tagged with a Process and SourceContext. The App/Ui were previously log-silent.
  • TaskId correlation rides Serilog LogContext: pushed in TaskRunner.RunAsync/ContinueAsync (Worker) and in WorkerClient.InvokeForTaskAsync (UI). Grep one TaskId to follow a task UI -> Worker -> UI.
  • IWorkerClient / WorkerHub contracts unchanged; only the concrete WorkerClient ctor gained an ILogger param, so test fakes are unaffected.

Test plan

  • dotnet build App + Worker (Release): 0 errors
  • Worker.Tests: 419 pass (incl. 4 new logging tests)
  • Manual (visual-verification gap): run App + Worker from Rider (Debug), confirm both log to one claudedo-*.log + console; run a task and confirm UI and Worker lines share the same [TaskId]
  • Manual: install Release build, confirm log is Warning+ only and no console output

Review notes (non-blocking)

  • BuildConfig.IsDebug uses GetEntryAssembly(), which is null under the test host -> the BuildConfigTests assertion is effectively a tautology. This is correct for production (entry assembly = the App/Worker exe) and the spec already accepted that the branch can't be flipped within one test run.
  • InvokeForTaskAsync's LogContext scope currently only decorates the single debug trace line; kept as a forward-looking hook for future UI log lines on that path.

See docs/superpowers/specs/2026-06-04-debug-logging-traceability-design.md and the matching plan in docs/superpowers/plans/.

🤖 Generated with Claude Code

## Summary Build-configuration-driven logging so debugging is rich locally while the installed app stays quiet. - New `ClaudeDo.Logging` library: `BuildConfig.IsDebug` (runtime `DebuggableAttribute` check, no `#if DEBUG`), `DefaultTaskIdEnricher`, and `LoggingSetup.Configure` (the single shared Serilog setup both processes call). - **Debug builds** (Rider run button): `Debug` level, console + file. **Release builds** (installed app): `Warning` level, file only. - Worker + App/Ui now write ONE shared rolling file `~/.todo-app/logs/claudedo-.log` (retain 2), each line tagged with a `Process` and `SourceContext`. The App/Ui were previously log-silent. - `TaskId` correlation rides Serilog `LogContext`: pushed in `TaskRunner.RunAsync`/`ContinueAsync` (Worker) and in `WorkerClient.InvokeForTaskAsync` (UI). Grep one TaskId to follow a task UI -> Worker -> UI. - `IWorkerClient` / `WorkerHub` contracts unchanged; only the concrete `WorkerClient` ctor gained an `ILogger` param, so test fakes are unaffected. ## Test plan - [x] `dotnet build` App + Worker (Release): 0 errors - [x] Worker.Tests: 419 pass (incl. 4 new logging tests) - [ ] **Manual (visual-verification gap):** run App + Worker from Rider (Debug), confirm both log to one `claudedo-*.log` + console; run a task and confirm UI and Worker lines share the same `[TaskId]` - [ ] **Manual:** install Release build, confirm log is `Warning`+ only and no console output ## Review notes (non-blocking) - `BuildConfig.IsDebug` uses `GetEntryAssembly()`, which is null under the test host -> the `BuildConfigTests` assertion is effectively a tautology. This is correct for production (entry assembly = the App/Worker exe) and the spec already accepted that the branch can't be flipped within one test run. - `InvokeForTaskAsync`'s `LogContext` scope currently only decorates the single debug trace line; kept as a forward-looking hook for future UI log lines on that path. See `docs/superpowers/specs/2026-06-04-debug-logging-traceability-design.md` and the matching plan in `docs/superpowers/plans/`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude added 8 commits 2026-06-04 17:27:45 +00:00
This pull request has changes conflicting with the target branch.
  • src/ClaudeDo.Ui/Services/WorkerClient.cs
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/debug-logging-traceability:feature/debug-logging-traceability
git checkout feature/debug-logging-traceability
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: releases/ClaudeDo#8