python-math #21: feat(math): clojure-legacy blob emission + selection parity — Clojure-exact math_main at step 0 - #2649
Draft
jucor wants to merge 1 commit into
Draft
python-math #21: feat(math): clojure-legacy blob emission + selection parity — Clojure-exact math_main at step 0#2649jucor wants to merge 1 commit into
jucor wants to merge 1 commit into
Conversation
This was referenced Jul 22, 2026
Draft
Draft
Draft
Draft
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
… parity — Clojure-exact math_main at step 0
## What
Aligns clojure-legacy emission and selection semantics with Clojure's prep-main blob — the JSON math result (`math_main.data`) as assembled by `prep-main` (conv_man.clj:45-74) — per the step-0 battery diagnosis (journal 2026-07-22 session 3; fingerprints in `docs/divergences.json`).
Battery effect: vw:uniform8 (8 steps), vw:single-cut, and biodiversity:uniform8 (8 steps) went from DIVERGENCE to full MATCH; vw:front-loaded6 remains open (a base-cluster count edge at small N).
## Emission (`Conversation.to_dict`, legacy-gated; improved mode unchanged)
- group-clusters: members emitted as BASE-CLUSTER ids (Clojure's folded form); the unfolded participant ids stay under the snake_case alias `group_clusters`.
- votes-base: per-base-cluster A/D/S (agree/disagree/seen) bucket lists over the sort-by-id clustered members (`agg-bucket-votes-for-tid`, conversation.clj:601-608), instead of whole-matrix integer totals.
- pca: comment-projection and comment-extremity emitted (using the existing functions from fix D12).
- Sign parity: `pca.center`, base-clusters x/y, group-clusters centers, and comment-projection are negated at emission — Delphi's vote matrix is the NEGATION of Clojure's (AGREE = +1 vs -1); comps are covariance-derived and already equal (verified max|clj+py| = 1e-16 on center).
- repness (the per-group representative-comment statistics): emitted as `{gid: [finalize-cmt-stats-shaped entries]}` (repness.clj:173); the internal dict is preserved under `repness_full` for the `from_dict` round-trip.
- mod-in / mod-out / lastModTimestamp: null until moderation has been applied.
- tids (comment ids) emitted in Clojure's column order (first-vote arrival), with the pca arrays permuted alongside; `from_dict` inverts the center sign and restores the arrival tracker in legacy mode.
## Selection/stat parity
- group-aware-consensus multiplies (A+1)/(S+2) over EVERY group — a group with zero seen-votes contributes 1/2 rather than being skipped (conversation.clj:639-641).
- repness rest-stats sum over the OTHER GROUPS only (repness.clj:125), excluding unclustered voters from the comparison domain.
- Exact-score ties in repness/consensus selection resolve by Clojure's stable sort over named-matrix column order: `update_votes` tracks first-vote arrival order, `conv_repness` accepts `tid_order`, and the selectors iterate as-given in legacy mode.
## Also
Skip the three math-tree-hashing harness tests in delphi-only CI images (no `/math` tree in the container; fixes CI run 29881478306's 3 failures).
## Testing
TDD: `tests/test_legacy_blob_shape.py` (25 tests, RED observed per fix).
commit-id:0add28f3
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
Aligns clojure-legacy emission and selection semantics with Clojure's prep-main blob — the JSON math result (
math_main.data) as assembled byprep-main(conv_man.clj:45-74) — per the step-0 battery diagnosis (journal 2026-07-22 session 3; fingerprints indocs/divergences.json).Battery effect: vw:uniform8 (8 steps), vw:single-cut, and biodiversity:uniform8 (8 steps) went from DIVERGENCE to full MATCH; vw:front-loaded6 remains open (a base-cluster count edge at small N).
Emission (
Conversation.to_dict, legacy-gated; improved mode unchanged)group_clusters.agg-bucket-votes-for-tid, conversation.clj:601-608), instead of whole-matrix integer totals.pca.center, base-clusters x/y, group-clusters centers, and comment-projection are negated at emission — Delphi's vote matrix is the NEGATION of Clojure's (AGREE = +1 vs -1); comps are covariance-derived and already equal (verified max|clj+py| = 1e-16 on center).{gid: [finalize-cmt-stats-shaped entries]}(repness.clj:173); the internal dict is preserved underrepness_fullfor thefrom_dictround-trip.from_dictinverts the center sign and restores the arrival tracker in legacy mode.Selection/stat parity
update_votestracks first-vote arrival order,conv_repnessacceptstid_order, and the selectors iterate as-given in legacy mode.Also
Skip the three math-tree-hashing harness tests in delphi-only CI images (no
/mathtree in the container; fixes CI run 29881478306's 3 failures).Testing
TDD:
tests/test_legacy_blob_shape.py(25 tests, RED observed per fix).commit-id:0add28f3
Stack: