Skip to content

Tiered validation: fast gate for intermediate saves, tests only on final push#46927

Merged
pelikhan merged 3 commits into
mainfrom
copilot/copilot-opt-eliminate-late-validation-failures
Jul 21, 2026
Merged

Tiered validation: fast gate for intermediate saves, tests only on final push#46927
pelikhan merged 3 commits into
mainfrom
copilot/copilot-opt-eliminate-late-validation-failures

Conversation

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

make agent-report-progress includes test-unit (120–233s) and was run before every report_progress call per AGENTS.md rule 2. Multiple saves per session meant redundant full test runs, wasting hundreds of seconds late in the session where failures are costliest.

Changes

Makefile

  • New agent-report-progress-no-test target: build + fmt + lint + workflow-drift, no test-unit (~30s)
  • agent-report-progress retains test-unit; updated comment to mark it as the final-push gate

AGENTS.md — rule 2 split into two:

  • Intermediate saves → make agent-report-progress-no-test
  • Final push → make agent-report-progress (with test-unit, once)

.github/skills/developer/SKILL.md — validation checkpoints rewritten as a tiered sequence:

1. After each edit        → make build && make fmt          (catch compile errors immediately)
2. Intermediate saves     → make agent-report-progress-no-test   (<30s, no tests)
3. Final report_progress  → make agent-report-progress           (test-unit, once)
4. Final handoff          → make agent-finish

Adds callouts for the key rule (run test-unit once, before the final push only) and a timeout-budget note pointing to make test-impacted-go as a scoped fallback when test-unit runs long.

…y on final push

- Add `agent-report-progress-no-test` Makefile target: same as
  `agent-report-progress` but skips test-unit (~30s vs 120s+)
- Update AGENTS.md rule 2: use fast gate for intermediate report_progress
  calls; run full gate (with test-unit) only before the final push
- Update developer SKILL.md: tiered checkpoint guide with build+fmt after
  each edit, no-test gate for intermediate saves, full gate for final push,
  plus timeout-budget guidance for test-unit

Closes #46904

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix high-frequency late validation failures during make build and test Tiered validation: fast gate for intermediate saves, tests only on final push Jul 20, 2026
Copilot AI requested a review from pelikhan July 20, 2026 21:53
@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Triage — Run §29791496271

Field Value
Category refactor
Risk 🔴 high
Score 35/100 (impact 15 + urgency 8 + quality 12)
Action defer (DRAFT)

Rationale: Tiered validation concept is sound but 263 files / 523k deletions is extremely risky. Needs careful scoped review and AGENTS.md alignment before undrafting.

Generated by 🔧 PR Triage Agent · 40.1 AIC · ⌖ 6.65 AIC · ⊞ 5.6K ·

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review July 21, 2026 03:41
Copilot AI review requested due to automatic review settings July 21, 2026 03:41
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #46927 does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100).

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@pelikhan
pelikhan merged commit 0608dfe into main Jul 21, 2026
52 of 70 checks passed
@pelikhan
pelikhan deleted the copilot/copilot-opt-eliminate-late-validation-failures branch July 21, 2026 03:43

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are clean and well-structured. The tiered validation approach (agent-report-progress-no-test for intermediate saves, agent-report-progress for final push) is a sound optimization. AGENTS.md and SKILL.md are updated consistently. The smoke-call-workflow.lock.yml changes (secrets: inherit, reduced permissions, comment fix) look correct for a recompile artifact. No issues found.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 14.2 AIC · ⌖ 4.34 AIC · ⊞ 5K

@github-actions github-actions Bot mentioned this pull request Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces tiered validation to avoid repeated full test runs during intermediate saves.

Changes:

  • Adds a fast, test-free intermediate validation target.
  • Updates agent guidance for intermediate and final validation.
  • Regenerates a smoke workflow lock file, introducing permission, context, and secret-handling regressions.
Show a summary per file
File Description
Makefile Adds tiered validation targets and help text.
AGENTS.md Defines intermediate and final validation rules.
.github/skills/developer/SKILL.md Documents the tiered validation sequence.
.github/workflows/smoke-call-workflow.lock.yml Regenerates reusable-workflow wiring.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 5
  • Review effort level: Medium

