Configure df12 Python lint gates - #266
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Summary
Validation
WalkthroughThe change adds lint gates, centralises benchmark GitHub transport, hardens subprocess exit handling, refactors benchmark and Cuprum helpers, and expands tests and documentation. ChangesQuality and reliability updates
Sequence Diagram(s)sequenceDiagram
participant BenchmarkCLI
participant GitHubHTTP
participant GitHub
BenchmarkCLI->>GitHubHTTP: Request baseline metadata
GitHubHTTP->>GitHub: Send authenticated HTTPS request
GitHub-->>GitHubHTTP: Return validated JSON
BenchmarkCLI->>GitHubHTTP: Request archive bytes
GitHubHTTP->>GitHub: Follow validated redirect
GitHub-->>GitHubHTTP: Return archive
GitHubHTTP-->>BenchmarkCLI: Return bounded archive bytes
sequenceDiagram
participant CuprumExecution
participant AwaitProcessExit
participant ProcessWait
participant ReturncodePolling
CuprumExecution->>AwaitProcessExit: Await process completion
AwaitProcessExit->>ProcessWait: Start process.wait()
AwaitProcessExit->>ReturncodePolling: Poll process.returncode
ProcessWait-->>AwaitProcessExit: Return exit code
ReturncodePolling-->>AwaitProcessExit: Return published exit code
AwaitProcessExit-->>CuprumExecution: Return selected exit code
Possibly related PRs
Suggested reviewers: Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (3 errors, 7 warnings, 1 inconclusive)
✅ Passed checks (9 passed)
✨ Finishing Touches 💡 2⚔️ Resolve merge conflicts 💡
🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideConfigures a new CPython 3.14-backed df12 Python lint stage and ambrleaks scanner in the lint toolchain, updates documentation and ADRs to describe the five-stage gate, and repairs or strengthens code and tests to satisfy the new lint rules without suppressions (notably assertion messages, dispatch/aliasing, redirect handling, Rust availability checks, benchmarking helpers, and snapshot scanning). Sequence diagram for the updated five-stage make lint processsequenceDiagram
actor Dev
participant Makefile
participant Ruff
participant Interrogate
participant PylintPyPy
participant DF12Pylint
participant Ambrleaks
Dev->>Makefile: make lint
Makefile->>Ruff: $(RUFF) check
Ruff-->>Makefile: status
alt Ruff failure
Makefile-->>Dev: stop lint
else Ruff success
Makefile->>Interrogate: uv run interrogate --fail-under 100 cuprum
Interrogate-->>Makefile: status
alt Interrogate failure
Makefile-->>Dev: stop lint
else Interrogate success
Makefile->>PylintPyPy: $(PYLINT) $(PYLINT_TARGETS)
PylintPyPy-->>Makefile: status
alt PyPy Pylint failure
Makefile-->>Dev: stop lint
else PyPy Pylint success
Makefile->>DF12Pylint: $(DF12_PYLINT) $(PYLINT_TARGETS)
DF12Pylint-->>Makefile: status
alt DF12 Pylint failure
Makefile-->>Dev: stop lint
else DF12 Pylint success
Makefile->>Ambrleaks: $(AMBRLEAKS) cuprum/unittests tests
Ambrleaks-->>Makefile: status
alt Ambrleaks failure
Makefile-->>Dev: stop lint
else Ambrleaks success
Makefile-->>Dev: run Rust and Whitaker lint stages
end
end
end
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
8220ab2 to
8bb484a
Compare
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cuprum/_backend.py`:
- Around line 90-106: Shorten the `_check_rust_available` docstring to a
single-line summary describing its purpose. Remove the redundant `Returns` and
`Notes` sections; retain cache or testing guarantees only as module-level
narrative if they are not otherwise documented.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 89bbec3b-9042-446b-aa10-3b5a85c7c0e0
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (36)
Makefileambrleaks.tomlbenchmarks/_benchmark_types.pybenchmarks/_tee_profile_worker_backend.pybenchmarks/fetch_main_benchmark_baseline.pybenchmarks/pipeline_worker.pybenchmarks/profile_tee_hotpath.pybenchmarks/ratchet_rust_performance.pybenchmarks/tee_profile_profilers.pybenchmarks/tee_profile_scenarios.pybenchmarks/test_stream_microbenchmarks.pycuprum/_backend.pycuprum/_pipeline_internals.pycuprum/_pipeline_streams.pycuprum/adapters/logging_adapter.pycuprum/catalogue.pycuprum/context/state.pycuprum/rust.pycuprum/sh.pycuprum/unittests/test_context.pydocs/adr-003-two-tier-python-linting.mddocs/developers-guide.mdpyproject.tomltests/behaviour/test_benchmark_comparison_report_behaviour.pytests/behaviour/test_benchmark_suite_behaviour.pytests/behaviour/test_builder_library_behaviour.pytests/behaviour/test_concurrency_helper.pytests/behaviour/test_context_hooks.pytests/behaviour/test_env_context_behaviour.pytests/behaviour/test_execution_runtime.pytests/behaviour/test_logging_hook_behaviour.pytests/behaviour/test_pipeline_execution.pytests/behaviour/test_rust_extension_behaviour.pytests/behaviour/test_stream_fidelity.pytests/behaviour/test_structured_events.pytests/behaviour/test_telemetry_adapters.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
leynos/shared-actions(auto-detected)leynos/pylint-pypy-shim(auto-detected)leynos/whitaker(auto-detected)
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@benchmarks/fetch_main_benchmark_baseline.py`:
- Around line 72-106: Update _redirect_request_arguments to bind positional and
keyword inputs using normal Python argument-binding rules, accepting valid mixed
calls such as a positional req/fp with code, msg, headers, and newurl supplied
by keyword while still rejecting missing, duplicate, unexpected, or incorrectly
typed arguments. Preserve the returned _RedirectRequestArguments shape and add
regression coverage for mixed positional/keyword invocations.
In `@benchmarks/test_stream_microbenchmarks.py`:
- Around line 90-93: Update the assertions in the benchmark result checks around
result.ok, result.stdout, output == expected, and consumed == payload_bytes to
report bounded observed state: include result.exit_code for success failures and
expected versus actual lengths or byte counts for output and consumption
mismatches. Keep explicit assertion messages, avoid payload contents, and apply
the same diagnostics to the additional checks around consumed output.
In `@cuprum/rust.py`:
- Around line 34-37: Add regression coverage for the validation in
is_rust_available: mock _check_rust_available() to return a non-bool value and
assert that calling is_rust_available() raises TypeError. Add the unhappy-path
pytest coverage in tests/behaviour/test_rust_extension_behaviour.py while
preserving the existing valid-result and native-agreement tests.
In `@Makefile`:
- Around line 51-59: Pin the DF12 dependency consistently to the immutable
revision recorded in uv.lock: update DF12_PYTHON_LINTS_REF and the AMBRLEAKS
source in Makefile lines 51-59, and align the corresponding df12-python-lints
declaration in pyproject.toml line 20. Regenerate or update uv.lock to preserve
that same revision, while continuing to use the transitively locked pylint
dependency.
In `@tests/behaviour/test_benchmark_suite_behaviour.py`:
- Around line 127-129: Update the assertion messages in the benchmark-plan
behavior test, including then_benchmark_plan_indicates_dry_run and the checks at
the other referenced assertions, so each identifies its specific failed
condition: profile-version mismatch, forbidden “uv run python” text, missing
sys.executable, or missing CUPRUM_STREAM_BACKEND prefix. Keep the assertions and
expected values unchanged while making every diagnostic actionable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 008bfeb3-3a10-4257-81ec-d096227be6a3
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (36)
Makefileambrleaks.tomlbenchmarks/_benchmark_types.pybenchmarks/_tee_profile_worker_backend.pybenchmarks/fetch_main_benchmark_baseline.pybenchmarks/pipeline_worker.pybenchmarks/profile_tee_hotpath.pybenchmarks/ratchet_rust_performance.pybenchmarks/tee_profile_profilers.pybenchmarks/tee_profile_scenarios.pybenchmarks/test_stream_microbenchmarks.pycuprum/_backend.pycuprum/_pipeline_internals.pycuprum/_pipeline_streams.pycuprum/adapters/logging_adapter.pycuprum/catalogue.pycuprum/context/state.pycuprum/rust.pycuprum/sh.pycuprum/unittests/test_context.pydocs/adr-003-two-tier-python-linting.mddocs/developers-guide.mdpyproject.tomltests/behaviour/test_benchmark_comparison_report_behaviour.pytests/behaviour/test_benchmark_suite_behaviour.pytests/behaviour/test_builder_library_behaviour.pytests/behaviour/test_concurrency_helper.pytests/behaviour/test_context_hooks.pytests/behaviour/test_env_context_behaviour.pytests/behaviour/test_execution_runtime.pytests/behaviour/test_logging_hook_behaviour.pytests/behaviour/test_pipeline_execution.pytests/behaviour/test_rust_extension_behaviour.pytests/behaviour/test_stream_fidelity.pytests/behaviour/test_structured_events.pytests/behaviour/test_telemetry_adapters.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
leynos/shared-actions(auto-detected)leynos/pylint-pypy-shim(auto-detected)leynos/whitaker(auto-detected)
|
@coderabbitai review |
✅ Action performedReview finished.
|
9778006 to
b2a2e93
Compare
540d8c4 to
e9346c8
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
Makefile (1)
124-131: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winSplit the
lintrecipe.Line 124 has seven recipe lines. This exceeds checkmake's configured maximum of
five. Extract the Python and Rust lint stages into named targets, and preserve
their current execution order.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Makefile` around lines 124 - 131, Split the lint recipe into named Python and Rust lint targets, moving the existing Ruff, interrogate, Pylint, DF12, and Ambleaks commands into the Python target and the Rust documentation, Clippy, Whitaker, and spelling commands into the Rust target. Update lint to depend on these targets in the same Python-then-Rust order, keeping each command’s behavior unchanged and reducing the lint recipe to at most five lines.Source: Linters/SAST tools
cuprum/unittests/test_logging_adapter_properties.py (1)
62-75: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winReduce the private-helper docstring.
Move the logging-level rationale to an inline comment if it must remain. Leave
_capturing_loggerwith a concise summary. Remove theReturnssection.Proposed fix
def _capturing_logger(name: str) -> tuple[logging.Logger, _CollectingHandler]: - """Return a logger that captures everything, plus its handler. - - The level is set explicitly rather than left at ``NOTSET``, which would - defer to the root logger's ``WARNING`` and make the hook skip its own - debug and info records — a real behaviour of the hook (it checks - ``isEnabledFor`` before building anything), but not the one under test - here. - - Returns - ------- - tuple[logging.Logger, _CollectingHandler] - The configured logger and its attached collecting handler. - """ + """Return a logger and handler that capture all records for tests."""As per path instructions, private functions and methods must use a single-line
summary. Based on learnings, private helpers should retain only narrative text
for non-obvious guarantees.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cuprum/unittests/test_logging_adapter_properties.py` around lines 62 - 75, Reduce the _capturing_logger docstring to a single-line summary, removing the detailed logging-level rationale and Returns section; preserve the rationale only as an inline comment if it is still needed to explain the explicit logger level.Sources: Path instructions, Learnings
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cuprum/_backend.py`:
- Around line 272-275: In the exception handler around _read_backend_env(),
assign str(exc) to a local msg variable before raising, then pass msg to
ValueError while preserving the explicit from exc cause.
In `@cuprum/unittests/test_context_narrowing.py`:
- Around line 197-199: Update the single-step narrowing call immediately before
the assertion to pass parent_is_restricted=True, matching both calls used to
compute two_step. Preserve the existing comparison and ensure empty-parent
inputs retain restricted-parent semantics.
In `@Makefile`:
- Around line 55-58: Update the DF12_PYLINT command so its isolated uv run
explicitly provides pylint and the df12_python_lints plugin through immutable
--with dependencies, or reuse the locked development environment instead.
Preserve the existing Python selection, plugin loading, and enabled-message
configuration.
---
Outside diff comments:
In `@cuprum/unittests/test_logging_adapter_properties.py`:
- Around line 62-75: Reduce the _capturing_logger docstring to a single-line
summary, removing the detailed logging-level rationale and Returns section;
preserve the rationale only as an inline comment if it is still needed to
explain the explicit logger level.
In `@Makefile`:
- Around line 124-131: Split the lint recipe into named Python and Rust lint
targets, moving the existing Ruff, interrogate, Pylint, DF12, and Ambleaks
commands into the Python target and the Rust documentation, Clippy, Whitaker,
and spelling commands into the Rust target. Update lint to depend on these
targets in the same Python-then-Rust order, keeping each command’s behavior
unchanged and reducing the lint recipe to at most five lines.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 15e43c2f-4611-4273-b7fa-a9e221dd8f38
📒 Files selected for processing (35)
Makefilebenchmarks/_github_http.pybenchmarks/_tee_profile_worker_backend.pybenchmarks/comparison_report.pybenchmarks/fetch_main_benchmark_baseline.pybenchmarks/pipeline_throughput_runner.pybenchmarks/ratchet_ratio_extraction.pybenchmarks/ratchet_rust_performance.pycuprum/_backend.pycuprum/_pipeline_wait.pycuprum/_process_lifecycle.pycuprum/adapters/metrics_adapter.pycuprum/catalogue.pycuprum/sh.pycuprum/unittests/test_benchmark_ci_ratchet.pycuprum/unittests/test_catalogue.pycuprum/unittests/test_concurrent_execution.pycuprum/unittests/test_context_narrowing.pycuprum/unittests/test_fetch_main_benchmark_baseline.pycuprum/unittests/test_fetch_main_benchmark_cli.pycuprum/unittests/test_fetch_main_benchmark_redirects.pycuprum/unittests/test_folded_summary.pycuprum/unittests/test_logging_adapter_properties.pycuprum/unittests/test_pipeline_output_options.pycuprum/unittests/test_pipeline_wait.pycuprum/unittests/test_rust_extension.pycuprum/unittests/test_rust_streams.pydocs/debugging/debugging-plan-20260801T140750.mddocs/developers-guide.mdtests/behaviour/_benchmark_ratchet_support.pytests/behaviour/test_concurrency_helper.pytests/behaviour/test_stream_fidelity.pytests/conftest.pytests/helpers/maturin.pytests/helpers/maturin_wheel.py
| try: | ||
| requested = _read_backend_env() | ||
| except ValueError as exc: | ||
| raise ValueError(str(exc)) from exc |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Construct the translated exception message before raising.
Set msg = str(exc) before Line 275. Pass msg to ValueError. Preserve the
explicit cause.
Proposed fix
except ValueError as exc:
- raise ValueError(str(exc)) from exc
+ msg = str(exc)
+ raise ValueError(msg) from excAs per coding guidelines, construct exception messages once in a variable and
pass that object to the exception constructor.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| try: | |
| requested = _read_backend_env() | |
| except ValueError as exc: | |
| raise ValueError(str(exc)) from exc | |
| try: | |
| requested = _read_backend_env() | |
| except ValueError as exc: | |
| msg = str(exc) | |
| raise ValueError(msg) from exc |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@cuprum/_backend.py` around lines 272 - 275, In the exception handler around
_read_backend_env(), assign str(exc) to a local msg variable before raising,
then pass msg to ValueError while preserving the explicit from exc cause.
Source: Coding guidelines
| assert two_step == single_step, ( | ||
| "two narrowing steps should equal the combined intersection" | ||
| ) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve restricted-parent semantics in the single-step comparison.
Line 195 omits parent_is_restricted=True, but Lines 193-194 set it for both
two-step calls. If parent is empty and first & second is non-empty,
two_step is empty while single_step becomes non-empty. The property then
fails despite equivalent narrowing semantics.
Proposed fix
- single_step = _narrow_allowlist(parent, first & second)
+ single_step = _narrow_allowlist(
+ parent,
+ first & second,
+ parent_is_restricted=True,
+ )📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| assert two_step == single_step, ( | |
| "two narrowing steps should equal the combined intersection" | |
| ) | |
| single_step = _narrow_allowlist( | |
| parent, | |
| first & second, | |
| parent_is_restricted=True, | |
| ) | |
| assert two_step == single_step, ( | |
| "two narrowing steps should equal the combined intersection" | |
| ) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@cuprum/unittests/test_context_narrowing.py` around lines 197 - 199, Update
the single-step narrowing call immediately before the assertion to pass
parent_is_restricted=True, matching both calls used to compute two_step.
Preserve the existing comparison and ensure empty-parent inputs retain
restricted-parent semantics.
| DF12_PYLINT = $(PYLINT_ENV) $(UV_RUN_ENV) uv run --isolated \ | ||
| --python $(DF12_PYTHON) pylint \ | ||
| --disable=all --load-plugins=df12_python_lints \ | ||
| --enable=$(DF12_PYLINT_MESSAGES) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
uv run --isolated --python 3.14 python -c '
import importlib.util
print(importlib.util.find_spec("df12_python_lints"))
'
uv run --isolated --python 3.14 pylint --versionRepository: leynos/cuprum
Length of output: 191
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Makefile excerpt:\n'
if [ -f Makefile ]; then
nl -ba Makefile | sed -n '45,70p'
else
echo 'Makefile not found'
fi
printf '\nRelevant pyproject/uv files:\n'
git ls-files | grep -E '(^|/)(pyproject\.toml|uv\.lock|Makefile)$' | while read -r f; do
echo "--- $f"
sed -n '1,220p' "$f"
doneRepository: leynos/cuprum
Length of output: 209
🌐 Web query:
uv run --isolated tool dependencies package management
💡 Result:
The --isolated flag in uv run enforces strict environment isolation by forcing the creation of a fresh, ephemeral virtual environment, bypassing the reuse of the standard project environment [1][2][3]. Key behaviors of uv run --isolated include: Environment Isolation: While uv typically reuses the project's virtual environment (usually located at.venv) for performance, --isolated forces a fresh environment to be generated [1][2][3]. This is useful for testing or ensuring that a command cannot import packages that are not explicitly declared as dependencies [4]. Project Handling: Even when using --isolated, the project itself is still installed into the environment as an editable dependency [1][2][3]. If you need to avoid discovering the project or workspace entirely, the --no-project flag is used instead [1][2]. Layering: If you combine --isolated with flags like --with or --with-requirements, those additional dependencies are layered into a second environment to maintain the required structure [1][2][3]. In summary, --isolated is a tool for strict dependency verification and environment cleanliness, ensuring that commands run in a predictable, freshly-synced state without relying on potentially stale or impure project environments [1][2][4]. You can also control this behavior via the UV_ISOLATED environment variable [1][2][3].
Citations:
- 1: https://docs.astral.sh/uv/reference/cli/
- 2: https://mintlify.wiki/astral-sh/uv/cli/run
- 3: https://docs.rs/uv-cli/latest/uv_cli/struct.RunArgs.html
- 4: Add
--isolatedsupport touv runastral-sh/uv#5471
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Makefile excerpt:\n'
if [ -f Makefile ]; then
awk 'NR>=45 && NR<=70 {printf "%5d %s\n", NR, $0;}' Makefile
else
echo 'Makefile not found'
fi
printf '\nRelevant dependency/config files:\n'
git ls-files | grep -E '(^|/)(pyproject\.toml|uv\.lock|Makefile)$' | while read -r f; do
echo "--- $f"
awk '{printf "%5d %s\n", NR, $0;}' "$f"
doneRepository: leynos/cuprum
Length of output: 50370
Provide the missing isolated tool dependencies.
DF12_PYLINT runs uv run --isolated, and pylint plus df12_python_lints are not supplied for that command. Add the required tools as immutable --with dependencies or run against the locked dev environment.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Makefile` around lines 55 - 58, Update the DF12_PYLINT command so its
isolated uv run explicitly provides pylint and the df12_python_lints plugin
through immutable --with dependencies, or reuse the locked development
environment instead. Preserve the existing Python selection, plugin loading, and
enabled-message configuration.
Add the complete df12-python-lints v0.1.0 Pylint policy and the ambrleaks snapshot scanner under CPython 3.14. Repair every newly exposed finding, preserve urllib redirect compatibility, and document the expanded five-stage Python lint architecture.
Adopt normal Python argument binding for redirect callbacks and cover valid mixed calls plus malformed inputs. Improve bounded benchmark diagnostics and exercise the Rust availability type contract. Pin both df12 tool entry points to the immutable v0.1.0 revision and document the shared release-pin policy.
Preserve main's extracted wheel and pin helpers while retaining the branch's public imports. Use a direct wheel helper re-export and align the inherited documentation with the enabled DF12 rules. Also remove the pre-existing duplicate blank line exposed by the Markdown gate.
Run the CPython 3.14 DF12 pylint pass in an isolated uv environment so its interpreter selection cannot replace the project's existing virtual environment.
Race asyncio's process waiter with the authoritative published return code so an already-reaped child cannot leave command or pipeline execution pending. Share the lifecycle helper across command waiting, pipelines, and termination. Add deterministic regressions for stranded wait futures and repeated short-lived captured commands, and record the falsification evidence that identified the lost wake-up.
Use a compact list for the debugging-plan metadata so the rendered structure does not depend on trailing-space hard breaks and Git's whitespace audit stays clean.
Apply the repository's pinned Ruff formatting to changes replayed onto enforce-pydocstyle so the corrected stack passes check-fmt.
Avoid creating a real default thread-pool executor when unit tests exercise mocked native stream dispatch. This prevents event-loop shutdown stalls in restricted environments without changing production execution.
Pass observe-hook tuples directly to the generic merge helper. This preserves the type compatibility check introduced on the new base and keeps ty output free of redundant-cast diagnostics.
Move GitHub HTTP retries, redirect normalization, and archive download policy into a focused private adapter. Split the redirect-specific tests into their own module so both existing files satisfy the repository's 400-line limit without changing behaviour. Document the adapter's narrow reuse boundary and refresh the deterministic wheel manifest for the new test module.
Restrict the symbolic alphabet to the character classes that affect the splitter's control flow. Keep arbitrary Unicode and additional line-boundary coverage in the adjacent Hypothesis tests while avoiding solver timeouts.
Create the read-only view lazily and reuse it so repeated visibility queries no longer copy the entire project catalogue. Preserve the method API while satisfying the DF12 wrapper lint through real cache initialization.
Move retry classification and schedule exhaustion into a focused helper so `_with_retry` always returns the operation result or raises the caught request failure. Cover successful, non-transient, and exhausted schedules directly. Move the existing CLI-only tests into a focused module to keep the mandated retry test module below the repository's 400-line limit.
Preserve `main`'s Maturin helper boundary while retaining the DF12-compliant direct wheel re-export. Normalize replayed test formatting and keep the context-hooks behaviour module below the enforced line ceiling.
Bound authenticated archive downloads, require HTTPS, and apply the authorization-safe redirect policy consistently. Make lifecycle polling and lazy catalogue publication safe under sustained and concurrent access. Replace timing-sensitive concurrency checks with deterministic overlap instrumentation, terminate every still-running pipeline stage on failure, and make test diagnostics actionable. Keep lint tooling lock-backed and align the supporting documentation with the enforced contracts.
Pin the isolated DF12 Pylint environment explicitly and expose focused Python and Rust lint targets while preserving their execution order. Correct the restricted-parent property comparison, simplify the logging test helper documentation, and keep protected API and CLI literals narrow in the generated spelling policy.
Regenerate the dependency lock from the new base and keep the isolated Pylint version aligned with it. Preserve the base's shared inline-code spelling policy and format replayed Python changes. Make the final-stage pipeline behaviour scenario deterministic and expect the fail-fast upstream termination already required by the unit contract.
7e42909 to
d01957d
Compare
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Our agent can fix these. Install it.
Gates Passed
6 Quality Gates Passed
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| fetch_main_benchmark_baseline.py | 9.69 → 10.00 | Complex Method |
Absence of Expected Change Pattern
- cuprum/tests/helpers/maturin.py is usually changed with: cuprum/cuprum/unittests/test_maturin_build.py
Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
Summary
This branch extends Cuprum's Ruff and PyPy-backed Pylint policy with every
df12-python-lintsv0.1.0 message under CPython 3.14. It also adds therelease's
ambrleaksscanner tomake lintand repairs every finding exposedby the new gates without adding suppressions.
The branch is stacked on PR #234,
which establishes the docstring policy this lint configuration builds upon.
Review walkthrough
and project configuration
for the pinned CPython 3.14 df12 Pylint and
ambrleakscommands.for deterministic public fixture data that resembles POSIX paths.
the commit,
including explicit assertion messages, stronger aliasing and dispatch
structures, and urllib redirect compatibility.
lint architecture decision
and developer guidance.
Validation
make check-fmtmake lintmake typecheckmake test— 815 Python tests passed, 47 skipped; all behavioural groupspassed; all 57 Rust tests passed
make markdownlint— 49 files, zero errors; 16 spelling-helper tests passedmake nixieReferences