dsh-hashline-edit 0.3.6 → 0.3.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-hashline-edit",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
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",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
- apply_patch: one call = one transaction; batch related changes and split only when an earlier RESULT decides the next.
|
|
2
|
+
- apply_patch: prefer identity hunks that name served `HASH│` anchors; a fragment hunk is only for targets the session never served.
|
|
2
3
|
- apply_patch: hunks are validated against the pre-call file in order (overlapping ranges reject the batch); a fragment hunk must match exactly once — add context to disambiguate, never guess — while identity hunks target served rows and a stale or unknown anchor is rejected; both serve the current rows back.
|
|
3
4
|
- apply_patch: a rejection writes nothing; retry from the served `HASH│content` rows without another `read`.
|
|
4
5
|
- apply_patch: success returns fresh anchors for changed lines; whole-file replacement is one identity hunk over every served line.
|
package/prompts/apply-patch.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Create, update, delete, move, copy, or cut UTF-8 text files with a single transactional patch; prefer it over multiple single-file edits when a change spans files or separated regions. Pass the complete patch as `input`.
|
|
1
|
+
Create, update, delete, move, copy, or cut UTF-8 text files with a single transactional patch; prefer it over multiple single-file edits when a change spans files or separated regions. Pass the complete patch as `input`. Prefer identity hunks that target served `HASH│` anchors (`@@<anchor>`) over fragment hunks matched by file text; use a fragment hunk only where no served row covers the change.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
- apply_patch:一次调用 = 一个事务;把相关改动成批处理,只有当先前的结果决定下一步时才拆分。
|
|
2
|
+
- apply_patch:优先使用指向已服务 `HASH│` 锚点的身份 hunk;片段 hunk 仅用于本会话从未服务过的目标。
|
|
2
3
|
- apply_patch:各 hunk 按顺序针对调用前的文件校验(重叠范围会拒绝整批);片段 hunk 必须恰好匹配一次——补充上下文以消歧,绝不猜测——身份 hunk 定位已服务的行,陈旧或未知锚点会被拒绝;两者都会回送当前行。
|
|
3
4
|
- apply_patch:拒绝时不写入任何内容;从回送的 `HASH│content` 行重试,无需再次 `read`。
|
|
4
5
|
- apply_patch:成功时返回改动行的新锚点;整文件替换是用一个身份 hunk 覆盖每一行已服务的行。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
用单个事务补丁创建、更新、删除、移动、复制或剪切 UTF-8 文本文件;当改动跨多个文件或分散区域时,优先于多次单文件编辑。把完整补丁作为 `input`
|
|
1
|
+
用单个事务补丁创建、更新、删除、移动、复制或剪切 UTF-8 文本文件;当改动跨多个文件或分散区域时,优先于多次单文件编辑。把完整补丁作为 `input` 传入。优先使用指向已服务 `HASH│` 锚点的身份 hunk(`@@<anchor>`),而不是按文件文本匹配的片段 hunk;仅当改动处没有已服务的行时才用片段 hunk。
|