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,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
tags: [final-gate, verification, second-brain]
|
|
3
|
+
note_type: final-gate
|
|
4
|
+
created: 2026-06-18
|
|
5
|
+
updated: 2026-06-18
|
|
6
|
+
parent: "[[Sessions/_Index]]"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 2026-06-18 - Final Gate Template - Final Gate
|
|
10
|
+
|
|
11
|
+
> Evidence-backed closeout for adding [[Templates/final]] and wiring it into the Sanook second-brain framework.
|
|
12
|
+
|
|
13
|
+
## 0. Final Gate Rule
|
|
14
|
+
|
|
15
|
+
- [x] This final gate was created before the final owner-facing answer.
|
|
16
|
+
- [x] Every PASS/PARTIAL/FAIL/BLOCKED claim below has evidence or an explicit reason.
|
|
17
|
+
- [x] No unchecked item is silently treated as done.
|
|
18
|
+
- [x] If a row has no evidence, it cannot be `PASS`.
|
|
19
|
+
|
|
20
|
+
## 1. Objective / DoD Lock
|
|
21
|
+
|
|
22
|
+
Original request:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
งั้น ช่วยทำทั้งแปดข้อให้ฉันหน่อยอย่างละเอียด
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Expected output:
|
|
29
|
+
|
|
30
|
+
- [x] Create a detailed `final.md` template that implements the eight proposed logic areas.
|
|
31
|
+
- [x] Wire the template into existing second-brain indexes/standards so agents can discover it.
|
|
32
|
+
- [x] Add verification that the template is bundled and keeps the eight sections.
|
|
33
|
+
|
|
34
|
+
Definition of Done:
|
|
35
|
+
|
|
36
|
+
| DoD item | Status | Evidence | Notes |
|
|
37
|
+
|---|---|---|---|
|
|
38
|
+
| `Templates/final.md` exists and covers all eight logic areas. | PASS | `second-brain/Templates/final.md`; `npm test -- src/brain.test.ts src/brain-review.test.ts` | Test asserts all eight headings. |
|
|
39
|
+
| Template is linked from canonical indexes/hot path. | PASS | `Templates/_Index.md`, `Shared/AI-Context-Index.md`, `verification-standard.md`, operating sequence | Discoverable from template, hot context, and technical standard. |
|
|
40
|
+
| Existing scaffold copies final template. | PASS | `src/brain.test.ts`; targeted test passed | `scaffoldBrain` copies bundled markdown seeds. |
|
|
41
|
+
| Work was verified without touching unrelated gateway changes. | PASS | `git status --short`; final response note | Gateway files were pre-existing unrelated changes and were not edited. |
|
|
42
|
+
|
|
43
|
+
## 2. Evidence-Backed Checklist
|
|
44
|
+
|
|
45
|
+
| Gate | Status | Evidence | Notes |
|
|
46
|
+
|---|---|---|---|
|
|
47
|
+
| Relevant source/context was read before editing. | PASS | Read template/index/verification files and `src/brain.test.ts` | Used current repo state, not memory only. |
|
|
48
|
+
| Existing canonical note/file was searched before creating a new one. | PASS | `find second-brain/Templates...`; `rg final/checklist/verification` | No existing `Templates/final.md`. |
|
|
49
|
+
| Changes were made in the correct folder/module boundary. | PASS | `Templates/final.md`; Tech-Standards/Runbook/AI index updates | No root folder added. |
|
|
50
|
+
| No unrelated user/worktree changes were reverted or overwritten. | PASS | `git status --short` still shows gateway files separate | Gateway files untouched. |
|
|
51
|
+
| New/changed durable notes have `parent` and `up::`. | PASS | `brain.test.ts` bundled markdown hygiene test passed | Includes final/session notes. |
|
|
52
|
+
| Index/backlink/discoverability was updated. | PASS | `Templates/_Index.md`, `Sessions/_Index.md`, `Shared/Tech-Standards/_Index.md` | Added links. |
|
|
53
|
+
| Verification was run at the right scope. | PASS | Targeted tests, typecheck, full tests, diff check | Listed below. |
|
|
54
|
+
| Residual risk is stated clearly. | PASS | Residual Risk section | No CLI command implemented yet. |
|
|
55
|
+
|
|
56
|
+
## 3. Status Matrix
|
|
57
|
+
|
|
58
|
+
| Work item / phase | Status | Evidence | Owner-visible outcome |
|
|
59
|
+
|---|---|---|---|
|
|
60
|
+
| Frame objective and DoD | PASS | This final gate section 1 | The eight items became concrete deliverables. |
|
|
61
|
+
| Retrieve required context | PASS | Read local template/standard/runbook files | Work fits existing vault taxonomy. |
|
|
62
|
+
| Implement / write / edit | PASS | Files changed list below | `final.md` and wiring added. |
|
|
63
|
+
| Verify behavior or artifact | PASS | `npm test`, typecheck, targeted tests | Scaffold/template hygiene preserved. |
|
|
64
|
+
| Update memory/index/session if needed | PASS | Session note + Sessions index + current-state updates | Trace preserved. |
|
|
65
|
+
| Prepare final response | PASS | Final-answer draft below | Response will match evidence. |
|
|
66
|
+
|
|
67
|
+
## 4. Evidence Matrix
|
|
68
|
+
|
|
69
|
+
Commands:
|
|
70
|
+
|
|
71
|
+
| Command | Status | Important output | Scope proven |
|
|
72
|
+
|---|---|---|---|
|
|
73
|
+
| `npm test -- src/brain.test.ts src/brain-review.test.ts` | PASS | 2 files, 26 tests passed | Template/scaffold/review targeted behavior. |
|
|
74
|
+
| `npm run typecheck` | PASS | `tsc --noEmit` passed | TypeScript compile surface. |
|
|
75
|
+
| `git diff --check` | PASS | No output | No whitespace conflict markers. |
|
|
76
|
+
| `npm test` | PASS | 100 files, 865 tests passed | Full current test suite. |
|
|
77
|
+
|
|
78
|
+
Files inspected:
|
|
79
|
+
|
|
80
|
+
| File/path | Why it matters | Evidence |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| `second-brain/Shared/Tech-Standards/verification-standard.md` | Existing DoD and verification contract | Updated with Final Gate section. |
|
|
83
|
+
| `second-brain/Checklists/preflight-postflight-template.md` | Existing pre/postflight checklist pattern | Final template complements, not replaces it. |
|
|
84
|
+
| `second-brain/Templates/session.md` | Existing session closeout structure | Final gate links to session/handoff closeout. |
|
|
85
|
+
| `second-brain/Runbooks/ai-second-brain-operating-sequence.md` | Agent phase model | Added final gate note under Eval. |
|
|
86
|
+
| `src/brain.test.ts` | Scaffold/template regression guard | Added final gate assertions. |
|
|
87
|
+
|
|
88
|
+
Files changed:
|
|
89
|
+
|
|
90
|
+
| File/path | Change summary | Evidence |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| `second-brain/Templates/final.md` | New canonical final gate template with eight detailed sections. | File exists and targeted tests passed. |
|
|
93
|
+
| `second-brain/Templates/_Index.md` | Links final template with other templates. | Index updated. |
|
|
94
|
+
| `second-brain/Shared/Tech-Standards/verification-standard.md` | Adds final gate contract. | Standard updated. |
|
|
95
|
+
| `second-brain/Shared/Tech-Standards/_Index.md` | Links verification standard. | Index updated. |
|
|
96
|
+
| `second-brain/Shared/AI-Context-Index.md` | Adds hot-path pointer to final template. | Index updated. |
|
|
97
|
+
| `second-brain/Runbooks/ai-second-brain-operating-sequence.md` | Adds final gate in Eval phase. | Runbook updated. |
|
|
98
|
+
| `second-brain/Sessions/2026-06-18-final-gate-template.md` | Session log for this work. | File exists. |
|
|
99
|
+
| `second-brain/Sessions/2026-06-18-final-gate-template-final.md` | This final gate. | File exists. |
|
|
100
|
+
| `src/brain.test.ts` | Regression tests for final template. | Targeted tests passed. |
|
|
101
|
+
|
|
102
|
+
## 5. Residual Risk
|
|
103
|
+
|
|
104
|
+
| Risk | Impact | Mitigation / next check |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| No `sanook brain final` command exists yet. | Agents/users must instantiate `Templates/final.md` manually. | Dogfood manually; automate later if repeated use proves the shape. |
|
|
107
|
+
| Template is detailed and may be too heavy for trivial tasks. | Could create checklist theater if overused. | Use only for non-trivial, multi-file, framework, release, or auditable tasks. |
|
|
108
|
+
| Full tests passed with unrelated gateway worktree changes present. | Test result covers current worktree, not a clean branch. | Final answer should mention gateway files were unrelated and not touched. |
|
|
109
|
+
|
|
110
|
+
Checks not run:
|
|
111
|
+
|
|
112
|
+
| Check | Reason not run | Consequence |
|
|
113
|
+
|---|---|---|
|
|
114
|
+
| `npm run build` | This change is markdown/test-only; typecheck/full tests passed. | Build artifact not separately regenerated for this note-only change. |
|
|
115
|
+
| `sanook brain review/eval` | Not required for a template-only framework note, and current configured vault may be user-local. | Could run later after indexing the actual vault. |
|
|
116
|
+
|
|
117
|
+
## 6. Change Summary Audit
|
|
118
|
+
|
|
119
|
+
What changed:
|
|
120
|
+
|
|
121
|
+
- Added a detailed final gate template.
|
|
122
|
+
- Wired it into template index, AI context index, verification standard, and operating sequence.
|
|
123
|
+
- Added tests to keep the final template bundled and structurally complete.
|
|
124
|
+
- Logged the work in Sessions and current-state.
|
|
125
|
+
|
|
126
|
+
What did not change:
|
|
127
|
+
|
|
128
|
+
- No CLI command was added.
|
|
129
|
+
- No root folder was added.
|
|
130
|
+
- Existing unrelated gateway files were not edited.
|
|
131
|
+
|
|
132
|
+
Behavior before:
|
|
133
|
+
|
|
134
|
+
- The vault had preflight/postflight and session templates, but no canonical final evidence matrix.
|
|
135
|
+
|
|
136
|
+
Behavior after:
|
|
137
|
+
|
|
138
|
+
- Non-trivial work can instantiate [[Templates/final]] before the final answer and close with evidence instead of unchecked claims.
|
|
139
|
+
|
|
140
|
+
## 7. Final Answer Draft
|
|
141
|
+
|
|
142
|
+
```text
|
|
143
|
+
ทำทั้ง 8 ข้อเป็น `Templates/final.md` แล้ว และผูกเข้ากับ verification standard, AI hot path, operating sequence, indexes, session log, current-state, และ scaffold tests.
|
|
144
|
+
|
|
145
|
+
Verified:
|
|
146
|
+
- npm test -- src/brain.test.ts src/brain-review.test.ts: PASS
|
|
147
|
+
- npm run typecheck: PASS
|
|
148
|
+
- git diff --check: PASS
|
|
149
|
+
- npm test: PASS (100 files, 865 tests)
|
|
150
|
+
|
|
151
|
+
Residual risk:
|
|
152
|
+
- ยังไม่ได้ทำ CLI automation เช่น `sanook brain final`; ตอนนี้เป็น reusable template/manual gate ก่อน
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## 8. Second-Brain Routing / Memory Closeout
|
|
156
|
+
|
|
157
|
+
Session / handoff:
|
|
158
|
+
|
|
159
|
+
- [x] Added [[Sessions/2026-06-18-final-gate-template]].
|
|
160
|
+
- [x] Added this final gate note.
|
|
161
|
+
- [x] Updated [[Sessions/_Index]].
|
|
162
|
+
|
|
163
|
+
Durable memory:
|
|
164
|
+
|
|
165
|
+
- [x] Updated [[Shared/Operating-State/current-state]] with final gate status.
|
|
166
|
+
- [x] No user preference or personal invariant was discovered.
|
|
167
|
+
|
|
168
|
+
Indexes / discoverability:
|
|
169
|
+
|
|
170
|
+
- [x] Updated [[Templates/_Index]].
|
|
171
|
+
- [x] Updated [[Shared/Tech-Standards/_Index]].
|
|
172
|
+
- [x] Updated [[Shared/AI-Context-Index]].
|
|
173
|
+
|
|
174
|
+
Quality loop:
|
|
175
|
+
|
|
176
|
+
- [x] Targeted and full tests passed.
|
|
177
|
+
- [x] Final gate template is covered by `src/brain.test.ts`.
|
|
178
|
+
|
|
179
|
+
## Final Verdict
|
|
180
|
+
|
|
181
|
+
| Verdict | Choose one | Evidence |
|
|
182
|
+
|---|---|---|
|
|
183
|
+
| Ready to close | YES | Full tests, typecheck, diff check, targeted scaffold tests passed. |
|
|
184
|
+
| Close with caveats | YES | No CLI automation yet; template/manual gate only. |
|
|
185
|
+
| Needs more work | NO | Requested eight detailed logic areas are implemented in template. |
|
|
186
|
+
| Blocked | NO | No blocker. |
|
|
187
|
+
|
|
188
|
+
One-line final state:
|
|
189
|
+
|
|
190
|
+
> Ready to close: `Templates/final.md` implements all eight requested closeout logic areas with evidence requirements and is wired into the vault framework.
|
|
191
|
+
|
|
192
|
+
up:: [[Sessions/_Index]]
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
tags: [session, session-log, final-gate, verification, second-brain]
|
|
3
|
+
note_type: session-log
|
|
4
|
+
created: 2026-06-18
|
|
5
|
+
updated: 2026-06-18
|
|
6
|
+
parent: "[[Sessions/_Index]]"
|
|
7
|
+
ai_surface: history
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 2026-06-18 - Final Gate Template
|
|
11
|
+
|
|
12
|
+
> Session log for turning the owner's `final.md` idea into a reusable evidence-backed closeout template.
|
|
13
|
+
|
|
14
|
+
## Summary
|
|
15
|
+
|
|
16
|
+
Created [[Templates/final]] as the final phase gate for non-trivial work. It turns the owner's eight requested logic areas into a detailed checklist with required evidence, status vocabulary, residual risk, change audit, final answer draft, and second-brain closeout routing.
|
|
17
|
+
|
|
18
|
+
## What Was Tried
|
|
19
|
+
|
|
20
|
+
- Read existing verification and closeout notes:
|
|
21
|
+
- [[Shared/Tech-Standards/verification-standard]]
|
|
22
|
+
- [[Checklists/preflight-postflight-template]]
|
|
23
|
+
- [[Templates/session]]
|
|
24
|
+
- [[Runbooks/ai-second-brain-operating-sequence]]
|
|
25
|
+
- [[Shared/Rules/rules-formatting]]
|
|
26
|
+
- Added `Templates/final.md`.
|
|
27
|
+
- Linked it from [[Templates/_Index]].
|
|
28
|
+
- Added final-gate rules to [[Shared/Tech-Standards/verification-standard]].
|
|
29
|
+
- Added hot-path pointers in [[Shared/AI-Context-Index]] and [[Runbooks/ai-second-brain-operating-sequence]].
|
|
30
|
+
- Added scaffold tests so the final template stays bundled and keeps the eight logic sections.
|
|
31
|
+
|
|
32
|
+
## Errors
|
|
33
|
+
|
|
34
|
+
- None blocking.
|
|
35
|
+
|
|
36
|
+
## Solutions
|
|
37
|
+
|
|
38
|
+
- Final gate uses `PASS`, `PARTIAL`, `FAIL`, `N/A`, and `BLOCKED`.
|
|
39
|
+
- Every row requires evidence; no-evidence rows cannot be `PASS`.
|
|
40
|
+
- Final answer draft is generated from evidence rather than memory or intent.
|
|
41
|
+
- Closeout includes session/handoff, durable memory routing, indexes, and Sanook brain doctor/review/eval gates.
|
|
42
|
+
|
|
43
|
+
## Key Decisions
|
|
44
|
+
|
|
45
|
+
- `Templates/final.md` is the canonical reusable template.
|
|
46
|
+
- Actual final gates should be instantiated as session/project artifacts when needed; the template itself stays in `Templates/`.
|
|
47
|
+
- `final.md` should remain read-only guidance for now, not a new CLI command, until repeated use proves an automation shape.
|
|
48
|
+
|
|
49
|
+
## Files Changed
|
|
50
|
+
|
|
51
|
+
- `second-brain/Templates/final.md`
|
|
52
|
+
- `second-brain/Templates/_Index.md`
|
|
53
|
+
- `second-brain/Shared/Tech-Standards/verification-standard.md`
|
|
54
|
+
- `second-brain/Shared/Tech-Standards/_Index.md`
|
|
55
|
+
- `second-brain/Shared/AI-Context-Index.md`
|
|
56
|
+
- `second-brain/Runbooks/ai-second-brain-operating-sequence.md`
|
|
57
|
+
- `src/brain.test.ts`
|
|
58
|
+
|
|
59
|
+
## Verification
|
|
60
|
+
|
|
61
|
+
- `npm test -- src/brain.test.ts src/brain-review.test.ts`: PASS
|
|
62
|
+
- `npm run typecheck`: PASS
|
|
63
|
+
- `git diff --check`: PASS
|
|
64
|
+
- `npm test`: PASS (100 files, 865 tests)
|
|
65
|
+
|
|
66
|
+
## Next Steps
|
|
67
|
+
|
|
68
|
+
- [ ] Dogfood [[Templates/final]] on the next non-trivial implementation task.
|
|
69
|
+
- [ ] If it proves useful repeatedly, consider `sanook brain final` or `sanook brain new final`.
|
|
70
|
+
|
|
71
|
+
up:: [[Sessions/_Index]]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
tags: [session, session-log, second-brain, dogfood, permission]
|
|
3
|
+
note_type: session-log
|
|
4
|
+
created: 2026-06-18
|
|
5
|
+
updated: 2026-06-18
|
|
6
|
+
parent: "[[Sessions/_Index]]"
|
|
7
|
+
ai_surface: history
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 2026-06-18 — Framework Dogfood: Permission + Memory
|
|
11
|
+
|
|
12
|
+
> Session evidence for using the new AI framework/context packs on a real permission-gate task plus durable memory updates.
|
|
13
|
+
|
|
14
|
+
## Summary
|
|
15
|
+
|
|
16
|
+
ใช้ framework ใหม่กับงานจริง 3 task-family ใน session เดียว: coding-release, second-brain maintenance, และ research/framework benchmark.
|
|
17
|
+
|
|
18
|
+
## What Was Tried
|
|
19
|
+
|
|
20
|
+
- **Coding & Release Work:** อ่าน diff ของ `src/tools/permission.ts` และ `src/tools/tools.test.ts`, แล้วรัน targeted test
|
|
21
|
+
- **Second-Brain Maintenance:** อัปเดต [[Shared/User-Memory/user-preferences]] และ [[Shared/User-Memory/response-examples]] จาก feedback "ทำทั้งหมดได้เลย"
|
|
22
|
+
- **Research To Framework / Benchmark:** รัน `Shared/Scripts/ai-second-brain-method-eval.mjs` และใช้ [[Evals/second-brain-benchmarks]] เป็น self-check
|
|
23
|
+
|
|
24
|
+
## Errors
|
|
25
|
+
|
|
26
|
+
- ไม่มี test failure ใน targeted permission/tools test
|
|
27
|
+
- ไม่มี whitespace diff issue ตอนตรวจ `git diff --check`
|
|
28
|
+
|
|
29
|
+
## Solutions
|
|
30
|
+
|
|
31
|
+
- Permission/tools targeted test ผ่าน: `npm test -- src/tools/tools.test.ts`
|
|
32
|
+
- เพิ่ม preference: เมื่อ scope ชัดและปลอดภัย ให้ทำครบตามรายการที่แนะนำได้เลย
|
|
33
|
+
- เพิ่ม response example: "Act On All Clear Recommendations"
|
|
34
|
+
- บันทึก benchmark/dogfood result ลง [[Evals/quality-ledger]]
|
|
35
|
+
|
|
36
|
+
## Key Decisions
|
|
37
|
+
|
|
38
|
+
- นับ session นี้เป็น dogfood ของ context packs 3 แบบ:
|
|
39
|
+
- [[Shared/Context-Packs/coding-release]]
|
|
40
|
+
- [[Shared/Context-Packs/second-brain-maintenance]]
|
|
41
|
+
- [[Shared/Context-Packs/research-to-framework]]
|
|
42
|
+
- ยังไม่แก้ logic ใน `src/tools/permission.ts` เพราะ targeted tests ผ่านและ diff สอดคล้องกับเจตนาของ permission gate
|
|
43
|
+
|
|
44
|
+
## Files Changed
|
|
45
|
+
|
|
46
|
+
- `second-brain/Shared/User-Memory/user-preferences.md`
|
|
47
|
+
- `second-brain/Shared/User-Memory/response-examples.md`
|
|
48
|
+
- `second-brain/Evals/quality-ledger.md`
|
|
49
|
+
- `second-brain/Shared/Operating-State/current-state.md`
|
|
50
|
+
- `second-brain/Sessions/_Index.md`
|
|
51
|
+
- `second-brain/Sessions/2026-06-18-framework-dogfood-permission-and-memory.md`
|
|
52
|
+
|
|
53
|
+
## Next Steps
|
|
54
|
+
|
|
55
|
+
- รัน full test/typecheck ถ้าจะ finalize code change ใน permission gate
|
|
56
|
+
- ใช้ benchmark อีกครั้งหลัง permission changes ถูก merge หรือปรับเพิ่ม
|
|
57
|
+
|
|
58
|
+
up:: [[Sessions/_Index]]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
tags: [session, session-log, second-brain, hermes, research]
|
|
3
|
+
note_type: session-log
|
|
4
|
+
created: 2026-06-18
|
|
5
|
+
updated: 2026-06-18
|
|
6
|
+
parent: "[[Sessions/_Index]]"
|
|
7
|
+
ai_surface: history
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 2026-06-18 — Hermes Second-Brain Expansion Research
|
|
11
|
+
|
|
12
|
+
> Session log for the research pass on what to add to this second-brain for Hermes CLI support. Links to the sourced research note and leaves implementation as a next step.
|
|
13
|
+
|
|
14
|
+
## Summary
|
|
15
|
+
|
|
16
|
+
Researched Hermes Agent docs, context engineering guidance, agent memory papers, LangGraph memory concepts, and PARA. Main conclusion: avoid many new root folders; prioritize Hermes-specific adapter/context, memory sync policy, atomic benchmarks, golden fixtures, and scheduled vault-health reviews.
|
|
17
|
+
|
|
18
|
+
## What Was Tried
|
|
19
|
+
|
|
20
|
+
- Read current vault map, AI context index, evals index, context packs index, user memory index, and operating sequence.
|
|
21
|
+
- Checked current worktree status and avoided unrelated CLI/search changes.
|
|
22
|
+
- Searched current Hermes docs for context files, persistent memory, skills, and curator behavior.
|
|
23
|
+
- Compared with external agent-memory/context sources.
|
|
24
|
+
|
|
25
|
+
## Errors
|
|
26
|
+
|
|
27
|
+
- Some docs pages were rendered HTML-heavy; raw GitHub markdown for Hermes docs was easier to inspect.
|
|
28
|
+
|
|
29
|
+
## Solutions
|
|
30
|
+
|
|
31
|
+
- Added [[Research/2026-06-18-hermes-cli-second-brain-expansion-research]] as the durable research note with source URLs and prioritized recommendations.
|
|
32
|
+
|
|
33
|
+
## Key Decisions
|
|
34
|
+
|
|
35
|
+
- No taxonomy folders were created yet.
|
|
36
|
+
- Recommended next build is `HERMES.md` plus a small Hermes-specific shared policy area before wider taxonomy changes.
|
|
37
|
+
|
|
38
|
+
## Files Changed
|
|
39
|
+
|
|
40
|
+
- `second-brain/Research/2026-06-18-hermes-cli-second-brain-expansion-research.md`
|
|
41
|
+
- `second-brain/Sessions/2026-06-18-hermes-second-brain-expansion-research.md`
|
|
42
|
+
- `second-brain/Research/_Index.md`
|
|
43
|
+
- `second-brain/Sessions/_Index.md`
|
|
44
|
+
- `second-brain/Shared/Operating-State/current-state.md`
|
|
45
|
+
|
|
46
|
+
## Next Steps
|
|
47
|
+
|
|
48
|
+
- [ ] Decide whether to implement the recommended Hermes bundle.
|
|
49
|
+
- [ ] If adding folders, update `Vault Structure Map.md` and `src/brain.ts` together.
|
|
50
|
+
- [ ] If only adding files under existing folders, keep taxonomy unchanged.
|
|
51
|
+
|
|
52
|
+
up:: [[Sessions/_Index]]
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
tags: [session, session-log, mcp, sanook-cli]
|
|
3
|
+
note_type: session-log
|
|
4
|
+
created: 2026-06-18
|
|
5
|
+
updated: 2026-06-18
|
|
6
|
+
parent: "[[Sessions/_Index]]"
|
|
7
|
+
ai_surface: history
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 2026-06-18 - MCP Ecosystem and Sanook UX Scan
|
|
11
|
+
|
|
12
|
+
> Session log for reviewing Sanook's MCP support and current MCP registry integration opportunities.
|
|
13
|
+
|
|
14
|
+
## Summary
|
|
15
|
+
|
|
16
|
+
- Inspected `src/mcp.ts`, `src/mcp-server.ts`, `src/bin.ts`, `README.md`, and existing MCP tests/docs.
|
|
17
|
+
- Queried the official MCP registry API and OpenAPI metadata.
|
|
18
|
+
- Identified that Sanook already supports stdio + remote Streamable HTTP and can act as an MCP server.
|
|
19
|
+
- Main UX gap: no registry-backed search/info/install/test wizard yet.
|
|
20
|
+
- Added [[Research/2026-06-18-sanook-mcp-ecosystem-and-ux-roadmap]] and [[Shared/Tech-Standards/mcp-integration-roadmap]].
|
|
21
|
+
- Implemented the P0 MCP UX inside Sanook CLI: registry search/info/install, presets, list/test/doctor probing, docs, and tests.
|
|
22
|
+
- Verified local stdio MCP probing works; official GitLab remote installs from registry but returns `401 Unauthorized` without an auth header.
|
|
23
|
+
|
|
24
|
+
## What Was Tried
|
|
25
|
+
|
|
26
|
+
- Checked current MCP code paths with `rg`.
|
|
27
|
+
- Read MCP client/server implementation.
|
|
28
|
+
- Queried registry endpoints:
|
|
29
|
+
- `https://registry.modelcontextprotocol.io/v0/version`
|
|
30
|
+
- `https://registry.modelcontextprotocol.io/v0/health`
|
|
31
|
+
- `https://registry.modelcontextprotocol.io/v0/servers?...`
|
|
32
|
+
- `https://registry.modelcontextprotocol.io/openapi.json`
|
|
33
|
+
- Sampled registry search terms: GitHub, GitLab, Postgres, SQLite, filesystem, Slack, Discord, Notion, Linear, Jira, Sentry, Playwright, browser, Gmail, Drive, Obsidian, Context7, fetch, Brave, Docker, Kubernetes.
|
|
34
|
+
|
|
35
|
+
## Errors
|
|
36
|
+
|
|
37
|
+
- Initial unquoted `curl` query with `?limit=8` was expanded by zsh; quoted URL fixed it.
|
|
38
|
+
- Mintlify HTML docs are noisy for terminal extraction; the registry OpenAPI and API responses were more useful as machine-readable evidence.
|
|
39
|
+
|
|
40
|
+
## Solutions
|
|
41
|
+
|
|
42
|
+
- Used quoted registry URLs.
|
|
43
|
+
- Used the registry OpenAPI for endpoint/field shape.
|
|
44
|
+
- Captured a Sanook-specific roadmap instead of implementing a large installer in the research turn.
|
|
45
|
+
- Added `src/mcp-registry.ts` for official registry parsing and install-plan generation.
|
|
46
|
+
- Added `sanook mcp search`, `info`, `install`, `preset`, `test`, `doctor`, and `list --tools`.
|
|
47
|
+
- Kept unit tests network-free; live registry smoke was run separately against built `dist/bin.js`.
|
|
48
|
+
- Smoke result: `mcp search/info/install/list` worked against the official registry; a fake stdio MCP server passed `mcp test`; GitLab remote probe failed with `401 Unauthorized` until a token/header is supplied.
|
|
49
|
+
|
|
50
|
+
## Key Decisions
|
|
51
|
+
|
|
52
|
+
- Next best implementation should be `sanook mcp search/info/install/test`, not another hardcoded list.
|
|
53
|
+
- Use registry metadata for env/header prompts and secret handling.
|
|
54
|
+
- Keep project-local MCP behind `sanook trust`.
|
|
55
|
+
- Prefer read-only / remote Streamable HTTP defaults where available.
|
|
56
|
+
- Do not make the regular test suite depend on the live registry.
|
|
57
|
+
- Preserve manual `--header` support because some registry entries do not yet declare required auth metadata.
|
|
58
|
+
|
|
59
|
+
## Files Changed
|
|
60
|
+
|
|
61
|
+
- `second-brain/Research/2026-06-18-sanook-mcp-ecosystem-and-ux-roadmap.md`
|
|
62
|
+
- `second-brain/Shared/Tech-Standards/mcp-integration-roadmap.md`
|
|
63
|
+
- `second-brain/Shared/Tech-Standards/_Index.md`
|
|
64
|
+
- `second-brain/Research/_Index.md`
|
|
65
|
+
- `second-brain/Sessions/_Index.md`
|
|
66
|
+
- `second-brain/Sessions/2026-06-18-mcp-ecosystem-and-sanook-ux-scan.md`
|
|
67
|
+
- `src/mcp-registry.ts`
|
|
68
|
+
- `src/mcp-registry.test.ts`
|
|
69
|
+
- `src/mcp.ts`
|
|
70
|
+
- `src/mcp.test.ts`
|
|
71
|
+
- `src/bin.ts`
|
|
72
|
+
- `README.md`
|
|
73
|
+
- `CHANGELOG.md`
|
|
74
|
+
|
|
75
|
+
## Next Steps
|
|
76
|
+
|
|
77
|
+
- Improve auth hints for hosted MCPs that return `401` but do not declare header requirements in registry metadata.
|
|
78
|
+
- Add risk labels / read-write warnings before installing high-impact servers.
|
|
79
|
+
- Consider registry result caching and richer install previews.
|
|
80
|
+
|
|
81
|
+
up:: [[Sessions/_Index]]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
tags: [session, session-log, sanook-cli, second-brain, implementation]
|
|
3
|
+
note_type: session-log
|
|
4
|
+
created: 2026-06-18
|
|
5
|
+
updated: 2026-06-18
|
|
6
|
+
parent: "[[Sessions/_Index]]"
|
|
7
|
+
ai_surface: history
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 2026-06-18 - Sanook Brain CLI P0 Implementation
|
|
11
|
+
|
|
12
|
+
> Implementation session for making the second-brain workflow first-class inside Sanook CLI.
|
|
13
|
+
|
|
14
|
+
## Summary
|
|
15
|
+
|
|
16
|
+
Implemented Sanook-native P0 commands for second-brain operations:
|
|
17
|
+
|
|
18
|
+
- `sanook brain doctor`
|
|
19
|
+
- `sanook brain context [--task "..."]`
|
|
20
|
+
- `sanook brain eval`
|
|
21
|
+
- `sanook brain review`
|
|
22
|
+
|
|
23
|
+
## What Was Tried
|
|
24
|
+
|
|
25
|
+
- Verified existing `brain doctor` implementation and tests.
|
|
26
|
+
- Refactored `buildBrainContext()` so the exact prompt context is assembled from inspectable source parts.
|
|
27
|
+
- Added a `brain context` module and CLI runner to show context source status, char counts, stale/missing warnings, and optional task retrieval.
|
|
28
|
+
- Added a `brain eval` module and CLI runner that scores `Evals/second-brain-benchmarks.md` through static vault checks, context checks, index freshness, and retrieval probes.
|
|
29
|
+
- Added a `brain review` module and CLI runner for read-only curator checks over Memory-Inbox, Context-Packs, Sessions/index coverage, eval freshness, and markdown routing hygiene.
|
|
30
|
+
|
|
31
|
+
## Errors
|
|
32
|
+
|
|
33
|
+
- The existing Memory-Inbox helper intentionally swallowed missing-file errors for runtime safety; `brain context` needed to distinguish `missing` from `empty`. Fixed by separating candidate parsing from file reading.
|
|
34
|
+
- Review of a fresh scaffold surfaced that generated `Shared/Context-Packs/_Index.md` did not link bundled packs. Fixed scaffold generation so new vaults are discoverable immediately.
|
|
35
|
+
- Review hygiene initially flagged root adapter files for missing `parent`; adjusted review to match the existing root-file exception rule.
|
|
36
|
+
|
|
37
|
+
## Solutions
|
|
38
|
+
|
|
39
|
+
- `src/memory.ts` now exports `buildBrainContextParts()` and `renderBrainContext()`.
|
|
40
|
+
- `src/brain-context.ts` provides parser, inspector, and formatter for `sanook brain context`.
|
|
41
|
+
- `src/brain-eval.ts` provides static and retrieval benchmark checks for `sanook brain eval`.
|
|
42
|
+
- `src/brain-review.ts` provides read-only curator checks and formatter for `sanook brain review`.
|
|
43
|
+
- `src/brain.ts` now renders seed context pack links into generated `Shared/Context-Packs/_Index.md`.
|
|
44
|
+
- CLI help and REPL help now mention the new commands.
|
|
45
|
+
|
|
46
|
+
## Files Changed
|
|
47
|
+
|
|
48
|
+
- `CHANGELOG.md`
|
|
49
|
+
- `src/bin.ts`
|
|
50
|
+
- `src/commands.ts`
|
|
51
|
+
- `src/memory.ts`
|
|
52
|
+
- `src/brain.ts`
|
|
53
|
+
- `src/brain-context.ts`
|
|
54
|
+
- `src/brain-context.test.ts`
|
|
55
|
+
- `src/brain-eval.ts`
|
|
56
|
+
- `src/brain-eval.test.ts`
|
|
57
|
+
- `src/brain-review.ts`
|
|
58
|
+
- `src/brain-review.test.ts`
|
|
59
|
+
- `second-brain/Projects/sanook-cli/second-brain-feature-roadmap.md`
|
|
60
|
+
- `second-brain/Shared/Operating-State/current-state.md`
|
|
61
|
+
|
|
62
|
+
## Verification
|
|
63
|
+
|
|
64
|
+
- `npm test -- src/brain-eval.test.ts src/brain-context.test.ts src/memory.test.ts src/brain-doctor.test.ts src/brain.test.ts`
|
|
65
|
+
- `npm run typecheck`
|
|
66
|
+
- `npm test`
|
|
67
|
+
- `npm run build`
|
|
68
|
+
- `git diff --check`
|
|
69
|
+
- Smoke with temp `HOME`: `brain init`, `index`, `brain doctor`, `brain context --task ... --no-content`, `brain eval --no-retrieval`
|
|
70
|
+
- Smoke with temp `HOME`: `brain eval` full retrieval probes passed 15.0/15
|
|
71
|
+
- `npm test -- src/brain-review.test.ts src/brain.test.ts src/memory.test.ts`
|
|
72
|
+
- `npm run typecheck`
|
|
73
|
+
- `npm test -- src/brain-review.test.ts src/brain-eval.test.ts src/brain-context.test.ts src/brain-doctor.test.ts src/brain.test.ts src/memory.test.ts`
|
|
74
|
+
- `npm test`
|
|
75
|
+
- `npm run build`
|
|
76
|
+
- `git diff --check`
|
|
77
|
+
- Smoke with temp `HOME`: `brain init`, `index`, `brain review` passed 0 warnings / 0 failures.
|
|
78
|
+
- `node dist/bin.js --help | rg "brain (review|context|eval|doctor)"`
|
|
79
|
+
|
|
80
|
+
## Next Steps
|
|
81
|
+
|
|
82
|
+
- [ ] Consider `sanook brain pack list|show` for `Shared/Context-Packs/`.
|
|
83
|
+
- [ ] Consider `sanook brain new <type>`.
|
|
84
|
+
- [ ] Consider `sanook brain repair`.
|
|
85
|
+
|
|
86
|
+
up:: [[Sessions/_Index]]
|