// Curation guide · alpha คู่มือ curation · alpha

Pin, scope, disable. Pin · scope · disable

Cosmos records lessons automatically. The moat doesn't compound automatically. The Phase 3 benchmark (lab notes) showed our rules block earns its weight specifically on lessons that have been pinned and scope-globbed — and adds verbosity tax on tasks where it doesn't.

Cosmos บันทึก lesson ให้อัตโนมัติ. แต่ moat ไม่ compound เอง. Phase 3 benchmark (lab notes) ชี้ว่า rules block ของเราได้ผลก็ต่อเมื่อ lesson นั้นถูก pin และ scope-glob — และเพิ่ม verbosity tax บน task ที่ไม่ตรง

Translation: 5 minutes of curation per week is what separates "AI keeps re-deriving the same fix" from "AI surfaces the recipe before any edit." This page is the playbook. Examples below come from our own dogfood brain, the same set the benchmark ran against.

แปลว่า: curate 5 นาทีต่อสัปดาห์คือเส้นที่แยก "AI re-derive fix ตัวเดิมไปเรื่อย" ออกจาก "AI ให้ recipe มาก่อนแก้ทุกครั้ง". หน้านี้คือ playbook. ตัวอย่างด้านล่างมาจาก dogfood brain ของเราเอง ชุดเดียวกับที่ benchmark วิ่งด้วย

// 01 · the three levers 01 · 3 levers

Pin · scope_globs · disable. Pin · scope_globs · disable

📌 Pin 📌 Pin

"Always high priority" "priority สูงเสมอ"

Pinned lessons get a +0.6 ranker boost on every recall. Surfaces in the top 3 hits when even loosely related. Use sparingly — pin everything = pin nothing.

Lesson ที่ pin ได้ ranker boost +0.6 ทุกครั้งที่ recall. โผล่ใน top 3 แม้เกี่ยวข้องหลวม ๆ. ใช้แบบประหยัด — pin ทุกอันคือไม่ pin เลย

🎯 Scope_globs 🎯 Scope_globs

"Always remind for these paths" "เตือนเสมอเมื่อเข้า path นี้"

