{
  "schemaVersion": 2,
  "date": "2026.07.26",
  "publishedAt": "2026-07-26T17:37:28-07:00",
  "timeZone": "America/Los_Angeles",
  "title": "Replacing label import with Qwen email interpretation",
  "publicationStatus": "Published",
  "executiveSummary": [
    "The first Gmail importer incorrectly assumed that the mailbox owner would organize messages under dedicated task and reading labels.",
    "The original design document was re-read and confirmed a different model: scan recent conversations, let an LLM decide what still requires action, identify saved reading, ignore non-actionable mail, and retain the result locally.",
    "Hiro now scans recent non-spam Gmail conversations without requiring labels, includes the owner's sent replies as context, and asks local Qwen 9B to classify each conversation as task, reading, or ignore.",
    "The same Qwen classification assigns every applicable tag from Hiro's controlled tag set, plus task priority. Deterministic source parsing continues to extract due dates and horizon from the conversation.",
    "A controlled live run analyzed three conversations in approximately 7.4 seconds, created one tagged review reading item, ignored two non-actionable conversations, and changed no Gmail state."
  ],
  "workstreams": [
    {
      "title": "Workflow correction",
      "status": "Completed",
      "details": [
        "Removed the Gmail-label requirement from the dashboard and import request.",
        "Changed the import dialog to explain that Qwen reads recent conversations and decides whether each belongs in tasks, reading, or neither.",
        "Added an advanced Gmail search query with a safe default covering recent mail while excluding spam and trash.",
        "Changed one import run to populate both task and reading sections instead of depending on the currently selected dashboard tab."
      ]
    },
    {
      "title": "Conversation ingestion",
      "status": "Completed",
      "details": [
        "Gmail message search results are deduplicated by conversation before full threads are fetched.",
        "Up to eight recent messages from each conversation are assembled into a bounded transcript.",
        "Messages carrying Gmail's sent marker are explicitly identified as owner messages so the model can recognize actions already handled by a reply.",
        "Each analyzed conversation receives a versioned external identifier based on the conversation and its newest message, allowing new replies to be reconsidered while preventing immediate duplicates."
      ]
    },
    {
      "title": "Structured Qwen classification",
      "status": "Completed",
      "details": [
        "The first free-form Qwen prompt consumed its response budget in hidden reasoning and produced no parseable classification.",
        "The classifier was moved to LM Studio's schema-constrained JSON output mode.",
        "The schema requires an exact classification, source-preserving identifier, title, concise notes, priority, reason, and a tag array restricted to Hiro's controlled tag vocabulary.",
        "Hiro accepts structured JSON from either the ordinary response channel or the model's reasoning channel because this Qwen build emits schema-constrained output through the latter.",
        "Tags are validated, normalized, deduplicated, and default to Other only when no specific allowed tag applies."
      ]
    },
    {
      "title": "Review-first persistence",
      "status": "Completed",
      "details": [
        "Tasks and reading items created by Qwen enter Review rather than becoming silently active.",
        "Task due dates retain their source phrase and confidence, and due dates determine Current, Medium-term, Long-term, or Someday horizon.",
        "Ignored conversations are still recorded as analyzed sources so repeated imports do not spend model time on the same mailbox state.",
        "Gmail remains read-only: importing does not apply labels, mark messages read, archive, delete, or otherwise modify mailbox state."
      ]
    }
  ],
  "decisions": [
    "Treat a Gmail conversation rather than an individual message as the unit of interpretation.",
    "Require local Qwen 9B for inbox interpretation instead of falling back to keyword-only task versus reading guesses.",
    "Allow multiple tags on every imported item and restrict model output to the user-approved tag set.",
    "Use schema-constrained generation rather than attempting to repair arbitrary model prose.",
    "Keep imports incremental by persisting ignore decisions and previously imported conversation versions.",
    "Limit the default import batch to twelve recent search results to bound Gmail reads, context size, and local inference time."
  ],
  "validation": [
    {
      "check": "Focused importer and productivity tests",
      "status": "passed",
      "result": "Eleven tests passed, covering task, reading, ignore, multi-tag assignment, priority, due-date extraction, review-first state, incremental deduplication, authorization errors, and existing productivity behavior."
    },
    {
      "check": "Synthetic structured classification",
      "status": "passed",
      "result": "Qwen classified a scheduling request as a high-priority family task and a saved article as a low-priority AI reading item in under four seconds."
    },
    {
      "check": "Controlled live Gmail import",
      "status": "passed",
      "result": "Three recent conversations were analyzed in approximately 7.4 seconds; one tagged reading item was added to Review and two conversations were ignored."
    },
    {
      "check": "Repeat live import",
      "status": "passed",
      "result": "The same three conversation versions were skipped without model analysis in approximately 1.3 seconds, and no duplicate items were created."
    },
    {
      "check": "Private task dashboard",
      "status": "passed",
      "result": "The dashboard returned status 200 and exposed the corrected label-free import interface."
    }
  ],
  "currentState": [
    "Hiro is running the label-free Qwen Gmail importer.",
    "One controlled live reading item is present in Review with a validated tag.",
    "Previously analyzed conversation versions are skipped on repeat imports.",
    "Gmail authorization remains read-only and mailbox state remains unchanged."
  ],
  "limitations": [
    "The first real import intentionally examined only three recent conversations to limit unintended list growth during validation.",
    "Conversation-version ingestion does not yet merge a newly classified reply back into an existing item or implement the original design's completed-item watermark and automatic reopen behavior.",
    "The current UI waits for the import request to finish rather than presenting per-conversation progress.",
    "The quality of task versus reading interpretation and tag assignment will need iteration using the owner's real review corrections."
  ],
  "nextSteps": [
    "Review the controlled reading item and correct its title, notes, or tags if needed.",
    "Run a larger bounded batch after confirming the first classification looks appropriate.",
    "Add a background import job with visible progress before enabling the planned recurring schedule.",
    "Implement thread-to-item refresh and completed-item auto-reopen semantics from the original design.",
    "Preserve model versus human fields separately before automatic re-analysis is enabled."
  ],
  "disclosureNote": "This public entry omits private network addresses, local paths, account details, message identifiers, subjects, senders, bodies, generated item text, process identifiers, and credential information."
}
