Skip to content

Add an opt-in indexed TRX projection for agents - #12671

Merged
Amaury Levé (Evangelink) merged 3 commits into
mainfrom
dev/amauryleve/agent-output-experiments
Dec 1, 2026
Merged

Amaury Levé (Evangelink) merged 3 commits into
mainfrom
dev/amauryleve/agent-output-experiments

Conversation

@Evangelink

@Evangelink Amaury Levé (Evangelink) commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 217a89d1bec1cf05166fd32b397c2f19ca28f1e1

Dimension Assessment Rationale
Change confidence 7.5/10 ↑ Earlier Release pack and packaged consumer cases passed, with a name-association mutation detected.
↑ Benchmark telemetry regression failed before the fix and passed afterward.
↓ Shipping tests were run on an earlier revision; in-flight cancellation, multi-module selection and shipped-projection token savings remain unverified.

Pull request

Summary

Add the opt-in agent-trx tool to project one selected TRX into a self-contained JSONL failure index with bounded excerpts and seekable, chunked diagnostic details. Default test output and exit behavior remain unchanged. Relates to #8827.

Design and decision record

Research, experiments, tradeoffs, and validation. The measured #7 + #10 prototype saved 11.1% versus #10 in a small source-free sample, but used a different artifact format and excerpt limit; savings for this implementation are not established. The benchmark sources are included for reproducibility.

Demonstration

Run Tests.exe agent-trx --input-trx report.trx --output-jsonl index.jsonl on a test application with the TRX extension registered. In a real packed net11.0 consumer, a captured six-result report produced three failure records, a 2,915-byte initial index and a 66,914-byte JSONL file; the source TRX was 66,259 bytes. Its header reported "reportOutcome": "Failed", "resultCount": 6, "failureCount": 3 and "detailsOffset": "00000000000000002915". JSONL is the intended nonvisual consumer surface, so a text transcript is more useful than a screenshot. TRX may already have truncated diagnostics; retain the original process exit and terminal log, and select each module's final report.

Validation and regression proof

On Windows, source based on 9892cae32dedef87f95cf16a8472274bcb67b231 with the implementation and tests included in this PR:

  • .\build.cmd -pack -c Release -bl — exit 0; package content and metadata validation passed.
  • .\.dotnet\dotnet.exe run --project test\UnitTests\Microsoft.Testing.Extensions.UnitTests\Microsoft.Testing.Extensions.UnitTests.csproj -f net10.0 -c Release --no-build --no-launch-profile -- --filter 'FullyQualifiedName~AgentTrxToolTests' --progress off — exit 0; 11 passed, none skipped.
  • .\.dotnet\dotnet.exe test --project test\IntegrationTests\MSTest.Acceptance.IntegrationTests\MSTest.Acceptance.IntegrationTests.csproj -c Release --no-build --filter 'FullyQualifiedName~AgentTrxProjectionAcceptanceTests' -p:UsingDotNetTest=true -p:ArtifactsTestResultsDir=artifacts\TestResults\Release\agent-trx-acceptance --show-test-results all — exit 0; three passed, none skipped. These cover distinct failed rows and associated seekable details, a passing report, and missing/existing paths in a real packed consumer. Package and loaded DLL hashes matched; see the decision record for versions and provenance.
  • All-extension help and info cases passed on net462, net10.0 and net11.0. Benchmark self-tests passed, including grader, reliability, comparison and default-harness checks.

In-flight cancellation and independent multi-module selection were not exercised. No change to SDK terminal rendering is claimed; servicing and downstream rollout remain separate decisions.

Test-value evidence

For this PR's implementation, an isolated, buildable mutation replaced the indexed failure name with an empty string. Each state was repacked using .\build.cmd -pack -c Release -bl '/p:RestoreFallbackFolders=Q:\.tools\.nuget\packages' with a separate NuGet cache. The same packed acceptance selection (--filter 'FullyQualifiedName~AgentTrx_FailingRowsPreserveIdentityExcerptsAndSeekableDetails', otherwise the command above) passed 1/1, failed 1/1 at the expected row-alpha/row-beta versus empty-name assertion (exit 2), and passed 1/1 after restoration. Each consumer DLL matched its own package asset. This proves sensitivity to lost name association, not every possible defect; exact hashes and command variants are in the decision record.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 30, 2026 19:40
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Nov 30, 2026

@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.

🧪 Test quality review — PR #12671

Compared merge base 9892cae32dedef87f95cf16a8472274bcb67b231 with head f202e303ce3eaf2ce58f7b9e547b77b85041691b. Evidence applies to this head, not every intermediate commit.

Test-value evidence

Static analysis only; no tests were executed here.

Contract Test / decisive assertion Counterfactual Status
Distinct rows with the same testId keep their own name, outcome, excerpt and byte-range details AgentTrxToolTests.Index_PreservesDistinctRowsAndByteRangesWithUnicode and AgentTrx_FailingRowsPreserveIdentityExcerptsAndSeekableDetails assert per-row name/outcome/excerpt and contiguous detail ranges Merging rows by testId or empty names would fail the name/executionId assertions Static prediction: likely detected
512-byte UTF-8-safe excerpt and omittedBytes Exact GetUtf8Prefix comparison plus omittedBytes assertions Splitting a surrogate pair or miscounting bytes fails the equality assertions Static prediction: likely detected
Details chunked below 12 KB and seekable ReadDetail and the 12,000-byte window loop reassemble the XML and compare it with the original Output Unchunked or misaligned records fail the part/last/size assertions Static prediction: likely detected
Zero failures and completeness: unknown Index_ZeroFailuresDoesNotClaimCompleteExecution and AgentTrx_PassingReportProducesHeaderWithoutFailures Claiming completeness fails the header assertion Static prediction: likely detected
Invalid input is atomic, with no output or tmp files Six-case Index_InvalidInputDoesNotPublishOrLeaveTemporaryFiles plus Index_ExistingOutputAndCanceledRunDoNotReplaceFiles and AgentTrx_InvalidPathsDoNotCreateOrOverwriteOutput Writing the output before validation fails the existence and tmp-file assertions Static prediction: likely detected
Help/info for the registered tool HelpInfoAllExtensionsTests wildcard expectation Option or description drift fails the match Static prediction: not executed here
Benchmark tooling, docs, resx/xlf — — Not applicable: not product behavior, and no tests are claimed

The PR body reports a packed name-association mutation that was detected, along with 11 unit and 3 acceptance tests passing. I did not verify those records against this head, so they are not counted as executed proof here. In-flight cancellation and multi-module selection remain unexercised, as the PR itself notes.

🧵 Parallel safety

STATUS: CLEAN. COUNTS: Critical=0; High=0; Warning=0; Info=0.

Test assembly Scope Workers Notes
Microsoft.Testing.Extensions.UnitTests MethodLevel 0 (all cores) Each test uses its own GUID-named workspace and no statics.
MSTest.Acceptance.IntegrationTests MethodLevel 0 (all cores) Each test uses its own TempDirectory; the shared asset fixture is only read.
Microsoft.Testing.Platform.Acceptance.IntegrationTests Not checked n/a Help-text expectation change only.

Per-test assessment

Pseudo-mutation evidence below consists of static predictions, not executed mutation results.

Result Quality Test Notes Follow-up
Pass A (90–100) new AgentTrxProjectionAcceptanceTests.AgentTrx_FailingRowsPreserveIdentityExcerptsAndSeekableDetails Real packed host; checks identity, excerpts, ranges and complete XML per row. None.
Pass A (90–100) new AgentTrxToolTests.Index_PreservesDistinctRowsAndByteRangesWithUnicode Row names, outcomes, excerpts and exact byte ranges are all asserted. None.
Pass B (80–89) new AgentTrxProjectionAcceptanceTests.AgentTrx_InvalidPathsDoNotCreateOrOverwriteOutput Both exit codes and unchanged files are asserted. No change justified: the error text is not part of the claimed contract.
Pass B (80–89) new AgentTrxProjectionAcceptanceTests.AgentTrx_PassingReportProducesHeaderWithoutFailures The header, with its single record, is asserted field by field. No change justified.
Pass B (80–89) new AgentTrxToolTests.CommandLine_ValidatesInputAndOutputWithoutCreatingFiles Validation results and the absence of the output file are asserted. No change justified: IsValid is the contract; message text is out of scope.
Pass B (80–89) new AgentTrxToolTests.Index_EmptyTestNamePreservesOtherFailures Both names are asserted, covering the empty-name edge case. No change justified.
Pass B (80–89) new AgentTrxToolTests.Index_ExistingOutputAndCanceledRunDoNotReplaceFiles Cancellation, exit 1, and unchanged output and input are asserted. No change justified.
Pass B (80–89) new AgentTrxToolTests.Index_InvalidInputDoesNotPublishOrLeaveTemporaryFiles Six data cases assert the exit code, the error and the lack of output or tmp files. No change justified: the kind string branching is readable at this size.
Pass B (80–89) new AgentTrxToolTests.Index_ZeroFailuresDoesNotClaimCompleteExecution Header counts, completeness and detailsOffset are asserted. No change justified.
Pass B (80–89) mod HelpInfoAllExtensionsTests expectation block A wildcard expectation for registered tools; it is a method-level expectation, not a new method. No change justified: version and description text are intentionally wildcarded or exact as already used.

No inline comments were published: no supported improvement or unresolved doubt passed the publication gate. Existing-thread lookup returned no prior reviews.

<sub>This advisory review is heuristic and non-blocking.

Re-run the combined review with /review-tests, or only the parallel-safety specialist with /parallel-audit.</sub>

🤖 Automated content by GitHub Copilot. Generated by the Test Quality Review on PR (on open / sync) workflow. · copilot · auto (Claude Sonnet 5.5) · ~59 AIC · ⌖ ~2 AIC · ⊞ 8.5K

@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 30, 2026
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 30, 2026

@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.

Note

🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.

Scope: I read the shipping code in full: AgentTrxTool.cs, the TrxReportExtensions.cs registration, the JsonStringWriter additions, the internal API files, and the acceptance tests. I only skimmed the .xlf and benchmark files. I did not build or run anything.

Main finding (scope discipline, non-blocking): The shipping change is about 410 lines of AgentTrxTool.cs plus the tests. It sits in a PR of 72 files and about 6,200 added lines. Roughly 50 of those files are the eng/agent-output-benchmark/** harness: Node scripts and PowerShell, with their own self-tests, graders and capture pipelines. The PR description says the savings of this implementation are not established. A reviewer therefore cannot confirm that the shipped tool delivers its motivating benefit, because the harness that would show it is not tied to the shipped output.

  • Please split the benchmark harness and docs/decisions/agent-output-experiments.md into a separate PR, or a follow-up tracked by an issue.
  • That leaves this PR as the tool, its tests and its docs, and makes it much easier to review.
  • If the harness stays in, it needs an owner, CI coverage, and a statement of how it is kept in sync with the shipped JSONL format.

Secondary observations (no change required, worth a look):

  1. Tool registration: AddTrxReportProvider now registers the agent-trx tool and its --input-trx and --output-jsonl options for every consumer of the TRX extension. The PR notes that default test output and exit behavior are unchanged, and the help and info acceptance expectations are updated. Please confirm the new options do not collide with the existing --report-trx* and trx-merge option names in the all-extensions case. The HelpInfoAllExtensionsTests change suggests this is covered.
  2. Error messages: Parsing failures throw InvalidDataException with hard-coded English text, for example "Unsupported TRX outcome". AgentTrxToolProjectionFailed puts ex.Message into a localized string, so users get mixed-language output. Either move these messages to the .resx, or accept English-only diagnostics for this opt-in tool and say so.
  3. Argument validation: ValidateOptionArgumentsAsync is a nested ternary that is hard to read. A switch or early returns would be clearer. It also checks that the output file does not exist, but not that its directory exists. A missing directory only surfaces later as DirectoryNotFoundException, which the tool does catch and report, so this is a UX nit and not a bug.
  4. Exception handling: RunAsync catches only IOException, UnauthorizedAccessException, XmlException, InvalidDataException and ArgumentException. The "index length changed" InvalidOperationException would escape as an unhandled failure. It is a defensive invariant, so I suggest keeping it, but you could document that this is intentional.
  5. Memory use: Each failing UnitTestResult is loaded fully as an XElement, and its whole Output is serialized to a byte array before chunking. This is fine for the stated use. Very large captured stdout in a failing row will spike memory, so a note in the docs or a size cap may be worthwhile.
  6. Output size: JsonStringWriter is pretty-printing, and WriteLine strips the newlines but leaves the indentation spaces in every record. This is correct, because newlines inside strings are escaped, but it adds padding to every JSONL record. If byte efficiency matters for the tool's goal, a compact mode would help.

Test-value evidence: The PR supplies a packaged acceptance regression with a name-association mutation (1/1 passed, then 1/1 failed on the expected assertion, then passed again after restoration). The tests assert identities, excerpt bytes, offset arithmetic, and the byte-level contiguity of the detail ranges, which is strong. I did not independently re-execute it. The PR itself lists in-flight cancellation and multi-module selection as unexercised gaps. A unit-level cancellation test would be cheap to add.

No blocking correctness defects found in the shipping code. The UTF-8 boundary handling for excerpts and chunks and the two-pass fixed-width offset computation look correct. The temp-file and cleanup ownership is sound, and DtdProcessing.Prohibit with XmlResolver = null is appropriate for untrusted TRX input.

@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 30, 2026
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 30, 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.

🟡 Changes recommended

Missing usage telemetry silently excludes trials from token totals, allowing incomplete data to falsely report savings against a complete baseline.

1 open issue
What changed in this PR

Adds the opt-in agent-trx workflow to Microsoft.Testing.Platform’s TRX extension, giving agents a failure index with bounded excerpts and seekable diagnostics without changing default test output.

Changes:

  • Registers the tool and adds JSON-writing support, API tracking, localized resources, and tool-info expectations.
  • Documents report selection, indexed retrieval, and diagnostic limitations.
  • Adds reproducible benchmark tooling for capture, retrieval, grading, telemetry, and comparisons.

Test-value evidence: The PR reports packaged acceptance tests and a detected name-association mutation for assessed revision f202e303ce3eaf2ce58f7b9e547b77b85041691b. Those runs were not independently verified here; cancellation, multi-module selection, and shipping-format token savings remain unverified.

File Description
test/​IntegrationTests/​Microsoft.Testing.Platform.Acceptance.IntegrationTests/​HelpInfoAllExtensionsTests.cs Adds agent-tool info expectations.
src/​MTP/​Microsoft.Testing.Platform/​OutputDevice/​JsonStringWriter.cs Supports long integers and booleans.
src/​MTP/​Microsoft.Testing.Platform/​InternalAPI/​InternalAPI.Unshipped.txt Tracks new JSON writer methods.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​TrxReportExtensions.cs Registers the agent tool.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.zh-Hant.xlf Adds Traditional Chinese catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.zh-Hans.xlf Adds Simplified Chinese catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.tr.xlf Adds Turkish catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.ru.xlf Adds Russian catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.pt-BR.xlf Adds Brazilian Portuguese catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.pl.xlf Adds Polish catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.ko.xlf Adds Korean catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.ja.xlf Adds Japanese catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.it.xlf Adds Italian catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.fr.xlf Adds French catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.es.xlf Adds Spanish catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.de.xlf Adds German catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.cs.xlf Adds Czech catalog entries.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​Resources/​ExtensionResources.resx Defines tool descriptions and errors.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​PACKAGE.md Documents tool invocation and limitations.
src/​MTP/​Microsoft.Testing.Extensions.TrxReport/​InternalAPI/​InternalAPI.Unshipped.txt Tracks tool and projection APIs.
eng/​agent-output-benchmark/​view.mjs Implements ten experimental retrieval views.
eng/​agent-output-benchmark/​trial-set.mjs Validates exact trial membership.
eng/​agent-output-benchmark/​telemetry.mjs Deduplicates and reconciles usage telemetry.
eng/​agent-output-benchmark/​summarize.mjs Aggregates ten-arm benchmark results.
eng/​agent-output-benchmark/​sourcefree-summary.mjs Summarizes source-free comparisons.
eng/​agent-output-benchmark/​sourcefree-self-test.mjs Checks source-free evidence and retrieval.
eng/​agent-output-benchmark/​sourcefree-run.mjs Runs source-free diagnostic trials.
eng/​agent-output-benchmark/​sourcefree-observe.mjs Provides bounded source-free observations.
eng/​agent-output-benchmark/​sourcefree-capture.ps1 Captures matched default/report scenarios.
eng/​agent-output-benchmark/​sourcefree-accounting-self-test.mjs Checks accounting and evidence integrity.
eng/​agent-output-benchmark/​self-test.mjs Tests retrieval views and telemetry.
eng/​agent-output-benchmark/​run-local.mjs Runs ten-arm trials through the executor.
eng/​agent-output-benchmark/​reliability-self-test.mjs Checks trial and runner reliability.
eng/​agent-output-benchmark/​regrade.mjs Regrades retained benchmark answers.
eng/​agent-output-benchmark/​query-trx.ps1 Extracts TRX result diagnostics.
eng/​agent-output-benchmark/​Pack.proj Groups benchmark package producers.
eng/​agent-output-benchmark/​grader-self-test.mjs Tests exact-diagnosis grading.
eng/​agent-output-benchmark/​grade.mjs Grades identities, status, and causes.
eng/​agent-output-benchmark/​Fixture.csproj.template Defines the packaged benchmark consumer.
eng/​agent-output-benchmark/​Fixture.cs Supplies diagnostic and retry scenarios.
eng/​agent-output-benchmark/​default-summary.mjs Summarizes default-output comparisons.
eng/​agent-output-benchmark/​default-self-test.mjs Checks default-output benchmark behavior.
eng/​agent-output-benchmark/​default-run.mjs Runs default-output diagnostic trials.
eng/​agent-output-benchmark/​default-regrade.mjs Audits original grading verdicts.
eng/​agent-output-benchmark/​default-provenance.mjs Verifies default-run package provenance.
eng/​agent-output-benchmark/​default-prepare.mjs Prepares output-only trial workspaces.
eng/​agent-output-benchmark/​default-observe.mjs Retrieves bounded stdout/stderr ranges.
eng/​agent-output-benchmark/​default-count-audit.mjs Audits final outcome counts.
eng/​agent-output-benchmark/​default-capture.ps1 Captures default VSTest and MTP runs.
eng/​agent-output-benchmark/​default-capture-process.mjs Captures separate process output streams.
eng/​agent-output-benchmark/​comparison-summary.mjs Aggregates comparative retrieval results.
eng/​agent-output-benchmark/​comparison-self-test.mjs Checks grading and diagnostic offsets.
eng/​agent-output-benchmark/​comparison-run.mjs Runs four-arm diagnostic comparisons.
eng/​agent-output-benchmark/​comparison-regrade.mjs Rechecks captured comparison answers.
eng/​agent-output-benchmark/​comparison-provenance.mjs Audits comparison packages and binaries.
eng/​agent-output-benchmark/​comparison-prepare.mjs Builds experimental indexes and trial inputs.
eng/​agent-output-benchmark/​comparison-observe.mjs Retrieves bounded comparison evidence.
eng/​agent-output-benchmark/​comparison-grade.mjs Grades exact test/row/cause associations.
eng/​agent-output-benchmark/​comparison-console-audit.mjs Audits terminal identity/cause associations.
eng/​agent-output-benchmark/​comparison-capture.ps1 Captures independent comparison runs.
eng/​agent-output-benchmark/​capture.ps1 Captures packaged diagnostic scenarios.
eng/​agent-output-benchmark/​capture-process.mjs Captures combined process output.
eng/​agent-output-benchmark/​benchmark.ps1 Orchestrates benchmark preparation and execution.
eng/​agent-output-benchmark/​audit.mjs Audits evidence, accounting, and concurrency.
docs/​mtp-for-agents.md Explains indexed TRX retrieval and caveats.

Review effort: Balanced

@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 30, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. labels Nov 30, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 30, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 30, 2026
Comment thread eng/agent-output-benchmark/Fixture.cs Resolved
Comment thread eng/agent-output-benchmark/Fixture.cs Resolved
@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 30, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 30, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 1, 2026 09:03
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/approved Proposal approved; ready for implementation. labels Dec 1, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/approved Proposal approved; ready for implementation. labels Dec 1, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Dec 1, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Dec 1, 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.

🔵 Needs a closer look

Diagnostic range validation accepts offsets beyond the available bytes, returning misleading omission metadata instead of an invalid-range error.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Reject diagnostic offsets beyond the end of the data

eng/​agent-output-benchmark/​view.mjs:101

An offset past the end of a diagnostic passes this validation and produces impossible omission metadata. For example, a 10-byte diagnostic requested at offset 20 with length 5 returns an empty diagnostic with totalBytes: 10 and omittedBytes: 20. An agent paging through details can therefore receive a successful but misleading response instead of an invalid-range error. Reject offsets greater than bytes.length, as the source-free retrieval helper already does.

1 resolved since last review

Review effort: Balanced

@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.

🧪 Test quality review — PR #12671

Compared merge base 9892cae32dedef87f95cf16a8472274bcb67b231 with head 217a89d1bec1cf05166fd32b397c2f19ca28f1e1. Evidence applies to this head, not every intermediate commit. Static review only: no builds or tests were run, and I did not check for an earlier report on this head.

Test-value evidence

Contract Test and decisive assertion Counterfactual Status
The agent TRX index keeps distinct rows that share a testId, with a 512-byte excerpt, omittedBytes, and contiguous seekable detail ranges (including Unicode and escaped content). AgentTrxToolTests.Index_PreservesDistinctRowsAndByteRangesWithUnicode. It asserts row names, excerpt, omittedBytes, offset/length contiguity to EOF, and exact round-tripped XML values. Keying rows by testId alone, or cutting the excerpt mid-surrogate, would change the names, counts, excerpt and offsets. Static prediction: caught. No executed red/green record available.
An empty test name does not drop other failures. Index_EmptyTestNamePreservesOtherFailures asserts both row names. Skipping rows with an empty name would remove the first row. Static prediction: caught.
A report with zero failures is not claimed complete. Index_ZeroFailuresDoesNotClaimCompleteExecution asserts a single header line, completeness of unknown, and detailsOffset equal to the file length. Emitting complete, or extra lines, would fail. Static prediction: caught.
Invalid input is rejected without publishing output or leaving temp files. Index_InvalidInputDoesNotPublishOrLeaveTemporaryFiles, 6 data rows. Each asserts exit code 1, a single error message, no output file and no *.tmp. Publishing before validation would fail. Static prediction: caught.
An existing output file is not overwritten, and cancellation leaves files untouched. Index_ExistingOutputAndCanceledRunDoNotReplaceFiles asserts the original content and input bytes. Overwriting the output or leaving a temp file would fail. Static prediction: caught.
Command-line validation of the input and output paths. CommandLine_ValidatesInputAndOutputWithoutCreatingFiles asserts all four validation outcomes. Inverting a check would fail. Static prediction: caught.
End-to-end projection through the real packaged agent-trx tool. The three AgentTrxProjectionAcceptanceTests methods assert identities, excerpt equality, per-record 12 KB windows, range contiguity, and invalid-path exit codes. Oversized detail records or wrong ranges would fail. Static prediction: caught. Needs a pack to execute.
The --help and --info expectations include the new option. HelpInfoAllExtensionsTests expected-output update. Removing the option fails the wildcard match. Static prediction.
RetryTrxRegistrationBehaviorTests mock and registration adjustments. Existing assertions retained. Refactor-type change, expected to pass before and after. Unverified.
JsonStringWriter.cs, the resx/xlf resources, PACKAGE.md, the benchmark scripts under eng/agent-output-benchmark, and the docs. None specific. Not an executable contract, or covered through the projection tests above. Not applicable, or not assessed. The benchmark scripts have no test coverage here.

No executed paired-revision records were accessible, so everything above is predicted, not executed.

🧵 Parallel safety

STATUS: CLEAN. A=0, B=0, C=0, D=0; no findings.

Test assembly Scope Workers Analyzer coverage
MSTest.Acceptance.IntegrationTests MethodLevel 0 (all cores) Not available (read-only static review)
Microsoft.Testing.Platform.Acceptance.IntegrationTests Not checked; only an expected-output string changed n/a Not available
Microsoft.Testing.Extensions.UnitTests MethodLevel 0 (all cores) Not available

Each changed test uses its own unique temp directory, and the shared asset fixture is only read. No process-wide state is mutated.

Per-test assessment

Pseudo-mutation evidence below consists of static predictions, not executed mutation results.

Result Quality Test Notes Follow-up
Pass A (90–100) new AgentTrxProjectionAcceptanceTests.AgentTrx_FailingRowsPreserveIdentityExcerptsAndSeekableDetails Real-tool E2E with exact excerpt, 12 KB window and range assertions. None.
Pass A (90–100) new AgentTrxToolTests.Index_PreservesDistinctRowsAndByteRangesWithUnicode Exact per-row identity, excerpt and contiguous-range assertions. None.
Pass A (90–100) new AgentTrxToolTests.Index_InvalidInputDoesNotPublishOrLeaveTemporaryFiles 6 data rows each assert exit code, error message, no output and no temp files. None.
Pass B (80–89) new AgentTrxProjectionAcceptanceTests.AgentTrx_InvalidPathsDoNotCreateOrOverwriteOutput Asserts exit codes and untouched files. No change justified. Both invalid-path cases are covered, and the error text is intentionally not pinned.
Pass B (80–89) new AgentTrxProjectionAcceptanceTests.AgentTrx_PassingReportProducesHeaderWithoutFailures Single header line with the expected counts and outcome. No change justified.
Pass B (80–89) new AgentTrxToolTests.CommandLine_ValidatesInputAndOutputWithoutCreatingFiles Four validation outcomes plus no file created. No change justified.
Pass B (80–89) new AgentTrxToolTests.Index_EmptyTestNamePreservesOtherFailures Asserts both row names. No change justified. The test is narrow and complete for its contract.
Pass B (80–89) new AgentTrxToolTests.Index_ExistingOutputAndCanceledRunDoNotReplaceFiles Asserts the exception type, output and input bytes, and no temp files. No change justified.
Pass B (80–89) new AgentTrxToolTests.Index_ZeroFailuresDoesNotClaimCompleteExecution Asserts line count, counts, completeness and offset. No change justified.
Not applicable — mod HelpInfoAllExtensionsTests, RetryTrxRegistrationBehaviorTests Changed ranges fall in expectation strings and local mock setup. None.

No inline comments were published: I found no supported improvement or unresolved doubt to anchor.

<sub>This advisory review is heuristic and non-blocking.

Re-run the combined review with /review-tests, or only the parallel-safety specialist with /parallel-audit.</sub>

🤖 Automated content by GitHub Copilot. Generated by the Test Quality Review on PR (on open / sync) workflow. · copilot · auto (Claude Sonnet 5.5) · ~60 AIC · ⌖ ~2 AIC · ⊞ 8.5K

@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Dec 1, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Dec 1, 2026
@Evangelink
Amaury Levé (Evangelink) merged commit 9ed78e7 into main Dec 1, 2026
54 of 58 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/agent-output-experiments branch December 1, 2026 10:34
@microsoft-github-policy-service microsoft-github-policy-service Bot removed the state/approved Proposal approved; ready for implementation. label Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants