Skip to content

[log] Add debug logging to CLI commands (trial, forecast, status)#31419

Merged
pelikhan merged 1 commit into
mainfrom
add-debug-logging-cli-commands-25dd979ffb4c1fea
May 11, 2026
Merged

[log] Add debug logging to CLI commands (trial, forecast, status)#31419
pelikhan merged 1 commit into
mainfrom
add-debug-logging-cli-commands-25dd979ffb4c1fea

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

Adds entry-point debug logging to several CLI commands and the Monte Carlo forecaster to improve troubleshooting visibility when DEBUG=cli:* is set.

Changes

  • pkg/cli/trial_command.go — Logs command invocation, engine validation failures, and trial options via the existing trialLog (cli:trial_command).
  • pkg/cli/forecast_command.go — Logs command invocation with all key flags via the existing forecastRunLog (cli:forecast_run).
  • pkg/cli/forecast_montecarlo.go — Adds a new forecastMonteCarloLog (cli:forecast_montecarlo) and logs Monte Carlo simulation entry/skip/completion with key statistics (observations, success rate, mean, stddev, P10/P50/P90, reliability).
  • pkg/cli/status.go — Logs command invocation with filter flags via the existing statusLog (cli:status_command).

All log arguments are side-effect free (only reading already-computed local variables) and follow the pkg:filename naming convention from AGENTS.md.

Why these files

These files were CLI command entry points with no debug logging despite their corresponding *Log variables already being declared in sibling files in the same package. The Monte Carlo simulator had no logger at all, making it hard to inspect simulation parameters when forecasts look surprising.

Test plan

  • make build succeeds
  • make test-unit passes
  • DEBUG=cli:* gh-aw status shows the status invocation log
  • DEBUG=cli:* gh-aw forecast shows forecast and Monte Carlo logs
  • DEBUG=cli:* gh-aw trial ... shows trial command logs

Note: Local validation was not possible in the workflow sandbox due to a Go toolchain mismatch (1.24 installed vs go.mod requiring 1.25.8 with GOTOOLCHAIN=local). CI will run the full validation suite.

Generated by Go Logger Enhancement · ● 83.9M ·

  • expires on May 13, 2026, 4:52 AM UTC

Adds entry-point debug logging to trial, forecast, and status commands,
plus simulation logging to the Monte Carlo forecaster, to improve
troubleshooting visibility when DEBUG=cli:* is set.

- pkg/cli/trial_command.go: log command invocation, engine validation
  failure, and trial options via the existing trialLog (cli:trial_command).
- pkg/cli/forecast_command.go: log command invocation via the existing
  forecastRunLog (cli:forecast_run).
- pkg/cli/forecast_montecarlo.go: add new forecastMonteCarloLog
  (cli:forecast_montecarlo) and log simulation entry/skip/completion
  with key statistics (mean, stddev, p10/p50/p90, reliability).
- pkg/cli/status.go: log command invocation via the existing statusLog
  (cli:status_command).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels May 11, 2026
@pelikhan pelikhan merged commit cebfa67 into main May 11, 2026
@pelikhan pelikhan deleted the add-debug-logging-cli-commands-25dd979ffb4c1fea branch May 11, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant