fix: findings from the Cowork test, released as v0.1.1

The operator tested v0.1.0 in Cowork on 2026-11-11. README now says what
was measured there and what was not.

- miljo: no longer claims that kontroll compares "with tolerance, not bit
  for bit" when numpy or scipy differ from the note's versions. kontroll
  always compares byte for byte first, and numpy 2.5.3 gave bit for bit.
- kontroll --alt: show every differing line. The cut-off line now names
  the option instead of only counting the lines left out.
- skill simuler: the question before a run must be answerable with yes or
  no. In the test it became a choice between variants and the run stalled.
- skill forbedre: offer the working copy as a zip when the user cannot
  open the folder it was made in, as in Cowork.

263 tests pass; full kontroll: bit for bit with the note.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-11-11 20:24:58 +01:00
commit 13f6c28dc0
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
11 changed files with 126 additions and 29 deletions

View file

@ -45,6 +45,20 @@ def test_tekst_endret(fasit: str, naa: str) -> None:
assert resultat.detaljer
def test_mange_forskjeller_kuttes_og_alt_viser_resten(monkeypatch: pytest.MonkeyPatch) -> None:
"""Cowork-prøven 2026-11-11: 274 linjer ble kuttet uten at brukeren kunne få dem fram."""
fasit = [f"linje {i}" for i in range(60)]
naa = [f"rad {i}" for i in range(60)]
kort = kontroll.forskjeller(fasit, naa)
assert len(kort) == kontroll.MAKS_LINJER + 1
assert kort[-1].endswith("linjer til; «kontroll --alt» viser alle)")
monkeypatch.setattr(kontroll, "VISNING", {"alt": True})
alle = kontroll.forskjeller(fasit, naa)
assert "-linje 59" in alle
assert "+rad 59" in alle
assert not any("linjer til" in linje for linje in alle)
DAT = "t K Q\n0.00000 1.00000 0.29100\n0.50000 1.10000 0.30000\n"
@ -183,6 +197,18 @@ def test_manglende_fasit(lett_kopi: Path, hjem: Path) -> None:
assert "norge_2025: fant ikke fasit/diagnose_norge_2025.txt" in prosess.stdout
def test_kontroll_avviser_ukjent_valg(hjem: Path) -> None:
prosess = kjor("kontroll", "--alle", hjem=hjem)
assert prosess.returncode == 2
assert "Bruk: kjor.py kontroll [--rask] [--alt]" in prosess.stderr
def test_kontroll_med_alt_gir_samme_dom(lett_kopi: Path, hjem: Path) -> None:
prosess = kjor("--modell", str(lett_kopi), "kontroll", "--rask", "--alt", hjem=hjem)
assert prosess.returncode == 0, prosess.stdout + prosess.stderr
assert "Nivå (uten full kjøring, --rask): bit for bit som notatet." in prosess.stdout
def test_diagnose_krever_eksakt_likhet(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
"""Funn 10: én enhet i siste siffer i diagnosen er endret, ikke innenfor toleranse."""
fasit = tmp_path / "fasit"