Skip to content

docs(#585): regenerate ADR-0005 evidence with the flaky-test fix; fix LOC-classification drift - #625

Merged
BorisTyshkevich merged 2 commits into
mainfrom
evidence/585-regenerate-with-flaky-fix
Aug 6, 2026
Merged

docs(#585): regenerate ADR-0005 evidence with the flaky-test fix; fix LOC-classification drift#625
BorisTyshkevich merged 2 commits into
mainfrom
evidence/585-regenerate-with-flaky-fix

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

What & why

Follow-up to #624 (the WebKit flaky-test fix). Regenerates docs/evidence/585/ for issue #585 / ADR-0005 with that fix in place, and fixes a second, unrelated evidence-generation bug found along the way, then reconciles docs/ADR-0005-clickhouse-web-client.md to match.

Corrected outcomes:

  • Browser-matrix gate: failpass (16/16, reproduced across two independent full-matrix reruns — no retries even needed).
  • Proposed ClickHouse version minimum: 26.6.2.16026.3.16.10001.altinitystable (that row is no longer excluded now that its browser-matrix cell passes).
  • Net production-code deletion estimate: -157-154 physical LOC (131 eligible − 190 adapter − 95 bridge/guard).

The Rejected decision is unchanged. The supported-server-matrix gate (a confirmed-live, genuine ClickHouse 24.8.x incompatibility) fails independently of both corrections above.

The second bug (deletion-estimate LOC classification)

Regenerating evidence with #624's fix in place surfaced the net-deletion figure moving the wrong direction first (-157 → -192). Root cause: run-matrix.mjs's classifyFunctionRangesFromSource only ever matched export-prefixed top-level declarations. #585 Phase 1 (PR #621) restructured src/net/ch-client.ts and moved chUrl (+ the progress-line stream loop) into a new src/net/clickhouse-http-transport.ts, and several other already-classified helpers (isAbort, errMessage, isCurrentEpoch, staleEpochAbort, querySystemAware, loadDataLakeCatalogTableNames) lost their export keyword along the way — none of this was tracked, so some symbols went uncounted entirely and others were misattributed to the wrong bucket, with no error raised in either direction.

Fixed: the boundary regex now matches top-level function/const declarations whether or not they're exported (still anchored to true top-level, never nested), and a new symmetric drift guard throws when a classification-table entry stops matching anything — mirroring the existing throw for an unclassified symbol found in the source. That guard immediately caught one more pre-existing latent bug (OfficialConnection, a type-only interface, was never actually matched by either regex and had been a dead table entry all along) and surfaced two more real, always-unexported symbols the old mechanism had always missed (transportFor, DOC_PROBE_TABLE_NAMES in ch-client.ts; classifyError, flattenHeaders in the spike's official-adapter.ts). clickhouse-http-transport.ts is now classified on its own and summed into the net-deletion formula.

The corrected -154 lands close to the originally-recorded -157 — the Rejected conclusion on this gate held for the right reasons all along, not the transient miscounting Phase 1's file split introduced.

Changes

  • tests/spike/clickhouse-client/run-matrix.mjs / run-matrix.test.ts: the classification-drift fix above (commit 1).
  • docs/evidence/585/**: regenerated from a full run-matrix.mjs run (all 4 server rows, both browsers) with both fixes in place (commit 2).
  • docs/ADR-0005-clickhouse-web-client.md: reconciled — updated the "Decision" gate count/bullets, the Support-minimum derivation, the Browser/origin-matrix and Decision-table mirrors, the Future-production-deletion-estimate numbers, Consequences, Alternatives considered, and the stale Limitations bullet; added a new "Evidence correction addendum" section documenting both fixes and their provenance.
  • CHANGELOG.md: updated the existing ADR-0005 ### Added entry (no longer cites the stale -157/WebKit-failure framing) and added a new ### Fixed entry for this correction.

Testing

  • npm run check:types, npm run check:arch, npm run check:schemas, npm run check:examples, npm test (100/97.14/100/100 coverage), npm run build — all green.
  • npm run check:client-spike:evidence (the evidence's own self-consistency validator): 92 findings against this regenerated evidence vs. 94 against the original unmodified evidence (verified via git stash) — the only two findings that disappeared are exactly the two browser-matrix-flake findings this change resolves; the remaining 92 are the expected, already-documented 24.8.x precision/live-scenario failures the ADR's supported-server-matrix gate is about.
  • Full evidence regeneration run completed cleanly (decision=Rejected) with no Docker/Playwright errors.

Checklist

  • npm test passes (the per-file coverage gate is non-negotiable)
  • Tests added/updated in the same change as the code (run-matrix.test.ts)
  • npm run build succeeds (single-file dist/sql.html)
  • Layers kept honest — confined to tests/spike/clickhouse-client/, docs/evidence/585/, docs/ADR-0005-clickhouse-web-client.md, CHANGELOG.md; nothing under src/ changed
  • No new runtime dependency
  • CHANGELOG.md ([Unreleased]) updated
  • Reconciled affected tracked work — the ADR itself is the tracked-work document here; ship-log will be updated separately

Part of #585 (does not close it — Phase 2-4 remain gated on a new decision; this PR corrects evidence precision, it does not reopen the decision).

🤖 Generated with Claude Code

https://claude.ai/code/session_01MqDRfSfy6w1FJnFibYY44F

BorisTyshkevich and others added 2 commits August 6, 2026 16:51
…'s file split

Regenerating evidence with the WebKit flaky-test fix in place surfaced a
second, unrelated bug: the deletion-estimate went from -157 to -192 LOC,
the wrong direction. Root cause: classifyFunctionRangesFromSource's
boundary regex only ever matched export-prefixed top-level declarations.
Phase 1 (PR #621) restructured ch-client.ts and moved chUrl (+ the
progress-line stream loop) into a new src/net/clickhouse-http-transport.ts,
and several other classified helpers (isAbort, errMessage, isCurrentEpoch,
staleEpochAbort, querySystemAware, loadDataLakeCatalogTableNames) lost their
export keyword along the way. None of this was tracked: symbols before the
file's first remaining export boundary were silently dropped from every
bucket, and symbols between two boundaries were misattributed to the
earlier one's bucket, with no error raised in either direction.

The boundary regex now matches top-level function/const declarations
whether or not they're exported (still anchored to true top-level, never
nested). A new symmetric drift guard throws when a classification-table
entry stops matching anything, mirroring the existing throw for an
unclassified symbol found in the source — this is exactly the failure mode
that let the drift go unnoticed. That guard immediately caught a second,
pre-existing latent bug (OfficialConnection, a type-only interface, was
never actually matched by either regex and had been a dead table entry all
along) and surfaced two more real symbols (transportFor, DOC_PROBE_TABLE_NAMES
in ch-client.ts; classifyError, flattenHeaders in official-adapter.ts) that
were always non-exported and always invisible to the old mechanism.

src/net/clickhouse-http-transport.ts is now classified on its own
(HTTP_TRANSPORT_CLASSIFICATION: chUrl/streamLines/createHttpTransport, all
delete-after-cutover per the ADR's ownership boundary) and combined into
the net-deletion formula alongside ch-client.ts's own bucket.

Corrected estimate (via computeDeletionEstimate(), no live-matrix rerun
needed for this part): currentGenericLoc 131, estimatedOfficialAdapterLoc
190, acceptedBridgeGuardLoc 95, netExecutableDeletion -154 — close to the
original -157 (the corrected pre-Phase-1 baseline), confirming the earlier
Rejected conclusion on this gate holds for the right reasons, not the
transient miscounting introduced by Phase 1.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MqDRfSfy6w1FJnFibYY44F
…he ADR

Regenerates docs/evidence/585/ from a full run-matrix.mjs pass (all 4
server rows, both browsers) with the WebKit flaky-test fix and the
deletion-estimate LOC-classification fix both in place, then reconciles
docs/ADR-0005-clickhouse-web-client.md's prose and quoted evidence mirrors
to match.

Corrected outcomes:
- Browser-matrix gate: fail -> pass (16/16, reproduced across two
  independent full-matrix reruns).
- Proposed ClickHouse minimum: 26.6.2.160 -> 26.3.16.10001.altinitystable
  (that row no longer excluded now that its browser-matrix cell passes).
- Net production-code deletion estimate: -157 -> -154 (131 eligible - 190
  adapter - 95 bridge/guard), now including src/net/clickhouse-http-
  transport.ts's own bucket alongside ch-client.ts's.

The Rejected decision is unchanged: the supported-server-matrix gate
(confirmed-live 24.8.x incompatibility) fails independently of both
corrections. Added an "Evidence correction addendum" section to the ADR
documenting both fixes and their provenance; updated the CHANGELOG's
existing #585 entries to match. docs/evidence/585/**'s own self-consistency
validator (npm run check:client-spike:evidence) reports 92 findings against
this regenerated evidence vs. 94 against the original (confirmed via
git stash) -- the only two findings that disappeared are exactly the
browser-matrix-flake ones this change resolves.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MqDRfSfy6w1FJnFibYY44F
@BorisTyshkevich
BorisTyshkevich merged commit d0fe736 into main Aug 6, 2026
8 checks passed
@BorisTyshkevich
BorisTyshkevich deleted the evidence/585-regenerate-with-flaky-fix branch August 6, 2026 15:12
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.

1 participant