Skip to content

fix(ci): unbreak main — pyright strictness errors + rest_sweep refresh - #11

Merged
pingedbrain merged 1 commit into
mainfrom
fix/ci-typecheck-and-sweep-drift
Oct 27, 2026
Merged

pingedbrain merged 1 commit into
mainfrom
fix/ci-typecheck-and-sweep-drift

Conversation

@pingedbrain

Copy link
Copy Markdown
Owner

Closes #10

What

  • Fix 76 pyright errors (newer pyright under typeCheckingMode = "basic"): Optional-narrowing assert ... is not None in tests, plus small src corrections — async on_startup callback for aiohttp, FramerSpec.endian typed Literal["big","little"], after_msgs/ureader/framer narrowing, upstream isinstance guard in cli.
  • Regenerate fidelity/rest_sweep.json via tools/rest_sweep.py — it drifted from the installed botocore (same drift class as botocore model drift — refresh fidelity captures #7).

Why

ci on main fails Typecheck (3.13) and cancels the rest of the matrix — the README badge is red and every PR inherits the failure.

How verified

  • pytest passes locally (1682 passed, 2 skipped)
  • ruff check src/ tests/ is clean
  • pyright 0 errors
  • New behavior has a test (or explains why not): no behavior change — type annotations, test asserts, and a regenerated snapshot

The last ci run on main fails Typecheck on 3.13 and cancels the rest of
the matrix. Two independent causes, both tool drift:

- pyright>=1.1.400 floats; newer releases report 76 errors under basic
  mode that earlier versions accepted. Fixed at the source: aiohttp
  on_startup now gets an async callback, FramerSpec.endian is typed
  Literal["big","little"], int|None comparisons get explicit narrowing
  (after_msgs, tcp ureader/framer asserts), and the tests guard
  Optional parse results with assert ... is not None instead of
  touching attributes on None.
- fidelity/rest_sweep.json drifted from the installed botocore
  (networkmanager, elementalinference, ...); regenerated via
  tools/rest_sweep.py. Same drift class as #7, different artifact.

Verified: ruff clean, pyright 0 errors, pytest 1682 passed / 2 skipped.
@pingedbrain
pingedbrain merged commit f92cdfe into main Oct 27, 2026
5 checks passed
@pingedbrain
pingedbrain deleted the fix/ci-typecheck-and-sweep-drift branch October 27, 2026 21:49
pingedbrain added a commit that referenced this pull request Oct 28, 2026
* feat(tls): client-side TLS termination via --tls-cert/--tls-key

Operator-supplied cert/key pair terminates TLS on the client-facing
listener for every transport; the upstream leg stays plaintext (no
re-encryption, no cert generation, no CA integration).

- src/microburst/tls.py: server_ssl_context() builds the pair-validated
  server context (all-or-nothing, a lone half is a config error) and
  upgrade_writer_tls() performs the in-band STARTTLS-style upgrade —
  asyncio streams expose no public server-side upgrade, so it drives
  loop.start_tls on the stream's own transport+protocol.
- cli.py/transports.py: --tls-cert/--tls-key flags (+ tls_cert:/
  tls_key: config keys), pair validation before dispatch, options
  forwarded through the TRANSPORTS registry.
- postgres: SSLRequest gets 'S' + in-band upgrade when configured,
  'N' otherwise; GSSENCRequest always 'N'.
- mysql: CLIENT_SSL stays in the relayed greeting when configured and
  an SSLRequest upgrades mid-handshake (the real handshake response is
  read inside TLS); without a pair the 1043/08S01 Bad handshake
  refusal is preserved. Compression caps still stripped.
- redis/grpc/tcp: ssl= on asyncio.start_server — rediss/grpcs/tcps
  listeners; grpc upstream stays prior-knowledge h2c.
- http: web.run_app(ssl_context=...) — the listener becomes https.

Also regenerates fidelity/rest_sweep.json — the installed botocore
removed the bedrock-agentcore-control RetrievalInstruction API, so the
committed snapshot drifted again (same maintenance as #11).

12 new tests in tests/test_tls.py cover pair validation, the pg
SSLRequest→S upgrade (+ GSSENC still refused inside TLS), the mysql
SSLRequest upgrade, TLS-from-connect listeners for redis/grpc/tcp, the
https HTTP listener, and plaintext rejection on a TLS listener.

Closes #18. Part of #6 (TLS termination).

* chore(fidelity): regenerate rest_sweep snapshot for botocore 1.43.120

CI installs the floating botocore (uv pip install ignores uv.lock);
1.43.120 reshaped bedrock-agentcore-control — committed snapshot must
match what the sweep test runs against.
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.

ci: main red — pyright strictness errors + rest_sweep.json drift

1 participant