Merge origin/main into duncan/byoh-generic-acp-harness

Main's #2974 modularized managed_agents/runtime.rs (process / orphan_sweep /
instance_reaper / lifecycle / metadata) from pre-PR content, conflicting with
this PR's runtime.rs changes. Resolution re-applies the PR's semantics into
the new module layout, changing nothing else:

- process.rs: valid_agent_runtime_receipt delegates to injectable
  valid_agent_runtime_receipt_with; marker-only ownership (name gate dropped).
- orphan_sweep.rs: sweep ownership rule comment block; marker-only gates in
  sweep_orphaned/sweep_system/collect_same_instance_orphans (macOS + Linux).
- instance_reaper.rs: name pre-gate removed on both platforms (marker is the
  authoritative proof).
- lifecycle.rs: kill_stale_tracked_processes delegates to injectable
  kill_stale_tracked_processes_with.
- runtime.rs: build_managed_agent_summary/spawn_agent_child keep the PR's
  descriptor resolver, global_config param, MissingBinary requirement, and
  descriptor.env write-back (main refactor did not touch these hunks);
  cfg(test) re-exports added for the injectable seams.
- check-file-sizes.mjs: took main's side (runtime.rs override removed by
  #2974; post-merge runtime.rs is 944 lines, under the 1000 ceiling).
  runtime/tests.rs keeps the PR's 1320 ratchet.

Verified at merge tree: cargo test --lib 1705/0 (14 ignored), clippy -D
warnings, fmt, file-size gate all clean.

Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
This commit is contained in:
npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d
2026-07-26 12:05:38 -04:00
co-authored by Tyler Longwell
7 changed files with 1426 additions and 1422 deletions
-26
View File
@@ -122,32 +122,6 @@ const overrides = new Map([
// helpers) replace the pubkey-keyed PID file, plus the hashed pair-scoped
// runtime log path. Load-bearing crash-recovery surface; queued to split.
["src-tauri/src/managed_agents/storage.rs", 1383],
// harness-persona-sync: persona-runtime resolution threaded into the spawn
// path here. Load-bearing feature growth; queued to split in the resolver
// unify refactor followup. +26 for resolve_effective_prompt_model_provider
// re-introduced after 826d735fe removal (config-bridge caller still needs it).
// PGID resolution helper + PID-recycling safety guard added for orphan sweep.
// activity-feed threads avatar_url into build_managed_agent_summary for the
// assistant-bubble pinned snapshot.
// +1 for agent_pubkey field in setup payload (config-nudge card wire).
// persona-blank-fallback: resolve_effective_prompt_model_provider gains a
// record_provider param + applies persona_field_with_record_fallback. +5 lines.
// global-agent-config: spawn_agent_child loads global config and merges as
// lowest env layer (+8 lines). Queued to split.
// +2: BYOH orphan-sweep fix — `!belongs && !has_buzz_marker` OR-gate replaces
// the old AND-gate so custom harness processes are not silently leaked on crash.
// +27: BYOH F4 fix — extract shared `buzz_sweep_owns_process` predicate, fix
// Linux AND-gate in sweep + orphan collectors, 4 production predicate tests.
// +12: BYOH F2 — record_agent_command / effective_agent_command check loaded
// harness registry for preset/custom ids after static-builtin lookup.
// +61: BYOH pass-2 — I2 (spawn_agent_child env+args from definition), I3
// (valid_agent_runtime_receipt uses buzz_sweep_owns_process marker-only),
// I6 (cross-platform buzz_sweep_owns_process, drop #[cfg(unix)]), +2 new
// receipt-path collector-decision tests.
// +2: BYOH Phase A — resolve_effective_harness_descriptor single typed resolver;
// C-9 injectable sweep predicates (kill_stale_tracked_processes_with +
// valid_agent_runtime_receipt_with) with 5 discriminating tests.
["src-tauri/src/managed_agents/runtime.rs", 2326],
// config-bridge setup-payload env-boundary fix adds readiness wiring in
// spawn_agent_child; load-bearing security fix, queued to split.
["src-tauri/src/managed_agents/config_bridge/reader.rs", 1016],