Repository navigation
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
logs --json
|
@copilot Fix failing checks |
The earlier rollout failure is fixed by the main merge ( |
|
Hey @mnkiefer 👋 — thanks for tackling this important distinction! The PR looks ready for review. You've done a great job: ✓ Clear focus — the diff consolidates changes to JSON schema, caching, output formatting, and tests all around one concept (unavailable vs. measured zero AIC). This looks solid. Ready for team review.
|
There was a problem hiding this comment.
🟡 Changes recommended
Coupling lifecycle-ledger versions to the run-cache schema causes readers to reject retained v7 or newly written v8 ledgers, breaking delivery/adoption collection and retained operational-value reporting.
4 open issues
What changed in this PR
Updates gh aw logs to distinguish unavailable AI-credit evidence from measured zero, addressing #79253 across JSON output, caches, and display formats.
Changes:
- Makes run and summary AIC values nullable and adds summary coverage metadata.
- Preserves AIC availability in caches and adapts episode, TSV, and compact output.
- Updates schemas, regression tests, MCP tool help, and cost-management documentation.
| File | Description |
|---|---|
schemas/logs.schema.json |
Defines nullable AIC fields and required summary coverage. |
schemas/logs-jsonl.schema.json |
Updates nullable run AIC and schema version 8. |
pkg/cli/mcp_tools_privileged.go |
Clarifies null AIC and coverage in tool help. |
pkg/cli/logs_report.go |
Tracks observed AIC and calculates aggregate coverage. |
pkg/cli/logs_report_test.go |
Tests missing, zero, positive, and cached AIC values. |
pkg/cli/logs_models.go |
Adds persisted AIC availability to run summaries. |
pkg/cli/logs_format_tsv.go |
Displays unavailable AIC as -. |
pkg/cli/logs_format_tsv_test.go |
Tests unavailable and measured TSV values. |
pkg/cli/logs_format_compact.go |
Handles nullable totals and marks partial coverage. |
pkg/cli/logs_format_compact_test.go |
Tests compact AIC values and coverage labels. |
pkg/cli/logs_episode_view.go |
Labels unavailable run cost in episode views. |
pkg/cli/logs_episode_test.go |
Adapts episode fixtures to nullable AIC. |
pkg/cli/logs_episode_rollup.go |
Skips unavailable AIC during episode aggregation. |
pkg/cli/logs_episode_retrieval_test.go |
Checks nullable totals and available coverage. |
pkg/cli/logs_episode_lineage_test.go |
Adapts lineage fixtures to nullable AIC. |
pkg/cli/logs_episode_hops.go |
Makes episode run-cost AIC nullable. |
pkg/cli/logs_episode_hops_test.go |
Tests nullable run costs and unavailable-cost rendering. |
pkg/cli/logs_episode_coverage_test.go |
Adapts coverage fixtures to nullable AIC. |
pkg/cli/logs_cached_json.go |
Bumps the cached JSONL schema version. |
pkg/cli/logs_cached_json_test.go |
Tests AIC cache preservation and updates version fixtures. |
pkg/cli/logs_cache.go |
Saves and restores the AIC availability flag. |
docs/src/content/docs/reference/cost-management.md |
Explains null semantics, coverage, and missing-cost counts. |
Review effort: Max (adaptive)
| type cachedLogsRuns map[int64]cachedLogsJSONLRunData | ||
|
|
||
| const cachedLogsJSONLSchemaVersion = 7 | ||
| const cachedLogsJSONLSchemaVersion = 8 |
| TotalAIC *float64 `json:"total_aic" console:"header:Total AIC"` | ||
| // AICCoverage is "available" when every run has observed AI credits, "partial" | ||
| // when only some runs do, and "unavailable" when none do. | ||
| AICCoverage string `json:"aic_coverage" console:"header:AIC Coverage"` |
| TokenUsage int `json:"token_usage" console:"header:Tokens,format:number,omitempty"` | ||
| // AIC is the run's observed AI credits. It is always emitted: null means cost | ||
| // evidence is unavailable (for example, no usage artifact), while 0 is a measured zero. | ||
| AIC *float64 `json:"aic"` |
| TokenUsage int `json:"token_usage" console:"header:Tokens,format:number,omitempty"` | ||
| // AIC is the run's observed AI credits. It is always emitted: null means cost | ||
| // evidence is unavailable (for example, no usage artifact), while 0 is a measured zero. | ||
| AIC *float64 `json:"aic"` |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "15b338e8dba5fd7015d69feded7124a9b0ec573e",
"kind": "requested",
"schema_version": "1",
"state": "1000d2dbd8c99f6768c4d55aebd97ac607042b9d857d03ae76aae9cb7d0793f1",
"work": [
"23027a7a3ebe972cffc3eabad4a22e44dac70312f0e8b312d61f867187f7f01d",
"42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac",
"526701581f32f211b30387aa941f7a6a514327e3ea3a9c5e5e15a5980ed93110",
"5688aa5f7ddadb7b8282331e8fd0a6dee900a09111561c77b45b4d1d60d6184a",
"7925451dea9b230345e1e8331f85d3467e9b4b27f0df1e3ac71216d08b94b58a",
"bc190b1bdb7008fdc0dee50ab31fb2b425378feb85a48e8df0afe8e090ce38f4"
],
"workflow": "pr-sous-chef"
}
|
…cost-issue Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
No longer needed |



runs[].aicwas always written as a number, so0meant either "the run cost nothing" or "there was no usage data".summary.total_aicusedomitempty, so a missing total and a zero total looked the same. As a result, summingruns[].aicunderstated cost whenever some runs had no usage artifact.Changes
logs_report.go)RunData.AICis now*float64. It holds a value only when the run reported AI credits (AICFound), or for older cached data whereTotalAIC > 0. A reported zero stays0; anything else isnull.LogsSummary.TotalAICis now*float64withoutomitempty. It adds up only runs that have a value, and isnullwhen none do.summary.aic_coveragefield:availablewhen every run has a value.partialwhen only some do.unavailablewhen none do, or when there are no runs.logs_cache.go,logs_models.go)TokenUsageSummary.AICFoundis taggedjson:"-", so the flag was lost whenrun_summary.jsonwas saved. It is now stored asRunSummary.TokenUsageAICFound(token_usage_aic_found) and restored on load.TotalAIC > 0rule.schema_versiongoes from 7 to 8.logs.schema.jsonandlogs-jsonl.schema.json:aicandtotal_aicare now["null","number"], andtotal_aicandaic_coverageare required.EpisodeRunCost.AICis now*float64. Rollups skipnilvalues, and the view shows "AI credits unavailable".-for a missing value.nil, shows-for each run without a value, and addsaic_coverage=partialwhen the total is incomplete.logstool description now explains thenullvalue and the coverage field.cost-management.mdexplainsnullaicandaic_coverage, and its jq example now reportsruns_without_aic.Review notes
.aicmust handlenull.summary.aic_coveragetells consumers whethertotal_aicis complete.EpisodeData.TotalAICstaysfloat64,omitempty, and the audit schema version is unchanged.