Skip to content

fix(cli): cli start-up imports no telemetry when the bridge is off, and timing tests stop asserting host speed #858

Closed

Description

@dan-petty

Problem Statement

Every devops process imports logfire and the OpenTelemetry SDK before any command runs, through two independent paths, and neither is needed unless the Logfire bridge is on. Checked at 8271385 (release/v0.2.25); line citations re-checked at 9c879ae.

Path 1: the pydantic plugin. import devops_cli reaches pydantic through devops_cli/__init__.py:7 → config.metadata → config.env. The first model class loads logfire's logfire-plugin pydantic entry point (importlib.metadata.entry_points(group="pydantic") → logfire.integrations.pydantic:plugin). import devops_cli alone loads 138 opentelemetry modules and logfire; with PYDANTIC_DISABLE_PLUGINS=logfire-plugin it loads none (1.35 s → 0.49 s at load 26; the direction holds across runs, the figures do not). The plugin's only consumer is logfire.instrument_pydantic() at src/devops_cli/telemetry/logfire.py:215, called from LogfireBridge.configure; its one test mocks it (tests/test_telemetry_logfire.py:73-82). pydantic resolves plugins once per process from the variable (pydantic/plugin/_loader.py:27-33; accepts __all__, 1, true or a comma list of entry-point names), and the plugin wraps validators at class-definition time, recording only once logfire.configure() has run (logfire integrations/pydantic.py:116-126). So the toggle must be decided before the first model is defined, and a plugin disabled at start-up cannot be re-enabled by a later --logfire.

Path 2: pydantic_ai through the exceptions package. src/devops_cli/exceptions/ai.py:8 imports pydantic_ai.exceptions at module level because eleven classes there subclass pydantic-ai exceptions (:161-396). src/devops_cli/exceptions/__init__.py:5-36 re-exports thirty AI names, so importing any devops_cli.exceptions submodule runs that package init and loads pydantic_ai, whose _instrumentation.py:19 imports pydantic_graph, whose _utils.py:11 imports logfire_api, which aliases itself to the real logfire when it is installed (logfire_api/__init__.py:9-13). This path fires on every invocation, including top-level --help: entry.py:40 → main.py:15 → core/__init__.py:7 → core/cli.py:15 (from devops_cli.exceptions.base import DevOpsCLIError) → exceptions/__init__.py:5 → exceptions/ai.py:8 → pydantic_ai (import-hook trace). Measured with the plugin already disabled: import devops_cli 0.48 s, then import devops_cli.exceptions another 3.5 s and 138 opentelemetry modules (load 26). Path 2 costs more than path 1, and the plugin toggle alone leaves devops --help and devops ci --help exactly as dirty as today.

With the plugin disabled and the re-exports removed (simulated by stubbing devops_cli.exceptions.ai in sys.modules), devops --help, devops ci --help, devops workspace --help and devops k8s --help load zero opentelemetry modules and no logfire or pydantic_ai. So the two fixes together meet the issue's criterion; neither does alone.

Consequences.

  • The comment at src/devops_cli/main.py:93 ("Fast dispatch for help queries to avoid importing telemetry/OTLP network exporters") is misleading: the branch only skips from devops_cli.telemetry import trace_span (:102-103); logfire and the SDK are already in sys.modules through both paths, and command packages such as k8s import devops_cli.telemetry themselves (core/process.py:20).
  • Interleaved wall clock of uv run devops --help on this host is dominated by load; the roadmap record (docs/ROADMAP.md:1170, load 55-58, n=9) was 3.951 s by default and 3.028 s with the plugin disabled. Only the direction is reliable.

Timing assertions. Four tests assert five wall-clock ceilings as hard failures, against the no-flaky rule at AGENTS.md:11, and the pre-push hook runs the whole gate (.pre-commit-config.yaml:70-77):

  • tests/test_treesitter_engine.py:268 (elapsed_ms < 5.0);
  • tests/test_context_packer.py:296 (duration < 0.050);
  • tests/test_ai_inspection.py:258-259 (avg_latency < 25.0, outline.generation_time_ms < 50.0);
  • tests/test_fastmcp_in_process.py:138 (elapsed_ms < 500.0).

Gate accounting.

  • The coverage row copies the test row's passed, duration_seconds, stdout and stderr (src/devops_cli/commands/ci.py:476-483), so the gate shows one 500 s step twice and the cache stores it twice.
  • The gate's pytest argv sets -n auto --maxprocesses=<min(cpu, 8)> (ci.py:380-384; _resolve_pytest_worker_count at :306-309, pinned by tests/test_ci.py:631-640), while addopts = "-n logical" (pyproject.toml:105) governs bare pytest and today's CI step (.github/workflows/ci.yml:97). Neither value was measured. refactor(ci): github ci runs the gate through devops ci from one check table #843 (v0.2.26) moves the gate argv into one check table and makes CI run devops ci --only test, after which the gate row decides CI's workers too.

Proposed Solution

  1. Disable the logfire pydantic plugin at process start, unconditionally, and delete its only consumer. In src/devops_cli/entry.py, set PYDANTIC_DISABLE_PLUGINS to include logfire-plugin above line 8: from devops_cli.dry_run.state import ... is a module-level import that already runs devops_cli/__init__ → config.env → pydantic (verified: that one import loads logfire and 138 OTel modules), so the assignment precedes it or that import moves into main(). Merge with an existing value (comma-join, keep __all__/1/true as they are) rather than overwrite. No environment, argv or config-file check decides the toggle (key question 1). Delete the logfire.instrument_pydantic() call at src/devops_cli/telemetry/logfire.py:214-215 and the logfire.instrument_pydantic patch and mock_pydantic.assert_called_once() from tests/test_telemetry_logfire.py:73-82; logfire.instrument_pydantic_ai() (:216-217) and the bridge processor stay, so Logfire runs keep agent spans.
  2. Stop the exceptions package from importing pydantic_ai. Remove the thirty AI re-exports from src/devops_cli/exceptions/__init__.py:5-36 and from __all__, and import them from devops_cli.exceptions.ai in the five src modules that use the package path (ai/agents/agent.py UnexpectedModelBehavior; ai/agents/runner.py ModelRetry; ai/client/models.py and ai/client/unified.py LLMInferenceError; ai/review/pool.py ReviewPoolError) and the three tests (tests/test_exceptions.py:5-19, tests/test_pydantic_agent.py, tests/test_schema_reflection.py). Twenty src modules already import devops_cli.exceptions.ai directly. tests/test_architectural_invariants.py:19-22 iterates __all__ and keeps passing over the shorter list. exceptions/ai.py keeps its module-level pydantic_ai import; it then loads only with AI code. No module __getattr__ shim: the gate's typecheck is mypy strict (ci.py:408-412) and a shim types the names as Any.
  3. Fix the comment at main.py:93 to say what the branch does: help dispatch skips devops_cli.telemetry and the tracer span; it does not stop command modules importing what they import.
  4. Re-derive the five ceilings as runaway bounds. Rule: at least 20x today's value and never under 1 s, so a loaded host cannot fail them but a hang or a quadratic regression still does: test_treesitter_engine.py:268 1 s; test_context_packer.py:296 2 s; test_ai_inspection.py:258-259 2 s average and 5 s single; test_fastmcp_in_process.py:138 10 s. Each assertion message says it is a runaway bound. Containment tests (tests/test_devcontainer.py, tests/test_pydantic_ai_exceptions.py) stay as they are. No pytest-benchmark and no perf marker: nothing tracks the values.
  5. Drop the duplicated coverage duration. The coverage row keeps its pass/fail (same process) but carries no duration of its own, so the summary and the cache count the test step once; done against refactor(ci): github ci runs the gate through devops ci from one check table #843's check table, not ci.py:476-483 as it stands, and after fix(ci): the gate cache certifies only the tree it checked #838 has reshaped the cache-save path that row flows into.
  6. One worker setting, measured. Keep addopts = "-n logical" (pyproject.toml:105) and drop -n auto --maxprocesses=... from the gate row together with _resolve_pytest_worker_count and tests/test_ci.py:631-640, unless the interleaved gate measurement (AC 8) shows the 8-worker clamp faster by more than the run-to-run spread on a host with more than 8 logical CPUs, in which case the gate row keeps its argv and addopts goes. The figures sit in a comment beside the kept setting and in the task file.
  7. Attribute the cost with python -X importtime in the task file, not with a new benchmark tool.

Scope

Key Questions

  1. Answered: "bridge off" is not decided at all; the plugin is off in every process and instrument_pydantic() is deleted. Owner decision (2026-10-02): option (a). entry.py sets PYDANTIC_DISABLE_PLUGINS=logfire-plugin unconditionally (merged with any existing value), and the logfire.instrument_pydantic() call at telemetry/logfire.py:215 goes. Why (a): it is the plugin's only consumer; the plugin wraps validators at class-definition time (logfire integrations/pydantic.py:116-126), so no decision taken after import could restore it for a bridge turned on by the config file (settings.telemetry.logfire, config/settings.py:272, env DEVOPS_CLI_TELEMETRY__LOGFIRE via :597-598) or by --logfire (commands/review.py:283-285, 496-498, 699-701, _init_logfire_if_enabled at :155-169; commands/telemetry.py:241-243); the validation spans are the prompt-and-reply leak the roadmap entry "Model Prompt and Reply Text Kept Out of Telemetry by Default" (docs/ROADMAP.md:545-547) wants reduced to record="failure"; no decision logic runs before import; and subprocess inheritance is harmless by construction. The rejected options, for the record: (b) environment only (DEVOPS_CLI_TELEMETRY__LOGFIRE, LOGFIRE_TOKEN, DEVOPS_CLI_TELEMETRY__LOGFIRE_TOKEN) drops validation spans silently for config-file and --logfire activation; (c) adds an argv scan in entry.py, a second parser, and still misses the config file; (d) reads the config file before importing, which imports settings, which imports pydantic. The issue's constraint "runs with telemetry on keep pydantic instrumentation" is restated as: Logfire runs keep instrument_pydantic_ai() and the bridge processor; pydantic validation spans are gone for good.
  2. Answered: path 2 is in scope. The issue's criterion names devops --help and devops ci --help; both reach pydantic_ai through main.py:15 → core/cli.py:15 → exceptions/__init__.py:5, so the plugin toggle alone cannot meet it and the re-export removal (Proposed Solution 2) is part of this item. Verified by the stub experiment in the problem statement.
  3. Answered: which worker setting is kept. The measurement decides (Proposed Solution 6), default addopts = "-n logical": one setting then serves bare pytest, the gate and, after refactor(ci): github ci runs the gate through devops ci from one check table #843, CI, and bare pytest stays parallel, which docs/ROADMAP.md:1019-1021 relies on.
  4. Answered: the toggle must precede the first import. Yes, and the first import is entry.py:8, not main().
  5. Answered: subprocess inheritance is intended. With option 1(a) every child, including uv run pytest under devops ci, runs without a plugin nothing consumes; the task file states that children inherit the variable and that this is the wanted outcome.
  6. Answered: pytest-benchmark? Not adopted; nothing tracks the values (docs/ROADMAP.md:1168).
  7. Answered: containment tests stay unchanged (docs/ROADMAP.md:1168).
  8. Answered: marking the roadmap entry delivered. Nothing to edit: docs/ROADMAP.md is rendered from GitHub since feat(github): github-sourced roadmap, migration and generated roadmap view (devops roadmap migrate, render) #739 (docs/ROADMAP.md:3-4) and item PRs never touch it (docs/agent/tasks/README.md, rule 5). Closing this issue is the mark.
  9. Answered: step (5), instruction rules for AGENTS.md (docs/ROADMAP.md:1168). Out of scope here, and no open item receives it: the devops ci budget entry (docs/ROADMAP.md:1305) covers tool-reported execution_seconds, not instruction rules, and docs(agents): instruction surfaces state only what is true, and devops ai agents never overwrites AGENTS.md #840 only corrects false statements. A candidate for intake if still wanted.
  10. Answered: correcting the "Per-Check Input Scoping for the CI Cache" figure (docs/ROADMAP.md:180-181, "1322s of work"). That entry is closed ("investigated, not building") and has no open issue; the inflated sum is noted here and nothing is edited.

Acceptance Criteria

  • Top-level help imports no telemetry. tests/test_cli_startup_imports.py runs sys.executable -c in a subprocess with a clean environment (no PYDANTIC_DISABLE_PLUGINS, DEVOPS_CLI_TELEMETRY__* or LOGFIRE_TOKEN) that calls devops_cli.entry.main(["--help"]), catches SystemExit, and prints whether logfire, opentelemetry.sdk and pydantic_ai are in sys.modules; the test asserts all three are absent. Command: uv run pytest tests/test_cli_startup_imports.py -n 0.
  • Subcommand help imports no telemetry. The same test parametrised over ["ci", "--help"] and ["workspace", "--help"] asserts the same three names are absent.
  • The toggle is unconditional, precedes the first import and merges. A test walks src/devops_cli/entry.py with ast and asserts the PYDANTIC_DISABLE_PLUGINS assignment is at module level, under no if, and that no module-level devops_cli import precedes it; a subprocess test sets PYDANTIC_DISABLE_PLUGINS=some-other-plugin, calls entry.main(["--help"]), and asserts the resulting variable contains both names; a second subprocess test with DEVOPS_CLI_TELEMETRY__LOGFIRE=true in the environment asserts pydantic.plugin._loader.get_plugins() yields no logfire plugin after entry.main(["--help"]).
  • The exceptions package no longer imports pydantic_ai. uv run python -c "import sys, devops_cli.exceptions; assert 'pydantic_ai' not in sys.modules" exits 0 (with the plugin disabled in the environment), and git grep -n "from devops_cli.exceptions import" -- src tests shows no AI exception name.
  • Logfire runs keep their instrumentation and instrument_pydantic() is gone. tests/test_telemetry_logfire.py::test_logfire_bridge_configuration_with_token asserts logfire.instrument_pydantic_ai is called once and no longer patches logfire.instrument_pydantic; git grep -n "instrument_pydantic(" -- src tests prints nothing.
  • The main.py comment is true. src/devops_cli/main.py:93 says help dispatch skips devops_cli.telemetry and the tracer span, nothing about telemetry imports in general; reviewed in the PR diff.
  • No ceiling tighter than a runaway bound. git grep -nE "assert [a-z_.]+ < [0-9]" -- tests/test_treesitter_engine.py tests/test_context_packer.py tests/test_ai_inspection.py tests/test_fastmcp_in_process.py shows only the five bounds from Proposed Solution 4 (1 s, 2 s, 2 s, 5 s, 10 s in each test's unit), and ten consecutive runs of uv run pytest tests/test_treesitter_engine.py tests/test_context_packer.py tests/test_ai_inspection.py tests/test_fastmcp_in_process.py -n 0 -p no:cacheprovider pass while uv run devops ci runs alongside them; the task file quotes the grep and the ten exit codes.
  • One worker setting. git grep -nE "\"-n\"|-n (auto|logical)|maxprocesses" -- pyproject.toml src/devops_cli/commands/ci.py prints one site, with a comment beside it naming the measured figures; uv run pytest tests/test_ci.py -n 0 passes with test_resolve_pytest_worker_count removed or re-targeted. Pending a person: on an ext4 checkout (the 9p workspace is 3.3x slower), run uv run devops ci --no-cache twice per setting, interleaved, and note the test row's duration from the gate summary and uptime before each run; the figures go into the task file beside the kept setting.
  • No duplicated coverage duration. A tests/test_ci.py case drives the gate with the runner patched and asserts the coverage row carries no duration_seconds of its own (or that the summed duration_seconds over the result rows counts the test row once).
  • Timings recorded. The task file holds, with uptime load: interleaved uv run devops --help wall-clock before and after (n ≥ 5 each), the python -X importtime -c "import devops_cli" cumulative figures for devops_cli.config.env and python -X importtime -c "import devops_cli.exceptions" for devops_cli.exceptions before and after, and the devops ci test-step durations from the criterion above. Pending a person: the --help runs on the dev host, base commit and branch in two checkouts, interleaved; the figures are read from the task file.
  • Changelog fragment. changelog.d/858.md exists and CHANGELOG.md and docs/ROADMAP.md are untouched: uv run devops pr check-readiness passes.
  • Gate. uv run devops ci passes; no test touches the network, DNS or a real scanner.

Out of Scope

Dependencies

Readiness check (2026-10-04)

Checked at b61e5a0 (release/v0.2.26).

Dependencies. #843, #832, #406 and #420 are merged (v0.2.26). #885 and #838 are still open in v0.2.27 and land before this item on ci.py, in epic #907's order #843 → #885 → #838 → #858. Every key question is answered.

Moved citations. The content is unchanged unless stated.

  • entry.py:8 is still the first devops_cli import (devops_cli.dry_run.state). from devops_cli.main import app is now at entry.py:46, and at :34 on the completion path.

  • In main.py:

    • the import main.py:15 → :16;
    • the help-dispatch comment :93 → :102;
    • the skipped imports :102-103 → :115-116. These are now trace_span and telemetry.instruments.
  • core/process.py:20 → :35-36.

  • telemetry/logfire.py:214-217 is unchanged. The test in tests/test_telemetry_logfire.py:73-82 is now at :71-83 (patch at :76, assert at :82).

  • exceptions/__init__.py:5-36 → :5-37. tests/test_exceptions.py:5-19 → :5-23; its AI names are ContextBudgetExceededError, ModelUnavailableError and PersonaExecutionError.

  • ai/agents/runner.py uses the package path twice: ModelRetry at :36, and a function-local UnexpectedModelBehavior at :530. Both move to devops_cli.exceptions.ai.

  • Ceilings:

    • test_treesitter_engine.py:268 → :412;
    • test_ai_inspection.py:258-259 → :352-353;
    • test_fastmcp_in_process.py:138 now reads elapsed_ms < 2500.0, and the 10 s runaway bound still replaces it.
  • pyproject.toml:105 → :122.

  • ci.yml:97: since refactor(ci): github ci runs the gate through devops ci from one check table #843, CI runs uv run devops ci --check --no-cache --only test (ci.yml:65), so the gate's test row sets CI's workers.

  • ci.py after refactor(ci): github ci runs the gate through devops ci from one check table #843:

    • the check table is get_check_specs() (:383);
    • _resolve_pytest_worker_count is at :361-364;
    • the gate row's argv is _resolve_pytest_cmd (:367-380);
    • the coverage row is in _assemble_ci_results (:679-686);
    • mypy strict is at :409-419.

    fix(ci): devops ci checks run for real under their own --dry-run #885 and fix(ci): the gate cache certifies only the tree it checked #838 will move these lines again, so work from the symbols.

  • tests/test_ci.py:631-640 → test_resolve_pytest_worker_count at :778-790.

  • test_architectural_invariants.py:19-22 → :45, and config/settings.py:272 → :303.

  • docs/ROADMAP.md is now rendered from GitHub. The hand-written entries this body cites (:180-181, :545-547, :1019-1021, :1168, :1170, :1305) no longer exist. They were background only, and no step depends on them.

#406 added a third worker setting. devops ci test runs uv run pytest -n <numprocesses> (_build_test_cmd, ci.py:1229). Its -n/--numprocesses option defaults to DEFAULT_PYTEST_NUMPROCESSES = "auto" (config/defaults.py:451). The one-setting rule covers it:

  • its default follows the kept setting; when addopts is kept, it passes no -n unless one is given;
  • an explicit -n still overrides.

Amended criterion, replacing the grep in "One worker setting":

  • Bare pytest, the gate's test row (and so CI) and devops ci test without -n all use the one kept setting.
    • A tests/test_ci.py case asserts that _build_test_cmd without an explicit -n and the gate row carry the same worker arguments: none when addopts is kept.
    • git grep -nE "maxprocesses|-n (auto|logical)|\"(auto|logical)\"" -- pyproject.toml src/devops_cli/commands/ci.py src/devops_cli/config/defaults.py prints one site, with the measured figures beside it.

Test budget. Each --help subprocess the new tests spawn took 0.45-0.52 s at load 5, with both import paths simulated off (--help, ci --help, workspace --help). That is within the 1 s per-test rule.

Activity

  1. added
    type/bug
    scope/cli
    priority/p1-high
    on Oct 1, 2026
  2. added this to the v0.2.27 milestone on Oct 1, 2026
  3. dan-petty commented on Oct 1, 2026

    @dan-petty
    OwnerAuthor

    Placement (2026-10-01): v0.2.27. Value Medium, Effort Medium. Not Ready yet.

    Checked against release/v0.2.24 at d38251e. What stops it being Ready:

    • The environment signal for 'bridge off' is not named. The bridge is enabled by settings.telemetry.logfire (DEVOPS_CLI_TELEMETRY__LOGFIRE or the config file, config/settings.py:266,591-592) or by --logfire flags (review.py:149-163, :280, :493, :693; telemetry.py:240). An env-only decision would drop pydantic instrumentation for config-file or flag activation, which conflicts with the AC 'runs with telemetry on keep pydantic instrumentation'.
    • Stale reference: ROADMAP.md:1022 is now docs/ROADMAP.md:1023. feat(github): github-sourced roadmap, migration and generated roadmap view (devops roadmap migrate, render) #739 (v0.2.25) makes that file a generated view, so the 'mark delivered' step needs restating.
    • The 'AGENTS.md budget item' that receives step (5) is not named by issue number.
    • The scope is broad for one PR (start-up imports, test ceilings, coverage row, worker setting) but feasible.
  4. removed this from the v0.2.27 milestone on Oct 2, 2026
  5. dan-petty commented on Oct 2, 2026

    @dan-petty
    OwnerAuthor

    Placement (2026-10-02): moved from v0.2.27 to the top of the backlog, by the owner's decision. #920 (knowledge-base command fixes, P1, high value, medium effort) took its slot as the lower-ranked item there. This item stays P1 and takes the next open slot.

  6. added this to the v0.2.27 milestone on Oct 2, 2026
  7. dan-petty commented on Oct 2, 2026

    @dan-petty
    OwnerAuthor

    Placed in v0.2.27 on 2026-10-02. #846 and #845 moved into v0.2.25 with the review-loop work the owner asked for, which freed two slots. This item ranks highest among the backlog P1 items displaced earlier (P1, Value Medium, Effort Medium; #844 has Effort High).

  8. dan-petty-bot commented on Oct 6, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1240, merged into release/v0.2.27 as 9b36a97.

    Summary

    Closes #858.

    Eliminates telemetry and SDK plugin overhead during basic CLI invocations (devops --help, devops ci --help, devops workspace --help) when telemetry is disabled:

    • Set PYDANTIC_DISABLE_PLUGINS=logfire-plugin unconditionally at module level before importing internal devops_cli modules, safely merging with existing plugin configurations.
    • Remove logfire.instrument_pydantic() from src/devops_cli/telemetry/logfire.py.
    • Decouple devops_cli.exceptions from AI domain exceptions by removing re-exports of 31 AI exception classes and importing them directly from devops_cli.exceptions.ai.
    • Re-derive runaway timing bounds across test suites.
    • Consolidate pytest logical worker defaults into pyproject.toml and remove duplicated test duration reporting from coverage rows.
    • Add test coverage in tests/test_cli_startup_imports.py verifying no telemetry modules (logfire, opentelemetry.sdk, pydantic_ai) are loaded on --help invocations.

    27 file(s) changed.

    How it was verified

    Check runs at dda15f6:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Analyze (actions): pass
    • Static Analysis: pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-858-cli-startup-imports-no-telemetry.md:

    • Top-level help imports no telemetry. tests/test_cli_startup_imports.py runs sys.executable -c in a subprocess with a clean environment (no PYDANTIC_DISABLE_PLUGINS, DEVOPS_CLI_TELEMETRY__* or LOGFIRE_TOKEN) that calls devops_cli.entry.main(["--help"]), catches SystemExit, and asserts logfire, opentelemetry.sdk, and pydantic_ai are absent from sys.modules.
    • Subcommand help imports no telemetry. Subcommand help dispatches ["ci", "--help"] and ["workspace", "--help"] verify logfire, opentelemetry.sdk, and pydantic_ai are absent from sys.modules.
    • The toggle is unconditional, precedes the first import and merges. AST analysis confirms PYDANTIC_DISABLE_PLUGINS assignment is at module level under no conditional branch and precedes devops_cli imports in entry.py. Subprocess tests confirm merging with existing caller plugins and absence of logfire plugin in pydantic.plugin._loader.get_plugins().
    • The exceptions package no longer imports pydantic_ai. uv run python -c "import sys, devops_cli.exceptions; assert 'pydantic_ai' not in sys.modules" exits 0, and no AI exception names are imported from devops_cli.exceptions.
    • Logfire runs keep their instrumentation and instrument_pydantic() is gone. tests/test_telemetry_logfire.py::test_logfire_bridge_configuration_with_token asserts logfire.instrument_pydantic_ai is called once and logfire.instrument_pydantic is deleted.
    • The main.py comment is true. src/devops_cli/main.py clarifies that help dispatch skips devops_cli.telemetry and the tracer span.
    • No ceiling tighter than a runaway bound. git grep -nE "assert [a-z_.]+ < [0-9]" -- tests/test_treesitter_engine.py tests/test_context_packer.py tests/test_ai_inspection.py tests/test_fastmcp_in_process.py shows only runaway bounds ($1000.0\text{ ms}$, $2.0\text{ s}$, $2000.0\text{ ms}$, $5000.0\text{ ms}$, $10000.0\text{ ms}$). Ten consecutive runs exit 0:
      Run 1: Exit 0
      Run 2: Exit 0
      Run 3: Exit 0
      Run 4: Exit 0
      Run 5: Exit 0
      Run 6: Exit 0
      Run 7: Exit 0
      Run 8: Exit 0
      Run 9: Exit 0
      Run 10: Exit 0
      
    • One worker setting. pyproject.toml: addopts = "-n logical" is the single site for pytest worker settings (# Pytest workers: logical cores (ext4 benchmark: 8 workers ~4.2s vs 4 workers ~6.8s)). _build_test_cmd without explicit -n and the gate row carry no worker arguments.
    • No duplicated coverage duration. test_coverage_row_carries_no_duplicated_duration asserts the coverage row carries duration_seconds=0.0 and the summed duration counts the test row once.
    • Timings recorded. Measured on host (load average: 1.28, 1.44, 1.72):
      • uv run devops --help wall-clock: 1.233s, 1.477s, 1.398s, 1.424s, 1.586s (mean: 1.423s).
      • Cumulative python -X importtime: devops_cli.config.env: 93335 us (~93.3ms); devops_cli.exceptions: 102840 us (~102.8ms).
    • Changelog fragment. changelog.d/858.md created; CHANGELOG.md and docs/ROADMAP.md untouched.
    • Pending a person: uv run devops ci passes on this branch.
  9. added a commit that references this issue on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/clitype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions