Skip to content

SPEC-299 CI reliability + SPEC-300 typed GROUP BY aggregations#41

Merged
ivkan merged 1 commit into
mainfrom
sf-299-300-merge-to-main
Jun 9, 2026
Merged

SPEC-299 CI reliability + SPEC-300 typed GROUP BY aggregations#41
ivkan merged 1 commit into
mainfrom
sf-299-300-merge-to-main

Conversation

@ivkan

@ivkan ivkan commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Lands the work completed on the sf-297-g1-settled-latch branch after PR #40
(Query Engine Consolidation Phase 1) was squash-merged. PR #40 captured only the
Phase 1 query path; the two specs below were committed afterward and never reached
main. This PR delivers both. Surfaces are disjoint (CI/client/mcp-server vs.
core-rust/server-rust query engine), so the diff reviews cleanly.

Please squash-merge — the branch carries a series of throwaway ci: TEMP diagnostic
commits whose net effect is already reverted; a squash keeps them out of main history.


SPEC-299 — CI reliability (root-cause fix, stopgaps removed)

The chronically-timing-out Build · Test · Lint (Unit tests) job is fixed at the source;
all stopgaps are removed. main currently still carries the stopgaps (--forceExit,
timeout -s KILL, forceExit: true) — this PR removes them.

  • SingleServerProvider: clear connectionTimeoutId + pendingConnectReject in close()
    with an isClosing reconnect guard (eliminates leaked connection-timeout / reconnect-loop timers).
  • TopGunClient.close() awaits provider close.
  • pino sync: isTest releases the SonicBoom fd in both client + mcp-server loggers.
  • mcp-server tests gain a MockWebSocket + HTTP keep-alive drain (closeAllConnections()).
  • node.yml: removed --forceExit / timeout -s KILL / >>>> JEST ENTER; timeout-minutes 25→18.
  • mcp-server/jest.config.js: removed forceExit: true.

~3150 tests pass locally with no --forceExit.

SPEC-300 — Typed GROUP BY field aggregations (SUM/MIN/MAX/AVG) over the wire

Single-node GROUP BY previously returned correct grouping + __count but degenerate
__sum/__min/__max (the converter hardcoded aggField = ""). This wires a real
aggregation spec end-to-end.

  • New AggFunc enum + Aggregation struct + Query.aggregations wire type (core-rust).
  • convert_query serializes query.aggregations; coordinator parses it back into Vec<Aggregation>;
    generalized AggregateProcessor emits __count + only the requested __<func>_<field> keys
    (conditional MsgPack Integer/F64) — degenerate-key leak eliminated.
  • combine-aggregate vertex now emitted only on the multi-node path, leaving CombineProcessor
    untouched (distributed combine deferred to TODO-437/442).
  • TS mirror: groupBy + aggregations on QuerySchema / QueryFilter; opaque QueryManager passthrough.
  • Cross-lang golden fixtures (QUERY_SUB_GROUPBY_AGG, QUERY_RESP_AGG) + WS integration coverage
    asserting correct non-degenerate values and no key leak.

Test evidence

  • Rust: cargo test --release -p topgun-server --lib — 1291 tests; cargo test -p topgun-core — 12 + 7 doc.
  • clippy --all-targets --all-features exit 0 on both crates; cargo fmt --check clean.
  • TS: @topgunbuild/core + @topgunbuild/client build; cross-lang fixtures + WS integration green.

Both specs were reviewed and APPROVED via the SpecFlow impl-review gate (0 critical / 0 major).

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploying topgun with  Cloudflare Pages  Cloudflare Pages

Latest commit: c5b8acc
Status:⚡️  Build in progress...

View logs

Lands the post-PR#40 work that never reached main:
- SPEC-299: root-cause CI fix (timer-leak teardown, remove --forceExit/SIGKILL stopgaps)
- SPEC-300: typed GROUP BY field aggregations (SUM/MIN/MAX/AVG) over the wire

Surfaces disjoint (client/mcp-server/ci vs core-rust/server-rust query engine).
Both reviewed + APPROVED via SpecFlow impl-review (0 critical / 0 major).

Co-authored-by: Claude <noreply@anthropic.com>
@ivkan ivkan force-pushed the sf-299-300-merge-to-main branch from ec68cf3 to c5b8acc Compare June 9, 2026 19:51
@ivkan ivkan merged commit 858eb89 into main Jun 9, 2026
8 of 10 checks passed
@ivkan ivkan deleted the sf-299-300-merge-to-main branch June 9, 2026 19:51
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