-
Notifications
You must be signed in to change notification settings - Fork 51
fix(workflow): retryable TESTED SKIPPED verdicts and non-dead-end test_runner scope advice (#2756) #2766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
fix(workflow): retryable TESTED SKIPPED verdicts and non-dead-end test_runner scope advice (#2756) #2766
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Stop test_runner's dead-end scope advice and score TESTED SKIPPED as retryable, not failed | ||
|
|
||
| Issue: #2756 | ||
|
|
||
| ## What changed | ||
|
|
||
| - **`test_runner` remediation text** (`src/tools/test-runner.ts`): the guard that rejects `scope:"convention"`/`"graph"`/`"impact"` without `files`/`targets` no longer recommends `scope:"all"` — the exact scope its sibling guard blocks for agent use (env-gated `SWARM_ALLOW_FULL_SUITE`) and the `test_engineer` prompt prohibits. The `message` field now directs the caller to pass a non-empty `files` array (or `targets` for framework-native names) with a concrete example, and both response fields (`message` and `error`) enumerate every scope the guard covers. Both guards' rejection semantics are unchanged. | ||
| - **Foreground Stage B verdict settlement** (`src/hooks/delegation-gate.ts`): a `[TESTED] | task-N | SKIPPED | ...` structured verdict (tests were NOT run — prohibited scope, framework detection none, missing test file) no longer emits `stage_b_failed`. The task stays in its Stage B eligible state (`reviewer_run`/`pre_check_passed`), the reviewer's APPROVED gate proof is preserved, and the `stageBCompletion` entry is untouched, so the architect can re-dispatch the test gate instead of forcing a coder rework of correct code. A warn log records the skip for the orchestrator. Genuine `FAIL` verdicts and `REVIEWED` rejections keep the existing `stage_b_failed` → `rework_required` semantics. | ||
| - **Background Stage B ingestion** (`src/background/stage-b-gates.ts`): `structuredStageBVerdict` now returns `'skip'` for TESTED SKIPPED; `ingestBackgroundStageBCompletion` consumes the record with the new `skipped: true` result flag and fires no transition and no proof clearing. `StageBIngestionResult` gains the optional `skipped` field. | ||
| - **Background advisory** (`src/background/completion-observer.ts`): a skipped ingestion publishes `skipped (tests not run) — re-dispatch the test gate; reviewer proof preserved; task remains Stage B eligible` instead of the generic `ingestion failed`, so operators can distinguish a retryable skip from a hard failure. | ||
|
|
||
| ## Why | ||
|
|
||
| An agent that followed the tool's own advice (`scope:"all"`) could not succeed — the recommended scope is blocked — and models without a natural `files:` habit (observed: Kimi K2.7 Code, 10–11 identical calls) looped until the repetition breaker fired. The prompt's SKIP CONDITION 1 then legitimately produced a `[TESTED] ... SKIPPED` verdict, which the gate scored as a code failure: `rework_required` plus deletion of the reviewer's approval for code that was correct and passing (`python -m pytest` green). Together with #2755 (no autonomous exit from `rework_required`, fixed by PR #2760's audited recovery tool), a single tool-argument mistake stranded tasks that only a human could free. This fix removes the wrongful entry: tests-not-run is retryable state, not failure. | ||
|
|
||
| ## Tests | ||
|
|
||
| - `tests/unit/tools/test-runner-scope-advice.test.ts` — guard-2 response fields direct to files/targets, enumerate all three guarded scopes, and never recommend the blocked scope; guard-1 block characterized as unchanged. | ||
| - `tests/unit/hooks/delegation-gate-stage-b-skipped.test.ts` — SKIPPED leaves state `reviewer_run` with durable reviewer proof and the reviewer completion entry intact; FAIL and REVIEWED REJECTED still go `rework_required` with proof cleared. | ||
| - `tests/unit/background/stage-b-gates-skipped-verdict.test.ts` — SKIPPED ingest returns `skipped: true`, no state mutation, proof preserved; FAIL and unparseable output keep the fail-closed rejection. |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.