ace-herdr 0.8.1 → 0.10.0

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.
@@ -2,10 +2,10 @@
2
2
  "schema": "ace.herdr.native-source/v1",
3
3
  "repository": "https://github.com/herdrdev/herdr.git",
4
4
  "baseline_commit": "7b116c05bfda646af39d2524c54e70c751f57ee8",
5
- "source_commit": "7a2e78b4e92d2b694bd8a06c1ef4943915c399b2",
6
- "source_tree": "77d1f89f514731239c02b0966c49b9e5f30650da",
5
+ "source_commit": "f475b86b1fc0a72103fbdf5cc0aba7dfc54cdcb4",
6
+ "source_tree": "61d414a2d7377d1ec3f10fa433b26a80be26e235",
7
7
  "patch_file": "guarded-prompt.patch",
8
- "patch_sha256": "92971473f75c116181dc73de138d91f532e1cb62220c13eace2eb5cfd05fa811",
8
+ "patch_sha256": "f6c60630cf64472e2bb9d9a6ff11590730191f88fc5793e0e5fb171004514429",
9
9
  "cargo_lock_sha256": "bb3ab17351af496a2cc316a11c81a97f90959cd37c3d5625f2f8028c0133ffca",
10
10
  "rust_toolchain_sha256": "0d9298c075817aba62477d23dcda3534cd836b5d5cf1960bd2de54df675ceffd",
11
11
  "rust_version": "1.96.1",
@@ -15,7 +15,7 @@
15
15
  "committer": {
16
16
  "name": "Miguel",
17
17
  "email": "mc@cs3b.com",
18
- "date": "2026-10-07T00:43:20+01:00"
18
+ "date": "2026-11-10T23:16:46+00:00"
19
19
  },
20
20
  "targets": [
21
21
  "x86_64-unknown-linux-musl",
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ set -eu
3
+ exec "$ZIG" cc -target "$ACE_NATIVE_ZIG_TARGET" "$@"
@@ -26,9 +26,11 @@ module Ace
26
26
  executor: Molecules::HerdrExecutor.new,
27
27
  preset_loader: Molecules::PresetLoader.new,
28
28
  default_agent_kind: "pi",
29
- agent_start_timeout_ms: 60_000
29
+ agent_start_timeout_ms: 60_000,
30
+ env: ENV
30
31
  )
31
32
  @executor = executor
33
+ @env = env
32
34
  @preset_loader = preset_loader
33
35
  @default_agent_kind = default_agent_kind
34
36
  @agent_start_timeout_ms = agent_start_timeout_ms
@@ -76,8 +78,9 @@ module Ace
76
78
 
77
79
  # Live workspaces (tmux sessions analogue)
78
80
  def list_workspaces
79
- result_rows(@executor.workspace_list.parsed_json, "workspaces")
81
+ rows = result_rows(@executor.workspace_list.parsed_json, "workspaces")
80
82
  .map { |row| normalize_workspace(row) }
83
+ rows
81
84
  end
82
85
 
83
86
  # --- capture ------------------------------------------------------------
@@ -41,7 +41,7 @@ module Ace
41
41
  # @return [Models::DispatchOutcome]
42
42
  # @raise [TargetResolutionError] workspace/pane cannot be resolved
43
43
  # @raise [ExecutorError] herdr command failures
44
- def dispatch(label:, prompt:, kind: nil, workspace_id: nil, pane: nil, cwd: nil)
44
+ def dispatch(label:, prompt:, kind: nil, workspace_id: nil, pane: nil, cwd: nil, role: nil, env_file: nil, args: [])
45
45
  kind ||= @default_agent_kind
46
46
  tab_created = false
47
47
 
@@ -53,14 +53,14 @@ module Ace
53
53
  end
54
54
  validate_token!(pane, "pane")
55
55
 
