sanook-cli 0.5.0 → 0.5.2

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 (146) hide show
  1. package/.env.example +161 -3
  2. package/CHANGELOG.md +83 -5
  3. package/README.md +240 -23
  4. package/README.th.md +87 -6
  5. package/dist/approval.js +6 -0
  6. package/dist/bin.js +3045 -210
  7. package/dist/brain-context.js +223 -0
  8. package/dist/brain-doctor.js +318 -0
  9. package/dist/brain-eval.js +186 -0
  10. package/dist/brain-final.js +371 -0
  11. package/dist/brain-review.js +382 -0
  12. package/dist/brain.js +12 -1
  13. package/dist/brand.js +1 -1
  14. package/dist/cli-args.js +152 -0
  15. package/dist/cli-option-values.js +16 -0
  16. package/dist/commands.js +172 -13
  17. package/dist/compaction.js +96 -11
  18. package/dist/config.js +118 -28
  19. package/dist/context-compression.js +191 -0
  20. package/dist/cost.js +49 -15
  21. package/dist/first-run.js +21 -0
  22. package/dist/gateway/auth.js +37 -8
  23. package/dist/gateway/bluebubbles.js +205 -0
  24. package/dist/gateway/config.js +929 -0
  25. package/dist/gateway/deliver.js +357 -0
  26. package/dist/gateway/discord.js +124 -0
  27. package/dist/gateway/email.js +472 -0
  28. package/dist/gateway/googlechat.js +207 -0
  29. package/dist/gateway/homeassistant.js +256 -0
  30. package/dist/gateway/ledger.js +18 -0
  31. package/dist/gateway/line.js +171 -0
  32. package/dist/gateway/lock.js +3 -1
  33. package/dist/gateway/matrix.js +366 -0
  34. package/dist/gateway/mattermost.js +322 -0
  35. package/dist/gateway/ntfy.js +218 -0
  36. package/dist/gateway/schedule.js +31 -4
  37. package/dist/gateway/serve.js +267 -7
  38. package/dist/gateway/server.js +253 -19
  39. package/dist/gateway/service.js +224 -0
  40. package/dist/gateway/session.js +343 -0
  41. package/dist/gateway/signal.js +351 -0
  42. package/dist/gateway/slack.js +124 -0
  43. package/dist/gateway/sms.js +169 -0
  44. package/dist/gateway/targets.js +576 -0
  45. package/dist/gateway/teams.js +106 -0
  46. package/dist/gateway/telegram.js +38 -15
  47. package/dist/gateway/webhooks.js +220 -0
  48. package/dist/gateway/whatsapp.js +230 -0
  49. package/dist/hooks.js +13 -2
  50. package/dist/insights-args.js +35 -0
  51. package/dist/insights.js +86 -0
  52. package/dist/loop.js +123 -24
  53. package/dist/lsp/index.js +23 -5
  54. package/dist/mcp-registry.js +350 -0
  55. package/dist/mcp-server.js +1 -1
  56. package/dist/mcp.js +44 -6
  57. package/dist/memory.js +100 -33
  58. package/dist/orchestrate.js +49 -19
  59. package/dist/personality.js +58 -0
  60. package/dist/providers/codex.js +86 -38
  61. package/dist/providers/keys.js +1 -1
  62. package/dist/providers/models.js +22 -6
  63. package/dist/providers/registry.js +38 -49
  64. package/dist/search/chunk.js +7 -8
  65. package/dist/search/cli.js +75 -0
  66. package/dist/search/embed-store.js +3 -0
  67. package/dist/search/indexer.js +44 -1
  68. package/dist/search/store.js +23 -1
  69. package/dist/session.js +93 -7
  70. package/dist/skill-install.js +29 -12
  71. package/dist/support-dump.js +175 -0
  72. package/dist/tools/edit.js +45 -15
  73. package/dist/tools/git.js +10 -5
  74. package/dist/tools/homeassistant.js +106 -0
  75. package/dist/tools/index.js +5 -0
  76. package/dist/tools/list.js +19 -6
  77. package/dist/tools/permission.js +923 -9
  78. package/dist/tools/read.js +16 -4
  79. package/dist/tools/schedule.js +19 -3
  80. package/dist/tools/search.js +217 -13
  81. package/dist/tools/task.js +18 -7
  82. package/dist/tools/timeout.js +21 -3
  83. package/dist/trust.js +11 -1
  84. package/dist/ui/app.js +57 -11
  85. package/dist/ui/brain-wizard.js +2 -2
  86. package/dist/ui/history.js +37 -5
  87. package/dist/ui/mentions.js +3 -2
  88. package/dist/ui/render.js +55 -15
  89. package/dist/ui/setup.js +107 -10
  90. package/dist/update.js +24 -11
  91. package/dist/worktree.js +175 -4
  92. package/package.json +4 -4
  93. package/second-brain/AGENTS.md +6 -4
  94. package/second-brain/CLAUDE.md +7 -1
  95. package/second-brain/Evals/_Index.md +10 -2
  96. package/second-brain/Evals/quality-ledger.md +9 -1
  97. package/second-brain/Evals/second-brain-benchmarks.md +62 -0
  98. package/second-brain/GEMINI.md +5 -4
  99. package/second-brain/Home.md +1 -1
  100. package/second-brain/Projects/_Index.md +3 -1
  101. package/second-brain/Projects/sanook-cli/_Index.md +26 -0
  102. package/second-brain/Projects/sanook-cli/second-brain-feature-roadmap.md +156 -0
  103. package/second-brain/README.md +1 -1
  104. package/second-brain/Research/2026-06-17-ai-second-brain-method-experiment.md +108 -0
  105. package/second-brain/Research/2026-06-18-ai-token-reduction-frameworks.md +55 -0
  106. package/second-brain/Research/2026-06-18-hermes-cli-second-brain-expansion-research.md +160 -0
  107. package/second-brain/Research/2026-06-18-sanook-mcp-ecosystem-and-ux-roadmap.md +181 -0
  108. package/second-brain/Research/_Index.md +6 -1
  109. package/second-brain/Reviews/2026-06-18-auto-improve-maintenance.md +54 -0
  110. package/second-brain/Reviews/_Index.md +1 -1
  111. package/second-brain/Runbooks/_Index.md +6 -1
  112. package/second-brain/Runbooks/ai-second-brain-operating-sequence.md +108 -0
  113. package/second-brain/SANOOK.md +45 -0
  114. package/second-brain/Sessions/2026-06-17-ai-framework-additional-zones.md +68 -0
  115. package/second-brain/Sessions/2026-06-17-ai-second-brain-sequence-experiment.md +63 -0
  116. package/second-brain/Sessions/2026-06-18-cli-args-release-readiness.md +59 -0
  117. package/second-brain/Sessions/2026-06-18-final-gate-template-final.md +192 -0
  118. package/second-brain/Sessions/2026-06-18-final-gate-template.md +71 -0
  119. package/second-brain/Sessions/2026-06-18-framework-dogfood-permission-and-memory.md +58 -0
  120. package/second-brain/Sessions/2026-06-18-hermes-second-brain-expansion-research.md +52 -0
  121. package/second-brain/Sessions/2026-06-18-mcp-ecosystem-and-sanook-ux-scan.md +81 -0
  122. package/second-brain/Sessions/2026-06-18-sanook-brain-cli-p0-implementation.md +86 -0
  123. package/second-brain/Sessions/2026-06-18-sanook-brain-final-cli-final.md +246 -0
  124. package/second-brain/Sessions/2026-06-18-sanook-brain-final-cli.md +78 -0
  125. package/second-brain/Sessions/2026-06-18-sanook-cli-second-brain-roadmap-correction.md +54 -0
  126. package/second-brain/Sessions/2026-06-18-token-reduction-framework-integration.md +69 -0
  127. package/second-brain/Sessions/_Index.md +15 -1
  128. package/second-brain/Shared/AI-Context-Index.md +22 -0
  129. package/second-brain/Shared/Context-Packs/_Index.md +9 -1
  130. package/second-brain/Shared/Context-Packs/coding-release.md +51 -0
  131. package/second-brain/Shared/Context-Packs/research-to-framework.md +51 -0
  132. package/second-brain/Shared/Context-Packs/second-brain-maintenance.md +41 -0
  133. package/second-brain/Shared/Operating-State/current-state.md +22 -3
  134. package/second-brain/Shared/Scripts/_Index.md +3 -1
  135. package/second-brain/Shared/Scripts/ai-second-brain-method-eval.mjs +198 -0
  136. package/second-brain/Shared/Tech-Standards/_Index.md +4 -1
  137. package/second-brain/Shared/Tech-Standards/mcp-integration-roadmap.md +86 -0
  138. package/second-brain/Shared/Tech-Standards/verification-standard.md +24 -0
  139. package/second-brain/Shared/User-Memory/_Index.md +4 -1
  140. package/second-brain/Shared/User-Memory/response-examples.md +98 -0
  141. package/second-brain/Shared/User-Memory/user-preferences.md +1 -0
  142. package/second-brain/Templates/_Index.md +9 -0
  143. package/second-brain/Templates/final-lite.md +111 -0
  144. package/second-brain/Templates/final.md +231 -0
  145. package/second-brain/Vault Structure Map.md +2 -1
  146. package/skills/structured-output-llm/SKILL.md +1 -1
@@ -31,6 +31,30 @@ Verification:
31
31
  - Smoke: <command/result>
32
32
  ```
33
33
 
34
+ ## Final Gate
35
+
36
+ For non-trivial work, multi-file changes, framework changes, releases, or anything the owner may later audit, instantiate [[Templates/final]] before the final owner-facing answer. Use [[Templates/final-lite]] for smaller tasks that still need evidence, or run:
37
+
38
+ ```text
39
+ sanook brain final --task "<objective>" --from-diff
40
+ sanook brain final --task "<objective>" --lite
41
+ ```
42
+
43
+ The final gate must prove all eight closeout requirements:
44
+
45
+ 1. Objective / DoD is restated and matched.
46
+ 2. Checklist items have evidence, not only checked boxes.
47
+ 3. Status uses `PASS`, `PARTIAL`, `FAIL`, `N/A`, or `BLOCKED`.
48
+ 4. Evidence matrix lists commands, files, artifacts, and sources.
49
+ 5. Residual risk and skipped checks are explicit.
50
+ 6. Change summary distinguishes changed vs untouched work.
51
+ 7. Final answer draft does not overclaim beyond evidence.
52
+ 8. Second-brain routing / memory closeout is handled.
53
+
54
+ If a row has no evidence, it cannot be `PASS`.
55
+
56
+ `sanook brain review` checks final-gate notes in `Sessions/` for missing sections, unfilled placeholders, `TODO` rows, and `PASS` rows without evidence. `sanook brain eval` checks that the final-gate templates remain bundled and wired into this standard.
57
+
34
58
  ## Never Claim Done If
35
59
 
36
60
  - Tests were skipped without saying why.
@@ -25,6 +25,9 @@ identity static (→User-Persona)
25
25
 
26
26
  > รายละเอียดทุกโฟลเดอร์ + decision rules → [[Vault Structure Map]]
27
27
 
28
- _(ยังว่าง โน้ตในโฟลเดอร์นี้จะถูกลิงก์ที่นี่)_
28
+ ## User-Memory Notes
29
+
30
+ - [[Shared/User-Memory/user-preferences]] — durable preferences ของเจ้าของ
31
+ - [[Shared/User-Memory/response-examples]] — examples/taste signals ว่าคำตอบ AI แบบไหนดีหรือไม่ดี
29
32
 
30
33
  up:: [[Shared/_Index]]
@@ -0,0 +1,98 @@
1
+ ---
2
+ tags: [user-memory, response-examples, taste]
3
+ note_type: response-examples
4
+ created: 2026-06-17
5
+ updated: 2026-06-17
6
+ parent: "[[Shared/User-Memory/_Index]]"
7
+ related:: [[Shared/User-Memory/user-preferences]]
8
+ ---
9
+
10
+ # Response Examples & Taste Signals
11
+
12
+ > Mutable examples of what "good AI behavior" feels like for {{OWNER_NAME}}. These examples are initial working defaults inferred from current vault work; update when the owner gives stronger feedback.
13
+
14
+ ## Preferred Shape
15
+
16
+ - Thai first, with natural tech English where useful.
17
+ - Lead with the answer or status.
18
+ - Be proactive when the action is safe; ask only when the next step is genuinely risky or ambiguous.
19
+ - Summarize verification evidence without dumping full logs.
20
+ - For framework work, think like Scientist first, then implement like Operator/Librarian.
21
+
22
+ ## Good Pattern: Work Completed
23
+
24
+ ```text
25
+ เสร็จแล้วครับ ผมเพิ่ม benchmark, taste examples, และ context packs เข้า framework แล้ว
26
+
27
+ หลัก ๆ คือ:
28
+ - Evals/second-brain-benchmarks.md สำหรับวัดคุณภาพ AI
29
+ - Shared/User-Memory/response-examples.md สำหรับ style/taste
30
+ - Shared/Context-Packs/... สำหรับโหลด context ตามงานซ้ำ
31
+
32
+ ตรวจแล้ว: script/runbook links อยู่ใน index และ git diff --check ผ่าน
33
+ ```
34
+
35
+ Why good:
36
+
37
+ - Starts with status.
38
+ - Names files.
39
+ - Mentions verification.
40
+ - Does not over-explain unless asked.
41
+
42
+ ## Bad Pattern: Too Vague
43
+
44
+ ```text
45
+ ผมได้ปรับปรุงระบบให้ดีขึ้นแล้ว มีหลายส่วนที่ช่วยให้ AI ทำงานดีขึ้น และน่าจะใช้งานได้ดีมากขึ้นในอนาคต
46
+ ```
47
+
48
+ Why bad:
49
+
50
+ - No files.
51
+ - No evidence.
52
+ - No next action.
53
+
54
+ ## Good Pattern: Recommendation Before Edit
55
+
56
+ ```text
57
+ ผมไม่แนะนำให้เพิ่ม root folder ใหม่ตอนนี้ครับ เพราะ vault มี zone รองรับอยู่แล้ว
58
+ ทางที่คุ้มกว่าคือเติม benchmark ใน Evals, taste examples ใน User-Memory, และ context packs ใน Shared/Context-Packs
59
+ ```
60
+
61
+ Why good:
62
+
63
+ - Gives a point of view.
64
+ - Protects the framework from unnecessary complexity.
65
+ - Offers concrete implementation path.
66
+
67
+ ## Good Pattern: Act On All Clear Recommendations
68
+
69
+ ```text
70
+ รับครับ ผมจะทำครบตาม 4 ข้อที่แนะนำไว้: ตรวจ worktree, รัน tests, ใช้ benchmark/framework จริง, แล้วอัปเดต memory/session evidence ให้ครบ
71
+ ```
72
+
73
+ Why good:
74
+
75
+ - Mirrors the requested scope.
76
+ - Commits to action when the work is safe and clear.
77
+ - Keeps the owner looped in without asking for unnecessary confirmation.
78
+
79
+ ## Good Pattern: Uncertainty
80
+
81
+ ```text
82
+ ผมยังยืนยัน claim นี้ไม่ได้จาก vault ปัจจุบันครับ หลักฐานที่มีบอกได้แค่ว่า X ผ่าน แต่ยังไม่ได้พิสูจน์ Y
83
+ ```
84
+
85
+ Why good:
86
+
87
+ - Does not pretend certainty.
88
+ - Separates evidence from inference.
89
+
90
+ ## Update Rule
91
+
92
+ When owner reacts positively/negatively to a response:
93
+
94
+ 1. Classify the signal as style, autonomy, detail level, or evidence expectation.
95
+ 2. Update this file or [[Shared/User-Memory/user-preferences]] with ADD/UPDATE/NOOP.
96
+ 3. Do not duplicate the same preference in multiple places.
97
+
98
+ up:: [[Shared/User-Memory/_Index]]
@@ -15,6 +15,7 @@ parent: "[[Shared/User-Memory/_Index]]"
15
15
 
16
16
  ## Execution
17
17
  - Autonomy: {{AUTONOMY}}
18
+ - เมื่อมีรายการแนะนำที่ scope ชัดและปลอดภัย เจ้าของมักต้องการให้ลงมือทำครบได้เลย ไม่ต้องถามยืนยันซ้ำ
18
19
 
19
20
  ## Likes
20
21
  _(เพิ่มเมื่อเจ้าของบอกว่าชอบอะไรชัดเจน)_
@@ -16,6 +16,15 @@ template ไว้ instantiate (session/bug/handoff/project)
16
16
  ## ไม่ใส่ที่นี่
17
17
  โน้ตจริง
18
18
 
19
+ ## Templates
20
+
21
+ - [[Templates/session]] — session log หลังจบงานหรือ checkpoint สำคัญ
22
+ - [[Templates/handoff]] — ส่งต่องานค้างให้ session/agent ถัดไป
23
+ - [[Templates/project]] — project overview
24
+ - [[Templates/bug]] — bug report
25
+ - [[Templates/final]] — final gate เต็มก่อนบอกว่าเสร็จแล้ว; checklist ต้องมี evidence
26
+ - [[Templates/final-lite]] — final gate แบบสั้นสำหรับงานเล็กถึงกลาง; ใช้เกณฑ์ evidence เดียวกัน
27
+
19
28
  ## AI Routing Contract
20
29
 
21
30
  - ก่อนเขียน: เช็กว่าเนื้อหาตรง "ใส่ที่นี่" และไม่เข้า "ไม่ใส่ที่นี่"; ถ้าก้ำกึ่งอ่าน [[Vault Structure Map]] ก่อน
@@ -0,0 +1,111 @@
1
+ ---
2
+ tags: [template, final-gate, verification, lite]
3
+ note_type: template
4
+ created: YYYY-MM-DD
5
+ updated: YYYY-MM-DD
6
+ parent: "[[Templates/_Index]]"
7
+ ---
8
+
9
+ # YYYY-MM-DD - <task/topic> - Final Gate Lite
10
+
11
+ > Final gate แบบสั้นสำหรับงานเล็กถึงกลาง: ยังต้องล็อก objective, evidence, risk, final answer, และ memory routing; ถ้า row ไม่มี evidence ห้าม mark `PASS`
12
+
13
+ ## 0. Final Gate Rule
14
+
15
+ - [ ] Created before the owner-facing final answer.
16
+ - [ ] Every `PASS` has evidence.
17
+ - [ ] If a row has no evidence, it cannot be `PASS`.
18
+
19
+ Status: `PASS`, `PARTIAL`, `FAIL`, `N/A`, `BLOCKED`, `TODO`.
20
+
21
+ ## 1. Objective / DoD Lock
22
+
23
+ Original request:
24
+
25
+ ```text
26
+ <paste owner request or goal text here>
27
+ ```
28
+
29
+ | DoD item | Status | Evidence |
30
+ |---|---|---|
31
+ | Objective is concrete. | TODO | |
32
+ | Deliverable exists in the right place. | TODO | |
33
+ | Owner-facing answer can be backed by evidence. | TODO | |
34
+
35
+ ## 2. Evidence-Backed Checklist
36
+
37
+ | Gate | Status | Evidence |
38
+ |---|---|---|
39
+ | Relevant context was read. | TODO | |
40
+ | No unrelated worktree changes were reverted. | TODO | |
41
+ | Verification ran at the right scope. | TODO | |
42
+
43
+ ## 3. Status Matrix
44
+
45
+ | Work item / phase | Status | Evidence |
46
+ |---|---|---|
47
+ | Implement/write/edit | TODO | |
48
+ | Verify | TODO | |
49
+ | Close memory/session if needed | TODO | |
50
+
51
+ ## 4. Evidence Matrix
52
+
53
+ Commands:
54
+
55
+ | Command | Status | Important output | Scope proven |
56
+ |---|---|---|---|
57
+ | `<command>` | TODO | | |
58
+
59
+ Changed files:
60
+
61
+ | File | Change summary | Evidence |
62
+ |---|---|---|
63
+ | `<file>` | | |
64
+
65
+ ## 5. Residual Risk
66
+
67
+ | Risk or skipped check | Status | Evidence / reason |
68
+ |---|---|---|
69
+ | `<risk>` | TODO | |
70
+
71
+ ## 6. Change Summary Audit
72
+
73
+ What changed:
74
+
75
+ - <short summary>
76
+
77
+ What did not change:
78
+
79
+ - <important non-change or unrelated worktree file>
80
+
81
+ ## 7. Final Answer Draft
82
+
83
+ ```text
84
+ <short final answer>
85
+
86
+ Verified:
87
+ - <command/result>
88
+
89
+ Residual risk:
90
+ - <risk or "none known">
91
+ ```
92
+
93
+ ## 8. Second-Brain Routing / Memory Closeout
94
+
95
+ | Routing item | Status | Evidence |
96
+ |---|---|---|
97
+ | Session/index/current-state update needed? | TODO | |
98
+ | Durable memory/decision update needed? | TODO | |
99
+ | Search/index refresh needed? | TODO | |
100
+
101
+ ## Final Verdict
102
+
103
+ | Verdict | Status | Evidence |
104
+ |---|---|---|
105
+ | Ready to close / caveat / blocked | TODO | |
106
+
107
+ One-line final state:
108
+
109
+ > <state + evidence>
110
+
111
+ up:: [[Templates/_Index]]
@@ -0,0 +1,231 @@
1
+ ---
2
+ tags: [template, final-gate, verification, dod]
3
+ note_type: template
4
+ created: YYYY-MM-DD
5
+ updated: YYYY-MM-DD
6
+ parent: "[[Templates/_Index]]"
7
+ ---
8
+
9
+ # YYYY-MM-DD - <task/topic> - Final Gate
10
+
11
+ > ใช้เป็น phase สุดท้ายก่อนบอกว่า "เสร็จแล้ว" โดยตรวจ objective, DoD, evidence, risk, memory routing และ final answer draft; ไม่ใช้เป็น checklist ลอย ๆ ที่ไม่มีหลักฐาน
12
+
13
+ ## 0. Final Gate Rule
14
+
15
+ - [ ] This final gate was created before the final owner-facing answer.
16
+ - [ ] Every PASS/PARTIAL/FAIL/BLOCKED claim below has evidence or an explicit reason.
17
+ - [ ] No unchecked item is silently treated as done.
18
+ - [ ] If evidence is missing, status is `PARTIAL`, `FAIL`, or `BLOCKED`, not `PASS`.
19
+ - [ ] If a row has no evidence, it cannot be `PASS`.
20
+
21
+ Status vocabulary:
22
+
23
+ | Status | Meaning | When to use |
24
+ |---|---|---|
25
+ | `PASS` | Requirement was satisfied and evidence proves it. | Command output, file path, rendered artifact, source citation, or reviewed diff exists. |
26
+ | `PARTIAL` | Some work was done, but evidence is incomplete or scope is narrower than requested. | Targeted test passed but full affected surface was not checked. |
27
+ | `FAIL` | Requirement was attempted and did not satisfy the gate. | Test failed, artifact missing, output contradicts requirement. |
28
+ | `N/A` | Gate does not apply to this task. | Visual QA for a non-visual note-only change. |
29
+ | `BLOCKED` | Work cannot proceed without owner input or external state. | Missing credential, unavailable service, unclear requirement after reasonable inspection. |
30
+
31
+ ## 1. Objective / DoD Lock
32
+
33
+ Original request:
34
+
35
+ ```text
36
+ <paste owner request or goal text here>
37
+ ```
38
+
39
+ Expected output:
40
+
41
+ - [ ] <deliverable 1>
42
+ - [ ] <deliverable 2>
43
+ - [ ] <deliverable 3>
44
+
45
+ Definition of Done:
46
+
47
+ | DoD item | Status | Evidence | Notes |
48
+ |---|---|---|---|
49
+ | Objective is restated in concrete terms. | TODO | | |
50
+ | Scope and non-goals are explicit. | TODO | | |
51
+ | Required artifact(s) exist in the right canonical home. | TODO | | |
52
+ | Owner-facing result matches requested language/tone/detail. | TODO | | |
53
+
54
+ Out of scope / non-goals:
55
+
56
+ - <not doing this because...>
57
+
58
+ ## 2. Evidence-Backed Checklist
59
+
60
+ > Rule: checkbox alone is not evidence. Each checked row needs proof.
61
+
62
+ | Gate | Status | Evidence | Notes |
63
+ |---|---|---|---|
64
+ | Relevant source/context was read before editing. | TODO | | |
65
+ | Existing canonical note/file was searched before creating a new one. | TODO | | |
66
+ | Changes were made in the correct folder/module boundary. | TODO | | |
67
+ | No unrelated user/worktree changes were reverted or overwritten. | TODO | | |
68
+ | New/changed durable notes have `parent` and `up::`. | TODO | | |
69
+ | Index/backlink/discoverability was updated when needed. | TODO | | |
70
+ | Verification was run at the right scope. | TODO | | |
71
+ | Residual risk is stated clearly. | TODO | | |
72
+
73
+ ## 3. Status Matrix
74
+
75
+ Use this when the work has multiple deliverables or phases.
76
+
77
+ | Work item / phase | Status | Evidence | Owner-visible outcome |
78
+ |---|---|---|---|
79
+ | Frame objective and DoD | TODO | | |
80
+ | Retrieve required context | TODO | | |
81
+ | Implement / write / edit | TODO | | |
82
+ | Verify behavior or artifact | TODO | | |
83
+ | Update memory/index/session if needed | TODO | | |
84
+ | Prepare final response | TODO | | |
85
+
86
+ Blocked / partial explanation:
87
+
88
+ - `PARTIAL`: <what is complete, what is not, why>
89
+ - `BLOCKED`: <blocking condition, attempts made, exact input/state needed>
90
+
91
+ ## 4. Evidence Matrix
92
+
93
+ Commands:
94
+
95
+ | Command | Status | Important output | Scope proven |
96
+ |---|---|---|---|
97
+ | `<command>` | TODO | | |
98
+
99
+ Files inspected:
100
+
101
+ | File/path | Why it matters | Evidence |
102
+ |---|---|---|
103
+ | `<path>` | | |
104
+
105
+ Files changed:
106
+
107
+ | File/path | Change summary | Evidence |
108
+ |---|---|---|
109
+ | `<path>` | | |
110
+
111
+ Artifacts/rendered outputs:
112
+
113
+ | Artifact | Status | Evidence |
114
+ |---|---|---|
115
+ | `<artifact>` | TODO | |
116
+
117
+ External sources, if any:
118
+
119
+ | Source | Claim supported | Link / citation |
120
+ |---|---|---|
121
+ | `<source>` | | |
122
+
123
+ ## 5. Residual Risk
124
+
125
+ Known risk:
126
+
127
+ | Risk | Impact | Mitigation / next check |
128
+ |---|---|---|
129
+ | `<risk>` | | |
130
+
131
+ Checks not run:
132
+
133
+ | Check | Reason not run | Consequence |
134
+ |---|---|---|
135
+ | `<check>` | | |
136
+
137
+ Do not claim done if:
138
+
139
+ - [ ] A required check failed.
140
+ - [ ] A required check was skipped without a reason.
141
+ - [ ] The changed behavior was not exercised.
142
+ - [ ] A visual/exported artifact was not opened/rendered when layout matters.
143
+ - [ ] The final answer would overstate evidence.
144
+
145
+ ## 6. Change Summary Audit
146
+
147
+ What changed:
148
+
149
+ - <bullet summary of actual changes>
150
+
151
+ What did not change:
152
+
153
+ - <important non-changes, especially unrelated worktree files>
154
+
155
+ Behavior before:
156
+
157
+ - <before state>
158
+
159
+ Behavior after:
160
+
161
+ - <after state>
162
+
163
+ Compatibility / migration notes:
164
+
165
+ - <none or details>
166
+
167
+ ## 7. Final Answer Draft
168
+
169
+ Use this draft as the owner-facing final answer. Keep it consistent with the evidence above.
170
+
171
+ ```text
172
+ <short answer/status first>
173
+
174
+ Changed:
175
+ - <file/behavior>
176
+
177
+ Verified:
178
+ - <command/result>
179
+
180
+ Residual risk:
181
+ - <risk or "none known">
182
+ ```
183
+
184
+ Final-answer safety check:
185
+
186
+ - [ ] Does not claim tests/build/smoke passed unless listed in Evidence Matrix.
187
+ - [ ] Names files/commands accurately.
188
+ - [ ] Mentions skipped checks or residual risk.
189
+ - [ ] Is concise enough for the owner.
190
+
191
+ ## 8. Second-Brain Routing / Memory Closeout
192
+
193
+ Session / handoff:
194
+
195
+ - [ ] Update `Sessions/YYYY-MM-DD-<topic>.md` if the work was non-trivial.
196
+ - [ ] Create/update `Handoffs/` if work remains for another session/agent.
197
+
198
+ Durable memory:
199
+
200
+ - [ ] Preference discovered? Route to [[Shared/User-Memory/user-preferences]] or Memory-Inbox.
201
+ - [ ] Decision made? Route to [[Shared/Decision-Memory/decision-log]].
202
+ - [ ] Current focus changed? Update [[Shared/Operating-State/current-state]].
203
+ - [ ] Unclear/conflicting memory? Route to [[Shared/Memory-Inbox/memory-inbox]].
204
+
205
+ Indexes / discoverability:
206
+
207
+ - [ ] Update destination `_Index.md` if the new artifact should be found later.
208
+ - [ ] Add backlinks to project/session/source/decision.
209
+ - [ ] Run `sanook index` if retrieval/search should see the change immediately.
210
+
211
+ Quality loop:
212
+
213
+ - [ ] Run `sanook brain doctor` if vault structure/config changed.
214
+ - [ ] Run `sanook brain review` if memory/context/session/eval hygiene changed.
215
+ - [ ] Run `sanook brain eval` if framework/hot-path behavior changed.
216
+ - [ ] Update [[Evals/quality-ledger]] for framework/system changes.
217
+
218
+ ## Final Verdict
219
+
220
+ | Verdict | Choose one | Evidence |
221
+ |---|---|---|
222
+ | Ready to close | TODO | |
223
+ | Close with caveats | TODO | |
224
+ | Needs more work | TODO | |
225
+ | Blocked | TODO | |
226
+
227
+ One-line final state:
228
+
229
+ > <e.g. Ready to close because X passed; caveat Y remains.>
230
+
231
+ up:: [[Templates/_Index]]
@@ -108,8 +108,9 @@ ai_surface: hot
108
108
  | `Shared/Assets/` | รูป/logo/binary | image/logo/asset | โน้ต .md |
109
109
 
110
110
  ### AI agent config / vendor (root-level)
111
- | Folder | Role | ใส่ที่นี่ | ห้ามใส่ |
111
+ | Path | Role | ใส่ที่นี่ | ห้ามใส่ |
112
112
  |---|---|---|---|
113
+ | `SANOOK.md` | Sanook CLI context adapter | กฎย่อเฉพาะ `sanook` / `sanook chat` ที่ชี้กลับ `CLAUDE.md` | durable note หรือ gateway/desktop setup |
113
114
  | `.agents/` `.agents/skills/` | skill folders (SKILL.md) | SKILL.md ที่ agent โหลด on-demand | prose how-to (→Runbooks) |
114
115
  | `.agents/workflows/` | workflow guides | multi-step orchestration ที่ทำซ้ำ | one-off task |
115
116
  | `copilot/` | vendor export (review/promote) | export จาก Copilot | durable (promote เข้า durable layer) |
@@ -13,7 +13,7 @@ Reach for this skill when a program — not a human — consumes the model's out
13
13
  - "The model returns ```json fences / prose / trailing commas and my parse breaks ~3% of the time"
14
14
  - "Function arguments come back malformed or with hallucinated keys"
15
15
  - "Fill this form schema" / "map this text to my DB row"
16
- - "Open-weights model (Llama/Mistral/Qwen) won't reliably produce valid JSON"
16
+ - "Open-weights model won't reliably produce valid JSON"
17
17
  - "Long extraction gets cut off mid-object" or "streaming JSON is unparseable until complete"
18
18
 
19
19
  NOT this skill: