@lmzhen/dsh-memory-files 0.32.4 → 0.32.6

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 +10 -26
  2. package/lib/index.js +2 -1
  3. package/package.json +7 -7
package/README.md CHANGED
@@ -1,33 +1,17 @@
1
1
  # @lmzhen/dsh-memory-files
2
2
 
3
- Local layered memory provider: registers the `files` provider into `ctx.memory` over the IO seam.
3
+ Default layered memory provider backed by `MEMORY.md` and `USER.md`. It registers as `files` and publishes the effective memory-budget view used by diagnostics.
4
4
 
5
- ## Model surface
5
+ `root` defaults to `$DSH_HOME/memories`. The store enforces its character budget on the final result and refuses overflow rather than silently truncating an entry. Batch writes are serialized within the provider; cross-process safety still depends on the selected IO backend.
6
6
 
7
- - **Model-visible:** nothing of its own: `tool-memory` owns the tool and the injection.
8
- - **Prompt prefix / KV cache:** unchanged by this package: family-level rules single-sourced in `packages/README.md` §"Model-visible prompt prefix and the KV cache".
9
- - **Mount it?** yes — the `memory-files` provider row, in `evolution-host`/`evolution-all`/one-click `evolution-preset`.
7
+ ## Budgets and defaults
10
8
 
11
- ## Configuration
9
+ - `memoryChars`: fallback default 2,200 characters for `MEMORY.md`.
10
+ - `userChars`: fallback default 1,375 characters for `USER.md`.
11
+ - `addDatePrefix`: default `false`.
12
+ - `maxConsolidationFailures`: default 3 failures before the model is told to stop retrying.
13
+ - `providerName`: default `files`.
12
14
 
13
- - `providerName` (default `files`): the registered name.
14
- - `memoryCharLimit` / `userCharLimit` (`2200` / `1375`) the budget the STORE enforces per target.
15
- Deprecated names (G0/S0.3): the canonical ids are the policy row's `memoryChars` /
16
- `userChars` (what the review planner reads). The two sides are not
17
- auto-synchronised — `/evolution doctor` reports the divergence (`budgetIssues`).
18
- Reading the legacy names still works; writing them is refused. Removal was planned for 0.7.0 and is deferred:
19
- both aliases still ship, so no later version is claimed here.
20
- - `root`: directory override; `''` means `$DSH_HOME/memories`.
21
- - `addDatePrefix` / `maxConsolidationFailures` (`false` / `3`) date prefixes on entries; consolidation failures one turn tolerates.
22
- - `threatExemptLabels` (default `[]`): benign threat labels for the MEMORY store (per-site rule in `evolution-threat`).
15
+ An explicit row/user value wins. Otherwise an already mounted evolution-policy budget takes precedence over the package fallback. The row budget controls what the store enforces; the policy budget controls what review plans against, so an explicit mismatch is warned about and surfaced by doctor.
23
16
 
24
- ## Known limitations
25
-
26
- - **The memory budget is configured in two places.** `memoryCharLimit`/`userCharLimit` (this package) is what the STORE enforces; `evolution-policy`'s `memoryChars`/`userChars` is what the review pipeline PLANS against. An unset limit follows the mounted policy, an explicit value wins, a contradiction warns once at load; `/evolution doctor` re-checks the pair at run time.
27
- - Nothing selects this provider implicitly: with `memory.provider` empty the FIRST registered provider serves every read/write: set the pin or row order decides.
28
-
29
- **Runtime invariant:** No companion is published. The platform auto-assembles nothing and the family mounts no `<pkg>/invariant` cordis row, so a companion here would never execute (v37 S2.1 / I-3).
30
-
31
- ## Notes and history
32
-
33
- - `memory.provider` pins the registry to one name (V27 G6.3), and with the pin empty the FIRST registered provider serves every read/write: so with two providers mounted, set the pin or the choice is row order.
17
+ `memoryCharLimit` and `userCharLimit` remain readable deprecated aliases of `memoryChars` and `userChars`; writes to the old names are refused (G0/S0.3). `threatExemptLabels` is deployment security configuration and defaults to empty.
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { resolve } from "node:path";
3
3
  import z from "@deepseek-ai/schemastery";
4
- import { DEFAULT_CONSOLIDATION_FAILURES, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_USER_CHAR_LIMIT, MemoryStore, clampOnce, evolutionIoAdapter, liveBool, makeSerialQueue, paramRowId, payloadText, unwrapLive, userSetKeys } from "@lmzhen/dsh-evolution-core";
4
+ import { DEFAULT_CONSOLIDATION_FAILURES, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_USER_CHAR_LIMIT, MemoryStore, clampOnce, evolutionIoAdapter, liveBool, makeSerialQueue, paramRowId, payloadText, registerOwnerSettings, unwrapLive, userSetKeys } from "@lmzhen/dsh-evolution-core";
5
5
  //#region lib/types/index.js
6
6
  /**
7
7
  * Local layered memory provider for `ctx.memory`.
@@ -21,6 +21,7 @@ const Config = z.object({
21
21
  threatExemptLabels: z.array(z.string()).default([])
22
22
  });
23
23
  function apply(ctx, rawConfig = {}) {
24
+ registerOwnerSettings(ctx, "memory-files", Config);
24
25
  ctx.inject(["settings"], (injected) => {
25
26
  const settings = injected.settings;
26
27
  if (typeof settings?.configure !== "function") return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-memory-files",
3
3
  "description": "Local layered memory provider (community build)",
4
- "version": "0.32.4",
4
+ "version": "0.32.6",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,17 +27,17 @@
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
29
  "@deepseek-ai/schemastery": "^3.18.5",
30
- "@lmzhen/dsh-evolution-core": "^0.32.4"
30
+ "@lmzhen/dsh-evolution-core": "^0.32.6"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@deepseek-ai/cordis": "^4.0.5",
34
- "@lmzhen/dsh-evolution-io": "^0.32.4",
35
- "@lmzhen/dsh-memory": "^0.32.4"
34
+ "@lmzhen/dsh-evolution-io": "^0.32.6",
35
+ "@lmzhen/dsh-memory": "^0.32.6"
36
36
  },
37
37
  "devDependencies": {
38
- "@lmzhen/dsh-evolution-core": "^0.32.4",
39
- "@lmzhen/dsh-evolution-io": "^0.32.4",
40
- "@lmzhen/dsh-memory": "^0.32.4"
38
+ "@lmzhen/dsh-evolution-core": "^0.32.6",
39
+ "@lmzhen/dsh-evolution-io": "^0.32.6",
40
+ "@lmzhen/dsh-memory": "^0.32.6"
41
41
  },
42
42
  "engines": {
43
43
  "dsh": ">=0.2.1-rc.2 <0.2.2-0"