You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(parser): unify ChatGPT typed models and parser extraction #597
ChatGPT ingestion currently has two semantic extraction implementations that can drift.
Evidence from current master:
polylogue/sources/providers/chatgpt_conversation_models.py defines ChatGPTConversation.messages, which finds a root node and follows only children[0].
polylogue/sources/parsers/chatgpt.py defines extract_messages_from_mapping(), which iterates raw mapping values, emits every text+role message, computes branch_index from the parent children array, extracts attachments/content blocks/provider metadata, and sorts by timestamp when available.
Production parsing uses the raw-dict parser path. The typed ChatGPT conversation/message models are exercised by tests and unified semantic adapters, but they are not the production ingestion authority.
For branched ChatGPT exports, those two paths answer different questions: the typed model exposes one primary branch, while the parser preserves all parseable mapping entries with branch metadata. Tests can validate the typed path while ingestion uses different semantics.
Acceptance criteria
Pick one canonical ChatGPT extraction path for ingestion semantics.
Either make the typed ChatGPT model the parser's semantic helper, or remove/demote typed traversal helpers that are not production-canonical.
Add a branched ChatGPT fixture where at least one node has multiple children.
Assert the intended typed projection and production parsed projection agree on message inclusion, ordering, parent references, branch indexes, content blocks, and attachments.
Keep unified schema adapters aligned with the same canonical behavior.
Run the focused ChatGPT parser/model tests plus devtools verify --quick.
Notes
Found during the wide duplication/source-organization audit recorded in .agent/scratch/574-duplication-organization-audit.md.
Superseded by #623. I consolidated this finding into the composite issue so the work can be handled as one coherent slice instead of as a tiny standalone ticket. The original evidence remains available in this issue history.
Activity
Sinity commentedon May 1, 2026
Superseded by #623. I consolidated this finding into the composite issue so the work can be handled as one coherent slice instead of as a tiny standalone ticket. The original evidence remains available in this issue history.