ask-tools-shell 0.5.0 → 0.5.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/ask/tools/shell/apply_patch.rb +4 -0
- data/lib/ask/tools/shell/edit.rb +4 -4
- data/lib/ask/tools/shell/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a13d88c2167e73290edfcabe00488c6e7f9592e75fe5004fe878bc4e075585dd
|
|
4
|
+
data.tar.gz: 616e5788149068c16fabc73ea10c2984dfa917f359cdf9bc247e8b9327d562be
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fa1585022477ed69de424aa059ad0f13fc6652a01bf3b3ea2528dc944a6a1e218f247713b57828303770d7def901d2692b6d6557356cc9e8262f14727f6b99f2
|
|
7
|
+
data.tar.gz: 2da4a9a5aed750c5991a833e06a391199643e7c3b577d0d4c425120643bd9b23169e8c81ba95140d258a79e694fcfbd90bf220d45f7da53a05092c9003a61d69
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [0.5.1] - 2026-08-10
|
|
2
|
+
|
|
3
|
+
### Fixed
|
|
4
|
+
- **Ledger stays consistent after full-context edits.** `Edit` and
|
|
5
|
+
`ApplyPatch` read files in full, so they now record a full read for the
|
|
6
|
+
current state after writing — previously their write left the ledger with
|
|
7
|
+
a stale partial view that could deny a subsequent `Write` even though the
|
|
8
|
+
file had been fully read in between. (`ApplyPatch` gains the same
|
|
9
|
+
post-write record `Edit` had; `Edit`'s record moved to post-write so it
|
|
10
|
+
stays valid for the current file state.)
|
|
11
|
+
|
|
1
12
|
## [0.5.0] - 2026-08-10
|
|
2
13
|
|
|
3
14
|
### Added
|
|
@@ -100,6 +100,10 @@ module Ask
|
|
|
100
100
|
return Ask::Result.error(message: "Hunk does not match file content for: #{path}")
|
|
101
101
|
end
|
|
102
102
|
operations.write_file(path, new_content)
|
|
103
|
+
# ApplyPatch read the whole file to apply its hunks, so the model
|
|
104
|
+
# has full context — record a full read so a later Write isn't
|
|
105
|
+
# blocked by an earlier partial view.
|
|
106
|
+
Shell::FileLedger.record(path, partial: false, lines_seen: [0, new_content.count("\n") + 1])
|
|
103
107
|
results << { action: "update", path: entry[:path] }
|
|
104
108
|
|
|
105
109
|
when :delete
|
data/lib/ask/tools/shell/edit.rb
CHANGED
|
@@ -95,10 +95,6 @@ module Ask
|
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
raw = operations.read_file(path)
|
|
98
|
-
# Edit reads the whole file, so the model has seen all of it — record
|
|
99
|
-
# that before the write so a later Write isn't blocked by a stale
|
|
100
|
-
# partial view (and so the ledger reflects what was actually shown).
|
|
101
|
-
Shell::FileLedger.record(path, partial: false, lines_seen: [0, raw.count("\n") + 1])
|
|
102
98
|
bom, content = Shell.strip_bom(raw)
|
|
103
99
|
original_ending = Shell.detect_line_ending(content)
|
|
104
100
|
content = Shell.normalize_line_endings(content)
|
|
@@ -119,6 +115,10 @@ module Ask
|
|
|
119
115
|
content = bom + content
|
|
120
116
|
|
|
121
117
|
operations.write_file(path, content)
|
|
118
|
+
# Edit read the whole file to apply the change, so the model has full
|
|
119
|
+
# context — record a full read of the current state so a later Write
|
|
120
|
+
# isn't blocked by an earlier partial view.
|
|
121
|
+
Shell::FileLedger.record(path, partial: false, lines_seen: [0, content.count("\n") + 1])
|
|
122
122
|
Ask::Result.ok(data: { path: path, replacements: count },
|
|
123
123
|
metadata: { path: path, replacements: count })
|
|
124
124
|
end
|