diff --git a/synthesize.py b/synthesize.py index f617d54..31d0616 100755 --- a/synthesize.py +++ b/synthesize.py @@ -51,7 +51,7 @@ PRICES = { KINDS = {"idea", "want", "need", "goal", "concern"} STANCES = {"for", "against", "neutral"} -META_COL_RE = re.compile(r"^(id|#|time|timestamp|date|submitted|created|author|user)\b", re.I) +META_COL_RE = re.compile(r"^(id|#|time|timestamp|date|submitted|created|author|user|participant)\b", re.I) # --------------------------------------------------------------------------- # diff --git a/tests/test_synthesize.py b/tests/test_synthesize.py index bf310d5..9e5d9e1 100644 --- a/tests/test_synthesize.py +++ b/tests/test_synthesize.py @@ -76,6 +76,19 @@ class LoadTests(unittest.TestCase): self.assertEqual(loaded["questions"], ["Ideas"]) # Timestamp dropped as meta, Notes dropped as empty self.assertEqual([r["id"] for r in loaded["responses"]], ["r01", "r02"]) + def test_cryptpad_export_meta_columns(self): + # Real CryptPad Form export (2026-10-27): Time, Participant, then the questions. + with tempfile.TemporaryDirectory() as d: + p = Path(d) / "x.csv" + p.write_text("Time,Participant,Ideas,Priorities (pick up to 3).\n" + "2026-10-27T04:38:39.152Z,Guest,Build a shared prompt library members can contribute to.,\"privacy,green energy\"\n" + "2026-10-27T04:39:01.002Z,Guest,Try office hours once a month so people meet each other.,privacy\n" + "2026-10-27T04:39:22.418Z,Guest,Publish the energy numbers somewhere members can see them.,docs and onboarding\n") + loaded = S.load_responses(p) + self.assertEqual(loaded["questions"], ["Ideas"]) + self.assertEqual(loaded["choice_questions"], ["Priorities (pick up to 3)."]) + self.assertEqual(loaded["responses"][0]["choices"]["Priorities (pick up to 3)."], ["privacy", "green energy"]) + def test_choice_heuristic_rejects_long_text(self): self.assertFalse(S.looks_like_choice_column(["a long free-text answer that goes on and on about many things"] * 5)) self.assertTrue(S.looks_like_choice_column(["privacy, green", "green", "privacy; docs", "docs"]))