sanook-cli 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/.env.example +19 -0
  2. package/CHANGELOG.md +173 -0
  3. package/README.md +153 -20
  4. package/README.th.md +136 -0
  5. package/dist/agentContext.js +4 -0
  6. package/dist/approval.js +6 -0
  7. package/dist/bin.js +405 -57
  8. package/dist/brain.js +92 -59
  9. package/dist/brand.js +47 -0
  10. package/dist/checkpoint.js +37 -0
  11. package/dist/commands.js +86 -6
  12. package/dist/compaction.js +76 -5
  13. package/dist/config.js +100 -12
  14. package/dist/cost.js +60 -3
  15. package/dist/doctor.js +92 -0
  16. package/dist/gateway/auth.js +2 -2
  17. package/dist/gateway/ledger.js +2 -2
  18. package/dist/gateway/scheduler.js +1 -0
  19. package/dist/gateway/serve.js +6 -4
  20. package/dist/gateway/server.js +10 -2
  21. package/dist/git.js +11 -2
  22. package/dist/hooks.js +43 -17
  23. package/dist/knowledge.js +48 -49
  24. package/dist/loop.js +182 -66
  25. package/dist/lsp/client.js +173 -0
  26. package/dist/lsp/framing.js +56 -0
  27. package/dist/lsp/index.js +138 -0
  28. package/dist/lsp/servers.js +82 -0
  29. package/dist/mcp-server.js +244 -0
  30. package/dist/mcp.js +184 -29
  31. package/dist/memory-store.js +559 -0
  32. package/dist/memory.js +143 -29
  33. package/dist/orchestrate.js +150 -0
  34. package/dist/providers/codex.js +21 -7
  35. package/dist/providers/keys.js +3 -2
  36. package/dist/providers/models.js +22 -6
  37. package/dist/providers/registry.js +155 -1
  38. package/dist/repomap.js +93 -0
  39. package/dist/search/chunk.js +158 -0
  40. package/dist/search/embed-store.js +187 -0
  41. package/dist/search/engine.js +203 -0
  42. package/dist/search/fuse.js +35 -0
  43. package/dist/search/index-core.js +187 -0
  44. package/dist/search/indexer.js +241 -0
  45. package/dist/search/store.js +77 -0
  46. package/dist/session.js +42 -8
  47. package/dist/skill-install.js +10 -10
  48. package/dist/skills.js +12 -9
  49. package/dist/summarize.js +31 -0
  50. package/dist/tools/bash.js +21 -2
  51. package/dist/tools/diagnostics.js +41 -0
  52. package/dist/tools/edit.js +29 -7
  53. package/dist/tools/index.js +8 -1
  54. package/dist/tools/list.js +7 -2
  55. package/dist/tools/permission.js +90 -9
  56. package/dist/tools/read.js +23 -4
  57. package/dist/tools/remember.js +1 -1
  58. package/dist/tools/sandbox.js +61 -0
  59. package/dist/tools/search.js +105 -4
  60. package/dist/tools/task.js +195 -29
  61. package/dist/tools/timeout.js +35 -0
  62. package/dist/tools/util.js +10 -0
  63. package/dist/tools/write.js +6 -4
  64. package/dist/trust.js +89 -0
  65. package/dist/ui/app.js +228 -31
  66. package/dist/ui/banner.js +4 -9
  67. package/dist/ui/brain-wizard.js +2 -2
  68. package/dist/ui/history.js +30 -0
  69. package/dist/ui/mentions.js +44 -0
  70. package/dist/ui/render.js +55 -15
  71. package/dist/ui/setup.js +97 -12
  72. package/dist/ui/useEditor.js +83 -0
  73. package/dist/update.js +114 -0
  74. package/dist/worktree.js +173 -0
  75. package/package.json +11 -5
  76. package/scripts/postinstall.mjs +33 -0
  77. package/second-brain/.agents/_Index.md +30 -0
  78. package/second-brain/.agents/skills/_Index.md +30 -0
  79. package/second-brain/.agents/workflows/_Index.md +30 -0
  80. package/second-brain/AGENTS.md +4 -4
  81. package/second-brain/Acceptance/_Index.md +30 -0
  82. package/second-brain/Acceptance/golden-case-template.md +39 -0
  83. package/second-brain/Areas/_Index.md +30 -0
  84. package/second-brain/Bugs/System-OS/_Index.md +30 -0
  85. package/second-brain/Bugs/_Index.md +30 -0
  86. package/second-brain/CLAUDE.md +4 -1
  87. package/second-brain/Checklists/_Index.md +30 -0
  88. package/second-brain/Checklists/preflight-postflight-template.md +29 -0
  89. package/second-brain/Distillations/_Index.md +30 -0
  90. package/second-brain/Entities/_Index.md +30 -0
  91. package/second-brain/Entities/entity-template.md +33 -0
  92. package/second-brain/Evals/_Index.md +30 -0
  93. package/second-brain/Evals/correction-pairs.md +24 -0
  94. package/second-brain/Evals/failure-taxonomy.md +24 -0
  95. package/second-brain/Evals/golden-set.md +25 -0
  96. package/second-brain/Evals/quality-ledger.md +23 -0
  97. package/second-brain/Evals/self-eval-rubric.md +23 -0
  98. package/second-brain/GEMINI.md +4 -4
  99. package/second-brain/Goals/_Index.md +30 -0
  100. package/second-brain/Handoffs/_Index.md +30 -0
  101. package/second-brain/Home.md +7 -0
  102. package/second-brain/Intake/Raw Sources/_Index.md +30 -0
  103. package/second-brain/Intake/_Index.md +30 -0
  104. package/second-brain/Intake/_Quarantine/_Index.md +30 -0
  105. package/second-brain/Learning/_Index.md +30 -0
  106. package/second-brain/Playbooks/_Index.md +30 -0
  107. package/second-brain/Playbooks/playbook-template.md +23 -0
  108. package/second-brain/Projects/_Index.md +30 -0
  109. package/second-brain/Prompts/_Index.md +30 -0
  110. package/second-brain/README.md +2 -1
  111. package/second-brain/Research/_Index.md +30 -0
  112. package/second-brain/Retrospectives/_Index.md +30 -0
  113. package/second-brain/Reviews/_Index.md +30 -0
  114. package/second-brain/Runbooks/_Index.md +30 -0
  115. package/second-brain/Runbooks/eval-loop.md +24 -0
  116. package/second-brain/Sessions/_Index.md +30 -0
  117. package/second-brain/Shared/AI-Context-Index.md +20 -0
  118. package/second-brain/Shared/AI-Threads/_Index.md +30 -0
  119. package/second-brain/Shared/Archive/_Index.md +30 -0
  120. package/second-brain/Shared/Assets/_Index.md +30 -0
  121. package/second-brain/Shared/Context-Packs/_Index.md +30 -0
  122. package/second-brain/Shared/Context7-Docs/_Index.md +30 -0
  123. package/second-brain/Shared/Coordination/NOW.md +28 -0
  124. package/second-brain/Shared/Coordination/_Index.md +30 -0
  125. package/second-brain/Shared/Coordination/agent-registry.md +24 -0
  126. package/second-brain/Shared/Coordination/task-board/_Index.md +30 -0
  127. package/second-brain/Shared/Coordination/task-board/task-template.md +43 -0
  128. package/second-brain/Shared/Coordination/task-board.md +32 -0
  129. package/second-brain/Shared/Core-Facts/_Index.md +30 -0
  130. package/second-brain/Shared/Decision-Memory/_Index.md +30 -0
  131. package/second-brain/Shared/Glossary/_Index.md +30 -0
  132. package/second-brain/Shared/Memory-Inbox/_Index.md +30 -0
  133. package/second-brain/Shared/Operating-State/_Index.md +30 -0
  134. package/second-brain/Shared/Prompting/_Index.md +30 -0
  135. package/second-brain/Shared/Provenance/_Index.md +30 -0
  136. package/second-brain/Shared/Rules/_Index.md +30 -0
  137. package/second-brain/Shared/Rules/contextual-note-rule.md +30 -0
  138. package/second-brain/Shared/Rules/frontmatter-standard.md +10 -0
  139. package/second-brain/Shared/Rules/memory-write-protocol.md +28 -0
  140. package/second-brain/Shared/Rules/procedural-runbook-header.md +40 -0
  141. package/second-brain/Shared/Rules/review-and-staleness-policy.md +22 -0
  142. package/second-brain/Shared/Rules/rules-formatting.md +34 -0
  143. package/second-brain/Shared/Scripts/_Index.md +30 -0
  144. package/second-brain/Shared/Scripts-Archive/_Index.md +30 -0
  145. package/second-brain/Shared/Tech-Standards/_Index.md +30 -0
  146. package/second-brain/Shared/Tech-Standards/verification-standard.md +40 -0
  147. package/second-brain/Shared/User-Memory/_Index.md +30 -0
  148. package/second-brain/Shared/User-Persona/_Index.md +30 -0
  149. package/second-brain/Shared/User-Persona/owner-profile.md +25 -0
  150. package/second-brain/Shared/Working-Memory/_Index.md +30 -0
  151. package/second-brain/Shared/_Index.md +30 -0
  152. package/second-brain/Shared/mcp-servers/_Index.md +30 -0
  153. package/second-brain/Skills/_Index.md +30 -0
  154. package/second-brain/Templates/_Index.md +30 -0
  155. package/second-brain/Templates/bug.md +2 -0
  156. package/second-brain/Templates/handoff.md +2 -0
  157. package/second-brain/Templates/session.md +2 -0
  158. package/second-brain/Tools/_Index.md +30 -0
  159. package/second-brain/Traces/_Index.md +30 -0
  160. package/second-brain/Vault Structure Map.md +33 -1
  161. package/second-brain/copilot/_Index.md +30 -0
  162. package/skills/audit-license-compliance/SKILL.md +117 -0
  163. package/skills/author-codemod/SKILL.md +110 -0
  164. package/skills/build-audit-logging/SKILL.md +112 -0
  165. package/skills/build-cdc-streaming-pipeline/SKILL.md +123 -0
  166. package/skills/build-cli-tool/SKILL.md +108 -0
  167. package/skills/build-data-table/SKILL.md +141 -0
  168. package/skills/build-native-mobile-ui/SKILL.md +154 -0
  169. package/skills/build-offline-first-sync/SKILL.md +118 -0
  170. package/skills/build-realtime-channel/SKILL.md +122 -0
  171. package/skills/build-vector-search/SKILL.md +131 -0
  172. package/skills/compose-local-dev-stack/SKILL.md +149 -0
  173. package/skills/configure-bundler-build/SKILL.md +166 -0
  174. package/skills/configure-dns-tls/SKILL.md +142 -0
  175. package/skills/configure-reverse-proxy-lb/SKILL.md +129 -0
  176. package/skills/configure-security-headers-csp/SKILL.md +122 -0
  177. package/skills/contract-testing/SKILL.md +140 -0
  178. package/skills/datetime-timezone-correctness/SKILL.md +125 -0
  179. package/skills/debug-ci-pipeline-failure/SKILL.md +134 -0
  180. package/skills/debug-flaky-tests/SKILL.md +128 -0
  181. package/skills/defend-llm-prompt-injection/SKILL.md +110 -0
  182. package/skills/deliver-webhooks/SKILL.md +116 -0
  183. package/skills/design-api-pagination/SKILL.md +144 -0
  184. package/skills/design-authorization-model/SKILL.md +119 -0
  185. package/skills/design-backup-dr-recovery/SKILL.md +113 -0
  186. package/skills/design-event-sourcing-cqrs/SKILL.md +143 -0
  187. package/skills/design-multi-tenancy/SKILL.md +100 -0
  188. package/skills/design-protobuf-grpc-service/SKILL.md +146 -0
  189. package/skills/design-relational-schema/SKILL.md +129 -0
  190. package/skills/design-search-index-infra/SKILL.md +151 -0
  191. package/skills/design-state-machine/SKILL.md +108 -0
  192. package/skills/design-token-system/SKILL.md +109 -0
  193. package/skills/distributed-locks-leases/SKILL.md +120 -0
  194. package/skills/encrypt-sensitive-data/SKILL.md +148 -0
  195. package/skills/feature-flags-rollout/SKILL.md +130 -0
  196. package/skills/file-upload-object-storage/SKILL.md +107 -0
  197. package/skills/fuzz-dynamic-security-test/SKILL.md +111 -0
  198. package/skills/harden-llm-app-reliability/SKILL.md +126 -0
  199. package/skills/i18n-localization-setup/SKILL.md +113 -0
  200. package/skills/idempotency-keys/SKILL.md +107 -0
  201. package/skills/implement-push-notifications/SKILL.md +142 -0
  202. package/skills/ingest-webhook-secure/SKILL.md +120 -0
  203. package/skills/integrate-oauth-oidc/SKILL.md +126 -0
  204. package/skills/load-stress-test/SKILL.md +129 -0
  205. package/skills/map-privacy-data-gdpr/SKILL.md +146 -0
  206. package/skills/model-nosql-data/SKILL.md +118 -0
  207. package/skills/money-decimal-arithmetic/SKILL.md +123 -0
  208. package/skills/monitor-ml-drift/SKILL.md +109 -0
  209. package/skills/numeric-precision-units/SKILL.md +144 -0
  210. package/skills/optimize-llm-cost-latency/SKILL.md +103 -0
  211. package/skills/optimize-react-rerenders/SKILL.md +124 -0
  212. package/skills/orchestrate-agent-workflow/SKILL.md +100 -0
  213. package/skills/payments-billing-integration/SKILL.md +114 -0
  214. package/skills/pin-toolchain-versions/SKILL.md +116 -0
  215. package/skills/plan-strangler-migration/SKILL.md +95 -0
  216. package/skills/property-based-testing/SKILL.md +108 -0
  217. package/skills/publish-package-registry/SKILL.md +130 -0
  218. package/skills/recover-git-state/SKILL.md +119 -0
  219. package/skills/remediate-web-vulnerabilities/SKILL.md +125 -0
  220. package/skills/resilience-timeouts-retries/SKILL.md +104 -0
  221. package/skills/resolve-merge-rebase-conflict/SKILL.md +97 -0
  222. package/skills/rewrite-git-history/SKILL.md +109 -0
  223. package/skills/scaffold-cross-platform-app/SKILL.md +137 -0
  224. package/skills/schema-evolution-compatibility/SKILL.md +121 -0
  225. package/skills/send-transactional-email/SKILL.md +126 -0
  226. package/skills/serve-deploy-ml-model/SKILL.md +107 -0
  227. package/skills/setup-cdn-edge-waf/SKILL.md +107 -0
  228. package/skills/setup-devcontainer-env/SKILL.md +131 -0
  229. package/skills/setup-lint-format-precommit/SKILL.md +140 -0
  230. package/skills/setup-monorepo-tooling/SKILL.md +125 -0
  231. package/skills/ship-mobile-app-store-release/SKILL.md +137 -0
  232. package/skills/structured-output-llm/SKILL.md +86 -0
  233. package/skills/supply-chain-sbom-provenance/SKILL.md +120 -0
  234. package/skills/test-data-factories/SKILL.md +158 -0
  235. package/skills/threat-model-stride/SKILL.md +123 -0
  236. package/skills/train-evaluate-ml-model/SKILL.md +109 -0
  237. package/skills/unicode-text-correctness/SKILL.md +109 -0
  238. package/skills/visual-regression-testing/SKILL.md +120 -0
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, archive]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Archive
10
+
11
+ > cold storage (ไม่ลบ)
12
+
13
+ ## ใส่ที่นี่
14
+ โน้ต stale/retired ที่ออกจาก retrieval
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ ของที่ยังใช้
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Archive/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Archive/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, assets]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Assets
10
+
11
+ > รูป/logo/binary ของ vault
12
+
13
+ ## ใส่ที่นี่
14
+ image/logo/asset
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ โน้ต .md
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Assets/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Assets/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, context-packs]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Context-Packs
10
+
11
+ > full-context bundle ต่อ domain/task-type
12
+
13
+ ## ใส่ที่นี่
14
+ pack รวม context พร้อมโหลด
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ โน้ตเดี่ยว (→ปลายทางปกติ)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Context-Packs/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Context-Packs/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, context7-docs]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Context7-Docs
10
+
11
+ > cached external lib doc (regenerable — gitignore)
12
+
13
+ ## ใส่ที่นี่
14
+ cache ของ context7/lib doc
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ durable knowledge (→Learning/Research)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Context7-Docs/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Context7-Docs/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,28 @@
1
+ ---
2
+ tags: [coordination, baton, now]
3
+ note_type: registry
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/Coordination/_Index]]"
7
+ ai_surface: hot
8
+ ---
9
+
10
+ # NOW — Multi-Agent Baton
11
+
12
+ > **อ่านก่อนแตะ vault ถ้ามีหลาย agent ทำงานพร้อมกัน** — กันชนกัน (single agent ข้ามได้)
13
+
14
+ ## Active
15
+
16
+ - **agent:** _(ใครกำลังทำ — ว่าง = ไม่มีใคร)_
17
+ - **working on:** _(งานอะไร + ไฟล์/โฟลเดอร์ที่แตะ)_
18
+ - **since:** _(เวลา)_
19
+
20
+ ## Hand-off / Next
21
+
22
+ _(งานค้างส่งต่อ → รายละเอียดเต็มไป [[Handoffs/_Index]])_
23
+
24
+ ## Tie-break
25
+
26
+ ชนกัน → ลำดับ claude < codex < gemini (ตัวหลังยอม) · เขียน session ไฟล์ unique ต่อ agent (`YYYY-MM-DD-<agent>-<topic>.md`)
27
+
28
+ up:: [[Shared/Coordination/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, coordination]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Coordination
10
+
11
+ > live coordination ของหลาย agent พร้อมกัน
12
+
13
+ ## ใส่ที่นี่
14
+ NOW.md baton + task-board + agent-registry
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ เอกสารส่งมอบครั้งเดียว (→Handoffs)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Coordination/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Coordination/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,24 @@
1
+ ---
2
+ tags: [coordination, agents, registry]
3
+ note_type: registry
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/Coordination/_Index]]"
7
+ ai_surface: hot
8
+ ---
9
+
10
+ # Agent Registry
11
+
12
+ > Who is allowed to touch the vault and what each agent should read first.
13
+
14
+ | Agent | Reads First | Writes | Notes |
15
+ |---|---|---|---|
16
+ | Claude | `CLAUDE.md` + `Shared/AI-Context-Index.md` | normal vault writes | Follow local tool safety. |
17
+ | Gemini | `GEMINI.md` + `Shared/AI-Context-Index.md` | normal vault writes | Follow COI activation rules. |
18
+ | Codex | `AGENTS.md` + `Shared/AI-Context-Index.md` | repo and vault writes | Prefer verified changes and concise handoffs. |
19
+
20
+ ## Coordination Rule
21
+
22
+ Before making broad vault changes, read [[Shared/Coordination/NOW]] and update [[Shared/Coordination/task-board]] if the task spans multiple sessions.
23
+
24
+ up:: [[Shared/Coordination/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, task-board]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/Coordination/_Index]]"
7
+ ---
8
+
9
+ # task-board
10
+
11
+ > file-Kanban task cards สำหรับ multi-agent coordination
12
+
13
+ ## ใส่ที่นี่
14
+ task file ต่อชิ้นงาน มี claimed_by/status/frontmatter
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ session narrative (→Sessions) · handoff snapshot (→Handoffs)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Coordination/task-board/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Coordination/task-board/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/Coordination/_Index]]
@@ -0,0 +1,43 @@
1
+ ---
2
+ tags: [template, coordination, task]
3
+ note_type: template
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/Coordination/task-board/_Index]]"
7
+ status: todo
8
+ claimed_by:
9
+ priority: medium
10
+ ---
11
+
12
+ # Task Template
13
+
14
+ > ใช้เป็นการ์ดงานที่ claim ได้สำหรับหลาย session/หลาย agent โดยเก็บ objective, scope, owner ปัจจุบัน และ progress สั้น ๆ; narrative ยาวให้ไป Sessions/Handoffs
15
+
16
+ ## Objective
17
+
18
+ _(What needs to be true when this task is done.)_
19
+
20
+ ## Scope
21
+
22
+ - Files / folders:
23
+ - Non-goals:
24
+
25
+ ## Claim
26
+
27
+ - claimed_by:
28
+ - claimed_at:
29
+ - last_checked:
30
+
31
+ ## Progress
32
+
33
+ - [ ] Read [[Shared/Coordination/NOW]]
34
+ - [ ] Verify no other agent claimed this task
35
+ - [ ] Do the work
36
+ - [ ] Update links / indexes / session log
37
+ - [ ] Mark done or hand off
38
+
39
+ ## Notes
40
+
41
+ _(Short operational notes only. Long narrative goes to Sessions or Handoffs.)_
42
+
43
+ up:: [[Shared/Coordination/task-board/_Index]]
@@ -0,0 +1,32 @@
1
+ ---
2
+ tags: [coordination, task-board]
3
+ note_type: registry
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/Coordination/_Index]]"
7
+ ai_surface: hot
8
+ ---
9
+
10
+ # Task Board
11
+
12
+ > Lightweight board for multi-session or multi-agent vault work.
13
+
14
+ ## Active
15
+
16
+ | Task | Owner | Files / Folders | Status | Next Step |
17
+ |---|---|---|---|---|
18
+ | _(none)_ | | | | |
19
+
20
+ ## Waiting
21
+
22
+ | Task | Waiting On | Since |
23
+ |---|---|---|
24
+ | _(none)_ | | |
25
+
26
+ ## Done Recently
27
+
28
+ | Date | Task | Link |
29
+ |---|---|---|
30
+ | _(none)_ | | |
31
+
32
+ up:: [[Shared/Coordination/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, core-facts]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Core-Facts
10
+
11
+ > ground truth ที่เจ้าของเขียนเอง (read-only, invariant)
12
+
13
+ ## ใส่ที่นี่
14
+ protected-facts ที่ AI ห้ามแก้/supersede
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ decision ที่ AI ตัด (→Decision-Memory)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Core-Facts/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Core-Facts/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, decision-memory]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Decision-Memory
10
+
11
+ > การตัดสินใจที่ AI บันทึก (latest-wins + supersedes)
12
+
13
+ ## ใส่ที่นี่
14
+ decision locked + เหตุผล
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ ground truth คน (→Core-Facts)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Decision-Memory/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Decision-Memory/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, glossary]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Glossary
10
+
11
+ > vocabulary กลาง (routes ไป category pages)
12
+
13
+ ## ใส่ที่นี่
14
+ term + นิยาม กลาง
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ entity page (→Entities)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Glossary/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Glossary/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, memory-inbox]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Memory-Inbox
10
+
11
+ > candidate durable memory ที่ยังไม่ชัด/ขัดกัน
12
+
13
+ ## ใส่ที่นี่
14
+ observation รอ promote (เคลียร์ทุก weekly)
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ durable ที่ชัดแล้ว (→ปลายทาง)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Memory-Inbox/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Memory-Inbox/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, operating-state]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Operating-State
10
+
11
+ > live status/metrics ตอนนี้
12
+
13
+ ## ใส่ที่นี่
14
+ current-state + health/queue + workbench
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ objective (→Goals)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Operating-State/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Operating-State/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, prompting]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Prompting
10
+
11
+ > prompt-engineering pattern (style/structure)
12
+
13
+ ## ใส่ที่นี่
14
+ pattern การเขียน prompt ที่ reuse
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ prompt asset ต่อ task (→Prompts)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Prompting/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Prompting/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, provenance]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Provenance
10
+
11
+ > lineage ledger — ทุก claim ชี้ source:: ได้
12
+
13
+ ## ใส่ที่นี่
14
+ บรรทัด ingest ต่อแหล่ง (ingest-log)
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ โน้ต derived (ใส่ source:: แทน)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Provenance/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Provenance/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [index, moc, rules]
3
+ note_type: moc
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/_Index]]"
7
+ ---
8
+
9
+ # Rules
10
+
11
+ > กฎ operating always-on
12
+
13
+ ## ใส่ที่นี่
14
+ memory-write-protocol/frontmatter/context-assembly/formatting/staleness
15
+
16
+ ## ไม่ใส่ที่นี่
17
+ how-to ทำงาน (→Runbooks)
18
+
19
+ ## AI Routing Contract
20
+
21
+ - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
22
+ - ก่อนสร้างไฟล์ใหม่: ค้นหาโน้ตเดิมในโฟลเดอร์นี้และโฟลเดอร์ใกล้เคียงก่อน เพื่อ merge/update แทน append ซ้ำ
23
+ - เมื่อสร้างโน้ตในโฟลเดอร์นี้: ตั้ง `parent: "[[Shared/Rules/_Index]]"` และท้ายไฟล์ `up:: [[Shared/Rules/_Index]]`
24
+ - หลังเขียน: เชื่อม link ไป source/project/session/decision ที่เกี่ยวข้อง และอัปเดต hub/index ถ้าโน้ตนี้ควรถูกค้นเจอในอนาคต
25
+
26
+ > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
+
28
+ _(ยังว่าง — โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
29
+
30
+ up:: [[Shared/_Index]]
@@ -0,0 +1,30 @@
1
+ ---
2
+ tags: [rule, context, notes]
3
+ note_type: rule
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/Rules/_Index]]"
7
+ ai_surface: hot
8
+ ---
9
+
10
+ # Contextual Note Rule
11
+
12
+ > Notes must explain why they exist, not just what they contain.
13
+
14
+ ## Required Context
15
+
16
+ - Why this note was created.
17
+ - What decision, task, entity, or source it connects to.
18
+ - What would make the note stale or superseded.
19
+ - Where the next reader should go next.
20
+
21
+ ## Routing Check
22
+
23
+ Before creating a new note:
24
+
25
+ 1. Search for an existing canonical home.
26
+ 2. Check [[Vault Structure Map]] for the right folder.
27
+ 3. If uncertain, park in [[Shared/Memory-Inbox/memory-inbox]] with a short reason.
28
+ 4. Promote only after the context is clear.
29
+
30
+ up:: [[Shared/Rules/_Index]]
@@ -13,6 +13,16 @@ parent: "[[Shared/Rules/_Index]]"
13
13
  ## Core fields (ทุกโน้ต)
14
14
  `tags` · `note_type` · `created` · `updated` · `parent` + ท้ายไฟล์ `up:: [[parent/_Index]]`
15
15
 
16
+ ## Note Type Taxonomy (allowed values — ห้ามมั่ว type ใหม่เอง)
17
+ - **Project:** `project-overview` `context` `current-state` `session` `index` `reference`
18
+ - **Memory:** `user-preferences` `decision-log` `operating-state` `response-examples` `working-patterns` `success-signals`
19
+ - **Session/Knowledge:** `session-log` `retrospective` `learning-note` `distillation` `research-note` `moc`
20
+ - **Durable:** `durable-index` `protocol` `registry` `standard-reference`
21
+ - **System:** `template` `rule` `glossary` `runbook` `intake` `bug-report` `handoff` `weekly-review`
22
+ - **Dashboard:** `homepage` `projects-dashboard`
23
+
24
+ > ไม่มี type ที่ตรง → ใช้ `reference` (อย่าคิด type ใหม่)
25
+
16
26
  ## Bi-temporal validity (fact notes: Core-Facts / Decision-Memory / Entities)
17
27
 
18
28
  | field | ความหมาย |
@@ -0,0 +1,28 @@
1
+ ---
2
+ tags: [rule, memory, protocol]
3
+ note_type: rule
4
+ created: {{DATE}}
5
+ updated: {{DATE}}
6
+ parent: "[[Shared/Rules/_Index]]"
7
+ ---
8
+
9
+ # Memory-Write Protocol (ADD / UPDATE / DELETE / NOOP)
10
+
11
+ > ทุกครั้งที่จะเขียน durable memory — เลือก operation ชัด (Mem0-style) แทนการ append มั่ว
12
+ > หลักการแม่: **Merge, Don't Append**
13
+
14
+ ## ก่อนเขียน
15
+ 1. **diff กับ [[Shared/Core-Facts/protected-facts]]** (invariant) → ขัด = **หยุด + flag เจ้าของ** (ห้ามทับเงียบ)
16
+ 2. search ปลายทางหา entry หัวข้อเดียวกัน
17
+
18
+ ## เลือก operation
19
+ | op | เมื่อ | ทำ |
20
+ |---|---|---|
21
+ | **ADD** | ของใหม่จริง (ไม่เจอเดิม) | เพิ่ม entry |
22
+ | **UPDATE** | เจอ entry เดิม | แก้ + bump `updated:` (ห้ามเพิ่มซ้ำ) |
23
+ | **DELETE** | fact เลิกจริง/ถูกแทน | bi-temporal supersede (ดู [[Shared/Rules/frontmatter-standard]]) ไม่ลบทิ้ง |
24
+ | **NOOP** | รู้อยู่แล้ว | ไม่ต้องเขียน |
25
+
26
+ > ขัดกัน (ไม่ใช่แค่ซ้ำ) → THESIS/ANTITHESIS/SYNTHESIS → บันทึก decision-log + `supersedes::`
27
+
28
+ up:: [[Shared/Rules/_Index]]