chore(ruff): the acceptance was whatever the default happened to be [skip-docs]
`uv sync --frozen` resolved ruff 0.15.22 and the tree read clean. A loose install resolves 0.16.6, under which the SAME untouched code reports 148 findings -- 4 more than round 9 counted, because this round added four files. All of them are new rules rather than new defects: 0.16 widened the default rule set to whole families (YTT, ASYNC, PL, ISC, C4, UP, B, SIM, FURB, ...). (`[skip-docs]` is for CLAUDE.md, which a lint-configuration change does not reach. README's developer section IS updated in this commit.) THE DEFECT IS NOT THE 148, IT IS THAT NOBODY CHOSE THEM. `[tool.ruff]` set only `line-length` and `target-version`, so the acceptance was ruff's default, and the tree stayed green only as long as the lockfile froze an old ruff. `select` is now written down: `E4`, `E7`, `E9`, `F` (the historical default), `I` because this tree already keeps imports sorted, and `RUF100` so a `noqa` that has stopped meaning anything is caught rather than left as decoration. Pin `ruff>=0.9` -> `ruff>=0.16.6,<0.17`. Per rule, before -> after: RUF100 50 -> 0, I001 20 -> 0, ISC004 19, PLW1510 8, C408 8, EXE001 6, RUF007 5, PLE2515 4, UP031 3, B017 3, and fourteen more with 2 or fewer -- the families out of the declared set are 0 by selection, and 148 is the number to start from if they are adopted, which is a separate decision and not one to take inside a version-pin commit. 57 were auto-fixed; one E402 was reintroduced by the import-sorting fix merging a block away from its `noqa`, and got the directive back rather than a bare one. `S` IS MEASURED OUT, NOT ASSUMED OUT: it reports 2657 `S101` on a suite whose every assertion is an `assert`, and `S603` flags 19 subprocess calls of which one was ever marked -- selecting it buys 18 suppressions and no defect. Two `noqa` directives naming non-selected rules were dropped with that reason recorded in the configuration instead. THE TWO FILES 0.16 WOULD REFORMAT ARE MARKDOWN, NOT PYTHON: `README.md` and `docs/2026-09-08-blindsone-below-k-k2.md`. 0.16 formats fenced Python inside markdown, and both blocks are RECORDS -- the second is a quotation of `COST_VOCABULARY` as it stood when that measurement was taken. Reformatting a quotation makes it stop being one, so markdown is excluded from the formatter and `ruff format --check .` stays in the acceptance over `.py`. `tools/okf_consume_measure.py` is fenced by the order as run-not-edited, so its three findings are exempted by path with the reason and the debt named, and its bytes are untouched. THE LOCKFILE TRAP IS CLOSED, NOT AVOIDED. `uv.lock` predated the `[ocr]` extra, so any unlocked resolve wrote that extra's transitive tree back into it -- 681 insertions over 4 deletions, twice now, and round 9 recorded the cause as `uv run` OUTSIDE the project when it is `uv run` without `--frozen` INSIDE it. The relock is complete for every declared extra (703 insertions, 26 deletions), and measured after it, an unfrozen `uv run` leaves the file alone. `ruff check src tests tools`, `ruff format --check .` (0.16.6), `mypy src` over 21 files and 1535 tests, all green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
191de89f41
commit
36c201cc8a
37 changed files with 843 additions and 105 deletions
|
|
@ -39,9 +39,9 @@ from llm_ingestion_okf.segmentation import parse_segmentation_plan
|
|||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools"))
|
||||
|
||||
import okf_adjudicate # noqa: E402
|
||||
import okf_adjudicate
|
||||
|
||||
from llm_ingestion_okf import propose as okf_propose_segments # noqa: E402
|
||||
from llm_ingestion_okf import propose as okf_propose_segments
|
||||
|
||||
DOCUMENT = """# N500 Vegbygging
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ from __future__ import annotations
|
|||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from test_import_flow import CONCEPT, StubImportGate, place, run
|
||||
|
||||
from llm_ingestion_okf.materialize import parse_frontmatter
|
||||
from llm_ingestion_okf.profiles import DEFAULT, OKF_V0_2, STRICT_V1, FrontmatterSchema
|
||||
from test_import_flow import CONCEPT, StubImportGate, place, run
|
||||
|
||||
ATTESTED = "Attested Computation"
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ from pathlib import Path
|
|||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools"))
|
||||
|
||||
import okf_cid_measure # noqa: E402
|
||||
import okf_cid_measure
|
||||
|
||||
|
||||
def test_known_cid_fraction() -> None:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import pytest
|
|||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools"))
|
||||
|
||||
import okf_fidelity # noqa: E402
|
||||
import okf_fidelity
|
||||
|
||||
DOCUMENT_XML = """<?xml version="1.0"?>
|
||||
<w:document xmlns:w="x"><w:body>
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ import inspect
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
import llm_ingestion_guard as guard
|
||||
import pytest
|
||||
from llm_ingestion_guard import okf as guard_okf
|
||||
|
||||
from llm_ingestion_okf import guard_adapter, importer, inbox
|
||||
from llm_ingestion_okf.errors import MaterializationError
|
||||
from llm_ingestion_okf.importer import import_bundle
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ import subprocess
|
|||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from test_import_flow import CONCEPT, StubImportGate, place
|
||||
|
||||
from llm_ingestion_okf.importer import import_bundle
|
||||
from llm_ingestion_okf.materialize import parse_frontmatter
|
||||
from llm_ingestion_okf.profiles import DEFAULT, SEGMENTED_V1
|
||||
|
||||
from test_import_flow import CONCEPT, StubImportGate, place
|
||||
|
||||
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
||||
TOOL = PROJECT_ROOT / "tools" / "okf_consume.py"
|
||||
KNOWN_POSITIVE = PROJECT_ROOT / "examples" / "ingest-golden-segmented-okf-v0-2" / "expected-bundle"
|
||||
|
|
@ -120,7 +120,7 @@ def test_the_default_profile_names_no_root_key_and_says_so(tmp_path: Path) -> No
|
|||
gate=StubImportGate(),
|
||||
root_frontmatter_values={"bundle_id": "x"},
|
||||
)
|
||||
except Exception as exc: # noqa: BLE001 - the code is the assertion
|
||||
except Exception as exc:
|
||||
assert getattr(exc, "code", "") == "index_root_frontmatter_unexpected"
|
||||
else: # pragma: no cover - a pass here is the defect
|
||||
raise AssertionError("an unnamed root key was written")
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ from __future__ import annotations
|
|||
from dataclasses import replace
|
||||
from pathlib import Path
|
||||
|
||||
from test_import_flow import EXTERNAL, INGESTED_AT, AUTOMATIC, StubImportGate, place
|
||||
from test_import_flow import AUTOMATIC, EXTERNAL, INGESTED_AT, StubImportGate, place
|
||||
|
||||
from llm_ingestion_okf.importer import ImportResult, import_bundle
|
||||
from llm_ingestion_okf.profiles import DEFAULT, STRUCTURED_V1, BundleProfile, FacetPolicy
|
||||
|
|
|
|||
|
|
@ -20,8 +20,10 @@ PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
|||
sys.path.insert(0, str(PROJECT_ROOT / "src"))
|
||||
|
||||
from llm_ingestion_okf import project # noqa: E402
|
||||
from llm_ingestion_okf.cli import build # noqa: E402
|
||||
from llm_ingestion_okf.cli import parse_args # noqa: E402
|
||||
from llm_ingestion_okf.cli import ( # noqa: E402
|
||||
build,
|
||||
parse_args,
|
||||
)
|
||||
from llm_ingestion_okf.cli import main as okf_main # noqa: E402
|
||||
from llm_ingestion_okf.errors import IngestError # noqa: E402
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ from pathlib import Path
|
|||
from typing import Any
|
||||
|
||||
import pytest
|
||||
from test_import_flow import StubImportGate, place, run
|
||||
|
||||
from llm_ingestion_okf.errors import MaterializationError
|
||||
from llm_ingestion_okf.materialize import (
|
||||
|
|
@ -40,7 +41,6 @@ from llm_ingestion_okf.materialize import (
|
|||
parse_frontmatter,
|
||||
)
|
||||
from llm_ingestion_okf.profiles import DEFAULT, STRICT_V1, BundleProfile, FrontmatterSchema
|
||||
from test_import_flow import StubImportGate, place, run
|
||||
|
||||
INGESTED_AT = "2026-07-25T12:00:00Z"
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ import pytest
|
|||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools"))
|
||||
|
||||
import okf_watch # noqa: E402
|
||||
|
||||
import okf_watch
|
||||
|
||||
# --- the exit-status / empty-result seam -----------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ from pathlib import Path
|
|||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools"))
|
||||
|
||||
import okf_outline_measure # noqa: E402
|
||||
import okf_outline_measure
|
||||
|
||||
from llm_ingestion_okf import propose as okf_propose_segments # noqa: E402
|
||||
from llm_ingestion_okf import propose as okf_propose_segments
|
||||
|
||||
OUTLINE_DOC = """1 Innledning
|
||||
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ def test_the_resolved_binary_is_the_bundled_one_not_a_path_binary() -> None:
|
|||
|
||||
|
||||
def test_the_resolved_binary_reports_the_pinned_version() -> None:
|
||||
import subprocess # noqa: S404 - test-side only; `src/` stays free of it
|
||||
import subprocess
|
||||
|
||||
reported = subprocess.run( # noqa: S603
|
||||
reported = subprocess.run(
|
||||
[str(resolve_pandoc()), "--version"], capture_output=True, text=True
|
||||
).stdout.split("\n")[0]
|
||||
assert reported == f"pandoc {PANDOC_VERSION}"
|
||||
|
|
|
|||
|
|
@ -25,9 +25,8 @@ from pathlib import Path
|
|||
|
||||
import pytest
|
||||
|
||||
from llm_ingestion_okf.segmentation import parse_segmentation_plan
|
||||
|
||||
from llm_ingestion_okf import propose as okf_propose_segments
|
||||
from llm_ingestion_okf.segmentation import parse_segmentation_plan
|
||||
|
||||
DOCUMENT = """# N500 Vegbygging
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import pytest
|
|||
|
||||
from llm_ingestion_okf.extract import extract_text, source_units
|
||||
from llm_ingestion_okf.inbox import render_inbox_concept
|
||||
from llm_ingestion_okf.propose import RULE_SHEET_SECTION, find_candidates
|
||||
from llm_ingestion_okf.profiles import (
|
||||
DEFAULT,
|
||||
SEGMENTED_OKF_V0_2,
|
||||
|
|
@ -36,6 +35,7 @@ from llm_ingestion_okf.profiles import (
|
|||
STRICT_V1,
|
||||
STRUCTURED_V1,
|
||||
)
|
||||
from llm_ingestion_okf.propose import RULE_SHEET_SECTION, find_candidates
|
||||
from llm_ingestion_okf.segmentation import SegmentEntry
|
||||
|
||||
FIXTURES = Path(__file__).parent / "fixtures"
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ import hashlib
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from llm_ingestion_okf.extract import extract_text
|
||||
from llm_ingestion_okf.inbox import GateDecision, process_inbox
|
||||
from llm_ingestion_okf.materialize import NAME_MAX_BYTES
|
||||
from llm_ingestion_okf.profiles import DEFAULT, SEGMENTED_V1
|
||||
from llm_ingestion_okf.extract import extract_text
|
||||
from llm_ingestion_okf.segmentation import (
|
||||
SegmentationPlan,
|
||||
observed_extractor_version,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import hashlib
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from llm_ingestion_okf.extract import extract_text
|
||||
from llm_ingestion_okf.inbox import GateDecision, process_inbox
|
||||
from llm_ingestion_okf.profiles import (
|
||||
DEFAULT,
|
||||
|
|
@ -32,7 +33,6 @@ from llm_ingestion_okf.profiles import (
|
|||
SEGMENTED_V1,
|
||||
STRUCTURED_V1,
|
||||
)
|
||||
from llm_ingestion_okf.extract import extract_text
|
||||
from llm_ingestion_okf.segmentation import (
|
||||
SegmentationPlan,
|
||||
observed_extractor_version,
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ from typing import Any
|
|||
import pytest
|
||||
|
||||
from llm_ingestion_okf.errors import SegmentationError
|
||||
from llm_ingestion_okf.extract import extract_text
|
||||
from llm_ingestion_okf.inbox import GateDecision, process_inbox
|
||||
from llm_ingestion_okf.profiles import SEGMENTED_V1
|
||||
from llm_ingestion_okf.extract import extract_text
|
||||
from llm_ingestion_okf.segmentation import (
|
||||
SegmentationPlan,
|
||||
observed_extractor_version,
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ import hashlib
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from llm_ingestion_okf.extract import extract_text
|
||||
from llm_ingestion_okf.inbox import GateDecision, process_inbox
|
||||
from llm_ingestion_okf.profiles import DEFAULT, SEGMENTED_V1
|
||||
from llm_ingestion_okf.extract import extract_text
|
||||
from llm_ingestion_okf.segmentation import (
|
||||
SegmentationPlan,
|
||||
observed_extractor_version,
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@ from pathlib import Path
|
|||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools"))
|
||||
|
||||
import okf_outline_measure # noqa: E402
|
||||
import okf_table_measure # noqa: E402
|
||||
import okf_outline_measure
|
||||
import okf_table_measure
|
||||
|
||||
from llm_ingestion_okf import propose as okf_propose_segments # noqa: E402
|
||||
from llm_ingestion_okf import propose as okf_propose_segments
|
||||
|
||||
GRID_DOC = """+-------+-------+
|
||||
| Navn | Verdi |
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ from __future__ import annotations
|
|||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(PROJECT_ROOT / "tools"))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue