hypomnema 1.3.2 → 1.3.3
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 +2 -1
- package/README.md +2 -1
- package/commands/audit.md +1 -1
- package/commands/crystallize.md +3 -3
- package/commands/doctor.md +1 -1
- package/commands/feedback.md +1 -1
- package/commands/graph.md +1 -1
- package/commands/ingest.md +1 -1
- package/commands/init.md +1 -1
- package/commands/lint.md +1 -1
- package/commands/query.md +1 -1
- package/commands/rename.md +79 -0
- package/commands/resume.md +1 -1
- package/commands/stats.md +1 -1
- package/commands/uninstall.md +1 -1
- package/commands/upgrade.md +1 -1
- package/commands/verify.md +1 -1
- package/hooks/hypo-auto-commit.mjs +8 -24
- package/hooks/hypo-compact-guard.mjs +5 -2
- package/hooks/hypo-shared.mjs +318 -41
- package/package.json +1 -1
- package/scripts/crystallize.mjs +89 -12
- package/scripts/rename.mjs +478 -15
- package/skills/crystallize/SKILL.md +2 -2
- package/skills/graph/SKILL.md +1 -1
- package/skills/ingest/SKILL.md +1 -1
- package/skills/lint/SKILL.md +1 -1
- package/skills/query/SKILL.md +1 -1
- package/skills/verify/SKILL.md +1 -1
- package/templates/hypo-config.md +1 -1
- package/templates/hypo-guide.md +2 -0
- package/templates/hypo-help.md +1 -0
package/README.ko.md
CHANGED
|
@@ -225,6 +225,7 @@ v1.0에서는 `personal / shared / public` 3-mode를 만들었습니다. 현실
|
|
|
225
225
|
| `/hypo:verify` | `verify_by` 프런트매터가 붙은 페이지를 점검 | 시간이 지나 옛 정보가 됐을 가능성이 있을 때 |
|
|
226
226
|
| `/hypo:lint` | frontmatter, 위키링크, 스키마 검증 | 커밋 전, CI에서 |
|
|
227
227
|
| `/hypo:graph` | 위키링크 의존성 그래프 생성 | 구조적 성장을 보고 싶을 때 |
|
|
228
|
+
| `/hypo:rename` | 페이지·디렉터리 이름 변경 + 인바운드 `[[위키링크]]` 갱신 | 페이지나 프로젝트 폴더 이름을 바꿀 때 |
|
|
228
229
|
|
|
229
230
|
### 라이프사이클 훅 (14개)
|
|
230
231
|
|
|
@@ -249,7 +250,7 @@ v1.0에서는 `personal / shared / public` 3-mode를 만들었습니다. 현실
|
|
|
249
250
|
|
|
250
251
|
이와 별도로 `SessionStart` 훅은 npm 레지스트리와 Claude Code 플러그인 마켓플레이스를 백그라운드에서 확인합니다(세션 시작을 막지 않습니다). 새 버전이 게시되어 있으면 다음 세션 시작 시 "Update available!" 안내가 한 줄 표시됩니다. `HYPO_NO_UPDATE_CHECK=1`, `NO_UPDATE_NOTIFIER=1`을 지정하거나 `CI=true` 환경에서 실행하면 점검을 건너뜁니다.
|
|
251
252
|
|
|
252
|
-
위 네 가지 레인 외의 v1.3 세부 수정 — 세션 마무리 lint를 건드린 파일로 스코프해 무관한 debt로 `/compact`가 막히지 않게 한 변경, `feedback` scope 검증기가 cwd 유래 project id를 수용하게 한 수정, `--strict`가 에러로 승격하는 안정적 lint 경고 ID `W1`/`W2`/`W4`(`--fix`로 자동복구되는 `W3`는 경고로 유지) — 은 [`CHANGELOG.md`](CHANGELOG.md)를 참고하세요. **v1.3.1**은 수정 전용 패치입니다: 업데이트 notifier 배너가 이제 보이지 않던 stderr 출력 대신 top-level `systemMessage` 채널로 실제 사용자에게 도달하고, `/hypo:upgrade`가 플러그인·dual(수동+플러그인) 설치에서 core 훅을 중복 등록하지 않으며, 세션 마무리가 두 프로젝트가 같은 최신 날짜를 가질 때 완료된 close를 false-block 하지 않습니다. **v1.3.2**는 비-프로젝트(툴링·위키 전용) 세션을 무관한 프로젝트에 엮지 않고 닫는 1급 log-only close 경로와, 페이지 이름을 바꿀 때 해당하는 인바운드 위키링크를 갱신하는 `rename` 헬퍼를 추가합니다(모호하거나 append-only인 참조는 갱신하지 않고 보고합니다). 또한 세션 마무리 게이트(오늘 활동한 모든 프로젝트를 게이트, 세션별 마커와 `/compact`가 하나의 게이트를 공유, 도출 가능한 루트 `log.md` 항목 자동 도출)와 linter(`--json`이 파이프에서 잘리지 않음, 볼트 관습 위키링크를 오탐 대신 정상 해석)를 수정합니다.
|
|
253
|
+
위 네 가지 레인 외의 v1.3 세부 수정 — 세션 마무리 lint를 건드린 파일로 스코프해 무관한 debt로 `/compact`가 막히지 않게 한 변경, `feedback` scope 검증기가 cwd 유래 project id를 수용하게 한 수정, `--strict`가 에러로 승격하는 안정적 lint 경고 ID `W1`/`W2`/`W4`(`--fix`로 자동복구되는 `W3`는 경고로 유지) — 은 [`CHANGELOG.md`](CHANGELOG.md)를 참고하세요. **v1.3.1**은 수정 전용 패치입니다: 업데이트 notifier 배너가 이제 보이지 않던 stderr 출력 대신 top-level `systemMessage` 채널로 실제 사용자에게 도달하고, `/hypo:upgrade`가 플러그인·dual(수동+플러그인) 설치에서 core 훅을 중복 등록하지 않으며, 세션 마무리가 두 프로젝트가 같은 최신 날짜를 가질 때 완료된 close를 false-block 하지 않습니다. **v1.3.2**는 비-프로젝트(툴링·위키 전용) 세션을 무관한 프로젝트에 엮지 않고 닫는 1급 log-only close 경로와, 페이지 이름을 바꿀 때 해당하는 인바운드 위키링크를 갱신하는 `rename` 헬퍼를 추가합니다(모호하거나 append-only인 참조는 갱신하지 않고 보고합니다). 또한 세션 마무리 게이트(오늘 활동한 모든 프로젝트를 게이트, 세션별 마커와 `/compact`가 하나의 게이트를 공유, 도출 가능한 루트 `log.md` 항목 자동 도출)와 linter(`--json`이 파이프에서 잘리지 않음, 볼트 관습 위키링크를 오탐 대신 정상 해석)를 수정합니다. **v1.3.3**은 세션 마무리 게이트를 실수 발동에 대해 단단히 합니다: 모델이 실제 사용자 종료 신호 없이 세션을 닫을 수 없고, 종료 관련 텍스트를 읽는 것이 턴을 false-block하지 않으며, `--apply-session-close`가 사용자 종료 신호가 있는 close에서 payload 커밋과 마커 기록을 한 번에 끝내고, 일상적 트래커 bookkeeping이 무관한 프로젝트의 `/compact`를 cross-block하지 않습니다. 또한 `rename`을 디렉터리 서브트리 전체 이동으로 확장합니다(`/hypo:rename` 커맨드와 대상 경로가 이미 있을 때의 merge/renumber 충돌 리포트 포함).
|
|
253
254
|
|
|
254
255
|
### 셋업 & 유지보수
|
|
255
256
|
|
package/README.md
CHANGED
|
@@ -225,6 +225,7 @@ Eight commands cover the full capture → retrieval → consolidation cycle.
|
|
|
225
225
|
| `/hypo:verify` | Audits pages with `verify_by` frontmatter | When time-bound knowledge might have aged out |
|
|
226
226
|
| `/hypo:lint` | Validates frontmatter, wikilinks, schema | Before commits, in CI |
|
|
227
227
|
| `/hypo:graph` | Generates a wikilink dependency graph | When you want to see structural growth |
|
|
228
|
+
| `/hypo:rename` | Renames a page or directory and rewrites inbound `[[wikilinks]]` | When a page or project folder needs a new name |
|
|
228
229
|
|
|
229
230
|
### Lifecycle hooks (14)
|
|
230
231
|
|
|
@@ -249,7 +250,7 @@ All hooks resolve the wiki root via `HYPO_DIR` env → `hypo-config.md` scan →
|
|
|
249
250
|
|
|
250
251
|
Additionally, the `SessionStart` hook performs a non-blocking background check against npm and the Claude Code plugin marketplace and prints an "Update available!" banner the next time a newer Hypomnema version has been published. Opt out with `HYPO_NO_UPDATE_CHECK=1`, `NO_UPDATE_NOTIFIER=1`, or by running under `CI=true`.
|
|
251
252
|
|
|
252
|
-
For fix-level v1.3 detail beyond the lanes above — session-close lint scoped to touched files so `/compact` is no longer blocked by unrelated debt, the `feedback` scope validator accepting cwd-derived project ids, and the stable lint warning IDs `W1`/`W2`/`W4` that `--strict` promotes to errors (while `W3`, auto-repaired by `--fix`, stays a warning) — see [`CHANGELOG.md`](CHANGELOG.md). **v1.3.1** is a fixes-only patch: update-notifier banners now actually reach the user via the top-level `systemMessage` channel instead of an invisible stderr write, `/hypo:upgrade` no longer double-registers core hooks for plugin or dual (manual + plugin) installs, and session-close no longer false-blocks a completed close when two projects share the latest date. **v1.3.2** adds a first-class log-only session-close path, so a non-project (tooling or wiki-only) session closes cleanly without being forced onto an unrelated project, plus a `rename` helper that rewrites the eligible inbound wikilinks when you rename a page (ambiguous or append-only references are reported, not rewritten). It also tightens the session-close gate (every project with activity today is gated, the per-session marker and `/compact` share one gate, and the derivable root `log.md` entry auto-derives) and the linter (`--json` no longer truncates on a pipe, and vault-convention wikilinks resolve instead of being false-flagged).
|
|
253
|
+
For fix-level v1.3 detail beyond the lanes above — session-close lint scoped to touched files so `/compact` is no longer blocked by unrelated debt, the `feedback` scope validator accepting cwd-derived project ids, and the stable lint warning IDs `W1`/`W2`/`W4` that `--strict` promotes to errors (while `W3`, auto-repaired by `--fix`, stays a warning) — see [`CHANGELOG.md`](CHANGELOG.md). **v1.3.1** is a fixes-only patch: update-notifier banners now actually reach the user via the top-level `systemMessage` channel instead of an invisible stderr write, `/hypo:upgrade` no longer double-registers core hooks for plugin or dual (manual + plugin) installs, and session-close no longer false-blocks a completed close when two projects share the latest date. **v1.3.2** adds a first-class log-only session-close path, so a non-project (tooling or wiki-only) session closes cleanly without being forced onto an unrelated project, plus a `rename` helper that rewrites the eligible inbound wikilinks when you rename a page (ambiguous or append-only references are reported, not rewritten). It also tightens the session-close gate (every project with activity today is gated, the per-session marker and `/compact` share one gate, and the derivable root `log.md` entry auto-derives) and the linter (`--json` no longer truncates on a pipe, and vault-convention wikilinks resolve instead of being false-flagged). **v1.3.3** hardens the session-close gate against accidental triggers: the model can no longer mark a session closed without a real user close signal, reading close-related text no longer false-blocks the turn, `--apply-session-close` commits its payload and writes the marker in one step on a close that carries a user close signal, and routine tracker bookkeeping no longer cross-blocks an unrelated project's `/compact`. It also extends `rename` to move a whole directory subtree (with a `/hypo:rename` command and a merge/renumber collision report when a destination already exists).
|
|
253
254
|
|
|
254
255
|
### Setup & maintenance
|
|
255
256
|
|
package/commands/audit.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Audit recent sessions for observability gaps and optionally write the weekly report. Use when the user asks to review session quality, find tracking gaps, or generate the weekly summary.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:audit`. Inspect recent Claude Code sessions to see how much of the wiki's value motion is actually happening (search, ingest, citation, feedback), then either show the result inline or write a weekly observability page.
|
package/commands/crystallize.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Crystallize draft notes into stable knowledge
|
|
2
|
+
description: Crystallize draft notes into stable wiki knowledge; also the session-close path. Use when the user explicitly signals session end (종료/마무리/wrap up), asks to save or consolidate notes, or before a /compact. Task completion alone is not a close signal.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:crystallize`. This command serves two purposes:
|
|
@@ -11,7 +11,7 @@ You are running `/hypo:crystallize`. This command serves two purposes:
|
|
|
11
11
|
|
|
12
12
|
## Step 1 — Detect context
|
|
13
13
|
|
|
14
|
-
If
|
|
14
|
+
If `/hypo:crystallize` was invoked to close a session (via an explicit close signal like "세션 종료" / "오늘 작업 마무리" / "session close" / "wrap up", an accepted proactive-offer [세션 마무리], or `/compact`), run Step 1a (advisory reflections) then Steps 2–4 (session-close mechanical apply + recovery) **before** the synthesis scan. Task completion alone does not put you in close mode. Otherwise skip to Step 5.
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
@@ -109,7 +109,7 @@ Both gates judge only the **payload files** (the 5 mandatory close files + `open
|
|
|
109
109
|
1. **Preflight** — `lint.mjs --json` runs **before** any payload bytes are written. Errors in overwrite targets (sessionState / projectHot / rootHot / openQuestions) are filtered (about to be replaced). Errors in an **append target** (session-log / log.md) still block (appending can't repair existing corruption) → exit 1 with `stage='preflight-lint'`. Errors outside the payload files → `notices[]`, apply proceeds.
|
|
110
110
|
2. **Post-apply** — lint re-runs after the writes. Blocks only on **errors** in payload files (a payload-introduced malformed body / bad frontmatter); pre-existing errors elsewhere → `notices[]`. A lint crash (unparseable output) always blocks. Broken wikilinks are lint **warnings** (W4 — forward references to planned pages are normal) and are not gated here. Surfaces as `stage='post-apply-lint'` (or `'post-apply-verification+lint'` if freshness also fails).
|
|
111
111
|
|
|
112
|
-
> **Manual close (direct Write tool calls)** clears the Stop-chain block via `--mark-session-closed --session-id=<id>`.
|
|
112
|
+
> **Manual close (direct Write tool calls)** clears the Stop-chain block via `--mark-session-closed --session-id=<id>`. Both marker writers apply a **user-close hard gate** (ADR 0055): the marker is written only when the session's transcript carries a genuine user close signal — an NL close phrase, a `/compact`, or an accepted AskUserQuestion [세션 마무리] answer. The transcript is resolved **strictly from `--session-id`** (a globally-unique id, globbed under `~/.claude/projects/`), never from a CLI arg, so a model that runs the writer on its own — without the user ever signalling close — is refused, and a forged path cannot point the gate at someone else's close-intent. The lint scope is widened from that same resolved transcript. `--transcript-path` is **not** consulted by the marker gate; it survives only to scope `--check-session-close`'s lint (which writes no marker).
|
|
113
113
|
|
|
114
114
|
---
|
|
115
115
|
|
package/commands/doctor.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Run a health check on a Hypomnema wiki installation (hooks, settings, structure). Use when the user reports the wiki misbehaving, after an install or upgrade, or to diagnose setup problems.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:doctor`. Verify the health of the current Hypomnema wiki installation.
|
package/commands/feedback.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Record an AI behavior correction or preference into the wiki
|
|
2
|
+
description: Record an AI behavior correction or preference into the wiki. Use when the user corrects how you work or states a lasting preference to remember.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:feedback`. Capture a behavior correction or preference into `pages/feedback/` — the **single source of truth** for learned behaviors (ADR 0031).
|
package/commands/graph.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Generate a wikilink dependency graph
|
|
2
|
+
description: Generate a wikilink dependency graph from wiki pages (json, mermaid, or dot). Use when the user asks to visualize wiki structure or find orphan and hub pages.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:graph`. Generate a link dependency graph from wiki pages.
|
package/commands/ingest.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Ingest an external source into the wiki
|
|
2
|
+
description: Ingest an external source (URL, doc, article, command output) into the wiki as a citable page. Use when the user shares a source to capture or wants external knowledge saved for reuse.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:ingest`. Save a raw source and synthesize it into wiki pages.
|
package/commands/init.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Initialize a new Hypomnema wiki
|
|
2
|
+
description: Initialize a new Hypomnema wiki (structure, config, hooks). Use when the user is setting up a wiki for the first time or starting a fresh vault.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:init`. Set up a new personal wiki powered by Hypomnema.
|
package/commands/lint.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Validate wiki pages for frontmatter correctness and broken wikilinks
|
|
2
|
+
description: Validate wiki pages for frontmatter correctness and broken wikilinks. Use when the user asks to check wiki health, before a commit, or after bulk edits or renames.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:lint`. Validate all wiki pages for frontmatter correctness and broken `[[wikilink]]` references.
|
package/commands/query.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Query the wiki and synthesize an answer from relevant pages
|
|
2
|
+
description: Query the wiki and synthesize an answer from the relevant pages. Use when the user asks what the wiki knows, wants to recall a past decision, or needs prior context before starting work.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:query`. Answer a question by searching the wiki and synthesizing from relevant pages.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Rename a wiki page or directory and rewrite the inbound wikilinks so live links survive. Use when the user wants to move or rename a page or folder without breaking references.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
You are running `/hypo:rename`. Move a page or directory and content-aware rewrite every inbound `[[wikilink]]` across the vault so the rename never breaks a link.
|
|
6
|
+
|
|
7
|
+
## What this does
|
|
8
|
+
|
|
9
|
+
- Resolves `--from` to a page (`.md`) or a directory
|
|
10
|
+
- Page mode: moves the single page, rewrites every inbound `[[old]]` / `[[old|alias]]` / `[[old#anchor]]` / `[[dir/old]]` that resolves unambiguously to it
|
|
11
|
+
- Directory mode: relocates the whole subtree (carrying non-`.md` assets) and rewrites inbound full-slug and dir-relative links for every moved page
|
|
12
|
+
- Skips append-only time records (journal / session-log / weekly / archive / postmortems / root `log.md`) and immutable `sources/*` as link sources
|
|
13
|
+
- Reports ambiguous bare links it refuses to auto-rewrite, and refuses a merge/renumber into an existing destination
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Step 1 — Locate package root
|
|
18
|
+
|
|
19
|
+
Locate the Hypomnema package root (the directory containing this file's parent `commands/`).
|
|
20
|
+
|
|
21
|
+
If the user specified a Hypomnema directory, pass it as `--hypo-dir="<path>"`. Otherwise omit the flag.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Step 2 — Dry-run first
|
|
26
|
+
|
|
27
|
+
Always run the dry-run (no `--apply`) before writing anything:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
node <package-root>/scripts/rename.mjs \
|
|
31
|
+
[--hypo-dir="<path>"] \
|
|
32
|
+
--from=<slug|rel|dir> \
|
|
33
|
+
--to=<slug|rel|dir> \
|
|
34
|
+
[--json]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Options:
|
|
38
|
+
- `--from` — the page slug / relative path, OR an existing directory to relocate
|
|
39
|
+
- `--to` — the new name. A bare name renames in place within the same directory; a path with `/` moves across directories. For a directory `--from`, `--to` must be a fresh (non-existing) directory in the same top-level area
|
|
40
|
+
- `--json` — machine-readable result (recommended so you can present a precise summary)
|
|
41
|
+
- `--apply` — perform the move + rewrites (Step 4)
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Step 3 — Present the dry-run result
|
|
46
|
+
|
|
47
|
+
From the JSON, report:
|
|
48
|
+
- `from` → `to`, and for directory mode `pages_moved`
|
|
49
|
+
- `links_rewritten` across `files_rewritten` files — list the `from`→`to` per file
|
|
50
|
+
- `ambiguous` — any bare links shared by more than one page that were NOT rewritten. Tell the user to resolve these manually (use a dir-relative or full-slug form)
|
|
51
|
+
|
|
52
|
+
If the result is `ok: false`:
|
|
53
|
+
- `reason: "renumber-or-merge"` — the destination directory already exists. List `destination_collisions` and explain this is a merge/renumber: resolve manually, then retry into a fresh directory.
|
|
54
|
+
- `reason: "form-collision"` — the move would create ambiguous link forms. List `form_collisions`.
|
|
55
|
+
- Any other error — surface the `error` message verbatim.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Step 4 — Apply
|
|
60
|
+
|
|
61
|
+
Once the user confirms the dry-run looks right, re-run with `--apply`:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
node <package-root>/scripts/rename.mjs \
|
|
65
|
+
[--hypo-dir="<path>"] \
|
|
66
|
+
--from=<slug|rel|dir> \
|
|
67
|
+
--to=<slug|rel|dir> \
|
|
68
|
+
--apply --json
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Then confirm: the page/subtree moved, `links_rewritten` applied, and any `ambiguous` links still pending manual fixup.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Notes
|
|
76
|
+
|
|
77
|
+
- Directory mode rewrites a relocated time-record's intra-subtree links as `[[new|old]]`, preserving the rendered historical label while pointing at the live page.
|
|
78
|
+
- Bare `[[name]]` links to a moved page are intentionally left untouched in directory mode: a directory rename does not change basenames, so they keep resolving.
|
|
79
|
+
- After a large rename, run `/hypo:lint` to confirm no broken links remain.
|
package/commands/resume.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Resume the
|
|
2
|
+
description: Resume an active project and pick up where you left off. Use when the user asks to continue prior work or what they were working on.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:resume`. Load the session state for an active project and pick up where you left off.
|
package/commands/stats.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Show statistics about the wiki
|
|
2
|
+
description: Show statistics about the wiki (page counts, link density, growth). Use when the user asks how big the wiki is, how it has grown, or its overall shape.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:stats`. Display a summary of wiki health and activity.
|
package/commands/uninstall.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Remove Hypomnema hooks and clean up settings.json
|
|
2
|
+
description: Remove Hypomnema hooks and clean up settings.json. Use when the user wants to uninstall or disable the wiki integration.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:uninstall`. Remove Hypomnema from this machine.
|
package/commands/upgrade.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Check for Hypomnema updates and optionally apply them
|
|
2
|
+
description: Check for Hypomnema updates and optionally apply them. Use when the user asks to update Hypomnema or sees an update-available notice.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:upgrade`. Check if the installed Hypomnema wiki is out of date and offer to apply updates.
|
package/commands/verify.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Check verify_by fields and surface overdue or missing verifications
|
|
2
|
+
description: Check verify_by fields and surface overdue or missing verifications. Use when the user asks what wiki knowledge needs re-checking or wants to audit freshness.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
You are running `/hypo:verify`. Audit wiki pages for overdue or missing `verify_by` fields.
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { spawnSync } from 'child_process';
|
|
9
|
-
import { HYPO_DIR,
|
|
10
|
-
import { join } from 'path';
|
|
9
|
+
import { HYPO_DIR, appendSyncFailure, commitWikiChanges } from './hypo-shared.mjs';
|
|
11
10
|
|
|
12
11
|
function git(...args) {
|
|
13
12
|
return spawnSync('git', ['-C', HYPO_DIR, ...args], { encoding: 'utf-8', timeout: 30000 });
|
|
@@ -18,28 +17,13 @@ function hasRemote() {
|
|
|
18
17
|
return (r.stdout || '').trim().length > 0;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const file = line.slice(3).replace(/^"|"$/g, '').split(' -> ').pop().trim();
|
|
29
|
-
if (!file) continue;
|
|
30
|
-
if (ignorePatterns.length > 0 && isIgnored(join(HYPO_DIR, file), HYPO_DIR, ignorePatterns))
|
|
31
|
-
continue;
|
|
32
|
-
paths.push(file);
|
|
33
|
-
}
|
|
34
|
-
if (paths.length > 0) git('add', '--', ...paths);
|
|
35
|
-
const staged = git('diff', '--cached', '--name-only').stdout?.trim() || '';
|
|
36
|
-
if (staged) {
|
|
37
|
-
const today = new Date().toISOString().slice(0, 10);
|
|
38
|
-
const commit = git('commit', '-m', `auto: ${today} wiki update`);
|
|
39
|
-
if (commit.status !== 0) {
|
|
40
|
-
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
41
|
-
process.exit(0);
|
|
42
|
-
}
|
|
20
|
+
// Stage + commit via the shared helper (same .hypoignore filter the apply path
|
|
21
|
+
// uses — ADR 0056). A real commit failure short-circuits before sync, exactly as
|
|
22
|
+
// the inline logic did; "nothing to commit" is success and falls through to sync.
|
|
23
|
+
const result = commitWikiChanges(HYPO_DIR);
|
|
24
|
+
if (!result.committed) {
|
|
25
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
26
|
+
process.exit(0);
|
|
43
27
|
}
|
|
44
28
|
|
|
45
29
|
if (hasRemote()) {
|
|
@@ -42,14 +42,17 @@ process.stdin.on('end', () => {
|
|
|
42
42
|
const gitStatus = hypoIsClean();
|
|
43
43
|
const hotStatus = hotMdIsClean();
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
// ADR 0056: block on uncommitted (real unsaved work); unpushed commits (ahead)
|
|
46
|
+
// are a soft, auto-synced state and must not block /compact or /clear — mirrors
|
|
47
|
+
// the precompactGateStatus demote so the chat-side gate stays consistent.
|
|
48
|
+
if (hasSession && !gitStatus.uncommitted && hotStatus.clean) {
|
|
46
49
|
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
47
50
|
return;
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
const reasons = [
|
|
51
54
|
!hasSession ? 'session log entry missing' : '',
|
|
52
|
-
|
|
55
|
+
gitStatus.uncommitted ? gitStatus.reason : '',
|
|
53
56
|
!hotStatus.clean ? hotStatus.reason : '',
|
|
54
57
|
].filter(Boolean);
|
|
55
58
|
|