sanook-cli 0.5.1 → 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.
- package/.env.example +161 -3
- package/CHANGELOG.md +57 -8
- package/README.md +240 -23
- package/README.th.md +87 -6
- package/dist/approval.js +6 -0
- package/dist/bin.js +3026 -196
- package/dist/brain-context.js +223 -0
- package/dist/brain-doctor.js +318 -0
- package/dist/brain-eval.js +186 -0
- package/dist/brain-final.js +371 -0
- package/dist/brain-review.js +382 -0
- package/dist/brain.js +12 -1
- package/dist/brand.js +1 -1
- package/dist/cli-args.js +152 -0
- package/dist/cli-option-values.js +16 -0
- package/dist/commands.js +172 -13
- package/dist/compaction.js +96 -11
- package/dist/config.js +118 -28
- package/dist/context-compression.js +191 -0
- package/dist/cost.js +49 -15
- package/dist/first-run.js +21 -0
- package/dist/gateway/auth.js +37 -8
- package/dist/gateway/bluebubbles.js +205 -0
- package/dist/gateway/config.js +929 -0
- package/dist/gateway/deliver.js +357 -0
- package/dist/gateway/discord.js +124 -0
- package/dist/gateway/email.js +472 -0
- package/dist/gateway/googlechat.js +207 -0
- package/dist/gateway/homeassistant.js +256 -0
- package/dist/gateway/ledger.js +18 -0
- package/dist/gateway/line.js +171 -0
- package/dist/gateway/lock.js +3 -1
- package/dist/gateway/matrix.js +366 -0
- package/dist/gateway/mattermost.js +322 -0
- package/dist/gateway/ntfy.js +218 -0
- package/dist/gateway/schedule.js +31 -4
- package/dist/gateway/serve.js +267 -7
- package/dist/gateway/server.js +253 -19
- package/dist/gateway/service.js +224 -0
- package/dist/gateway/session.js +343 -0
- package/dist/gateway/signal.js +351 -0
- package/dist/gateway/slack.js +124 -0
- package/dist/gateway/sms.js +169 -0
- package/dist/gateway/targets.js +576 -0
- package/dist/gateway/teams.js +106 -0
- package/dist/gateway/telegram.js +38 -15
- package/dist/gateway/webhooks.js +220 -0
- package/dist/gateway/whatsapp.js +230 -0
- package/dist/hooks.js +13 -2
- package/dist/insights-args.js +35 -0
- package/dist/insights.js +86 -0
- package/dist/loop.js +123 -24
- package/dist/lsp/index.js +23 -5
- package/dist/mcp-registry.js +350 -0
- package/dist/mcp-server.js +1 -1
- package/dist/mcp.js +44 -6
- package/dist/memory.js +100 -33
- package/dist/orchestrate.js +49 -19
- package/dist/personality.js +58 -0
- package/dist/providers/codex.js +70 -36
- package/dist/providers/keys.js +1 -1
- package/dist/providers/models.js +1 -1
- package/dist/providers/registry.js +14 -47
- package/dist/search/chunk.js +7 -8
- package/dist/search/cli.js +75 -0
- package/dist/search/embed-store.js +3 -0
- package/dist/search/indexer.js +44 -1
- package/dist/search/store.js +23 -1
- package/dist/session.js +93 -7
- package/dist/skill-install.js +29 -12
- package/dist/support-dump.js +175 -0
- package/dist/tools/edit.js +45 -15
- package/dist/tools/git.js +10 -5
- package/dist/tools/homeassistant.js +106 -0
- package/dist/tools/index.js +5 -0
- package/dist/tools/list.js +19 -6
- package/dist/tools/permission.js +923 -9
- package/dist/tools/read.js +16 -4
- package/dist/tools/schedule.js +19 -3
- package/dist/tools/search.js +217 -13
- package/dist/tools/task.js +18 -7
- package/dist/tools/timeout.js +21 -3
- package/dist/trust.js +11 -1
- package/dist/ui/app.js +48 -8
- package/dist/ui/history.js +37 -5
- package/dist/ui/mentions.js +3 -2
- package/dist/ui/setup.js +17 -4
- package/dist/update.js +24 -11
- package/dist/worktree.js +175 -4
- package/package.json +4 -4
- package/second-brain/AGENTS.md +6 -4
- package/second-brain/CLAUDE.md +7 -1
- package/second-brain/Evals/_Index.md +10 -2
- package/second-brain/Evals/quality-ledger.md +9 -1
- package/second-brain/Evals/second-brain-benchmarks.md +62 -0
- package/second-brain/GEMINI.md +5 -4
- package/second-brain/Home.md +1 -1
- package/second-brain/Projects/_Index.md +3 -1
- package/second-brain/Projects/sanook-cli/_Index.md +26 -0
- package/second-brain/Projects/sanook-cli/second-brain-feature-roadmap.md +156 -0
- package/second-brain/README.md +1 -1
- package/second-brain/Research/2026-06-17-ai-second-brain-method-experiment.md +108 -0
- package/second-brain/Research/2026-06-18-ai-token-reduction-frameworks.md +55 -0
- package/second-brain/Research/2026-06-18-hermes-cli-second-brain-expansion-research.md +160 -0
- package/second-brain/Research/2026-06-18-sanook-mcp-ecosystem-and-ux-roadmap.md +181 -0
- package/second-brain/Research/_Index.md +6 -1
- package/second-brain/Reviews/2026-06-18-auto-improve-maintenance.md +54 -0
- package/second-brain/Reviews/_Index.md +1 -1
- package/second-brain/Runbooks/_Index.md +6 -1
- package/second-brain/Runbooks/ai-second-brain-operating-sequence.md +108 -0
- package/second-brain/SANOOK.md +45 -0
- package/second-brain/Sessions/2026-06-17-ai-framework-additional-zones.md +68 -0
- package/second-brain/Sessions/2026-06-17-ai-second-brain-sequence-experiment.md +63 -0
- package/second-brain/Sessions/2026-06-18-cli-args-release-readiness.md +59 -0
- package/second-brain/Sessions/2026-06-18-final-gate-template-final.md +192 -0
- package/second-brain/Sessions/2026-06-18-final-gate-template.md +71 -0
- package/second-brain/Sessions/2026-06-18-framework-dogfood-permission-and-memory.md +58 -0
- package/second-brain/Sessions/2026-06-18-hermes-second-brain-expansion-research.md +52 -0
- package/second-brain/Sessions/2026-06-18-mcp-ecosystem-and-sanook-ux-scan.md +81 -0
- package/second-brain/Sessions/2026-06-18-sanook-brain-cli-p0-implementation.md +86 -0
- package/second-brain/Sessions/2026-06-18-sanook-brain-final-cli-final.md +246 -0
- package/second-brain/Sessions/2026-06-18-sanook-brain-final-cli.md +78 -0
- package/second-brain/Sessions/2026-06-18-sanook-cli-second-brain-roadmap-correction.md +54 -0
- package/second-brain/Sessions/2026-06-18-token-reduction-framework-integration.md +69 -0
- package/second-brain/Sessions/_Index.md +15 -1
- package/second-brain/Shared/AI-Context-Index.md +22 -0
- package/second-brain/Shared/Context-Packs/_Index.md +9 -1
- package/second-brain/Shared/Context-Packs/coding-release.md +51 -0
- package/second-brain/Shared/Context-Packs/research-to-framework.md +51 -0
- package/second-brain/Shared/Context-Packs/second-brain-maintenance.md +41 -0
- package/second-brain/Shared/Operating-State/current-state.md +22 -3
- package/second-brain/Shared/Scripts/_Index.md +3 -1
- package/second-brain/Shared/Scripts/ai-second-brain-method-eval.mjs +198 -0
- package/second-brain/Shared/Tech-Standards/_Index.md +4 -1
- package/second-brain/Shared/Tech-Standards/mcp-integration-roadmap.md +86 -0
- package/second-brain/Shared/Tech-Standards/verification-standard.md +24 -0
- package/second-brain/Shared/User-Memory/_Index.md +4 -1
- package/second-brain/Shared/User-Memory/response-examples.md +98 -0
- package/second-brain/Shared/User-Memory/user-preferences.md +1 -0
- package/second-brain/Templates/_Index.md +9 -0
- package/second-brain/Templates/final-lite.md +111 -0
- package/second-brain/Templates/final.md +231 -0
- package/second-brain/Vault Structure Map.md +2 -1
- package/skills/structured-output-llm/SKILL.md +1 -1
|
@@ -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
|
-
|
|
|
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
|
|
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:
|