Skip to content

chore: stabilize the baseline (RFC 028, phase P0) - #17

Open
supa-chayajin wants to merge 1 commit into
mainfrom
feature/rfc-028-p0
Open

supa-chayajin wants to merge 1 commit into
mainfrom
feature/rfc-028-p0

Conversation

@supa-chayajin

Copy link
Copy Markdown
Member

Summary

Phase P0 of RFC 028 (provider-agnostic LLM layer): stabilize the baseline before the refactor starts. Apart from the fixed install, nothing changes for users.

Changes

  • Fresh installs no longer crash at startup. click is now a declared dependency: Typer 0.28 stopped installing it, and commands/commit.py imports it directly. CI now smoke-tests the built wheel in a clean venv.

  • .devtool.toml.example is valid TOML again. It declared [inference.default] twice, so load_config silently fell back to its built-in defaults for anyone who copied it. A test now parses and loads it.

  • Hermetic tests. Autouse fixtures do three things:

    • block every TCP connection, localhost included;
    • isolate HOME, so a developer's ~/.devtool.toml cannot leak in;
    • reset the DI caches between tests.

    The patch targets in test_option_c_commands.py now point to where the commands look the service up, so the 4 tests that used to reach a real Ollama now pass.

  • The whole suite runs everywhere. The default -m 'not slow' is gone, so CI now runs all 410 tests; 153 of them never ran there before. The dead mock_ollama fixture is removed.

  • Python ≥ 3.12. This covers requires-python, a CI matrix of 3.12–3.14 and the black target. The tomli fallbacks are gone (3.10 reached end-of-life in October 2026).

  • Reproducible lint. Ruff 0.17 widened its default rule set, which gives 162 findings on unchanged main, so the lint jobs were failing. The rule set is now explicit (E4, E7, E9, F, which is what CI enforced before), and ruff, black and isort are pinned. Stricter rules can come in a dedicated PR.

  • Dependency guard test. It fails when devtool/ imports a third-party module that pyproject.toml does not declare. Optional imports inside try/except ImportError are excepted.

Verification

  • make lint: clean (ruff, black, isort).
  • make test: 410 passed in about 4 s, coverage 82.6 %.
  • Clean venv: pip install devtool-*.whl && devtool --help works.
  • The guard test fails as expected when click is removed from a scratch copy of pyproject.toml.

🤖 Generated with Claude Code

- Declare click: Typer 0.28 no longer installs it, so a fresh install
  crashed at startup. CI now smoke-tests the built wheel in a clean venv.
- Fix .devtool.toml.example: it declared [inference.default] twice, which
  is invalid TOML, so load_config silently fell back to its defaults.
  A test now parses and loads the example.
- Make the test suite hermetic: no network (localhost included), an
  isolated HOME, fresh DI caches; patch commands where they look up the
  generation service. The 4 failing slow tests now pass.
- Run the whole suite everywhere (drop the default -m 'not slow') and
  remove the dead mock_ollama fixture.
- Python floor 3.12 (ADR 028-07): requires-python, CI on 3.12-3.14, the
  black target; drop the tomli fallbacks.
- Make ruff's rule set explicit and pin ruff, black and isort: ruff 0.17
  widened its defaults, giving 162 findings on unchanged main.
- Add a guard test: every non-optional third-party import must be a
  declared dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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