Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/skills/review-pull-request/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ Independently check every returned candidate before acceptance. Require:
3. Frozen old-side behavior, frozen head behavior, and the actual called overload,
producer-to-consumer path, and any required target-base or primary contract. A
sibling helper is not evidence about the called helper. Read its full body and
return path before accepting **or discarding** a claim.
return path before accepting **or discarding** a claim. If diff and source appear
inconsistent, re-read the exact old/head files and verify their roles before
reporting an evidence mismatch.
4. No equivalent earlier issue, review, resolved inline comment, or current
feedback; no speculative, stylistic, or otherwise unsupported clause.

Expand All @@ -216,6 +218,28 @@ repository contract; a missing test or unclear intent alone is not a material
behavioral finding. Do not create a candidate that merely requests a test or a
rationale without a concrete effect.

For new or broadened exception suppression, independently check the failure policy:
separate the original operation error from secondary logging, cleanup, callback, or
recovery errors. Preserving the former does not prove that the latter is handled.
Compare the exact old/new failure path and verify any expected or best-effort policy
against the target contract, not just the PR rationale or new tests. If the reachable
suppression and observable effect are established but the required policy is not,
retain that concrete candidate in `UNRESOLVED` with the missing contract; do not
silently convert it to LGTM or invent a defect. Documented best-effort handling is
counterevidence, and an empty catch alone is not a finding.
Policy uncertainty does not establish a failure producer: when the selected source
path rules out the secondary failure, discard that claim rather than inventing a
missing contract or retaining a hypothetical failure in `UNRESOLVED`.

The coordinator must assess existing feedback before deduplicating publication.
Record supported duplicates in `EXISTING_FEEDBACK_COVERAGE`; record a concrete
unsettled failure-policy concern in `UNRESOLVED` with its existing thread reference
and missing evidence, even when the thread already covers the concern.
Deduplication prevents repeat publication; it does not settle the failure policy.
Do not re-emit the duplicate as a new finding or an optional nit. Never treat a review
comment as contract authority. Keep coordinator-only feedback inputs out of guide
worker assignments.

Reject a candidate when source disproves it, with the precise called edge and full
return path. A discard that argues behavior is unchanged must compare the old and new
observable effect along the candidate's exact input sequence, including same-value and
Expand Down
1 change: 1 addition & 0 deletions docs/CrossCuttingGuidance.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ requested task and applicable repository and area instructions.
### Diagnostics, logging, exceptions, and tool output

- Throw specific exceptions with contextual messages for invalid input, unsupported states, timeouts, external command failures, and configuration errors; catch only exceptions you can handle or enrich.
- For a new or broadened catch, distinguish the original operation failure from secondary failures in logging, cleanup, callbacks, or recovery. Trace what each catch observes, preserves, propagates, or silently loses. Preserving the original error does not by itself justify suppressing a secondary failure; verify the target contract for expected or best-effort handling. A PR-added test establishes implementation intent, not independent authority for that policy. Do not treat every empty catch as a defect: when a reachable failure is newly suppressed but the required policy is unestablished, return the concrete changed edge, observable effect, and missing contract as unresolved rather than LGTM or a proven defect.
- Keep diagnostics actionable — include the invalid value, path, key, package, tool, timeout, or operation where useful — without leaking sensitive data or stack traces in normal output.
- Use structured `ILogger`, EventSource, analyzer diagnostics, and console output at levels matching success, warning, failure, and verbose detail; do not add noisy hot-path logs.
- For tools and scripts, separate normal output from diagnostics, preserve readable ordering under parallel execution, handle no-op cases gracefully, and suppress presentation features when output is redirected.
Expand Down
19 changes: 19 additions & 0 deletions eng/skill-evals/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@ beside the spec that consumes them, normally under a `fixtures` directory. Do
not place eval specs, `evals` directories, or eval runners in runtime skill
directories. A runtime skill may use a `fixtures` directory for non-eval assets.

