[log] Add debug logging to CLI commands (trial, forecast, status)#31419
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 existingtrialLog(cli:trial_command).pkg/cli/forecast_command.go— Logs command invocation with all key flags via the existingforecastRunLog(cli:forecast_run).pkg/cli/forecast_montecarlo.go— Adds a newforecastMonteCarloLog(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 existingstatusLog(cli:status_command).All log arguments are side-effect free (only reading already-computed local variables) and follow the
pkg:filenamenaming convention fromAGENTS.md.Why these files
These files were CLI command entry points with no debug logging despite their corresponding
*Logvariables 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 buildsucceedsmake test-unitpassesDEBUG=cli:* gh-aw statusshows the status invocation logDEBUG=cli:* gh-aw forecastshows forecast and Monte Carlo logsDEBUG=cli:* gh-aw trial ...shows trial command logsNote: Local validation was not possible in the workflow sandbox due to a Go toolchain mismatch (1.24 installed vs
go.modrequiring 1.25.8 withGOTOOLCHAIN=local). CI will run the full validation suite.