From 90029b9a270f34f787d6a98939e1a7545fd8cb31 Mon Sep 17 00:00:00 2001 From: Christoph Schmatzler Date: Mon, 2 Mar 2026 14:17:45 +0000 Subject: [PATCH] up Signed-off-by: Christoph Schmatzler --- profiles/opencode/command/inbox-triage.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/profiles/opencode/command/inbox-triage.md b/profiles/opencode/command/inbox-triage.md index 96d551f..4bd8dc7 100644 --- a/profiles/opencode/command/inbox-triage.md +++ b/profiles/opencode/command/inbox-triage.md @@ -21,27 +21,23 @@ Workflow: - `Newsletters and Marketing` - `Junk` - `Deleted Messages` -3. `Archive` is deprecated legacy storage: - - Do not move new messages to `Archive`. - - Do not create new workflows that route mail to `Archive`. - - Existing messages already in `Archive` may remain there unchanged. -4. Determine source folder: +3. Determine source folder: - If `$ARGUMENTS` is a single known folder name (matches a folder from step 1), use that as source. - Otherwise use `INBOX`. -5. Build a run scope safely: +4. Build a run scope safely: - List with fixed page size `20` and JSON output: `himalaya envelope list -f "" -p 1 -s 20 --output json`. - Start at page `1`. Enumerate IDs in returned order. - Process each ID fully before touching the next ID. - Keep an in-memory reviewed set for this run to avoid reprocessing IDs already handled or intentionally left untouched. - When all IDs on the current page are in the reviewed set, advance to the next page. - Stop when a page returns fewer results than the page size (end of folder) and all its IDs are in the reviewed set. -6. For each single envelope ID, do all checks before any move/delete: +5. For each single envelope ID, do all checks before any move/delete: - Read the message: `himalaya message read -f "" `. - If needed for classification, inspect attachments: `himalaya attachment download -f "" --dir /tmp/himalaya-triage`. - If attachments are downloaded, inspect them and `rm` the downloaded files from `/tmp/himalaya-triage` after use. - Move: `himalaya message move -f "" ""`. - Delete: `himalaya message delete -f "" `. -7. Classification precedence (higher rule wins on conflict): +6. Classification precedence (higher rule wins on conflict): - Human communication — a message with freeform natural-language content written by a human, not templated or autogenerated. When in doubt whether a message is human or automated, leave it untouched. - Clearly ephemeral automated/system message (alerts, bot/status updates, OTP/2FA, password reset codes, login codes) with no archival value: move to `Deleted Messages`. - Payment transaction correspondence (actual charge/payment confirmations, receipts, failed-payment notices, provider payment events such as Klarna/PayPal/Stripe): move to `Payments`. @@ -53,7 +49,7 @@ Workflow: - Marketing/newsletters: move to `Newsletters and Marketing`. - Delivery/submission confirmations for items you shipped outbound: move to `Outgoing Shipments`. - Long-term but uncategorized messages: create a concise new folder and move there. -8. Folder creation rule: +7. Folder creation rule: - Create a new folder only if no existing folder fits and the message should be kept. - Naming constraints: concise topic name, avoid duplicates, and avoid broad catch-all names. - Command: `himalaya folder add ""`. @@ -65,7 +61,6 @@ Execution rules: - Never skip reading message content before deciding. - Keep decisions conservative: only route clearly ephemeral automated/system messages to `Deleted Messages`. - Never move or delete human communications via automation. -- Never route new messages to `Archive`; treat it as deprecated legacy-only. - Define "processed" as "reviewed once in this run" (including intentionally untouched human messages). - Include only messages observed during this run's listings; if new mail arrives mid-run, leave it for the next run. - Report a compact action log at the end with: