novahiz 0.8.1 → 0.9.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/CHANGELOG.md +87 -0
- package/adapters/opencode/instructions.md +4 -3
- package/catalog/vault-structure.json +1348 -85
- package/dist/cli.js +1 -1
- package/dist/commands/init.js +46 -0
- package/dist/commands/second-memory.js +263 -166
- package/install/install.mjs +99 -15
- package/install/lib.d.mts +90 -0
- package/install/lib.mjs +147 -0
- package/package.json +1 -1
- package/skills/memory/SKILL.md +5 -5
- package/skills/novahiz-memory/SKILL.md +19 -23
- package/skills/novahiz-second-memory/SKILL.md +62 -48
- package/skills/novahiz-second-memory/references/arborescence.md +21 -12
- package/skills/novahiz-second-memory/references/templates.md +4 -4
- package/src/cli.ts +1 -1
- package/src/commands/init.ts +46 -0
- package/src/commands/second-memory.ts +266 -166
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,93 @@
|
|
|
3
3
|
All notable changes to Novahiz are documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
5
|
|
|
6
|
+
## [0.9.0] - 2026-10-10
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- **`second-memory project-init`** — gives a new project its vault folders
|
|
11
|
+
(`docs/journal/decisions/<project>/`, each with a real `_MOC.md`, never
|
|
12
|
+
`memory/`) and binds the project to its branch. Dry-run by default,
|
|
13
|
+
`--branch Domain/Branch` validates against the catalog, idempotent, and
|
|
14
|
+
`--apply` writes the `vault.json` binding (slug → domain/branch) in the
|
|
15
|
+
memory root.
|
|
16
|
+
- **`novahiz init` Obsidian step** — when a vault exists and the project has
|
|
17
|
+
a name, init creates the project's folders through the same logic; no
|
|
18
|
+
vault, no name or no branch signal means the step skips with an advice and
|
|
19
|
+
never invents a folder. Honors `--dry-run`.
|
|
20
|
+
- **`journal` and `decisions` leaves** in `catalog/vault-structure.json` for
|
|
21
|
+
every `memory|docs` branch (19 branches, 38 leaves), with root
|
|
22
|
+
`journalKeywords` / `decisionsKeywords`. `routePath` resolves the leaf
|
|
23
|
+
`decisions` > `journal` > `docs` > `memory`, and the project level extends
|
|
24
|
+
to the new leaves.
|
|
25
|
+
- **Project binding in `routePath`** — a note carrying a `project:` bound by
|
|
26
|
+
`project-init` lands in the project's branch whatever the keywords say;
|
|
27
|
+
stale or missing bindings fall back to the historic keyword routing.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- **`second-memory sync` is archive-only** — project memory stays local
|
|
32
|
+
(`MEMORY.md` + `project-memory/` slots); the bidirectional slot ↔ vault
|
|
33
|
+
mirror (pull / push / rebuild, last-writer-wins) is retired. `sync` now
|
|
34
|
+
lists (dry-run) and archives (`--apply`, backed up under `Archive/.backup`)
|
|
35
|
+
the notes the old mirror generated (`novahiz_slot_id`), while keeping the
|
|
36
|
+
opt-in inverse import (`novahiz_slot_sync: true` → slot in local memory).
|
|
37
|
+
`status` / `doctor` report the leftovers as `project-memory note(s) in the
|
|
38
|
+
vault`.
|
|
39
|
+
- **Skills and instructions follow** — `novahiz-memory` / `memory` are
|
|
40
|
+
local-only (no vault write, no routing table); `novahiz-second-memory`
|
|
41
|
+
documents the new leaves, `project-init`, the binding and the archive-only
|
|
42
|
+
sync; `instructions.md` adds the local-memory rule and the
|
|
43
|
+
no-speculative-folders rule.
|
|
44
|
+
|
|
45
|
+
### Removed
|
|
46
|
+
|
|
47
|
+
- Mirror helpers and constants of the retired sync (`renderSlotNote`,
|
|
48
|
+
`slotBody`, `parseIso`, `SYNC_TOLERANCE_MS`, and the `readIndex` usage in
|
|
49
|
+
sync).
|
|
50
|
+
|
|
51
|
+
## [0.8.2] - 2026-10-10
|
|
52
|
+
|
|
53
|
+
### Fixed
|
|
54
|
+
|
|
55
|
+
- **In-place `npm install -g novahiz` now keeps the new package instead of
|
|
56
|
+
silently restoring the previous one** (`install/install.mjs`): the
|
|
57
|
+
`Finalize` step spawned `npm outdated` / `npm update` from inside npm's own
|
|
58
|
+
`postinstall` to refresh dependencies. npm exports its config to lifecycle
|
|
59
|
+
scripts (`npm_config_*`, `envExport` default true), so the inherited
|
|
60
|
+
`npm_config_global=true` from the outer `npm install -g` turned that refresh
|
|
61
|
+
into a **second reify of the same global prefix while npm's transaction was
|
|
62
|
+
still open**. Its retire of `node_modules\novahiz` fails with `EBUSY` (the
|
|
63
|
+
installer's cwd *is* the package directory), the nested npm crashes, and
|
|
64
|
+
arborist's rollback runs `rm(new)` + `rename(.novahiz-OLD → novahiz)` —
|
|
65
|
+
the previous install comes back byte-for-byte with its original mtimes
|
|
66
|
+
while the outer npm reports exit 0 / "changed 1 package". The refresh is now
|
|
67
|
+
pinned to the novahiz home (`npm_config_global=false`, `--ignore-scripts`),
|
|
68
|
+
a directory the outer transaction never touches. This was the actual cause
|
|
69
|
+
of "the in-place install does not replace": it reproduces with **no OpenCode
|
|
70
|
+
restart at all** (proved end-to-end 2026-10-10, see tests below).
|
|
71
|
+
|
|
72
|
+
- **The npm postinstall no longer writes the opencode config while npm is
|
|
73
|
+
still mid-transaction** (`install/install.mjs`, `install/lib.mjs`): a second,
|
|
74
|
+
independent failure mode — running `npm install -g novahiz` from an
|
|
75
|
+
OpenCode-owned shell restarted the OpenCode server during `postinstall`, and
|
|
76
|
+
the restart killed the process tree with npm still inside its reify
|
|
77
|
+
transaction. Depending on where the kill landed, the update either left
|
|
78
|
+
orphaned `.novahiz-*` retire directories and shims behind or aborted the
|
|
79
|
+
configuration pass. The installer now splits in two: the synchronous pass
|
|
80
|
+
only touches `NOVAHIZ_HOME` (the only zone never observed as the restart
|
|
81
|
+
trigger across three reproduced kills), while everything that writes the
|
|
82
|
+
OpenCode config — skills, plugin, agent, commands, `opencode.jsonc`,
|
|
83
|
+
provider skill packs — runs in a detached process that waits for the
|
|
84
|
+
installer and npm to exit first (`--deferred-opencode`, log:
|
|
85
|
+
`<novahiz-home>/install-deferred.log`). That child is spawned with
|
|
86
|
+
`cwd=novahiz-home` so it can never hold the package directory open (a
|
|
87
|
+
process whose cwd sits in `node_modules\novahiz` is what makes any npm
|
|
88
|
+
retire of it fail with `EBUSY` on Windows). Direct runs (`novahiz-install`,
|
|
89
|
+
CLI bootstrap) keep the historical fully synchronous behaviour, and
|
|
90
|
+
`--sync` forces that behaviour back under npm as an escape hatch.
|
|
91
|
+
Regression tests: `tests/install-defer.test.ts`.
|
|
92
|
+
|
|
6
93
|
## [Unreleased]
|
|
7
94
|
|
|
8
95
|
## [0.8.1] - 2026-10-10
|
|
@@ -17,13 +17,14 @@ Search it yourself (`novahiz second-memory search "<terms>"`, then read the note
|
|
|
17
17
|
Do **not** consult it for trivial edits, unrelated questions, or when the prompt already carries the needed context.
|
|
18
18
|
|
|
19
19
|
### Rules
|
|
20
|
-
1. When the user asks to **save / memorize / update** memory, load the `memory` skill (alias for `novahiz-memory`) and follow its procedure without exception. For vault-only writes and structure questions, load `novahiz-second-memory` instead: it owns the vault's fixed, predefined arborescence.
|
|
21
|
-
2. Vault routing comes from the predefined structure (`catalog/vault-structure.json`, surfaced by the `novahiz-second-memory` skill) — never guess a location. When ambiguous, ask the user, and display the chosen path before writing.
|
|
20
|
+
1. When the user asks to **save / memorize / update** memory, load the `memory` skill (alias for `novahiz-memory`) and follow its procedure without exception. Project memory is local to the project (`MEMORY.md` + `project-memory/` slots) and **never goes into the vault**. For vault-only writes and structure questions, load `novahiz-second-memory` instead: it owns the vault's fixed, predefined arborescence.
|
|
21
|
+
2. Vault routing comes from the predefined structure (`catalog/vault-structure.json`, surfaced by the `novahiz-second-memory` skill) — never guess a location. A note belongs to a project when its frontmatter carries `project:`; its leaf is `decisions` on a `decisionsKeywords` hit, else `journal` on a `journalKeywords` hit, else `docs`, else `memory`. When ambiguous, ask the user, and display the chosen path before writing.
|
|
22
22
|
3. Search before you write: `novahiz second-memory search "<terms>"` — merge into an existing note rather than creating a duplicate. Link pages with `[[wikilinks]]`.
|
|
23
23
|
4. Never write to `index.md`, `log.md`, `hot.md`, `.manifest.json`, `_meta/`, or `.obsidian/`. If the user asks for it, do it step by step in front of them, with a backup first for anything under `.obsidian/`.
|
|
24
24
|
5. Never create a root domain on your own: every new domain requires user agreement and a structure update.
|
|
25
25
|
6. Include mandatory frontmatter: `title, category, tags, sources, created, updated, summary`.
|
|
26
|
-
7. Structure maintenance is CLI work: `novahiz second-memory [init|doctor|fix|sync|status]` (dry-run by default, `--apply` to write).
|
|
26
|
+
7. Structure maintenance is CLI work: `novahiz second-memory [init|doctor|fix|sync|project-init|status]` (dry-run by default, `--apply` to write). `sync` only archives notes the old memory mirror left in the vault — it never mirrors memory into the vault.
|
|
27
|
+
8. Folders are never created speculatively: a folder appears on the first write, or when `second-memory project-init` (the same logic behind the `Obsidian project folder` step of `novahiz init`) creates a project's `docs/journal/decisions` folders on request — never `memory/<project>/`.
|
|
27
28
|
|
|
28
29
|
## Playwright Browser — Persistent Profile
|
|
29
30
|
|