Files
Project-Thoth/codex/chatgpt-capture-mvp/implementation/0003a-conversation-discovery.md
T

1.1 KiB

Implement Task 3A — ChatGPT Conversation Discovery.

Goal: Refactor the extractor so it reliably discovers all conversation-bearing containers before attempting high-quality Markdown conversion.

Primary requirement: Completeness is more important than formatting.

Deliverables:

  • findConversationContainers()
  • classifyContainer(container)
  • extractContainerFallback(container)
  • debug reporting

Rules:

  • Never silently skip a candidate container.
  • If role cannot be determined, mark role: "unknown".
  • If type cannot be determined, mark type: "unknown".
  • Preserve rawText for every discovered container.
  • Preserve a short htmlSnippet for unknown containers.
  • Return debug counts:
    • containersFound
    • parsedMessages
    • userMessages
    • assistantMessages
    • unknownContainers

Do not solve tables, links, bold, lists, or Markdown formatting in this task. Those belong to Task 3B.

Acceptance criteria:

  • Previously lost conversation sections are captured as either user, assistant, or unknown.
  • Unknown sections are included in output rather than dropped.
  • Debug output makes it clear what was discovered and what was not confidently parsed.