From 6d22326887de5ca3dac54530a36c4744bf0dd328 Mon Sep 17 00:00:00 2001 From: Julien Cornebise Date: Mon, 27 Jul 2026 17:39:37 +0200 Subject: [PATCH] =?UTF-8?q?python-math=20#37:=20feat(math):=20mode=20colla?= =?UTF-8?q?pse=20=E2=80=94=20Q15=20watermark=20drop=20unconditional=20(ite?= =?UTF-8?q?m=204=20parked)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `GOAL_CUTOVER_READY.md` Phase 2, chunk C2a of the mode collapse (removing the engine's improved-mode branches so the Clojure-faithful behavior is the only code path). Every votes recompute now drops `last_mod_timestamp` (the moderation watermark) exactly like Clojure — quirk Q15: Clojure's `conv-update` graph has no `:last-mod-timestamp` node, so the watermark never survives a votes recompute (`conversation.clj:780-820`). The former improved-mode persistent watermark is queue item 4 in `POST_CUTOVER_IMPROVEMENTS.md` (its park commit, preserving the deleted code, is minted at the end of the collapse). The improved-mode watermark test is deleted with the branch. commit-id:4aa08bd4 --- delphi/polismath/conversation/conversation.py | 8 ++++---- delphi/tests/test_mod_update_parity.py | 13 ------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/delphi/polismath/conversation/conversation.py b/delphi/polismath/conversation/conversation.py index 46a17745a..efae4236c 100644 --- a/delphi/polismath/conversation/conversation.py +++ b/delphi/polismath/conversation/conversation.py @@ -1440,10 +1440,10 @@ def recompute(self) -> 'Conversation': # has ONLY graph-node keys — :last-mod-timestamp is not one # (conversation.clj:780-820), so every votes recompute DROPS the mod # watermark; blobs carry lastModTimestamp only when the tick's last - # write was a mod-update. Improved mode keeps the persistent watermark - # (documented divergence). tests/test_mod_update_parity.py. - if resolve_engine_mode() == ENGINE_MODE_LEGACY: - result.last_mod_timestamp = None + # write was a mod-update. tests/test_mod_update_parity.py. (The + # former improved-mode persistent watermark is parked: + # POST_CUTOVER_IMPROVEMENTS.md item 4.) + result.last_mod_timestamp = None # Compute PCA and projections result._compute_pca(prev_pca=prev_pca) diff --git a/delphi/tests/test_mod_update_parity.py b/delphi/tests/test_mod_update_parity.py index d28edc7f7..22be4be02 100644 --- a/delphi/tests/test_mod_update_parity.py +++ b/delphi/tests/test_mod_update_parity.py @@ -28,11 +28,6 @@ def legacy_mode(monkeypatch): monkeypatch.setenv(ENGINE_MODE_ENV_VAR, 'clojure-legacy') -@pytest.fixture -def improved_mode(monkeypatch): - monkeypatch.setenv(ENGINE_MODE_ENV_VAR, 'improved') - - def _conv(**sets): conv = Conversation("mod-parity-probe", last_updated=1) for attr, val in sets.items(): @@ -150,14 +145,6 @@ def test_votes_recompute_drops_watermark_in_legacy_mode(self, legacy_mode): conv2 = conv.update_votes(dict(self.BATCH), recompute=True) assert conv2.last_mod_timestamp is None - def test_watermark_persists_in_improved_mode(self, improved_mode): - # Documented divergence: improved mode keeps the sane persistent - # watermark instead of Clojure's graph-drop. - conv = Conversation("wm-keep", last_updated=1) - conv = conv.mod_update([_row(0, mod=-1, modified=777)]) - conv2 = conv.update_votes(dict(self.BATCH), recompute=True) - assert conv2.last_mod_timestamp == 777 - class TestGroupVotesTallyRawMatrix: """Clojure's group-votes aggregates votes-base, whose fnk reads