dsh-better-edit 0.8.2 → 1.1.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 (79) hide show
  1. package/CHANGELOG.md +173 -99
  2. package/README.md +61 -33
  3. package/README.zh.md +20 -17
  4. package/cordis.patch.yml +1 -1
  5. package/lib/constants.js +19 -4
  6. package/lib/contract.js +136 -79
  7. package/lib/domain-errors.js +570 -0
  8. package/lib/edit-diff.js +33 -7
  9. package/lib/file-encoding-state.js +27 -7
  10. package/lib/file-view.js +305 -82
  11. package/lib/fs-bridge.js +23 -7
  12. package/lib/guidance/materialize.js +7 -7
  13. package/lib/guidance/resolve.js +13 -8
  14. package/lib/hash-store.js +404 -278
  15. package/lib/hashline/anchor-pipeline.js +586 -378
  16. package/lib/hashline/hash-assign.js +21 -22
  17. package/lib/hashline/hash.js +6 -6
  18. package/lib/hashline/index.js +1 -1
  19. package/lib/hashline/resolve.js +1 -1
  20. package/lib/hashline/served-guard.js +181 -0
  21. package/lib/index.js +37 -11
  22. package/lib/mutation/engine.js +392 -96
  23. package/lib/mutation.js +22 -130
  24. package/lib/noop-guard.js +20 -9
  25. package/lib/prompts.js +20 -18
  26. package/lib/read-and-serve.js +44 -20
  27. package/lib/sandbox.js +1 -1
  28. package/lib/session-view.js +57 -43
  29. package/lib/snapshot-store/index.js +97 -0
  30. package/lib/snapshot-store/lineage-store.js +400 -0
  31. package/lib/snapshot-store/migrate.js +80 -0
  32. package/lib/snapshot-store/pairing.js +412 -0
  33. package/lib/snapshot-store/txn.js +63 -0
  34. package/lib/snapshot-store/vacuum.js +243 -0
  35. package/lib/store-lifecycle.js +13 -1
  36. package/lib/store-retry.js +34 -0
  37. package/lib/tool-edit.js +90 -44
  38. package/lib/tool-read.js +29 -1
  39. package/lib/tool-str-replace-editor.js +26 -18
  40. package/lib/tool-undo.js +25 -8
  41. package/lib/types/constants.d.ts +5 -2
  42. package/lib/types/contract.d.ts +76 -71
  43. package/lib/types/domain-errors.d.ts +410 -0
  44. package/lib/types/edit-response.d.ts +1 -1
  45. package/lib/types/file-encoding-state.d.ts +1 -0
  46. package/lib/types/file-view.d.ts +35 -6
  47. package/lib/types/guidance/materialize.d.ts +2 -2
  48. package/lib/types/guidance/resolve.d.ts +14 -2
  49. package/lib/types/hash-store.d.ts +38 -19
  50. package/lib/types/hashline/anchor-pipeline.d.ts +117 -36
  51. package/lib/types/hashline/hash-assign.d.ts +5 -5
  52. package/lib/types/hashline/hash.d.ts +1 -1
  53. package/lib/types/hashline/index.d.ts +2 -2
  54. package/lib/types/hashline/served-guard.d.ts +100 -0
  55. package/lib/types/index.d.ts +3 -3
  56. package/lib/types/mutation/engine.d.ts +49 -30
  57. package/lib/types/mutation.d.ts +1 -39
  58. package/lib/types/noop-guard.d.ts +4 -4
  59. package/lib/types/prompts.d.ts +1 -1
  60. package/lib/types/read-and-serve.d.ts +6 -0
  61. package/lib/types/sandbox.d.ts +1 -1
  62. package/lib/types/session-view.d.ts +38 -9
  63. package/lib/types/snapshot-store/index.d.ts +28 -0
  64. package/lib/types/snapshot-store/lineage-store.d.ts +96 -0
  65. package/lib/types/snapshot-store/migrate.d.ts +16 -0
  66. package/lib/types/snapshot-store/pairing.d.ts +99 -0
  67. package/lib/types/snapshot-store/txn.d.ts +12 -0
  68. package/lib/types/snapshot-store/vacuum.d.ts +79 -0
  69. package/lib/types/store-lifecycle.d.ts +0 -1
  70. package/lib/types/store-retry.d.ts +6 -0
  71. package/lib/types/tool-edit.d.ts +2 -2
  72. package/lib/types/tool-str-replace-editor.d.ts +2 -2
  73. package/lib/types/utils.d.ts +5 -6
  74. package/lib/types/workspace-context.d.ts +10 -1
  75. package/lib/undo-edit.js +27 -11
  76. package/lib/utils.js +12 -12
  77. package/lib/workspace-context.js +27 -9
  78. package/lib/write-hook.js +13 -4
  79. package/package.json +28 -30
