Skip to content

Commit d95e1f4

Browse files
authored
chore(context7): drop the stale planning/ exclusion (#176)
* chore: migrate off the planning/ convention Replaces the two-axis planning/ + architecture/ convention with PR-body-as-spec, CONTEXT.md for vocabulary, and docs/adr/ for rejected alternatives, per modern-python/.github#67. - planning/ deleted in full, 51 files. changes/ held 21 design records whose content is the diff each describes, and git history is that record; audits/ and retros/ recorded two audit arcs that shipped complete (3 criticals, 5 design issues, 7 refactors, 8 test gaps, 10 low-priority items across #89-#103 and #107; all 26 findings of the second audit across #108-#110), so nothing there is outstanding; specs/ and plans/ held one org-wide README standardization whose lite-bootstrap half is in README.md today. releases/ held ten notes: 1.4.0 and 1.3.0 diffed byte-identical against `gh release view` apart from a trailing newline GitHub adds, and 1.1.0 differs only where the local copy was edited after publication to chase a planning/ path rename — the Releases are the record either way. - deferred.md's three items plus two never-scheduled findings from the second audit's scope appendix are drafted as issue bodies in ../DRAFT-ISSUES-lite-bootstrap.md, each carrying its revisit trigger. Not opened on GitHub. - planning/decisions/ held four records; the previous, interrupted attempt at this migration had carried only two of them across. All four are now ADRs, frontmatter stripped: keep-per-instrument-axis is 0002, teardown-marker limits is 0003 (its "Update (1.4.0)" section kept as prose), orjson-opt-in is 0005, otlp-http-exporter-shape is 0006. None of the four declared a supersedes or superseded_by relationship, so none was lost in the strip. Four more ADRs rescue rejections that were buried in change files: 0001 (FastMCP teardown via a Provider lifespan rather than app._lifespan), 0004 (trace-exclusion stays one method), 0007 (the zero-dependency core was attempted and failed on pydantic's TypedDict rule under Python < 3.12), 0008 (the structlog->Sentry seam keeps its startswith heuristic rather than gaining a marker key). All eight keep a revisit trigger. - architecture/ carried five prose pages. Three claims in them were enforceable and are now INVARIANT tests; the rest was mechanism readable from lite_bootstrap/ and is deleted, not relocated. test_importing_lite_bootstrap_needs_only_the_stdlib_and_typing_extensions (new tests/test_core_import_surface.py) walks every module's top-level AST and fails on a third-party import outside an import_checker or TYPE_CHECKING guard — the invariant that broke four times and the one this library actually controls in the free-threading story. Verified: an unguarded `import orjson` in logging_factory.py fails it, and adding a new *guarded* optional import plus a new stdlib import leaves it green. test_every_framework_config_post_init_cascade_reaches_base_config (new tests/test_config_cascade.py) spies on BaseConfig's terminator while constructing each framework config. Verified against the exact bug that shipped once: dropping CorsConfig's super().__post_init__() call fails it for FastAPIConfig and LitestarConfig, and giving SwaggerConfig a new __post_init__ that does call super() leaves it green. test_only_the_silent_skip_path_lands_in_skipped_instruments (tests/test_free_bootstrap.py) pins the asymmetry CONTEXT.md defines "skipped" by. Verified: appending the dependency-missing case to skipped_instruments fails it, while adding another config-skipped instrument to FreeBootstrapper — the list legitimately growing — leaves it green. The free-threading page was judged to hold no enforceable claim of its own: its support matrix is a statement about upstream wheel availability, and its single-threaded-init section is a design stance, not a testable one. Its two live blockers are drafted as issues instead. - CONTEXT.md was written by the interrupted attempt and audited rather than trusted. Its "Skipped" entry claimed both skip paths appear in build_summary(); a dependency skip appears in neither list, and the entry is corrected — the same claim the new invariant test now holds. All five _Avoid_ entries were audited against real usage and all five earn their listing: "instrumentation" and "integration" appear only in their sanctioned senses (opentelemetry-instrumentation-* packages and the middleware named after them; docs/integrations/ and Sentry's own Integration objects), with one straggler — docs/introduction/quickstart.md said "production instrumentation" for what are mostly not instrumentation at all, now "production observability". That is a user-visible string on the docs site. - README.md's extras paragraph linked architecture/free-threading.md and claimed no mandatory runtime dependencies. Both are fixed: the free-threading facts a user needs are inlined, and core's one dependency is named. That paragraph is user-visible on PyPI, and the old claim is what ADR-0007 exists to correct. - AGENTS.md gains Workflow and Where-a-fact-goes and loses the planning lanes, the architecture/ promotion rule, and the capability index. The admission check applied to itself cut eight invariant bullets and four convention bullets that restated a docstring, a comment already at the site, pyproject.toml or the justfile — the frozen/non-frozen split Python enforces on its own, the slots-and-bare-super comment that sits three lines above the code it explains, the from_dict/from_object asymmetry both docstrings state. What survives is the three rules invisible in the code that obeys them, and the ty suppression spellings the justfile does not give. - mkdocs.yml excludes /adr/ from the published site, matching modern-di: an internal decision record is not user documentation, and mkdocs --strict fails on a docs/ file absent from nav. - justfile and lint-ci drop index and check-planning (there was no check-links recipe); the offline lychee gate in _checks.yml replaces them (modern-python/.github#66). Locally it went from 8 errors to 0 over 57 unique links — every one of the eight lived inside planning/, and deleting it is what made them green. Beyond the recipe, and the reason this is chore: and not docs: release.yml read the Release body from planning/releases/<tag>.md and hard-required one for every stable tag, so deleting planning/ would have failed every future stable release. It is now byte-identical to modern-di's post-migration workflow apart from the PyPI project name, using GitHub's generated notes; modern-di dropped the same gate in 1ea74ee (modern-python/modern-di#449). This retires the mandatory-curated-notes policy; a release wanting prose is edited after the fact with `gh release edit`. Verification: just lint-ci clean, just test 242 passed at 100% coverage, just docs-build strict clean, lychee --offline 0 errors, and no remaining reference to planning/, architecture/, check-planning, check-links or convention-version anywhere in the tree. * chore(context7): drop the stale planning/ exclusion The sibling commit on this branch deletes planning/, so the exclusion now names a directory that does not exist. Dropping the key rather than leaving an empty list: Context7's schema (https://context7.com/schema/context7.json) declares no required properties and gives excludeFolders a default of [], so an absent key and an empty list are equivalent. Absent matches the repos that never carried the line.
1 parent 04bec8b commit d95e1f4

81 files changed

Lines changed: 599 additions & 8072 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/_checks.yml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ jobs:
1616
- run: uv python pin 3.10
1717
- run: just install lint-ci
1818

19+
links:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v6
23+
# --offline blocks network requests and excludes every external URL, so this gate
24+
# is deterministic: it fails only on a relative link or file path a diff broke.
25+
- name: Check local links
26+
uses: lycheeverse/lychee-action@v2
27+
with:
28+
args: >-
29+
--offline
30+
--no-progress
31+
'**/*.md'
32+
1933
docs:
2034
runs-on: ubuntu-latest
2135
steps:

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,47 +25,22 @@ jobs:
2525
- uses: extractions/setup-just@v4
2626
- uses: astral-sh/setup-uv@v7
2727

28-
# Curated release notes are MANDATORY for a stable tag. This runs BEFORE
29-
# `just publish` (which is irreversible) so a missing notes file aborts
30-
# the release before anything reaches PyPI — rather than silently shipping
31-
# with GitHub's auto-generated notes. Pre-release tags (a letter in the
32-
# name, e.g. 2.0.0rc1) are exempt and keep the auto-generated fallback.
33-
- name: Require curated release notes (stable tags)
34-
run: |
35-
set -euo pipefail
36-
if [[ "$GITHUB_REF_NAME" =~ [a-z] ]]; then
37-
echo "Pre-release ${GITHUB_REF_NAME}: curated notes not required."
38-
exit 0
39-
fi
40-
notes="planning/releases/${GITHUB_REF_NAME}.md"
41-
if [ ! -f "$notes" ]; then
42-
echo "::error::Stable tag ${GITHUB_REF_NAME} has no curated release notes at ${notes}. Write the notes, commit to main, and re-tag." >&2
43-
exit 1
44-
fi
45-
echo "Found curated release notes: ${notes}"
46-
4728
# PyPI is irreversible, so it runs FIRST: if it fails the job stops and no
4829
# GitHub Release is created advertising a version that never reached PyPI.
4930
# `just publish` derives the version from $GITHUB_REF_NAME (the tag name).
5031
# Auth via PyPI Trusted Publishing (OIDC); no PYPI_TOKEN. Needs a Trusted
5132
# Publisher on the lite-bootstrap PyPI project (env: pypi, workflow: release.yml).
5233
- run: just publish
5334

54-
# Description source: planning/releases/<tag>.md if present (verbatim, no
55-
# auto-changelog appended); otherwise GitHub's generated notes. A tag with
56-
# a letter (2.0.0rc1) is a pre-release -> flagged so GitHub won't mark it
57-
# "Latest".
35+
# The Release body is GitHub's generated notes, rendered from the squashed
36+
# PR titles since the previous tag — so a conventional-commit title is what
37+
# a reader gets. A release wanting prose is edited after the fact with
38+
# `gh release edit <tag> --notes-file`. A tag with a letter (2.0.0rc1) is a
39+
# pre-release -> flagged so GitHub won't mark it "Latest".
5840
- name: Resolve release metadata
5941
id: meta
6042
run: |
6143
set -euo pipefail
62-
notes="planning/releases/${GITHUB_REF_NAME}.md"
63-
if [ -f "$notes" ]; then
64-
echo "body_path=$notes" >> "$GITHUB_OUTPUT"
65-
echo "generate_notes=false" >> "$GITHUB_OUTPUT"
66-
else
67-
echo "generate_notes=true" >> "$GITHUB_OUTPUT"
68-
fi
6944
if [[ "$GITHUB_REF_NAME" =~ [a-z] ]]; then
7045
echo "prerelease=true" >> "$GITHUB_OUTPUT"
7146
else
@@ -75,7 +50,6 @@ jobs:
7550
- name: Publish GitHub Release
7651
uses: softprops/action-gh-release@v3
7752
with:
78-
body_path: ${{ steps.meta.outputs.body_path }}
79-
generate_release_notes: ${{ steps.meta.outputs.generate_notes }}
53+
generate_release_notes: true
8054
prerelease: ${{ steps.meta.outputs.prerelease }}
8155
draft: false

‎AGENTS.md‎

Lines changed: 84 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -2,117 +2,105 @@
22

33
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44

5-
## Commands
5+
## Project Overview
66

7-
`just --list` is the source of truth. Non-obvious "which to use when":
7+
`lite-bootstrap` bootstraps a Python microservice with pre-configured observability;
8+
[`CONTEXT.md`](CONTEXT.md) opens with what it does and owns the vocabulary — read it before naming a
9+
concept in code, a test name, or an issue title. The distinction between an instrument being
10+
**configured** and a bootstrapper being **ready**, and between the two kinds of **skip**, is defined
11+
there and is load-bearing throughout.
812

9-
- `just lint` auto-fixes; `just lint-ci` is check-only (CI) and also runs the
10-
planning validator (`planning/index.py --check`). `just check-planning` runs
11-
just that validator.
12-
- `just test -- -k "test_name"` runs a single test; `just test-branch` adds
13-
branch coverage.
13+
## Commands
1414

15-
All commands use `uv run` — do not invoke tools directly (e.g., use `uv run pytest`, not `pytest`).
15+
`just` (task runner) and `uv` (package manager). The [`justfile`](justfile) is the source of truth —
16+
`just --list`, or read it; every non-obvious recipe carries its intent as a comment.
1617

1718
## Architecture
1819

19-
**lite-bootstrap** bootstraps Python microservices with pre-configured
20-
observability instruments: a frozen `BaseConfig` hierarchy describes what the
21-
user wants, `BaseInstrument[ConfigT]` subclasses each own one observability
22-
concern, and a `BaseBootstrapper` per framework decides which instruments apply
23-
and drives their lifecycle.
24-
25-
The authoritative, code-current account of each capability lives in
26-
[`architecture/`](architecture/). **When a change alters a capability's
27-
behavior, update the matching `architecture/<capability>.md` in the same PR** —
28-
that promotion is what keeps `architecture/` true.
29-
30-
Invariants (what must not break) — see the capability page for the full account:
31-
32-
- **Frozen configs, non-frozen instruments.** All `*Config` are frozen for
33-
user-facing immutability; `*Instrument` are non-frozen because `LoggingInstrument`
34-
/ `OpenTelemetryInstrument` cache runtime state, forcing the whole hierarchy
35-
non-frozen. → `architecture/config-model.md`, `architecture/instruments.md`
36-
- **`__post_init__` cascade.** Every config `__post_init__` must call
37-
`super().__post_init__()` (`BaseConfig` is the no-op terminator); `FastAPIConfig`
38-
uses the explicit `super(FastAPIConfig, self)` form under `slots=True`. →
39-
`architecture/config-model.md`
40-
- **`from_dict` vs `from_object` differ on `None`.** `from_dict` passes explicit
41-
`None` through (overrides default); `from_object` filters `None`/missing (default
42-
wins). → `architecture/config-model.md`
43-
- **Optional-dependency guard.** Optional imports sit behind
44-
`if import_checker.is_X_installed:`; code referencing the symbol runs only after
45-
`check_dependencies()` returned True. `ty` models this; other checkers may
46-
false-flag "possibly unbound". → `architecture/instruments.md`
47-
- **Construction skip ordering.** `is_configured` (silent skip) → `check_dependencies`
48-
(warns on configured-but-missing) → instantiate; one INFO summary line via
49-
`build_summary()`. → `architecture/bootstrappers.md`
50-
- **Idempotent teardown.** `teardown()` no-ops when not bootstrapped, runs instruments
51-
in reverse, collects per-instrument errors into one `TeardownError`, resets cached
52-
state in `try/finally`. → `architecture/bootstrappers.md`
53-
- **OTel is single-instance per process.** `set_tracer_provider` is set-once; a second
54-
instance is ignored. Construct exactly one `OpenTelemetryInstrument` per process. →
55-
`architecture/instruments.md`
56-
- **Teardown attaches once.** `_attach_teardown_once` guards against double-attach via
57-
the `_lite_bootstrap_teardown_attached` marker; a second bootstrapper on an already-marked
58-
target warns at construction and its `bootstrap()` raises `ConfigurationError`.
59-
`_lite_bootstrap_*`-prefixed attributes are the sanctioned way to tag user-supplied
60-
apps. → `architecture/bootstrappers.md`
61-
62-
Capability index (all of `architecture/`):
63-
64-
| Capability | File |
65-
|---|---|
66-
| Config model — `BaseConfig`, multiple-inheritance composition, `from_dict`/`from_object`, `UNSET`, `__post_init__` cascade | `architecture/config-model.md` |
67-
| Instruments — `BaseInstrument` lifecycle, catalog, optional-dep guard, non-frozen rationale, cross-instrument integrations (Logging↔Sentry, OTel↔Logging, Pyroscope↔OTel), OTel single-instance | `architecture/instruments.md` |
68-
| Bootstrappers — hierarchy, skip ordering, registry + idempotent teardown, summary logging, teardown-attach seam, app-tagging sentinels | `architecture/bootstrappers.md` |
69-
| Free-threading — nogil support matrix, orjson fallback, single-threaded-init invariant | `architecture/free-threading.md` |
20+
`lite_bootstrap/` is one file per concern and named for what it does: `instruments/<name>_instrument.py`
21+
owns one observability concern, `bootstrappers/<framework>_bootstrapper.py` owns one framework's
22+
bindings, and `import_checker.py` owns every optional-dependency probe. Read them.
7023

71-
Recent design context, bugs, and rationale: bug-audit findings in
72-
`planning/audits/`, post-work reflections in `planning/retros/`, and the audit
73-
arcs recorded as change files under `planning/changes/`. The full extras
74-
matrix is `[project.optional-dependencies]` in `pyproject.toml`.
24+
What reading them will not tell you is why four shapes are load-bearing rather than incidental:
25+
26+
- The instrument × framework matrix stays on the **instrument** axis, not a per-framework adapter
27+
axis ([ADR-0002](docs/adr/0002-keep-per-instrument-axis.md)).
28+
- The double-bootstrap guard is an attribute marker, with two known limits accepted
29+
([ADR-0003](docs/adr/0003-teardown-marker-accepted-limits.md)).
30+
- OpenTelemetry's URL-exclusion policy stays in one method reading its siblings, rather than being
31+
contributed per instrument ([ADR-0004](docs/adr/0004-excluded-urls-stay-one-method.md)).
32+
- `orjson` is an opt-in extra ([ADR-0005](docs/adr/0005-orjson-is-opt-in.md)) and
33+
`typing-extensions` is core's only runtime dependency
34+
([ADR-0007](docs/adr/0007-core-declares-typing-extensions.md)) — together, the reason every
35+
surface this library controls installs on free-threaded CPython.
36+
37+
Behaviour detail has no prose home: it lives in the code and in the `INVARIANT:`-marked tests.
38+
Before writing prose about a capability, run the admission check in **Where a fact goes**.
7539

7640
## Workflow
7741

78-
Planning uses the portable two-axis convention: `architecture/` (repo root) is
79-
the living truth home and promotion target; `planning/changes/` holds the
80-
per-change files. **Start at the
81-
[Quick path](planning/README.md#quick-path-start-here)** in
82-
[`planning/README.md`](planning/README.md) to choose a lane (Full / Lightweight /
83-
Tiny), create a change file, and ship — that file is the authoritative spec, with
84-
copy-and-fill starters in [`planning/_templates/`](planning/_templates/). Run
85-
`just check-planning` to validate changes and `just index` to print the listing.
86-
87-
Repo-local notes:
88-
89-
- Design docs and plans live under `planning/`, **not** under `docs/`, so the
90-
mkdocs site excludes them automatically. When superpowers skills default to
91-
`docs/superpowers/specs/` or `docs/superpowers/plans/`, use a change file
92-
under `planning/changes/` instead.
93-
- `summary` is finalized at ship to state the realized result, in the
94-
implementing PR alongside the code and the `architecture/` promotion — no
95-
post-merge bookkeeping, no file move.
42+
**The spec for a change is its PR body**, not a committed file: why, design, non-goals,
43+
verification, reviewed with the diff. There is no change file and no lane to choose. A trivial PR
44+
(typo, dep bump, formatter, CI tweak) ships a conventional-commit title with no body ceremony.
9645

97-
## Code style
46+
Two things outlive the PR, and there are exactly two places to put them: an alternative **rejected**
47+
with reasoning becomes an ADR in [`docs/adr/`](docs/adr/) (`NNNN-slug.md`, sequential, with a revisit
48+
trigger), and real work **not scheduled** becomes a GitHub issue. There is no third state, and no
49+
separate truth-home directory — a behaviour change is reviewed with the diff, not promoted to a page.
9850

99-
- Line length: 120 characters (ruff enforced)
100-
- Ruff ALL rules enabled; notable ignores: D1 (missing docstrings), S101 (assert), TCH (type-checking imports), FBT (boolean args)
101-
- Type annotations required; checked with `ty`
51+
### Where a fact goes
10252

103-
### Conventions (from prior audit work)
53+
Four homes, one owner each:
10454

105-
These are coding rules. The capability invariants they touch are detailed in
106-
`architecture/` (pointers below).
55+
| Home | Holds |
56+
|---|---|
57+
| `lite_bootstrap/` | anything readable from the module — the default |
58+
| a named test | an **invariant**: must stay true, and a change could silently break it |
59+
| `docs/adr/` | a rejected alternative, with the reasoning that would otherwise be re-litigated |
60+
| `README.md` and `docs/` | anything a user needs |
61+
62+
Before writing a line anywhere:
63+
64+
> Can an agent get this by reading `lite_bootstrap/`? → **don't write it.**
65+
> Would a wrong change here fail a test? → it belongs **in the test**, not in prose.
66+
> Does a user need it? → **`README.md` or `docs/`**.
67+
> Otherwise it does not get written.
68+
69+
**Prose about mechanism has no home. There is no file to add a paragraph to.** This file included:
70+
it is always loaded, so a line that restates a docstring, a justfile comment, or `pyproject.toml`
71+
costs every turn and rots in two places at once. This project tempts that failure mode particularly
72+
hard, because the instrument × framework matrix invites a written index of cells that the file
73+
layout already gives you.
74+
75+
An invariant is a test whose name is the claim, with a docstring opening `INVARIANT:` and a second
76+
paragraph naming **what breaks it** — design rationale, not a report of what this one test catches.
77+
Nothing enforces that docstring shape; it is read at review time. A relative link to an ADR *is*
78+
checked — CI runs lychee `--offline` over every `.md` — but a path named in a docstring or a comment
79+
is not. Both ADRs and `INVARIANT:` docstrings ratchet: nothing prunes a record once its call is
80+
settled. Keeping them lean is a standing habit.
81+
82+
## Code style
10783

108-
- **No `# noqa: PLR2004`**: extract magic values to named locals. Example: `expected_max_age = 600; assert config.cors_max_age == expected_max_age` (not `assert config.cors_max_age == 600 # noqa: PLR2004`).
109-
- **Backward-compat aliases for renames**: when renaming a public class, add a silent module-level alias (`OldName = NewName`) at the end of the file. Re-export both names from `__init__.py` if the old name was publicly exported. Aliases are class assignments, not subclasses — same class object, so `isinstance` behavior is preserved.
110-
- **Frozen-config bypass in `__post_init__`**: `object.__setattr__(self, "field", value)` inside a frozen config's `__post_init__` is acceptable to set a field that requires other config values to construct; document with a one-line comment naming the trade-off (user-facing immutability vs. construction-time mutation). → `architecture/config-model.md`
111-
- **Optional-import guard pattern**: top-level conditional imports (`if import_checker.is_X_installed: import X`) keep optional dependencies actually optional; code referencing `X` runs only after `check_dependencies()` returned True (the `is_configured → check_dependencies → instantiate` flow in `BaseBootstrapper.__init__`). See "Type checking" below. → `architecture/instruments.md`
112-
- **`from_dict` vs `from_object` differ on `None`**: `from_dict` overrides the default with explicit `None`; `from_object` filters `None`/missing so the default wins. Documented in both docstrings (`instruments/base.py`) and pinned by `tests/test_config.py`. Pick `from_dict` if explicit-None override is the load-bearing semantic. → `architecture/config-model.md`
113-
- **`__post_init__` cascade**: every config-class `__post_init__` must call `super().__post_init__()`; `BaseConfig`'s no-op terminates the chain; `FastAPIConfig` needs the explicit `super(FastAPIConfig, self).__post_init__()` form under `slots=True`. → `architecture/config-model.md`
114-
- **`_lite_bootstrap_*` prefix for sentinels on user-supplied apps**: tag a user-supplied framework app with a direct `_lite_bootstrap_`-prefixed attribute (read via `getattr(..., default)` — no SLF violation; write with `# noqa: SLF001`); don't squat in framework namespaces like Starlette's `application.state`. The canonical example is the `_lite_bootstrap_teardown_attached` double-attach marker set by `_attach_teardown_once`. → `architecture/bootstrappers.md`
84+
Three rules that are not visible in the code that follows them:
85+
86+
- **No `# noqa: PLR2004`.** Extract the magic value to a named local instead:
87+
`expected_max_age = 600; assert config.cors_max_age == expected_max_age`.
88+
- **A public rename ships a silent alias.** Add `OldName = NewName` at the end of the module and
89+
re-export both from `__init__.py` if the old name was exported. It is a class assignment, not a
90+
subclass, so `isinstance` still holds. `FreeBootstrapperConfig`, `OpentelemetryConfig` and
91+
`IGNORED_STRUCTLOG_ATTRIBUTES` exist for this reason.
92+
- **Sentinels on a user's app get a `_lite_bootstrap_` prefix.** Set a direct attribute on the app
93+
object; never squat in a framework namespace like Starlette's `application.state`. Read it with
94+
`getattr(target, name, default)` (no SLF violation); write it with `# noqa: SLF001`.
11595

11696
### Type checking
11797

118-
The project uses **`ty`** (Astral's type checker), enforced via `just lint`. No other type checker is supported; the codebase patterns (conditional imports for optional dependencies, covariant `bootstrap_config` narrowing in framework instrument subclasses, TypedDict optional-key access guarded by `.get()` truthiness checks) require a checker that models them correctly. Pyright is not used.
98+
`ty` is the only supported type checker. The codebase leans on patterns a checker has to model
99+
correctly — conditional imports for optional dependencies, covariant `bootstrap_config` narrowing on
100+
instrument subclasses, `TypedDict` optional-key access guarded by `.get()` — and Pyright reports all
101+
three as errors. Do not add it, and do not act on its diagnostics.
102+
103+
Two suppression spellings recur and are both correct as written: `# ty: ignore[invalid-method-override]`
104+
on a framework subclass's `is_configured` classmethod, which narrows its parameter type where `ty`
105+
enforces invariance, and `# ty: ignore[unresolved-attribute]` on the optional OTel/pyroscope symbols
106+
whose guard `ty` does not follow.

0 commit comments

Comments
 (0)