@mickey-kras/hindsight-memory-router-coding-agents 0.8.2 → 0.8.9

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 (64) hide show
  1. package/DEVIATIONS.md +149 -31
  2. package/README.md +40 -14
  3. package/UPSTREAM.json +10 -10
  4. package/dist/antigravity-hook.js +13 -8
  5. package/dist/antigravity-statusline.js +1 -1
  6. package/dist/antigravity-stop-hook.js +13 -8
  7. package/dist/claude-hook.js +13 -8
  8. package/dist/claude-sessionstart-hook.js +13 -8
  9. package/dist/claude-stop-hook.js +13 -8
  10. package/dist/cline.js +51 -2
  11. package/dist/codebuddy-hook.js +13 -8
  12. package/dist/codebuddy-sessionstart-hook.js +13 -8
  13. package/dist/codebuddy-stop-hook.js +13 -8
  14. package/dist/codex-hook.js +13 -8
  15. package/dist/codex-sessionstart-hook.js +13 -8
  16. package/dist/codex-stop-hook.js +13 -8
  17. package/dist/copilot-hook.js +13 -8
  18. package/dist/copilot-sessionstart-hook.js +13 -8
  19. package/dist/copilot-stop-hook.js +13 -8
  20. package/dist/cursor-hook.js +13 -8
  21. package/dist/cursor-sessionstart-hook.js +13 -8
  22. package/dist/cursor-stop-hook.js +13 -8
  23. package/dist/dcode-hook.js +13 -8
  24. package/dist/dcode-sessionstart-hook.js +13 -8
  25. package/dist/dcode-stop-hook.js +13 -8
  26. package/dist/deepen.js +7 -3
  27. package/dist/devin-hook.js +13 -8
  28. package/dist/devin-sessionstart-hook.js +13 -8
  29. package/dist/devin-stop-hook.js +13 -8
  30. package/dist/droid-hook.js +13 -8
  31. package/dist/droid-sessionstart-hook.js +13 -8
  32. package/dist/droid-stop-hook.js +13 -8
  33. package/dist/dsh.js +51 -2
  34. package/dist/grok-hook.js +13 -8
  35. package/dist/grok-sessionstart-hook.js +13 -8
  36. package/dist/grok-stop-hook.js +13 -8
  37. package/dist/hindsight-seed.js +1 -1
  38. package/dist/index.js +2294 -14661
  39. package/dist/installer.js +13 -8
  40. package/dist/kilo.js +2294 -14661
  41. package/dist/kimi-hook.js +13 -8
  42. package/dist/kimi-sessionstart-hook.js +13 -8
  43. package/dist/kimi-stop-hook.js +13 -8
  44. package/dist/mcp-server.js +125 -20
  45. package/dist/opencode2.js +2296 -14663
  46. package/dist/pi.js +51 -2
  47. package/dist/prime-agent.js +51 -2
  48. package/dist/qwen-hook.js +13 -8
  49. package/dist/qwen-sessionstart-hook.js +13 -8
  50. package/dist/qwen-stop-hook.js +13 -8
  51. package/dist/status.js +1 -1
  52. package/dist/traecode-hook.js +13 -8
  53. package/dist/traecode-sessionstart-hook.js +13 -8
  54. package/dist/traecode-stop-hook.js +13 -8
  55. package/dist/workbuddy-hook.js +13 -8
  56. package/dist/workbuddy-sessionstart-hook.js +13 -8
  57. package/dist/workbuddy-stop-hook.js +13 -8
  58. package/dist/zcode-hook.js +13 -8
  59. package/dist/zcode-sessionstart-hook.js +13 -8
  60. package/dist/zcode-stop-hook.js +13 -8
  61. package/npm-shrinkwrap.json +745 -353
  62. package/package.json +14 -10
  63. package/plugin.json +1 -1
  64. package/skill/SKILL.md +113 -106
package/DEVIATIONS.md CHANGED
@@ -1,49 +1,167 @@
1
1
  # Router deviations
2
2
 
3
- - Managed harness identity, HTTPS endpoint, token environment references, and explicit path mappings replace upstream endpoint/token/dynamic-bank configuration.
4
- - `optInOnly` is enforced from managed mappings. Normal config cannot rename banks or override identity/credentials.
5
- - All HTTP requests use the shared bank/operation guard. Bank listing intersects router-visible banks with configured IDs.
6
- - Recall/reflect fan out through the shared coordinator. Other reads remain explicitly bank-addressed.
7
- - 401/403 are terminal; upstream credential retry is replaced by runtime environment resolution on each request.
8
- - Optional human mode resolves a short-lived session from native OS secure storage on every request. Browser login uses the router's loopback OIDC/PKCE exchange; sign-out revokes and deletes the session. Persistent application credentials remain separate.
9
- - Redirects and raw server error bodies are blocked. Automatic upstream replacement and installer token migration are disabled.
10
- - Diagnostic and ordinary log files use an allowlist of timing, counts, booleans and bounded classifications at every verbosity. Prompts, answers, failure text, identifiers, paths, URLs and arbitrary progress messages are omitted; no content-debug mode is provided. Existing log files are not purged by an upgrade.
11
- - Upstream transcript parsing, provenance tags, retain payloads, hooks and harness adapters remain the baseline, with deliberate routing, privacy, installer and reliability adaptations. This is not a claim of identical behavior; the changes and source hashes below define the maintained differences.
12
- - Manual document ingestion uses the shared exact-title hash identity. Legacy IDs remain untouched; see the root README migration note.
13
- - `src/core/inject.ts` rewords the reflect rendering rules to "commit, PR and issue ids": the upstream "commit/PR/issue" slash token trips the Memory Router encoded-payload request scan, which rejects the reflect query with 422 suspicious_content.
3
+ - Managed harness identity, HTTPS endpoint, token environment references, and explicit path mappings replace upstream configuration for endpoints, tokens and dynamic banks.
4
+ - Managed mappings enforce `optInOnly`. Normal configuration cannot rename banks or override identity or credentials.
5
+ - All HTTP requests use the shared guard for banks and operations. Bank listing intersects router-visible banks with configured IDs.
6
+ - Recall and reflect use the shared coordinator to read multiple banks. Other reads need an explicit bank address.
7
+ - A 401/403 response is terminal. Runtime environment resolution on each request replaces upstream credential retry.
8
+ - Optional human mode resolves a short-lived session from native OS secure storage on every request.
9
+ Browser login uses the router's loopback OIDC exchange with PKCE. Sign-out revokes and deletes the session.
10
+ Persistent application credentials remain separate.
11
+ - The client blocks redirects and raw server error bodies. The integration disables automatic upstream replacement and installer token migration.
12
+ - At every verbosity, diagnostic and ordinary log files contain only timing, counts, booleans and bounded classifications.
13
+ They omit prompts, answers, failure text, identifiers, paths, URLs and arbitrary progress messages.
14
+ There is no content-debug mode. An upgrade does not remove existing log files.
15
+ - Upstream transcript parsing, provenance tags, retain payloads, hooks and harness adapters remain the baseline.
16
+ This fork changes routing, privacy, installation and reliability. It does not claim the same behavior.
17
+ The changes and source hashes below define the maintained differences.
18
+ - Manual document ingestion uses the shared exact-title hash identity. Legacy IDs do not change. See the migration note in the root README.
19
+ - `src/core/inject.ts` changes the reflect rendering rules to "commit, PR and issue ids".
20
+ The upstream token `commit/PR/issue` triggers the Memory Router encoded-payload request scan.
21
+ That scan rejects the reflect query with 422 suspicious_content.
14
22
 
15
- The source hashes in `UPSTREAM.json` describe the pristine snapshot. `LOCAL_CHANGES.json` pins adapted files.
16
- The regression suite covers unchanged transcript/provenance code; root tests cover the changed security contracts.
17
- Live harness and deployed Memory Router compatibility must be verified before rollout.
23
+ The source hashes in `UPSTREAM.json` describe the original snapshot. `LOCAL_CHANGES.json` pins adapted files.
24
+ The regression suite covers unchanged code for transcripts and provenance. Root tests cover the changed security contracts.
18
25
 
19
- Bank configuration is operator-managed (`manageBankConfig: false`). Provision coding missions/strategies before ingestion. Read-only principals disable automatic ingestion and write-back. Local usage can read existing host transcripts, but journal-only hosts capture prompts and replies only when session retention is enabled and the principal can write the resolved bank.
20
- Session state uses per-user private directories (0700 on POSIX), regular files (0600), and exclusive atomic temporary files. Owned legacy directories are secured and migrated; symlinks, hard links, and foreign-owned paths are rejected.
21
- Memory content is not reused from session caches; lifecycle flags remain cached. A denied application-token value remains blocked until it changes; human credentials require explicit login after expiry or denial.
26
+ Before deployment, check compatibility with live harnesses and the deployed Memory Router.
22
27
 
23
- Reliability fixes use explicit sorting, global replacements, Node ANSI stripping, optional arguments, and non-empty installer regex matches. Transcript escape decoding retains UTF-16 surrogate behavior.
28
+ The operator manages bank configuration (`manageBankConfig: false`). Before ingestion, configure coding missions and strategies.
29
+ Read-only principals disable automatic ingestion and write-back. Local usage can read existing host transcripts.
24
30
 
25
- Dependencies are classified by their package declarations; bundling does not make declared runtime dependencies development-only. Direct runtime dependencies are `@modelcontextprotocol/sdk`, `@napi-rs/keyring`, `jsonc-parser`, `smol-toml` and `zod`. Development dependencies are `@opencode-ai/plugin`, `@opencode-ai/sdk`, `@opencode/plugin`, `@types/node`, `tsup`, `typescript` and `vitest`.
31
+ Journal-only hosts capture prompts and replies only if session retention applies and the principal can write the resolved bank.
26
32
 
27
- The complete override inventory is `@opencode/plugin > @opentelemetry/core` (`>=2.8.0 <3.0.0`), `esbuild` (`>=0.25.0 <1.0.0`), `fast-uri` (`>=3.1.6 <4.0.0`), `hono` (`>=4.13.7 <5.0.0`), `http-cache-semantics` (`4.3.0`), `ip-address` (`>=10.5.1 <11.0.0`), `postcss` (`>=8.5.23 <9.0.0`) and `vite` (`>=6.4.3 <7.0.0`). These ranges constrain the dependency graph; exact resolved versions are in `npm-shrinkwrap.json`. Reassess compatibility and advisories when updating, rather than assuming these overrides are permanently required or sufficient.
33
+ Session state uses per-user private directories (0700 on POSIX), regular files (0600), and exclusive atomic temporary files.
34
+ The integration secures and migrates owned legacy directories. It rejects symlinks, hard links, and foreign-owned paths.
28
35
 
29
- Survey admission is scoped to the managed router URL, principal and bank. Tokens never enter lease keys; credential rotation keeps the same lease. Normal config cannot override the managed principal. No CodeQL suppression is used.
36
+ It does not reuse memory content from session caches. Lifecycle flags remain cached.
37
+ A denied application-token value remains blocked until it changes. Human credentials need explicit login after expiry or denial.
30
38
 
31
- Upstream baseline is coding-agents 0.8.1 at the shared v1.0.0 commit. Downstream package versions remain independent. The managed README, generated companion skill and disabled daemon implementation remain router-owned: upstream endpoint setup, dynamic banks, local daemon and update instructions are unsupported. The package uses npm-shrinkwrap.json; upstream package-lock.json stays intentionally absent.
39
+ Reliability fixes use explicit sorting, global replacements, Node ANSI stripping, optional arguments, and non-empty installer regex matches.
40
+ Transcript escape decoding retains UTF-16 surrogate behavior.
32
41
 
33
- New upstream append capability, retry budgets, query bounds, page scoping and document freshness reads use the existing guarded client. Version probing accepts GET /v1/version and falls back to /version; authorization failures remain terminal. Router error bodies are redacted, so a 404 cannot latch page support off based on its upstream body.
42
+ Package declarations classify dependencies. Bundling does not make declared runtime dependencies development-only.
43
+ Direct runtime dependencies are `@modelcontextprotocol/sdk`, `@napi-rs/keyring`, `jsonc-parser`, `smol-toml` and `zod`.
44
+ Development dependencies are `@opencode-ai/plugin`, `@opencode-ai/sdk`, `@opencode/plugin`, `@types/node`, `tsup`, `typescript` and `vitest`.
34
45
 
35
- Grok tool-hook context is stored privately and delivered only after managed credentials and the current project mapping are validated. Its handoff key includes endpoint, primary bank, the canonical physical path of the recorded session root, session, a hash of the actual effective principal and the complete managed read-bank scope. Moving into a subdirectory preserves the handoff only while both the live directory and recorded root remain authorized for the same bank and the live directory remains physically inside that root. Every bank that could contribute to aggregated memory is freshly authorized in parallel under one shared 15-second deadline before delivery; scope/principal changes and server revocations reject the handoff. The effective endpoint, physical workspace and project mapping are resolved again after awaited reads and grant probes. Authorization failures discard it permanently. Tokens never enter identity keys. Pending context uses immutable blocks with atomic claims per publication; concurrent tools may deliver separate blocks, and waiting-block deduplication is best-effort. Delivery reads at most 64 blocks per event, leaving later blocks for subsequent events; terminal denial discards the bound scope's pending snapshot. Session caches retain attempt counters and lifecycle flags, never memory content.
46
+ The complete override inventory is:
36
47
 
37
- New Kimi, WorkBuddy, CodeBuddy and TraeCode entries use managed identity and branded registration names. Trae workspace MCP files are written only by explicit transactional installation for operator-mapped projects; hooks only report the workspace-MCP gate. Global settings and workspace SQLite enable switches remain user-managed.
48
+ | Dependency | Range |
49
+ | --- | --- |
50
+ | `@opencode/plugin > @opentelemetry/core` | `>=2.8.0 <3.0.0` |
51
+ | `@opencode-ai/plugin > zod` | `>=4.6.6 <5.0.0` |
52
+ | `esbuild` | `>=0.25.0 <1.0.0` |
53
+ | `fast-uri` | `>=3.1.9 <4.0.0` |
54
+ | `hono` | `>=4.13.11 <5.0.0` |
55
+ | `http-cache-semantics` | `4.3.0` |
56
+ | `ip-address` | `>=10.5.1 <11.0.0` |
57
+ | `postcss` | `>=8.5.23 <9.0.0` |
58
+ | `vite` | `>=6.4.3 <7.0.0` |
38
59
 
39
- Managed settings are reapplied after every path/bank override, including paths without a bank section. Project prompt tuning stays available; read-only principals cannot restore ingestion, surveys or bank management. The shared transport composes over the current host dispatcher to disable Undici's header/body timeout caps while preserving the request's AbortSignal deadline and proxy setup.
60
+ These ranges constrain the dependency graph. `npm-shrinkwrap.json` contains exact resolved versions.
61
+ When you update dependencies, assess compatibility and advisories again.
62
+ Do not assume that these overrides remain necessary or enough.
40
63
 
41
- SessionStart readiness probes propagate terminal authorization failures before launching further background work; transient failures retain their fallback behavior. Append capabilities and accepted-operation cursors belong to one bank, so a managed bank switch re-probes the destination and starts from a replacement transcript. Grok's native hooks file and generated backup, and Trae's generated JSON backups, are covered by installer transactions.
64
+ Survey admission uses the managed router URL, principal and bank as its scope.
65
+ Tokens never enter lease keys. Credential rotation keeps the same lease.
42
66
 
43
- Multi-source conversation retention preserves rollout contributions in their original order and rereads their sources when rebuilding the shared document. Sources must remain readable, including replies previously retained before their transcript was flushed. Reconstruction supports up to 16 source references and refuses any decoded source or assembled document exceeding 32 MiB of serialized turns or 100,000 turns. Missing or ambiguous sources, unknown legacy continuation boundaries, moving copied prefixes and exceeded limits stop the write with a diagnostic instead of replacing the document with incomplete data. Single-source and persistent-runtime retention retain their existing size behavior.
67
+ Normal configuration cannot override the managed principal. The code uses no CodeQL suppression.
44
68
 
45
- SessionStart propagates failures to the shared lifecycle entrypoint. Hook lifecycle entrypoints observe rejected work, emit one fixed stderr diagnostic and exit 1 without adding protocol stdout. Authorization denial remains terminal. Seed launch waits only for the child spawn/error event; failure is reported without raw exception text, and manual success means launched, not extraction complete.
69
+ The upstream baseline is coding-agents 0.8.2 at the shared v1.1.0 release commit. Downstream package versions remain independent.
70
+ The router maintains the managed README, generated companion skill and disabled daemon implementation.
71
+ This fork does not support upstream endpoint setup, dynamic banks, local daemon and update instructions.
46
72
 
47
- Sync requires a confirmed zero active-operation count. Unavailable or malformed operation probes remain unknown; background settlement retries for up to 15 minutes and reports unconfirmed settlement at timeout. Authorization denial remains terminal.
73
+ The package uses npm-shrinkwrap.json. Upstream package-lock.json remains intentionally absent.
48
74
 
49
- Persistent runtimes admit at most 256 sessions per workspace. Explicit host disposal releases completed state; admission evicts the least-recently-used idle session when end events are unavailable. Active prompts, transcript fetches, retains and dirty or buffered cursors stay pinned. When every slot is pinned, new sessions skip automatic recall/retention with a `session_capacity_reached` diagnostic; existing work continues. Evicted sessions resume with a full transcript replacement. OpenCode2 global events require current scoped-prompt admission, and keyed injection never falls back to another session. Cline keeps only the latest prompt ID for up to 256 sessions. Usage counters restart after eviction, so resumed transcripts can repeat local usage records.
75
+ New upstream append capability, retry budgets, query bounds, page scoping and document freshness reads use the existing guarded client.
76
+ Version probing accepts GET /v1/version and falls back to /version. Authorization failures remain terminal.
77
+
78
+ The router removes error body content. Thus, a 404 cannot disable page support based on its upstream body.
79
+
80
+ Grok tool-hook context uses private storage. Delivery requires valid managed credentials and a valid current project mapping.
81
+ The handoff key contains these fields:
82
+
83
+ - Endpoint and primary bank.
84
+ - Canonical physical path of the recorded session root.
85
+ - Session.
86
+ - Hash of the actual effective principal.
87
+ - Complete managed read-bank scope.
88
+
89
+ A move into a subdirectory preserves the handoff only under both conditions:
90
+
91
+ - The live directory and recorded root remain authorized for the same bank.
92
+ - The live directory remains physically inside that root.
93
+
94
+ Before delivery, every bank that can contribute memory receives a new authorization check.
95
+ These checks run in parallel under one shared 15-second deadline.
96
+ Changes to scope or principal and server revocations reject the handoff.
97
+ After awaited reads and grant probes, the integration resolves the effective endpoint, physical workspace and project mapping again.
98
+
99
+ Authorization failures discard the handoff permanently. Tokens never enter identity keys.
100
+
101
+ Pending context uses immutable blocks with atomic claims per publication.
102
+ Concurrent tools can deliver separate blocks. Waiting-block deduplication is best-effort.
103
+
104
+ Delivery reads at most 64 blocks per event. Later blocks remain for next events.
105
+ Terminal denial discards the bound scope's pending snapshot.
106
+
107
+ Session caches retain retry counters and lifecycle flags. They never retain memory content.
108
+
109
+ New Kimi, WorkBuddy, CodeBuddy and TraeCode entries use managed identity and branded registration names.
110
+ Only explicit transactional installation writes MCP files for Trae workspaces for operator-mapped projects.
111
+ Hooks only report the workspace-MCP gate. Users manage global settings and workspace SQLite enable switches.
112
+
113
+ The integration reapplies managed settings after every override for paths or banks, including paths without a bank section.
114
+ Project prompt adjustments remain available. Read-only principals cannot restore ingestion, surveys or bank management.
115
+ The shared transport uses the current host dispatcher to disable Undici's timeout caps for headers and bodies.
116
+
117
+ It preserves the request's AbortSignal deadline and proxy setup.
118
+
119
+ Before further background work starts, SessionStart readiness probes propagate terminal authorization failures.
120
+ Transient failures retain their fallback behavior. Append capabilities and accepted-operation cursors belong to one bank.
121
+ Thus, a managed bank switch probes the destination again and starts from a replacement transcript.
122
+
123
+ Installer transactions cover Grok's native hooks file and generated backup. They also cover Trae's generated JSON backups.
124
+
125
+ Multi-source conversation retention preserves rollout contributions in their original order.
126
+ It reads their sources again when it rebuilds the shared document.
127
+ Sources must remain readable, including replies retained before the host flushed their transcript.
128
+ Reconstruction supports up to 16 source references.
129
+
130
+ It rejects any decoded source or assembled document that exceeds 32 MiB of serialized turns or 100,000 turns.
131
+ The following conditions stop the write with a diagnostic:
132
+
133
+ - Missing or ambiguous sources.
134
+ - Unknown legacy continuation boundaries.
135
+ - Moving copied prefixes.
136
+ - Exceeded limits.
137
+
138
+ The integration does not replace the document with incomplete data.
139
+ Single-source and persistent-runtime retention keep their existing size behavior.
140
+
141
+ SessionStart propagates failures to the shared lifecycle entrypoint.
142
+ Hook lifecycle entrypoints observe rejected work, emit one fixed stderr diagnostic and exit 1 without protocol stdout.
143
+ Authorization denial remains terminal. Seed launch waits only for the child spawn or error event.
144
+
145
+ Failure reports omit raw exception text. Manual success means that launch occurred. It does not mean that extraction is complete.
146
+
147
+ Sync requires a confirmed zero active-operation count. Unavailable or malformed operation probes remain unknown.
148
+
149
+ Background settlement retries for up to 15 minutes. At timeout, it reports unconfirmed settlement. Authorization denial remains terminal.
150
+
151
+ Persistent runtimes admit at most 256 sessions per workspace. When the host explicitly disposes of a session, the runtime releases completed state.
152
+ If end events are unavailable, admission evicts the least-recently-used idle session.
153
+ Active prompts, transcript fetches, retains and dirty or buffered cursors stay pinned.
154
+
155
+ If all slots stay pinned, new sessions skip automatic recall and retention with a `session_capacity_reached` diagnostic. Existing work continues.
156
+ Evicted sessions resume with a full transcript replacement.
157
+
158
+ OpenCode2 global events need current scoped-prompt admission. Keyed injection never falls back to another session.
159
+ Cline keeps only the latest prompt ID for up to 256 sessions.
160
+
161
+ Usage counters restart after eviction. Thus, resumed transcripts can repeat local usage records.
162
+
163
+ Managed git-log synchronization retains bounded full replacement semantics. Upstream incremental appends lack an expected-base precondition.
164
+ Two asynchronous writes from the same persisted head can overlap after HEAD changes, despite distinct operation IDs.
165
+ This fork does not import the append implementation until that concurrency contract exists.
166
+
167
+ Authorization denials remain terminal. The maintained git-log tests cover pending writes across changed heads.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Coding agents
2
2
 
3
- Source: `vectorize-io/hindsight/hindsight-integrations/coding-agents`, v0.8.1.
4
- The superseded per-agent integrations are not imported.
3
+ Source: `vectorize-io/hindsight/hindsight-integrations/coding-agents`, v0.8.2.
4
+ This fork does not import the superseded per-agent integrations.
5
5
 
6
6
  Set `HINDSIGHT_ROUTER_CONFIG` to an absolute, operator-managed JSON file:
7
7
 
@@ -31,28 +31,54 @@ Set `HINDSIGHT_ROUTER_CONFIG` to an absolute, operator-managed JSON file:
31
31
  }
32
32
  ```
33
33
 
34
- Resolve each named environment variable through the deployment's secret manager before launching that harness.
34
+ Before you start a harness, resolve each named environment variable through the deployment's secret manager.
35
35
  Give each harness only its own token. Never put token values in JSON, arguments, or this repository.
36
- Create matching per-principal + bank + scope grants in Memory Router first.
36
+ First, create matching grants for each principal, bank and scope in Memory Router.
37
37
 
38
- **client routing != authorization; Memory Router grants are authoritative**
38
+ Client routing does not grant access. The router controls access through its grants.
39
39
 
40
- Install the verified release coding-agents tarball and run its `hindsight-coding-agents install` command.
40
+ Install the verified release coding-agents tarball.
41
+ Run its `hindsight-coding-agents install` command.
41
42
  The upstream harness hooks, plugin entrypoints, transcript readers, and background ingestion remain packaged.
42
- Install from this artifact; do not run upstream's `npx` installer over it.
43
+
44
+ Install from this artifact. Do not replace it with upstream's `npx` installer.
43
45
 
44
46
  Only explicit managed path mappings opt a project in. Child directories inherit their mapping.
45
- Use the principal's write bank in mappings for writable projects; map an assigned read bank for a read-only principal.
46
- Unmapped paths, unknown harnesses, and missing secrets fail closed. No dynamic repository banks.
47
- Upstream normal config may tune prompts and ingestion, but cannot change identity, credentials, endpoint, or grants. `banks.<id>.bank` and path-level bank renames are ignored; change the operator-managed `mapPathToBank` and matching server grants instead.
47
+ For writable projects, use the principal's write bank in mappings. For a read-only principal, map an assigned read bank.
48
+
49
+ Unmapped paths, unknown harnesses, and missing secrets stop access. The integration does not create dynamic repository banks.
50
+ Normal upstream configuration can adjust prompts and ingestion. It cannot change identity, credentials, endpoint, or grants.
51
+
52
+ The integration ignores `banks.<id>.bank` and path-level bank renames.
53
+ To change banks, change the operator-managed `mapPathToBank` and matching server grants.
54
+
55
+ Coding agents accept and validate legacy managed JSON keys for compatibility. These keys have no effect:
56
+ `recallTimeoutMs`, `recallMaxTokens`, `retainQueueFlushIntervalMs`, `queueMaxAgeMs`, `queueMaxItems`, `queueMaxBytes` and `queueDir`.
57
+ During migration, remove them. Adjust the retrieval settings in normal coding-agent configuration.
58
+
59
+ Coding agents have no OpenClaw-style durable outage queue or replay timer. Ingestion uses the upstream retry and cursor mechanisms.
60
+ Managed `queueMaxAgeMs` accepts `-1` or a positive integer. Unlike OpenClaw, it rejects `0`.
48
61
 
49
- Legacy managed JSON keys `recallTimeoutMs`, `recallMaxTokens`, `retainQueueFlushIntervalMs`, `queueMaxAgeMs`, `queueMaxItems`, `queueMaxBytes` and `queueDir` are accepted and validated for compatibility but have no effect in coding agents. Remove them when migrating; tune retrieval in normal coding-agent config. There is no OpenClaw-style durable outage queue or replay timer here; ingestion uses the upstream retry/cursor mechanisms. Managed `queueMaxAgeMs` accepts `-1` or a positive integer and rejects `0`, unlike OpenClaw.
62
+ `pageRefreshEveryTurns` and `HINDSIGHT_PAGE_REFRESH_EVERY_TURNS` do not reduce hook page-list reads.
63
+ Session caches omit page lists that contain memory. Each prompt hook fetches newly authorized pages.
50
64
 
51
- `pageRefreshEveryTurns` (and `HINDSIGHT_PAGE_REFRESH_EVERY_TURNS`) does not reduce hook page-list reads: memory-bearing page lists are deliberately omitted from session caches, so each prompt hook fetches freshly authorized pages. The setting still controls how often the roster/tool guide is injected, not how often it is fetched; omission or `0` means every turn (`1`). It does not configure persistent-plugin refresh behavior. Do not restore cached memory content to implement a cadence.
65
+ The setting controls how often hooks inject the roster and tool guide. It does not control how often hooks fetch the guide.
66
+ An omitted value or `0` means every turn (`1`). The setting does not configure persistent-plugin refresh behavior.
67
+
68
+ Do not restore cached memory content to control refresh frequency.
52
69
 
53
70
  Recall and reflect read the assigned union, with a 4,096-token shared budget.
54
- Recall/reflect use the caller's configured deadline: automatic retrieval uses `injectTimeoutMs` (7,000 ms), automatic reflect uses `reflectTimeoutMs` (20,000 ms), and the reflect tool uses `reflectToolTimeoutMs` (when omitted, the greater of 330,000 ms and the configured `reflectTimeoutMs`; an explicit positive tool timeout can be lower). Generic requests without a caller signal default to 15 seconds. Raising a hook deadline also requires enough time in the host hook configuration.
71
+ Recall and reflect use the caller's configured deadline:
72
+
73
+ - Automatic retrieval uses `injectTimeoutMs` (7,000 ms).
74
+ - Automatic reflect uses `reflectTimeoutMs` (20,000 ms).
75
+ - The reflect tool uses `reflectToolTimeoutMs`. If omitted, this is the greater of 330,000 ms and the configured `reflectTimeoutMs`. An explicit positive tool timeout can be lower.
76
+
77
+ Generic requests without a caller signal default to 15 seconds.
78
+ If you increase a hook deadline, also allow enough time in the host hook configuration.
55
79
  Transient failures return partial results with a diagnostic. Any 401/403 discards all results.
56
- Other bank/config/page reads use an explicit assigned bank; mutations cannot target additional read banks.
80
+
81
+ Other reads for banks, configuration and pages use an explicit assigned bank. Mutations can target only the write bank.
57
82
 
58
83
  See `DEVIATIONS.md` for intentional differences and `UPSTREAM.json` for exact provenance.
84
+
package/UPSTREAM.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "commit": "39c65ffe2f140d0c84cee58566cad8900c5b9908",
2
+ "commit": "a5a619b5ca59c5c39e0f96be6f7a31fabd136bd5",
3
3
  "files": {
4
4
  ".gitignore": "adb911f1ff2d2103411b4bbe90a167b4c7ef5acd38231fff55519c581f2bbd1b",
5
- "README.md": "93c6c188f47536022afff8d836496f4268e07a39cc007a5d449ebfadfc0be21c",
5
+ "README.md": "87f35964226b72c8a8bcdfec5f7d6d1d1e07187bd29ebe2b27241f77669ab830",
6
6
  "cordis.patch.yml": "0109fe6515d1c4fb25f30d14fa532f341a116d58e813864eb764053b9cbcceae",
7
7
  "e2e/Dockerfile.base": "c0f450ed6ee4c0cf0d7ea4420e4108fcd46e7360fef9a257392a6148d1ec1910",
8
8
  "e2e/Dockerfile.claude-code": "aa2087e40d91384d76de9962c804b5fc1fbed5ad4af49d17689ade4239baa186",
@@ -29,12 +29,12 @@
29
29
  "e2e/zcode-e2e-exec.sh": "66d9ad1fc55356c931fe5ae53bee4ce42863fce80270b5a29fa742898e919703",
30
30
  "hooks/hooks.json": "1d0617fd75a5729fa5b5fdb67b248384eaa74bf2c647c3b494b2fe05d83e292e",
31
31
  "index.js": "4d906968db9b5d32c27db47799700b1b4739cd16bd3322c23b8842593af3264d",
32
- "package-lock.json": "ca2b39660d53b0f5f3ff3c887f40540165286ab865fea74bf9a7a1845938a0c9",
33
- "package.json": "12510aa835394fe548839f92d32a35449277544128c771dbcea8d6906bb466c8",
34
- "plugin.json": "7d39522d47063c2c9fc9bfbd64c3bbea1da8f830423420ccff8bbe64ad15e133",
32
+ "package-lock.json": "df25ee2d0444348448a4875682389bed0bec4213d78681a1df4047b9984b5d17",
33
+ "package.json": "c1ea323677927a79f295e0ecb3730c21f982edb59d27254f3b6d3ca6f41d2020",
34
+ "plugin.json": "bc6827dbba0bdf1b48d9c76d017c79ed72203ad31d095a8a124ac25ee13cd407",
35
35
  "scripts/build-skill.mjs": "6aa241650e1c76905a86dd6b6ccaa544786ad7246c62554f2c548a064b404b80",
36
- "skill/SKILL.md": "30d04263f840c03f6ad90293255165bac108db662754488343717ccb800580f5",
37
36
  "skill-src/preamble.md": "711d0830e7192a55fc725226d41c47bf993437687f1d1dfd5a84056c1cbe8b64",
37
+ "skill/SKILL.md": "dd3a78db3e533f5053fb3f478d8de5971d0a4473cc26b48ed1107630bea1ff27",
38
38
  "src/antigravity-hook.ts": "fba83a6133dee3058d4e0cc596ee9cfbd9197bdbb58f54b1530c47a2b8b7c74f",
39
39
  "src/antigravity-statusline.test.ts": "e3e4b1f93967dbf0133cb87677978dd422b672a02d1138829f4fdcac1a6069d5",
40
40
  "src/antigravity-statusline.ts": "9e4fd2f6ed17bceff7a80b9078384e523b2b18bb84779f289f8b467a204bf614",
@@ -75,9 +75,9 @@
75
75
  "src/core/git-layout.test.ts": "19b035a97d52457c70b78e9a79128d23aa0ecd5f0ceca47a0415141f8f413848",
76
76
  "src/core/git-layout.ts": "2f4be171b6252d41cb0d9582c0879cca92206e28ca82ea6a24c187ce68bafc19",
77
77
  "src/core/git-stderr.test.ts": "e32bf64f33620020a129d35396897a9d53799e0c66d8a6b6f6333065f0b6b3b7",
78
- "src/core/git.gitlog.test.ts": "f8a5d7bdc371f3cf45b8b40f7f92b0b2dd433afdabf6d209ef478fc5f8add175",
78
+ "src/core/git.gitlog.test.ts": "845ba224163f97d8815b1f7e7efcfec2c5d5e2c8dfb1ec8ee829fb700ad36cc3",
79
79
  "src/core/git.test.ts": "3adf7e25fc5ccb6dfbe39b2c7e4edb723c6403f3397a387f5f82d0f83076649f",
80
- "src/core/git.ts": "0bd216aa92701608b1d4729cea15863d9b87bcf67bb77d698223f5cf4c16e26c",
80
+ "src/core/git.ts": "74af05b42c09c2d37d0287303a0e149c4c88ebe049bb17e13de86343e6bc7f41",
81
81
  "src/core/hindsight.pages.test.ts": "130af6279155e3f6a96b71b237ef1351528a119a24685ea8c337551979901110",
82
82
  "src/core/hindsight.test.ts": "8ef84394a5a06c63126bf9663814e2b35f72f0bfd913420582ebf9c155628441",
83
83
  "src/core/hindsight.ts": "0b3a204f84f3bd2f2317d5bcab31ea9ffb0ba94a05c48b4ac5f9e5aa8d7d65b8",
@@ -210,6 +210,7 @@
210
210
  "src/grok-hook.ts": "59f85f9a5cc26c82c748bd993c54dfa929f36237985ba0e8262d3b9d031d120e",
211
211
  "src/grok-sessionstart-hook.ts": "e80a45a2571139008472fb13b27958c31f3ff158f05b7e0693d502bd69ca5128",
212
212
  "src/grok-stop-hook.ts": "abb8c9b7523a79d54d38244996fff821ea222d9141501cda7d0231c5307b74d0",
213
+ "src/harness.e2e.test.ts": "cf3d328fb6efafeef83dad2822248d7ea76c3e5ab91e91cfc28d06fe643fdcb7",
213
214
  "src/harness/hook-lifecycle.test.ts": "c1acb1be5417e777456b248e3243e2d1e71f7463e9a5a00838af328314fd2438",
214
215
  "src/harness/hook-lifecycle.ts": "71f704b1227ef50d8eb9a00c833d5a9b677b890f6db3baa976a66932efc52a63",
215
216
  "src/harness/opencode.test.ts": "ec7529733b5c599724a8dd80c6873fe4d061920fb8cb5e5204290f4415292244",
@@ -222,7 +223,6 @@
222
223
  "src/harness/plugin-entry.ts": "3b6a14000cc9c8c90ff07af6b0cabc33ad8c32f424b18ac0fef56b8ea29e514b",
223
224
  "src/harness/registry.test.ts": "ea3fd02adfeca8c07c695b47ef4c2a3799665e7289a36e08712bca3c376fbd35",
224
225
  "src/harness/registry.ts": "75b56ebbc527d4a30efe554e479dc8606b8dd6b205161fd497abe51d886a8d24",
225
- "src/harness.e2e.test.ts": "cf3d328fb6efafeef83dad2822248d7ea76c3e5ab91e91cfc28d06fe643fdcb7",
226
226
  "src/hindsight-seed.ts": "f1a45eabde45121f4979fcc5b94bd0966a43c0c0277172b45e273a1f093b5c38",
227
227
  "src/index.ts": "f98fb7b77d62fd74176fe572a232fda6436591eba9fec109aeb13047a4a03841",
228
228
  "src/install-ui.test.ts": "e44d5a0009ce1f56aab547e1cf11c63ef4caad9c81f85f1753a8dd38b056930e",
@@ -259,5 +259,5 @@
259
259
  },
260
260
  "path": "hindsight-integrations/coding-agents",
261
261
  "source": "https://github.com/vectorize-io/hindsight",
262
- "version": "0.8.1"
262
+ "version": "0.8.2"
263
263
  }
@@ -1277,7 +1277,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1277
1277
  ];
1278
1278
 
1279
1279
  // package.json
1280
- var version = "0.8.2";
1280
+ var version = "0.8.9";
1281
1281
 
1282
1282
  // src/core/util.ts
1283
1283
  import { accessSync, constants } from "fs";
@@ -3175,20 +3175,25 @@ function* readJsonl(path) {
3175
3175
  try {
3176
3176
  const buffer = Buffer.allocUnsafe(CHUNK_BYTES);
3177
3177
  const decoder = new StringDecoder("utf8");
3178
- let pending = "";
3178
+ let fragments = [];
3179
3179
  let position = 0;
3180
3180
  for (; ; ) {
3181
3181
  const bytesRead = readSync2(fd, buffer, 0, buffer.length, position);
3182
3182
  if (bytesRead <= 0) break;
3183
3183
  position += bytesRead;
3184
- pending += decoder.write(buffer.subarray(0, bytesRead));
3184
+ const chunk = decoder.write(buffer.subarray(0, bytesRead));
3185
+ let start = 0;
3185
3186
  let newline;
3186
- while ((newline = pending.indexOf("\n")) !== -1) {
3187
- yield pending.slice(0, newline);
3188
- pending = pending.slice(newline + 1);
3187
+ while ((newline = chunk.indexOf("\n", start)) !== -1) {
3188
+ fragments.push(chunk.slice(start, newline));
3189
+ yield fragments.join("");
3190
+ fragments = [];
3191
+ start = newline + 1;
3189
3192
  }
3193
+ if (start < chunk.length) fragments.push(chunk.slice(start));
3190
3194
  }
3191
- pending += decoder.end();
3195
+ fragments.push(decoder.end());
3196
+ const pending = fragments.join("");
3192
3197
  if (pending) yield pending;
3193
3198
  } finally {
3194
3199
  closeSync2(fd);
@@ -4577,7 +4582,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
4577
4582
  var version2 = {
4578
4583
  major: 4,
4579
4584
  minor: 6,
4580
- patch: 5
4585
+ patch: 7
4581
4586
  };
4582
4587
 
4583
4588
  // node_modules/zod/v4/core/schemas.js
@@ -880,7 +880,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
880
880
  ];
881
881
 
882
882
  // package.json
883
- var version = "0.8.2";
883
+ var version = "0.8.9";
884
884
 
885
885
  // src/core/util.ts
886
886
  import { accessSync, constants } from "fs";
@@ -1214,7 +1214,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1214
1214
  ];
1215
1215
 
1216
1216
  // package.json
1217
- var version = "0.8.2";
1217
+ var version = "0.8.9";
1218
1218
 
1219
1219
  // src/core/util.ts
1220
1220
  import { accessSync, constants } from "fs";
@@ -3142,20 +3142,25 @@ function* readJsonl(path) {
3142
3142
  try {
3143
3143
  const buffer = Buffer.allocUnsafe(CHUNK_BYTES);
3144
3144
  const decoder = new StringDecoder("utf8");
3145
- let pending = "";
3145
+ let fragments = [];
3146
3146
  let position = 0;
3147
3147
  for (; ; ) {
3148
3148
  const bytesRead = readSync2(fd, buffer, 0, buffer.length, position);
3149
3149
  if (bytesRead <= 0) break;
3150
3150
  position += bytesRead;
3151
- pending += decoder.write(buffer.subarray(0, bytesRead));
3151
+ const chunk = decoder.write(buffer.subarray(0, bytesRead));
3152
+ let start = 0;
3152
3153
  let newline;
3153
- while ((newline = pending.indexOf("\n")) !== -1) {
3154
- yield pending.slice(0, newline);
3155
- pending = pending.slice(newline + 1);
3154
+ while ((newline = chunk.indexOf("\n", start)) !== -1) {
3155
+ fragments.push(chunk.slice(start, newline));
3156
+ yield fragments.join("");
3157
+ fragments = [];
3158
+ start = newline + 1;
3156
3159
  }
3160
+ if (start < chunk.length) fragments.push(chunk.slice(start));
3157
3161
  }
3158
- pending += decoder.end();
3162
+ fragments.push(decoder.end());
3163
+ const pending = fragments.join("");
3159
3164
  if (pending) yield pending;
3160
3165
  } finally {
3161
3166
  closeSync2(fd);
@@ -4770,7 +4775,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
4770
4775
  var version2 = {
4771
4776
  major: 4,
4772
4777
  minor: 6,
4773
- patch: 5
4778
+ patch: 7
4774
4779
  };
4775
4780
 
4776
4781
  // node_modules/zod/v4/core/schemas.js
@@ -1277,7 +1277,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1277
1277
  ];
1278
1278
 
1279
1279
  // package.json
1280
- var version = "0.8.2";
1280
+ var version = "0.8.9";
1281
1281
 
1282
1282
  // src/core/util.ts
1283
1283
  import { accessSync, constants } from "fs";
@@ -3175,20 +3175,25 @@ function* readJsonl(path) {
3175
3175
  try {
3176
3176
  const buffer = Buffer.allocUnsafe(CHUNK_BYTES);
3177
3177
  const decoder = new StringDecoder("utf8");
3178
- let pending = "";
3178
+ let fragments = [];
3179
3179
  let position = 0;
3180
3180
  for (; ; ) {
3181
3181
  const bytesRead = readSync2(fd, buffer, 0, buffer.length, position);
3182
3182
  if (bytesRead <= 0) break;
3183
3183
  position += bytesRead;
3184
- pending += decoder.write(buffer.subarray(0, bytesRead));
3184
+ const chunk = decoder.write(buffer.subarray(0, bytesRead));
3185
+ let start = 0;
3185
3186
  let newline;
3186
- while ((newline = pending.indexOf("\n")) !== -1) {
3187
- yield pending.slice(0, newline);
3188
- pending = pending.slice(newline + 1);
3187
+ while ((newline = chunk.indexOf("\n", start)) !== -1) {
3188
+ fragments.push(chunk.slice(start, newline));
3189
+ yield fragments.join("");
3190
+ fragments = [];
3191
+ start = newline + 1;
3189
3192
  }
3193
+ if (start < chunk.length) fragments.push(chunk.slice(start));
3190
3194
  }
3191
- pending += decoder.end();
3195
+ fragments.push(decoder.end());
3196
+ const pending = fragments.join("");
3192
3197
  if (pending) yield pending;
3193
3198
  } finally {
3194
3199
  closeSync2(fd);
@@ -4577,7 +4582,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
4577
4582
  var version2 = {
4578
4583
  major: 4,
4579
4584
  minor: 6,
4580
- patch: 5
4585
+ patch: 7
4581
4586
  };
4582
4587
 
4583
4588
  // node_modules/zod/v4/core/schemas.js
@@ -1348,7 +1348,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1348
1348
  ];
1349
1349
 
1350
1350
  // package.json
1351
- var version = "0.8.2";
1351
+ var version = "0.8.9";
1352
1352
 
1353
1353
  // src/core/util.ts
1354
1354
  import { accessSync, constants } from "fs";
@@ -2924,20 +2924,25 @@ function* readJsonl(path) {
2924
2924
  try {
2925
2925
  const buffer = Buffer.allocUnsafe(CHUNK_BYTES);
2926
2926
  const decoder = new StringDecoder("utf8");
2927
- let pending = "";
2927
+ let fragments = [];
2928
2928
  let position = 0;
2929
2929
  for (; ; ) {
2930
2930
  const bytesRead = readSync2(fd, buffer, 0, buffer.length, position);
2931
2931
  if (bytesRead <= 0) break;
2932
2932
  position += bytesRead;
2933
- pending += decoder.write(buffer.subarray(0, bytesRead));
2933
+ const chunk = decoder.write(buffer.subarray(0, bytesRead));
2934
+ let start = 0;
2934
2935
  let newline;
2935
- while ((newline = pending.indexOf("\n")) !== -1) {
2936
- yield pending.slice(0, newline);
2937
- pending = pending.slice(newline + 1);
2936
+ while ((newline = chunk.indexOf("\n", start)) !== -1) {
2937
+ fragments.push(chunk.slice(start, newline));
2938
+ yield fragments.join("");
2939
+ fragments = [];
2940
+ start = newline + 1;
2938
2941
  }
2942
+ if (start < chunk.length) fragments.push(chunk.slice(start));
2939
2943
  }
2940
- pending += decoder.end();
2944
+ fragments.push(decoder.end());
2945
+ const pending = fragments.join("");
2941
2946
  if (pending) yield pending;
2942
2947
  } finally {
2943
2948
  closeSync2(fd);
@@ -5260,7 +5265,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
5260
5265
  var version2 = {
5261
5266
  major: 4,
5262
5267
  minor: 6,
5263
- patch: 5
5268
+ patch: 7
5264
5269
  };
5265
5270
 
5266
5271
  // node_modules/zod/v4/core/schemas.js
@@ -1214,7 +1214,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
1214
1214
  ];
1215
1215
 
1216
1216
  // package.json
1217
- var version = "0.8.2";
1217
+ var version = "0.8.9";
1218
1218
 
1219
1219
  // src/core/util.ts
1220
1220
  import { accessSync, constants } from "fs";
@@ -3142,20 +3142,25 @@ function* readJsonl(path) {
3142
3142
  try {
3143
3143
  const buffer = Buffer.allocUnsafe(CHUNK_BYTES);
3144
3144
  const decoder = new StringDecoder("utf8");
3145
- let pending = "";
3145
+ let fragments = [];
3146
3146
  let position = 0;
3147
3147
  for (; ; ) {
3148
3148
  const bytesRead = readSync2(fd, buffer, 0, buffer.length, position);
3149
3149
  if (bytesRead <= 0) break;
3150
3150
  position += bytesRead;
3151
- pending += decoder.write(buffer.subarray(0, bytesRead));
3151
+ const chunk = decoder.write(buffer.subarray(0, bytesRead));
3152
+ let start = 0;
3152
3153
  let newline;
3153
- while ((newline = pending.indexOf("\n")) !== -1) {
3154
- yield pending.slice(0, newline);
3155
- pending = pending.slice(newline + 1);
3154
+ while ((newline = chunk.indexOf("\n", start)) !== -1) {
3155
+ fragments.push(chunk.slice(start, newline));
3156
+ yield fragments.join("");
3157
+ fragments = [];
3158
+ start = newline + 1;
3156
3159
  }
3160
+ if (start < chunk.length) fragments.push(chunk.slice(start));
3157
3161
  }
3158
- pending += decoder.end();
3162
+ fragments.push(decoder.end());
3163
+ const pending = fragments.join("");
3159
3164
  if (pending) yield pending;
3160
3165
  } finally {
3161
3166
  closeSync2(fd);
@@ -4770,7 +4775,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
4770
4775
  var version2 = {
4771
4776
  major: 4,
4772
4777
  minor: 6,
4773
- patch: 5
4778
+ patch: 7
4774
4779
  };
4775
4780
 
4776
4781
  // node_modules/zod/v4/core/schemas.js