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 วิ่งด้วย
Pin · scope_globs · disable. Pin · scope_globs · disable
"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 เลย
"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"
"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
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"
- 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 การเกิดใหม่ด้วยrecurringtag นั้น ก็คือ signal ให้ Cosmos pin - 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 กับข้อนี้. ข้ามถูก; ทำใหม่แพง
- 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 ตั้งแต่ศูนย์
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 เดียวกัน
**. If no
(the lesson is genuinely about that one file's quirk), keep it
narrow.
เริ่มจาก file ที่ fix อยู่. ถ้าอีกปีคุณเพิ่ม sibling file ที่มี
pattern เดียวกัน คุณอยากให้ lesson ยิงไหม? ถ้าใช่ ขยายเป็น
**. ถ้าไม่ (lesson เป็นเรื่อง quirk
ของ file นั้นจริง ๆ) ให้แคบไว้
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
Recurring tag · 4 prior occurrences (tiptap → r3f → lucide → react-force-graph) · vite.config.ts is bug-magnet (3 lessons reference it).
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)
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).
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
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).
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
Severity-2 ops-class · single occurrence · symptom-vs-cause mismatch (process LOOKS idle but is broken pipe) — AI commonly misdiagnoses.
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
Subtle race condition spanning 3 files · fixing on disk didn't stop the bug · exactly the class where re-derive cost is high.
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.
Things that look like curation but break the moat. สิ่งที่ดูเหมือน curation แต่ทำให้ moat พัง
- ✗ Pinning everything. Pin = "always high priority." When 30% of your library is pinned, the ranker boost stops differentiating. Aim for 5–15% pinned at most. The benchmark showed pinned lessons win — but only when "pinned" still means something. Pin ทุกอย่าง. Pin = "priority สูงเสมอ". เมื่อ 30% ของ library ถูก pin, ranker boost จะหยุด differentiate. ตั้งเป้า 5–15% pin เท่านั้น. Benchmark พิสูจน์ว่า pin lesson ชนะ — แต่ก็ต่อเมื่อ "pin" ยังมีความหมาย
- ✗ Scope_globs that are too wide.
**alone, orsrc/**, will fire on every edit in your codebase. The lesson surfaces on every recall whether it's relevant or not — same effect as pinning, with none of the discipline. Tighten to a module or file family. Scope_globs กว้างเกินไป.**ลอย ๆ หรือsrc/**จะยิงทุก edit ใน codebase. Lesson โผล่ทุก recall ไม่ว่าเกี่ยวหรือไม่ — ผลเหมือน pin แต่ไม่มี discipline. แคบลงให้ตรง module หรือ family ของ file - ✗ Pinning sibling lessons that document the same pattern. The vite barrel pattern hit us four separate times — but only ONE of those four lessons is pinned (the most general one). Pinning all four would triple the boost on the same query (multiplicity bias), making the ranker look stronger than it is. Pin the canonical lesson; leave siblings active for historical depth. Pin sibling lesson ที่ document pattern เดียวกัน. Vite barrel pattern โดน 4 ครั้งต่างกัน — แต่ pin แค่ 1 ใน 4 (ตัวที่ general สุด). Pin ทั้ง 4 จะ triple boost บน query เดียวกัน (multiplicity bias) ทำให้ ranker ดูแกร่งเกินจริง. Pin lesson canonical; ปล่อย sibling active ไว้เพื่อความลึกของประวัติ
- ✗ Curating to make a benchmark look good. If you ever pin a lesson the day before running a benchmark because you suspect it'll help on a specific task — that's stadium-tuning. Always curate from product-level signals (recurring, severity, file co-occurrence), not from the test set. The Phase 3 protocol §11 enforces this with timestamped logs; in practice, it just means: curate when the bug bites, not when the demo looms. Curate เพื่อให้ benchmark ดูดี. ถ้าวันก่อนรัน benchmark คุณ pin lesson เพราะคิดว่าจะช่วย task เฉพาะ — นั่นคือ stadium-tuning. ให้ curate จาก signal ระดับ product (recurring, severity, file co-occurrence) เสมอ ไม่ใช่จาก test set. Phase 3 protocol section 11 บังคับด้วย timestamped log; ในทางปฏิบัติแปลว่า: curate ตอนบั๊กกัด ไม่ใช่ตอน demo ใกล้
- ✗ Disabling instead of editing. If a lesson's wording is off but the underlying fix is still valid, edit it (the in-app Lessons tab has an Edit modal). Disabling drops it from recall entirely — including the AI that would've benefited from a corrected version. Disable แทนที่จะ edit. ถ้า wording ของ lesson แปลก แต่ fix ใต้ในยัง valid ให้ edit (tab Lessons ใน app มี Edit modal). Disable เอาออกจาก recall ทั้งหมด — รวมถึง AI ที่ควรจะได้ประโยชน์จาก version ที่แก้แล้ว
How often to look at your library. บ่อยแค่ไหนต้องมาดู library
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 คือ คุณไม่ต้องคิดเรื่องนี้ในวันโค้ดปกติ
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
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 จริง
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