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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8805be0a64d1a42f4b0eae3600c81ce0e61565fa19aaf1fd835d36fbb6fa9b58
4
- data.tar.gz: fe497b0c0604cc2c9a90cd02bc17c31ff8f46140ac88a67e9697b5b9cd15f7ee
3
+ metadata.gz: a13d88c2167e73290edfcabe00488c6e7f9592e75fe5004fe878bc4e075585dd
4
+ data.tar.gz: 616e5788149068c16fabc73ea10c2984dfa917f359cdf9bc247e8b9327d562be
5
5
  SHA512:
6
- metadata.gz: defeb70d692dc1da34ad21300ed52dff8496df4fd28c3365b7724d9e3a6c113afbdd7816619cfa0f9017479d9af1a061fb0ef82c140110f0e46209df8829bdc6
7
- data.tar.gz: e855c29b7b8ed782dab2fccb0764c3eebe4b5b5b7af039aff713fc746c31b3b70f77b1a47abc250a54b217a3bacba4642bef97aa3f409e5f52ee80043a8f0610
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
@@ -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
@@ -3,7 +3,7 @@
3
3
  module Ask
4
4
  module Tools
5
5
  module Shell
6
- VERSION = "0.5.0"
6
+ VERSION = "0.5.1"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-tools-shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto