python-math #17: feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes - #2645
Draft
jucor wants to merge 1 commit into
Draft
python-math #17: feat(math): un-mirror priority_metric (#2571 resolved) + Q2 prev-tick group-votes#2645jucor wants to merge 1 commit into
jucor wants to merge 1 commit into
Conversation
This was referenced Jul 22, 2026
Draft
Draft
Draft
Draft
jucor
marked this pull request as draft
July 22, 2026 00:52
This was referenced Jul 25, 2026
Draft
Draft
Draft
python-math #43: docs(delphi): s7 goal state + journal — mode collapse executed, battery 20/20
#2672
Draft
Draft
Draft
This was referenced Jul 28, 2026
Draft
3 tasks
…d) + Q2 prev-tick group-votes ## What Two changes to comment prioritization: - Restore the real `priority_metric` branching formula in BOTH engine modes. Clojure HEAD passes a real boolean since #2611 (conversation.clj:686, merged 2026-07-18), so the all-49 mirror of bug #1961 (the meta-tid routing bug that flattened every comment's priority to ~49, which #2571 had us reproduce for parity) is no longer the parity behavior — the correct formula is. - Replicate quirk Q2 (`delphi/docs/CLOJURE_QUIRKS.md`): Clojure's `:comment-priorities` node SHADOWS its current-tick group-votes input with `(:group-votes conv)` — the PREVIOUS tick's stored value (conversation.clj:658). clojure-legacy mode (the engine setting that reproduces the old Clojure engine's behavior exactly) now consumes the captured previous-tick group-votes (`{}` on the first tick, matching Clojure's nil); improved mode keeps the current-tick read. ## How it works The current tick's group-votes are stored on `self.group_votes` each tick in both modes (like `self.pca`), as the in-memory analogue of Clojure persisting `:group-votes` in `math_main` (the math results table). The restart seam — reloading group-votes on `from_dict` / poller reload — is deferred to the poller equivalence phase and noted in the journal. Stale-mirror test sites reworked: - The designed xfail on `test_priority_metric_non_meta_squared` is harvested: the formula test now gates. - `TestD12CommentPriorities` now pins varied (non-all-49) Python output plus coverage, instead of the mirror signature. - The exact-value comparison in `test_legacy_clojure_regression.py::test_comment_priorities` is xfailed for ALL variants — the reference blobs predate the Clojure #2611 fix, so value parity is validated by the H-B replay battery (the `scripts/certify.py` Clojure-vs-Python replay comparison) until the blobs are regenerated with a fixed generator. ## Testing TDD: `tests/test_priority_unmirror.py` — RED observed (formula tests fail on the mirror; prev-tick flow + group_votes storage fail on the old wiring), 7 GREEN after. Targeted runs: 13 passed (unmirror + float-serialization), 21 passed (D12/priority subset), 4 xfailed (legacy regression value comparisons). commit-id:a85047a7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two changes to comment prioritization:
priority_metricbranching formula in BOTH engine modes. Clojure HEAD passes a real boolean since fix(math): restore priority-based comment routing (regression from #1961) #2611 (conversation.clj:686, merged 2026-07-18), so the all-49 mirror of bug cutoff for large-convo processing if > 5000 comments #1961 (the meta-tid routing bug that flattened every comment's priority to ~49, which Clojure math.repness: priority-metric meta detection treats 0 as truthy, assigning META_PRIORITY^2 to every comment #2571 had us reproduce for parity) is no longer the parity behavior — the correct formula is.delphi/docs/CLOJURE_QUIRKS.md): Clojure's:comment-prioritiesnode SHADOWS its current-tick group-votes input with(:group-votes conv)— the PREVIOUS tick's stored value (conversation.clj:658). clojure-legacy mode (the engine setting that reproduces the old Clojure engine's behavior exactly) now consumes the captured previous-tick group-votes ({}on the first tick, matching Clojure's nil); improved mode keeps the current-tick read.How it works
The current tick's group-votes are stored on
self.group_voteseach tick in both modes (likeself.pca), as the in-memory analogue of Clojure persisting:group-votesinmath_main(the math results table). The restart seam — reloading group-votes onfrom_dict/ poller reload — is deferred to the poller equivalence phase and noted in the journal.Stale-mirror test sites reworked:
test_priority_metric_non_meta_squaredis harvested: the formula test now gates.TestD12CommentPrioritiesnow pins varied (non-all-49) Python output plus coverage, instead of the mirror signature.test_legacy_clojure_regression.py::test_comment_prioritiesis xfailed for ALL variants — the reference blobs predate the Clojure fix(math): restore priority-based comment routing (regression from #1961) #2611 fix, so value parity is validated by the H-B replay battery (thescripts/certify.pyClojure-vs-Python replay comparison) until the blobs are regenerated with a fixed generator.Testing
TDD:
tests/test_priority_unmirror.py— RED observed (formula tests fail on the mirror; prev-tick flow + group_votes storage fail on the old wiring), 7 GREEN after. Targeted runs: 13 passed (unmirror + float-serialization), 21 passed (D12/priority subset), 4 xfailed (legacy regression value comparisons).commit-id:a85047a7
Stack: