Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/PsychQuant/che-apple-mail-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/psychquant/che-apple-mail-mcp/archive-mail-repair-synthetic-ids)<a href="https://agentmods.dev/commands/psychquant/che-apple-mail-mcp/archive-mail-repair-synthetic-ids"><img src="https://agentmods.dev/badge/commands/psychquant/che-apple-mail-mcp/archive-mail-repair-synthetic-ids/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/psychquant/che-apple-mail-mcp/archive-mail-repair-synthetic-ids"><img src="https://agentmods.dev/badge/commands/psychquant/che-apple-mail-mcp/archive-mail-repair-synthetic-ids.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01269 |
| Opus 5 | $0.00000 | $0.00634 |
| Sonnet 5 | $0.00000 | $0.00254 |
| Haiku 4.5 | $0.00000 | $0.00127 |
Grade A, and why
archive-mail-repair-synthetic-ids scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/archive-mail-repair-synthetic-ids — 修復 synthetic message_id 佔位符(一次性,mail#319)
掃描歸檔目錄中 message_id 匹配 ^synthetic: 的 markdown 檔,嘗試從 Mail 重新解析真實 RFC 5322 Message-ID 並就地修復 frontmatter + email_index.json。保守優先:寧可留 unparseable 交人工,絕不錯誤合併兩封不同的信。
背景(為什麼存在)
過去某些 session 在拿不到真 Message-ID 時即興發明了 synthetic:<ISO-timestamp> 佔位符(SOP 當時對缺值沒有規定——現已明文禁止,見 archive-mail frontmatter 規則)。synthetic key 的 timestamp 是執行當下時間,同一封信每次重跑產生不同 key → dedup 結構性失效:mail#319 實測單一 target 84/273 檔帶 synthetic key、單輪 12 封靜默重複、所有既有 gate 全綠。
用法
/archive-mail-repair-synthetic-ids <archive_target 或 output_dir>
Execution
Step 0: Bootstrap Task List(強制)
TaskCreate(name="scan_synthetic", description="glob 頂層 *.md,抓 frontmatter message_id 匹配 ^synthetic: 的清單")
TaskCreate(name="rekey_attempts", description="逐檔嘗試從 Mail 重新定位真 Message-ID(保守匹配,見下)")
TaskCreate(name="apply_repairs", description="可修者:改寫 frontmatter message_id + email_index.json 換 key(temp+rename 原子寫)")
TaskCreate(name="dedupe_pass", description="re-key 後同一真 Message-ID 對到多檔 → 內容比對確認重複 → 保留最早、其餘移 duplicates/ 子目錄(不刪)")
TaskCreate(name="report", description="修復報告:repaired / still-unparseable / duplicates-quarantined 三清單")
Step 1: 掃描
僅頂層 *.md(同 Step 8.5 紀律,不深入子目錄)。抓 frontmatter message_id 匹配 ^synthetic: 者,連同其 date、thread_key、sender、body Subject: 行入清單。
Step 2: 重新定位真 Message-ID(保守階梯)
對每檔依序嘗試,第一個成功即停:
- Subject 精確搜尋:
search_emails(field: "subject", query: <bare subject>, projection: "summary", dedup: "logical")→ 候選中 sender 相同且 date 相差 < 2 分鐘 者恰好一封 → 用該 id 呼叫get_email_headers取真 Message-ID。 - 候選為零或多於一封(含同 thread 密集時間戳的情形)→ 不猜。記入
still-unparseable。
mail#319 issue 作者自證:ad-hoc
(sender, bare_subject, ±時間窗)三元組在密集 thread 中不可靠——所以匹配窗刻意窄(2 分鐘、恰好一封),寬鬆匹配寧可失敗。
Step 3: 修復
- frontmatter:
message_id: "synthetic:…"→message_id: "<真值>"(原檔就地改寫)。 email_index.json:舊 synthetic key 的 entry 換 key 為真 Message-ID(temp+rename 原子寫,同 Step 8.5 紀律)。- 順帶修 date offset(mail#319 secondary defect):該檔
date無 offset 時,用get_email_headers的 Date header 重寫為帶 offset 的 ISO。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 13d ago First seen · 68 lines · 0 tokens per session scan A 8e715430280c
archive-mail-repair-synthetic-ids is a command published in the GitHub repository PsychQuant/che-apple-mail-mcp (8 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,269 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
remind
Create a reminder from natural language.
week
Show this week's calendar overview.
today
Show today's calendar events and pending reminders.
watch-toggle
Temporarily disable or re-enable the popcorn hooks.
analyze-email
Quick analysis of a single email. Read metadata, summarize content, and list attachments.
browser
Set or check the browser popcorn should control (Chrome / Arc / Safari / Brave / Edge).