@fingerskier/augment 0.1.10 → 0.2.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 +20 -2
  2. package/dist/cli.d.ts +6 -0
  3. package/dist/cli.js +43 -2
  4. package/dist/cli.js.map +1 -1
  5. package/dist/constants.d.ts +3 -0
  6. package/dist/constants.js +19 -3
  7. package/dist/constants.js.map +1 -1
  8. package/dist/daemon/client.d.ts +5 -0
  9. package/dist/daemon/client.js +15 -6
  10. package/dist/daemon/client.js.map +1 -1
  11. package/dist/daemon/http.d.ts +1 -1
  12. package/dist/daemon/http.js +159 -53
  13. package/dist/daemon/http.js.map +1 -1
  14. package/dist/daemon/main.js +15 -1
  15. package/dist/daemon/main.js.map +1 -1
  16. package/dist/daemon/scheduler.d.ts +17 -0
  17. package/dist/daemon/scheduler.js +77 -0
  18. package/dist/daemon/scheduler.js.map +1 -0
  19. package/dist/daemon/single-instance.d.ts +32 -0
  20. package/dist/daemon/single-instance.js +131 -0
  21. package/dist/daemon/single-instance.js.map +1 -0
  22. package/dist/db.d.ts +13 -1
  23. package/dist/db.js +166 -105
  24. package/dist/db.js.map +1 -1
  25. package/dist/hooks.js +28 -3
  26. package/dist/hooks.js.map +1 -1
  27. package/dist/install.d.ts +2 -0
  28. package/dist/install.js +41 -7
  29. package/dist/install.js.map +1 -1
  30. package/dist/mcp/server.js +30 -4
  31. package/dist/mcp/server.js.map +1 -1
  32. package/dist/recall.d.ts +2 -0
  33. package/dist/recall.js +1 -0
  34. package/dist/recall.js.map +1 -1
  35. package/dist/service.d.ts +64 -1
  36. package/dist/service.js +269 -35
  37. package/dist/service.js.map +1 -1
  38. package/dist/sleep.d.ts +43 -0
  39. package/dist/sleep.js +129 -0
  40. package/dist/sleep.js.map +1 -0
  41. package/dist/tally.d.ts +46 -0
  42. package/dist/tally.js +94 -0
  43. package/dist/tally.js.map +1 -0
  44. package/dist/types.d.ts +6 -0
  45. package/dist/util/text.d.ts +3 -0
  46. package/dist/util/text.js +26 -2
  47. package/dist/util/text.js.map +1 -1
  48. package/docs/FEATURES.md +155 -50
  49. package/docs/verify-memory-flow.md +28 -9
  50. package/package.json +1 -1
@@ -7,7 +7,7 @@ relying on the agent to remember to call the MCP tools:
7
7
  | ------------------ | ---------------------------------- | ------ |
8
8
  | `SessionStart` | `augment hook session-start` | Warms the daemon and registers the project. |
9
9
  | `UserPromptSubmit` | `augment hook user-prompt-submit` | Recalls relevant memory and injects it as `additionalContext` **before** the model sees the prompt. |
10
- | `PreToolUse` | `augment hook pre-tool-use` | Recalls **additional** memory keyed to the matched tool action (the edited file / the Bash command) and injects it as `additionalContext`. Matcher-scoped to `Edit\|Write\|Bash` to bound the hot path; injection-only (never blocks, gates, or rewrites a tool call). |
10
+ | `PreToolUse` | `augment hook pre-tool-use` | Recalls **additional** memory keyed to the matched tool action (the edited file / the Bash command) and injects it as `additionalContext`. Matcher-scoped to `Edit\|Write\|Bash` to bound the hot path; injection-only (never blocks, gates, or rewrites a tool call). Uses a raised relevance floor (`min_score` 0.45 — above the 0.4 search default, calibrated on the real model because tool queries are command/path-shaped, not prose) and injects each distinct query at most once per session. |
11
11
  | `Stop` | `augment hook stop` | Blocks the turn **once** with a directive to upsert a memory, then allows the stop (loop-guarded per turn). |
12
12
 
13
13
  `PreToolUse` fires before **every matched** tool call, so it is the only hook with a tool-name
@@ -33,7 +33,8 @@ npm test
33
33
  Covers:
34
34
  - `test/hooks.test.ts` — the stdin→stdout contract of every hook event
35
35
  (UserPromptSubmit envelope, PreToolUse tool-query derivation + injection-only
36
- envelope, Stop block-once loop guard, fail-open paths).
36
+ envelope + 0.45 floor + per-session dedupe, Stop block-once loop guard,
37
+ fail-open paths).
37
38
  - `test/recall.test.ts` — recall degrades to `""` on any failure (a hook must
38
39
  never break the agent).
39
40
  - `test/cli.test.ts` — the `recall` and `hook` CLI commands.
@@ -76,6 +77,17 @@ a cold machine, downloads the bge-small model — so the very first run is slow.
76
77
  This is real-model retrieval; ranking quality (not just wiring) is what you're
77
78
  eyeballing here.
78
79
 
80
+ Two footnotes on the examples: they omit `session_id`, which deliberately skips
81
+ the PreToolUse once-per-session dedupe — include one to demo it. And the Stop
82
+ loop-guard marker persists in the OS tmpdir, so re-running the stop example
83
+ later with the same `session_id`/`prompt_id` yields empty on the *first* call
84
+ too — use fresh ids per run.
85
+
86
+ For a binding version of the ranking-quality check, `npm run test:model` runs
87
+ the pinned real-bge abstention/recall tripwires
88
+ (`test/real-model-abstention.model.ts`) — what this layer can otherwise only
89
+ eyeball.
90
+
79
91
  ## 3. Real project (host-level hook firing)
80
92
 
81
93
  1. Install into a repo (or user scope):
@@ -100,13 +112,20 @@ eyeballing here.
100
112
 
101
113
  ## Known caveats (logged, not blockers)
102
114
 
103
- - **Per-prompt latency.** Each hook shells out via `npm exec --yes` (self-bootstrapping,
104
- matches the MCP server). On UserPromptSubmit that adds startup overhead before
105
- every prompt. A direct-node invocation is a planned optimization.
115
+ - **Hook startup cost (resolved).** Hooks now invoke the install-time-provisioned
116
+ runtime directly (`node <prefix>/node_modules/@fingerskier/augment/dist/bin/augment.js
117
+ hook <event>`, tens of milliseconds) the old `npm exec --yes` form paid a
118
+ multi-second npm bootstrap per event. Residual caveat: provisioning is
119
+ best-effort. If npm was missing at install time the installer prints a manual
120
+ `npm install --prefix <prefix> @fingerskier/augment` command and hooks fail
121
+ open (silent no-ops) until it is run. The MCP server itself still launches via
122
+ `npm exec`; only the hook hot path changed.
106
123
  - **Claude hook activation depends on plugin install.** The MCP server is also
107
124
  direct-registered (so the tools always exist), but the hooks live in the plugin;
108
125
  if the plugin isn't installed, the loop degrades to the CLAUDE.md prose guidance.
109
- - **Retrieval floor calibration.** Real bge-small cosine is mis-normalized
110
- (`(cos+1)/2`), so abstention is weaker than intended on the real model — see
111
- `.council/memory/retrieval-quality-roadmap.md`. The flow still injects; it just
112
- may inject loosely-related memory. Tracked separately.
126
+ - **Retrieval floor calibration (resolved).** The `(cos+1)/2` mis-normalization
127
+ is fixed by an empirically-anchored cosine rescale (`SEMANTIC_COSINE_BASELINE`
128
+ 0.33), and abstention is now proven on the real model by `npm run test:model`.
129
+ Remaining retrieval-quality follow-ups (Phase 2 dogfood tally, credential-warn,
130
+ HF revision pin) are tracked in `.council/memory/retrieval-quality-roadmap.md`
131
+ and [ROADMAP.md](../ROADMAP.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fingerskier/augment",
3
- "version": "0.1.10",
3
+ "version": "0.2.0",
4
4
  "description": "Local RAG memory system for coding agents",
5
5
  "type": "module",
6
6
  "publishConfig": {