Skip to content

F16.4 — Every member passes its own gate

State Closed
Parent E16
Iteration Release 5
Start Date 2026-10-16
Closed Date 2026-10-16
Predecessors —
Source kiln's pykit-shaped repository run, 2026-10-16, reproduced in pykit the same day

Stories: 3 Closed

Story State Depends on
S16.4.1 — Member test runs leave the scaffold suite to the root Closed (2026-10-16) —
S16.4.2 — Decision: FastApiApp owns server tracing Closed (2026-10-16) —
S16.4.3 — AppConfig(tracing=False) records no spans on current FastAPI Closed (2026-10-16) —

kiln's python-lib gate runs each per-package tool once per workspace member, from that member's own directory: uv run --directory packages/<member> --package <member> <tool>. Only the member's own pyproject.toml tables, and its tests/conftest.py, apply. Two member suites fail that run in pykit's own tree today, independently of kiln. This feature fixes them before the cutover, so F16.3 changes tooling only.

Context

Outcome: of the member-directory failures reproduced at pykit acdf4bc, two were pykit's (the root-only scaffold_venv fixture and FastAPI 0.142's native tracing) and are fixed here; the rest (the root ruff tables, the rn-forge-web guide examples, the import contracts) were kept by F16.3 or fixed by S16.2.1.

S16.4.1 — Member test runs leave the scaffold suite to the root

State: Closed (2026-10-16)

Outcome: the scaffold tests need the whole workspace and run once, from the root, so rn-forge-cli, rn-forge-tooling, rn-forge-fastapi and rn-forge-django deselect them with -m 'not scaffold' in their own pytest table.

Acceptance:

  • For every workspace member, uv run --directory packages/<member> --package <member> pytest -q exits 0, with no fixture 'scaffold_venv' not found error.
  • uv run pytest -m scaffold --collect-only -q at the root collects the six scaffold tests.
  • No member's tests/ has a conftest.py that imports the root conftest.py.

S16.4.2 — Decision: FastApiApp owns server tracing

State: Closed (2026-10-16)

Outcome: the wiring guide states the rule: AppConfig.tracing alone decides server spans unless the application passes telemetry=. The fastapi>=0.141.1 floor stays, because older FastAPI ignores the unknown keyword.

Acceptance:

  • rn-forge-fastapi's wiring guide, under its tracing rule, states that FastApiApp turns off FastAPI's native tracing unless the application passes telemetry=, and that AppConfig.tracing alone decides whether server spans are recorded.

S16.4.3 — AppConfig(tracing=False) records no spans on current FastAPI

State: Closed (2026-10-16)

Outcome: FastApiApp defaults telemetry to {"tracing": False}, and the lock moved to FastAPI 0.142 or later so the suite tests the native path.

Acceptance:

  • uv.lock resolves fastapi at 0.142 or later.
  • A new test sets an SDK TracerProvider with an in-memory exporter. It asserts that a request to FastApiApp(config=AppConfig(tracing=False)) finishes no span, and that a request with tracing=True finishes exactly one SpanKind.SERVER span.
  • uv run --directory packages/rn-forge-fastapi --package rn-forge-fastapi pytest -q exits 0.
  • rn-forge-fastapi's CHANGELOG.md has a Fixed entry under [Unreleased].

Acceptance

set -euo pipefail
members=$(ls packages)

# S16.4.1, S16.4.3: every member's suite passes from its own directory.
for m in $members; do
  uv run --directory "packages/$m" --package "$m" pytest -q
done

# S16.4.1: the scaffold suite still runs from the root.
uv run pytest -m scaffold --collect-only -q | grep -qE '^6/[0-9]+ tests collected'

# S16.4.3: the lock carries native-tracing FastAPI.
uv run python -c 'import fastapi; v = tuple(map(int, fastapi.__version__.split(".")[:2])); assert v >= (0, 142), v'

uv run pytest
uv run pyright
uv run lint-imports
sh docs/_update_board.sh --check

S16.4.2's guide sentence is checked by reading it.

Considered and rejected

  • Make scaffold_venv reachable from each member. A per-member conftest.py cannot import the root one, which the testing rules forbid. Moving the fixture into rn_forge.commons.testing would ship a fixture that only knows pykit's own packages/ layout. Either way, every member run would build all nine wheels and install them from the index.
  • Override kiln's per-member test task in pykit's kiln config. It moves a property of pykit's suites into generated-tooling configuration. The member's own pytest table is where a member-directory run already looks.
  • Narrow pykit's test lint ignore to kiln's default (ANN, D, PLR2004, S101 in place of ALL). It is not needed for the gate, and costs 486 findings across every member's tests/, 337 of them auto-fixable. That is separate work, if the owner wants it.
  • Cap fastapi<0.142. It defers the bug to whoever lifts the cap, and keeps applications that depend on rn-forge-fastapi from current FastAPI.