hypomnema 1.0.1 → 1.2.0
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.ko.md +12 -5
- package/README.md +12 -5
- package/commands/audit.md +46 -0
- package/commands/crystallize.md +113 -23
- package/commands/feedback.md +40 -26
- package/commands/ingest.md +31 -9
- package/commands/upgrade.md +2 -2
- package/docs/ARCHITECTURE.md +83 -9
- package/docs/CONTRIBUTING.md +2 -2
- package/hooks/hooks.json +39 -1
- package/hooks/hypo-auto-commit.mjs +23 -4
- package/hooks/hypo-auto-minimal-crystallize.mjs +145 -0
- package/hooks/hypo-auto-stage.mjs +9 -5
- package/hooks/hypo-compact-guard.mjs +33 -24
- package/hooks/hypo-cwd-change.mjs +107 -24
- package/hooks/hypo-file-watch.mjs +23 -10
- package/hooks/hypo-first-prompt.mjs +37 -23
- package/hooks/hypo-hot-rebuild.mjs +31 -8
- package/hooks/hypo-lookup.mjs +171 -65
- package/hooks/hypo-personal-check.mjs +207 -112
- package/hooks/hypo-pre-commit.mjs +46 -0
- package/hooks/hypo-session-end.mjs +58 -0
- package/hooks/hypo-session-record.mjs +60 -0
- package/hooks/hypo-session-start.mjs +312 -44
- package/hooks/hypo-shared.mjs +880 -28
- package/hooks/hypo-web-fetch-ingest.mjs +121 -0
- package/hooks/version-check-fetch.mjs +74 -0
- package/hooks/version-check.mjs +184 -0
- package/package.json +17 -3
- package/scripts/crystallize.mjs +623 -18
- package/scripts/doctor.mjs +739 -46
- package/scripts/feedback-sync.mjs +974 -0
- package/scripts/feedback.mjs +253 -44
- package/scripts/graph.mjs +35 -22
- package/scripts/ingest.mjs +89 -16
- package/scripts/init.mjs +442 -114
- package/scripts/lib/design-history-stale.mjs +83 -0
- package/scripts/lib/extensions.mjs +749 -0
- package/scripts/lib/frontmatter.mjs +5 -1
- package/scripts/lib/hypo-ignore.mjs +12 -10
- package/scripts/lib/pkg-json.mjs +23 -5
- package/scripts/lib/project-create.mjs +225 -0
- package/scripts/lib/schema-vocab.mjs +96 -0
- package/scripts/lint.mjs +238 -31
- package/scripts/query.mjs +26 -10
- package/scripts/resume.mjs +11 -5
- package/scripts/session-audit.mjs +277 -0
- package/scripts/smoke-pack.mjs +224 -0
- package/scripts/stats.mjs +24 -10
- package/scripts/uninstall.mjs +369 -48
- package/scripts/upgrade.mjs +766 -195
- package/scripts/verify.mjs +24 -14
- package/scripts/weekly-report.mjs +211 -0
- package/skills/crystallize/SKILL.md +24 -7
- package/skills/graph/SKILL.md +4 -0
- package/skills/ingest/SKILL.md +29 -5
- package/skills/lint/SKILL.md +4 -0
- package/skills/query/SKILL.md +4 -0
- package/skills/verify/SKILL.md +4 -0
- package/templates/.hypoignore +19 -2
- package/templates/Home.md +2 -0
- package/templates/SCHEMA.md +61 -6
- package/templates/extensions/agents/.gitkeep +0 -0
- package/templates/extensions/commands/.gitkeep +0 -0
- package/templates/extensions/hooks/.gitkeep +0 -0
- package/templates/extensions/skills/.gitkeep +0 -0
- package/templates/gitignore +5 -0
- package/templates/hot.md +2 -0
- package/templates/hypo-config.md +1 -1
- package/templates/hypo-guide.md +63 -1
- package/templates/hypo-help.md +1 -1
- package/templates/pages/observability/_index.md +77 -0
- package/templates/projects/_template/index.md +2 -2
- package/templates/projects/_template/prd.md +1 -1
package/templates/hypo-guide.md
CHANGED
|
@@ -59,12 +59,23 @@ Over time, new sources *update* pages more than they *create* them — that's wh
|
|
|
59
59
|
1. Read root `hot.md` → identify active project
|
|
60
60
|
2. If `cwd` matches `projects/<name>/index.md`'s `working_dir:` field → read `projects/<name>/session-state.md` first
|
|
61
61
|
3. Read `projects/<name>/hot.md` for background context
|
|
62
|
-
4.
|
|
62
|
+
4. **Your first response must lead with the resume**: a one-line summary of last session + the concrete next task(s) from `session-state.md`, then "Continuing [X] — shall we pick up?". Do not wait for the user to ask; this is mandatory whenever a project matched (not a soft offer).
|
|
63
63
|
|
|
64
64
|
### Session Close
|
|
65
65
|
|
|
66
66
|
Trigger: explicit close mention, `/compact` request, or context limit approaching.
|
|
67
67
|
|
|
68
|
+
**Auto-trigger rule**: when the user sends a natural-language close signal — "세션 마무리하자", "오늘 여기까지", "이만 종료", "wrap up", "signing off", or equivalent — run the session close checklist immediately without waiting for an explicit `/compact` or `/hypo:crystallize`. If the intent is ambiguous, confirm with a single question before proceeding.
|
|
69
|
+
|
|
70
|
+
**Proactive close offer** (ADR 0022 Layer 1): even when the user gives no close signal, offer to wrap up once a task is truly done — don't make them remember to. Fire `AskUserQuestion` **at the end of the assistant turn in which you report a task complete or verified**, when both hold:
|
|
71
|
+
|
|
72
|
+
1. The session did substantial work — file mutations or multi-step changes, not Q&A only.
|
|
73
|
+
2. The current user request did not already include a next task or tell you not to close.
|
|
74
|
+
|
|
75
|
+
Do **not** treat these as completion: plan approvals, clarification answers, permission grants, progress updates, partial findings, or mid-task checkpoints. A "좋아요" / "감사합니다" / "ok" following any of those is *not* a close signal — only offer after a genuine final completion/verification report.
|
|
76
|
+
|
|
77
|
+
Ask: *"이 작업이 마무리되었나요? 세션을 정리(crystallize)할까요?"* with options **[세션 마무리 / 계속 작업]**. On **세션 마무리** → run the session close checklist (or invoke `/hypo:crystallize`). On **계속 작업** → continue and do not re-ask until the next task completes. Ask at most once per completed task; never loop. (Decline simply ends the turn — Layer 3's Stop-chain only blocks on an explicit close signal, so no repeated prompts occur.)
|
|
78
|
+
|
|
68
79
|
1. Update `projects/<name>/session-state.md` (next tasks, overwrite)
|
|
69
80
|
2. Update `projects/<name>/hot.md` (what was done, ≤500 words, overwrite)
|
|
70
81
|
3. Append to `projects/<name>/session-log/YYYY-MM.md` (narrative entry, append-only)
|
|
@@ -74,6 +85,8 @@ Skip session close for: single bug fix, single-file edit, Q&A only.
|
|
|
74
85
|
|
|
75
86
|
### Ingest (external source → wiki)
|
|
76
87
|
|
|
88
|
+
**Auto-trigger rule**: after any `WebFetch` / `WebSearch` that yields new knowledge relevant to the current task, run `/hypo:ingest` immediately — do not wait for the user to ask.
|
|
89
|
+
|
|
77
90
|
1. Save raw source to `sources/<slug>.<ext>` (never edit after)
|
|
78
91
|
2. Read and synthesize
|
|
79
92
|
3. Update or create pages in `pages/` with frontmatter `source: <slug>`
|
|
@@ -85,6 +98,7 @@ Skip session close for: single bug fix, single-file edit, Q&A only.
|
|
|
85
98
|
1. Read `index.md` first
|
|
86
99
|
2. Cross-reference related pages
|
|
87
100
|
3. Synthesize answer — cite `[[page-slug]]` links
|
|
101
|
+
4. **On miss**: research externally (`WebFetch` / `WebSearch`), then auto-ingest — omitting `/hypo:ingest` after external research is a defect
|
|
88
102
|
|
|
89
103
|
---
|
|
90
104
|
|
|
@@ -111,6 +125,32 @@ projects/<name>/
|
|
|
111
125
|
|
|
112
126
|
Add to root `hot.md` active projects table.
|
|
113
127
|
|
|
128
|
+
#### Auto-project offer (ADR 0023)
|
|
129
|
+
|
|
130
|
+
When SessionStart / CwdChanged injects a line like
|
|
131
|
+
`[WIKI: cwd '<name>'에 매칭되는 프로젝트가 없습니다. 자동 생성할까요? (Y/n)]`,
|
|
132
|
+
the current working directory is a real project (git repo + a project marker
|
|
133
|
+
like `package.json`) that has no matching wiki project. **Act on it — do not
|
|
134
|
+
ignore it:**
|
|
135
|
+
|
|
136
|
+
1. Ask the user with `AskUserQuestion` (or a plain Y/n question) whether to
|
|
137
|
+
create the project.
|
|
138
|
+
2. **On Yes** — run the scaffold helper once (it substitutes tokens, creates
|
|
139
|
+
the project files, adds the root `hot.md` row, and logs the entry):
|
|
140
|
+
```
|
|
141
|
+
node <pkg-root>/scripts/lib/project-create.mjs --name <slug> --working-dir "$(pwd)"
|
|
142
|
+
```
|
|
143
|
+
Then tell the user: "Created project `<name>` at
|
|
144
|
+
`~/hypomnema/projects/<name>/`. Edit `index.md` to refine." Do **not** hand-write
|
|
145
|
+
the five files — the helper keeps substitution and registration consistent.
|
|
146
|
+
3. **On No** — record the refusal so this cwd is never offered again: append an
|
|
147
|
+
entry to `~/hypomnema/.cache/project-suggestions.json` under `skips`:
|
|
148
|
+
```json
|
|
149
|
+
{ "skips": [ { "cwd": "<absolute cwd>", "declined_at": "<ISO date>", "reason": "user_decline" } ] }
|
|
150
|
+
```
|
|
151
|
+
(preserve any existing `skips` / `cooldowns` keys). The hook reads this and
|
|
152
|
+
stays silent for that cwd permanently.
|
|
153
|
+
|
|
114
154
|
### Close a project
|
|
115
155
|
|
|
116
156
|
1. Write final `session-state.md` (mark as complete)
|
|
@@ -144,3 +184,25 @@ ADRs are immutable once accepted. Mark deprecated/superseded but never edit cont
|
|
|
144
184
|
- **Weekly**: check `pages/open-questions.md` for resolved items
|
|
145
185
|
- **Monthly**: review `log.md` for source-starved weeks (< 1 external source)
|
|
146
186
|
- **On schema change**: bump `SCHEMA.md` version, update this guide if layout changed
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 8. Observability & citation convention
|
|
191
|
+
|
|
192
|
+
Hypomnema v1.1.0 ships an **autonomy score** so you can see whether the wiki is actually being used per session, rather than just trusting that it is.
|
|
193
|
+
|
|
194
|
+
- **Citation:** when a response uses a wiki page, link it inline as `[[page-slug]]`. The audit script counts citations as one signal of "the wiki was actually consulted".
|
|
195
|
+
- **Tools that count:** `Grep`, `WebSearch`, `WebFetch`, and any `/hypo:query` / `/hypo:ingest` / `/hypo:feedback` invocation in the transcript.
|
|
196
|
+
- **Classification (heuristic v0):**
|
|
197
|
+
- `normal` — at least one search, no missed URL ingests
|
|
198
|
+
- `search-0` — zero search/query in the session
|
|
199
|
+
- `search-many` — five or more searches (sign of heavy retrieval; may indicate missing synthesis)
|
|
200
|
+
- `ingest-missed` — URLs appeared in conversation but no `/hypo:ingest` ran
|
|
201
|
+
- `staleness-skip` — session older than the audit window (default 30d)
|
|
202
|
+
- **Where it lives:**
|
|
203
|
+
- Per-session transcript index: `<hypo-root>/.cache/sessions/index.jsonl` (written by the Stop hook `hypo-session-record.mjs`).
|
|
204
|
+
- Fallback source: `~/.claude/projects/<encoded>/*.jsonl` (used when the index is empty — see ADR 0019 if present in your wiki).
|
|
205
|
+
- Reports: `journal/weekly/<YYYY-Www>.md` (spec §6.4 SoT), generated by `node scripts/weekly-report.mjs --write`.
|
|
206
|
+
- **Definitions:** the 0% / 100% endpoints, the formal score sketch, and open questions live in `pages/observability/_index.md`.
|
|
207
|
+
|
|
208
|
+
Use `/hypo:audit` for a quick read of recent sessions; pass `--write` to commit the weekly report into the wiki.
|
package/templates/hypo-help.md
CHANGED
|
@@ -38,7 +38,7 @@ Quick reference for all `/hypo:*` commands.
|
|
|
38
38
|
|
|
39
39
|
| Command | Description |
|
|
40
40
|
|---------|-------------|
|
|
41
|
-
| `/hypo:crystallize` |
|
|
41
|
+
| `/hypo:crystallize` | Close a session (steps 1~6 hard gate) and, on request, surface synthesis candidates (steps 7~11) — tag clusters, unlinked pages, drafts |
|
|
42
42
|
| `/hypo:verify` | Review overdue verify_by deadlines |
|
|
43
43
|
| `/hypo:lint` | Validate frontmatter and `[[wikilinks]]` |
|
|
44
44
|
| `/hypo:graph` | Generate link graph (json / mermaid / dot) |
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Observability Index
|
|
3
|
+
type: reference
|
|
4
|
+
updated: YYYY-MM-DD
|
|
5
|
+
tags: [observability, autonomy, wiki-health]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Observability
|
|
9
|
+
|
|
10
|
+
> Tracks how often and how well the wiki is used per session. Score = proxy for autonomous wiki engagement (not ground truth).
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. Data flow
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
Stop hook (hypo-session-record.mjs)
|
|
18
|
+
│ appends one JSONL entry per session
|
|
19
|
+
▼
|
|
20
|
+
.cache/sessions/index.jsonl
|
|
21
|
+
│
|
|
22
|
+
▼
|
|
23
|
+
scripts/session-audit.mjs ← per-session metrics + classification
|
|
24
|
+
│
|
|
25
|
+
▼
|
|
26
|
+
scripts/weekly-report.mjs ← weekly autonomy score
|
|
27
|
+
│
|
|
28
|
+
▼
|
|
29
|
+
journal/weekly/<YYYY-Www>.md (spec §6.4 SoT)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Session classification
|
|
35
|
+
|
|
36
|
+
| Class | Rule |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `staleness-skip` | `recorded_at` older than `--max-age-days` (default 30) |
|
|
39
|
+
| `ingest-missed` | `urls >= 2` and `ingest_count == 0` |
|
|
40
|
+
| `search-many` | `search_count >= 5` |
|
|
41
|
+
| `search-0` | `search_count == 0` |
|
|
42
|
+
| `normal` | otherwise |
|
|
43
|
+
|
|
44
|
+
Counted tools: `Grep`, `WebSearch`, `WebFetch`. Counted commands: `/hypo:query`, `/hypo:ingest`, `/hypo:feedback`.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 3. Autonomy score formula (heuristic v0)
|
|
49
|
+
|
|
50
|
+
Score is clamped to `[0, 100]`. `staleness-skip` sessions are excluded.
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
numerator = Σ min(search_count, 3) + ingest_count × 3 + feedback_count × 2
|
|
54
|
+
denominator = Σ 1 + (urls > 0 ? min(urls, 5) × 2 : 0)
|
|
55
|
+
score = clamp(round(numerator / denominator × 100), 0, 100)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- Each real session contributes 1 to denominator (baseline expectation).
|
|
59
|
+
- URLs raise the bar: each external URL is a missed-ingest opportunity (weight 2, capped at 5).
|
|
60
|
+
- Ingest (weight 3) and feedback (weight 2) are the strongest positive signals.
|
|
61
|
+
- Search (weight 1, capped at 3) is a weaker signal.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 4. Four-week baseline plan
|
|
66
|
+
|
|
67
|
+
Capture v0 scores for 4 weeks before introducing LLM-judge classification or changing formula weights. Goal: establish a baseline before tuning.
|
|
68
|
+
|
|
69
|
+
| Week | Score | Notes |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| <!-- YYYY-Www --> | <!-- % --> | <!-- first run --> |
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 5. Privacy
|
|
76
|
+
|
|
77
|
+
Weekly reports emit only `session_id` plus aggregate counts — no transcript content, no URLs, no tool inputs. Transcripts live under `~/.claude/projects/` or `.cache/sessions/`, excluded by `.hypoignore`.
|