Repository navigation
feat(experiments): add outcome-backed metrics with adaptive maturity windows - #74992
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…kflow churn Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot apply #74988 (comment) |
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
This comment has been minimized.
This comment has been minimized.
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Review completed with two actionable correctness/compatibility findings.
Highlights
- Outcome-backed
secondary_metricsare accepted by validation but omitted from outcome collection/analysis. - Requiring
zero_touch_evidence_completein persisted log schemas breaks validation of historical records that predate this field.
The specialist pass was unavailable because its environment could not read the pre-fetched diff; findings above are from the independent source review. No tests were run per the static-review constraints.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (1,029 new lines in 📄 Draft ADR committed:
Key decision captured: add 📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and check that the implementation matches the decision. ❓ Why ADRs Matter
ADRs keep a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
There was a problem hiding this comment.
🟡 Changes recommended
Unvalidated artifact-derived hosts can expose enterprise tokens, a contradictory test expectation fails deterministically, and automatic censor-aware maturity windows are missing.
3 open issues
What changed in this PR
Adds live GitHub outcome metrics to gh aw experiments analyze, extending experiment measurements beyond grader and eval results toward the goals of #74988.
Changes:
- Adds outcome metric validation and configurable maturity durations.
- Collects per-run outcomes, tracks evidence completeness and coverage, and reuses existing statistical analysis.
- Updates schemas, focused tests, documentation, and experiment-proposer guidance.
| File | Description |
|---|---|
schemas/logs.schema.json |
Adds zero-touch evidence completeness to log reports. |
schemas/logs-jsonl.schema.json |
Adds evidence completeness to JSONL records. |
schemas/audit.schema.json |
Adds evidence completeness to audit outcomes. |
pkg/workflow/frontmatter_types.go |
Adds experiment maturity-window configuration. |
pkg/workflow/compiler_experiments.go |
Validates outcome references and durations. |
pkg/workflow/compiler_experiments_outcome_test.go |
Tests outcome compiler validation. |
pkg/parser/schemas/main_workflow_schema.json |
Defines outcome-window schema and metric descriptions. |
pkg/parser/schema_experiments_outcome_test.go |
Tests outcome frontmatter schema validation. |
pkg/cli/outcomes_episodes.go |
Includes evidence completeness in observation equality. |
pkg/cli/outcomes_episodes_test.go |
Tests conflicting evidence-completeness values. |
pkg/cli/outcome_eval.go |
Adds the evidence-completeness report field. |
pkg/cli/outcome_eval_pr.go |
Separates incomplete evidence from human intervention. |
pkg/cli/outcome_eval_jsonl.go |
Serializes evidence completeness. |
pkg/cli/outcome_eval_jsonl_test.go |
Extends round-trip fixtures with completeness values. |
pkg/cli/experiments_outcome_observations.go |
Collects, scores, and reports outcome observations. |
pkg/cli/experiments_outcome_observations_test.go |
Tests scoring, maturity, collection, and coverage. |
pkg/cli/experiments_grader_statistics.go |
Handles outcome sets without observations. |
pkg/cli/experiments_grader_observations.go |
Adds outcome coverage to shared observation sets. |
pkg/cli/experiments_command.go |
Merges outcome observations into experiment analysis. |
pkg/cli/experiments_analyze_statistics.go |
Exposes primary and guardrail outcome coverage. |
docs/src/content/docs/experimental/experiments.md |
Documents outcome metric usage and interpretation. |
docs/src/content/docs/experimental/experiments-specification.md |
Specifies outcome validation and analysis semantics. |
.github/workflows/daily-harness-experiment-proposer.md |
Allows outcome metrics in experiment proposals. |
.github/workflows/daily-harness-experiment-proposer.lock.yml |
Refreshes compiled workflow body hashes. |
Review effort: Balanced (auto)
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd, /codebase-design and /diagnosing-bugs. Requesting changes because the focused outcome tests fail on the PR head.
📋 Key Themes & Highlights
Key Themes
- Failing test on head:
TestOutcomeMetricRunValue/non_PR_acceptance_has_unknown_zero_touch_evidenceexpectsUnavailable: 1, but the code correctly keeps resolved non-PR outputs in the denominator at zero. The spec agrees with the code. Fix the expectation, see the inline comment. - Implicit per-run coverage flags:
Unavailable/StalePendingare set with=, which is correct but undocumented. A one-line comment would help. - Empty-set metric type:
graderObservationMetricTypereturnsbinaryfor coverage-only sets with no observations. Unverified impact, needs a test.
Positive Highlights
- ✅ Zero-touch excludes incomplete PR evidence rather than scoring zero, matching the spec
- ✅ Outcome reference parsing and validation have focused tests, and
pkg/workflowandpkg/parserpass - ✅ Shared API cache and per-run download pool keep primary and guardrail collection to one pass
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: c5dba44
|
Assignment in progress: merge the latest Sous-chef requested-head: c5dba44 |
…upport-outcome-backed-metrics Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…rics Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Require --outcome before collecting outcome-backed primary, secondary, or guardrail metrics. Explain the additional API requests in CLI help and documentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Correct Kaplan-Meier p95 rounding and strengthen regression coverage for trusted outcome hosts and historical schema compatibility. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🎉 This pull request is included in a new release. Release: |


Summary
Adds outcome-backed experiment metrics so
gh aw experiments analyze <workflow> --outcomecan compare real GitHub acceptance and human-intervention outcomes without declaring a grader or eval, or adding a scheduled collector.outcome:acceptedandoutcome:zero_touchas primary, secondary, and guardrail metrics, with compiler/schema validation.--outcomebecause it downloads artifacts and makes additional GitHub API requests. Without the flag, an outcome-backed metric produces an actionable error before collecting metric evidence; workflows without outcome metrics retain their existing behavior.outcome_window: auto(the default), learning a pooled 95th-percentile decision time across variants using Kaplan–Meier censoring for still-open outputs. The learned window is bounded to 24 hours–30 days, with a72hcold-start fallback until 20 outputs have known decision times. A positive Go duration provides an explicit override.proportion_testandbayesian_abrequire binary observations.Measurement semantics
Only runs at least the effective maturity window contribute observations. Each run contributes one value: accepted or zero-touch outputs divided by resolved outputs. Pending outputs beyond the window score zero; unknown/errored outcomes are excluded. Lifecycle, ignored, and skipped outputs do not contribute, and runs without outcome-bearing outputs are no-ops rather than successes. Only usable run observations count toward
min_samples.Zero-touch requires a merged PR with no non-bot comments, reviews, or commits after creation. Accepted PRs with incomplete zero-touch evidence are excluded from that metric; other resolved output types remain in its denominator and score zero. Evidence completeness is propagated through outcome reports and JSON schemas, and outcome evaluation rejects repository hosts that do not match the workflow run host.
Coverage distinguishes
immature,stale_pending,unavailable, andno_opruns. These are per-run flags: a partially observed run may contribute a measurement and also count as stale pending or unavailable.Validation status
Merged the refreshed
origin/main(33 incoming commits), resolving the sole conflict by regenerating the proposer workflow lock file. The merge and opt-in changes are committed and pushed.pkg/cli,pkg/parser, andpkg/workflowpassed using a nonsymlink temporary directory. The initial run hit an unrelated macOS/varsymlink restriction in a Harbor export test.outcome:accepted,outcome:zero_touch) #74988