human-hindsight 1.8.0 → 1.8.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/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  </p>
14
14
 
15
15
  ```bash
16
- npx human-hindsight
16
+ npx human-hindsight@latest
17
17
  ```
18
18
 
19
19
  Human Hindsight mines your coding-agent session history (Claude Code, Codex, Kiro, OpenCode)
@@ -44,6 +44,18 @@ No data move or re-distillation is required. Data-directory precedence is:
44
44
  a fresh installation. If both directories exist, the new one wins; use
45
45
  `--home` to choose explicitly. Directories are never merged automatically.
46
46
 
47
+ In 1.8.2, existing preferences remain visible as **candidates**. Open the
48
+ Preferences tab, check the evidence and scope, then **Accept**, **Edit**, or
49
+ **Dismiss** each candidate. **Accepted instructions** builds a block from
50
+ accepted global rules, with an optional project selection. Task-only choices
51
+ stay out of standing instruction files. Reviews are saved in your library and
52
+ survive browser restarts.
53
+
54
+ Re-running `distill` refreshes results whose source content, prompt version,
55
+ runner/model selection, or grouping mode changed. Older checkpoints are refreshed
56
+ once because they have no input fingerprints. Hand-edited prompts are preserved;
57
+ `--force` explicitly allows replacing them.
58
+
47
59
  Updating the old npm package installs the small compatibility wrapper, so
48
60
  `npx cc-hindsight@latest gui` also works. Both global commands can coexist:
49
61
  the main package owns `human-hindsight`, and the wrapper owns `cc-hindsight`.
@@ -106,7 +118,7 @@ Use `--no-follow-up` for one command at a time; pipes, dry runs, and scripted
106
118
  You can also start directly with distillation:
107
119
 
108
120
  ```bash
109
- npx human-hindsight distill # offers to export first, then digest → cluster →
121
+ npx human-hindsight@latest distill # offers to export first, then digest → cluster →
110
122
  # author (asks before any runner call), then shows
111
123
  # offers the finished library in your browser
112
124
  ```
@@ -114,24 +126,25 @@ npx human-hindsight distill # offers to export first, then digest → cluster
114
126
  Prefer to drive each stage yourself? The pipeline is just three verbs:
115
127
 
116
128
  ```bash
117
- npx human-hindsight # 1. scan: inventory your projects (read-only)
118
- npx human-hindsight export # 2. export: human-only markdown per session
119
- npx human-hindsight distill # 3. distill: digest → cluster → author (asks first)
129
+ npx human-hindsight@latest # 1. scan: inventory your projects (read-only)
130
+ npx human-hindsight@latest export # 2. export: human-only markdown per session
131
+ npx human-hindsight@latest distill # 3. distill: digest → cluster → author (asks first)
120
132
  ```
121
133
 
122
134
  Then browse and curate the results:
123
135
 
124
136
  ```bash
125
- npx human-hindsight list # your library (✎ edited / ▲▼ rating badges)
126
- npx human-hindsight gui # browse, search, and copy in your browser
127
- npx human-hindsight show <slug> # read a oneshot
128
- npx human-hindsight copy <slug> # → clipboard, paste into a fresh session
129
- npx human-hindsight edit <slug> # open in $EDITOR; your edits are protected
130
- npx human-hindsight rate <slug> up # record a verdict (up|down)
131
- npx human-hindsight prune # remove orphaned entries (asks first)
132
- npx human-hindsight preferences # → CLAUDE.md block
133
- npx human-hindsight status # pipeline funnel + orphan/skip flags
134
- npx human-hindsight retention # optional: preview longer local retention
137
+ npx human-hindsight@latest list # your library (✎ edited / ▲▼ rating badges)
138
+ npx human-hindsight@latest gui # browse, search, and copy in your browser
139
+ npx human-hindsight@latest show <slug> # read a oneshot
140
+ npx human-hindsight@latest copy <slug> # → clipboard, paste into a fresh session
141
+ npx human-hindsight@latest edit <slug> # open in $EDITOR; your edits are protected
142
+ npx human-hindsight@latest rate <slug> up # record a verdict (up|down)
143
+ npx human-hindsight@latest prune # remove orphaned entries (asks first)
144
+ npx human-hindsight@latest preferences # accepted global rules → CLAUDE.md
145
+ npx human-hindsight@latest preferences --project my-app # include this project's accepted rules
146
+ npx human-hindsight@latest status # pipeline funnel + orphan/skip flags
147
+ npx human-hindsight@latest retention # optional: preview longer local retention
135
148
  ```
136
149
 
137
150
  Requires Node 22.13+ on Node 22, or Node 23.4+ on newer releases, on macOS or Linux (Windows is untested and currently
@@ -142,17 +155,58 @@ with a consent prompt (or your explicit `--yes`).
142
155
  ### A small local library viewer
143
156
 
144
157
  ```bash
145
- npx human-hindsight gui # start locally and open your browser
146
- npx human-hindsight gui --no-open # print the address without opening it
147
- npx human-hindsight gui --port 3210 # choose a port (default: any available port)
148
- npx human-hindsight gui --home /path/to/library-home
158
+ npx human-hindsight@latest gui # start locally and open your browser
159
+ npx human-hindsight@latest gui --no-open # print the address without opening it
160
+ npx human-hindsight@latest gui --port 3210 # choose a port (default: any available port)
161
+ npx human-hindsight@latest gui --home /path/to/library-home
149
162
  ```
150
163
 
151
- Search titles and text, filter by domain, sort, and copy prompts with one click.
164
+ Switch between **Prompts** and **Preferences** to search, filter by domain,
165
+ sort, and copy items with one click. Preferences are deduplicated across tasks
166
+ and can be sorted by frequency, recency, or text. Search also matches their
167
+ evidence and source prompt titles.
168
+ Domain filters start with broad categories and reveal optional subdomains,
169
+ up to five levels deep. Selecting a parent includes all its descendants.
170
+ Existing flat labels are grouped locally without changing the library or
171
+ making a model call; newly distilled sessions use hierarchical domain paths.
152
172
  **Preview** renders Markdown headings, lists, tables, links, blockquotes, task
153
173
  lists, and code blocks. **Markdown** shows the original source. Copy always
154
174
  uses that original Markdown, including when the preview is selected.
155
175
 
176
+ Each prompt links to its preference candidates. Newly distilled candidates
177
+ show exact human quotations, message references, and global/project/task scope;
178
+ older observations are labeled for review. Candidates can come from failed or
179
+ unfinished sessions too. You can bookmark either view and use your browser's
180
+ Back and Forward buttons. **View all candidates** shows observations;
181
+ **Accepted instructions** provides the reviewed block for `CLAUDE.md` or
182
+ `AGENTS.md`. Changed source evidence returns a candidate to review.
183
+
184
+ The terminal `preferences` command also exports accepted rules by default.
185
+ Use `--include-unreviewed` explicitly to inspect draft observations in scripts.
186
+ This flag does not accept them or change their review status.
187
+
188
+ The tips bar starts with an open-source and privacy reminder, then rotates
189
+ through quick tips with copyable `npx human-hindsight@latest` commands.
190
+ Pause it, hide it, or restore it with **Show tips**. Hidden tips stay hidden
191
+ when you reload the same local address.
192
+
193
+ Export and distill show an open-source/privacy reminder near the start.
194
+ Interactive terminals get a colorful elapsed-time progress indicator during
195
+ scanning, export, and model work; redirected output stays free of animation.
196
+
197
+ Consolidation is optional: `npx human-hindsight@latest preferences --consolidate`
198
+ uses your accepted rules in a call through your own coding harness and its configured provider,
199
+ with consent and the subscription/credit cost explained first. Successful
200
+ results are saved, with their Markdown and input metadata, in
201
+ `<home>/library/preferences.consolidated.json`. Refresh the GUI to open
202
+ **Saved consolidation**. Every output rule links to its input preferences.
203
+ Coverage, scope, explicit conditions, and direct contradictions are checked;
204
+ invalid output gets one semantic correction attempt. Failed, empty, incomplete,
205
+ or declined results leave the last saved result intact. Saved results are
206
+ flagged when the selected inputs or their review status change. Legacy saved
207
+ results remain readable and need regeneration before copying as reviewed
208
+ instructions.
209
+
156
210
  The viewer uses a minimal black-and-white palette and system monospace fonts.
157
211
  Light and dark appearance follow your system setting. Local edits, ratings,
158
212
  and session counts remain visible. Use **Refresh** after changing files and
@@ -162,8 +216,11 @@ The GUI uses Node's built-in HTTP server and bundled HTML/CSS/JavaScript:
162
216
  no frontend framework, database, font download, or external assets.
163
217
  Markdown parsing and sanitization ship inside the bundle. Raw HTML stays
164
218
  inert and remote images are represented by their alt text, without fetching them.
165
- It listens only on `127.0.0.1`, serves a read-only library API, and stops with
166
- Ctrl+C. The GUI doesn't invoke an agent or modify your library.
219
+ It listens only on `127.0.0.1` and stops with Ctrl+C. Browsing stays read-only.
220
+ The single write action saves an explicit preference review to
221
+ `library/preferences.review.json`; it requires the current browser session's
222
+ token, matching origin, and a current candidate revision. The GUI never invokes
223
+ an agent, edits source history, or writes an instruction file for you.
167
224
 
168
225
  ### Multiple backends (Claude Code + Codex + Kiro + OpenCode)
169
226
 
@@ -201,14 +258,14 @@ then falls back in the order Claude → Codex → Kiro → OpenCode. Models are
201
258
  with `--model`; without it, the chosen CLI uses its configured default.
202
259
 
203
260
  ```bash
204
- npx human-hindsight export --source codex
205
- npx human-hindsight distill --source codex --runner codex
206
- npx human-hindsight distill --source claude --runner codex
207
- npx human-hindsight preferences --target codex # AGENTS.md; alias of --target agents
208
- npx human-hindsight export --source opencode
209
- npx human-hindsight distill --source opencode --runner opencode
210
- npx human-hindsight distill --source claude --runner opencode --model provider/model
211
- npx human-hindsight preferences --target opencode # AGENTS.md
261
+ npx human-hindsight@latest export --source codex
262
+ npx human-hindsight@latest distill --source codex --runner codex
263
+ npx human-hindsight@latest distill --source claude --runner codex
264
+ npx human-hindsight@latest preferences --target codex # AGENTS.md; alias of --target agents
265
+ npx human-hindsight@latest export --source opencode
266
+ npx human-hindsight@latest distill --source opencode --runner opencode
267
+ npx human-hindsight@latest distill --source claude --runner opencode --model provider/model
268
+ npx human-hindsight@latest preferences --target opencode # AGENTS.md
212
269
  ```
213
270
 
214
271
  `preferences --target claude|codex|kiro|opencode|agents` emits a `CLAUDE.md` block,
@@ -217,7 +274,13 @@ source defaults to `AGENTS.md`. The Codex runner uses `codex exec` with a JSON
217
274
  schema, a read-only sandbox, and ephemeral sessions; generated distill sessions
218
275
  do not become new source history. Claude supports current `structured_output`
219
276
  results as well as legacy `result` objects/strings and verbose event arrays.
220
- It disables session persistence when the installed CLI advertises the flag.
277
+ The Claude runner requires current isolation controls, including `--safe-mode`.
278
+ It runs from a private directory, disables tools, hooks, skills, and ambient
279
+ MCP configuration, supplies a dedicated system instruction, and disables session
280
+ persistence. Unsupported CLIs fail before any model call with an upgrade hint
281
+ or the option to choose another runner. Updating Human Hindsight does not update
282
+ Claude Code. Organization-managed policy remains authoritative; these controls
283
+ do not override administrator policy or constitute an operating-system sandbox.
221
284
 
222
285
  ### OpenCode 1 and 2
223
286
 
@@ -258,10 +321,10 @@ OpenCode preferences can go into the project's `AGENTS.md`, or the global
258
321
  ### Optional: keep more local history
259
322
 
260
323
  ```bash
261
- npx human-hindsight retention # read-only preview
262
- npx human-hindsight retention --apply # preview, then confirm
263
- npx human-hindsight retention --apply --yes # explicit opt-in for scripting
264
- npx human-hindsight retention --source codex --apply
324
+ npx human-hindsight@latest retention # read-only preview
325
+ npx human-hindsight@latest retention --apply # preview, then confirm
326
+ npx human-hindsight@latest retention --apply --yes # explicit opt-in for scripting
327
+ npx human-hindsight@latest retention --source codex --apply
265
328
  ```
266
329
 
267
330
  The default reviews existing tool directories. An explicit `--source` can
@@ -323,7 +386,7 @@ product:
323
386
  in the repository's `package-lock.json`, which is not published. Bundled
324
387
  libraries include citty, Zod, Clack, smol-toml, jsonc-parser, Marked, and
325
388
  DOMPurify; their license texts ship in `dist/THIRD_PARTY_NOTICES.txt`.
326
- - **Consent-gated LLM use.** `distill` states the exact invocation count and
389
+ - **Consent-gated LLM use.** `distill` states its estimated invocation count and
327
390
  waits for `[y/N]` before anything runs on your subscription/credits.
328
391
  `--dry-run` shows the full plan for free. If you decline, it exits without
329
392
  invoking anything (exit code 2).
@@ -402,10 +465,11 @@ chosen local agent CLI to its configured provider, using its authentication.
402
465
 
403
466
  **What does distill cost?**
404
467
  Whatever your chosen agent CLI costs you: it runs on your existing subscription or
405
- API credits. The consent prompt states the exact invocation count up front
468
+ API credits. The consent prompt estimates the invocation count up front
406
469
  (one call per session digested, one to cluster, one per task authored), and
407
470
  `--dry-run` prints the same plan without running anything. Checkpoints mean an
408
- interrupted run isn't wasted money. Sessions too large for the input budget
471
+ interrupted run can reuse completed work. Retries and windowed grouping may add
472
+ calls. Sessions too large for the input budget
409
473
  (default 400k chars, `--input-budget`) are **refused before anything is
410
474
  spent**. Re-run with `--truncate=extreme` to cut them (recorded in
411
475
  provenance) or narrow the scope. Digest and author calls run 3 at a time by
@@ -1,140 +1,6 @@
1
1
  Human Hindsight includes the following open-source libraries.
2
2
 
3
3
 
4
- ========================================================================
5
- @clack/prompts@1.7.0 — MIT
6
-
7
- MIT License
8
-
9
- MIT License Copyright (c) 2025-Present [Bombshell contributors](https://bomb.sh/team)
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
-
17
-
18
- ========================================================================
19
- @clack/core@1.4.3 — MIT
20
-
21
- MIT License
22
-
23
- MIT License Copyright (c) 2025-Present [Bombshell contributors](https://bomb.sh/team)
24
-
25
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
26
-
27
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
28
-
29
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30
-
31
-
32
- ========================================================================
33
- fast-wrap-ansi@0.2.2 — MIT
34
-
35
- MIT License
36
-
37
- Copyright (c) 2025 James Garbutt
38
-
39
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
40
-
41
- Permission is hereby granted, free of charge, to any person obtaining a copy
42
- of this software and associated documentation files (the "Software"), to deal
43
- in the Software without restriction, including without limitation the rights
44
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
45
- copies of the Software, and to permit persons to whom the Software is
46
- furnished to do so, subject to the following conditions:
47
-
48
- The above copyright notice and this permission notice shall be included in all
49
- copies or substantial portions of the Software.
50
-
51
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
54
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
56
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
57
- SOFTWARE.
58
-
59
-
60
- ========================================================================
61
- fast-string-width@3.0.2 — MIT
62
-
63
- The MIT License (MIT)
64
-
65
- Copyright (c) 2024-present Fabio Spampinato
66
-
67
- Permission is hereby granted, free of charge, to any person obtaining a
68
- copy of this software and associated documentation files (the "Software"),
69
- to deal in the Software without restriction, including without limitation
70
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
71
- and/or sell copies of the Software, and to permit persons to whom the
72
- Software is furnished to do so, subject to the following conditions:
73
-
74
- The above copyright notice and this permission notice shall be included in
75
- all copies or substantial portions of the Software.
76
-
77
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
78
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
79
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
80
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
81
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
82
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
83
- DEALINGS IN THE SOFTWARE.
84
-
85
-
86
- ========================================================================
87
- fast-string-truncated-width@3.0.3 — MIT
88
-
89
- The MIT License (MIT)
90
-
91
- Copyright (c) 2024-present Fabio Spampinato
92
-
93
- Permission is hereby granted, free of charge, to any person obtaining a
94
- copy of this software and associated documentation files (the "Software"),
95
- to deal in the Software without restriction, including without limitation
96
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
97
- and/or sell copies of the Software, and to permit persons to whom the
98
- Software is furnished to do so, subject to the following conditions:
99
-
100
- The above copyright notice and this permission notice shall be included in
101
- all copies or substantial portions of the Software.
102
-
103
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
104
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
105
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
106
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
107
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
108
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
109
- DEALINGS IN THE SOFTWARE.
110
-
111
-
112
- ========================================================================
113
- sisteransi@1.0.5 — MIT
114
-
115
- MIT License
116
-
117
- Copyright (c) 2018 Terkel Gjervig Nielsen
118
-
119
- Permission is hereby granted, free of charge, to any person obtaining a copy
120
- of this software and associated documentation files (the "Software"), to deal
121
- in the Software without restriction, including without limitation the rights
122
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
123
- copies of the Software, and to permit persons to whom the Software is
124
- furnished to do so, subject to the following conditions:
125
-
126
- The above copyright notice and this permission notice shall be included in all
127
- copies or substantial portions of the Software.
128
-
129
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
130
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
131
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
132
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
133
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
134
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
135
- SOFTWARE.
136
-
137
-
138
4
  ========================================================================
139
5
  citty@0.2.2 — MIT
140
6