56
- @executor.pane_run(
57
- pane,
58
- Ace::Support::Cli::Toolchain.shell_setup + "export HERDR_SESSION=#{Shellwords.escape(workspace_id)} " \
59
- "HERDR_PANE=#{Shellwords.escape(pane)}"
60
- )
61
- @executor.agent_start(
62
- name: label, kind: kind, pane: pane, timeout_ms: @agent_start_timeout_ms
63
- )
56
+ unless env_file
57
+ @executor.pane_run(pane, Ace::Support::Cli::Toolchain.shell_setup +
58
+ "export HERDR_SESSION=#{Shellwords.escape(workspace_id)} HERDR_PANE=#{Shellwords.escape(pane)}")
59
+ end
60
+ options = {name: label, kind: kind, pane: pane, timeout_ms: @agent_start_timeout_ms}
61
+ options[:env_file] = env_file if env_file
62
+ options[:args] = args unless args.empty?
63
+ @executor.agent_start(**options)
64
64
 
65
65
  prompted = false
66
66
  unless prompt.empty?
@@ -11,6 +11,9 @@ module Ace
11
11
  # Explicit source build, outside the installed protected deployment.
12
12
  # No server contact, product execution, global tool selection or publication.
13
13
  class NativeSourceBuilder
14
+ # A cold ARM64 build includes Ghostty's Zig/C++ dependencies and may
15
+ # exceed 30 minutes even while all compiler processes remain active.
16
+ BUILD_TIMEOUT_SECONDS = 7200
14
17
  def initialize(selection: Molecules::NativeSource.new, runner: nil)
15
18
  @selection = selection
16
19
  @runner = runner || lambda do |argv, environment:, chdir:, timeout_s:|
@@ -58,9 +61,16 @@ module Ace
58
61
  compile_environment = @environment.merge("CARGO_HOME" => cargo_home,
59
62
  "CARGO_TARGET_DIR" => File.join(staging, "target"), "RUSTC" => tools.fetch("rustc"),
60
63
  "RUSTUP_TOOLCHAIN" => selected.fetch("rust_version"), "ZIG" => tools.fetch("zig"),
64
+ # Panic locations and generated source references otherwise embed
65
+ # the caller's output directory even in stripped release binaries.
66
+ # Zig supplies target libc/startup objects. Rust's bundled CRT
67
+ # would otherwise introduce duplicate _start symbols.
68
+ "CARGO_ENCODED_RUSTFLAGS" => "--remap-path-prefix=#{staging}=/ace-native-build\x1f-Clink-self-contained=no",
69
+ "ACE_NATIVE_ZIG_TARGET" => target.sub("-unknown", ""),
70
+ "CC_#{target.tr('-', '_')}" => tools.fetch("linker"),
61
71
  "CARGO_TARGET_#{target.upcase.tr("-", "_")}_LINKER" => tools.fetch("linker"))
62
72
  run([tools.fetch("cargo"), "build", "--release", "--locked", "--target", target],
63
- chdir: checkout, environment: compile_environment, timeout_s: 1800)
73
+ chdir: checkout, environment: compile_environment, timeout_s: BUILD_TIMEOUT_SECONDS)
64
74
  verify_source_files(checkout)
65
75
  unless tool_digests(tools) == tool_digests
66
76
  raise Molecules::NativeSource::Error, "native build tools changed during compilation"
@@ -81,12 +91,9 @@ module Ace
81
91
 
82
92
  private
83
93
 
84
- def validate_native_host!(target)
85
- architecture = {"x86_64-unknown-linux-musl" => /\A(?:x86_64|amd64)\z/,
86
- "aarch64-unknown-linux-musl" => /\A(?:aarch64|arm64)\z/}.fetch(target)
87
- unless RbConfig::CONFIG.fetch("host_os").include?("linux") &&
88
- architecture.match?(RbConfig::CONFIG.fetch("host_cpu"))
89
- raise Molecules::NativeSource::Error, "native source builds require a matching Linux host; cross builds are unsupported"
94
+ def validate_native_host!(_target)
95
+ unless RbConfig::CONFIG.fetch("host_os").match?(/linux|darwin/)
96
+ raise Molecules::NativeSource::Error, "native source builds require a Linux or macOS build host"
90
97
  end
91
98
  end
92
99
 
@@ -137,7 +144,10 @@ module Ace
137
144
  [name, File.realpath(path)]
138
145
  end
139
146
  tools["zig"] = executable("zig")
