Skip to content

chore: pin uv_build upper bound; assert pyroscope_endpoint precondition#104

Merged
lesnik512 merged 3 commits into
mainfrom
chore/post-retro-hygiene
Jun 1, 2026
Merged

chore: pin uv_build upper bound; assert pyroscope_endpoint precondition#104
lesnik512 merged 3 commits into
mainfrom
chore/post-retro-hygiene

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

Two tiny hygiene items surfaced during post-retro action-item work.

  • uv_build upper bound (pyproject.toml): requires = ["uv_build"]requires = ["uv_build<0.12"]. Silences the persistent just lint warning about missing upper bound (matches the warning's own suggestion).
  • Pyroscope endpoint assert (lite_bootstrap/instruments/pyroscope_instrument.py): assert self.bootstrap_config.pyroscope_endpoint is not None at the top of bootstrap(), with a comment documenting the precondition that is_ready() already enforces.

Why the assert: runtime safety for direct callers that bypass the bootstrapper (clear AssertionError instead of a downstream pyroscope TypeError), documents the invariant, and narrows str | Nonestr for ty.

Caveat: the plan claimed both ty and Pyright narrow after the assert. In practice Pyright doesn't narrow attribute chains across assertions (known limitation). The assert still has value (runtime + ty + docs); the Pyright residual diagnostic is acceptable noise consistent with the existing [tool.pyright] policy.

First PR using the lightweight plan template. First PR using a combined spec+quality review dispatch (testing the "trim two-stage review for trivial PRs" retro action item).

Test plan

  • just test — 129/129.
  • just lint — clean; the "missing upper bound on uv_build" warning is gone.
  • Existing test_pyroscope_instrument_bootstrap_and_teardown exercises the new assert path (with a real endpoint).

🤖 Generated with Claude Code

lesnik512 and others added 3 commits June 1, 2026 21:23
Captures the brainstormed design for a new FastMcpBootstrapper that mirrors
microbootstrap PR141's instrument set (sentry, pyroscope, logging with MCP
access middleware, health checks, prometheus) while following lite-bootstrap
conventions (frozen-dataclass configs, optional-import guards, single-file
bootstrapper module). Adds teardown wiring via FastMCP lifespan composition,
which PR141 doesn't do.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
uv_build: silence the `just lint` warning about missing upper bound by
pinning to <0.12 (matches the warning's own suggestion).

Pyroscope: add `assert self.bootstrap_config.pyroscope_endpoint is not None`
at the top of bootstrap(). This documents the precondition that is_ready()
already enforces and narrows the type for both ty and Pyright (was the
only remaining real Pyright complaint after the post-retro suppressions
landed). Direct callers that bypass the bootstrapper now get a clear
AssertionError instead of a TypeError from pyroscope.

Both items surfaced during retro action-item work. First PR using the
lightweight plan template.
Twelve-task TDD plan implementing the design from
2026-06-01-fastmcp-bootstrapper-design.md. Tasks scaffold the bootstrapper
module, layer instruments one at a time with failing-then-passing tests,
add missing-dependency regression coverage, update docs, and open the PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lesnik512 lesnik512 self-assigned this Jun 1, 2026
@lesnik512 lesnik512 merged commit ab7dd19 into main Jun 1, 2026
7 checks passed
@lesnik512 lesnik512 deleted the chore/post-retro-hygiene branch June 1, 2026 18:30
@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
lite_bootstrap/instruments/pyroscope_instrument.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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