Skip to content

test: observe Web response settlement and preserve failure diagnostics - #917

Merged
taras merged 1 commit into
mainfrom
agent/issue-914-surface-diagnostics
Oct 15, 2026
Merged

taras merged 1 commit into
mainfrom
agent/issue-914-surface-diagnostics

Conversation

@taras

@taras taras commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Why

The diagnostics/navigation slice of #914 makes selected tests observe the response lifetime they name and expose the original evidence when a child process, lockfile comparison, or review component fails. The assertion-correction dependency, #915, is merged into main.

What changes

Before: production response listeners were measured after a scheduler turn, native response settlement was unobserved, and a terminal incomplete raw HTTP response could wait forever. Startup failures discarded captured output, lock mismatches hid process context, and unrelated review errors could satisfy negative assertions.

After: listener acquisition is acknowledged explicitly; real ServerResponse close-before-finish and finish-before-close outcomes are observed directly; incomplete terminal HTTP responses fail with the observed termination and a bounded buffered prefix. Failures retain event/count, child command/status/output, and intended error diagnostics. Navigation points to the existing independent runner vectors and actual release-mapping tests. Two demonstrated overlapping pairs are consolidated with their complete assertions retained.

What must stay true

  • Injected server ordering remains separate from native response translation. Relative listener counts, joined teardown, and late-event invariance remain; attachment diagnostics retain event, live count, and baseline.
  • The real streaming-limit journey still receives a complete 413, observes connection termination, keeps submission pending, and accepts a later valid answer.
  • Shard cancellation still stops its process group, starts no later file, leaves no grandchild marker, and checks exact fixture residue. Frozen-entry comparisons still require byte-identical lock strings.
  • Exit-1 Oxlint diagnostics remain valid; raw source/unbounded fields stay out of journals; empty input starts zero processes. Malformed JSON and invocation failure require their own reasons.
  • Discovery consolidation retains self-presence, non-vacuity, ordered full equality (including extra/duplicate/reordered results), and the moved stranded-file diagnostic. Filename-pattern checks remain separate. Both original cases used the same walk/discovery/root/runtime boundary.
  • X2 consolidation retains refusal, zero provider calls, removed observer, absolute post-refusal count settled.length + 1, and exactly one new record after a later explicit append. Both original cases used the identical duplicated-first-record fixture and entrypoint. P1's live post-unwind assertion and independent journal stability remain unchanged.

How to verify it

The explicit focused Deno selection passes 44 groups / 161 steps:

deno task test packages/web/tests/server-lifecycle.test.ts packages/web/tests/server.test.ts scripts/tests/shard-execution.test.ts scripts/tests/frozen-entry.test.ts scripts/tests/runtime-tests.test.ts scripts/tests/runtime-exclusions.test.ts scripts/tests/test-file-discovery.test.ts scripts/tests/review-infrastructure.test.ts packages/cli/tests/repl-execution.test.ts packages/code-review-agent/tests/parse-oxlint.test.ts scripts/tests/release-targets.test.ts

Focused portable Node and Bun selections pass 97 tests each across Web server/lifecycle, REPL execution, runtime scheduling/exclusions, and discovery. After the final review refinement, Web passes 35 cases under Deno and Node; Bun's full focused selection passes 97/97.

Local delivery checks pass: deno task lint, deno task check, pnpm exec tsc -p tsconfig.node.json --noEmit, and deno task check:jsr (Success Dry run complete). Deno and Node typechecks were repeated after the final refinement.

Bounded temporary faults discriminate missing finish/close listener removal; close accepted as success; failed finish; late close overriding success; terminal-before-parse; unbounded response prefix; failed child before its startup marker; controlled lock mismatch; unrelated Oxlint exception; missing/extra/reordered/duplicate/empty discovery; and X2 reconstruction append/provider/observer/subsequent-append errors. A delayed-acquisition positive control passes. A listener attachment fault reports its event and numeric counts. Every temporary fault was restored byte-for-byte, with first outputs retained.

Scope

Included: the ten reviewed test/helper/navigation files for this slice of #914. No dependency, public interface, runtime exclusion, CI concurrency, or product-response implementation changes. Packaging fixture ownership and the separate Core/Workflow corrections remain their own slices; this PR does not close #914.

Risks and limitations

Bun reports the real socket reset fixture as close on this host. The test retains resetAndDestroy() as its stimulus, validates the native observed ending, and requires the incomplete-response diagnostic to match it. Initial sandbox loopback/DNS failures and an intermediate refinement error are retained separately from the passing evidence. No flake-frequency or runtime savings are claimed.

Architect review: PASS for signed commit 2a7a21469b45f11074ab9528e2b01df5856f9fd8 (tree a04734a33d78be1694c36efb6f26758efd086d4f).

Scope confirmation

  • Every changed file supports the purpose described above.
  • Unrelated cleanup and formatting changes are excluded.
  • Mechanical navigation corrections are identified above.
  • The description matches the final diff and test results.

@github-actions

Copy link
Copy Markdown

PR #917: test: observe Web response settlement and preserve failure diagnostics

10 files, +324 / -97

Scope

🟡 421 lines changed. PRs under 400 receive more thorough review.

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

Oxlint: 1 diagnostic across 1 file (1 rule)
Density: 0.003 violations/added-line

no-shadow (1): packages/web/tests/http-client.ts

Correctness

No extraneous code patterns detected.

@taras
taras merged commit ebe09c2 into main Oct 15, 2026
44 checks passed
@taras
taras deleted the agent/issue-914-surface-diagnostics branch October 15, 2026 00:48
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.

Make XMD test assertions, fixtures and failures trustworthy

1 participant