140
- tools["linker"] = executable("musl-gcc")
147
+ tools["linker"] = linker_path
148
+ unless File.file?(tools["linker"]) && File.executable?(tools["linker"])
149
+ raise Molecules::NativeSource::Error, "packaged Zig target linker is unavailable"
150
+ end
141
151
  unless run([tools.fetch("rustc"), "--version"]).start_with?("rustc #{version} ") &&
142
152
  run([tools.fetch("cargo"), "--version"]).start_with?("cargo #{version} ") &&
143
153
  run([tools.fetch("zig"), "version"]).strip == @selection.selection.fetch("zig_version")
@@ -146,6 +156,10 @@ module Ace
146
156
  tools
147
157
  end
148
158
 
159
+ def linker_path
160
+ File.expand_path("../native_source/zig-linker", __dir__)
161
+ end
162
+
149
163
  def git(checkout, *arguments)
150
164
  run([@git, "-c", "core.hooksPath=/dev/null", "-c", "commit.gpgsign=false", "-C", checkout, *arguments])
151
165
  end
@@ -164,7 +178,14 @@ module Ace
164
178
  def run(argv, chdir: nil, environment: @environment, timeout_s: 60)
165
179
  result = @runner.call(argv, environment: environment, chdir: chdir, timeout_s: timeout_s)
166
180
  unless result.status.success? && !result.oversized
167
- raise Molecules::NativeSource::Error, "native build command failed or exceeded output bound"
181
+ # The build runs with a closed toolchain environment and no secrets.
182
+ # Keep compiler diagnostics bounded, but do not discard the reason
183
+ # needed to repair a failed build before retrying it.
184
+ detail = result.stderr.to_s.dup.force_encoding(Encoding::UTF_8).scrub
185
+ .gsub(/\e\[[0-9;]*[A-Za-z]/, "")
186
+ detail = detail.byteslice(-8192, 8192).scrub("") if detail.bytesize > 8192
187
+ raise Molecules::NativeSource::Error,
188
+ "native build command failed (#{File.basename(argv.first)}, output_limit=#{result.oversized}): #{detail.strip}"
168
189
  end
169
190
  result.stdout
170
191
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ace
4
4
  module Herdr
5
- VERSION = "0.8.1"
5
+ VERSION = "0.10.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ace-herdr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Czyz
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-10-20 00:00:00.000000000 Z
10
+ date: 2026-11-10 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: websocket-driver
@@ -64,6 +64,9 @@ dependencies:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0.3'
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 0.4.2
67
70
  type: :runtime
68
71
  prerelease: false
69
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -71,6 +74,9 @@ dependencies:
71
74
  - - "~>"
72
75
  - !ruby/object:Gem::Version
73
76
  version: '0.3'
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: 0.4.2
74
80
  - !ruby/object:Gem::Dependency
75
81
  name: ace-support-cli
76
82
  requirement: !ruby/object:Gem::Requirement
@@ -220,6 +226,7 @@ files:
220
226
  - LICENSE
221
227
  - README.md
222
228
  - Rakefile
229
+ - docs/native-source.md
223
230
  - docs/usage.md
224
231
  - exe/ace-herdr
225
232
  - lib/ace/herdr.rb
@@ -261,6 +268,7 @@ files:
261
268
  - lib/ace/herdr/molecules/inbox_context_wire.rb
262
269
  - lib/ace/herdr/molecules/inbox_direct_effect_binding.rb
263
270
  - lib/ace/herdr/molecules/inbox_direct_result.rb
271
+ - lib/ace/herdr/molecules/installed_pi_extensions.rb
264
272
  - lib/ace/herdr/molecules/native_queue_executor.rb
265
273
  - lib/ace/herdr/molecules/native_source.rb
266
274
  - lib/ace/herdr/molecules/pane_tidy_probe.rb
@@ -272,6 +280,7 @@ files:
272
280
  - lib/ace/herdr/native_source/HERDR-LICENSE
273
281
  - lib/ace/herdr/native_source/guarded-prompt.patch
274
282
  - lib/ace/herdr/native_source/selection.json
283
+ - lib/ace/herdr/native_source/zig-linker
275
284
  - lib/ace/herdr/organisms/control_surface.rb
276
285
  - lib/ace/herdr/organisms/deliverer.rb
277
286
  - lib/ace/herdr/organisms/dispatcher.rb