package/CHANGELOG.md CHANGED
@@ -1,3 +1,77 @@
1
+ # Changelog
2
+
3
+ <!-- markdownlint-configure-file { "MD004": { "style": "asterisk" } } -->
4
+ <!-- Bullets stay `*`: semantic-release's preset writes `*`, and this file is excluded from the
5
+ formatters so they cannot normalize them to `-`. Keep `# Changelog` as the FIRST line:
6
+ @semantic-release/changelog rewrites the title in place only while the file starts with
7
+ the configured `changelogTitle`, and prepends release notes above it otherwise. Do not
8
+ move this title below the comments, and do not remove the title. -->
9
+
10
+ All notable changes to this project will be documented in this file.
11
+
12
+ ## [Unreleased]
13
+
14
+ ## [1.1.0] - 2026-10-22
15
+
16
+ ### Bug Fixes
17
+
18
+ * **dsh:** follow the session's live working directory instead of the immutable creation header - a `working_directory` change now retargets relative-path resolution and the per-workspace store (the 0.2.1 `workingDirectory` service; the header stays as the pre-0.2.1 fallback) (#83)
19
+ * **guidance:** derive each tool section's default order from the harness's canonical slot (`systemPrompt.getSectionOrder` for `TOOL_READ`/`TOOL_EDIT`, with a `1100`/`1300`/`1310` fallback) and seed the shipped `ptc` preset in place of the retired `code` (#83)
20
+
21
+ ### Documentation
22
+
23
+ * **docs:** state and document dsh `0.2.0+` support in both READMEs, and sync the plugin-authoring skill for `0.2.1-rc.2` - `agent/created`, the 1000-band section orders, the `workingDirectory` seam, the shipped preset ids, and `sandboxPermissionsDescription` (#83)
24
+
25
+ ### Miscellaneous Chores
26
+
27
+ * **deps:** upgrade the `@deepseek-ai/dsh-*` dev baseline to `0.2.1-rc.2` and `@deepseek-ai/cordis` to `4.0.5` (#83)
28
+
29
+ ## [1.0.0] - 2026-09-27
30
+
31
+ ### Features
32
+
33
+ * **absorb:** land the upstream v2 line-identity redesign on this branch - seam ports, lease identity, and served-span verification across 177 gated, mutant-proven commits (#81)
34
+ * **errors:** address headers to the addressee - `[TO MODEL]`/`[TO USER]` rendering so a cold reader tells addressee from channel; codes, remedies, and the sole composer unchanged (#81)
35
+ * **read:** enforce test-tree typechecking in the gate - the test config overrides the inherited base exclude, closing the zero-file coverage hole with 146 loaded test files (#81)
36
+
37
+ * **served:** a rejected edit now answers with the current rows of exactly the region the submitted anchors name (region-matched serve); the payload never re-binds another region, and re-read stays the recovery
38
+ * **store:** v7 content-addressed line identity — lines carry stable ids with lineage, leases key on identity, and materialization/undo resolve through it instead of position
39
+
40
+ ### Bug Fixes
41
+
42
+ * 对齐 DSH 0.1.6-alpha.2 并修复本地测试
43
+ * **edit:** a stale served span no longer heals silently onto a look-alike line — verification is exact-position and fail-closed (`E_STALE_RANGE` / `E_UNSERVED_RANGE`), removing the position-misaligned accept path
44
+ * **edit:** a rejected edit records and grants nothing, so the next fresh read cannot turn the rejection into a duplicate anchor
45
+ * **store:** the version-flap guard refuses an out-of-order store write instead of letting it clobber the newer version
46
+ * **store:** corrupt lineage repairs terminate, and store writes land as atomic snapshot+lineage pairs — no half-written families
47
+ * **errors:** the copied-anchor echo is one deny code (`E_SUSPICIOUS_TEXT`) across edit/write with a diagnosis that names the served line; the range family's re-read remedy is now truthful
48
+ * **read:** gate the positionless pseudo-previous reuse on the dense served mirror, so interleaved windowed reads no longer reshuffle anchors of a byte-identical file (#62)
49
+ * **hashline:** write 0-matched HASH│ content through literally — the bare-prefix guard now rejects only a line-start hash that is a real anchor of the file, and #63 deliberately supersedes #24's 0-matched arm (see ADR-0025) (#63)
50
+
51
+ ### Performance Improvements
52
+
53
+ * **snapshot-store:** an LRU vacuum bounds snapshot retention — global and per-path budgets with lease/undo pins honored; the deferred state is reported, never resolved by evicting a pin
54
+
55
+ ### Code Refactoring
56
+
57
+ * **errors:** the domain-error registry is the single source — declaration-only codes with no producer are deleted, and deferred upstream producers are gated per code by a producer oracle
58
+ * **served:** the orphaned-serve healing and candidate-span enumeration are gone; lease identity is the span-verification authority
59
+
60
+ ### Documentation
61
+
62
+ * **docs:** the v2 absorb's decisions are recorded — ADR-0016 through ADR-0025 landed (0025 records #63's deliberate supersession of #24's 0-matched strip arm; 0024's Landing forward-contract section now describes the wired reader), stale code names in older ADRs and the glossary are annotated as historical with their rename chain, the dangling supersession in ADR-0003 is annotated in place, upstream-numbered ADR cites are qualified, and the absorb plan carries the upstream-to-local ADR mapping
63
+ * **docs:** the FU follow-up lane (`absorb/follow-upstream`, base `map/absorb-v2` @ `da4a177`) is recorded — a conformance re-audit of the v2 absorb against upstream `b92e0ec81db0bbcf38849e2cacadb0b5ccb635e5`, not a version-range absorb: `00f8c34..b92e0ec` is scaffold/CI-only and stays unabsorbed by design. What the lane ported/corrected, commit by commit: FU-1 `5fb9141` applied-diff removal capping at `DIFF_REMOVED_CAP`; FU-2 `36d9d48` `sessionKeyFor` fails loud without a session (no minted preview key); FU-3 `edc516d` upstream ADR-0024 interior-`null` acceptance on the leased route with the granular `details.cause` headlines; FU-4 `b65d437` (+`7299bfe` ledger re-measure, `554f874` residual-note corrections) the granular rejection codes `E_UNKNOWN_ANCHOR`/`E_FOREIGN_ANCHOR`/`E_TARGET_LOST`/`E_UNVERIFIED_RANGE` behind the lease-first boundary interception; FU-5 `c6fa426` the two `W_SERVED_*` warning producers, emptying `DEFERRED_PRODUCERS`; FU-6 `e79f9e0` multi-window reads and read-path stats consolidation (`2334352`, superseding ADR-0023's decline); FU-7 `a2b211d` batch envelope cause semantics; FU-8 the spec refresh and the full mutate-ledger sweep (53 cells; one moved set re-anchored, T5M14). Cursor moved to `b92e0ec`; the lane's decisions ride on ADR-0014/0019/0022/0023/0025 amendments, each in its own behavior commit
64
+
65
+ ### Continuous Integration
66
+
67
+ * **ci:** the changelog ledger is curated, not projected — one gate (`scripts/changelog-gate.py`) checks both CI boundaries (PR run and durable `main` run) with the waiver as the only recorded escape; the amending pre-push hook is retired and the local signal is the read-only `check` probe
68
+ * **ci:** the release job no longer runs Python — the handoff `clear` step and the now-consumer-less `setup-python` pin are deleted, and release notes come from the curated `[Unreleased]` block through the release-changelog plugin
69
+ * **ci:** the PR run reads the `Landing:` declaration — `scripts/changelog-gate.py` validates `--landing` (`squash|merge`) and `changelog-check.yml` forwards the PR-body line; the two deliberate holds live in `.config/scaffold-divergence.txt` as recorded drift, and the typecheck-budget projection is dropped now that its component went opt-in
70
+
71
+ ### Miscellaneous Chores
72
+
73
+ * **scaffold:** re-project the changelog script and `.gitignore` to the skill's bytes and adopt the `Related issues` footer in the PR template — keeping the `Landing:` declaration and declining the `CODE_AUTHORS` block
74
+
1
75
  ## [0.8.2](https://github.com/Rianico/dsh-better-edit/compare/v0.8.1...v0.8.2) (2026-09-14)
2
76
 
3
77
  ### Bug Fixes
@@ -8,97 +82,97 @@
8
82
 
9
83
  ### Bug Fixes
10
84
 
11
- - **str-replace:** record real fs version so view/read authorizes str_replace/insert ([#70](https://github.com/Rianico/dsh-better-edit/issues/70)) ([06b76ff](https://github.com/Rianico/dsh-better-edit/commit/06b76ffec4c0393f790d2195c06910328b611059))
85
+ * **str-replace:** record real fs version so view/read authorizes str_replace/insert ([#70](https://github.com/Rianico/dsh-better-edit/issues/70)) ([06b76ff](https://github.com/Rianico/dsh-better-edit/commit/06b76ffec4c0393f790d2195c06910328b611059))
12
86
 
13
87
  ### Documentation
14
88
 
15
- - add PR template and document PR requirements via git scaffolding ([#68](https://github.com/Rianico/dsh-better-edit/issues/68)) ([b341fbc](https://github.com/Rianico/dsh-better-edit/commit/b341fbc778868496bdee2e49801c5cf3745d1c99))
89
+ * add PR template and document PR requirements via git scaffolding ([#68](https://github.com/Rianico/dsh-better-edit/issues/68)) ([b341fbc](https://github.com/Rianico/dsh-better-edit/commit/b341fbc778868496bdee2e49801c5cf3745d1c99))
16
90
 
17
91
  ## [0.8.0](https://github.com/Rianico/dsh-better-edit/compare/v0.7.1...v0.8.0) (2026-09-09)
18
92
 
19
93
  ### Features
20
94
 
21
- - **edit:** accept object-form edits entries ({remove_from, remove_to, replacement_text}), closes [#64](https://github.com/Rianico/dsh-better-edit/issues/64) ([#66](https://github.com/Rianico/dsh-better-edit/issues/66)) ([a14ef4c](https://github.com/Rianico/dsh-better-edit/commit/a14ef4cee1c4d8126f40516624b6811d57041bf8))
22
- - **str-replace:** add governed editor shadow ([#67](https://github.com/Rianico/dsh-better-edit/issues/67)) ([a015629](https://github.com/Rianico/dsh-better-edit/commit/a0156296ce615069f10acf60e3d96c4dc3fa9e14))
95
+ * **edit:** accept object-form edits entries ({remove_from, remove_to, replacement_text}), closes [#64](https://github.com/Rianico/dsh-better-edit/issues/64) ([#66](https://github.com/Rianico/dsh-better-edit/issues/66)) ([a14ef4c](https://github.com/Rianico/dsh-better-edit/commit/a14ef4cee1c4d8126f40516624b6811d57041bf8))
96
+ * **str-replace:** add governed editor shadow ([#67](https://github.com/Rianico/dsh-better-edit/issues/67)) ([a015629](https://github.com/Rianico/dsh-better-edit/commit/a0156296ce615069f10acf60e3d96c4dc3fa9e14))
23
97
 
24
98
  ### Bug Fixes
25
99
 
26
- - **script:** correct repo inference and headless dispatch for gh-release ([b517646](https://github.com/Rianico/dsh-better-edit/commit/b5176465f8363ff80bb48e96cdfa86e6254f2ebf)), closes [#51](https://github.com/Rianico/dsh-better-edit/issues/51)
100
+ * **script:** correct repo inference and headless dispatch for gh-release ([b517646](https://github.com/Rianico/dsh-better-edit/commit/b5176465f8363ff80bb48e96cdfa86e6254f2ebf)), closes [#51](https://github.com/Rianico/dsh-better-edit/issues/51)
27
101
 
28
102
  ### Documentation
29
103
 
30
- - **agents:** sync AGENTS.md — remove tag-first releasing, fix git guide and upstream cursor ([d1088d1](https://github.com/Rianico/dsh-better-edit/commit/d1088d1f43f151f80f204fc5189268a5945066f8))
104
+ * **agents:** sync AGENTS.md — remove tag-first releasing, fix git guide and upstream cursor ([d1088d1](https://github.com/Rianico/dsh-better-edit/commit/d1088d1f43f151f80f204fc5189268a5945066f8))
31
105
 
32
106
  ## [0.7.1](https://github.com/Rianico/dsh-better-edit/compare/v0.7.0...v0.7.1) (2026-09-06)
33
107
 
34
108
  ### Bug Fixes
35
109
 
36
- - **hashline:** retired hazard GC and stable reuse for anchor-space deadlock ([#59](https://github.com/Rianico/dsh-better-edit/issues/59)) ([2487c43](https://github.com/Rianico/dsh-better-edit/commit/2487c43e6d0ec8e5af15b42495bc4f8d7e3ca89a)), closes [#51](https://github.com/Rianico/dsh-better-edit/issues/51) [#51](https://github.com/Rianico/dsh-better-edit/issues/51) [#51](https://github.com/Rianico/dsh-better-edit/issues/51)
110
+ * **hashline:** retired hazard GC and stable reuse for anchor-space deadlock ([#59](https://github.com/Rianico/dsh-better-edit/issues/59)) ([2487c43](https://github.com/Rianico/dsh-better-edit/commit/2487c43e6d0ec8e5af15b42495bc4f8d7e3ca89a)), closes [#51](https://github.com/Rianico/dsh-better-edit/issues/51) [#51](https://github.com/Rianico/dsh-better-edit/issues/51) [#51](https://github.com/Rianico/dsh-better-edit/issues/51)
37
111
 
38
112
  ### Documentation
39
113
 
40
- - **context:** retired anchor replaces tombstone; add hazard card and epoch glossary ([#58](https://github.com/Rianico/dsh-better-edit/issues/58)) ([287b68e](https://github.com/Rianico/dsh-better-edit/commit/287b68efc97bea940fd881a8ca1e8755b2da311a)), closes [#51](https://github.com/Rianico/dsh-better-edit/issues/51)
114
+ * **context:** retired anchor replaces tombstone; add hazard card and epoch glossary ([#58](https://github.com/Rianico/dsh-better-edit/issues/58)) ([287b68e](https://github.com/Rianico/dsh-better-edit/commit/287b68efc97bea940fd881a8ca1e8755b2da311a)), closes [#51](https://github.com/Rianico/dsh-better-edit/issues/51)
41
115
 
42
116
  ## [0.7.0](https://github.com/Rianico/dsh-better-edit/compare/v0.6.3...v0.7.0) (2026-09-06)
43
117
 
44
118
  ### Features
45
119
 
46
- - **session-view:** canon-deficit drift instead of hash rotation (Closes [#46](https://github.com/Rianico/dsh-better-edit/issues/46)) ([#50](https://github.com/Rianico/dsh-better-edit/issues/50)) ([44ba1b3](https://github.com/Rianico/dsh-better-edit/commit/44ba1b3ea3c33759c879363a7e18b4d718edd4d9)), closes [#68](https://github.com/Rianico/dsh-better-edit/issues/68)
47
- - user/model audience split + glossary error codes ([#49](https://github.com/Rianico/dsh-better-edit/issues/49)) ([1559fc5](https://github.com/Rianico/dsh-better-edit/commit/1559fc5d135d006faa86aa656c166a5e3fa3be08)), closes [#48](https://github.com/Rianico/dsh-better-edit/issues/48) [#45](https://github.com/Rianico/dsh-better-edit/issues/45)
120
+ * **session-view:** canon-deficit drift instead of hash rotation (Closes [#46](https://github.com/Rianico/dsh-better-edit/issues/46)) ([#50](https://github.com/Rianico/dsh-better-edit/issues/50)) ([44ba1b3](https://github.com/Rianico/dsh-better-edit/commit/44ba1b3ea3c33759c879363a7e18b4d718edd4d9)), closes [#68](https://github.com/Rianico/dsh-better-edit/issues/68)
121
+ * user/model audience split + glossary error codes ([#49](https://github.com/Rianico/dsh-better-edit/issues/49)) ([1559fc5](https://github.com/Rianico/dsh-better-edit/commit/1559fc5d135d006faa86aa656c166a5e3fa3be08)), closes [#48](https://github.com/Rianico/dsh-better-edit/issues/48) [#45](https://github.com/Rianico/dsh-better-edit/issues/45)
48
122
 
49
123
  ### Bug Fixes
50
124
 
51
- - **edit:** Gemma-4 tool-call bleed hardening + prompt channel wording (Closes [#47](https://github.com/Rianico/dsh-better-edit/issues/47)) ([#52](https://github.com/Rianico/dsh-better-edit/issues/52)) ([55e8d21](https://github.com/Rianico/dsh-better-edit/commit/55e8d21bcc57e87ee674c4d7484da0cd200e2e03)), closes [#55](https://github.com/Rianico/dsh-better-edit/issues/55)
52
- - review follow-ups from 1.6.0 absorb (Closes [#55](https://github.com/Rianico/dsh-better-edit/issues/55)) ([#56](https://github.com/Rianico/dsh-better-edit/issues/56)) ([d6a9cbb](https://github.com/Rianico/dsh-better-edit/commit/d6a9cbb5ae071892dd88aefdaa6b9d875aa091e7))
53
- - **served:** epoch lifecycle belongs to full reads (Closes [#48](https://github.com/Rianico/dsh-better-edit/issues/48)) ([#54](https://github.com/Rianico/dsh-better-edit/issues/54)) ([959f355](https://github.com/Rianico/dsh-better-edit/commit/959f355b0866a6a892dda2a149cc20c6505fc9ad)), closes [#69](https://github.com/Rianico/dsh-better-edit/issues/69)
54
- - **served:** refresh canons on truncated serve records (Closes [#53](https://github.com/Rianico/dsh-better-edit/issues/53)) ([#57](https://github.com/Rianico/dsh-better-edit/issues/57)) ([1f8601c](https://github.com/Rianico/dsh-better-edit/commit/1f8601cc8b3608bc79acb82130abbe37990aef75))
125
+ * **edit:** Gemma-4 tool-call bleed hardening + prompt channel wording (Closes [#47](https://github.com/Rianico/dsh-better-edit/issues/47)) ([#52](https://github.com/Rianico/dsh-better-edit/issues/52)) ([55e8d21](https://github.com/Rianico/dsh-better-edit/commit/55e8d21bcc57e87ee674c4d7484da0cd200e2e03)), closes [#55](https://github.com/Rianico/dsh-better-edit/issues/55)
126
+ * review follow-ups from 1.6.0 absorb (Closes [#55](https://github.com/Rianico/dsh-better-edit/issues/55)) ([#56](https://github.com/Rianico/dsh-better-edit/issues/56)) ([d6a9cbb](https://github.com/Rianico/dsh-better-edit/commit/d6a9cbb5ae071892dd88aefdaa6b9d875aa091e7))
127
+ * **served:** epoch lifecycle belongs to full reads (Closes [#48](https://github.com/Rianico/dsh-better-edit/issues/48)) ([#54](https://github.com/Rianico/dsh-better-edit/issues/54)) ([959f355](https://github.com/Rianico/dsh-better-edit/commit/959f355b0866a6a892dda2a149cc20c6505fc9ad)), closes [#69](https://github.com/Rianico/dsh-better-edit/issues/69)
128
+ * **served:** refresh canons on truncated serve records (Closes [#53](https://github.com/Rianico/dsh-better-edit/issues/53)) ([#57](https://github.com/Rianico/dsh-better-edit/issues/57)) ([1f8601c](https://github.com/Rianico/dsh-better-edit/commit/1f8601cc8b3608bc79acb82130abbe37990aef75))
55
129
 
56
130
  ### Documentation
57
131
 
58
- - **absorb:** record v1.6.0 checkpoint 87a17eb after T1-T4 ([8afba98](https://github.com/Rianico/dsh-better-edit/commit/8afba9842628e44a011c266956d8746725295c11))
59
- - migrate CLAUDE.md to AGENTS.md with symlink ([4706b6e](https://github.com/Rianico/dsh-better-edit/commit/4706b6e15f6a0ca627059087e3f05953b7b2ae6e))
132
+ * **absorb:** record v1.6.0 checkpoint 87a17eb after T1-T4 ([8afba98](https://github.com/Rianico/dsh-better-edit/commit/8afba9842628e44a011c266956d8746725295c11))
133
+ * migrate CLAUDE.md to AGENTS.md with symlink ([4706b6e](https://github.com/Rianico/dsh-better-edit/commit/4706b6e15f6a0ca627059087e3f05953b7b2ae6e))
60
134
 
61
135
  ## [0.6.3](https://github.com/Rianico/dsh-better-edit/compare/v0.6.2...v0.6.3) (2026-09-05)
62
136
 
63
137
  ### Bug Fixes
64
138
 
65
- - **self-heal:** restore hash-anchored read/edit after external takeover ([#43](https://github.com/Rianico/dsh-better-edit/issues/43)) ([#44](https://github.com/Rianico/dsh-better-edit/issues/44)) ([b53fc75](https://github.com/Rianico/dsh-better-edit/commit/b53fc753bcd71f1950bde61ad81e1b7b94758273))
139
+ * **self-heal:** restore hash-anchored read/edit after external takeover ([#43](https://github.com/Rianico/dsh-better-edit/issues/43)) ([#44](https://github.com/Rianico/dsh-better-edit/issues/44)) ([b53fc75](https://github.com/Rianico/dsh-better-edit/commit/b53fc753bcd71f1950bde61ad81e1b7b94758273))
66
140
 
67
141
  ## [0.6.2](https://github.com/Rianico/dsh-better-edit/compare/v0.6.1...v0.6.2) (2026-09-03)
68
142
 
69
143
  ### Bug Fixes
70
144
 
71
- - **deps:** upgrade dsh dependencies to 0.1.1-rc.2 ([30e6029](https://github.com/Rianico/dsh-better-edit/commit/30e6029888fa517f20c640b7a38523a8a6148ccd))
145
+ * **deps:** upgrade dsh dependencies to 0.1.1-rc.2 ([30e6029](https://github.com/Rianico/dsh-better-edit/commit/30e6029888fa517f20c640b7a38523a8a6148ccd))
72
146
 
73
147
  ### Documentation
74
148
 
75
- - **readme:** compact rewrite — pos-free hero, round-trips, tokens ([dc468c5](https://github.com/Rianico/dsh-better-edit/commit/dc468c5ce9799ddf9578d92e715905701b2a95a1))
149
+ * **readme:** compact rewrite — pos-free hero, round-trips, tokens ([dc468c5](https://github.com/Rianico/dsh-better-edit/commit/dc468c5ce9799ddf9578d92e715905701b2a95a1))
76
150
 
77
151
  ## [0.6.1](https://github.com/Rianico/dsh-better-edit/compare/v0.6.0...v0.6.1) (2026-09-01)
78
152
 
79
153
  ### Bug Fixes
80
154
 
81
- - **hashline:** prevent freed anchor reuse ([#31](https://github.com/Rianico/dsh-better-edit/issues/31)) ([#42](https://github.com/Rianico/dsh-better-edit/issues/42)) ([19724a4](https://github.com/Rianico/dsh-better-edit/commit/19724a4083afcfc104172d5ce71bb6ab198026b7)), closes [GH#41](https://github.com/Rianico/GH/issues/41)
155
+ * **hashline:** prevent freed anchor reuse ([#31](https://github.com/Rianico/dsh-better-edit/issues/31)) ([#42](https://github.com/Rianico/dsh-better-edit/issues/42)) ([19724a4](https://github.com/Rianico/dsh-better-edit/commit/19724a4083afcfc104172d5ce71bb6ab198026b7)), closes [GH#41](https://github.com/Rianico/GH/issues/41)
82
156
 
83
157
  ## [0.6.0](https://github.com/Rianico/dsh-better-edit/compare/v0.5.1...v0.6.0) (2026-08-31)
84
158
 
85
159
  ### Features
86
160
 
87
- - **edit:** render diff card after tool calling ([df7712c](https://github.com/Rianico/dsh-better-edit/commit/df7712cef265dfec424feefb60c19f833d380f9f))
88
- - **hashline:** remove boundaryDups auto-fix (Closes [#38](https://github.com/Rianico/dsh-better-edit/issues/38)) ([54d0bc6](https://github.com/Rianico/dsh-better-edit/commit/54d0bc6c9078fbcffa6f7a531e80e005774156a4))
161
+ * **edit:** render diff card after tool calling ([df7712c](https://github.com/Rianico/dsh-better-edit/commit/df7712cef265dfec424feefb60c19f833d380f9f))
162
+ * **hashline:** remove boundaryDups auto-fix (Closes [#38](https://github.com/Rianico/dsh-better-edit/issues/38)) ([54d0bc6](https://github.com/Rianico/dsh-better-edit/commit/54d0bc6c9078fbcffa6f7a531e80e005774156a4))
89
163
 
90
164
  ### Bug Fixes
91
165
 
92
- - **ci:** add neural version check to Verify and Release ([7f85b56](https://github.com/Rianico/dsh-better-edit/commit/7f85b5605e228d19bcde802ce2b10affc90fbde7))
166
+ * **ci:** add neural version check to Verify and Release ([7f85b56](https://github.com/Rianico/dsh-better-edit/commit/7f85b5605e228d19bcde802ce2b10affc90fbde7))
93
167
 
94
168
  ## [0.5.1](https://github.com/Rianico/dsh-better-edit/compare/v0.5.0...v0.5.1) (2026-08-30)
95
169
 
96
170
  ### Bug Fixes
97
171
 
98
- - **encoding:** support non-UTF-8 text files via VS Code model ([#34](https://github.com/Rianico/dsh-better-edit/issues/34)) ([#35](https://github.com/Rianico/dsh-better-edit/issues/35)) ([dd3e553](https://github.com/Rianico/dsh-better-edit/commit/dd3e553a3877e47b08aa2ba6336115e80b5d96f5))
99
- - **lint:** address biome blockers for release ([00b9270](https://github.com/Rianico/dsh-better-edit/commit/00b92704ac4093a627754e698bb1968acdc3d4e8))
100
- - remove unused exitHandlerRegistered ([f6a29f3](https://github.com/Rianico/dsh-better-edit/commit/f6a29f3f1dd694e4bb7c55a98d0eba80bc32a58f))
101
- - **scripts:** map fix to Fixed for Keep a Changelog ([bcd1850](https://github.com/Rianico/dsh-better-edit/commit/bcd18501e280b10d5075108c034de7352ece6922))
172
+ * **encoding:** support non-UTF-8 text files via VS Code model ([#34](https://github.com/Rianico/dsh-better-edit/issues/34)) ([#35](https://github.com/Rianico/dsh-better-edit/issues/35)) ([dd3e553](https://github.com/Rianico/dsh-better-edit/commit/dd3e553a3877e47b08aa2ba6336115e80b5d96f5))
173
+ * **lint:** address biome blockers for release ([00b9270](https://github.com/Rianico/dsh-better-edit/commit/00b92704ac4093a627754e698bb1968acdc3d4e8))
174
+ * remove unused exitHandlerRegistered ([f6a29f3](https://github.com/Rianico/dsh-better-edit/commit/f6a29f3f1dd694e4bb7c55a98d0eba80bc32a58f))
175
+ * **scripts:** map fix to Fixed for Keep a Changelog ([bcd1850](https://github.com/Rianico/dsh-better-edit/commit/bcd18501e280b10d5075108c034de7352ece6922))
102
176
 
103
177
  # Changelog
104
178
 
@@ -110,203 +184,203 @@ Entries link to the originating spec issue in [pi-hashline-edit-lsz](https://git
110
184
 
111
185
  ### Features
112
186
 
113
- - **edit:** route drift signals to user-facing details (pi-better-edit@6ec52f2)
114
- - scaffold verify→release with biome+coverage 80%
187
+ * **edit:** route drift signals to user-facing details (pi-better-edit@6ec52f2)
188
+ * scaffold verify→release with biome+coverage 80%
115
189
 
116
190
  ### Bug Fixes
117
191
 
118
- - **ci:** lower coverage threshold to 75 and add SAFETY for hash-store cast
119
- - **tests:** align drift expectations with user-facing routing (6ec52f2)
120
- - **hashline:** add E_EDIT_HASH_ECHO guard for served echo (pi-better-edit@65b8eb1)
121
- - clarify HASH vs content without served
122
- - **edit:** clarify HASH vs HASH│content and downgrade bare prefix warnings (pi-better-edit@a837e9d)
123
- - **fs-write:** log stale-temp and sync failures (pi-better-edit@671c66d)
124
- - **hashline:** heal multi-line staleness and stable anchoring (f94fb88)
125
- - **git:** wire pre-push hook via husky path
192
+ * **ci:** lower coverage threshold to 75 and add SAFETY for hash-store cast
193
+ * **tests:** align drift expectations with user-facing routing (6ec52f2)
194
+ * **hashline:** add E_EDIT_HASH_ECHO guard for served echo (pi-better-edit@65b8eb1)
195
+ * clarify HASH vs content without served
196
+ * **edit:** clarify HASH vs HASH│content and downgrade bare prefix warnings (pi-better-edit@a837e9d)
197
+ * **fs-write:** log stale-temp and sync failures (pi-better-edit@671c66d)
198
+ * **hashline:** heal multi-line staleness and stable anchoring (f94fb88)
199
+ * **git:** wire pre-push hook via husky path
126
200
 
127
201
  ## [0.4.1] - 2026-08-27
128
202
 
129
203
  ### Fixed
130
204
 
131
- - Refuse a built-in `write` before dispatch when a candidate line starts with the exact hashline anchor served for the same session, canonical path, and line. This prevents copied `HASH│` preview chains from entering Markdown while leaving the file byte-identical; unrelated hash-like text is not generically stripped (#29).
205
+ * Refuse a built-in `write` before dispatch when a candidate line starts with the exact hashline anchor served for the same session, canonical path, and line. This prevents copied `HASH│` preview chains from entering Markdown while leaving the file byte-identical; unrelated hash-like text is not generically stripped (#29).
132
206
 
133
207
  ## [0.4.0] - 2026-08-24
134
208
 
135
209
  ### Added
136
210
 
137
- - Configurable store tenancy with central default (`$DSH_HOME/plugins/dsh-better-edit/runtime/<name>-<hash8>/`), `workspace` legacy opt-in, and custom `/abs` root — yaml at `$DSH_HOME/plugins/dsh-better-edit/config.yaml` (`storeDir` — where the store lives, `autoGitignore` — workspace .gitignore handling, `undo_ttl_s` — undo TTL in seconds (-1 = forever), `storeMaxAgeS` — central janitor max idle age in seconds (default 30 days), `storeMaxTotalBytes` — central janitor max total bytes) + god envs `DSH_BETTER_EDIT_STORE_DIR`/`DSH_BETTER_EDIT_AUTO_GITIGNORE` (`env > yaml > central`) with malformed fallback to central and warnings. DB files are disposable caches — safe to delete, rebuilt on next `read` ([#24](https://github.com/Rianico/dsh-better-edit/issues/24)). Thanks to [@MrWeiCodes](https://github.com/MrWeiCodes) for the proposal and design discussion.
138
- - Readable `runtime/<name>-<hash8>/` with `.wsPath` sidecar for collision proof.
211
+ * Configurable store tenancy with central default (`$DSH_HOME/plugins/dsh-better-edit/runtime/<name>-<hash8>/`), `workspace` legacy opt-in, and custom `/abs` root — yaml at `$DSH_HOME/plugins/dsh-better-edit/config.yaml` (`storeDir` — where the store lives, `autoGitignore` — workspace .gitignore handling, `undo_ttl_s` — undo TTL in seconds (-1 = forever), `storeMaxAgeS` — central janitor max idle age in seconds (default 30 days), `storeMaxTotalBytes` — central janitor max total bytes) + god envs `DSH_BETTER_EDIT_STORE_DIR`/`DSH_BETTER_EDIT_AUTO_GITIGNORE` (`env > yaml > central`) with malformed fallback to central and warnings. DB files are disposable caches — safe to delete, rebuilt on next `read` ([#24](https://github.com/Rianico/dsh-better-edit/issues/24)). Thanks to [@MrWeiCodes](https://github.com/MrWeiCodes) for the proposal and design discussion.
212
+ * Readable `runtime/<name>-<hash8>/` with `.wsPath` sidecar for collision proof.
139
213
 
140
214
  ### Changed
141
215
 
142
- - Default store location moved from workspace-co-located to central `runtime/` to eliminate git pollution and zip privacy leakage — `workspace` now requires explicit `storeDir: workspace`.
143
- - Store lifecycle now plugin-owned for central/custom (throttled janitor on `apply` + `agent/session-start` >24h, `mtime>storeMaxAgeS` (default 30 days / 2592000 s, unified to seconds with `undo_ttl_s`) then LRU to `count<100 && sum<500MB`, never deleting live `hash(workspaceCwd)`), `wal_checkpoint(TRUNCATE)` on close/janitor, `undo` TTL `undo_ttl_s` (default 7d, `-1` = forever, seconds), `pruneMissing` batch 64 — workspace mode remains user-owned with row TTL only. DB files are disposable caches — safe to delete, rebuilt on next `read`.
216
+ * Default store location moved from workspace-co-located to central `runtime/` to eliminate git pollution and zip privacy leakage — `workspace` now requires explicit `storeDir: workspace`.
217
+ * Store lifecycle now plugin-owned for central/custom (throttled janitor on `apply` + `agent/session-start` >24h, `mtime>storeMaxAgeS` (default 30 days / 2592000 s, unified to seconds with `undo_ttl_s`) then LRU to `count<100 && sum<500MB`, never deleting live `hash(workspaceCwd)`), `wal_checkpoint(TRUNCATE)` on close/janitor, `undo` TTL `undo_ttl_s` (default 7d, `-1` = forever, seconds), `pruneMissing` batch 64 — workspace mode remains user-owned with row TTL only. DB files are disposable caches — safe to delete, rebuilt on next `read`.
144
218
 
145
219
  ### Fixed
146
220
 
147
- - `.gitignore` pollution warning for `workspace` mode and idempotent `autoGitignore` opt-in (yaml+env `true|false`).
221
+ * `.gitignore` pollution warning for `workspace` mode and idempotent `autoGitignore` opt-in (yaml+env `true|false`).
148
222
 
149
223
  ## [0.4.0-rc.1] - 2026-08-24
150
224
 
151
225
  ### Added
152
226
 
153
- - Configurable store tenancy with central default (`$DSH_HOME/plugins/dsh-better-edit/runtime/<name>-<hash8>/`), `workspace` legacy opt-in, and custom `/abs` root — yaml at `$DSH_HOME/plugins/dsh-better-edit/config.yaml` (`storeDir` — where the store lives, `autoGitignore` — workspace .gitignore handling, `undo_ttl_s` — undo TTL in seconds (-1 = forever), `storeMaxAgeS` — central janitor max idle age in seconds (default 30 days), `storeMaxTotalBytes` — central janitor max total bytes) + god envs `DSH_BETTER_EDIT_STORE_DIR`/`DSH_BETTER_EDIT_AUTO_GITIGNORE` (`env > yaml > central`) with malformed fallback to central and warnings. DB files are disposable caches — safe to delete, rebuilt on next `read` ([#24](https://github.com/Rianico/dsh-better-edit/issues/24)). Thanks to [@MrWeiCodes](https://github.com/MrWeiCodes) for the proposal and design discussion.
154
- - Readable `runtime/<name>-<hash8>/` with `.wsPath` sidecar for collision proof.
227
+ * Configurable store tenancy with central default (`$DSH_HOME/plugins/dsh-better-edit/runtime/<name>-<hash8>/`), `workspace` legacy opt-in, and custom `/abs` root — yaml at `$DSH_HOME/plugins/dsh-better-edit/config.yaml` (`storeDir` — where the store lives, `autoGitignore` — workspace .gitignore handling, `undo_ttl_s` — undo TTL in seconds (-1 = forever), `storeMaxAgeS` — central janitor max idle age in seconds (default 30 days), `storeMaxTotalBytes` — central janitor max total bytes) + god envs `DSH_BETTER_EDIT_STORE_DIR`/`DSH_BETTER_EDIT_AUTO_GITIGNORE` (`env > yaml > central`) with malformed fallback to central and warnings. DB files are disposable caches — safe to delete, rebuilt on next `read` ([#24](https://github.com/Rianico/dsh-better-edit/issues/24)). Thanks to [@MrWeiCodes](https://github.com/MrWeiCodes) for the proposal and design discussion.
228
+ * Readable `runtime/<name>-<hash8>/` with `.wsPath` sidecar for collision proof.
155
229
 
156
230
  ### Changed
157
231
 
158
- - Default store location moved from workspace-co-located to central `runtime/` to eliminate git pollution and zip privacy leakage — `workspace` now requires explicit `storeDir: workspace`.
159
- - Store lifecycle now plugin-owned for central/custom (throttled janitor on `apply` + `agent/session-start` >24h, `mtime>storeMaxAgeS` (default 30 days / 2592000 s, unified to seconds with `undo_ttl_s`) then LRU to `count<100 && sum<500MB`, never deleting live `hash(workspaceCwd)`), `wal_checkpoint(TRUNCATE)` on close/janitor, `undo` TTL `undo_ttl_s` (default 7d, `-1` = forever, seconds), `pruneMissing` batch 64 — workspace mode remains user-owned with row TTL only. DB files are disposable caches — safe to delete, rebuilt on next `read`.
232
+ * Default store location moved from workspace-co-located to central `runtime/` to eliminate git pollution and zip privacy leakage — `workspace` now requires explicit `storeDir: workspace`.
233
+ * Store lifecycle now plugin-owned for central/custom (throttled janitor on `apply` + `agent/session-start` >24h, `mtime>storeMaxAgeS` (default 30 days / 2592000 s, unified to seconds with `undo_ttl_s`) then LRU to `count<100 && sum<500MB`, never deleting live `hash(workspaceCwd)`), `wal_checkpoint(TRUNCATE)` on close/janitor, `undo` TTL `undo_ttl_s` (default 7d, `-1` = forever, seconds), `pruneMissing` batch 64 — workspace mode remains user-owned with row TTL only. DB files are disposable caches — safe to delete, rebuilt on next `read`.
160
234
 
161
235
  ### Fixed
162
236
 
163
- - `.gitignore` pollution warning for `workspace` mode and idempotent `autoGitignore` opt-in (yaml+env `true|false`).
237
+ * `.gitignore` pollution warning for `workspace` mode and idempotent `autoGitignore` opt-in (yaml+env `true|false`).
164
238
 
165
239
  ## [0.3.2] - 2026-08-23
166
240
 
167
241
  ### Fixed
168
242
 
169
- - Preserve a stripped UTF-8 BOM across `ctx.fs`-backed `edit` and `undo_last_edit` writes while retaining the file's original line endings (#23).
243
+ * Preserve a stripped UTF-8 BOM across `ctx.fs`-backed `edit` and `undo_last_edit` writes while retaining the file's original line endings (#23).
170
244
 
171
245
  ## [0.3.1] - 2026-08-21
172
246
 
173
247
  ### Changed
174
248
 
175
- - Deepen `Mutation` owns edit lifecycle (C01, #21): collapse `tool-edit` orchestrator (260→121 lines) into `mutation.ts:execute()` deep seam — one interface owning `applySequence → commit → buildBatchResult → recordServedTruncated` with correct `undoUnavailableMessage`/`restoreUnwrittenUndos` branching; `tool-edit` thin adapter `validate → execute`.
249
+ * Deepen `Mutation` owns edit lifecycle (C01, #21): collapse `tool-edit` orchestrator (260→121 lines) into `mutation.ts:execute()` deep seam — one interface owning `applySequence → commit → buildBatchResult → recordServedTruncated` with correct `undoUnavailableMessage`/`restoreUnwrittenUndos` branching; `tool-edit` thin adapter `validate → execute`.
176
250
 
177
- - Heal guidance ghost (C02, #21): remove `batch_edit` seam — `GUIDANCE_SECTIONS` 4→3, `materialize.ts` ghost `batch_edit.md` cleanup (shipped + custom presets, `ENOENT`-tolerant), keep `BATCH_EDIT_*` as `@deprecated` aliases; order gap `132` preserved.
251
+ * Heal guidance ghost (C02, #21): remove `batch_edit` seam — `GUIDANCE_SECTIONS` 4→3, `materialize.ts` ghost `batch_edit.md` cleanup (shipped + custom presets, `ENOENT`-tolerant), keep `BATCH_EDIT_*` as `@deprecated` aliases; order gap `132` preserved.
178
252
 
179
253
  ### Fixed
180
254
 
181
- - Dense `servedRows` port `pi-better-edit@7b91958` (post-v1.1.4): `edit-response:buildChanged/buildBatchResult` and `tool-undo` now emit dense `0..n-1` `servedRows` instead of sparse diff rows; `firstChangedLine` fallback to `undoDiffResult` — fixes `E_RANGE_UNVERIFIED` on chained edits.
255
+ * Dense `servedRows` port `pi-better-edit@7b91958` (post-v1.1.4): `edit-response:buildChanged/buildBatchResult` and `tool-undo` now emit dense `0..n-1` `servedRows` instead of sparse diff rows; `firstChangedLine` fallback to `undoDiffResult` — fixes `E_RANGE_UNVERIFIED` on chained edits.
182
256
 
183
- - Fix `tool-undo` SAFETY cast `canonical as unknown as FsEscalationArgs` + `withWorkspace` indentation (2→4 tabs) and `edit-response` biome fixes (no behavior change).
257
+ * Fix `tool-undo` SAFETY cast `canonical as unknown as FsEscalationArgs` + `withWorkspace` indentation (2→4 tabs) and `edit-response` biome fixes (no behavior change).
184
258
 
185
- - Fix `guidance/resolve.ts` double-tab indent left by `batch_edit` removal on `tool:undo_last_edit` entry.
259
+ * Fix `guidance/resolve.ts` double-tab indent left by `batch_edit` removal on `tool:undo_last_edit` entry.
186
260
 
187
261
  ### Added
188
262
 
189
- - Docs: `CLAUDE.md` upstream sync section — last absorbed checkpoint `7b91958` (dense `servedRows`), procedure, checkpoint history, `upstream` remote.
263
+ * Docs: `CLAUDE.md` upstream sync section — last absorbed checkpoint `7b91958` (dense `servedRows`), procedure, checkpoint history, `upstream` remote.
190
264
 
191
265
  ## [0.3.0] - 2026-08-20
192
266
 
193
267
  ### Changed
194
268
 
195
- - **BREAKING** — `edit` now requires `{ path, edits: [[remove_from, remove_to, replacement_text], ...] }` tuple payload (ADR-0003); `batch_edit` removed — single `edit` covers single and batched edits via `edits` arity (ADR-0007). `EDITS_MAX_ITEMS=32`, path nullable (`null` infers from anchors). Old top-level `{remove_from,remove_to,replacement_text}` shape now fails with `[E_BAD_SHAPE]`.
196
- - Whitespace-insensitive anchors (ADR-0002): `canon()` strips all ASCII whitespace `[ \t\r\n]` (`CANON_VERSION=2`, memoized `getCanon`), snapshot cache versioned so pre-upgrade caches invalidate; formatter-only drift (prettier/black) no longer rotates anchors. String-internal whitespace caveat documented.
197
- - Orphaned serve healing & served robustness (ADR-0004): `SessionView.patchServed` eagerly heals stale duplicates, `verifyServedRange` disambiguates candidate spans, truncation on rejection-echo/external-shrink ends the `E_RANGE_UNVERIFIED` self-loop.
198
- - Hashline purity & store seams (ARCH C1-C4): `HashSnapshotIO` injection keeps hashing pure, `recordDiffServes` helper, one `applyOneEdit` composition, `DebouncedPreview` (150ms) extracted, noop-loop folded, per-domain stmt slices.
199
- - Notices & prompts hygiene: Zed-style terse drift/noop/rejection notices (codes unchanged), lean guidelines (dedupe tool descriptions), tool schema descriptions trimmed to one-liners.
200
- - README brooks-lint reorg + CONTEXT glossary merge: hook, shining points, Why Hashline before Tools, benchmark section referencing `pi-better-edit/benchmarks/results/` (same hashline algorithm).
269
+ * **BREAKING** — `edit` now requires `{ path, edits: [[remove_from, remove_to, replacement_text], ...] }` tuple payload (ADR-0003); `batch_edit` removed — single `edit` covers single and batched edits via `edits` arity (ADR-0007). `EDITS_MAX_ITEMS=32`, path nullable (`null` infers from anchors). Old top-level `{remove_from,remove_to,replacement_text}` shape now fails with `[E_BAD_SHAPE]`.
270
+ * Whitespace-insensitive anchors (ADR-0002): `canon()` strips all ASCII whitespace `[ \t\r\n]` (`CANON_VERSION=2`, memoized `getCanon`), snapshot cache versioned so pre-upgrade caches invalidate; formatter-only drift (prettier/black) no longer rotates anchors. String-internal whitespace caveat documented.
271
+ * Orphaned serve healing & served robustness (ADR-0004): `SessionView.patchServed` eagerly heals stale duplicates, `verifyServedRange` disambiguates candidate spans, truncation on rejection-echo/external-shrink ends the `E_RANGE_UNVERIFIED` self-loop.
272
+ * Hashline purity & store seams (ARCH C1-C4): `HashSnapshotIO` injection keeps hashing pure, `recordDiffServes` helper, one `applyOneEdit` composition, `DebouncedPreview` (150ms) extracted, noop-loop folded, per-domain stmt slices.
273
+ * Notices & prompts hygiene: Zed-style terse drift/noop/rejection notices (codes unchanged), lean guidelines (dedupe tool descriptions), tool schema descriptions trimmed to one-liners.
274
+ * README brooks-lint reorg + CONTEXT glossary merge: hook, shining points, Why Hashline before Tools, benchmark section referencing `pi-better-edit/benchmarks/results/` (same hashline algorithm).
201
275
 
202
276
  ## [0.2.2] - 2026-08-19
203
277
 
204
278
  ### Added
205
279
 
206
- - Guidance reset & restore defaults (issue #17): emptying or deleting an override file — or deleting its whole `<preset>/` directory — restores that section's compiled default guidance and order: the default renders at session-start and the file re-seeds at next boot (shipped presets; a deleted custom-preset override stays absent). A whitespace-only file with no front-matter fence means "I want the default"; any well-formed fence (even keyless, even an empty body) is a deliberate-intent signal and is never reset. Malformed fences now fast-fail instead of degrading to prose: a missing closing `---`, a non-integer `order`, or an unknown key rejects the file — the compiled default renders, a warning names the file and the reason, and the file is left untouched on disk for repair.
280
+ * Guidance reset & restore defaults (issue #17): emptying or deleting an override file — or deleting its whole `<preset>/` directory — restores that section's compiled default guidance and order: the default renders at session-start and the file re-seeds at next boot (shipped presets; a deleted custom-preset override stays absent). A whitespace-only file with no front-matter fence means "I want the default"; any well-formed fence (even keyless, even an empty body) is a deliberate-intent signal and is never reset. Malformed fences now fast-fail instead of degrading to prose: a missing closing `---`, a non-integer `order`, or an unknown key rejects the file — the compiled default renders, a warning names the file and the reason, and the file is left untouched on disk for repair.
207
281
 
208
282
  ## [0.2.1] - 2026-08-18
209
283
 
210
284
  ### Added
211
285
 
212
- - Configurable per-preset tool guidance (issues #7, #8; tickets #9–#13): the four `tool:*` prompt sections resolve from plain-markdown override files keyed by agent preset — `$DSH_HOME/plugins/dsh-better-edit/<preset>/<section>.md` — with an optional `order` front-matter. On first boot the plugin seeds each shipped preset (`standard`, `code`, `minimal`, `cordis`) with its guidance as editable files plus a root README documenting the scheme. Per section the chain is `<preset>/<section>.md` → compiled default; files are read once per agent at session-start, so edits apply to new sessions. Deployments without the `agentPresets` service keep the compiled defaults untouched.
286
+ * Configurable per-preset tool guidance (issues #7, #8; tickets #9–#13): the four `tool:*` prompt sections resolve from plain-markdown override files keyed by agent preset — `$DSH_HOME/plugins/dsh-better-edit/<preset>/<section>.md` — with an optional `order` front-matter. On first boot the plugin seeds each shipped preset (`standard`, `code`, `minimal`, `cordis`) with its guidance as editable files plus a root README documenting the scheme. Per section the chain is `<preset>/<section>.md` → compiled default; files are read once per agent at session-start, so edits apply to new sessions. Deployments without the `agentPresets` service keep the compiled defaults untouched.
213
287
  Default orders sit at 130–133, above the built-in tool-guidance band (100–116 in the shipped
214
288
  dsh), so a same-order section merge with unrelated tool guidance cannot occur out of the box; the
215
289
  seeded preset files expose that `order` as editable front-matter.
216
- - Default guidance text simplified per the writing-for-agents principles; the `*_GUIDELINES` constants unified on `*_GUIDANCE`.
217
- - Thanks to [@R-LEI2536](https://github.com/R-LEI2536) for requesting configurable per-preset prompts and for the design input that shaped this release (issue [#7](https://github.com/Rianico/dsh-better-edit/issues/7)).
290
+ * Default guidance text simplified per the writing-for-agents principles; the `*_GUIDELINES` constants unified on `*_GUIDANCE`.
291
+ * Thanks to [@R-LEI2536](https://github.com/R-LEI2536) for requesting configurable per-preset prompts and for the design input that shaped this release (issue [#7](https://github.com/Rianico/dsh-better-edit/issues/7)).
218
292
 
219
293
  ### Changed
220
294
 
221
- - Benchmark extended to a third arm, `@oh-my-pi/hashline`: same corpus, same 12 replacements, two modes (per-edit `seq` with renumbered lines + one-document `batch` fixed to original line numbers). Payloads are built from the package's published grammar and validated before counting (the package is Bun-only, so it cannot run under the Node benchmark). Honest result, reported as such: hashline saves 31% vs `str_replace` on the session (43% on multi-line ranges) and remains the plugin's claim; the compact patch language saves 42% per edit / 53% batched — and this README says so. `npm run benchmark` stays byte-deterministic (verified over repeated runs).
222
- - READMEs (English and 中文) refined along ponytail-style lines: "How It Compares" gains an `@oh-my-pi/hashline` column plus a same-lineage/different-jobs comparison; the Benchmark section documents all three arms, adds an honest "regenerate, don't trust" reproducibility note, and widens the scope-and-honesty block with what the payload numbers do _not_ capture (renumber/tag-chase cost, block ops, Bun-vs-Node, tool-pair vs patcher library).
223
- - `package.json` keywords now include `oh-my-pi` alongside `hashline`.
224
- - Roadmap gains a first-class decision item: close or justify the gap vs `@oh-my-pi/hashline` (payload-lighter by 42%/53% vs 31%, with block ops / registers / `REM`/`MV` / multi-hunk documents / pluggable fs we do not support — against correctness costs: unverified line numbers, renumber-per-edit, best-effort merge on stale tags, model skill floor). A reference record lives at `../oh-my-pi.md` (workspace-level, outside this repo): the token comparison, the correctness asymmetry, the ability-by-ability status, and the decision rationale.
295
+ * Benchmark extended to a third arm, `@oh-my-pi/hashline`: same corpus, same 12 replacements, two modes (per-edit `seq` with renumbered lines + one-document `batch` fixed to original line numbers). Payloads are built from the package's published grammar and validated before counting (the package is Bun-only, so it cannot run under the Node benchmark). Honest result, reported as such: hashline saves 31% vs `str_replace` on the session (43% on multi-line ranges) and remains the plugin's claim; the compact patch language saves 42% per edit / 53% batched — and this README says so. `npm run benchmark` stays byte-deterministic (verified over repeated runs).
296
+ * READMEs (English and 中文) refined along ponytail-style lines: "How It Compares" gains an `@oh-my-pi/hashline` column plus a same-lineage/different-jobs comparison; the Benchmark section documents all three arms, adds an honest "regenerate, don't trust" reproducibility note, and widens the scope-and-honesty block with what the payload numbers do _not_ capture (renumber/tag-chase cost, block ops, Bun-vs-Node, tool-pair vs patcher library).
297
+ * `package.json` keywords now include `oh-my-pi` alongside `hashline`.
298
+ * Roadmap gains a first-class decision item: close or justify the gap vs `@oh-my-pi/hashline` (payload-lighter by 42%/53% vs 31%, with block ops / registers / `REM`/`MV` / multi-hunk documents / pluggable fs we do not support — against correctness costs: unverified line numbers, renumber-per-edit, best-effort merge on stale tags, model skill floor). A reference record lives at `../oh-my-pi.md` (workspace-level, outside this repo): the token comparison, the correctness asymmetry, the ability-by-ability status, and the decision rationale.
225
299
 
226
300
  ## [0.2.0] - 2026-08-16
227
301
 
228
302
  ### Changed
229
303
 
230
- - Architecture deepening across six refactors (GitHub issues #1–#6), with the model-facing contract unchanged — every `[E_…]` code and message byte-identical, full suite green (615 → 626 tests):
231
- - Served state (what the model has been shown) now lives in one async module: the doubled sync/async store interface (whose sync half had zero production callers) is gone, and the served-row merge invariant — stale tail / duplicate anchors — is one shared helper with a regression test.
232
- - `edit` and `batch_edit` run on one edit-sequence engine — apply-one, the multi-edit sequencer, the noop-loop guard, and the persist-undo → write → restore transaction — replacing `batch_edit`'s duplicated 685-line pipeline with a thin orchestrator. Batch apply, atomic batch rejection, and undo revert are now covered by end-to-end tests.
233
- - The hashline anchor math is a pure module (no store imports); persistence is a thin wrapper over it. The public hashline interface shrank to the consumer call surface.
234
- - The `read` tool and the write auto-read share one read-and-serve operation; canonical path resolution moved out of the write module into the path helpers.
235
- - All four tools validate requests through one contract module — field sets and the `[E_BAD_SHAPE]` vocabulary declared once.
236
- - The hash store exposes domain APIs (snapshots / undo / served) instead of raw prepared statements; corruption handling and cross-table cleanup are owned by the store, and the import graph is acyclic.
304
+ * Architecture deepening across six refactors (GitHub issues #1–#6), with the model-facing contract unchanged — every `[E_…]` code and message byte-identical, full suite green (615 → 626 tests):
305
+ * Served state (what the model has been shown) now lives in one async module: the doubled sync/async store interface (whose sync half had zero production callers) is gone, and the served-row merge invariant — stale tail / duplicate anchors — is one shared helper with a regression test.
306
+ * `edit` and `batch_edit` run on one edit-sequence engine — apply-one, the multi-edit sequencer, the noop-loop guard, and the persist-undo → write → restore transaction — replacing `batch_edit`'s duplicated 685-line pipeline with a thin orchestrator. Batch apply, atomic batch rejection, and undo revert are now covered by end-to-end tests.
307
+ * The hashline anchor math is a pure module (no store imports); persistence is a thin wrapper over it. The public hashline interface shrank to the consumer call surface.
308
+ * The `read` tool and the write auto-read share one read-and-serve operation; canonical path resolution moved out of the write module into the path helpers.
309
+ * All four tools validate requests through one contract module — field sets and the `[E_BAD_SHAPE]` vocabulary declared once.
310
+ * The hash store exposes domain APIs (snapshots / undo / served) instead of raw prepared statements; corruption handling and cross-table cleanup are owned by the store, and the import graph is acyclic.
237
311
 
238
312
  ## [0.1.9] - 2026-08-15
239
313
 
240
314
  ### Changed
241
315
 
242
- - READMEs (English and 中文): added a concise "Why you need this" opening section — the transcription cost and 46–51% patch-failure rate of `str_replace`, the 31%/43% edit-token savings, verified landing, and the leaner-context benefit (the model's attention stays on the code, not on re-transcribing it) — placed before Quick Start so the demo stays immediately visible. Fixed the stale static version badge.
316
+ * READMEs (English and 中文): added a concise "Why you need this" opening section — the transcription cost and 46–51% patch-failure rate of `str_replace`, the 31%/43% edit-token savings, verified landing, and the leaner-context benefit (the model's attention stays on the code, not on re-transcribing it) — placed before Quick Start so the demo stays immediately visible. Fixed the stale static version badge.
243
317
 
244
318
  ## [0.1.8] - 2026-08-15
245
319
 
246
320
  ### Added
247
321
 
248
- - This CHANGELOG (Keep-a-Changelog style, following the pi-interactive-shell layout), shipped in the npm tarball.
249
- - Git tag / GitHub release automation: a `postpublish` hook (`scripts/tag-current.mjs`) reads the version from `package.json`, creates an annotated `vX.Y.Z` tag at HEAD and pushes it, so every successful `npm publish` stays in sync with git; a GitHub Actions workflow (`.github/workflows/release.yml`) turns any `v*` tag push into a release with auto-generated notes.
250
- - Backfilled `v0.1.0`–`v0.1.7` git tags and GitHub releases at their version-bump commits.
322
+ * This CHANGELOG (Keep-a-Changelog style, following the pi-interactive-shell layout), shipped in the npm tarball.
323
+ * Git tag / GitHub release automation: a `postpublish` hook (`scripts/tag-current.mjs`) reads the version from `package.json`, creates an annotated `vX.Y.Z` tag at HEAD and pushes it, so every successful `npm publish` stays in sync with git; a GitHub Actions workflow (`.github/workflows/release.yml`) turns any `v*` tag push into a release with auto-generated notes.
324
+ * Backfilled `v0.1.0`–`v0.1.7` git tags and GitHub releases at their version-bump commits.
251
325
 
252
326
  ## [0.1.7] - 2026-08-15
253
327
 
254
328
  ### Added
255
329
 
256
- - `assets/logo.svg` and `assets/banner.svg` (file.ts → read → hashed lines → edit by hash → diff), shipped in the npm tarball.
257
- - READMEs (English and 中文) restyled in a centered, image-led layout: badge row, harness-problem pull-quote, example-driven Quick Start, a hashline-vs-`str_replace`-vs-line-number comparison table, project-structure tree, roadmap, acknowledgments, and a star-history chart.
330
+ * `assets/logo.svg` and `assets/banner.svg` (file.ts → read → hashed lines → edit by hash → diff), shipped in the npm tarball.
331
+ * READMEs (English and 中文) restyled in a centered, image-led layout: badge row, harness-problem pull-quote, example-driven Quick Start, a hashline-vs-`str_replace`-vs-line-number comparison table, project-structure tree, roadmap, acknowledgments, and a star-history chart.
258
332
 
259
333
  ### Changed
260
334
 
261
- - The published tarball now includes `assets/` alongside `README.md` and `README.zh.md`.
335
+ * The published tarball now includes `assets/` alongside `README.md` and `README.zh.md`.
262
336
 
263
337
  ## [0.1.6] - 2026-08-15
264
338
 
265
339
  ### Added
266
340
 
267
- - Chinese README (`README.zh.md`) — a full translation mirroring the English one (pillars, diagrams, benchmark, tools, error codes, lineage).
268
- - Reciprocal language links at the top of both READMEs; `README.zh.md` shipped in the npm tarball.
341
+ * Chinese README (`README.zh.md`) — a full translation mirroring the English one (pillars, diagrams, benchmark, tools, error codes, lineage).
342
+ * Reciprocal language links at the top of both READMEs; `README.zh.md` shipped in the npm tarball.
269
343
 
270
344
  ## [0.1.5] - 2026-08-15
271
345
 
272
346
  ### Added
273
347
 
274
- - Reproducible token-cost benchmark (`benchmark/run.mjs` + frozen 103-line corpus + methodology): hashline vs `str_replace` on the same file with the same 12 replacements — 31% fewer output tokens over the session (43% on multi-line ranges), ~1.4× cheaper on effective cost at the 5× output-token rate. Deterministic: content-addressed self-checking edit script, pinned `js-tiktoken` `cl100k_base` devDependency. Run with `npm run benchmark`.
275
- - README rewritten around the three pillars — token-saving, correctness, and the modern content-addressed edit pattern — with Mermaid diagrams, a `str_replace` comparison table, and an inspiration/lineage section (The Harness Problem, pi-hashline-edit, pi-hashline-edit-pro, pi-hashline-edit-lsz).
348
+ * Reproducible token-cost benchmark (`benchmark/run.mjs` + frozen 103-line corpus + methodology): hashline vs `str_replace` on the same file with the same 12 replacements — 31% fewer output tokens over the session (43% on multi-line ranges), ~1.4× cheaper on effective cost at the 5× output-token rate. Deterministic: content-addressed self-checking edit script, pinned `js-tiktoken` `cl100k_base` devDependency. Run with `npm run benchmark`.
349
+ * README rewritten around the three pillars — token-saving, correctness, and the modern content-addressed edit pattern — with Mermaid diagrams, a `str_replace` comparison table, and an inspiration/lineage section (The Harness Problem, pi-hashline-edit, pi-hashline-edit-pro, pi-hashline-edit-lsz).
276
350
 
277
351
  ## [0.1.4] - 2026-08-15
278
352
 
279
353
  ### Fixed
280
354
 
281
- - `E_RANGE_UNVERIFIED` ("served at N positions") on edits after a shrinking write: the served-state array was upserted by position but never truncated to the file's current line count, so a stale tail kept a surviving line's hash at its OLD position while the current serve held it at its new one. `recordServed`/`recordServes` now take the current line count and truncate before upserting, threaded from every whole-file serve — read, write auto-read, drift rows, and all rejection-echo sites. Regression test covers the 8-line→2-line write case ([Rianico/pi-hashline-edit-lsz#27](https://github.com/Rianico/pi-hashline-edit-lsz/issues/27)).
282
- - The fix is a candidate to upstream into pi-hashline-edit-lsz / upstream, whose `upsertServed` has the same never-truncate behavior (tracked in [Rianico/pi-hashline-edit-lsz#27](https://github.com/Rianico/pi-hashline-edit-lsz/issues/27)).
355
+ * `E_RANGE_UNVERIFIED` ("served at N positions") on edits after a shrinking write: the served-state array was upserted by position but never truncated to the file's current line count, so a stale tail kept a surviving line's hash at its OLD position while the current serve held it at its new one. `recordServed`/`recordServes` now take the current line count and truncate before upserting, threaded from every whole-file serve — read, write auto-read, drift rows, and all rejection-echo sites. Regression test covers the 8-line→2-line write case ([Rianico/pi-hashline-edit-lsz#27](https://github.com/Rianico/pi-hashline-edit-lsz/issues/27)).
356
+ * The fix is a candidate to upstream into pi-hashline-edit-lsz / upstream, whose `upsertServed` has the same never-truncate behavior (tracked in [Rianico/pi-hashline-edit-lsz#27](https://github.com/Rianico/pi-hashline-edit-lsz/issues/27)).
283
357
 
284
358
  ## [0.1.3] - 2026-08-15
285
359
 
286
360
  ### Fixed
287
361
 
288
- - Sandboxed sessions rejected in-workspace edits while the built-in `write` succeeded: the shadowed mutating tools called `fs.writeText` without the per-call sandbox policy, so a confined backend fell back to the deployment root. Tools now mirror `@deepseek-ai/dsh-tool-fs`'s `FsSandboxController` — resolve the policy with the session cwd as the workspace root, advertise `sandbox_permissions`/`justification`, pass the policy to `fs.writeText`, and map `FS_SANDBOX_DENIED` to the shared `[sandbox: …]` marker.
362
+ * Sandboxed sessions rejected in-workspace edits while the built-in `write` succeeded: the shadowed mutating tools called `fs.writeText` without the per-call sandbox policy, so a confined backend fell back to the deployment root. Tools now mirror `@deepseek-ai/dsh-tool-fs`'s `FsSandboxController` — resolve the policy with the session cwd as the workspace root, advertise `sandbox_permissions`/`justification`, pass the policy to `fs.writeText`, and map `FS_SANDBOX_DENIED` to the shared `[sandbox: …]` marker.
289
363
 
290
364
  ## [0.1.2] - 2026-08-15
291
365
 
292
366
  ### Changed
293
367
 
294
- - The hash store moved from `$DSH_HOME/plugins/dsh-better-edit` to a per-workspace location: `<workspace>/.dsh_better_edit/hash-store.sqlite`, carried per tool call via an AsyncLocalStorage workspace context (`src/workspace.ts`). Parallel sessions in different workspaces no longer share anchors or undo history. The shared home path remains the fallback for tests/previews.
295
- - Undo history from before 0.1.2 is not migrated to the new layout.
368
+ * The hash store moved from `$DSH_HOME/plugins/dsh-better-edit` to a per-workspace location: `<workspace>/.dsh_better_edit/hash-store.sqlite`, carried per tool call via an AsyncLocalStorage workspace context (`src/workspace.ts`). Parallel sessions in different workspaces no longer share anchors or undo history. The shared home path remains the fallback for tests/previews.
369
+ * Undo history from before 0.1.2 is not migrated to the new layout.
296
370
 
297
371
  ## [0.1.1] - 2026-08-15
298
372
 
299
373
  ### Fixed
300
374
 
301
- - Shadowed tools silently never registering, leaving sessions on the built-ins: per-agent installation failed with `cannot get property "fs" without inject` at `session-start`. The plugin now declares `inject = ['tools', 'systemPrompt', 'fs']` and resolves the host `fs` service from the plugin's own `rootCtx` (the agent fiber chain does not carry the plugin's inject list).
375
+ * Shadowed tools silently never registering, leaving sessions on the built-ins: per-agent installation failed with `cannot get property "fs" without inject` at `session-start`. The plugin now declares `inject = ['tools', 'systemPrompt', 'fs']` and resolves the host `fs` service from the plugin's own `rootCtx` (the agent fiber chain does not carry the plugin's inject list).
302
376
 
303
377
  ## [0.1.0] - 2026-08-14
304
378
 
305
379
  ### Added
306
380
 
307
- - Initial dsh port of pi-hashline-edit-lsz: hash-anchored `read` / `edit` / `batch_edit` / `undo_last_edit` tools for DeepSeek Harness. Every line gets a unique 3-character content hash; edits target `remove_from`/`remove_to` hashes. The hashline core is ported byte-for-byte; the tool layer is rewritten on dsh's plugin API ([batch_edit spec: Rianico/pi-hashline-edit-lsz#19](https://github.com/Rianico/pi-hashline-edit-lsz/issues/19)).
308
- - Built-in replacement via scope-layered registry shadowing: on `agent/session-start` the tools and the `tool:read`/`tool:edit` prompt sections are registered on the agent's own layer (own-layer-wins), unwinding automatically on disposal; a `tools/post-execute` listener appends the auto-read to built-in `write` results.
309
- - Served-state range verification with reject-and-serve: every line of the resolved range is checked against what the model was shown; stale/never-served/unverified ranges are hard-rejected with the current `HASH│content` rows echoed back (retry needs no `read`). Drift notices report served territory changed outside the edit range ([reject-and-serve spec: Rianico/pi-hashline-edit-lsz#13](https://github.com/Rianico/pi-hashline-edit-lsz/issues/13)).
310
- - Chained edits without re-reading: post-edit diff rows and rejection echoes count as serves, so follow-up edits verify cleanly.
311
- - Error-code contract (`[E_*]` codes, README-documented and test-enforced) including the noop-loop guard ([Rianico/pi-hashline-edit-lsz#18](https://github.com/Rianico/pi-hashline-edit-lsz/issues/18)); `undo_last_edit` surviving restarts; and safe writes preserving permissions, line endings, BOMs, symlinks, and hard links via `ctx.fs`.
312
- - Test suite ported from pi-hashline-edit-lsz (614 tests at release), driving the dsh tool builders directly over a local filesystem bridge.
381
+ * Initial dsh port of pi-hashline-edit-lsz: hash-anchored `read` / `edit` / `batch_edit` / `undo_last_edit` tools for DeepSeek Harness. Every line gets a unique 3-character content hash; edits target `remove_from`/`remove_to` hashes. The hashline core is ported byte-for-byte; the tool layer is rewritten on dsh's plugin API ([batch_edit spec: Rianico/pi-hashline-edit-lsz#19](https://github.com/Rianico/pi-hashline-edit-lsz/issues/19)).
382
+ * Built-in replacement via scope-layered registry shadowing: on `agent/session-start` the tools and the `tool:read`/`tool:edit` prompt sections are registered on the agent's own layer (own-layer-wins), unwinding automatically on disposal; a `tools/post-execute` listener appends the auto-read to built-in `write` results.
383
+ * Served-state range verification with reject-and-serve: every line of the resolved range is checked against what the model was shown; stale/never-served/unverified ranges are hard-rejected with the current `HASH│content` rows echoed back (retry needs no `read`). Drift notices report served territory changed outside the edit range ([reject-and-serve spec: Rianico/pi-hashline-edit-lsz#13](https://github.com/Rianico/pi-hashline-edit-lsz/issues/13)).
384
+ * Chained edits without re-reading: post-edit diff rows and rejection echoes count as serves, so follow-up edits verify cleanly.
385
+ * Error-code contract (`[E_*]` codes, README-documented and test-enforced) including the noop-loop guard ([Rianico/pi-hashline-edit-lsz#18](https://github.com/Rianico/pi-hashline-edit-lsz/issues/18)); `undo_last_edit` surviving restarts; and safe writes preserving permissions, line endings, BOMs, symlinks, and hard links via `ctx.fs`.
386
+ * Test suite ported from pi-hashline-edit-lsz (614 tests at release), driving the dsh tool builders directly over a local filesystem bridge.