@vectorize-io/hindsight-coding-agents 0.6.0 → 0.7.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.
Files changed (50) hide show
  1. package/README.md +179 -40
  2. package/dist/antigravity-hook.js +344 -169
  3. package/dist/antigravity-statusline.js +117 -4
  4. package/dist/antigravity-stop-hook.js +262 -113
  5. package/dist/claude-hook.js +344 -169
  6. package/dist/claude-sessionstart-hook.js +348 -136
  7. package/dist/claude-stop-hook.js +262 -113
  8. package/dist/cline.js +494 -184
  9. package/dist/codex-hook.js +344 -169
  10. package/dist/codex-sessionstart-hook.js +348 -136
  11. package/dist/codex-stop-hook.js +262 -113
  12. package/dist/copilot-hook.js +344 -169
  13. package/dist/copilot-sessionstart-hook.js +348 -136
  14. package/dist/copilot-stop-hook.js +262 -113
  15. package/dist/cursor-hook.js +344 -169
  16. package/dist/cursor-sessionstart-hook.js +348 -136
  17. package/dist/cursor-stop-hook.js +262 -113
  18. package/dist/daemon-start.js +116 -4
  19. package/dist/dcode-hook.js +344 -169
  20. package/dist/dcode-sessionstart-hook.js +348 -136
  21. package/dist/dcode-stop-hook.js +262 -113
  22. package/dist/deepen.js +204 -47
  23. package/dist/devin-hook.js +344 -169
  24. package/dist/devin-sessionstart-hook.js +348 -136
  25. package/dist/devin-stop-hook.js +262 -113
  26. package/dist/droid-hook.js +344 -169
  27. package/dist/droid-sessionstart-hook.js +348 -136
  28. package/dist/droid-stop-hook.js +262 -113
  29. package/dist/dsh.js +494 -184
  30. package/dist/grok-hook.js +344 -169
  31. package/dist/grok-sessionstart-hook.js +348 -136
  32. package/dist/grok-stop-hook.js +262 -113
  33. package/dist/hindsight-seed.js +116 -4
  34. package/dist/index.js +494 -184
  35. package/dist/installer.js +92 -70
  36. package/dist/kilo.js +494 -184
  37. package/dist/mcp-server.js +230 -57
  38. package/dist/opencode2.js +521 -184
  39. package/dist/pi.js +495 -186
  40. package/dist/prime-agent.js +495 -186
  41. package/dist/qwen-hook.js +344 -169
  42. package/dist/qwen-sessionstart-hook.js +348 -136
  43. package/dist/qwen-stop-hook.js +262 -113
  44. package/dist/status.js +203 -47
  45. package/dist/zcode-hook.js +344 -169
  46. package/dist/zcode-sessionstart-hook.js +348 -136
  47. package/dist/zcode-stop-hook.js +262 -113
  48. package/package.json +2 -2
  49. package/plugin.json +1 -1
  50. package/skill/SKILL.md +173 -39
package/README.md CHANGED
@@ -12,6 +12,8 @@ tie-break policy. Those decisions live in git history and past conversations. Th
12
12
  in front of the agent at the moment it starts working, and keeps a curated set of **knowledge pages**
13
13
  (architecture, conventions, in-flight initiatives) that future sessions start from.
14
14
 
15
+ <!-- figure: coding-agents -->
16
+
15
17
  [View Changelog →](https://hindsight.vectorize.io/changelog/integrations/coding-agents)
16
18
 
17
19
  ## Install
@@ -98,7 +100,7 @@ A plugin entry in `~/.config/opencode/opencode.json` — native tools, no MCP ne
98
100
  npx @vectorize-io/hindsight-coding-agents install opencode2
99
101
  ```
100
102
 
101
- opencode v2 (`npm @opencode-ai/cli@beta`) installs its `opencode2` binary **alongside** v1 and
103
+ opencode v2 (`npm @opencode/cli`) exposes an `opencode2` binary alias **alongside** `opencode` and
102
104
  rewrote the plugin API, so it is a harness of its own. It writes the same plugin entry to the same
103
105
  `~/.config/opencode/opencode.json` — the two CLIs share that file, and v1 rejects the whole config
104
106
  if it sees v2's `plugins` key — and each CLI then loads its own entry point from the one registered
@@ -107,7 +109,9 @@ path. So installing either harness wires both, and uninstalling either removes t
107
109
  Two differences from v1, both because of the host: the one-time codebase survey runs under another
108
110
  installed agent's CLI (v2 plugins cannot define the read-only agent the survey needs), and the seed
109
111
  banner is written to the plugin log instead of a TUI toast (v2 plugins cannot raise one). Recall,
110
- injection, the native `hindsight_*` tools and session write-back are identical.
112
+ injection, the native `hindsight_*` tools and session write-back are identical. The companion skill
113
+ is identical too, but it is registered in memory through v2's skill API rather than copied into a
114
+ skills directory — opencode2 has none of its own, and the two it reads belong to other agents.
111
115
 
112
116
  #### <img src="https://hindsight.vectorize.io/img/harness/kilo.svg" alt="" width="20" height="20" /> Kilo CLI
113
117
 
@@ -261,7 +265,9 @@ resolved per session workspace rather than once per process; and dsh has no plug
261
265
  channel, so the seed line goes to the plugin log rather than the UI. Everything model-facing —
262
266
  recalled memory, the knowledge preamble, the `hindsight_*` tools — is unaffected. If you prefer the
263
267
  published-package route, `dsh plugin --profile web add @vectorize-io/hindsight-coding-agents` works
264
- too: the package ships the profile patch layer, so nothing else needs editing.
268
+ too: the package ships the profile patch layer, so nothing else needs editing. Either route gets the
269
+ companion skill — a plugin wired by the host's own plugin manager installs it itself on the first
270
+ session, since that route never runs our installer.
265
271
 
266
272
  Uninstall the same way: `npx @vectorize-io/hindsight-coding-agents uninstall claude-code` (or `uninstall all`).
267
273
 
@@ -507,42 +513,48 @@ hook by Codex...), so one shared config serves several agents side by side:
507
513
 
508
514
  ### Reference
509
515
 
510
- | field | default | meaning |
511
- | ----------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
512
- | `apiUrl` | `https://api.hindsight.vectorize.io` | Hindsight API base URL (set to `http://localhost:8888` for a local server) |
513
- | `apiToken` | — | bearer token (Hindsight Cloud). Picked up without restarting the agent: a long-lived host re-reads it after a rejected request, so enabling auth or rotating the key mid-session recovers on the next call |
514
- | `bankId` | — | **explicit static bank**; unset ⇒ per-repo dynamic resolution (below) |
515
- | `dynamicBankId` | dynamic iff no `bankId` | force dynamic (`true`) or static (`false`) resolution |
516
- | `bankIdTemplate` | `"coding-agent::{gitProject}"` | dynamic bank id format; the default makes every agent share one bank per repo |
517
- | `mapPathToBank` | — | absolute path → bank; **longest prefix wins**; linked worktrees inherit their main checkout's mapping; overrides everything |
518
- | `optInOnly` | `false` | run memory ONLY in opted-in projects — everything else is inert, with no bank created; see [Opt-in only](#opt-in-only) |
519
- | `optInPaths` | — | directories opted in, matched as prefixes with `~` expanded; each repo beneath and its linked worktrees are approved while keeping their own dynamic bank |
520
- | `resolveWorktrees` | `true` | linked worktrees inherit the main checkout's bank identity, path approval, and mapping |
521
- | `retainTags` | — | extra tags on every document written by the integration, e.g. `["project:{gitProject}"]` — see **Recording where a memory came from** below |
522
- | `retainMetadata` | — | extra metadata on every document written by the integration, e.g. `{"repo": "{gitProject}"}` |
523
- | `manageBankConfig` | `true` | let the plugin shape the bank's own configuration — the retain strategies it writes under, the `knowledge` entity-label group, and, on a bank that has none, the missions. Writing is strictly **additive**: it adds what the bank does not define and never overwrites what is there, so your control-plane edits survive. Set `false` to keep it out of the bank config entirely — see **A bank you shape yourself** below |
524
- | `observationScopes` | `"shared"` | how consolidation groups observations: `"shared"` (default) = ONE global scope per bank, so every agent on a repo builds one set of beliefs; also `"combined"` (the server default), `"per_tag"`, `"all_combinations"`, `[["t"]]`; `"per_source"` adds a scope per `source:` kind alongside the global one, so commit knowledge and conversation knowledge consolidate apart |
525
- | `disabled` | `false` | hard off-switch (inert plugin/hook — a no-memory baseline) |
526
- | `reflectTimeoutMs` | `120000` | **automatic** session-reflect timeout (hook harnesses additionally cap it at 20s to fit the host's hook window); on timeout or a 5xx the hook falls back to knowledge-page search, then to a raw recall of observations (recorded) |
527
- | `reflectToolTimeoutMs` | `330000` | timeout for the agent-invoked `hindsight_reflect` tool — a call the agent waits on, whose high-budget synthesis on a populated bank runs for minutes. Defaults above the server's own reflect wall timeout (`HINDSIGHT_API_REFLECT_WALL_TIMEOUT`, 300s) so the server decides when to give up. Unset, it inherits an explicitly raised `reflectTimeoutMs`, but a short one never lowers it |
528
- | `reflectBudget` | `"high"` | reflect budget for the `hindsight_reflect` tool: `"low"`, `"mid"` or `"high"`. Drop it on a large bank where high-budget synthesis exceeds the server's wall timeout. The automatic session-start reflect always uses `"low"` to fit its hook window and is unaffected |
529
- | `autoReflect` | `true` | inject a one-time reflect synthesis on the session's **first prompt**. `false` = tool-only reflect: nothing is injected; the agent searches knowledge pages first and reflects only when they are too shallow |
530
- | `pageRefreshEveryTurns` | `10` | refetch the knowledge pages and re-inject the page roster + tool guide every N user turns |
531
- | `pageTriggerType` | `"cron"` | when NEW knowledge pages refresh, i.e. what keeping them current costs — `"cron"` (default) on `pageTriggerCron` only and only when actually stale, `"auto-refresh"` after every consolidation that produced new material, `"manual"` never on their own. Auto-refresh is the most current and by far the most expensive: one synthesis per page per consolidation. Maps to the page's `trigger.refresh_cron`, or `trigger.refresh_after_consolidation` in the Hindsight API (`true` for auto-refresh, `false` for manual) |
532
- | `pageTriggerCron` | `"H * * * *"` | schedule for `pageTriggerType: "cron"` — UTC, standard 5-field cron, e.g. `"0 3 * * *"`. The default is hourly, each page on its own hashed minute. Sets the page's `trigger.refresh_cron`, which the API treats as mutually exclusive with `refresh_after_consolidation`; a scheduled refresh is skipped when nothing changed. Write a field as `H` to give each page its own value there — see **Spreading refreshes with `H`** below |
533
- | `autoSeed` | `true` | SessionStart: auto-seed a cold repo's bank from git history |
534
- | `seedLimit` | `300` | auto-seed: most-recent-N-commits cap |
535
- | `codebaseSurvey` | `true` | SessionStart: headless survey of a cold repo's structure, run under the current harness's own CLI (claude/codex/antigravity/opencode), falling back to any available agent |
536
- | `surveyModel` | `haiku` | model for the survey — Claude recipe only (`claude -p --model`); other agents use their configured default |
537
- | `surveyBudgetUsd` | `2` | survey spend cap — Claude recipe only (`claude -p --max-budget-usd`); other agents rely on their read-only sandbox |
538
- | `surveyRefreshCommits` | `20` | re-run the survey at SessionStart once this many commits have accrued since the last one, so the structural pages track an architecture that keeps moving (`0` = survey a cold repo only, never again) |
539
- | `retainSessions` | `true` | session write-back, honored by every harness: hook harnesses write the transcript on Stop, Factory Droid also writes on its cancellation notification, and plugin harnesses (opencode, opencode 2, Kilo) upsert it every turn plus an idle flush that captures the reply the per-turn pass can't see. Set `false` - globally, per harness, or per bank - to stop writing transcripts (the background history import stops with it) while recall, git ingest and the memory tools keep working |
540
- | `maxParallelRetains` | `10` | cap on concurrent retain-related requests: drain()'s per-op polls plus deepen's chat/git retain pools. The API rate-limits bursts, not single requests — if you see 429s, lower this rather than raising it |
541
- | `logLevel` | `"info"` | plugin-log verbosity (`"debug"` \| `"info"` \| `"warn"` \| `"error"`); `HINDSIGHT_LOG_LEVEL` env overrides |
542
- | `autoUpdate` | `true` | keep the installed runtime current by itself: once a day a session start asks npm for the published version and, when it is newer, re-stages `~/.hindsight/coding-agents` in the background. It rewires no host config, so a release adding a **new** hook entry point still needs a manual `install`. Set `false` to pin the installed version; `disabled` stops it too, since an inert plugin should stay inert. Only ever replaces a runtime installed the documented way, via `npx` — a copy installed with `npm i -g`, vendored as a project dependency, or built from a checkout is left to whoever manages it (update those the way you installed them), and it needs `npx` on `PATH` |
543
- | `gitIngest` | `"message"` | git depth for seeding AND staying current (same engine): `"message"` = commit messages only (one doc, re-upserted when HEAD moves); `"full"` = messages + per-commit full diffs (progressive, newest first); `"none"` = git off |
544
- | `harnesses.<name>` | — | per-harness override of any field above |
545
- | `harness` | `opencode` | **deepen engine only**: which session format `--conversations` is read as |
516
+ | field | default | meaning |
517
+ | ----------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
518
+ | `apiUrl` | `https://api.hindsight.vectorize.io` | Hindsight API base URL (set to `http://localhost:8888` for a local server) |
519
+ | `apiToken` | — | bearer token (Hindsight Cloud). Picked up without restarting the agent: a long-lived host re-reads it after a rejected request, so enabling auth or rotating the key mid-session recovers on the next call |
520
+ | `bankId` | — | **explicit static bank**; unset ⇒ per-repo dynamic resolution (below) |
521
+ | `dynamicBankId` | dynamic iff no `bankId` | force dynamic (`true`) or static (`false`) resolution |
522
+ | `bankIdTemplate` | `"coding-agent::{gitProject}"` | dynamic bank id format; the default makes every agent share one bank per repo |
523
+ | `mapPathToBank` | — | absolute path → bank; **longest prefix wins**; linked worktrees inherit their main checkout's mapping; overrides everything |
524
+ | `optInOnly` | `false` | run memory ONLY in opted-in projects — everything else is inert, with no bank created; see [Opt-in only](#opt-in-only) |
525
+ | `optInPaths` | — | directories opted in, matched as prefixes with `~` expanded; each repo beneath and its linked worktrees are approved while keeping their own dynamic bank |
526
+ | `resolveWorktrees` | `true` | linked worktrees inherit the main checkout's bank identity, path approval, and mapping |
527
+ | `retainTags` | — | extra tags on every document written by the integration, e.g. `["project:{gitProject}"]` — see **Recording where a memory came from** below |
528
+ | `retainMetadata` | — | extra metadata on every document written by the integration, e.g. `{"repo": "{gitProject}"}` |
529
+ | `manageBankConfig` | `true` | let the plugin shape the bank's own configuration — the retain strategies it writes under, the `knowledge` entity-label group, and, on a bank that has none, the missions. Writing is **additive**: it adds what the bank does not define and never overwrites what is there, so your control-plane edits survive — the one exception is the extraction mode of its own strategies, which follows `retainExtractionMode`. Set `false` to keep it out of the bank config entirely — see **A bank you shape yourself** below |
530
+ | `retainExtractionMode` | `"concise"` | how the server extracts memories from sessions, commits and documents: `"concise"`, `"verbose"`, `"verbatim"` or `"chunks"` (store the text, no extraction). Every Stop writes the session back, so this is what each turn costs — `"verbose"` pulls more detail for several times the tokens. Kept in sync on the plugin's own retain strategies every session, so a change reaches existing banks too (not with `manageBankConfig: false`) |
531
+ | `observationScopes` | `"shared"` | how consolidation groups observations: `"shared"` (default) = ONE global scope per bank, so every agent on a repo builds one set of beliefs; also `"combined"` (the server default), `"per_tag"`, `"all_combinations"`, `[["t"]]`; `"per_source"` adds a scope per `source:` kind alongside the global one, so commit knowledge and conversation knowledge consolidate apart |
532
+ | `disabled` | `false` | hard off-switch (inert plugin/hook — a no-memory baseline) |
533
+ | `reflectTimeoutMs` | `20000` | **automatic** session-reflect timeout; on hook harnesses the installer registers a 30s prompt-hook timeout, so going above ~20s also means raising that hook's `timeout` in the host's config, or the host kills the hook mid-reflect; on timeout or a 5xx the hook falls back to knowledge-page search, then to a raw recall of observations (recorded) |
534
+ | `reflectToolTimeoutMs` | `330000` | timeout for the agent-invoked `hindsight_reflect` tool — a call the agent waits on, whose high-budget synthesis on a populated bank runs for minutes. Defaults above the server's own reflect wall timeout (`HINDSIGHT_API_REFLECT_WALL_TIMEOUT`, 300s) so the server decides when to give up. Unset, it inherits an explicitly raised `reflectTimeoutMs`, but a short one never lowers it |
535
+ | `reflectBudget` | `"high"` | reflect budget for the `hindsight_reflect` tool: `"low"`, `"mid"` or `"high"`. Drop it on a large bank where high-budget synthesis exceeds the server's wall timeout. The automatic session-start reflect always uses `"low"` to fit its hook window and is unaffected |
536
+ | `autoInject` | `"reflect"` | what to inject once, on the session's **first prompt**: `"reflect"` = a low-budget reflect synthesis (on timeout/5xx it falls back to page search, then recall); `"pages"` = the knowledge pages matching the prompt by search; `"recall"` = the bank's memories recalled for the prompt (what it asks for is `recallOptions`, observations by default); `"none"` = nothing — the agent searches knowledge pages first and reflects only when they are too shallow. `"pages"` and `"recall"` are retrieval only (no LLM), so they stay well inside the hook window |
537
+ | `autoReflect` | `true` | **deprecated** — use `autoInject`. Still honoured (`false` = `autoInject: "none"`), ignored when `autoInject` is set, and logs a deprecation warning |
538
+ | `pageSearchLimit` | `3` | knowledge pages ONE search returns. Applies to every search of the bank — the `autoInject: "pages"` injection, the reflect fallback, and the agent's own `hindsight_search_knowledge_pages` tool — because the limit lives on the client they all share |
539
+ | `recallOptions` | see description | overrides merged key-by-key into the body of every recall — the `autoInject: "recall"` source and the reflect fallback. Keys are the API's own recall parameters, passed straight through, so anything recall accepts is settable without a new option here; `query` is the one field it cannot replace. The default body is `{"types": ["observation"], "budget": "low", "max_tokens": 2000, "include": {"entities": null}}`, and what you set is merged over it one key at a time — `{"max_tokens": 4000}` changes the budget and leaves the rest alone. Observations are the consolidated layer, so they answer best per token, but a bank with **consolidation disabled never grows any** and the default recall comes back empty on it: set `{"types": ["world", "experience"]}` there, or `{"types": null}` for every type. File-only, like `retainMetadata` — an object does not flatten into an env var |
540
+ | `pageRefreshEveryTurns` | `10` | refetch the knowledge pages and re-inject the page roster + tool guide every N user turns |
541
+ | `pageTriggerType` | `"cron"` | when NEW knowledge pages refresh, i.e. what keeping them current costs — `"cron"` (default) on `pageTriggerCron` only and only when actually stale, `"auto-refresh"` after every consolidation that produced new material, `"manual"` never on their own. Auto-refresh is the most current and by far the most expensive: one synthesis per page per consolidation. Maps to the page's `trigger.refresh_cron`, or `trigger.refresh_after_consolidation` in the Hindsight API (`true` for auto-refresh, `false` for manual) |
542
+ | `pageTriggerCron` | `"H * * * *"` | schedule for `pageTriggerType: "cron"` — UTC, standard 5-field cron, e.g. `"0 3 * * *"`. The default is hourly, each page on its own hashed minute. Sets the page's `trigger.refresh_cron`, which the API treats as mutually exclusive with `refresh_after_consolidation`; a scheduled refresh is skipped when nothing changed. Write a field as `H` to give each page its own value there — see **Spreading refreshes with `H`** below |
543
+ | `pages` | every page | per-page configuration for the seeded knowledge pages, keyed by page name (case-insensitive): `false` skips a page entirely, `{"source_query": "..."}` seeds it with your question instead of the built-in one. Omitted, all five pages are seeded with their built-in queries. This is the supported way to own a page's wording — the plugin re-syncs a page whose live query differs from the one it is configured to have, so a query edited through the API or the control plane is replaced on the next session. A skipped page is **not deleted**: one already seeded keeps its content and stops being re-synced. The scoping clause is appended to your query too, so a reworded page cannot start reporting a dependency's decisions as this project's. File-only, like `recallOptions`; in a `banks.<id>` section it replaces the global map rather than merging into it |
544
+ | `customPages` | — | knowledge pages of your own, seeded alongside the five above and keyed by the name they get: `{"Security posture": {"source_query": "...", "tags": ["knowledge:decision"]}}`. `source_query` is required; `tags` picks which facts feed the page and is optional — omitted, the page draws on everything the bank holds. A separate setting from `pages` on purpose, so that an unknown name there stays a typo warning rather than quietly creating a page. File-only, and replaced (not merged) by a `banks.<id>` section |
545
+ | `autoSeed` | `true` | SessionStart: auto-seed a cold repo's bank from git history |
546
+ | `seedLimit` | `300` | auto-seed: most-recent-N-commits cap |
547
+ | `codebaseSurvey` | `true` | SessionStart: headless survey of a cold repo's structure, run under the current harness's own CLI (claude/codex/antigravity/opencode), falling back to any available agent |
548
+ | `surveyModel` | `haiku` | model for the survey — Claude recipe only (`claude -p --model`); other agents use their configured default |
549
+ | `surveyBudgetUsd` | `2` | survey spend cap — Claude recipe only (`claude -p --max-budget-usd`); other agents rely on their read-only sandbox |
550
+ | `surveyRefreshCommits` | `20` | re-run the survey at SessionStart once this many commits have accrued since the last one, so the structural pages track an architecture that keeps moving (`0` = survey a cold repo only, never again) |
551
+ | `retainSessions` | `true` | session write-back, honored by every harness: hook harnesses write the transcript on Stop, Factory Droid also writes on its cancellation notification, and plugin harnesses (opencode, opencode 2, Kilo) upsert it every turn plus an idle flush that captures the reply the per-turn pass can't see. Set `false` - globally, per harness, or per bank - to stop writing transcripts (the background history import stops with it) while recall, git ingest and the memory tools keep working |
552
+ | `maxParallelRetains` | `10` | cap on concurrent retain-related requests: drain()'s per-op polls plus deepen's chat/git retain pools. The API rate-limits bursts, not single requests — if you see 429s, lower this rather than raising it |
553
+ | `logLevel` | `"info"` | plugin-log verbosity (`"debug"` \| `"info"` \| `"warn"` \| `"error"`); `HINDSIGHT_LOG_LEVEL` env overrides |
554
+ | `autoUpdate` | `true` | keep the installed runtime current by itself: once a day a session start asks npm for the published version and, when it is newer, re-stages `~/.hindsight/coding-agents` in the background. It rewires no host config, so a release adding a **new** hook entry point still needs a manual `install`. Set `false` to pin the installed version; `disabled` stops it too, since an inert plugin should stay inert. Only ever replaces a runtime installed the documented way, via `npx` — a copy installed with `npm i -g`, vendored as a project dependency, or built from a checkout is left to whoever manages it (update those the way you installed them), and it needs `npx` and `npm` on `PATH` |
555
+ | `gitIngest` | `"message"` | git depth for seeding AND staying current (same engine): `"message"` = commit messages only (one doc, re-upserted when HEAD moves); `"full"` = messages + per-commit full diffs (progressive, newest first); `"none"` = git off |
556
+ | `harnesses.<name>` | — | per-harness override of any field above |
557
+ | `harness` | `opencode` | **deepen engine only**: which session format `--conversations` is read as |
546
558
 
547
559
  By default a page refreshes **hourly, staggered**: `pageTriggerCron` is `"H * * * *"`, so every
548
560
  page gets its own minute of the hour (see below) and a tick with nothing new to fold in is skipped
@@ -589,6 +601,123 @@ file is the source of truth for these pages: to give one a different schedule, c
589
601
  page. Only the fields this plugin states are touched — a page's `mode`, its excluded siblings and
590
602
  its minimum refresh interval are left exactly as they are.
591
603
 
604
+ ### Customize Knowledge Pages — `pages`
605
+
606
+ Every repo gets the same five pages. They are a **taxonomy**, not a summary of your source: each one
607
+ is synthesized from what the bank ingested — commit history and past conversations — and each is
608
+ pinned to one knowledge tier, so a page draws only on the facts the extractor routed to it.
609
+
610
+ | Page | What it answers | Tier tag |
611
+ | ------------------------------ | ------------------------------------------------------------------------------------------------------- | ------------------------ |
612
+ | `Component map` | the main components/modules/subsystems, what each is responsible for, and how they depend on each other | `knowledge:component` |
613
+ | `Core concepts` | the domain abstractions and key entities — the vocabulary a developer has to know | `knowledge:concept` |
614
+ | `Conventions and patterns` | how THIS project does things: testing, error handling, naming, structure, how changes are made | `knowledge:convention` |
615
+ | `Key decisions and rationale` | the significant technical decisions and the durable "why we do it this way" behind them | `knowledge:decision` |
616
+ | `Initiatives and enhancements` | the major initiatives and features over time, linking out to each captured initiative's own page | `knowledge:feature-work` |
617
+
618
+ `pages` says which of them to seed and what each one asks. Keys are the page names above, matched
619
+ ignoring case and surrounding spaces:
620
+
621
+ ```jsonc
622
+ {
623
+ "pages": {
624
+ // don't seed this page at all
625
+ "Component map": false,
626
+ // seed it, but ask your question instead of the built-in one
627
+ "Key decisions and rationale": {
628
+ "source_query": "What did we decide about data retention, encryption and PII handling, and why? Prefer decisions that constrain what new code may do.",
629
+ },
630
+ },
631
+ }
632
+ ```
633
+
634
+ Omit `pages` entirely — the default — and all five are seeded with their built-in queries.
635
+
636
+ **Fewer pages.** Each page costs one LLM synthesis per refresh, so a repo that only wants the
637
+ architecture ones turns the rest off:
638
+
639
+ ```jsonc
640
+ {
641
+ "pages": {
642
+ "Initiatives and enhancements": false,
643
+ "Conventions and patterns": false,
644
+ "Key decisions and rationale": false,
645
+ },
646
+ }
647
+ ```
648
+
649
+ **Per repo**, like every other field — usually where this belongs, since what a page should ask is a
650
+ property of the project, not of your machine:
651
+
652
+ ```jsonc
653
+ {
654
+ "banks": {
655
+ "coding-agent::payments-api": {
656
+ "pages": {
657
+ "Core concepts": {
658
+ "source_query": "What are the payment domain's entities — orders, ledgers, settlement states — and what does each mean in OUR model?",
659
+ },
660
+ },
661
+ },
662
+ },
663
+ }
664
+ ```
665
+
666
+ Four things worth knowing before you reach for it:
667
+
668
+ - **This is the only durable way to reword a page.** Every session compares each seeded page against
669
+ the query it is configured to have and re-syncs the ones that differ, so a `source_query` edited
670
+ through the API or the control plane is replaced the next time an agent runs. Setting it here makes
671
+ your wording the configured one. When a re-sync does replace a query, the plugin now says which
672
+ page in the plugin log rather than doing it silently.
673
+ - **Your query still gets the scoping clause.** The sentence that keeps a dependency's decisions off
674
+ your project's page is appended to a custom query too — a bank holds facts about the libraries and
675
+ services a repo merely uses, and without that clause a page will present them as yours.
676
+ - **The tier tag stays the taxonomy's.** It selects which facts the synthesis reads; rewording the
677
+ question changes what is asked of those facts, not which ones are in scope.
678
+ - **`false` does not delete anything.** A page already seeded keeps its content and simply stops
679
+ being re-synced — remove it in the control plane if you want it gone.
680
+
681
+ A name that matches no page above is ignored with a warning in the plugin log, so a typo fails
682
+ loudly instead of looking like it disabled something. Adding pages of your own is not what this
683
+ setting is for: the agent's `hindsight_capture_initiative` tool already creates pages, one per
684
+ initiative, each with its own query.
685
+
686
+ #### Pages of your own — `customPages`
687
+
688
+ `pages` only reworks the five above. To add a page, name it under `customPages`:
689
+
690
+ ```jsonc
691
+ {
692
+ "customPages": {
693
+ "Security posture": {
694
+ "source_query": "What are this project's security decisions — authn, secrets handling, PII, dependency policy — and what do they constrain in new code?",
695
+ "tags": ["knowledge:decision"],
696
+ },
697
+ "Operational runbook": {
698
+ "source_query": "How does this project get deployed, monitored and rolled back? What has broken in production, and what fixed it?",
699
+ },
700
+ },
701
+ }
702
+ ```
703
+
704
+ `source_query` is required. `tags` is optional and picks which facts feed the page — one of the tier
705
+ tags above, or any tag you stamp on your own writes with `retainTags`. Omit it and the page draws on
706
+ everything the bank holds: a refresh matches tags with `all`, so no tags means no tag constraint,
707
+ **not** an empty page.
708
+
709
+ Your pages are seeded at the same root as the taxonomy, on the same refresh schedule, and re-synced
710
+ from the config the same way — reword one here and the live page follows on the next session. They
711
+ compose with `pages`, so trading two built-ins for one of your own is just both settings at once.
712
+
713
+ **Why it is a separate setting.** `pages` refuses a name that matches no seeded page, and that is
714
+ what makes a typo loud: if an unknown key there meant "create this page", `"Componnet map"` would
715
+ quietly create an empty second page instead of rewording the one you meant. For the same reason,
716
+ naming a seeded page under `customPages` is refused — reword it under `pages`.
717
+
718
+ A page you create yourself in the control plane is a third thing again, and the plugin never touches
719
+ it: the seed pass only visits the pages it is configured to own.
720
+
592
721
  ### A bank you shape yourself — `manageBankConfig`
593
722
 
594
723
  Pointed at a bank, this plugin gives it the shape its ingestion needs: retain strategies for the
@@ -604,6 +733,11 @@ already has it. To take the current default back, clear that override on the ban
604
733
  strategy, or the whole `retain_strategies` entry, in the control plane): the next session finds the
605
734
  bank silent there and seeds it again.
606
735
 
736
+ One field is the exception: the extraction mode of the plugin's own four strategies (`git`,
737
+ `gitlog`, `conversation`, `document`) follows `retainExtractionMode` and is put back on every session
738
+ if it drifts — the same way a seeded page's query is. Change it in `coding-agent.json`, not in the
739
+ control plane. The strategies' other fields, and your own strategies, are still left alone.
740
+
607
741
  Set `manageBankConfig: false` to keep the plugin out of the bank's configuration altogether — the
608
742
  right setting for a bank you share with non-coding work, or one you configure yourself. That bank
609
743
  should then define the five strategies above itself. Note that the miss is **silent**: the server
@@ -850,10 +984,15 @@ as a JSON line to `~/.hindsight/coding-agents-logs/diag.jsonl` (override with
850
984
  `reflect_failed` / `pages_failed` record the error; if you're comparing memory-on vs memory-off,
851
985
  check this file — a run whose reflects failed is a no-memory run. When the failure was a timeout or
852
986
  a 5xx, the hook falls back to knowledge-page search and, if no page matches, to a raw recall of the
853
- bank's observations: `reflect_fallback_pages` / `reflect_fallback_observations` record what each
987
+ bank's memories: `reflect_fallback_pages` / `reflect_fallback_observations` record what each
854
988
  step returned (`*_failed` when it errored). Seed starts are logged as
855
989
  `seed_started`.
856
990
 
991
+ When `autoInject` names a retrieval source instead of reflect, that source records its own
992
+ outcome with the number of items it returned: `inject_pages` for `"pages"`, `inject_recall` for
993
+ `"recall"` (`inject_pages_failed` / `inject_recall_failed` when the call errored). No reflect
994
+ event is written on those turns — nothing reflected.
995
+
857
996
  **Tool usage** (is the agent using Hindsight?): one JSON line per finished user turn in
858
997
  `~/.hindsight/coding-agents-logs/usage.jsonl` (override `HINDSIGHT_USAGE_FILE`) — the `hindsight_*`
859
998
  tools the agent called during that turn, and whether its reply credited Hindsight memory ("From