From 285455ca6085171111f9052f2ffc7ce83111ee8d Mon Sep 17 00:00:00 2001 From: Thor Whalen <1906276+thorwhalen@users.noreply.github.com> Date: Tue, 23 Jun 2026 22:43:44 +0200 Subject: [PATCH 1/2] TEMP(#11): Windows dol-store diagnostic (--tb=long -l -s + path dump) Temporary: capture the exact path resolution + dol key->path mapping on the Windows runner to pinpoint the persistence-store failure. Reverted once fixed. Claude-Session: https://claude.ai/code/session_019bFtivmtdcXDoCQt3B9gGp --- pyproject.toml | 2 +- tests/test_zzz_windows_diag.py | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 tests/test_zzz_windows_diag.py diff --git a/pyproject.toml b/pyproject.toml index b7c70f9..4d3f2ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,7 +140,7 @@ enabled = false [tool.wads.ci.testing] enabled = true python_versions = ["3.10", "3.12"] -pytest_args = ["-v", "--tb=short"] +pytest_args = ["-v", "--tb=long", "-l", "-s"] coverage_enabled = true coverage_threshold = 0 coverage_report_format = ["term", "xml"] diff --git a/tests/test_zzz_windows_diag.py b/tests/test_zzz_windows_diag.py new file mode 100644 index 0000000..6e7d904 --- /dev/null +++ b/tests/test_zzz_windows_diag.py @@ -0,0 +1,50 @@ +"""TEMP diagnostic for the Windows dol-store failure (#11). Removed once fixed. + +Named test_zzz_* so it runs late, and prints (via `-s`) the exact path resolution +and dol-internal key->path mapping on the Windows runner. +""" + +import os +import tempfile +import traceback + + +def test_windows_store_diagnostic(): + import dol + from dol.dig import inner_most_key + + from ek.stores import data_dir, json_store + + root = tempfile.mkdtemp() + print("\n===== WINDOWS-DIAG START =====") + print("os.sep:", repr(os.sep), "os.path.sep:", repr(os.path.sep)) + print("dol:", getattr(dol, "__version__", "?"), dol.__file__) + + d = data_dir("calibrators", rootdir=root) + print("data_dir:", repr(str(d)), "| isdir:", os.path.isdir(str(d))) + + s = json_store("calibrators", rootdir=root) + print("store.rootdir:", repr(getattr(s, "rootdir", "?"))) + + try: + imk = inner_most_key(s, "cal-v1") + print("inner_most_key('cal-v1'):", repr(imk)) + print("os.path.dirname(imk):", repr(os.path.dirname(imk))) + print("dirname isdir:", os.path.isdir(os.path.dirname(imk))) + except Exception: + print("inner_most_key RAISED:") + traceback.print_exc() + + try: + s["cal-v1"] = {"kind": "platt", "a": 1.0} + print("WRITE OK ->", s["cal-v1"]) + except Exception: + print("WRITE RAISED:") + traceback.print_exc() + + print("calibrators isdir after:", os.path.isdir(str(d))) + print("files under root:") + for dp, _dn, fs in os.walk(root): + for f in fs: + print(" ", os.path.join(dp, f)) + print("===== WINDOWS-DIAG END =====") From d295f2c8bbf54df87ff129cf633e022a3ab0044c Mon Sep 17 00:00:00 2001 From: Thor Whalen <1906276+thorwhalen@users.noreply.github.com> Date: Tue, 23 Jun 2026 22:58:30 +0200 Subject: [PATCH 2/2] stores (#11): require dol>=0.3.45 (fixes dol.Jsons on Windows); drop diagnostic Root cause of the Windows persistence failures was a dol bug: filter_regex compiled regexes with the path-oriented safe_compile, which re.escape's on Windows, so filter_suffixes('.json') (behind dol.Jsons) matched nothing and every store write raised KeyError: 'Key not in store: .json'. Fixed upstream in dol 0.3.45 (i2mint/dol#64); pin it here. Reverts the temporary --tb diagnostic. Closes #11. Claude-Session: https://claude.ai/code/session_019bFtivmtdcXDoCQt3B9gGp --- pyproject.toml | 4 +-- tests/test_zzz_windows_diag.py | 50 ---------------------------------- 2 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 tests/test_zzz_windows_diag.py diff --git a/pyproject.toml b/pyproject.toml index 4d3f2ba..ffaf35f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ authors = [{ name = "Thor Whalen" }] # opt-in extra (see [project.optional-dependencies]); nothing copyleft/non-commercial # is ever a default. See skills/ek-dev-licensing for the policy and landmines. dependencies = [ - "dol", # local-file key-value stores (MutableMapping facades) + "dol>=0.3.45", # local-file key-value stores; >=0.3.45 fixes Jsons on Windows (filter_regex) "config2py", # ~/.local/share/ek/ XDG data-folder resolution "jiwer", # CER/WER (Apache-2.0; rapidfuzz C++ core) "rapidfuzz", # MIT edit distance -- the permissive replacement for GPL Levenshtein @@ -140,7 +140,7 @@ enabled = false [tool.wads.ci.testing] enabled = true python_versions = ["3.10", "3.12"] -pytest_args = ["-v", "--tb=long", "-l", "-s"] +pytest_args = ["-v", "--tb=short"] coverage_enabled = true coverage_threshold = 0 coverage_report_format = ["term", "xml"] diff --git a/tests/test_zzz_windows_diag.py b/tests/test_zzz_windows_diag.py deleted file mode 100644 index 6e7d904..0000000 --- a/tests/test_zzz_windows_diag.py +++ /dev/null @@ -1,50 +0,0 @@ -"""TEMP diagnostic for the Windows dol-store failure (#11). Removed once fixed. - -Named test_zzz_* so it runs late, and prints (via `-s`) the exact path resolution -and dol-internal key->path mapping on the Windows runner. -""" - -import os -import tempfile -import traceback - - -def test_windows_store_diagnostic(): - import dol - from dol.dig import inner_most_key - - from ek.stores import data_dir, json_store - - root = tempfile.mkdtemp() - print("\n===== WINDOWS-DIAG START =====") - print("os.sep:", repr(os.sep), "os.path.sep:", repr(os.path.sep)) - print("dol:", getattr(dol, "__version__", "?"), dol.__file__) - - d = data_dir("calibrators", rootdir=root) - print("data_dir:", repr(str(d)), "| isdir:", os.path.isdir(str(d))) - - s = json_store("calibrators", rootdir=root) - print("store.rootdir:", repr(getattr(s, "rootdir", "?"))) - - try: - imk = inner_most_key(s, "cal-v1") - print("inner_most_key('cal-v1'):", repr(imk)) - print("os.path.dirname(imk):", repr(os.path.dirname(imk))) - print("dirname isdir:", os.path.isdir(os.path.dirname(imk))) - except Exception: - print("inner_most_key RAISED:") - traceback.print_exc() - - try: - s["cal-v1"] = {"kind": "platt", "a": 1.0} - print("WRITE OK ->", s["cal-v1"]) - except Exception: - print("WRITE RAISED:") - traceback.print_exc() - - print("calibrators isdir after:", os.path.isdir(str(d))) - print("files under root:") - for dp, _dn, fs in os.walk(root): - for f in fs: - print(" ", os.path.join(dp, f)) - print("===== WINDOWS-DIAG END =====")