ace-overseer 0.31.0 → 0.31.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 +6 -0
- data/lib/ace/overseer/molecules/eyes_session_evidence.rb +44 -12
- data/lib/ace/overseer/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a7bd199f526cd282ebb59d712113fc4d5e3d85231f2bdc0dfc65d3b5a1400e63
|
|
4
|
+
data.tar.gz: 671ee238f79bdb4469592b827b6ca89a535c29ebcb435a6bfd15beb294640167
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c94a54662c6a9fe25d44a1426c0a4fc8486f812b1e3f889aa2f82749bb5f17232d47b7819e4f3e7181aeede37d25b56b4111942a7fe26fc60a6a3bf1108b3f6
|
|
7
|
+
data.tar.gz: b05613ed67ee5edc6c71fed92805e2e08131475be997f1c07d09a2d4a7709968a1fbe7ca185a76d4489777fab91a5be0cdf83be413e248eaf0e7ab7a68d5c28d
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.31.1] - 2026-11-15
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Read long-lived Pi sessions incrementally and retain only readiness evidence instead of rejecting histories above 64 MiB.
|
|
15
|
+
|
|
10
16
|
## [0.31.0] - 2026-11-12
|
|
11
17
|
|
|
12
18
|
### Changed
|
|
@@ -12,7 +12,7 @@ module Ace
|
|
|
12
12
|
# Reconstruct Pi's current persisted branch and bind its eyes evidence
|
|
13
13
|
# to the live Herdr pane and process, without persisting another copy.
|
|
14
14
|
class EyesSessionEvidence
|
|
15
|
-
|
|
15
|
+
MAX_ENTRY_BYTES = 64 * 1024 * 1024
|
|
16
16
|
MAX_ENTRIES = 200_000
|
|
17
17
|
SESSION_PATH = %r{\A/[^\0]*_([0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})\.jsonl\z}
|
|
18
18
|
|
|
@@ -54,12 +54,11 @@ module Ace
|
|
|
54
54
|
path = before.fetch("path")
|
|
55
55
|
file = @file_opener.call(path)
|
|
56
56
|
stat = file.stat
|
|
57
|
-
return false unless stat.file? && stat.size.
|
|
58
|
-
|
|
59
|
-
return false unless content && content.bytesize == stat.size && content.end_with?("\n")
|
|
57
|
+
return false unless stat.file? && stat.size.positive?
|
|
58
|
+
header, branch = branch_for(file, prompt)
|
|
60
59
|
again = file.stat
|
|
61
|
-
return false unless
|
|
62
|
-
|
|
60
|
+
return false unless file.pos == stat.size &&
|
|
61
|
+
[stat.dev, stat.ino, stat.size, stat.mtime] == [again.dev, again.ino, again.size, again.mtime]
|
|
63
62
|
return false unless header["cwd"] == root && header["id"].to_s.downcase == before.fetch("session_id").downcase
|
|
64
63
|
|
|
65
64
|
eye = branch.reverse.find { |entry| entry["type"] == "custom" && entry["customType"] == EyesEvidence::ENTRY }
|
|
@@ -104,18 +103,51 @@ module Ace
|
|
|
104
103
|
list.is_a?(Array) && list.any? { |row| row.is_a?(Hash) && row["pid"] == pid }
|
|
105
104
|
end
|
|
106
105
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
# Bound individual records, not the lifetime of an otherwise healthy
|
|
107
|
+
# session. Retain only evidence fields; tool output and acknowledged
|
|
108
|
+
# event maps can dwarf the readiness proof in long-running sessions.
|
|
109
|
+
def read_entry(file)
|
|
110
|
+
line = file.gets(MAX_ENTRY_BYTES + 1)
|
|
111
|
+
return unless line
|
|
112
|
+
raise ArgumentError, "invalid session record size or terminator" unless
|
|
113
|
+
line.bytesize <= MAX_ENTRY_BYTES && line.end_with?("\n")
|
|
114
|
+
entry = JSON.parse(line, create_additions: false, max_nesting: 64, allow_duplicate_key: false)
|
|
115
|
+
raise ArgumentError, "session record must be an object" unless entry.is_a?(Hash)
|
|
116
|
+
entry
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def readiness_entry(entry, prompt)
|
|
120
|
+
result = entry.slice("id", "parentId", "type", "timestamp", "customType")
|
|
121
|
+
if entry["type"] == "message" && entry["message"].is_a?(Hash)
|
|
122
|
+
message = entry["message"]
|
|
123
|
+
result["message"] = message.slice("role", "stopReason")
|
|
124
|
+
content = message["content"]
|
|
125
|
+
matched = content == prompt || content.is_a?(Array) && content.any? do |part|
|
|
126
|
+
part.is_a?(Hash) && part["type"] == "text" && part["text"] == prompt
|
|
127
|
+
end
|
|
128
|
+
result["message"]["content"] = prompt if matched
|
|
129
|
+
elsif entry["type"] == "custom" && entry["data"].is_a?(Hash)
|
|
130
|
+
keys = case entry["customType"]
|
|
131
|
+
when EyesEvidence::BINDING then %w[ownerCwd process]
|
|
132
|
+
when EyesEvidence::ENTRY then %w[ownerCwd enabled retired breaker errors config observerEvidence]
|
|
133
|
+
else []
|
|
134
|
+
end
|
|
135
|
+
result["data"] = entry["data"].slice(*keys)
|
|
136
|
+
end
|
|
137
|
+
result
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def branch_for(file, prompt)
|
|
141
|
+
header = read_entry(file)
|
|
111
142
|
raise ArgumentError, "invalid Pi session" unless header.is_a?(Hash) && header["type"] == "session" && header["version"] == 3
|
|
112
143
|
entries = {}
|
|
113
144
|
last = nil
|
|
114
|
-
|
|
115
|
-
|
|
145
|
+
while (entry = read_entry(file))
|
|
146
|
+
raise ArgumentError, "session entry limit" if entries.size >= MAX_ENTRIES
|
|
116
147
|
raise ArgumentError, "invalid session entry" unless entry.is_a?(Hash) && entry["id"].is_a?(String) &&
|
|
117
148
|
!entry["id"].empty? && !entries.key?(entry["id"]) &&
|
|
118
149
|
(entry["parentId"].nil? || entries.key?(entry["parentId"]))
|
|
150
|
+
entry = readiness_entry(entry, prompt)
|
|
119
151
|
entries[entry["id"]] = entry
|
|
120
152
|
last = entry
|
|
121
153
|
end
|
data/lib/ace/overseer/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ace-overseer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.31.
|
|
4
|
+
version: 0.31.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michal Czyz
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-11-
|
|
10
|
+
date: 2026-11-15 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: ace-support-cli
|
|
@@ -234,7 +234,7 @@ dependencies:
|
|
|
234
234
|
version: '0.11'
|
|
235
235
|
- - ">="
|
|
236
236
|
- !ruby/object:Gem::Version
|
|
237
|
-
version: 0.11.
|
|
237
|
+
version: 0.11.3
|
|
238
238
|
type: :runtime
|
|
239
239
|
prerelease: false
|
|
240
240
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -244,7 +244,7 @@ dependencies:
|
|
|
244
244
|
version: '0.11'
|
|
245
245
|
- - ">="
|
|
246
246
|
- !ruby/object:Gem::Version
|
|
247
|
-
version: 0.11.
|
|
247
|
+
version: 0.11.3
|
|
248
248
|
- !ruby/object:Gem::Dependency
|
|
249
249
|
name: ace-lab
|
|
250
250
|
requirement: !ruby/object:Gem::Requirement
|