python-math #30: feat(delphi): poller-equivalence harness (goal condition 2) — PASSES live on vw + pc-meta-02 - #2657
Draft
jucor wants to merge 1 commit into
Draft
python-math #30: feat(delphi): poller-equivalence harness (goal condition 2) — PASSES live on vw + pc-meta-02#2657jucor wants to merge 1 commit into
jucor wants to merge 1 commit into
Conversation
This was referenced Jul 24, 2026
Draft
Draft
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
3 tasks
…tion 2) — PASSES live on vw + pc-meta-02 ## What The condition-(2) harness from `GOAL_R1_PARITY.md`, specified in `MATH_POLLER_EQUIV_SPEC.md`: one throwaway Postgres, the REAL Clojure math container (`clojure -M:run full`, writing under `MATH_ENV=clj-ref`) and the Python `MathPollerService` (`MATH_ENV=py-shadow`) fed identical timed vote batches — `math_env` being the column that keys each math result row, so the two engines write side by side in the same database. Written rows are compared per batch with the battery acceptance criteria (`StepComparer` projection, plus the quirk-Q7 exclusion: subgroup stats that Clojure computes and persists but nothing downstream ever consumes), extended with a measured Clojure self-jitter envelope for floats — two independent Clojure runs establish the envelope, the float threshold is max(2x envelope, 1e-9), and structural divergences are never excused. The protocol includes a kill+restart seam mid-schedule, and checks `caching_tick` MAX+1 per env, `math_ticks` monotonic, and exactly-once watermark coverage. Guards: NO-COVERAGE (0 aligned batches / `ready:false` / empty store => FAIL — a vacuous pass is structurally impossible), a fail-fast feeder with runner-log evidence capture, and a startup gate closing the quirk-Q19 race window (see below). ## Live results 2026-07-24; stores + verdict JSONs under `real_data/.local/replays/poller_equiv/`: - `vw`: verdict MATCH, 8/8 batches, restart seam after batch 4, ticks OK, 0 envelope-excused divergences. - `pc-meta-02`: verdict MATCH, 6/6 batches, seam after batch 3, moderation stream live (146/146 moderation events woven, matching the Clojure side). ## Real bugs found and fixed by the harness arc - The Python poller stringified pid/tid/zid at ingestion (`postgres.py` `poll_votes`/`poll_votes_since`/`poll_moderation`, `service.py` `str(zid)`) — native DB ints now flow end-to-end, matching Clojure. The `poll_moderation` fix also prevents a would-be regression: int vote-tids vs str mod-tids would have silently disabled comment moderation. - `derive_ptptstats` wrote `conv.participant_info` — a DIFFERENT STATISTIC from Clojure's `prep-ptpt-stats`. It is now the verbatim geometric port (`repness.clj:383-413`: centricness/coreness/extremeness in PCA space, columnized per `conv_man.clj:79-88`, group order via `clojure_hash_map_key_order`). - Quirk Q19 (`CLOJURE_QUIRKS.md`): a GENUINE Clojure production bug — `conv_man.clj` `queue-message-batch!` races on discovery of a brand-new zid (conversation ID): two conv-actors get spawned, one is orphaned, and its accumulated votes are silently lost (reproduced 3x). The harness carves it out via test-input sequencing only: wait for the container's first poll cycle before feeding (the acceptance criteria are untouched). Flagged for an upstream fix. - Five harness-environment findings (the Clojure `postgres://` URL regex, `POLL_FROM_DAYS_AGO` long parse, SSL mode, shared-millisecond cut ties vs strict-`>` watermarks, per-row insert visibility) — fixed in the harness, with the Clojure behaviors documented. ## Testing Harness + poller: 497 passed. Full delphi suite: 1134 passed / 22 skipped / 46 xfailed, zero failures. The live protocol is opt-in (it needs the real services); the unit surface covers every pure decision point. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> commit-id:1530cd63
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
The condition-(2) harness from
GOAL_R1_PARITY.md, specified inMATH_POLLER_EQUIV_SPEC.md: one throwaway Postgres, the REAL Clojure math container (clojure -M:run full, writing underMATH_ENV=clj-ref) and the PythonMathPollerService(MATH_ENV=py-shadow) fed identical timed vote batches —math_envbeing the column that keys each math result row, so the two engines write side by side in the same database.Written rows are compared per batch with the battery acceptance criteria (
StepComparerprojection, plus the quirk-Q7 exclusion: subgroup stats that Clojure computes and persists but nothing downstream ever consumes), extended with a measured Clojure self-jitter envelope for floats — two independent Clojure runs establish the envelope, the float threshold is max(2x envelope, 1e-9), and structural divergences are never excused. The protocol includes a kill+restart seam mid-schedule, and checkscaching_tickMAX+1 per env,math_ticksmonotonic, and exactly-once watermark coverage.Guards: NO-COVERAGE (0 aligned batches /
ready:false/ empty store => FAIL — a vacuous pass is structurally impossible), a fail-fast feeder with runner-log evidence capture, and a startup gate closing the quirk-Q19 race window (see below).Live results
2026-07-24; stores + verdict JSONs under
real_data/.local/replays/poller_equiv/:vw: verdict MATCH, 8/8 batches, restart seam after batch 4, ticks OK, 0 envelope-excused divergences.pc-meta-02: verdict MATCH, 6/6 batches, seam after batch 3, moderation stream live (146/146 moderation events woven, matching the Clojure side).Real bugs found and fixed by the harness arc
postgres.pypoll_votes/poll_votes_since/poll_moderation,service.pystr(zid)) — native DB ints now flow end-to-end, matching Clojure. Thepoll_moderationfix also prevents a would-be regression: int vote-tids vs str mod-tids would have silently disabled comment moderation.derive_ptptstatswroteconv.participant_info— a DIFFERENT STATISTIC from Clojure'sprep-ptpt-stats. It is now the verbatim geometric port (repness.clj:383-413: centricness/coreness/extremeness in PCA space, columnized perconv_man.clj:79-88, group order viaclojure_hash_map_key_order).CLOJURE_QUIRKS.md): a GENUINE Clojure production bug —conv_man.cljqueue-message-batch!races on discovery of a brand-new zid (conversation ID): two conv-actors get spawned, one is orphaned, and its accumulated votes are silently lost (reproduced 3x). The harness carves it out via test-input sequencing only: wait for the container's first poll cycle before feeding (the acceptance criteria are untouched). Flagged for an upstream fix.postgres://URL regex,POLL_FROM_DAYS_AGOlong parse, SSL mode, shared-millisecond cut ties vs strict->watermarks, per-row insert visibility) — fixed in the harness, with the Clojure behaviors documented.Testing
Harness + poller: 497 passed. Full delphi suite: 1134 passed / 22 skipped / 46 xfailed, zero failures. The live protocol is opt-in (it needs the real services); the unit surface covers every pure decision point.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
commit-id:1530cd63
Stack: