human-hindsight 1.8.1 → 1.8.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 (3) hide show
  1. package/README.md +67 -25
  2. package/dist/cli.js +293 -167
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -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`.
@@ -129,7 +141,8 @@ npx human-hindsight@latest copy <slug> # → clipboard, paste into a fre
129
141
  npx human-hindsight@latest edit <slug> # open in $EDITOR; your edits are protected
130
142
  npx human-hindsight@latest rate <slug> up # record a verdict (up|down)
131
143
  npx human-hindsight@latest prune # remove orphaned entries (asks first)
132
- npx human-hindsight@latest preferences # → CLAUDE.md block
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
133
146
  npx human-hindsight@latest status # pipeline funnel + orphan/skip flags
134
147
  npx human-hindsight@latest retention # optional: preview longer local retention
135
148
  ```
@@ -152,47 +165,69 @@ Switch between **Prompts** and **Preferences** to search, filter by domain,
152
165
  sort, and copy items with one click. Preferences are deduplicated across tasks
153
166
  and can be sorted by frequency, recency, or text. Search also matches their
154
167
  evidence and source prompt titles.
155
- Domain filters start with broad categories and reveal optional subdomains,
156
- up to five levels deep. Selecting a parent includes all its descendants.
168
+ One expandable domain tree lets you browse from broad categories down to
169
+ five levels. Select a parent to include its descendants, or expand its arrow
170
+ to choose a child. Prompt details show shared ancestry once; open **+N** to
171
+ see the full grouped hierarchy. Domain labels from the same evidence are
172
+ deduplicated regardless of casing.
157
173
  Existing flat labels are grouped locally without changing the library or
158
174
  making a model call; newly distilled sessions use hierarchical domain paths.
159
175
  **Preview** renders Markdown headings, lists, tables, links, blockquotes, task
160
176
  lists, and code blocks. **Markdown** shows the original source. Copy always
161
177
  uses that original Markdown, including when the preview is selected.
162
178
 
163
- Each prompt links to its observed preferences; each preference shows its
164
- evidence and links back to the source prompts. You can bookmark either view
165
- and use your browser's Back and Forward buttons. **View all preferences**
166
- opens a combined Markdown block ready to copy into `CLAUDE.md` or `AGENTS.md`.
167
-
168
- The tips bar starts with an open-source and privacy reminder, then rotates
169
- through quick tips with copyable `npx human-hindsight@latest` commands.
170
- Pause it, hide it, or restore it with **Show tips**. Hidden tips stay hidden
171
- when you reload the same local address.
179
+ Each prompt links to its preference candidates. Newly distilled candidates
180
+ show exact human quotations, message references, and global/project/task scope;
181
+ older observations are labeled for review. Open the collapsed **Source evidence**
182
+ section to see quotations. Use the check, pencil, and dismiss icons to review
183
+ a candidate; each control has an accessible label and hover description.
184
+ Candidates can come from failed or unfinished sessions too. You can bookmark
185
+ either view and use your browser's Back and Forward buttons. **All** shows
186
+ observations; **Accepted** provides the reviewed instruction block for `CLAUDE.md`
187
+ or `AGENTS.md`. Changed source evidence returns a candidate to review.
188
+
189
+ The terminal `preferences` command also exports accepted rules by default.
190
+ Use `--include-unreviewed` explicitly to inspect draft observations in scripts.
191
+ This flag does not accept them or change their review status.
192
+
193
+ A compact tip card sits in the header and flips through quick suggestions.
194
+ Open it to read the explanation, copy a `npx human-hindsight@latest` command,
195
+ or pause or hide tips. The lightbulb restores hidden tips. Rotation pauses
196
+ while you interact, and reduced-motion settings disable the flip animation.
197
+ Hidden tips stay hidden when you reload the same local address.
172
198
 
173
199
  Export and distill show an open-source/privacy reminder near the start.
174
200
  Interactive terminals get a colorful elapsed-time progress indicator during
175
201
  scanning, export, and model work; redirected output stays free of animation.
176
202
 
177
203
  Consolidation is optional: `npx human-hindsight@latest preferences --consolidate`
178
- uses one call through your own coding harness and its configured provider,
204
+ uses your accepted rules in a call through your own coding harness and its configured provider,
179
205
  with consent and the subscription/credit cost explained first. Successful
180
206
  results are saved, with their Markdown and input metadata, in
181
- `<home>/library/preferences.consolidated.json`. Refresh the GUI to open
182
- **Saved consolidation**. It flags results whose observed preferences have
183
- changed. Failed or declined calls leave the last saved result intact.
207
+ `<home>/library/preferences.consolidated.json`. Reload the browser and select
208
+ **Saved** to open the consolidation. Every output rule links to its input preferences.
209
+ Coverage, scope, explicit conditions, and direct contradictions are checked;
210
+ invalid output gets one semantic correction attempt. Failed, empty, incomplete,
211
+ or declined results leave the last saved result intact. Saved results are
212
+ flagged when the selected inputs or their review status change. Legacy saved
213
+ results remain readable and need regeneration before copying as reviewed
214
+ instructions.
184
215
 
185
216
  The viewer uses a minimal black-and-white palette and system monospace fonts.
186
- Light and dark appearance follow your system setting. Local edits, ratings,
187
- and session counts remain visible. Use **Refresh** after changing files and
188
- press `/` to focus search.
217
+ Light and dark appearance follow your system setting. Rows emphasize titles;
218
+ session counts remain visible, and the information icon reveals dates,
219
+ confidence, local edits, and ratings. Reload the browser after changing files
220
+ and press `/` to focus search.
189
221
 
190
222
  The GUI uses Node's built-in HTTP server and bundled HTML/CSS/JavaScript:
191
223
  no frontend framework, database, font download, or external assets.
192
224
  Markdown parsing and sanitization ship inside the bundle. Raw HTML stays
193
225
  inert and remote images are represented by their alt text, without fetching them.
194
- It listens only on `127.0.0.1`, serves a read-only library API, and stops with
195
- Ctrl+C. The GUI doesn't invoke an agent or modify your library.
226
+ It listens only on `127.0.0.1` and stops with Ctrl+C. Browsing stays read-only.
227
+ The single write action saves an explicit preference review to
228
+ `library/preferences.review.json`; it requires the current browser session's
229
+ token, matching origin, and a current candidate revision. The GUI never invokes
230
+ an agent, edits source history, or writes an instruction file for you.
196
231
 
197
232
  ### Multiple backends (Claude Code + Codex + Kiro + OpenCode)
198
233
 
@@ -246,7 +281,13 @@ source defaults to `AGENTS.md`. The Codex runner uses `codex exec` with a JSON
246
281
  schema, a read-only sandbox, and ephemeral sessions; generated distill sessions
247
282
  do not become new source history. Claude supports current `structured_output`
248
283
  results as well as legacy `result` objects/strings and verbose event arrays.
249
- It disables session persistence when the installed CLI advertises the flag.
284
+ The Claude runner requires current isolation controls, including `--safe-mode`.
285
+ It runs from a private directory, disables tools, hooks, skills, and ambient
286
+ MCP configuration, supplies a dedicated system instruction, and disables session
287
+ persistence. Unsupported CLIs fail before any model call with an upgrade hint
288
+ or the option to choose another runner. Updating Human Hindsight does not update
289
+ Claude Code. Organization-managed policy remains authoritative; these controls
290
+ do not override administrator policy or constitute an operating-system sandbox.
250
291
 
251
292
  ### OpenCode 1 and 2
252
293
 
@@ -352,7 +393,7 @@ product:
352
393
  in the repository's `package-lock.json`, which is not published. Bundled
353
394
  libraries include citty, Zod, Clack, smol-toml, jsonc-parser, Marked, and
354
395
  DOMPurify; their license texts ship in `dist/THIRD_PARTY_NOTICES.txt`.
355
- - **Consent-gated LLM use.** `distill` states the exact invocation count and
396
+ - **Consent-gated LLM use.** `distill` states its estimated invocation count and
356
397
  waits for `[y/N]` before anything runs on your subscription/credits.
357
398
  `--dry-run` shows the full plan for free. If you decline, it exits without
358
399
  invoking anything (exit code 2).
@@ -431,10 +472,11 @@ chosen local agent CLI to its configured provider, using its authentication.
431
472
 
432
473
  **What does distill cost?**
433
474
  Whatever your chosen agent CLI costs you: it runs on your existing subscription or
434
- API credits. The consent prompt states the exact invocation count up front
475
+ API credits. The consent prompt estimates the invocation count up front
435
476
  (one call per session digested, one to cluster, one per task authored), and
436
477
  `--dry-run` prints the same plan without running anything. Checkpoints mean an
437
- interrupted run isn't wasted money. Sessions too large for the input budget
478
+ interrupted run can reuse completed work. Retries and windowed grouping may add
479
+ calls. Sessions too large for the input budget
438
480
  (default 400k chars, `--input-budget`) are **refused before anything is
439
481
  spent**. Re-run with `--truncate=extreme` to cut them (recorded in
440
482
  provenance) or narrow the scope. Digest and author calls run 3 at a time by