Comment on lines +1107 to +1110
# Review the called workflow's frontmatter permissions in ./.github/workflows/smoke-workflow-call.md.
permissions:
actions: read
contents: read
issues: write
pull-requests: write
pull-requests: read
uses: ./.github/workflows/smoke-workflow-call.lock.yml
with:
aw_context: ${{ fromJSON(needs.safe_outputs.outputs.call_workflow_payload).aw_context }}
payload: ${{ needs.safe_outputs.outputs.call_workflow_payload }}
GH_AW_OTEL_GRAFANA_ENDPOINT: ${{ secrets.GH_AW_OTEL_GRAFANA_ENDPOINT }}
GH_AW_OTEL_SENTRY_AUTHORIZATION: ${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }}
GH_AW_OTEL_SENTRY_ENDPOINT: ${{ secrets.GH_AW_OTEL_SENTRY_ENDPOINT }}
secrets: inherit
Comment on lines +49 to 51
4. **Before final handoff when time allows**
```bash
make agent-finish

> **Key rule:** Run `test-unit` only before the **final** `report_progress` call, not before intermediate saves. Each unnecessary invocation adds 120+ seconds to total validation time.

> **Timeout budget:** `make test-unit` is expected to take up to 120 seconds. If it exceeds that, use `make test-impacted-go` to run only tests for packages affected by the current branch's changes.

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and recompile

Done. Merged main and recompiled all 260 workflows (0 errors).

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /codebase-design and /grill-with-docs — two issues flagged, no blocking defects.

📋 Key Themes & Highlights

Key Themes

  • secrets: inherit security trade-off (smoke-call-workflow.lock.yml): switching from 6 explicit secrets to secrets: inherit broadens credential exposure. Needs confirmation this is intentional and ideally a comment explaining why.
  • "intermediate" is undefined (AGENTS.md): the optimisation only works if agents can reliably identify the final report_progress call. Without a clear heuristic, agents may either skip tests on the last push or run full tests on every save — exactly the waste this PR aims to prevent.

Positive Highlights

  • ✅ The tiered validation idea is sound and well-motivated — removing redundant 120s test runs is a real win.
  • ✅ The Makefile target names and comments are clear and self-documenting.
  • ✅ SKILL.md callout blocks improve signal-to-noise for agents scanning the doc.
  • ✅ Permission reduction in the lock file is a good security improvement where intentional.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 26.2 AIC · ⌖ 4.61 AIC · ⊞ 6.7K
Comment /matt to run again

GH_AW_OTEL_GRAFANA_ENDPOINT: ${{ secrets.GH_AW_OTEL_GRAFANA_ENDPOINT }}
GH_AW_OTEL_SENTRY_AUTHORIZATION: ${{ secrets.GH_AW_OTEL_SENTRY_AUTHORIZATION }}
GH_AW_OTEL_SENTRY_ENDPOINT: ${{ secrets.GH_AW_OTEL_SENTRY_ENDPOINT }}
secrets: inherit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/codebase-design] Switching to secrets: inherit expands the secret exposure surface from the 6 explicitly-named secrets to all secrets available in the caller context.

💡 Why this matters

The previous explicit list constrained which credentials the called workflow could access. secrets: inherit forwards every secret the caller has, including any future secrets added to the repo. If smoke-workflow-call does not need all those secrets, this violates the principle of least privilege.

Consider whether the reduction to secrets: inherit was intentional or an artefact of a make recompile pass. If intentional, document why in the PR description. If not intentional, restore the explicit list.

@copilot please address this.

Comment thread AGENTS.md
@@ -22,7 +22,8 @@ Everything else should be loaded **lazily** through skills only when needed.
## Critical Rules (Always Applicable)

1. If you changed files, use `report_progress` to commit and push.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/grill-with-docs] The term "intermediate" is not defined — agents must infer what counts as an intermediate vs. final report_progress call, which could lead to skipping tests on what is actually the final push.

💡 Suggested clarification

Add a concrete heuristic, e.g.:

Intermediate = any save before the PR is ready for human review. Final = the save that creates or updates the PR targeting merge.

Without this, an agent unsure whether its current save is the last one may default to agent-report-progress every time, eliminating the optimisation.

@copilot please address this.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two blocking issues in the workflow change

The Makefile and documentation changes (tiered validation, agent-report-progress-no-test) are well-structured. Two issues in smoke-call-workflow.lock.yml need resolution before merge.

🔍 Findings

[High] Permission downgrade vs. called workflow requirements — the caller now grants only contents: read + pull-requests: read. GitHub requires the caller to grant at least every permission the callee declares. If smoke-workflow-call.lock.yml job blocks still declare pull-requests: write or issues: write, every invocation will fail at runtime with a permissions error. Needs explicit verification that the callee's permissions were reduced to match.

[Medium] secrets: inherit broadens secret exposure — replacing the explicit secrets list passes all repository secrets to the called workflow unconditionally. Unless the prior explicit list was incomplete by design, prefer an explicit list to maintain least-privilege.

🔎 Code quality review by PR Code Quality Reviewer · 40.8 AIC · ⌖ 4.61 AIC · ⊞ 5.6K
Comment /review to run again

Comments that could not be inline-anchored

.github/workflows/smoke-call-workflow.lock.yml:1118

Permission downgrade may break the called workflow at runtime: the caller now grants only contents: read + pull-requests: read, but the called workflow likely still declares pull-requests: write (and possibly issues: write / actions: read). GitHub requires the caller to grant at least the permissions the callee declares; granting fewer causes a hard runtime error.

<details>
<summary>💡 What to verify</summary>

Check smoke-workflow-call.lock.yml job-level permissions: blocks.…

.github/workflows/smoke-call-workflow.lock.yml:1127

secrets: inherit exposes all repository secrets to the called workflow: the previous explicit list forwarded only the specific secrets the workflow needed. secrets: inherit passes every secret in the repo (API keys, signing keys, tokens) to the called workflow unconditionally.

<details>
<summary>💡 Why this matters</summary>

With explicit secrets forwarding, a compromised or mis-invoked called workflow could only access a bounded set of secrets. With secrets: inherit, the blast radi…

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[copilot-opt] Eliminate high-frequency late validation failures from slow make build+test runs

3 participants