From b3b1c54c57bffe4560b3400641b883444b323357 Mon Sep 17 00:00:00 2001 From: gregoryfoster Date: Wed, 2 Dec 2026 22:13:01 +0000 Subject: [PATCH 1/5] #160 test: the parse-agreement fixtures are read on a fixed day, so the dated window can't expire Co-Authored-By: Claude Opus 5.5 --- tests/test_patching.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/test_patching.py b/tests/test_patching.py index 23e4ccf..7b2dd6b 100644 --- a/tests/test_patching.py +++ b/tests/test_patching.py @@ -133,9 +133,11 @@ def test_no_weekday_window_is_unreadable(self): parse_windows("window 2026-11-03 15:37-17:37\n") -def _read_knob(path: Path) -> list[tuple]: +def _read_knob(path: Path, today: str | None = None) -> list[tuple]: + """The skill's reading of the knob at PATH, checked as of TODAY (default: today, UTC).""" + args = ["bash", str(READ_KNOB), "--config", str(path), "--host", "co-processor"] out = subprocess.run( - ["bash", str(READ_KNOB), "--config", str(path), "--host", "co-processor"], + args + (["--today", today] if today else []), capture_output=True, text=True, check=True, @@ -163,6 +165,13 @@ def _ours(text: str) -> list[tuple]: ] +#: The day the fixtures below are read on. The reader reports a dated window as +#: ``past-window`` from the day after it, so a fixed date keeps the dated case +#: about the parse, not the calendar (#160). The committed knob is read on the +#: real date: a past window there is a real finding. +FIXTURE_TODAY = "2026-12-01" + + @pytest.mark.parametrize( "text", [ @@ -178,7 +187,7 @@ def test_the_parse_agrees_with_the_skills_reader(tmp_path, text): assert READ_KNOB.is_file(), f"{READ_KNOB} missing: run `bash .skills/doctor.sh`" knob = tmp_path / "knob" knob.write_text("class production\nposture automatic\n" + text) - assert _ours(knob.read_text()) == _read_knob(knob) + assert _ours(knob.read_text()) == _read_knob(knob, today=FIXTURE_TODAY) def test_the_committed_knob_agrees_with_the_skills_reader(): From 599bd046924cd57e94ddbe0e8f1ca9e2f10f637f Mon Sep 17 00:00:00 2001 From: gregoryfoster Date: Wed, 2 Dec 2026 23:31:16 +0000 Subject: [PATCH 2/5] =?UTF-8?q?#160=20test:=20CR=201=20=E2=80=94=20the=20f?= =?UTF-8?q?ixtures=20are=20read=20the=20day=20before=20their=20dated=20win?= =?UTF-8?q?dow,=20off=20the=20boundary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- tests/test_patching.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_patching.py b/tests/test_patching.py index 7b2dd6b..087d126 100644 --- a/tests/test_patching.py +++ b/tests/test_patching.py @@ -165,11 +165,12 @@ def _ours(text: str) -> list[tuple]: ] -#: The day the fixtures below are read on. The reader reports a dated window as -#: ``past-window`` from the day after it, so a fixed date keeps the dated case -#: about the parse, not the calendar (#160). The committed knob is read on the +#: The day the fixtures below are read on: the day before their dated window, so the +#: case doesn't rest on how the reader treats the window's own day. The reader +#: reports a dated window as ``past-window`` from the day after it, so a fixed date +#: keeps the dated case about the parse, not the calendar (#160). The committed knob is read on the #: real date: a past window there is a real finding. -FIXTURE_TODAY = "2026-12-01" +FIXTURE_TODAY = "2026-11-30" @pytest.mark.parametrize( From 7dcecfb5d7ee8a02c2598cb292e88e4f17b9ed3a Mon Sep 17 00:00:00 2001 From: gregoryfoster Date: Wed, 2 Dec 2026 23:31:16 +0000 Subject: [PATCH 3/5] =?UTF-8?q?#160=20test:=20CR=202=20=E2=80=94=20past-wi?= =?UTF-8?q?ndow=20counts=20from=20the=20day=20after=20the=20one=20the=20wi?= =?UTF-8?q?ndow=20closes=20on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- tests/test_patching.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_patching.py b/tests/test_patching.py index 087d126..43d8d40 100644 --- a/tests/test_patching.py +++ b/tests/test_patching.py @@ -167,7 +167,8 @@ def _ours(text: str) -> list[tuple]: #: The day the fixtures below are read on: the day before their dated window, so the #: case doesn't rest on how the reader treats the window's own day. The reader -#: reports a dated window as ``past-window`` from the day after it, so a fixed date +#: reports a dated window as ``past-window`` from the day after the one it closes +#: on, so a fixed date #: keeps the dated case about the parse, not the calendar (#160). The committed knob is read on the #: real date: a past window there is a real finding. FIXTURE_TODAY = "2026-11-30" From 72bc8943bdb186f20379b50084dbfa60f4578ab2 Mon Sep 17 00:00:00 2001 From: gregoryfoster Date: Wed, 2 Dec 2026 23:31:23 +0000 Subject: [PATCH 4/5] =?UTF-8?q?#160=20test:=20CR=203=20=E2=80=94=20FIXTURE?= =?UTF-8?q?=5FTODAY=20sits=20with=20the=20module's=20other=20fixture=20con?= =?UTF-8?q?stants?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- tests/test_patching.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/test_patching.py b/tests/test_patching.py index 43d8d40..4c6775a 100644 --- a/tests/test_patching.py +++ b/tests/test_patching.py @@ -38,6 +38,13 @@ READ_KNOB = ROOT / "skills" / "patching-hosts" / "scripts" / "read-knob.sh" TUE = "window Tue 05:00-10:00\n" +#: The day the parse-agreement fixtures are read on: the day before their dated +#: window, so the case doesn't rest on how the reader treats the window's own day. +#: The reader reports a dated window as ``past-window`` from the day after the one +#: it closes on, so a fixed date keeps the case about the parse, not the calendar +#: (#160). The committed knob is read on the real date: a past window there is a +#: real finding. +FIXTURE_TODAY = "2026-11-30" #: Tuesday 2026-11-10, the first window under #113. OPEN = datetime(2026, 11, 10, 5, 0, tzinfo=UTC) CLOSE = datetime(2026, 11, 10, 10, 0, tzinfo=UTC) @@ -165,15 +172,6 @@ def _ours(text: str) -> list[tuple]: ] -#: The day the fixtures below are read on: the day before their dated window, so the -#: case doesn't rest on how the reader treats the window's own day. The reader -#: reports a dated window as ``past-window`` from the day after the one it closes -#: on, so a fixed date -#: keeps the dated case about the parse, not the calendar (#160). The committed knob is read on the -#: real date: a past window there is a real finding. -FIXTURE_TODAY = "2026-11-30" - - @pytest.mark.parametrize( "text", [ From ee97ec34517b8e2827c46be6a1b9e314d845c30e Mon Sep 17 00:00:00 2001 From: gregoryfoster Date: Wed, 2 Dec 2026 23:31:26 +0000 Subject: [PATCH 5/5] =?UTF-8?q?#160=20test:=20CR=204=20=E2=80=94=20only=20?= =?UTF-8?q?None=20falls=20back=20to=20the=20real=20date?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- tests/test_patching.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_patching.py b/tests/test_patching.py index 4c6775a..b7afad8 100644 --- a/tests/test_patching.py +++ b/tests/test_patching.py @@ -144,7 +144,7 @@ def _read_knob(path: Path, today: str | None = None) -> list[tuple]: """The skill's reading of the knob at PATH, checked as of TODAY (default: today, UTC).""" args = ["bash", str(READ_KNOB), "--config", str(path), "--host", "co-processor"] out = subprocess.run( - args + (["--today", today] if today else []), + args + (["--today", today] if today is not None else []), capture_output=True, text=True, check=True,