Exclude intentional credit-guardrail tests from prod-main health rollups#47263
Conversation
- Add intentional-failure: true to daily-credit-limit-test.md and daily-max-ai-credits-test.md - Add intentional-failure field to main_workflow_schema.json - Add IsIntentionalFailure() helper in pkg/workflow/resolve.go - Add IntentionalFailure field to RunData and IntentionalFailureRuns to LogsSummary - Exclude intentional-failure workflows from CalculateHealthSummary rollup counts - Update audit-workflows.md and deep-report.md to exclude these workflows from success-rate rollups - Recompile both affected workflows - Add unit tests for IsIntentionalFailure and CalculateHealthSummaryExcludesIntentionalFailure Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| "description": "Mark the workflow as private, preventing it from being added to other repositories via 'gh aw add'. A workflow with private: true is not meant to be shared outside its repository.", | ||
| "examples": [true, false] | ||
| }, | ||
| "intentional-failure": { |
There was a problem hiding this comment.
@copilot move to features.intentional-failure in the front matter
There was a problem hiding this comment.
Done in the latest commit. Moved intentional-failure: true under the features: block in both workflow files, updated IsIntentionalFailure in resolve.go to read features["intentional-failure"], updated the test fixture, and moved the schema definition from a top-level property into the documented features.properties object.
There was a problem hiding this comment.
Pull request overview
Adds an intentional-failure marker so expected guardrail failures can be excluded from fleet-health rollups.
Changes:
- Registers and detects the new frontmatter marker.
- Propagates exclusion metadata through logs and health summaries.
- Updates audit prompts, guardrail workflows, generated locks, and tests.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/resolve.go |
Detects intentional-failure frontmatter. |
pkg/workflow/resolve_test.go |
Tests marker detection. |
pkg/parser/schemas/main_workflow_schema.json |
Registers the marker. |
pkg/cli/logs_report.go |
Adds run and summary metadata. |
pkg/cli/health_metrics.go |
Excludes marked workflows from counts. |
pkg/cli/health_metrics_test.go |
Tests health exclusion. |
pkg/cli/health_command.go |
Propagates marker into health data. |
.github/workflows/deep-report.md |
Adds adjusted-rate instructions. |
.github/workflows/deep-report.lock.yml |
Updates generated metadata. |
.github/workflows/daily-max-ai-credits-test.md |
Marks expected failure. |
.github/workflows/daily-max-ai-credits-test.lock.yml |
Updates generated metadata. |
.github/workflows/daily-credit-limit-test.md |
Marks expected failure. |
.github/workflows/daily-credit-limit-test.lock.yml |
Updates generated metadata. |
.github/workflows/audit-workflows.md |
Adds rollup exclusion instructions. |
.github/workflows/audit-workflows.lock.yml |
Updates generated metadata. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 15/15 changed files
- Comments generated: 3
- Review effort level: Medium
| mdPath = filepath.Join(constants.GetWorkflowDir(), normalizedName+".md") | ||
| } | ||
|
|
||
| content, err := os.ReadFile(mdPath) |
There was a problem hiding this comment.
Fixed in c9e9350. health_command.go now skips IsIntentionalFailure entirely when config.RepoOverride != "" (remote repo). logs_report.go (buildLogsData) calls GetCurrentRepoSlug() once before the loop and skips classification when the run's Repository field is set and differs from the local slug — failing open in both cases.
| runData.IntentionalFailure = workflow.IsIntentionalFailure(runData.WorkflowPath) | ||
| if runData.IntentionalFailure { | ||
| intentionalFailureRuns++ |
There was a problem hiding this comment.
Added TestBuildLogsDataIntentionalFailure in logs_report_test.go (c9e9350). It sets up a temp workflow dir with a features.intentional-failure: true fixture, runs buildLogsData with one marked and one unmarked run, and asserts runs[].intentional_failure and summary.intentional_failure_runs.
| if wh.IntentionalFailure { | ||
| // Exclude from rollup counts — these workflows are expected to fail. | ||
| continue | ||
| } |
There was a problem hiding this comment.
Fixed in c9e9350. The success branch now reads "All evaluated workflows above %.0f%% success threshold" to make clear that intentional-failure workflows are excluded from the count.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main and recompile |
|
@copilot please run the This branch is not cleanly mergeable yet (
|
…xclude-intentional-tests # Conflicts: # pkg/cli/health_metrics.go # pkg/cli/logs_report.go Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done. Merged |
…fix misleading summary text Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Done. Addressed remaining review feedback in c9e9350:
All 260 workflows compile cleanly and unit tests pass locally. |
Daily Credit Limit TestandDaily Max AI Credits Testare guardrail stress tests designed to fail, depressing the fleet-wide success rate by ~1.5pts daily (92.7% raw → 94.2% actual).Frontmatter marker
Added
intentional-failure: trueto both workflow files and registered the field inmain_workflow_schema.json. This is the canonical opt-out signal.Go — detection & propagation
pkg/workflow/resolve.go—IsIntentionalFailure(workflowPath): reads local markdown frontmatter for the marker. Fails open (returnsfalse) when the file isn't available locally.pkg/cli/logs_report.go—RunData.IntentionalFailure boolpopulated per run;LogsSummary.IntentionalFailureRuns intaggregated. Agents consuming thelogsMCP output can now filter withruns[].intentional_failure/summary.intentional_failure_runs.pkg/cli/health_metrics.go—WorkflowHealth.IntentionalFailure bool;CalculateHealthSummaryskips these workflows when computingHealthyWorkflowsandBelowThresholdrollup counts (they still appear in the per-workflow table).pkg/cli/health_command.go—displayHealthSummarypopulatesIntentionalFailureper workflow from the first run'sWorkflowPath.Workflow prompt instructions
audit-workflows.mdanddeep-report.mdboth gain an explicit section instructing agents to excludeintentional_failureruns from fleet success-rate rollups and to report the adjusted rate alongside the raw one (e.g."92.7% raw (94.2% excl. intentional failures)").Tests
TestIsIntentionalFailure— covers.lock.ymlpath,.mdpath, bare ID, normal workflow (false), missing file (fail-open), empty input.TestCalculateHealthSummaryExcludesIntentionalFailure— verifies the two guardrail workflows don't affectHealthyWorkflows/BelowThresholdwhile still appearing inTotalWorkflowsand theWorkflowsslice.