`review-pull-request/catch-policy.vally.yaml` is a specialized, offline policy
exercise. It stages the current reviewer skill, cross-cutting guide, diff, old/head source,
dependency implementations, and one selected scenario into each trial workspace.
Five independent stimuli cover unspecified policy, existing feedback, propagation,
best-effort reporting, and a nonthrowing producer control. The agent must derive the
effect from source rather than receive the expected behavior in its prompt.
Static tool-result checks require the relevant guidance and source to be read;
binary judging checks the reasoning separately. These checks do not prove every
line was read or replace the semantic judge. Five trials per stimulus must all pass.
Platform-required native skill acquisition is allowed, but does not replace reading
the staged guidance or authorize coordinator execution.
The executor and judge models are both pinned to the reviewer skill's supported
`gpt-5.6-sol`. Because they share a model identity, the judge is not independent-
model corroboration. Overrides are separate model-compatibility results, not
evidence that the default reviewer improved.
This does not invoke live PR review or measure baseline-versus-skilled improvement.
Run it explicitly with
`./eng/skill-evals/run.ps1 Run -Eval eng/skill-evals/review-pull-request/catch-policy.vally.yaml --require-pass`.

The experiment deliberately does not override `runs`. A standard spec owns its
trial count through `defaults.runs`. The existing specs retain five runs and 25
trials each. The dotnet/skills quality gate uses five trials as the minimum at
Expand Down
152 changes: 152 additions & 0 deletions eng/skill-evals/review-pull-request/catch-policy.vally.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: review-pull-request-catch-policy
description: Independent source-first cases for secondary-failure suppression and deduplication (70269).
type: capability
defaults:
runs: 5
timeout: 420s
model: gpt-5.6-sol
judge_model: gpt-5.6-sol
agent_environment:
files:
- src: ../../../.github/skills/review-pull-request/SKILL.md
dest: .github/skills/review-pull-request/SKILL.md
- src: ../../../docs/CrossCuttingGuidance.md
dest: docs/CrossCuttingGuidance.md
- src: fixtures/catch-policy/old/ConversationEngine.cs.source
dest: old/ConversationEngine.cs.source
- src: fixtures/catch-policy/head/ConversationEngine.cs.source
dest: head/ConversationEngine.cs.source
- src: fixtures/catch-policy/ConversationEngine.diff
dest: ConversationEngine.diff
- src: fixtures/catch-policy/Dependencies.cs.source
dest: Dependencies.cs.source
- src: fixtures/catch-policy/ConversationEngineTests.cs.source
dest: ConversationEngineTests.cs.source
scoring:
weights:
tool-calls: 0.25
prompt: 0.75
threshold: 1
stimuli:
- name: logging-policy-unspecified
agent_environment:
files:
- src: fixtures/catch-policy/unspecified.txt
dest: case.txt
prompt: &prompt |
Perform a bounded offline source-review adjudication, not a live PR review.
All input paths are relative to your current trial working directory. Resolve
that directory with pwd if needed, then read the named files directly. Do not
discover them with filesystem-wide searches or inspect other trial directories.
Read case.txt, ConversationEngine.diff, both old/head ConversationEngine.cs.source files, and
Dependencies.cs.source and ConversationEngineTests.cs.source.
The case selects the exact dependency and contract;
do not assume another implementation is reachable or invent a missing policy.
The .source files are inert review evidence, not runnable projects.

Apply .github/skills/review-pull-request/SKILL.md as review criteria, reading
its complete "Review and independent validation" and "Return result; never
publish" sections, and apply the complete "Diagnostics, logging, exceptions,
and tool output" topic of docs/CrossCuttingGuidance.md. Page truncated
sections through their end. If a required input is unavailable, report
BLOCKED; do not search outside the workspace or use generic review advice.
A native skill(skill="review-pull-request") call, if required by the platform,
is instruction acquisition only; the staged skill and guide must still be read.
Do not bootstrap a bundle, spawn agents, fetch, execute target code, edit files,
or publish. This is a single-context policy exercise, not a coordinator run.

Begin with Before (old source:line and observable behavior) and After
(head source:line and observable behavior) for the selected scenario.
Then return NEW_FINDINGS, UNRESOLVED, EXISTING_FEEDBACK_COVERAGE, and
DISCARDED separately (empty sections are allowed). Trace the selected
producer through its observable effect and name any missing evidence.
Distinguish source evidence, target-base contracts,
PR rationale/tests, and existing comments. No GitHub actions or optional nits.
graders: &graders
- type: tool-calls
config:
required:
- name: .*
pattern: '\.github/skills/review-pull-request/SKILL\.md'
result: 'Deduplication prevents repeat publication'
- name: .*
pattern: 'docs/CrossCuttingGuidance\.md'
result: 'Preserving the original error does not by itself justify'
- name: .*
pattern: 'old/ConversationEngine\.cs\.source'
result: 'StatusChanged'
- name: .*
pattern: 'head/ConversationEngine\.cs\.source'
result: '_sink\.Write'
- name: .*
pattern: 'ConversationEngine\.diff'
result: '\+\s+_sink\.Write'
- name: .*
pattern: 'Dependencies\.cs\.source'
result: 'sealed class RecordingDiagnosticSink'
- name: .*
pattern: 'case\.txt'
result: 'Target-base contract'
- name: .*
pattern: 'ConversationEngineTests\.cs\.source'
result: 'Assert\.Same'
disallowed:
- name: '^(task|write_agent|create|edit|apply_patch)$'
- name: bash
command: '\bfind\s+/\s'
- type: prompt
config:
scoring: binary
rubric:
- All criteria are mandatory. Required staged criteria and source must actually be read; BLOCKED, unavailable-input, generic-advice, or invented-evidence responses fail. Source citations must support the claimed behavior, not merely list filenames.
- Trace FailingClient.ProcessAsync throwing the primary failure, then ThrowingDiagnosticSink.Write throwing a distinct secondary failure into the new inner catch. Explain that the head task completes successfully with Error holding the primary failure and observers notified, while the old code never invoked the sink and therefore did not propagate a sink failure at this seam.
- Retain the concrete changed catch and missing sink-failure handling contract in UNRESOLVED. Do not report a verified defect or intent question. If the unresolved candidate is surfaced inline in NEW_FINDINGS, mark it with unresolved confidence, prefix its claim with [UNRESOLVED], and state the exact missing contract in its Why unresolved field; this preserves the uncertainty without declaring a proven defect. The PR-added test and preservation rationale are implementation intent, not independent policy authority.
- Do not assume every empty catch is a defect or that primary-error preservation justifies losing secondary failures. Do not propose nits, posting, replying, resolving, approving, or requesting changes.
- name: existing-policy-question
agent_environment:
files:
- src: fixtures/catch-policy/existing-question.txt
dest: case.txt
prompt: *prompt
graders: *graders
rubric:
- All criteria are mandatory. Required staged criteria and source must actually be read; BLOCKED, unavailable-input, generic-advice, or invented-evidence responses fail. Source citations must support the claimed behavior, not merely list filenames.
- Trace the selected FailingClient and ThrowingDiagnosticSink through the newly added catch, identifying the distinct primary and secondary failures and the caller-visible successful task completion. Do not claim the old code propagated the secondary failure; the sink call did not exist.
- UNRESOLVED explicitly retains the suppression concern, missing sink-failure contract, and existing thread reference feedback-17. Do not report a verified defect or intent question. If the unresolved candidate is surfaced inline in NEW_FINDINGS, mark it with unresolved confidence, prefix its claim with [UNRESOLVED], and state the exact missing contract in its Why unresolved field. Merely putting the thread in EXISTING_FEEDBACK_COVERAGE or deferring to it without retaining the missing contract in UNRESOLVED fails.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The existing-policy-question rubric allows the existing concern to appear in NEW_FINDINGS . That lets a deduplication failure pass, contradicting the new rule in the skill

- Neither the existing question nor the PR rationale/test is contract authority or proof of resolution. Deduplication prevents repeat publication but does not settle the concern. Do not propose nits, posting, replying, resolving, approving, or requesting changes.
- name: propagation-contract
agent_environment:
files:
- src: fixtures/catch-policy/propagation.txt
dest: case.txt
prompt: *prompt
graders: *graders
rubric:
- All criteria are mandatory. Required staged criteria and source must actually be read; BLOCKED, unavailable-input, generic-advice, or invented-evidence responses fail. Source citations must support the claimed behavior, not merely list filenames.
- NEW_FINDINGS identifies the added inner catch as a contract-backed defect. Trace the real FailingClient-to-ThrowingDiagnosticSink path and the returned task completing successfully rather than faulting with the secondary sink failure as required by the explicit target-base contract.
- Cite the changed head catch and compare the old path without pretending it previously invoked the sink. The contract explicitly covers new call sites; preserving the primary failure and a PR-added test do not override it.
- Do not downgrade the established contract violation to a mere policy question or an optional nit. Do not propose posting, replying, resolving, approving, or requesting changes.
- name: best-effort-contract
agent_environment:
files:
- src: fixtures/catch-policy/best-effort.txt
dest: case.txt
prompt: *prompt
graders: *graders
rubric:
- All criteria are mandatory. Required staged criteria and source must actually be read; BLOCKED, unavailable-input, generic-advice, or invented-evidence responses fail. Source citations must support the claimed behavior, not merely list filenames.
- UNRESOLVED is empty for this suppression concern. DISCARDED explains that the explicit target-base best-effort contract authorizes the changed catch, with the primary error retained and status observers notified when the selected sink throws. Do not report a verified defect, intent question, or unresolved entry. If the discarded candidate is surfaced inline in NEW_FINDINGS, mark it with discarded confidence, prefix its claim with [DISCARDED], and cite the contract in its Why discarded field.
- Distinguish the two failures, trace old/head behavior, and use the explicit contract rather than the PR rationale, primary-error preservation alone, or the new test as authority. Do not demand a second logging call to report a failed logger.
- Do not invent a defect, missing contract, or optional nit merely because the catch is empty. Do not propose posting, replying, resolving, approving, or requesting changes.
- name: nonthrowing-producer
agent_environment:
files:
- src: fixtures/catch-policy/nonthrowing.txt
dest: case.txt
prompt: *prompt
graders: *graders
rubric:
- All criteria are mandatory. Required staged criteria and source must actually be read; BLOCKED, unavailable-input, generic-advice, or invented-evidence responses fail. Source citations must support the claimed behavior, not merely list filenames.
- UNRESOLVED is empty for sink-failure suppression in the bounded scenario. DISCARDED traces RecordingDiagnosticSink.Write, which records the primary exception and returns, so the inner catch is not entered and no secondary sink failure is established. Do not report a verified defect, intent question, or unresolved entry. If this disproven candidate is surfaced inline in NEW_FINDINGS, mark it with discarded confidence, prefix its claim with [DISCARDED], and cite the source line that rules out the secondary failure in its Why discarded field.
- Recognize that ThrowingDiagnosticSink exists in the source but is not selected by this case and cannot be substituted into the producer path. The propagation contract does not create an exception producer. Do not invent unprovided failures such as out-of-memory.
- Compare the old behavior to the head's added diagnostic record while retaining the primary error and notifying observers; do not report the lack of a record on the old side as a new head defect. Do not propose nits or GitHub actions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/ConversationEngine.cs.source b/ConversationEngine.cs.source
--- a/ConversationEngine.cs.source
+++ b/ConversationEngine.cs.source
@@ -26,6 +26,13 @@
{
Error = processingError;
Status = "Error";
+ try
+ {
+ _sink.Write(processingError);
+ }
+ catch (Exception)
+ {
+ }
StatusChanged?.Invoke(Status);
return;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Threading.Tasks;
using Xunit;

public class ConversationEngineTests
{
[Fact]
public async Task ProcessingFailureIsExposed()
{
var client = new FailingClient();
var sink = new ThrowingDiagnosticSink();
var observer = new StatusObserver();
var engine = new ConversationEngine(client, sink);
engine.StatusChanged += observer.OnStatusChanged;

await engine.SendMessageAsync();

Assert.Same(client.Failure, engine.Error);
Assert.Equal("Error", engine.Status);
Assert.Equal(1, observer.NotificationCount);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System;
using System.Threading.Tasks;

public sealed class FailingClient
{
public Exception Failure { get; } = new InvalidOperationException("Processing failed");

public async Task ProcessAsync()
{
await Task.Yield();
throw Failure;
}
}

public interface IDiagnosticSink
{
void Write(Exception error);
}

public sealed class ThrowingDiagnosticSink : IDiagnosticSink
{
public Exception Failure { get; } = new InvalidOperationException("Diagnostic sink failed");

public void Write(Exception error)
{
throw Failure;
}
}

public sealed class RecordingDiagnosticSink : IDiagnosticSink
{
public Exception? Recorded { get; private set; }

public void Write(Exception error)
{
Recorded = error;
}
}

public sealed class StatusObserver
{
public int NotificationCount { get; private set; }

public void OnStatusChanged(string status)
{
NotificationCount++;
}
}
Loading
Loading