Path patterns (e.g. core/api/**) that trigger a +1.5 boost — the heaviest single ranker bonus — when your AI's current edit path matches. The "always remind me about X when working on Y" workflow.

Path pattern (เช่น core/api/**) ทำให้ได้ boost +1.5 — bonus เดียวที่หนักสุด — เมื่อ path ที่ AI กำลังแก้ match. Workflow แบบ "เตือนเรื่อง X เสมอ ตอนทำงานบน Y"

🚫 Disable 🚫 Disable

"Hide from AI without losing" "ซ่อนจาก AI แต่ไม่ลบทิ้ง"

Lessons stay on disk; MCP recall paths skip them entirely. Use when a fix is rooted (no longer relevant), the lesson wording was wrong, or the content is sensitive enough that you don't want it reaching an AI vendor.

Lesson ยังอยู่บน disk; MCP recall path ข้ามไปเลย. ใช้เมื่อ fix root แล้ว (ไม่เกี่ยวอีก), wording lesson ผิด, หรือเนื้อหา sensitive ไม่ต้องการให้ไปถึง AI vendor

how the math compounds math compound อย่างไร
Cosmos's recall ranker is additive — bonuses stack. A lesson that is both pinned and scope-glob-matched on the current edit path earns roughly +2.1 to the relevance score plus token-overlap on the symptom text. That's typically enough to push it from "buried in 50 results" to "first thing the AI sees." Without curation: only token overlap fires, which the benchmark showed isn't enough on its own when the lesson body and the prompt are in different languages or use different vocabulary. Ranker ของ Cosmos เป็น additive — bonus ซ้อนกันได้. Lesson ที่ pin + scope-glob match กับ path ที่กำลังแก้ ได้ +2.1 ใน relevance score บวก token-overlap จาก symptom. ปกติพอจะดันจาก "จม 50 ผลลัพธ์" เป็น "อันแรกที่ AI เห็น". ถ้าไม่ curate: ยิงแค่ token overlap ซึ่ง benchmark พิสูจน์ว่าไม่พอ เมื่อ lesson กับ prompt ใช้ คนละภาษาหรือคนละศัพท์
// 02 · when to pin 02 · pin เมื่อไหร่

Three signals that earn a pin. 3 signal ที่คู่ควรกับการ pin

Pin a lesson when at least two of these are true. One signal alone is usually a "leave it active" not "pin it."

Pin lesson เมื่อมี อย่างน้อย 2 ข้อข้างล่างเป็นจริง. ข้อเดียวมักจะแค่ "active" ไม่ใช่ "pin"

  1. Recurring. The lesson has fired more than once — the bug's pattern repeats across packages, files, or weeks. The lesson body explicitly says "this is the Nth time we've seen this." If you're tagging new occurrences with recurring, that tag is doing the work of telling Cosmos to pin. Recurring. Lesson ยิงมากกว่า 1 ครั้ง — pattern ของบั๊กเกิดซ้ำข้าม package / file / สัปดาห์. Body ของ lesson บอกชัดว่า "นี่เป็นครั้งที่ N". ถ้าคุณ tag การเกิดใหม่ด้วย recurring tag นั้น ก็คือ signal ให้ Cosmos pin
  2. High blast radius. When the bug fires, it breaks the dev loop or the user-facing surface. Build crashes, app crashes, "white screen on launch," "all queries return zero." Severity 1 in the lesson UI maps to this. Cheap to skip; expensive to redo. Blast radius สูง. พอบั๊กยิง พัง dev loop หรือหน้า user. Build crash, app crash, "จอขาวตอนเปิด", "query คืนค่าศูนย์หมด". Severity 1 ใน lesson UI map กับข้อนี้. ข้ามถูก; ทำใหม่แพง
  3. Re-derive cost ≫ recall cost. The fix is not obvious from reading the source — it's a 3-cause root, a config gotcha, an ordering invariant. AI without the lesson would chase the wrong cause first. The lesson body has enough specificity that an LLM applying it produces a different answer than an LLM searching cold. Re-derive cost ≫ recall cost. Fix ไม่ชัดจากการอ่าน source — เป็น root 3 สาเหตุ, config gotcha, หรือ ordering invariant. AI ที่ไม่มี lesson จะไล่สาเหตุผิด ก่อน. Body ของ lesson เฉพาะเจาะจงพอที่ LLM ใช้แล้วได้คำตอบ ต่างจาก LLM ที่ search ตั้งแต่ศูนย์
don't pin if อย่า pin ถ้า
the symptom is one-line ("typo," "missed import," "off-by-one") — those have low re-derive cost and clutter recall results. Active-without-pin still gives them ranker contribution when the prompt overlaps; pinning would just bias every Cosmos query toward them. symptom เป็น 1 บรรทัด ("typo", "missed import", "off-by-one") — re-derive cost ต่ำและรกใน recall result. Active โดยไม่ pin ก็ยังได้ ranker contribution เมื่อ prompt overlap; pin จะแค่ bias ทุก query ของ Cosmos
// 03 · writing scope_globs 03 · เขียน scope_globs

Cover the file family, not just the file. ครอบคลุม family ของ file ไม่ใช่แค่ file เดียว

Scope_globs are shell-style path patterns that fire a +1.5 ranker bonus when your AI's current edit path matches. The trick is picking patterns that are tight enough to not fire on unrelated edits, but loose enough to catch new files in the same family.

Scope_globs คือ path pattern แบบ shell-style ที่ยิง ranker bonus +1.5 เมื่อ path ที่ AI กำลังแก้ match. เคล็ดคือเลือก pattern ที่ แคบพอ ที่จะไม่ยิงกับ edit ที่ไม่เกี่ยว แต่ กว้างพอ ที่จะจับ file ใหม่ ใน family เดียวกัน

Pattern Pattern
Matches Match อะไร
When to use ใช้ตอนไหน
vite.config.ts
that exact file only เฉพาะ file นั้นเท่านั้น
single-file lesson · config gotcha · the fix lives entirely in this file lesson เฉพาะ file เดียว · config gotcha · fix อยู่ทั้งใน file นี้
src/api/*.py
flat directory directory ชั้นเดียว
single-folder lesson · all files in src/api but NOT in src/api/sub/ lesson เฉพาะ folder · ทุก file ใน src/api แต่ไม่รวม src/api/sub/
src/api/**
recursive subtree subtree แบบ recursive
module-level lesson · the most common pattern · use when new files in nested dirs should inherit lesson ระดับ module · pattern ที่ใช้บ่อยสุด · ใช้เมื่อ file ใหม่ใน nested dir ควร inherit
**/*.test.ts
file-type pattern pattern ตามชนิด file
test-suite-wide lesson · catches all test files anywhere in repo lesson ครอบคลุม test suite · จับทุก test file ทุกที่ใน repo
core/api/mcp_server.py + core/code_indexer/**
two patterns 2 pattern
cross-module lesson · the bug spans more than one part of the system · use multiple globs (each one earns the +1.5 independently) lesson ข้าม module · บั๊กกินมากกว่า 1 ส่วนของระบบ · ใช้ glob หลายอัน (แต่ละอันได้ +1.5 อิสระกัน)
rule of thumb หลักการคร่าว
Start with the file where the fix lives. If a year from now you added a sibling file with the same pattern, would you want this lesson to fire? If yes, broaden to **. If no (the lesson is genuinely about that one file's quirk), keep it narrow. เริ่มจาก file ที่ fix อยู่. ถ้าอีกปีคุณเพิ่ม sibling file ที่มี pattern เดียวกัน คุณอยากให้ lesson ยิงไหม? ถ้าใช่ ขยายเป็น **. ถ้าไม่ (lesson เป็นเรื่อง quirk ของ file นั้นจริง ๆ) ให้แคบไว้
// 04 · worked examples 04 · ตัวอย่างจริง

Five real lessons, real curation choices. 5 lesson จริง · choice curation จริง

Every example below comes verbatim from the Cosmos dogfood brain's curation log. These are the same lessons whose pin/scope_glob state was set before the Phase 3 benchmark task pool was extended — the audit trail is in curation_log_2026-05-07.json.

ทุก example ด้านล่างมาตามต้นฉบับจาก curation log ของ Cosmos dogfood brain. ชุดเดียวกับ lesson ที่ pin / scope_glob state ถูก set ก่อน task pool ของ Phase 3 ถูก extend — audit trail อยู่ใน curation_log_2026-05-07.json

เนื้อหา example แต่ละ entry ด้านล่างเก็บเป็นภาษาอังกฤษ เพราะ data ต้นทางเขียนเป็น EN — แปลภายหลังเมื่อ data layer มี TH

#01 Vite optimizeDeps barrel pattern → ErrorBoundary on default-import

📌 pinned 📌 pinned
// scope_globs
vite.config.tspackage.json
// why these signals // ทำไมถึงเลือก signal แบบนี้

Recurring tag · 4 prior occurrences (tiptap → r3f → lucide → react-force-graph) · vite.config.ts is bug-magnet (3 lessons reference it).

// why this curation shape // ทำไมรูปแบบ curation นี้

Pin because it's recurring AND high-blast-radius (whole dev server breaks). scope_globs covers BOTH the file you'd edit (vite.config.ts) AND the file whose change triggers the bug (package.json on pnpm add). Together: every time AI touches package install or vite config, the lesson surfaces with +0.6 pin + +1.5 scope match = +2.1 ranker boost.

#02 Graph focus-node click → FPS dive / app freeze (R3F + Zustand)

📌 pinned 📌 pinned
// scope_globs
src/components/GraphView/**
// why these signals // ทำไมถึงเลือก signal แบบนี้

Severity-1 user-blocking · root cause has 3 simultaneous causes that generic R3F docs don't cover together · NeuralMap.tsx is bug-magnet (2 lessons).

// why this curation shape // ทำไมรูปแบบ curation นี้

Pin because the failure mode is invisible (3-cause root) — AI without the lesson would debug each cause sequentially. scope_globs uses recursive glob `**` so any new component under GraphView/ inherits the warning, not just NeuralMap.tsx. Generalizes the lesson rather than tying it to one file.

#03 code_search FTS5 plain-string coverage gap

📌 pinned 📌 pinned
// scope_globs
core/code_indexer/**core/api/mcp_server.py
// why these signals // ทำไมถึงเลือก signal แบบนี้

Schema/coverage class — hardest for AI to re-derive without indexer source · 2 of 4 affected files are bug-magnets · documents 3 distinct gaps (file-level, function-body, language-tokenizer).

// why this curation shape // ทำไมรูปแบบ curation นี้

Pin because it's multi-symptom and the kind of bug that takes hours to triage from scratch. Two scope_globs: one recursive over the indexer module, one specific to mcp_server.py — different files trigger different sub-symptoms, so two patterns cover the surface.

#04 MCP stdio call hangs (idle, no error) on long-running server

active · no pin active · ไม่ pin
// scope_globs
core/api/mcp_server.py
// why these signals // ทำไมถึงเลือก signal แบบนี้

Severity-2 ops-class · single occurrence · symptom-vs-cause mismatch (process LOOKS idle but is broken pipe) — AI commonly misdiagnoses.

// why this curation shape // ทำไมรูปแบบ curation นี้

NOT pinned because it's one-shot, not recurring — pinning would over-bias every Cosmos query. scope_glob is narrow (one file) because that's where the fix lives. Active without pin: the file overlap still earns +0.4 to +0.8 file-match boost when AI's current_path is in mcp_server.py, but no general-query bias.

#05 project_summarizer race + watcher self-trigger creates dup summaries

active · no pin active · ไม่ pin
// scope_globs
core/code_indexer/project_summarizer.pycore/code_indexer/watcher.py
// why these signals // ทำไมถึงเลือก signal แบบนี้

Subtle race condition spanning 3 files · fixing on disk didn't stop the bug · exactly the class where re-derive cost is high.

// why this curation shape // ทำไมรูปแบบ curation นี้

NOT pinned because the prompt that surfaces it is naturally specific (no AI asks 'why duplicates?' on unrelated tasks). Two scope_globs cover both files in the race: editing summarizer.py without seeing watcher.py = miss the cause.

// 05 · anti-patterns 05 · anti-pattern

Things that look like curation but break the moat. สิ่งที่ดูเหมือน curation แต่ทำให้ moat พัง

// 06 · cadence 06 · cadence

How often to look at your library. บ่อยแค่ไหนต้องมาดู library

Daily — 0 minutes รายวัน — 0 นาที

Don't curate daily. The point of letting Cosmos record automatically is that you don't think about it during a normal coding day.

อย่า curate รายวัน. จุดของการให้ Cosmos บันทึก automatic คือ คุณไม่ต้องคิดเรื่องนี้ในวันโค้ดปกติ

Weekly — 5 minutes รายสัปดาห์ — 5 นาที

Open the Lessons tab. Sort by "added this week." Ask: any recurring? Any severity-1? Any with re-derive cost ≫ recall cost? Pin those. Add scope_globs based on file family.

เปิด tab Lessons. Sort ตาม "added this week". ถาม: มี recurring ไหม? severity-1 ไหม? re-derive cost ≫ recall cost ไหม? Pin พวกนั้น. เพิ่ม scope_globs ตาม family ของ file

Quarterly — 30 minutes รายไตรมาส — 30 นาที

Review pinned lessons. Anything stale? Anything fixed at the root and no longer relevant? Disable (don't delete — keep the audit trail). Check Outcome dashboard to see which lessons are actually being recalled.

Review lesson ที่ pin. มี stale ไหม? ที่ fix root แล้วไม่เกี่ยว? Disable (อย่าลบ — เก็บ audit trail). ดู Outcome dashboard ว่า lesson ไหนถูก recall จริง

// 07 · 60-second checklist 07 · checklist 60 วินาที

Before you ship a curation pass. ก่อน ship รอบ curation

  • Less than 15% of active lessons are pinned
  • Each pinned lesson satisfies ≥ 2 of: recurring, severity-1, high re-derive cost
  • Scope_globs target file families, not src/** or single one-off files
  • No lesson disabled where editing would have done the job
  • Sibling lessons of a recurring pattern: only ONE is pinned (the canonical)
  • If running a benchmark soon: curation timestamps recorded BEFORE the task set was finalised
  • น้อยกว่า 15% ของ lesson ที่ active ถูก pin
  • ทุก lesson ที่ pin เข้าเงื่อนไข ≥ 2 ใน: recurring, severity-1, re-derive cost สูง
  • Scope_globs เล็ง family ของ file ไม่ใช่ src/** หรือ file one-off ตัวเดียว
  • ไม่มี lesson ถูก disable ในที่ที่ edit ก็พอ
  • Sibling lesson ของ pattern recurring: pin แค่ตัวเดียว (canonical)
  • ถ้าจะรัน benchmark เร็ว ๆ นี้: timestamp ของ curation บันทึก ก่อน task set ถูก finalise

The library you build is the moat. The curation rules above are what we figured out doing it ourselves; we'll publish updates as we learn more.

Library ที่คุณสร้างคือ moat. กฎ curation ด้านบนคือสิ่งที่เราคิดได้ ระหว่างทำเอง; จะ publish update เพิ่มเมื่อเรียนรู้มากขึ้น

Currently in private alpha — invitation-only access while we finish the curation UX and ship Cloud MCP.

ตอนนี้อยู่ใน private alpha — เข้าได้เฉพาะคนที่ได้รับเชิญ ในระหว่าง เราทำ UX ของ curation เสร็จและ ship Cloud MCP