python-math #18: feat(delphi): prodclone extractor — feature-filtered dataset export (Spec B) - #2646
Draft
jucor wants to merge 1 commit into
Draft
python-math #18: feat(delphi): prodclone extractor — feature-filtered dataset export (Spec B)#2646jucor wants to merge 1 commit into
jucor wants to merge 1 commit into
Conversation
This was referenced Jul 22, 2026
Draft
Draft
Draft
jucor
marked this pull request as draft
July 22, 2026 00:52
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
This was referenced Jul 28, 2026
Draft
3 tasks
… dataset export (Spec B) ## What Adds a prodclone extractor (Spec B) — a tool that exports feature-filtered private test datasets from a production database clone into the replay-data format. Built by a Sonnet agent from SPEC_B: `scripts/prodclone_extract.py` (click CLI with `survey` and `extract` commands) over `polismath/replay/prodclone.py` (pure SQL builders, feature classifiers, CSV writers, slug minting, path-safety guard). ## Privacy invariants (reviewed) - The output path is resolved and asserted to live under `real_data/.local/` (refuses anything else). - The directory prefix is a salted sha256 of the zid (the internal conversation id), never a real report id. - The comment-body column is present but ALWAYS empty (text redacted — the math pipeline never reads it). - The slug-to-zid map lives only in `.local/prodclone_map.json` (merge-updated). The export mirrors the public dataset byte-layout: votes carry the full revote history (`ORDER BY created, ctid` — no dedup); comment agrees/disagrees are counted over all vote rows the way `report.ts` does. ## Feature classes modheavy / revote / banned (voters with `participants.mod = -1`) / meta / zerovote / smallmix / midmix (unremarkable-volume coverage). ## Testing 52 passed — pure-function units (no DB) plus one integration test on the repo's `require_polis_postgres` throwaway-Postgres fixture, round-tripping survey → extract → `load_export_votes`. TDD (RED commit first in the agent's clone). commit-id:9f45b733
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
Adds a prodclone extractor (Spec B) — a tool that exports feature-filtered private test datasets from a production database clone into the replay-data format. Built by a Sonnet agent from SPEC_B:
scripts/prodclone_extract.py(click CLI withsurveyandextractcommands) overpolismath/replay/prodclone.py(pure SQL builders, feature classifiers, CSV writers, slug minting, path-safety guard).Privacy invariants (reviewed)
real_data/.local/(refuses anything else)..local/prodclone_map.json(merge-updated).The export mirrors the public dataset byte-layout: votes carry the full revote history (
ORDER BY created, ctid— no dedup); comment agrees/disagrees are counted over all vote rows the wayreport.tsdoes.Feature classes
modheavy / revote / banned (voters with
participants.mod = -1) / meta / zerovote / smallmix / midmix (unremarkable-volume coverage).Testing
52 passed — pure-function units (no DB) plus one integration test on the repo's
require_polis_postgresthrowaway-Postgres fixture, round-tripping survey → extract →load_export_votes. TDD (RED commit first in the agent's clone).commit-id:9f45b733
Stack: