{
  "schemaVersion": 2,
  "date": "2026.07.26",
  "publishedAt": "2026-07-26T18:39:15-07:00",
  "timeZone": "America/Los_Angeles",
  "title": "Teaching task rejection and enforcing Gmail importance",
  "publicationStatus": "Published",
  "executiveSummary": [
    "The Gmail productivity workflow now uses Gmail importance as a hard outer gate. Non-important conversations never reach local Qwen or participate in task or reading creation.",
    "Task analysis applies the date-window query only within Gmail Important. The reading list is a deterministic narrower mirror of conversations that are both Important and Unread.",
    "Removing a Gmail-imported task now records an owner rejection on its durable source. Future classifications receive compact recent examples of deleted imported tasks as negative evidence, including historical soft-deletions created before this change.",
    "A live audit found that the previous broad scan had created forty-nine reading entries from mail outside the intended Gmail section. Those entries were soft-removed with audit and source history retained, then replaced by the forty conversations actually in Important and Unread.",
    "Hiro was restarted with the corrected policy. The private remote page now shows the Important-only query and explains the separate task and reading scopes."
  ],
  "workstreams": [
    {
      "title": "Owner-removal learning loop",
      "status": "Completed",
      "details": [
        "Enhanced task soft-deletion to identify Gmail provenance before removal.",
        "Owner-deleted imported tasks mark their source as rejected-task feedback and retain the removed task wording locally in source evidence.",
        "The Qwen classifier receives up to eight recent removed-task examples with bounded excerpts and instructions to treat them as negative evidence unless a new conversation clearly presents a different unresolved action.",
        "Historical deleted Gmail tasks are also selected as feedback, so learning includes removals that occurred before the new deletion hook.",
        "Policy-driven removals for non-important mail are explicitly excluded from owner-preference learning."
      ]
    },
    {
      "title": "Hard Gmail importance gate",
      "status": "Completed",
      "details": [
        "Every task-import query is server-enforced to include Gmail is:important, even if the browser query omits it.",
        "The default dashboard query visibly includes is:important with the thirty-day window and spam and trash exclusions.",
        "Added reconciliation for active imported tasks: any source no longer marked Important is soft-removed without becoming negative preference feedback.",
        "The one remaining active imported task passed the live Important-state reconciliation."
      ]
    },
    {
      "title": "Correct reading-list semantics",
      "status": "Completed",
      "details": [
        "Separated reading eligibility from LLM classification. Gmail Important plus Unread is now the deterministic membership rule.",
        "Reading items link to the Gmail conversation itself instead of extracting arbitrary article links from broad mail.",
        "Local Qwen supplies summaries and applicable tags for eligible reading conversations but cannot add a noneligible conversation.",
        "Added reconciliation that soft-removes Gmail reading items outside Important and Unread and preserves manual reading items.",
        "The corrected live sync established forty active reading items corresponding to the forty current Important-and-Unread conversations."
      ]
    },
    {
      "title": "Reliability and runtime",
      "status": "Completed",
      "details": [
        "Background jobs reconcile task and reading eligibility before and after bounded task analysis as appropriate.",
        "Job status now reports policy-removed tasks, policy-removed reading items, and the final Important-and-Unread reading-list count.",
        "Reduced negative-example prompt size after the first full reading-tag sync showed that oversized correction context could exhaust reliable local-model classification.",
        "A subsequent non-persisting one-conversation Qwen check succeeded with all eight historical owner-removal examples and returned a valid kind and tag set.",
        "Restarted Hiro and verified the private remote task page serves the corrected policy and query."
      ]
    }
  ],
  "decisions": [
    "Treat Gmail IMPORTANT as mandatory input eligibility rather than an LLM feature or suggestion.",
    "Use IMPORTANT plus UNREAD as the complete reading-list membership rule; Qwen may describe and tag eligible mail but may not decide membership.",
    "Learn only from explicit owner task removals, not automated policy reconciliation.",
    "Keep feedback local in SQLite and send only compact recent examples to the local Qwen model.",
    "Soft-remove incorrect imported items so audit and source provenance remain recoverable.",
    "Link reading entries to their Gmail conversations because the email itself is the reading object."
  ],
  "validation": [
    {
      "check": "Focused automated regression suite",
      "status": "passed",
      "result": "Eighteen tests passed, covering the enforced Important query, Important-and-Unread label detection, task and reading reconciliation, owner-removal feedback, historical feedback retrieval, policy-removal exclusion, email reading links, multi-tag sync, background jobs, bounded Qwen batches, individual fallback, dates, persistence, and API behavior."
    },
    {
      "check": "Live mailbox eligibility audit",
      "status": "passed",
      "result": "The mailbox reported forty Important-and-Unread conversations. Forty-nine previously imported reading items were outside that set and were soft-removed; the corrected list contains forty eligible Gmail conversations."
    },
    {
      "check": "Live task reconciliation",
      "status": "passed",
      "result": "The remaining active imported task was confirmed to have an Important Gmail source. Eight historical owner-deleted imported tasks were available as negative examples."
    },
    {
      "check": "Non-persisting local-model check",
      "status": "passed",
      "result": "One eligible Important conversation was classified read-only with all eight compact owner-removal examples; Qwen returned a valid classification and validated tag output without creating an item."
    },
    {
      "check": "Restarted private runtime",
      "status": "passed",
      "result": "Hiro restarted successfully. The private remote task page returned status 200, showed the Important-only query, and served the hard-gate explanation."
    },
    {
      "check": "Task-page JavaScript syntax",
      "status": "passed",
      "result": "The embedded task-page script parsed successfully after the updated query, removal explanation, and job-status fields."
    },
    {
      "check": "Public journal unit tests",
      "status": "passed",
      "result": "npm run test:hiro passed the timestamped-entry unit tests."
    },
    {
      "check": "Public journal production build",
      "status": "passed",
      "result": "npm run build generated and validated 53 journal pages, then completed the TypeScript and Vite production build."
    }
  ],
  "currentState": [
    "Only Gmail conversations marked Important can participate in task analysis.",
    "The default task scope is Important mail from the last thirty days, excluding spam and trash.",
    "The reading list contains forty current Important-and-Unread Gmail conversations and no broad-mail article extractions.",
    "One imported task remains active and its source is Important.",
    "Eight prior explicit task removals are available as local negative feedback for subsequent scans.",
    "Gmail remains read-only; no labels, read state, archive state, or message data were changed."
  ],
  "limitations": [
    "The current reading sync falls back to deterministic keyword tags when local Qwen cannot tag a conversation after bounded retries.",
    "Important-and-Unread membership is refreshed when a Gmail background scan runs, not continuously between scans.",
    "Owner-removal learning is example-based prompt adaptation rather than model-weight training; it improves decisions while remaining inspectable and reversible.",
    "Job progress remains in server memory, while created items, removals, source evidence, and audit events remain durable in SQLite."
  ],
  "nextSteps": [
    "Use the Review section to remove any remaining false task; each explicit removal becomes another negative example.",
    "Run Analyze later as needed; the server will enforce Important-only scope even if the visible query is edited.",
    "Review the forty Important-and-Unread reading entries and adjust tags when necessary.",
    "Consider adding an explicit false-positive reason selector only if simple removal feedback proves too ambiguous."
  ],
  "disclosureNote": "This public entry omits private network addresses, local paths, account details, message identifiers, subjects, senders, bodies, item contents, process identifiers, and credential information."
}
