ask-tools-shell 0.5.0 → 0.5.2

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: 7e0ee1bfe576ebc5adc41d2e6b07334c928eede7abea5b29a8ba991afe2d9921
4
+ data.tar.gz: cc92808594b5b4a5d6022cf93ae0c6347a1410bccb6443ce56fb9fe49c05dc17
5
5
  SHA512:
6
- metadata.gz: defeb70d692dc1da34ad21300ed52dff8496df4fd28c3365b7724d9e3a6c113afbdd7816619cfa0f9017479d9af1a061fb0ef82c140110f0e46209df8829bdc6
7
- data.tar.gz: e855c29b7b8ed782dab2fccb0764c3eebe4b5b5b7af039aff713fc746c31b3b70f77b1a47abc250a54b217a3bacba4642bef97aa3f409e5f52ee80043a8f0610
6
+ metadata.gz: 179d47b5235324542e3f3ee08474201ba0f4c5ec1ae7413b997c8cb8574588bbf356e08982bdb2e14a2f722eff89a79c3ef1444251469d27b030a8a4ecc57de3
7
+ data.tar.gz: f3afa00cf9b407113e4b4ef2af37e4c5ba99ed750296463d4bfc706f850f10da0ca2467b5de6ba050aa30206d2a75dbe5a22de0af600746b804495cb126fd7e5
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.2"
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '0.1'
18
+ version: 0.6.1
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '0.1'
25
+ version: 0.6.1
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: ask-sandbox-providers
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []
129
- rubygems_version: 4.0.3
129
+ rubygems_version: 4.0.18
130
130
  specification_version: 4
131
131
  summary: Shell, filesystem, and code execution tools
132
132
  test_files: []