python-math #29: feat(math): moderation + restart replay parity — mod_update, restart-seam restore, Q13-Q18 - #2656
Draft
jucor wants to merge 1 commit into
Draft
python-math #29: feat(math): moderation + restart replay parity — mod_update, restart-seam restore, Q13-Q18#2656jucor wants to merge 1 commit into
jucor wants to merge 1 commit into
Conversation
This was referenced Jul 22, 2026
Draft
Draft
Draft
Draft
Draft
Draft
This was referenced Jul 27, 2026
Draft
Draft
python-math #43: docs(delphi): s7 goal state + journal — mode collapse executed, battery 20/20
#2672
Draft
Draft
Draft
5 tasks
3 tasks
…_update, restart-seam restore, Q13-Q18 ## What Certification-battery coverage (the battery: recorded real-conversation vote schedules replayed through both engines and compared step by step) for the goal-doc's moderation-heavy, meta-tids (comments flagged `is_meta`) and restart-seam edge cases, plus the quirks they surfaced. All TDD, ledgered in `CLOJURE_QUIRKS.md`; design in `MOD_RESTART_PORT_SPEC.md`. ## Engine ports - `Conversation.mod_update`: parity with Clojure's `mod-update` reducer (`conversation.clj:846-884`) — a comment flagged `is_meta` lands in BOTH mod sets, un-moderation removes via `disj`, application is order-sensitive, and the moderation watermark takes a max floor. - Quirk Q15: legacy `recompute()` drops the moderation watermark, because Clojure's `conv-update` plumbing graph has no `:last-mod-timestamp` node — replicated. - Quirk Q16: rank-1 principal components collapse ALL projections to `[0,0]` (Clojure's `utils/zip` truncates when pc2 is nil) — replicated at both projection helpers; found by review-driven 1xN/Nx1 tiny-shape tests with Clojure-derived reference values. - group-votes tally source: tallies read from `raw-rating-mat` (the raw, pre-moderation-filter rating matrix; `conversation.clj:601-608`) at ALL THREE tally sites — the compute path, the inline `to_dict`, and `to_dynamo_dict`. ## Replay drivers - Mod-event weaving: votes-then-moderation per batch, one result blob (the JSON math result) per step, plus a load-or-init restart seam (kill the engine mid-schedule, then resume from the persisted blob) — both in BOTH drivers. The blob round-trips via `db/load-conv`'s longs-else-keywords key-fn and `restructure-json-conv`, with full-history `raw-rating-mat` and `mod-update`; the Clojure seam was validated bit-identical pre-seam vs cached recordings. - Restart-seam restore (2026-07-24): `Conversation.from_dict` now restores `zid` (blobs emit `'zid'` in both engine modes), base-clusters (unfold + the legacy un-negate — the warm-start lineage input), and group-votes (tid keys re-intified — the recovery tick's previous-tick priorities input, per quirk Q2: comment priorities always read the PREVIOUS tick's stored group-votes) — mirroring Clojure's `restructure-json-conv` (`conv_man.clj:171-186`). Both restart battery entries MATCH at every step. - Restart-driver review fixes: at the seam, replay woven mods only (Clojure `restart-conv`'s `(mapcat :mods steps-so-far)`, never `dataset.mod_events`); `restart_after` range validation; modified-only comments-CSV header (`is-meta` optional); `to_dynamo_dict` tally gate. ## Quirks resolved this round - Q17 PORTED: legacy `cluster_step` resolves k-means distance ties by Clojure's cleared-clusters map iteration order — insertion order for <=8 clusters, PersistentHashMap trie order (via `clj_hash`) for >8. Quirk Q11's cancellation floor (the Clojure distance formula floors near-coincident distances to exactly 0.0) makes exact 0.0 ties common, not measure-zero. - Q18 CARVED out of certification: `uniqify` merge-center exactness is value-dependent ulp luck, amplified by exact-equality comparison over ~1e-16 cross-engine PCA noise (real-vectorz evidence recorded in the quirk row). Consequently `pc-modheavy-01` + `pc-meta-01` are re-scheduled to single-cut-mod (cold tick, full moderation weave — deterministic), and a NEW entry `pc-meta-02` (moderate coincidence density) carries the warm-chain mod/meta coverage. ## Tooling + results - prodclone extractor (pulls datasets from the production-database clone): additive `is-meta`/`modified` comment columns; certify passes `--comments` for moderation schedules. - Battery: 20 entries — 20/20 MATCH on TWO consecutive full passes (2026-07-24); `divergences.json` at 0 open (70 resolved + 11 carved-out). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> commit-id:9467ac51
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
Certification-battery coverage (the battery: recorded real-conversation vote schedules replayed through both engines and compared step by step) for the goal-doc's moderation-heavy, meta-tids (comments flagged
is_meta) and restart-seam edge cases, plus the quirks they surfaced. All TDD, ledgered inCLOJURE_QUIRKS.md; design inMOD_RESTART_PORT_SPEC.md.Engine ports
Conversation.mod_update: parity with Clojure'smod-updatereducer (conversation.clj:846-884) — a comment flaggedis_metalands in BOTH mod sets, un-moderation removes viadisj, application is order-sensitive, and the moderation watermark takes a max floor.recompute()drops the moderation watermark, because Clojure'sconv-updateplumbing graph has no:last-mod-timestampnode — replicated.[0,0](Clojure'sutils/ziptruncates when pc2 is nil) — replicated at both projection helpers; found by review-driven 1xN/Nx1 tiny-shape tests with Clojure-derived reference values.raw-rating-mat(the raw, pre-moderation-filter rating matrix;conversation.clj:601-608) at ALL THREE tally sites — the compute path, the inlineto_dict, andto_dynamo_dict.Replay drivers
db/load-conv's longs-else-keywords key-fn andrestructure-json-conv, with full-historyraw-rating-matandmod-update; the Clojure seam was validated bit-identical pre-seam vs cached recordings.Conversation.from_dictnow restoreszid(blobs emit'zid'in both engine modes), base-clusters (unfold + the legacy un-negate — the warm-start lineage input), and group-votes (tid keys re-intified — the recovery tick's previous-tick priorities input, per quirk Q2: comment priorities always read the PREVIOUS tick's stored group-votes) — mirroring Clojure'srestructure-json-conv(conv_man.clj:171-186). Both restart battery entries MATCH at every step.restart-conv's(mapcat :mods steps-so-far), neverdataset.mod_events);restart_afterrange validation; modified-only comments-CSV header (is-metaoptional);to_dynamo_dicttally gate.Quirks resolved this round
cluster_stepresolves k-means distance ties by Clojure's cleared-clusters map iteration order — insertion order for <=8 clusters, PersistentHashMap trie order (viaclj_hash) for >8. Quirk Q11's cancellation floor (the Clojure distance formula floors near-coincident distances to exactly 0.0) makes exact 0.0 ties common, not measure-zero.uniqifymerge-center exactness is value-dependent ulp luck, amplified by exact-equality comparison over ~1e-16 cross-engine PCA noise (real-vectorz evidence recorded in the quirk row). Consequentlypc-modheavy-01+pc-meta-01are re-scheduled to single-cut-mod (cold tick, full moderation weave — deterministic), and a NEW entrypc-meta-02(moderate coincidence density) carries the warm-chain mod/meta coverage.Tooling + results
is-meta/modifiedcomment columns; certify passes--commentsfor moderation schedules.divergences.jsonat 0 open (70 resolved + 11 carved-out).Co-Authored-By: Claude Fable 5 noreply@anthropic.com
commit-id:9467ac51
Stack: