Skip to content

test(windows): cover each quota repeat outcome at both catch seams (#219) - #338

Merged
BunsDev merged 2 commits into
mainfrom
fix/219-quota-repeat-entry-bound
Sep 21, 2026
Merged

BunsDev merged 2 commits into
mainfrom
fix/219-quota-repeat-entry-bound

Conversation

@BunsDev

@BunsDev BunsDev commented Sep 21, 2026

Copy link
Copy Markdown
Member

What

Diagnostic coverage for the Windows resource-quota monitor's repeat classification, for #219.

The diagnosis posted on #219 (from OpenCoven/sdk#38) proposed splitting the bare catch that mapped every second failure to repeat=persistent. On current main that split already exists: since 2cb98c0 (#326) both ReadDirectorySnapshotOperation and ClassifyQuotaReadRepeat call the shared ClassifyPersistentQuotaRepeat, which emits persistent-entry-bound, persistent-access-denied, persistent-io[-<hresult class>], persistent-arithmetic-overflow and persistent-unexpected. The production supervisor source is unchanged by this PR; the frozen blob pinned in phase1-conformance.lock.json still matches.

What was missing was proof. This PR adds it:

  • scripts/windows-quota-diagnostics.test.ps1: a matrix that drives both seams (entry-attributes and directory-enumeration-depth-3-plus) with one injected second failure at a time and asserts the exact repeat label, that the first category stays access-denied, that exactly two attempts were made, and that no private path text leaks. A no-injection case reads a real two-entry directory with a one-entry budget and asserts Category=entry-bound, Repeat=persistent-entry-bound, the exact mechanism described on the issue (the entry budget is per traversal, not per directory).
  • docs/windows-quota-repeat-outcome.md: documents run 35146928092, why persistent alone could not identify the cause, and every persistent-<category> label.
  • docs/phase1-conformance.md: refreshed byte/SHA-256 row for the diagnostics test, which src/client-v1-conformance-workflow.test.ts enforces.

Verification

  • pwsh -NoLogo -NoProfile -NonInteractive -File scripts/windows-quota-diagnostics.test.ps1 on macOS (PowerShell 7.6.6, .NET 10): exit 0, including the new lines "Second denial, exhausted entry budget, other I/O failures, and missing paths keep distinct repeat labels at both seams" and "A spent traversal entry budget reports entry-bound on the first attempt and its repeat".
  • dotnet build of the probe C# block: 0 warnings, 0 errors.
  • vitest run src/client-v1-conformance-workflow.test.ts: 91 passed, 19 skipped.
  • ci:full label requested so windows-supervisor-behavior exercises the suite on windows-2025.

Not claimed

No Windows reproduction, no repair of the protected failure, no acceptance change. Which of the three causes fired in run 35146928092 is still unknown; the next protected run will say persistent-entry-bound, persistent-access-denied or persistent-io-* instead of persistent. If the SDK validator fixture tests/fixtures/chat-debee-windows-supervisor.cs.br predates 2cb98c0, that rebinding is a separate follow-up on OpenCoven/sdk#38.

🤖 Generated with Claude Code

Protected run 35146928092 failed closed with repeat=persistent after an
access denial in directory-enumeration-depth-3-plus. That label could
not separate a second UnauthorizedAccessException from an exhausted
traversal-wide entry budget (QuotaEntryBoundException) or a changed
IOException, because both repeat paths in the supervisor classified
every non-missing second exception with a bare catch.

The frozen supervisor source already maps both sites through one helper,
ClassifyPersistentQuotaRepeat, which reports persistent-<category> using
the fixed first-failure categories (persistent-entry-bound,
persistent-access-denied, persistent-io and its HRESULT variants,
persistent-arithmetic-overflow, persistent-unexpected). The lock pins
that source, so it is unchanged here.

What was missing was coverage through the production seams and a
current description of the labels:

- Drive ReadQuotaOperation and ReadDirectorySnapshotOperation with one
  injected second failure at a time (second denial, entry-bound, generic
  and HRESULT-classified I/O, both missing types, unexpected) and require
  the matching label after exactly two calls, with the first category
  preserved and no private text.
- Read a real two-entry directory through ReadBoundedDirectorySnapshot
  with a one-entry budget and require entry-bound on both attempts, with
  no injection, since MaximumQuotaEntries is one budget per traversal.
- Document the persistent-<category> labels in
  docs/windows-quota-repeat-outcome.md alongside the retired transient
  label, and refresh the diagnostics test's byte and SHA-256 row.

No resource limit, quota ceiling, retry count, identity, permission, or
dependency changes.

Refs #219

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 21, 2026 04:36
@BunsDev BunsDev added the ci:full Run the macOS and Windows CI jobs on this pull request label Sep 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.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds diagnostic coverage for Windows quota repeat classification across both production seams and documents the resulting labels.

Changes:

  • Adds injected repeat-outcome matrix and real entry-budget regression coverage.
  • Documents repeat categories and protected-run context.
  • Refreshes conformance metadata for the updated test script.
File Description
scripts/​windows-quota-diagnostics.test.ps1 Updated as part of this pull request.
docs/​windows-quota-repeat-outcome.md Updated as part of this pull request.
docs/​phase1-conformance.md Updated as part of this pull request.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/windows-quota-diagnostics.test.ps1
Comment thread docs/windows-quota-repeat-outcome.md Outdated
…rified status

Address the two Copilot review threads on PR #338.

The both-seam matrix omitted persistent-arithmetic-overflow and the
classified I/O labels for file-not-found, path-not-found,
lock-violation, name-too-long and invalid-directory, so a seam-specific
wiring regression for those outcomes could not be caught; the earlier
loop only calls ClassifyPersistentQuotaRepeat directly. Inject one
exception per remaining normalized label: an OverflowException and
plain IOException instances carrying each reviewed Win32 HRESULT. A
plain IOException with the file-not-found HRESULT is not a
FileNotFoundException, so it must reach the classifier rather than the
missing catch; the matrix now proves that at both production seams.

The status line in docs/windows-quota-repeat-outcome.md said the matrix
and spent-budget check had not been executed. That is no longer true:
the managed file passed on macOS (PowerShell 7.6.6, .NET 10) and the
windows-supervisor-behavior job passed on windows-2025 in run
35561671518. State that, and keep what remains unproven separate: which
cause fired in protected run 35146928092, which only a fresh protected
run reporting a persistent-<category> label can show.

Refresh the diagnostics test's byte and SHA-256 row.

Refs #219

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@BunsDev
BunsDev merged commit 01adf71 into main Sep 21, 2026
11 checks passed
@BunsDev
BunsDev deleted the fix/219-quota-repeat-entry-bound branch September 21, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the macOS and Windows CI jobs on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants