dsh-hashline-edit 0.3.8 → 0.3.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.
package/README.md CHANGED
@@ -19,17 +19,17 @@ The semantic core is the [pi-better-edit](https://github.com/Rianico/pi-better-e
19
19
 
20
20
  The anchor width is baked into the build. Set `PI_BETTER_EDIT_ANCHOR_WIDTH` when you build or pack:
21
21
 
22
- - `PI_BETTER_EDIT_ANCHOR_WIDTH=3 pnpm run build` (and `pnpm pack`) produces a fully 3-char artifact.
23
- - unset or `4` builds the 4-char default.
22
+ - unset builds the 3-char default.
23
+ - `PI_BETTER_EDIT_ANCHOR_WIDTH=4 pnpm run build` (and `pnpm pack`) produces a fully 4-char artifact.
24
24
 
25
25
  | Value | Anchor width | Usable space | Anchor generation |
26
26
  | --- | --- | --- | --- |
27
- | unset or `4` (default) | 4 chars | 14,766,336 | 1 |
28
- | `3` | 3 chars | 237,328 | 2 |
27
+ | unset (default) | 3 chars | 237,328 | 2 |
28
+ | `4` | 4 chars | 14,766,336 | 1 |
29
29
 
30
30
  The value is inlined into the bundle at build time (`esbuild define`), so the installed plugin never reads an environment variable at runtime — a 3-char build stays 3-char. The persisted store is keyed by the anchor generation, so changing the build width is a hard cache miss (served rows are simply re-read), never a cross-width hit. Width 4 keeps generation 1, so existing stores keep working unchanged.
31
31
 
32
- Measured on the DeepSeek-V4.1 tokenizer, a 3-char anchor averages ~2.3 tokens and a 4-char anchor ~3.0 tokens per served line, and neither collapses to one token (see [ADR-0020](docs/adr/0020-configurable-anchor-width-3-4.md)). The default stays 4 to preserve the existing persisted contract; build with `PI_BETTER_EDIT_ANCHOR_WIDTH=3` to ship 3-char.
32
+ Measured on the DeepSeek-V4.1 tokenizer, a 3-char anchor averages ~2.3 tokens and a 4-char anchor ~3.0 tokens per served line, and neither collapses to one token (see [ADR-0020](docs/adr/0020-configurable-anchor-width-3-4.md)). The default is 3; build with `PI_BETTER_EDIT_ANCHOR_WIDTH=4` to ship the 4-char artifact, whose generation-1 store keeps existing rows valid.
33
33
 
34
34
  ## Install
35
35
 
package/lib/index.js CHANGED
@@ -48,7 +48,7 @@ import {
48
48
  import { dirname as dirname2, join as join4, parse, resolve, sep } from "node:path";
49
49
 
50
50
  // src/hashline/alphabet.ts
51
- var HASH_LEN = true ? 4 : resolveAnchorWidth(process.env);
51
+ var HASH_LEN = true ? 3 : resolveAnchorWidth(process.env);
52
52
  var ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
53
53
  var ALPHA_SAFE = ALPHA.replace(/-/g, "\\-");
54
54
  var ALPHA_RE = new RegExp(`^[${ALPHA_SAFE}]+$`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-hashline-edit",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "Hash-anchored read/apply_patch tools for DeepSeek Harness (dsh). Every line gets a unique 3- or 4-char hash (A-Za-z0-9, configurable) that stays stable across edits; apply_patch is the only file-mutation entry point and commits one patch batch per transaction. Undo persists across restarts.",
5
5
  "keywords": [
6
6
  "anchors",