openwolf-enhanced 1.9.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.
Files changed (127) hide show
  1. package/CHANGELOG.md +386 -0
  2. package/LICENSE +663 -0
  3. package/NOTICE +48 -0
  4. package/README.md +283 -0
  5. package/dist/bin/openwolf.js +10 -0
  6. package/dist/bin/openwolf.js.map +1 -0
  7. package/dist/dashboard/assets/AISuggestions-DHXOgHMM.js +9 -0
  8. package/dist/dashboard/assets/ActivityTimeline-BXLwacZV.js +1 -0
  9. package/dist/dashboard/assets/AnatomyBrowser-CUyC8M2I.js +1 -0
  10. package/dist/dashboard/assets/BugLog-Bxvy1sPW.js +1 -0
  11. package/dist/dashboard/assets/CerebrumViewer-DCySVmzA.js +1 -0
  12. package/dist/dashboard/assets/CronStatus-BA4fmQX3.js +1 -0
  13. package/dist/dashboard/assets/DesignQC-BhNEKryS.js +1 -0
  14. package/dist/dashboard/assets/MemoryViewer-0y9lsDUO.js +1 -0
  15. package/dist/dashboard/assets/ProjectOverview-CC51rVRe.js +1 -0
  16. package/dist/dashboard/assets/StatusBadge-4NJI_F2G.js +1 -0
  17. package/dist/dashboard/assets/TokenUsage-7pCxlnCX.js +55 -0
  18. package/dist/dashboard/assets/index-4O5rk-qB.css +2 -0
  19. package/dist/dashboard/assets/index-jfgWxxsn.js +13 -0
  20. package/dist/dashboard/assets/utils-BqE_aDxV.js +1 -0
  21. package/dist/dashboard/index.html +16 -0
  22. package/dist/hooks/post-read.js +85 -0
  23. package/dist/hooks/post-write.js +520 -0
  24. package/dist/hooks/pre-read.js +107 -0
  25. package/dist/hooks/pre-write.js +120 -0
  26. package/dist/hooks/session-start.js +76 -0
  27. package/dist/hooks/shared.js +0 -0
  28. package/dist/hooks/stop.js +219 -0
  29. package/dist/src/buglog/bug-matcher.js +3 -0
  30. package/dist/src/buglog/bug-matcher.js.map +1 -0
  31. package/dist/src/buglog/bug-tracker.js +89 -0
  32. package/dist/src/buglog/bug-tracker.js.map +1 -0
  33. package/dist/src/cli/bug-cmd.js +31 -0
  34. package/dist/src/cli/bug-cmd.js.map +1 -0
  35. package/dist/src/cli/cron-cmd.js +107 -0
  36. package/dist/src/cli/cron-cmd.js.map +1 -0
  37. package/dist/src/cli/daemon-cmd.js +180 -0
  38. package/dist/src/cli/daemon-cmd.js.map +1 -0
  39. package/dist/src/cli/dashboard.js +88 -0
  40. package/dist/src/cli/dashboard.js.map +1 -0
  41. package/dist/src/cli/designqc-cmd.js +31 -0
  42. package/dist/src/cli/designqc-cmd.js.map +1 -0
  43. package/dist/src/cli/doctor-cmd.js +94 -0
  44. package/dist/src/cli/doctor-cmd.js.map +1 -0
  45. package/dist/src/cli/index.js +158 -0
  46. package/dist/src/cli/index.js.map +1 -0
  47. package/dist/src/cli/init.js +493 -0
  48. package/dist/src/cli/init.js.map +1 -0
  49. package/dist/src/cli/registry.js +93 -0
  50. package/dist/src/cli/registry.js.map +1 -0
  51. package/dist/src/cli/scan.js +39 -0
  52. package/dist/src/cli/scan.js.map +1 -0
  53. package/dist/src/cli/status.js +98 -0
  54. package/dist/src/cli/status.js.map +1 -0
  55. package/dist/src/cli/update.js +435 -0
  56. package/dist/src/cli/update.js.map +1 -0
  57. package/dist/src/daemon/cron-engine.js +321 -0
  58. package/dist/src/daemon/cron-engine.js.map +1 -0
  59. package/dist/src/daemon/file-watcher.js +64 -0
  60. package/dist/src/daemon/file-watcher.js.map +1 -0
  61. package/dist/src/daemon/health.js +23 -0
  62. package/dist/src/daemon/health.js.map +1 -0
  63. package/dist/src/daemon/wolf-daemon.js +440 -0
  64. package/dist/src/daemon/wolf-daemon.js.map +1 -0
  65. package/dist/src/designqc/designqc-capture.js +278 -0
  66. package/dist/src/designqc/designqc-capture.js.map +1 -0
  67. package/dist/src/designqc/designqc-engine.js +159 -0
  68. package/dist/src/designqc/designqc-engine.js.map +1 -0
  69. package/dist/src/designqc/designqc-types.js +5 -0
  70. package/dist/src/designqc/designqc-types.js.map +1 -0
  71. package/dist/src/hooks/post-read.js +86 -0
  72. package/dist/src/hooks/post-read.js.map +1 -0
  73. package/dist/src/hooks/post-write.js +521 -0
  74. package/dist/src/hooks/post-write.js.map +1 -0
  75. package/dist/src/hooks/pre-read.js +108 -0
  76. package/dist/src/hooks/pre-read.js.map +1 -0
  77. package/dist/src/hooks/pre-write.js +121 -0
  78. package/dist/src/hooks/pre-write.js.map +1 -0
  79. package/dist/src/hooks/session-start.js +77 -0
  80. package/dist/src/hooks/session-start.js.map +1 -0
  81. package/dist/src/hooks/shared.js +0 -0
  82. package/dist/src/hooks/shared.js.map +1 -0
  83. package/dist/src/hooks/stop.js +220 -0
  84. package/dist/src/hooks/stop.js.map +1 -0
  85. package/dist/src/scanner/anatomy-scanner.js +278 -0
  86. package/dist/src/scanner/anatomy-scanner.js.map +1 -0
  87. package/dist/src/scanner/description-extractor.js +1007 -0
  88. package/dist/src/scanner/description-extractor.js.map +1 -0
  89. package/dist/src/scanner/project-root.js +52 -0
  90. package/dist/src/scanner/project-root.js.map +1 -0
  91. package/dist/src/tracker/token-estimator.js +20 -0
  92. package/dist/src/tracker/token-estimator.js.map +1 -0
  93. package/dist/src/tracker/token-ledger.js +55 -0
  94. package/dist/src/tracker/token-ledger.js.map +1 -0
  95. package/dist/src/tracker/waste-detector.js +101 -0
  96. package/dist/src/tracker/waste-detector.js.map +1 -0
  97. package/dist/src/utils/dashboard-auth.js +50 -0
  98. package/dist/src/utils/dashboard-auth.js.map +1 -0
  99. package/dist/src/utils/fs-safe.js +135 -0
  100. package/dist/src/utils/fs-safe.js.map +1 -0
  101. package/dist/src/utils/hooks-deploy.js +70 -0
  102. package/dist/src/utils/hooks-deploy.js.map +1 -0
  103. package/dist/src/utils/logger.js +48 -0
  104. package/dist/src/utils/logger.js.map +1 -0
  105. package/dist/src/utils/maintenance.js +385 -0
  106. package/dist/src/utils/maintenance.js.map +1 -0
  107. package/dist/src/utils/paths.js +23 -0
  108. package/dist/src/utils/paths.js.map +1 -0
  109. package/dist/src/utils/platform.js +14 -0
  110. package/dist/src/utils/platform.js.map +1 -0
  111. package/dist/src/utils/seed.js +61 -0
  112. package/dist/src/utils/seed.js.map +1 -0
  113. package/package.json +82 -0
  114. package/src/templates/OPENWOLF.md +147 -0
  115. package/src/templates/STATUS.md +48 -0
  116. package/src/templates/anatomy.md +5 -0
  117. package/src/templates/buglog.json +4 -0
  118. package/src/templates/cerebrum.md +22 -0
  119. package/src/templates/claude-md-snippet.md +5 -0
  120. package/src/templates/claude-rules-openwolf.md +17 -0
  121. package/src/templates/config.json +83 -0
  122. package/src/templates/cron-manifest.json +97 -0
  123. package/src/templates/cron-state.json +7 -0
  124. package/src/templates/identity.md +9 -0
  125. package/src/templates/memory.md +4 -0
  126. package/src/templates/reframe-frameworks.md +597 -0
  127. package/src/templates/token-ledger.json +21 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,386 @@
1
+ # Changelog
2
+
3
+ All notable changes to **OpenWolf Enhanced** are documented here.
4
+
5
+ This is a fork of [OpenWolf](https://github.com/cytostack/openwolf) by Cytostack
6
+ Pvt Ltd. Versions ≤ 1.0.4 refer to the upstream project; `1.1.0` is the first
7
+ release of this fork.
8
+
9
+ ## [1.9.3] — 2026-07-10
10
+
11
+ First release published to npm as [`openwolf-enhanced`](https://www.npmjs.com/package/openwolf-enhanced) — `npm install -g openwolf-enhanced`.
12
+
13
+ ### Fixed
14
+ - **`prepublishOnly` no longer builds — it verifies.** It previously ran `pnpm build`, whose
15
+ `prebuild` deletes `dist/`; since the global `openwolf` command symlinks into
16
+ `dist/bin/openwolf.js`, a build failure mid-publish would take the installed CLI down with it, and
17
+ a publish at the wrong moment could ship a stale `dist/`. `scripts/prepublish-guard.mjs` now
18
+ refuses to publish unless `dist/` is present, no source is newer than the compiled CLI, the working
19
+ tree is clean, and `package.json`'s version has a matching git tag on `HEAD`. Building is a
20
+ deliberate, separate step. (This `prepublishOnly → prebuild-deletes-dist` trap was inherited
21
+ verbatim from upstream 1.0.4.)
22
+
23
+ ### Documentation
24
+ - README Quick Start leads with `npm install -g openwolf-enhanced`, notes that the bare `openwolf`
25
+ package is the unmaintained upstream 1.0.4, and keeps the from-source build as a collapsible
26
+ fallback.
27
+
28
+ ## [1.9.2] — 2026-07-10
29
+
30
+ Three findings from the 1.9.1 investigation, fixed.
31
+
32
+ ### Fixed
33
+ - **`openwolf update` now seeds user-data files a project never received.** `USER_DATA_FILES` are
34
+ never overwritten — but that was implemented as *never touched*, so a project initialised before a
35
+ file existed never got one. `STATUS.md` (added in 1.4.0) was the casualty: older projects had none,
36
+ while `OPENWOLF.md` instructs the agent to read it first. Missing files are now copied from
37
+ `src/templates/` with `{{PROJECT_NAME}}`/`{{DATE}}` substituted. Existing files are still never
38
+ touched.
39
+ - **The hooks we test are now the hooks we ship.** `copyHookScripts()` picked `dist/src/hooks/`
40
+ (the main `tsc` emit) while `test/logic.test.js` imported `dist/hooks/` (the dedicated
41
+ `tsconfig.hooks.json` build). Same sources, two compilations — free to diverge. Deployment now
42
+ prefers `dist/hooks/`, with `dist/src/hooks/` kept as a fallback for older installs. Verified
43
+ behaviourally identical (the two artifacts differed only by a `sourceMappingURL` comment).
44
+
45
+ ### Changed
46
+ - **`copyHookScripts()` extracted to `src/utils/hooks-deploy.ts`.** `init` and `update` each carried a
47
+ private copy that had already drifted: different candidate ordering, and only `init` warned when no
48
+ compiled hooks were found. One implementation now, and `init`'s unreachable "dev mode" branch —
49
+ which looked for `.ts` files in a compiled output directory — is gone.
50
+ - **`detectProjectName()` and template placeholder substitution moved to `src/utils/seed.ts`**, shared
51
+ by `init` and `update`.
52
+
53
+ ### Documentation
54
+ - README documents two rebuild traps: `prebuild` deletes `dist/` (which the global `openwolf` symlink
55
+ points into, so a failed build removes the CLI), and rebuilding the package deploys nothing — the
56
+ hooks that run are per-project copies, so `openwolf update` is required.
57
+
58
+ ## [1.9.1] — 2026-07-10
59
+
60
+ Backup retention — the ledger-growth fix (1.5.0) had a blind spot one layer up.
61
+
62
+ ### Fixed
63
+ - **`openwolf update` no longer copies `token-ledger.json` into its backup.** The ledger is capped by
64
+ *session count*, not bytes, so a mature project's ledger sits at a few MB — and every update snapshotted
65
+ it. Twelve updates in one afternoon left 38 MB of backups in a 41 MB `.wolf/`, of which ~30 MB were
66
+ redundant ledger copies. The ledger is regenerable telemetry: it is now excluded from `BACKUP_FILES`.
67
+ `restoreCommand()` reads the backup directory directly, so an excluded file is simply left untouched on
68
+ restore — rolling a project back no longer rolls back its usage telemetry either. Backups dropped from
69
+ 3.2 MB to 484 KB.
70
+ - **`createBackup()` now enforces `retention.backups_keep`.** `pruneBackups()` existed and knew the limit,
71
+ but was only ever called from `openwolf doctor` — so repeated updates accumulated snapshots indefinitely
72
+ and the limit only applied if you happened to run doctor. Pruning now runs immediately after each backup
73
+ is written. Oldest-first, so the snapshot just created always survives.
74
+
75
+ ### Notes
76
+ Together these took `orderflow/.wolf` from 41 MB → 9.0 MB with no loss of restorable state. The same class
77
+ of bug as 1.5.0's unbounded ledger: a bound that exists but is never enforced on the write path.
78
+
79
+ ## [1.9.0] — 2026-07-09
80
+
81
+ Dashboard & CLI quick wins — usability and self-diagnosis, verified headless (Chromium).
82
+
83
+ ### Added
84
+ - **Daemon-down banner (dashboard).** When the daemon is unreachable, panels used to render empty —
85
+ indistinguishable from a genuinely empty project. The dashboard now shows a dismissable warning
86
+ banner (with a "retry" button that re-fetches + reconnects) whenever the WebSocket is disconnected
87
+ after load. `useWolfData` exposes a `retry()` action for this.
88
+ - **Design QC image thumbnails + lightbox.** The Design QC panel showed only capture *filenames*.
89
+ It now renders each capture as a thumbnail grid; clicking one opens a full-size lightbox. Served by
90
+ a new path-safe, token-gated daemon route `GET /api/designqc/capture/:file` (with
91
+ `dotfiles: "allow"` — captures live under the `.wolf/` dotdir, which Express 5's `sendFile` ignores
92
+ by default).
93
+ - **`openwolf doctor` cross-project checks.** Doctor now reports registry health: **dead entries**
94
+ (registered project whose path no longer exists) and **dashboard-port collisions** (multiple
95
+ projects sharing a `dashboard.port`, whose daemons would collide). Exactly the failure modes that
96
+ bit a multi-project setup — now surfaced with the fix hint.
97
+
98
+ ### Fixed
99
+ - **Chart tooltips are theme-aware.** `TokenUsage` tooltips hard-coded dark colors (`#1a1a1a`), making
100
+ them unreadable in light mode. They now use the theme's CSS variables.
101
+
102
+ ### Notes
103
+ - Verified with a headless Chromium harness: Design QC thumbnails render and load, the lightbox opens,
104
+ and the daemon-down banner appears when the daemon is killed — with zero page/console errors. The
105
+ capture route returns `200 image/png`; path traversal (`../config.json`) is rejected. Doctor
106
+ correctly reports both a healthy 5-project registry and an injected port collision.
107
+
108
+ ## [1.8.0] — 2026-07-09
109
+
110
+ Dependency currency pass (dev + runtime majors) plus a latent file-watcher fix surfaced by the chokidar bump.
111
+
112
+ ### Fixed
113
+ - **File-watcher `ignored` never fired (latent since the chokidar 4 adoption).** chokidar 4+ dropped
114
+ glob-string support in the `ignored` option — a glob like `**/token-ledger.json` is treated as a
115
+ literal path and never matches, so the watcher was silently re-reading and broadcasting the full
116
+ contents of `token-ledger.json` / `buglog.json` / `*.tmp` / `*.lock` on every write — the exact
117
+ waste the ignore list was meant to prevent. Replaced the glob array with a `(path) => boolean`
118
+ predicate so the exclusions actually apply. Verified with an isolated chokidar test (glob strings
119
+ let `junk.tmp` and `token-ledger.json` through; the predicate correctly ignores them).
120
+
121
+ ### Changed
122
+ - **Dev-dependency majors:** TypeScript 5.9 → 7.0, Vite 6 → 8, `@vitejs/plugin-react` 4 → 6,
123
+ recharts 2 → 3, `@types/node` 22 → 26, `@tailwindcss/vite` → 4.3. Build (main + hooks +
124
+ dashboard) and the 8-test suite stay green.
125
+ - `tsconfig.hooks.json` now sets `"types": ["node"]` explicitly — TypeScript 7's `@types`
126
+ auto-discovery behaves differently for the hooks project's `rootDir: "src/hooks"`.
127
+ - **Runtime-dependency majors:** chokidar 4 → 5, commander 12 → 15, node-cron 3 → 4, open 10 → 11,
128
+ puppeteer-core 24 → 25. Smoke-tested: CLI (`--version`/`--help`) under commander 15, and the
129
+ daemon boots and serves HTTP with node-cron 4 (all cron tasks scheduled), chokidar 5 (watcher),
130
+ express 5, and ws.
131
+ - node-cron 4 moved `ScheduledTask` from a namespace (`cron.ScheduledTask`) to a named type
132
+ export — updated the import in `cron-engine.ts` accordingly.
133
+
134
+ ### Removed
135
+ - **`chalk`** — it was declared but never imported anywhere in `src/`; dropped rather than upgraded.
136
+ - **`@types/node-cron`** — node-cron 4 ships its own type definitions, so the separate `@types`
137
+ package is now redundant (and would conflict).
138
+
139
+ ### Notes
140
+ - Audit is unchanged at 0 vulnerabilities (`pnpm audit --prod`); these bumps are currency/maintenance.
141
+ - The Claude API call in `cron-engine.ts` was reviewed: `anthropic-version: 2023-06-01` is the current
142
+ stable API version header and `claude-haiku-4-5-20251001` is a current, active model ID — no change
143
+ needed.
144
+
145
+ ## [1.7.0] — 2026-07-09
146
+
147
+ Hardening and quality pass from the self-audit.
148
+
149
+ ### Added
150
+ - **File locking for the token ledger (M1).** The read-modify-write of `token-ledger.json` in the
151
+ stop hook and the cron token report is now wrapped in a best-effort advisory lock, so two
152
+ sessions ending at once (or a session plus the cron report) can't clobber each other. The lock
153
+ never blocks a hook for long — it waits up to ~1s, steals a stale lock (>5s), and proceeds
154
+ unlocked rather than risk a hook timeout. `.lock` files are ignored by the watcher and scanner.
155
+ - **Test suite.** `pnpm test` runs `node --test` over the core logic — retention/ledger caps,
156
+ buglog legacy-array migration + de-dup, the `.gitignore`/`.wolfignore` matcher, secret-file
157
+ detection, CRLF-tolerant anatomy parsing, and config/retention defaults (8 tests).
158
+
159
+ ### Security
160
+ - **`/api/switch` only accepts registered projects.** Previously any authenticated request could
161
+ point the daemon at an arbitrary directory containing a `.wolf/`; it now must match a project in
162
+ the registry.
163
+
164
+ ### Notes
165
+ - The package is npm-publish ready (`npm pack` ships only `dist/`, templates and license/docs) —
166
+ publishing under `openwolf-enhanced` would enable `npm i -g openwolf-enhanced`.
167
+
168
+ ## [1.6.1] — 2026-07-09
169
+
170
+ Security patch — resolves all advisories reported by `pnpm audit` (found in a self-audit).
171
+
172
+ ### Security
173
+ - **`ws` → 8.21.0** — fixes a high-severity memory-exhaustion DoS and a moderate uninitialized
174
+ memory disclosure in the WebSocket server (a direct, network-facing dependency).
175
+ - **`express` → 5.2.1** plus pinned overrides forcing patched transitive deps — `path-to-regexp`
176
+ (≥8.4.0, DoS/ReDoS on the HTTP router), `qs` (≥6.15.2, DoS in query parsing), and, for
177
+ cleanliness, `basic-ftp`/`ip-address` (via the optional `puppeteer-core` chain) and `uuid`
178
+ (via `node-cron`). `pnpm audit --prod` now reports **0 vulnerabilities**.
179
+
180
+ ### Fixed
181
+ - **AI API calls can no longer hang forever.** `runViaApi` now aborts after 120s (the old
182
+ `claude` subprocess path had a 120s timeout; `fetch` had none), so a stuck request can't
183
+ wedge a cron task.
184
+
185
+ ### Changed
186
+ - `pnpm build` runs end-to-end again (`allowBuilds: esbuild: true` in `pnpm-workspace.yaml`),
187
+ so the dashboard builds without a manual `pnpm rebuild esbuild`.
188
+
189
+ ## [1.6.0] — 2026-07-09
190
+
191
+ Completes upstream PR #4 — the larger dashboard sub-features, adapted to this fork's
192
+ authenticated, per-project dashboard.
193
+
194
+ ### Added
195
+ - **In-place project switcher (#4, bug 7).** A dropdown in the dashboard header lists your
196
+ registered projects and hot-swaps to one via `POST /api/switch` — the daemon stops and
197
+ restarts the cron engine and file watcher for the new project and broadcasts its state over
198
+ the existing WebSocket, with no process restart. The dashboard token is per-daemon, so an
199
+ authenticated session survives the switch. Verified: switching from project A to B swaps the
200
+ served project while the token keeps working.
201
+ - **Design QC works on deployed URLs and can be run from the dashboard (#4, bug 4).** A new
202
+ `detectDeployedUrl()` reads the target URL from `package.json` `homepage`, env files, or
203
+ `vercel.json`; a "Run Capture" button posts to `POST /api/designqc/run`; and the capture engine
204
+ now writes `designqc-report.json` so the panel shows the result.
205
+ - **AI Insights shows a copy-able prompt (#4, bug 2 client).** Since a background daemon can't
206
+ drive the interactive CLI, the panel offers a ready-to-paste prompt for a Claude Code session
207
+ instead of a button that opened the desktop app.
208
+
209
+ ### Changed
210
+ - **Honest status indicators (#4, bug 6).** The always-green "Healthy" sidebar badge is gone; the
211
+ header's "Live" indicator now reflects the real WebSocket connection (it can genuinely drop under
212
+ this fork's auth or during a project switch), and the overview uses the real cron `engine_status`.
213
+ - All new dashboard endpoints (`/api/projects`, `/api/switch`, `/api/designqc/run`, `/api/config`)
214
+ are behind the dashboard-token auth, and every new client call uses the authenticated fetch.
215
+
216
+ ## [1.5.0] — 2026-07-09
217
+
218
+ Adopts the core of upstream PR #4 (dashboard fixes by @MyEditHub), adapted to this fork's
219
+ authenticated dashboard.
220
+
221
+ ### Fixed
222
+ - **"Run Now" now works and gives feedback (#4).** The button posts to `/api/cron/run/:id`
223
+ (via the authenticated fetch — a plain fetch would 401 under this fork's dashboard auth); the
224
+ endpoint returns `202` and runs the task in the background, and a permanent failure is broadcast
225
+ as `task_error` so the UI shows the real error instead of resetting silently.
226
+ - **AI tasks no longer try to launch the desktop app (#4).** A background daemon can't drive the
227
+ interactive `claude` CLI; AI cron tasks now call the Anthropic API directly when
228
+ `ANTHROPIC_API_KEY` is set, and fail with a clear, actionable message when it isn't. Context
229
+ files are capped at 20 KB.
230
+ - **Cron execution log is written again (#4).** A partial `cron-state.json` (missing
231
+ `execution_log`) used to make every successful run look like a failure via an uncaught
232
+ `TypeError`; `readState` now merges stored state over complete defaults.
233
+ - **Token graph shows date *and* time (#4);** the token-comparison chart uses only real tracked
234
+ numbers (no fabricated "OpenClaw" bar), with honest labels, a transparent bar background and
235
+ readable tooltips.
236
+ - **`openwolf` binary keeps its execute bit (#4)** — `build` and a `postinstall` hook `chmod +x`
237
+ the CLI, which `tsc` otherwise strips on every build.
238
+
239
+ _Deferred to a follow-up: the larger sub-features of #4 — Design QC on deployed URLs, the
240
+ "Live"/health badge cleanup, and the in-place project switcher — which touch this fork's auth and
241
+ multi-project handling and warrant their own pass._
242
+
243
+ ## [1.4.0] — 2026-07-09
244
+
245
+ ### Added
246
+ - **`STATUS.md` — a session handoff document (#40 by @meketreve).** `openwolf init` now creates
247
+ `.wolf/STATUS.md` with sections for what's done (✅), the next quest (🚀), active architecture
248
+ (📁), pending items (⚠️) and useful commands (🔧). Reading it first when resuming a session
249
+ restores context in a single read instead of stitching it together from several files. The
250
+ protocol and rules instruct reading it first and updating it when a quest ends; the stop hook
251
+ nudges (once per session, via `additionalContext`) if it's missing or stale after real code
252
+ changes. `STATUS.md` is treated as user data — never overwritten by `update`, included in backups.
253
+
254
+ ## [1.3.1] — 2026-07-09
255
+
256
+ ### Changed
257
+ - **Stop-hook reminders no longer repeat every turn.** Each reminder type (missing buglog,
258
+ stale cerebrum, no memory summary) is now surfaced at most once per session — tracked in
259
+ `_session.json` — so it nudges once instead of re-firing on every turn.
260
+
261
+ ## [1.3.0] — 2026-07-09
262
+
263
+ Adopts a batch of upstream pull requests (never merged upstream), adapted to this fork.
264
+
265
+ ### Added
266
+ - **End-of-turn reminders now reach Claude (#55 by @JarrodAI).** The stop hook's reminders
267
+ (files edited 3+ times without a buglog entry, stale `cerebrum.md`, and — new — no
268
+ meaningful `memory.md` summary) were written to stderr, which Claude Code never surfaces to
269
+ the model. They're now emitted via the `additionalContext` stdout channel, so they actually
270
+ land in the next context window.
271
+ - **Dart support (#10 by @levnikmyskin).** `.dart` files are treated as code for token
272
+ estimation (description extraction already existed).
273
+
274
+ ### Changed
275
+ - **Hook entries are tagged `_managedBy: "openwolf"` (#32 by @mann1x).** `init`/`update` mark
276
+ the `.claude/settings.json` entries they own, so they can be cleanly replaced/removed even if
277
+ a user relocates the hook script — while leaving unrelated hooks untouched.
278
+
279
+ ### Fixed
280
+ - **`EPERM` on WSL2 9P + EFS (#33 by @WeathermanTony).** `init`/`update`/`restore` now copy
281
+ files with a `safeCopyFile` read+write shim instead of `fs.copyFileSync`, whose
282
+ `copy_file_range` fast path fails on WSL2 mounts under EFS-encrypted NTFS directories.
283
+
284
+ ## [1.2.1] — 2026-07-09
285
+
286
+ More adopted upstream bug fixes.
287
+
288
+ ### Fixed
289
+ - **`.gitignore` is now respected (#15 by @VimCommando).** Anatomy scanning and hook tracking
290
+ honor `.gitignore` in addition to `.wolfignore`, so build output / generated / ignored files
291
+ don't get indexed.
292
+ - **`init` no longer scaffolds `$HOME` (#20 by @shikyo13).** `findProjectRoot` stops at the home
293
+ directory, so a stray marker (`.git` / `package.json`) in `$HOME` can't make `openwolf init`
294
+ treat the whole home directory as a project.
295
+ - **Dashboard/daemon port collisions across projects (#20).** `init` bumps this project's ports
296
+ if another registered project already uses them.
297
+
298
+ _Note: #45 (buglog available for de-dup before fixing) is already covered — the OPENWOLF.md
299
+ protocol instructs reading `.wolf/buglog.json` before fixing, and the pre-write hook surfaces
300
+ similar past bugs._
301
+
302
+ ## [1.2.0] — 2026-07-09
303
+
304
+ Adopts a batch of security and correctness fixes that were reported/proposed upstream but
305
+ never merged (the upstream repo has been inactive since March 2026). Credit to the original
306
+ reporters and PR authors — issue/PR numbers refer to `cytostack/openwolf`.
307
+
308
+ ### Security
309
+ - **Dashboard is no longer network-exposed.** The daemon now binds to `127.0.0.1` by default
310
+ (was `0.0.0.0`) and requires a per-project token (`.wolf/dashboard-token`, `0600`) on every
311
+ `/api/*` request and WebSocket connection — WS is rejected pre-upgrade. This closes an
312
+ unauthenticated path to trigger arbitrary cron tasks. Token is threaded through
313
+ `openwolf dashboard` and `openwolf cron run`. Configurable via `openwolf.dashboard.host`.
314
+ (upstream #30 by @svanack404, #34 by @riverwolf67)
315
+ - **Command-injection surface removed.** All `execSync` string commands (PM2 start/stop/
316
+ restart/logs, port/pid lookups) are now `execFileSync` with argument arrays, and the PM2
317
+ process name derived from the project folder is sanitized. (upstream #34)
318
+ - **Path traversal blocked** in cron AI tasks: `context_files` that escape the project root
319
+ (e.g. `../../etc/passwd`) are rejected before being read into the model prompt. (upstream #34)
320
+
321
+ ### Fixed
322
+ - **CRLF data loss (#50 by @albertomenache; PRs #24 @fsener, #51).** `parseAnatomy` split on
323
+ `\n`, leaving a trailing `\r` that broke the end-anchored entry regex — on Windows/autocrlf
324
+ this dropped every entry and truncated `anatomy.md` to an empty skeleton. Now splits on
325
+ `\r?\n` in both copies.
326
+ - **Secret files captured into the brain (#54 by @bryandent).** Only `.env*` was excluded;
327
+ private keys, certs and keystores (`.pem`, `.key`, `.p8`, `.p12`, `.keystore`, `id_rsa`,
328
+ `credentials`, …) leaked their first ~100 chars into `anatomy.md`. Now excluded everywhere
329
+ (anatomy scan + post-write + post-read).
330
+ - **`bug search` crash on schema drift (#44 by @GordongWang).** `searchBugs` and the result
331
+ display are null-safe and handle entries that use a `files: string[]` array instead of a
332
+ singular `file`.
333
+ - **Repeated-read warning after edits (#41 by @1re2turn1).** `pre-read` now tracks file mtime
334
+ and doesn't warn "already read" when the file changed during the session — a re-read after
335
+ an edit is legitimate.
336
+ - **Files outside the project root (#56 by @goashem).** `post-write`/`post-read`/`pre-read` no
337
+ longer track absolute paths outside the project (`../` escapes) in anatomy/memory/ledger.
338
+
339
+ ## [1.1.0] — 2026-07-09
340
+
341
+ Based on upstream OpenWolf `1.0.4`. This release focuses on **bounded storage**,
342
+ **self-maintenance**, and **scoping** — the `.wolf/` directory no longer grows
343
+ without limit, and it can be kept healthy with a single command.
344
+
345
+ ### Added
346
+ - **`openwolf doctor`** — a daemon-independent command that reports the `.wolf/`
347
+ footprint and size warnings, then compacts everything: trims the token ledger,
348
+ consolidates old `memory.md` sessions, de-duplicates and caps `buglog.json`,
349
+ prunes old backups, rotates `daemon.log`, and clears stale `.tmp` files.
350
+ Use `--dry-run` to report without writing.
351
+ - **`.wolfignore`** — gitignore-style file at the project root that scopes both
352
+ anatomy scanning and hook tracking (dir names, path prefixes, `*.ext`, `**`).
353
+ - **`openwolf.retention` config block** — every storage limit is now tunable
354
+ (`token_ledger_max_sessions`, `session_io_max`, `buglog_max_entries`,
355
+ `backups_keep`, `memory_consolidate_after_days`, `memory_max_bytes`,
356
+ `daemon_log_max_bytes`).
357
+ - **`openwolf status`** now reports the `.wolf/` footprint, per-file sizes, and
358
+ warnings when a file exceeds its limit.
359
+ - Stop hook opportunistically consolidates `memory.md` when it exceeds
360
+ `memory_max_bytes`, so maintenance happens even without a running daemon.
361
+
362
+ ### Changed
363
+ - `openwolf update` now **deep-merges** `config.json` (user values win, new
364
+ default keys are added) instead of overwriting it — tuned settings survive.
365
+ - Large files are trimmed for dashboard delivery, and the file watcher no longer
366
+ re-reads/broadcasts `token-ledger.json` / `buglog.json` on every write.
367
+
368
+ ### Fixed
369
+ - **Unbounded `token-ledger.json` growth.** `sessions[]` (each embedding full
370
+ `reads[]`/`writes[]`) and `waste_flags[]` were never trimmed, so the ledger
371
+ could grow into the tens of megabytes and make the stop hook's full-file
372
+ rewrite quadratic. Now bounded by `openwolf.retention`.
373
+ - **Unbounded `buglog.json` growth and over-eager auto-detection.** The
374
+ "significant diff" catch-all logged nearly every real refactor as a bug; the
375
+ de-dup window was too short; IDs could collide after trimming. The catch-all
376
+ was removed, the window widened, IDs are derived from the max existing ID, and
377
+ the log is capped.
378
+ - **`anatomy.md` full rewrite on every write.** It is now skipped when a file's
379
+ entry is unchanged, and the edited file is read only once per write.
380
+ - **Legacy bare-array `buglog.json`** (`[...]` instead of `{ version, bugs }`) is
381
+ now read tolerantly and migrated on write without data loss — previously it
382
+ could crash the pre-write hook and silently disabled auto-detection.
383
+
384
+ ### Notes
385
+ - The CLI command remains `openwolf`, so this is a drop-in replacement.
386
+ - License unchanged: **AGPL-3.0**. See `LICENSE` and `NOTICE`.