@team-agent/installer 0.5.61 → 0.5.62
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.
- package/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/crates/team-agent/src/cli/adapters.rs +5 -2
- package/crates/team-agent/src/cli/attach_app_server_leader.rs +1 -0
- package/crates/team-agent/src/cli/diagnose.rs +1 -0
- package/crates/team-agent/src/cli/emit.rs +41 -7
- package/crates/team-agent/src/cli/helpers.rs +1 -0
- package/crates/team-agent/src/cli/leader.rs +6 -1
- package/crates/team-agent/src/cli/leaders.rs +2 -0
- package/crates/team-agent/src/cli/mod.rs +33 -3
- package/crates/team-agent/src/cli/named_address.rs +8 -1
- package/crates/team-agent/src/cli/profile.rs +2 -1
- package/crates/team-agent/src/cli/send/coordinator.rs +1 -0
- package/crates/team-agent/src/cli/send/mailbox.rs +3 -0
- package/crates/team-agent/src/cli/send/persist.rs +1 -0
- package/crates/team-agent/src/cli/send/presentation.rs +1 -0
- package/crates/team-agent/src/cli/send/resolve.rs +206 -1
- package/crates/team-agent/src/cli/send.rs +2 -1
- package/crates/team-agent/src/cli/spec.rs +1 -0
- package/crates/team-agent/src/cli/status.rs +2 -1
- package/crates/team-agent/src/cli/status_port/compact.rs +1 -0
- package/crates/team-agent/src/cli/status_port/format.rs +1 -0
- package/crates/team-agent/src/cli/status_port/inbox.rs +1 -0
- package/crates/team-agent/src/cli/tests/verb_profile.rs +38 -0
- package/crates/team-agent/src/cli/types.rs +3 -2
- package/crates/team-agent/src/communication_mode/mod.rs +1 -0
- package/crates/team-agent/src/compiler.rs +1 -0
- package/crates/team-agent/src/conpty/backend.rs +1 -0
- package/crates/team-agent/src/conpty/mod.rs +1 -0
- package/crates/team-agent/src/coordinator/backoff.rs +5 -8
- package/crates/team-agent/src/coordinator/conpty_shim.rs +3 -2
- package/crates/team-agent/src/coordinator/health.rs +1 -0
- package/crates/team-agent/src/coordinator/mod.rs +2 -2
- package/crates/team-agent/src/coordinator/orphan.rs +4 -116
- package/crates/team-agent/src/coordinator/runtime_detectors.rs +1 -0
- package/crates/team-agent/src/coordinator/runtime_observation.rs +1 -0
- package/crates/team-agent/src/coordinator/steps/abnormal.rs +6 -5
- package/crates/team-agent/src/coordinator/steps/delivery.rs +1 -0
- package/crates/team-agent/src/coordinator/steps/health_sync.rs +1 -0
- package/crates/team-agent/src/coordinator/steps/mod.rs +2 -0
- package/crates/team-agent/src/coordinator/steps/persist.rs +1 -0
- package/crates/team-agent/src/coordinator/steps/runtime_prompts.rs +1 -0
- package/crates/team-agent/src/coordinator/steps/session_gate.rs +1 -0
- package/crates/team-agent/src/coordinator/tests/abnormal.rs +0 -174
- package/crates/team-agent/src/coordinator/tests/api_error_recovery.rs +0 -9
- package/crates/team-agent/src/coordinator/tests/basics.rs +0 -184
- package/crates/team-agent/src/coordinator/tests/mod.rs +2 -17
- package/crates/team-agent/src/coordinator/tests/tick_core.rs +0 -42
- package/crates/team-agent/src/coordinator/tick.rs +24 -28
- package/crates/team-agent/src/coordinator/types.rs +3 -176
- package/crates/team-agent/src/db/agent_health_capture.rs +1 -0
- package/crates/team-agent/src/db/message_store.rs +2 -1
- package/crates/team-agent/src/db/migration.rs +5 -4
- package/crates/team-agent/src/db/mod.rs +1 -0
- package/crates/team-agent/src/db/schema.rs +1 -0
- package/crates/team-agent/src/diagnose/comms.rs +2 -1
- package/crates/team-agent/src/diagnose/mod.rs +1 -0
- package/crates/team-agent/src/diagnose/orphans.rs +1 -0
- package/crates/team-agent/src/layout/manager.rs +3 -7
- package/crates/team-agent/src/layout/mod.rs +2 -2
- package/crates/team-agent/src/layout/overlay.rs +6 -1
- package/crates/team-agent/src/layout/placement.rs +1 -0
- package/crates/team-agent/src/layout/recovery.rs +3 -0
- package/crates/team-agent/src/layout/runtime_sessions.rs +8 -3
- package/crates/team-agent/src/layout/sessions.rs +8 -1
- package/crates/team-agent/src/layout/tmux_endpoint.rs +3 -0
- package/crates/team-agent/src/layout/worker_env.rs +3 -0
- package/crates/team-agent/src/layout/worker_window_helpers.rs +2 -0
- package/crates/team-agent/src/leader/helpers.rs +1 -0
- package/crates/team-agent/src/leader/incident.rs +1 -0
- package/crates/team-agent/src/leader/lease.rs +27 -22
- package/crates/team-agent/src/leader/mod.rs +2 -3
- package/crates/team-agent/src/leader/owner_bind.rs +13 -3
- package/crates/team-agent/src/leader/provider_attribution.rs +1 -0
- package/crates/team-agent/src/leader/rediscover.rs +4 -17
- package/crates/team-agent/src/leader/registry.rs +3 -15
- package/crates/team-agent/src/leader/start.rs +373 -125
- package/crates/team-agent/src/leader/takeover.rs +10 -232
- package/crates/team-agent/src/leader/tests/claim_leader_mailbox_flush_contract.rs +544 -0
- package/crates/team-agent/src/leader/tests/historical_inventory_upgrade_gate_red.rs +624 -0
- package/crates/team-agent/src/leader/tests/identity.rs +7 -2
- package/crates/team-agent/src/leader/tests/idle.rs +0 -193
- package/crates/team-agent/src/leader/tests/lease_api.rs +0 -45
- package/crates/team-agent/src/leader/tests/mod.rs +4 -41
- package/crates/team-agent/src/leader/tests/rehomed_env.rs +83 -0
- package/crates/team-agent/src/leader/tests/team_in_team_state_scope_red.rs +1273 -0
- package/crates/team-agent/src/leader/tests/terminal_and_replay_vs_rerender_invariants_red.rs +417 -0
- package/crates/team-agent/src/leader/tests/wake_start_owner.rs +22 -103
- package/crates/team-agent/src/leader/types.rs +1 -28
- package/crates/team-agent/src/lib.rs +3 -0
- package/crates/team-agent/src/lifecycle/display.rs +7 -1
- package/crates/team-agent/src/lifecycle/helpers.rs +3 -1
- package/crates/team-agent/src/lifecycle/launch/add_agent.rs +2 -2
- package/crates/team-agent/src/lifecycle/launch/fork_agent/completion.rs +1 -0
- package/crates/team-agent/src/lifecycle/launch/fork_entry.rs +1 -0
- package/crates/team-agent/src/lifecycle/launch/fork_finalize.rs +1 -0
- package/crates/team-agent/src/lifecycle/launch/plan.rs +2 -2
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +4 -26
- package/crates/team-agent/src/lifecycle/launch/readiness.rs +0 -27
- package/crates/team-agent/src/lifecycle/launch/spawn.rs +1 -27
- package/crates/team-agent/src/lifecycle/launch/spec_state.rs +4 -32
- package/crates/team-agent/src/lifecycle/launch/state_projection.rs +1 -0
- package/crates/team-agent/src/lifecycle/launch.rs +11 -12
- package/crates/team-agent/src/lifecycle/mod.rs +2 -1
- package/crates/team-agent/src/lifecycle/restart/agent.rs +3 -3
- package/crates/team-agent/src/lifecycle/restart/orchestrator.rs +2 -2
- package/crates/team-agent/src/lifecycle/restart/rebuild.rs +13 -5
- package/crates/team-agent/src/lifecycle/restart/remove.rs +1 -1
- package/crates/team-agent/src/lifecycle/restart/selection.rs +3 -3
- package/crates/team-agent/src/lifecycle/restart.rs +13 -11
- package/crates/team-agent/src/lifecycle/tests/acceptance_b_batch_red.rs +1007 -0
- package/crates/team-agent/src/lifecycle/tests/b0_legacy_snapshot_nonauthority_contract.rs +265 -0
- package/crates/team-agent/src/lifecycle/tests/b0_reader_hideone_audit_contract.rs +459 -0
- package/crates/team-agent/src/lifecycle/tests/behavioral_diff_264_red.rs +849 -0
- package/crates/team-agent/src/lifecycle/tests/claude_compatible_config_red.rs +323 -0
- package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +423 -0
- package/crates/team-agent/src/lifecycle/tests/clone_fork_copilot_perms_red.rs +737 -0
- package/crates/team-agent/src/lifecycle/tests/codex_mcp_approval_inheritance_red.rs +1187 -0
- package/crates/team-agent/src/lifecycle/tests/codex_weak_window_attribution_red.rs +683 -0
- package/crates/team-agent/src/lifecycle/tests/communication_mode_runtime_contract_red.rs +394 -0
- package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +1856 -0
- package/crates/team-agent/src/lifecycle/tests/core_034_real_red.rs +917 -0
- package/crates/team-agent/src/lifecycle/tests/display_adaptive_red.rs +481 -0
- package/crates/team-agent/src/lifecycle/tests/f032_startup_prompt_best_effort_red.rs +301 -0
- package/crates/team-agent/src/lifecycle/tests/harvest2_a_batch_red.rs +516 -0
- package/crates/team-agent/src/lifecycle/tests/host_cotenant_death_p0_contract.rs +986 -0
- package/crates/team-agent/src/lifecycle/tests/lifecycle_rollback_red.rs +651 -0
- package/crates/team-agent/src/lifecycle/tests/main_preserved.rs +2 -0
- package/crates/team-agent/src/lifecycle/tests/quick_start_worker_readiness_red.rs +332 -0
- package/crates/team-agent/src/lifecycle/tests/realmachine_clusters_1_6_red.rs +846 -0
- package/crates/team-agent/src/lifecycle/tests/realmachine_residual_g1_g4_red.rs +648 -0
- package/crates/team-agent/src/lifecycle/tests/restart_build_before_destroy_0540_contract.rs +910 -0
- package/crates/team-agent/src/lifecycle/tests/restart_liveness_red.rs +630 -0
- package/crates/team-agent/src/lifecycle/tests/restart_rebind_hotfix_252_red.rs +1083 -0
- package/crates/team-agent/src/lifecycle/tests/restart_session_capture_red.rs +1677 -0
- package/crates/team-agent/src/lifecycle/tests/resume_recover_red.rs +410 -0
- package/crates/team-agent/src/lifecycle/tests/stale_team_saveconflict_contract.rs +428 -0
- package/crates/team-agent/src/lifecycle/tests/startup_latency_contract.rs +1032 -0
- package/crates/team-agent/src/lifecycle/tests/status_credential_redaction_contract.rs +869 -0
- package/crates/team-agent/src/lifecycle/tests/subprep_codex_trust_roundtrip_red.rs +1249 -0
- package/crates/team-agent/src/lifecycle/tests/swallow_batch4_semantics_red.rs +342 -0
- package/crates/team-agent/src/lifecycle/tests/team_in_team_identity_scope_red.rs +542 -0
- package/crates/team-agent/src/lifecycle/tests/team_in_team_sibling_quick_start_red.rs +1103 -0
- package/crates/team-agent/src/lifecycle/tests/team_in_team_state_scope_red.rs +1276 -0
- package/crates/team-agent/src/lifecycle/tests/team_key_retirement_roster_red.rs +145 -0
- package/crates/team-agent/src/lifecycle/tests/team_key_retirement_txn_red.rs +603 -0
- package/crates/team-agent/src/lifecycle/tests/test_isolation_escape_contract.rs +837 -0
- package/crates/team-agent/src/lifecycle/tests/upgrade_compat_0211_red.rs +928 -0
- package/crates/team-agent/src/lifecycle/tests/verify_rs031_window_consistency_red.rs +951 -0
- package/crates/team-agent/src/lifecycle/tests/worker_dangerous_bypass_argv_red.rs +327 -0
- package/crates/team-agent/src/lifecycle/tests/worker_spawn_env_red.rs +760 -0
- package/crates/team-agent/src/lifecycle/tests.rs +59 -0
- package/crates/team-agent/src/lifecycle/types.rs +0 -9
- package/crates/team-agent/src/mcp_server/helpers.rs +1 -0
- package/crates/team-agent/src/mcp_server/lifecycle_tools/mod.rs +1 -0
- package/crates/team-agent/src/mcp_server/lifecycle_tools/state_status.rs +1 -0
- package/crates/team-agent/src/mcp_server/mod.rs +1 -0
- package/crates/team-agent/src/mcp_server/normalize.rs +4 -3
- package/crates/team-agent/src/mcp_server/tools.rs +1 -0
- package/crates/team-agent/src/mcp_server/types.rs +1 -18
- package/crates/team-agent/src/mcp_server/wire.rs +5 -5
- package/crates/team-agent/src/messaging/activity.rs +1 -0
- package/crates/team-agent/src/messaging/address.rs +1 -0
- package/crates/team-agent/src/messaging/delivery.rs +4 -3
- package/crates/team-agent/src/messaging/helpers.rs +2 -1
- package/crates/team-agent/src/messaging/leader_channel.rs +1 -0
- package/crates/team-agent/src/messaging/leader_receiver.rs +2 -1
- package/crates/team-agent/src/messaging/mod.rs +10 -14
- package/crates/team-agent/src/messaging/peers.rs +2 -0
- package/crates/team-agent/src/messaging/persist.rs +3 -1
- package/crates/team-agent/src/messaging/presentation.rs +2 -1
- package/crates/team-agent/src/messaging/results.rs +1 -0
- package/crates/team-agent/src/messaging/scheduler.rs +1 -0
- package/crates/team-agent/src/messaging/selftest.rs +1 -1
- package/crates/team-agent/src/messaging/send.rs +41 -8
- package/crates/team-agent/src/messaging/tests/mod.rs +5 -0
- package/crates/team-agent/src/messaging/types.rs +2 -2
- package/crates/team-agent/src/messaging/watchers.rs +19 -13
- package/crates/team-agent/src/model/enums.rs +1 -0
- package/crates/team-agent/src/model/errors.rs +1 -0
- package/crates/team-agent/src/model/ids.rs +1 -0
- package/crates/team-agent/src/model/mod.rs +1 -0
- package/crates/team-agent/src/model/name_similarity.rs +1 -0
- package/crates/team-agent/src/model/pane_authority_refusal.rs +1 -0
- package/crates/team-agent/src/model/paths.rs +1 -0
- package/crates/team-agent/src/model/permissions.rs +3 -2
- package/crates/team-agent/src/model/routing.rs +1 -0
- package/crates/team-agent/src/model/spec.rs +1 -0
- package/crates/team-agent/src/model/task_graph.rs +1 -0
- package/crates/team-agent/src/model/yaml/tests.rs +1 -0
- package/crates/team-agent/src/model/yaml.rs +1 -0
- package/crates/team-agent/src/packaging/install.rs +9 -147
- package/crates/team-agent/src/packaging/migrate.rs +2 -0
- package/crates/team-agent/src/packaging/mod.rs +1 -0
- package/crates/team-agent/src/packaging/repair.rs +2 -0
- package/crates/team-agent/src/packaging/tests.rs +29 -218
- package/crates/team-agent/src/packaging/types.rs +8 -15
- package/crates/team-agent/src/platform/argv.rs +4 -0
- package/crates/team-agent/src/platform/errors.rs +10 -1
- package/crates/team-agent/src/platform/file_lock.rs +4 -157
- package/crates/team-agent/src/platform/mod.rs +0 -61
- package/crates/team-agent/src/platform/process.rs +1 -0
- package/crates/team-agent/src/provider/adapter.rs +1 -0
- package/crates/team-agent/src/provider/adapters/claude.rs +1 -0
- package/crates/team-agent/src/provider/adapters/claude_fork.rs +1 -0
- package/crates/team-agent/src/provider/adapters/codex.rs +1 -0
- package/crates/team-agent/src/provider/adapters/copilot.rs +1 -0
- package/crates/team-agent/src/provider/adapters/copilot_fork.rs +1 -0
- package/crates/team-agent/src/provider/adapters/fake.rs +1 -0
- package/crates/team-agent/src/provider/adapters/mod.rs +1 -0
- package/crates/team-agent/src/provider/approvals/mod.rs +1 -0
- package/crates/team-agent/src/provider/approvals/parsing.rs +2 -5
- package/crates/team-agent/src/provider/approvals/runtime_prompts.rs +6 -5
- package/crates/team-agent/src/provider/classify.rs +1 -0
- package/crates/team-agent/src/provider/faults.rs +1 -26
- package/crates/team-agent/src/provider/helpers.rs +1 -0
- package/crates/team-agent/src/provider/mod.rs +1 -1
- package/crates/team-agent/src/provider/session/capture.rs +1 -4
- package/crates/team-agent/src/provider/session/context_fork/claude.rs +1 -0
- package/crates/team-agent/src/provider/session/context_fork/codex.rs +1 -0
- package/crates/team-agent/src/provider/session/context_fork/outcome.rs +1 -0
- package/crates/team-agent/src/provider/session/context_fork.rs +1 -0
- package/crates/team-agent/src/provider/session/mod.rs +2 -4
- package/crates/team-agent/src/provider/session/resume.rs +2 -209
- package/crates/team-agent/src/provider/session_scan/claude.rs +1 -0
- package/crates/team-agent/src/provider/session_scan/codex.rs +1 -0
- package/crates/team-agent/src/provider/session_scan/common.rs +1 -0
- package/crates/team-agent/src/provider/session_scan/copilot.rs +1 -0
- package/crates/team-agent/src/provider/session_scan.rs +1 -42
- package/crates/team-agent/src/provider/startup_prompt.rs +1 -0
- package/crates/team-agent/src/provider/types.rs +1 -0
- package/crates/team-agent/src/provider/wire.rs +1 -0
- package/crates/team-agent/src/state/identity.rs +16 -5
- package/crates/team-agent/src/state/identity_keys.rs +1 -0
- package/crates/team-agent/src/state/mod.rs +2 -0
- package/crates/team-agent/src/state/owner_gate.rs +5 -0
- package/crates/team-agent/src/state/ownership.rs +10 -4
- package/crates/team-agent/src/state/paths.rs +12 -0
- package/crates/team-agent/src/state/persist.rs +9 -3
- package/crates/team-agent/src/state/projection.rs +15 -2
- package/crates/team-agent/src/state/repository/intent.rs +1 -0
- package/crates/team-agent/src/state/repository/tests.rs +1 -0
- package/crates/team-agent/src/state/repository.rs +7 -0
- package/crates/team-agent/src/state/selector.rs +1 -0
- package/crates/team-agent/src/tmux_backend/tests.rs +39 -0
- package/crates/team-agent/src/tmux_backend.rs +63 -0
- package/crates/team-agent/src/transport.rs +15 -0
- package/package.json +4 -4
- package/crates/team-agent/src/leader/inject.rs +0 -33
- package/crates/team-agent/src/provider/command.rs +0 -80
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//!
|
|
1
2
|
//! lifecycle::helpers —— runtime snapshot 原子写(bug-084)+ plan-state 路径/读取。
|
|
2
3
|
|
|
3
4
|
use std::fs;
|
|
@@ -6,6 +7,7 @@ use std::path::{Path, PathBuf};
|
|
|
6
7
|
|
|
7
8
|
use super::*;
|
|
8
9
|
|
|
10
|
+
///
|
|
9
11
|
/// `save_team_runtime_snapshot(workspace, state)` — Foundation-0 F0-2:
|
|
10
12
|
/// this is now a **diagnostic-only** legacy per-session snapshot writer.
|
|
11
13
|
/// Root/projection `.team/runtime/state.json` is the sole product
|
|
@@ -24,7 +26,7 @@ use super::*;
|
|
|
24
26
|
/// team-key layout will live under a different path
|
|
25
27
|
/// (`teams/<team_key>/...`), so this file also cannot be mistaken for
|
|
26
28
|
/// the future canonical shape.
|
|
27
|
-
pub fn save_team_runtime_snapshot(
|
|
29
|
+
pub(crate) fn save_team_runtime_snapshot(
|
|
28
30
|
workspace: &Path,
|
|
29
31
|
state: &serde_json::Value,
|
|
30
32
|
) -> Result<PathBuf, LifecycleError> {
|
|
@@ -130,7 +130,7 @@ pub fn add_agent_force(
|
|
|
130
130
|
|
|
131
131
|
/// `add_agent` with an injected transport — after the recompile+write, wires the new worker spawn
|
|
132
132
|
/// (via start_agent_with_transport) + start_coordinator (rt-host-a sweep: recompiled but never spawned).
|
|
133
|
-
pub fn add_agent_with_transport(
|
|
133
|
+
pub(crate) fn add_agent_with_transport(
|
|
134
134
|
workspace: &Path,
|
|
135
135
|
agent_id: &AgentId,
|
|
136
136
|
role_file_path: &Path,
|
|
@@ -157,7 +157,7 @@ pub fn add_agent_with_transport(
|
|
|
157
157
|
)
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
pub fn add_agent_with_transport_force(
|
|
160
|
+
pub(crate) fn add_agent_with_transport_force(
|
|
161
161
|
workspace: &Path,
|
|
162
162
|
agent_id: &AgentId,
|
|
163
163
|
role_file_path: &Path,
|
|
@@ -4,7 +4,7 @@ use super::*;
|
|
|
4
4
|
|
|
5
5
|
/// `start_plan(workspace, plan_path, start)`(`orchestrator/__init__.py:26`)。load_plan
|
|
6
6
|
/// (YAML 校验)→ 持久化 PlanState → 派发首 stage。对已 running/halted/completed 幂等返回。
|
|
7
|
-
pub fn start_plan(
|
|
7
|
+
pub(crate) fn start_plan(
|
|
8
8
|
workspace: &Path,
|
|
9
9
|
plan_path: &Path,
|
|
10
10
|
start: bool,
|
|
@@ -56,7 +56,7 @@ pub fn start_plan(
|
|
|
56
56
|
|
|
57
57
|
/// `handle_report_result(workspace, envelope)`(`orchestrator/__init__.py:79`)。被 step11
|
|
58
58
|
/// report_result 路径调用以推进 stage;条件匹配 → 推进/完成,否则 `NoMatch`。
|
|
59
|
-
pub fn handle_report_result(
|
|
59
|
+
pub(crate) fn handle_report_result(
|
|
60
60
|
workspace: &Path,
|
|
61
61
|
envelope: &serde_json::Value,
|
|
62
62
|
) -> Result<PlanProgress, LifecycleError> {
|
|
@@ -27,7 +27,7 @@ pub fn quick_start(
|
|
|
27
27
|
quick_start_in_workspace(&workspace, agents_dir, name, yes, team_id)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
pub fn quick_start_in_workspace(
|
|
30
|
+
pub(crate) fn quick_start_in_workspace(
|
|
31
31
|
workspace: &Path,
|
|
32
32
|
agents_dir: &Path,
|
|
33
33
|
name: Option<&str>,
|
|
@@ -39,28 +39,6 @@ pub fn quick_start_in_workspace(
|
|
|
39
39
|
quick_start_with_transport_in_workspace(&workspace, agents_dir, name, yes, team_id, &transport)
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
pub fn quick_start_in_workspace_with_display(
|
|
43
|
-
workspace: &Path,
|
|
44
|
-
agents_dir: &Path,
|
|
45
|
-
name: Option<&str>,
|
|
46
|
-
yes: bool,
|
|
47
|
-
team_id: Option<&str>,
|
|
48
|
-
open_display: bool,
|
|
49
|
-
) -> Result<QuickStartReport, LifecycleError> {
|
|
50
|
-
// Legacy entrypoint: no `--backend` override. Preserves the exact
|
|
51
|
-
// tmux behavior we shipped in Phase 1c (byte-equivalent tmux path
|
|
52
|
-
// when no explicit backend is asked for).
|
|
53
|
-
quick_start_in_workspace_with_display_and_backend(
|
|
54
|
-
workspace,
|
|
55
|
-
agents_dir,
|
|
56
|
-
name,
|
|
57
|
-
yes,
|
|
58
|
-
team_id,
|
|
59
|
-
open_display,
|
|
60
|
-
None,
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
42
|
/// 0.5.x Phase 1d Batch 2: quick-start with an optional
|
|
65
43
|
/// `--backend <tmux|conpty>` override. When `backend` is `None` or
|
|
66
44
|
/// `Some("tmux")` the transport is the same one the legacy entrypoint
|
|
@@ -204,7 +182,7 @@ pub fn quick_start_in_workspace_with_display_and_backend(
|
|
|
204
182
|
)
|
|
205
183
|
}
|
|
206
184
|
|
|
207
|
-
pub fn quick_start_with_transport(
|
|
185
|
+
pub(crate) fn quick_start_with_transport(
|
|
208
186
|
agents_dir: &Path,
|
|
209
187
|
name: Option<&str>,
|
|
210
188
|
yes: bool,
|
|
@@ -215,7 +193,7 @@ pub fn quick_start_with_transport(
|
|
|
215
193
|
quick_start_with_transport_in_workspace(&workspace, agents_dir, name, yes, team_id, transport)
|
|
216
194
|
}
|
|
217
195
|
|
|
218
|
-
pub fn quick_start_with_transport_in_workspace(
|
|
196
|
+
pub(crate) fn quick_start_with_transport_in_workspace(
|
|
219
197
|
workspace: &Path,
|
|
220
198
|
agents_dir: &Path,
|
|
221
199
|
name: Option<&str>,
|
|
@@ -228,7 +206,7 @@ pub fn quick_start_with_transport_in_workspace(
|
|
|
228
206
|
)
|
|
229
207
|
}
|
|
230
208
|
|
|
231
|
-
pub fn quick_start_with_transport_in_workspace_with_display(
|
|
209
|
+
pub(crate) fn quick_start_with_transport_in_workspace_with_display(
|
|
232
210
|
workspace: &Path,
|
|
233
211
|
agents_dir: &Path,
|
|
234
212
|
name: Option<&str>,
|
|
@@ -20,33 +20,6 @@ use crate::lifecycle::lock::{acquire_agent_lifecycle_lock, LifecycleLockRequest}
|
|
|
20
20
|
|
|
21
21
|
use super::*;
|
|
22
22
|
|
|
23
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
24
|
-
pub enum ReadinessPhase {
|
|
25
|
-
StartCoordinator,
|
|
26
|
-
ComputeVerdict,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
impl ReadinessPhase {
|
|
30
|
-
pub fn as_str(self) -> &'static str {
|
|
31
|
-
match self {
|
|
32
|
-
Self::StartCoordinator => "launch.readiness.start_coordinator",
|
|
33
|
-
Self::ComputeVerdict => "launch.readiness.compute_verdict",
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
#[cfg(test)]
|
|
39
|
-
mod tests {
|
|
40
|
-
use super::*;
|
|
41
|
-
|
|
42
|
-
#[test]
|
|
43
|
-
fn phase_labels_are_dotted_paths_under_launch_readiness() {
|
|
44
|
-
assert!(ReadinessPhase::StartCoordinator
|
|
45
|
-
.as_str()
|
|
46
|
-
.starts_with("launch.readiness."));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
23
|
pub(super) fn quick_start_worker_readiness(
|
|
51
24
|
workspace: &Path,
|
|
52
25
|
team_key: &str,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//!
|
|
1
2
|
//! unit-8 (Stage 3) — `lifecycle::launch::spawn` phase boundary.
|
|
2
3
|
//!
|
|
3
4
|
//! Dedicated home for the worker spawn executor. Future commits migrate
|
|
@@ -21,33 +22,6 @@ use crate::lifecycle::lock::{acquire_agent_lifecycle_lock, LifecycleLockRequest}
|
|
|
21
22
|
|
|
22
23
|
use super::*;
|
|
23
24
|
|
|
24
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
25
|
-
pub enum SpawnPhase {
|
|
26
|
-
SpawnFirstWithEnvUnset,
|
|
27
|
-
SpawnIntoWithEnvUnset,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
impl SpawnPhase {
|
|
31
|
-
pub fn as_str(self) -> &'static str {
|
|
32
|
-
match self {
|
|
33
|
-
Self::SpawnFirstWithEnvUnset => "launch.spawn.first_with_env_unset",
|
|
34
|
-
Self::SpawnIntoWithEnvUnset => "launch.spawn.into_with_env_unset",
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
#[cfg(test)]
|
|
40
|
-
mod tests {
|
|
41
|
-
use super::*;
|
|
42
|
-
|
|
43
|
-
#[test]
|
|
44
|
-
fn phase_labels_are_dotted_paths_under_launch_spawn() {
|
|
45
|
-
assert!(SpawnPhase::SpawnFirstWithEnvUnset
|
|
46
|
-
.as_str()
|
|
47
|
-
.starts_with("launch.spawn."));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
25
|
pub(super) fn spawn_agents(
|
|
52
26
|
workspace: &Path,
|
|
53
27
|
spec_path: &Path,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//!
|
|
1
2
|
//! unit-8 (Stage 3) — `lifecycle::launch::spec_state` phase boundary.
|
|
2
3
|
//!
|
|
3
4
|
//! The dedicated home for spec/runtime-path resolution and state-tree
|
|
@@ -40,38 +41,6 @@ use super::leader_context::{
|
|
|
40
41
|
};
|
|
41
42
|
use super::worker_env::spawn_timestamp;
|
|
42
43
|
|
|
43
|
-
/// Named launch phases under spec_state. Used in phase labels for logs
|
|
44
|
-
/// and (future) for the orchestrator's step dispatcher.
|
|
45
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
46
|
-
pub enum SpecStatePhase {
|
|
47
|
-
ResolveSpecPaths,
|
|
48
|
-
MaterializeState,
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
impl SpecStatePhase {
|
|
52
|
-
pub fn as_str(self) -> &'static str {
|
|
53
|
-
match self {
|
|
54
|
-
Self::ResolveSpecPaths => "launch.spec_state.resolve_spec_paths",
|
|
55
|
-
Self::MaterializeState => "launch.spec_state.materialize_state",
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
#[cfg(test)]
|
|
61
|
-
mod tests {
|
|
62
|
-
use super::*;
|
|
63
|
-
|
|
64
|
-
#[test]
|
|
65
|
-
fn phase_labels_are_dotted_paths_under_launch_spec_state() {
|
|
66
|
-
assert!(SpecStatePhase::ResolveSpecPaths
|
|
67
|
-
.as_str()
|
|
68
|
-
.starts_with("launch.spec_state."));
|
|
69
|
-
assert!(SpecStatePhase::MaterializeState
|
|
70
|
-
.as_str()
|
|
71
|
-
.starts_with("launch.spec_state."));
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
44
|
pub(super) fn initial_runtime_state(
|
|
76
45
|
spec: &Value,
|
|
77
46
|
spec_path: &Path,
|
|
@@ -258,6 +227,7 @@ pub(super) fn yaml_value_to_json(value: &Value) -> serde_json::Value {
|
|
|
258
227
|
}
|
|
259
228
|
}
|
|
260
229
|
|
|
230
|
+
///
|
|
261
231
|
/// Set `runtime.session_name` on the compiled spec to `session_name`, creating the
|
|
262
232
|
/// `runtime` map and/or the `session_name` entry if absent. Used by quick-start to
|
|
263
233
|
/// derive the tmux session from the REQUESTED team identity (CR-040/042) rather
|
|
@@ -356,6 +326,7 @@ pub(super) fn spec_session_name(spec: &Value) -> SessionName {
|
|
|
356
326
|
SessionName::new(format!("team-{team_name}"))
|
|
357
327
|
}
|
|
358
328
|
|
|
329
|
+
///
|
|
359
330
|
/// 0.3.28 layout step 1: pub re-export of `spec_session_name` for the new
|
|
360
331
|
/// `layout::sessions::worker_session_name` to delegate to. Single underlying
|
|
361
332
|
/// impl; this just widens visibility without duplicating logic.
|
|
@@ -370,6 +341,7 @@ pub(super) fn spec_agents(spec: &Value) -> Vec<AgentId> {
|
|
|
370
341
|
.collect()
|
|
371
342
|
}
|
|
372
343
|
|
|
344
|
+
///
|
|
373
345
|
/// Bug 1 (0.4.2): expose spec agent id set so the restart path can filter
|
|
374
346
|
/// state.agents to only the agents currently defined in the rebuilt spec.
|
|
375
347
|
/// Returns a `BTreeSet<String>` for O(log n) membership checks.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//!
|
|
1
2
|
//! lifecycle::launch —— 冷启 / quick-start / 危险审批探测 + add/fork / plan 起步与推进。
|
|
2
3
|
|
|
3
4
|
use std::collections::{BTreeMap, BTreeSet};
|
|
@@ -17,6 +18,7 @@ use super::*;
|
|
|
17
18
|
|
|
18
19
|
// ── lifecycle::launch —— 冷启 / quick-start / 危险审批探测 ──────────────────
|
|
19
20
|
|
|
21
|
+
///
|
|
20
22
|
/// `launch(spec_path, dry_run, auto_approve, skip_profile_smoke)`(`launch/core.py:29`)。
|
|
21
23
|
/// 冷启全队:路由 tasks、resolve 权限/危险审批门、session 冲突检查(冲突 →
|
|
22
24
|
/// `SessionConflict` 拒绝不 kill)、按 startup 顺序起每个 worker、捕获 session、开显示、
|
|
@@ -40,7 +42,7 @@ pub fn launch(
|
|
|
40
42
|
)
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
pub fn launch_with_transport(
|
|
45
|
+
pub(crate) fn launch_with_transport(
|
|
44
46
|
spec_path: &Path,
|
|
45
47
|
dry_run: bool,
|
|
46
48
|
auto_approve: bool,
|
|
@@ -186,10 +188,9 @@ pub fn launch_with_transport_in_workspace(
|
|
|
186
188
|
}
|
|
187
189
|
|
|
188
190
|
mod plan;
|
|
189
|
-
pub use plan::{handle_report_result, start_plan};
|
|
191
|
+
pub(crate) use plan::{handle_report_result, start_plan};
|
|
190
192
|
|
|
191
193
|
pub mod spawn;
|
|
192
|
-
pub use spawn::SpawnPhase;
|
|
193
194
|
pub(super) use spawn::*;
|
|
194
195
|
|
|
195
196
|
mod layout;
|
|
@@ -247,10 +248,10 @@ pub(crate) use identity::{
|
|
|
247
248
|
|
|
248
249
|
mod quick_start;
|
|
249
250
|
pub(super) use quick_start::*;
|
|
250
|
-
pub use quick_start::{
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
pub use quick_start::{quick_start, quick_start_in_workspace_with_display_and_backend};
|
|
252
|
+
pub(crate) use quick_start::{
|
|
253
|
+
quick_start_in_workspace, quick_start_with_transport, quick_start_with_transport_in_workspace,
|
|
254
|
+
quick_start_with_transport_in_workspace_with_display,
|
|
254
255
|
};
|
|
255
256
|
|
|
256
257
|
mod quick_start_transport;
|
|
@@ -263,7 +264,6 @@ pub(crate) use quick_start_transport::{
|
|
|
263
264
|
|
|
264
265
|
pub mod readiness;
|
|
265
266
|
pub(crate) use readiness::launched_team_receiver_is_attached;
|
|
266
|
-
pub use readiness::ReadinessPhase;
|
|
267
267
|
pub(super) use readiness::*;
|
|
268
268
|
|
|
269
269
|
mod approval;
|
|
@@ -276,9 +276,8 @@ use approval::{
|
|
|
276
276
|
|
|
277
277
|
mod add_agent;
|
|
278
278
|
pub(super) use add_agent::*;
|
|
279
|
-
pub use add_agent::{
|
|
280
|
-
|
|
281
|
-
};
|
|
279
|
+
pub use add_agent::{add_agent, add_agent_force};
|
|
280
|
+
pub(crate) use add_agent::{add_agent_with_transport, add_agent_with_transport_force};
|
|
282
281
|
|
|
283
282
|
mod add_agent_state;
|
|
284
283
|
pub(crate) use add_agent_state::inject_agent_into_spec;
|
|
@@ -320,4 +319,4 @@ use spec_state::{
|
|
|
320
319
|
spec_agent_values, spec_agents, spec_default_assignee, spec_routes, spec_session_name,
|
|
321
320
|
spec_tasks_json, team_workspace, write_launch_permission_audit, yaml_value_to_json,
|
|
322
321
|
};
|
|
323
|
-
pub use spec_state::
|
|
322
|
+
pub use spec_state::worker_session_name_pub;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//!
|
|
1
2
|
//! step 13 · lifecycle — team 进程级生命周期编排器(ROUND-0.5 骨架)。
|
|
2
3
|
//!
|
|
3
4
|
//! 真相源 `team-agent-public` @ v0.2.11 (439bef8),只读。Card:
|
|
@@ -67,7 +68,7 @@ pub use display::*;
|
|
|
67
68
|
pub use launch::*;
|
|
68
69
|
pub use restart::*;
|
|
69
70
|
|
|
70
|
-
pub use helpers::save_team_runtime_snapshot;
|
|
71
|
+
pub(crate) use helpers::save_team_runtime_snapshot;
|
|
71
72
|
pub(crate) use helpers::{plan_lock_path, plan_state_path, read_plan_state, save_plan_state};
|
|
72
73
|
|
|
73
74
|
#[cfg(test)]
|
|
@@ -42,7 +42,7 @@ pub fn start_agent(
|
|
|
42
42
|
/// `start_agent` with an injected transport — wires the single-worker resume/fresh spawn +
|
|
43
43
|
/// start_coordinator (rt-host-a sweep: was a stub returning RequirementUnmet at the spawn boundary).
|
|
44
44
|
#[allow(clippy::too_many_arguments)]
|
|
45
|
-
pub fn start_agent_with_transport(
|
|
45
|
+
pub(crate) fn start_agent_with_transport(
|
|
46
46
|
workspace: &Path,
|
|
47
47
|
agent_id: &AgentId,
|
|
48
48
|
force: bool,
|
|
@@ -801,7 +801,7 @@ pub fn stop_agent(
|
|
|
801
801
|
)
|
|
802
802
|
}
|
|
803
803
|
|
|
804
|
-
pub fn stop_agent_with_transport(
|
|
804
|
+
pub(crate) fn stop_agent_with_transport(
|
|
805
805
|
workspace: &Path,
|
|
806
806
|
agent_id: &AgentId,
|
|
807
807
|
team: Option<&str>,
|
|
@@ -1249,7 +1249,7 @@ pub fn reset_agent(
|
|
|
1249
1249
|
)
|
|
1250
1250
|
}
|
|
1251
1251
|
|
|
1252
|
-
pub fn reset_agent_with_transport(
|
|
1252
|
+
pub(crate) fn reset_agent_with_transport(
|
|
1253
1253
|
workspace: &Path,
|
|
1254
1254
|
agent_id: &AgentId,
|
|
1255
1255
|
discard_session: bool,
|
|
@@ -4,7 +4,7 @@ use super::*;
|
|
|
4
4
|
|
|
5
5
|
/// `halt_plan(workspace, plan_id, reason)`(`orchestrator/__init__.py:152`)。停 plan;
|
|
6
6
|
/// 非 running → 幂等返回。
|
|
7
|
-
pub fn halt_plan(
|
|
7
|
+
pub(crate) fn halt_plan(
|
|
8
8
|
workspace: &Path,
|
|
9
9
|
plan_id: &PlanId,
|
|
10
10
|
reason: &str,
|
|
@@ -26,7 +26,7 @@ pub fn halt_plan(
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/// `plan_status(workspace, plan_id)`(`orchestrator/__init__.py:177`)。读 plan 持久态。
|
|
29
|
-
pub fn plan_status(workspace: &Path, plan_id: &PlanId) -> Result<PlanState, LifecycleError> {
|
|
29
|
+
pub(crate) fn plan_status(workspace: &Path, plan_id: &PlanId) -> Result<PlanState, LifecycleError> {
|
|
30
30
|
let path = plan_state_path(workspace, plan_id);
|
|
31
31
|
if !path.exists() {
|
|
32
32
|
return Err(LifecycleError::InvalidPlan(format!(
|
|
@@ -109,7 +109,7 @@ fn resolve_restart_context(
|
|
|
109
109
|
/// `restart` with an injected transport (tests: recording mock; prod: real TmuxBackend). The Route-B
|
|
110
110
|
/// resume/fresh worker spawn + start_coordinator are wired here over `transport`. (rt-host-a sweep:
|
|
111
111
|
/// was a stub returning RequirementUnmet at the spawn boundary — never spawned/resumed/started coordinator.)
|
|
112
|
-
pub fn restart_with_transport(
|
|
112
|
+
pub(crate) fn restart_with_transport(
|
|
113
113
|
workspace: &Path,
|
|
114
114
|
allow_fresh: bool,
|
|
115
115
|
team: Option<&str>,
|
|
@@ -118,7 +118,7 @@ pub fn restart_with_transport(
|
|
|
118
118
|
restart_with_transport_with_readiness_deadline(workspace, allow_fresh, team, transport, None)
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
pub fn restart_with_transport_with_readiness_deadline(
|
|
121
|
+
pub(crate) fn restart_with_transport_with_readiness_deadline(
|
|
122
122
|
workspace: &Path,
|
|
123
123
|
allow_fresh: bool,
|
|
124
124
|
team: Option<&str>,
|
|
@@ -158,7 +158,7 @@ pub fn restart_with_transport_with_readiness_deadline(
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
pub fn restart_with_transport_with_session_convergence_deadline(
|
|
161
|
+
pub(crate) fn restart_with_transport_with_session_convergence_deadline(
|
|
162
162
|
workspace: &Path,
|
|
163
163
|
allow_fresh: bool,
|
|
164
164
|
team: Option<&str>,
|
|
@@ -1224,6 +1224,14 @@ fn restart_with_selected_team_and_transport(
|
|
|
1224
1224
|
// restoring the worker→leader delivery path. Failure is non-fatal — the
|
|
1225
1225
|
// user can still run `team-agent attach-leader` manually.
|
|
1226
1226
|
try_autobind_leader_after_restart(&selected.run_workspace, Some(&selected.team_key), &state);
|
|
1227
|
+
if let Ok(probe) = crate::lifecycle::display::probe_display_capabilities(&selected.run_workspace)
|
|
1228
|
+
{
|
|
1229
|
+
let _ = crate::lifecycle::display::rebuild_adaptive_display_after_rebind(
|
|
1230
|
+
&selected.run_workspace,
|
|
1231
|
+
&session_name,
|
|
1232
|
+
&probe,
|
|
1233
|
+
);
|
|
1234
|
+
}
|
|
1227
1235
|
// 0.3.28 Step 1: topology invariant guard (warn-only). Same pattern as
|
|
1228
1236
|
// `lifecycle::launch::launch_with_transport_in_workspace` — logs to stderr,
|
|
1229
1237
|
// never panics. Hard error path is deferred to Step 10.
|
|
@@ -3062,7 +3070,7 @@ fn write_restart_resume_decision_event(
|
|
|
3062
3070
|
|
|
3063
3071
|
/// `restart_candidates(workspace)`(`restart/selection.py:12`)。从 snapshot + active
|
|
3064
3072
|
/// state 收集可重启 team。
|
|
3065
|
-
pub fn restart_candidates(workspace: &Path) -> Result<Vec<RestartCandidate>, LifecycleError> {
|
|
3073
|
+
pub(crate) fn restart_candidates(workspace: &Path) -> Result<Vec<RestartCandidate>, LifecycleError> {
|
|
3066
3074
|
let state = crate::state::persist::load_runtime_state(workspace)
|
|
3067
3075
|
.map_err(|e| LifecycleError::StatePersist(e.to_string()))?;
|
|
3068
3076
|
let alive = crate::state::projection::team_state_candidates(&state);
|
|
@@ -3084,7 +3092,7 @@ pub fn restart_candidates(workspace: &Path) -> Result<Vec<RestartCandidate>, Lif
|
|
|
3084
3092
|
|
|
3085
3093
|
/// `select_restart_state(workspace, team)`(`restart/selection.py:49`)。按 `--team` 或
|
|
3086
3094
|
/// 唯一性选一个;歧义/未找到 → `TeamSelect`。
|
|
3087
|
-
pub fn select_restart_state(
|
|
3095
|
+
pub(crate) fn select_restart_state(
|
|
3088
3096
|
workspace: &Path,
|
|
3089
3097
|
team: Option<&str>,
|
|
3090
3098
|
) -> Result<RestartCandidate, LifecycleError> {
|
|
@@ -37,7 +37,7 @@ pub(crate) fn resumable_provider_requires_backing(provider: &str) -> bool {
|
|
|
37
37
|
|
|
38
38
|
/// `first_send_at` 严格分类(`_classify_first_send_at`,`orchestration.py:399`)。
|
|
39
39
|
/// **绝不靠 truthiness**:`""`/`0`/`False`/`"null"`/非 ISO → `Corrupt`。
|
|
40
|
-
pub fn classify_first_send_at(raw: &serde_json::Value) -> FirstSendAtState {
|
|
40
|
+
pub(crate) fn classify_first_send_at(raw: &serde_json::Value) -> FirstSendAtState {
|
|
41
41
|
match raw {
|
|
42
42
|
serde_json::Value::Null => FirstSendAtState::Absent,
|
|
43
43
|
serde_json::Value::String(s) => {
|
|
@@ -159,7 +159,7 @@ fn normalize_iso_separator(raw: &str) -> String {
|
|
|
159
159
|
/// `0/123→"int"`、`false→"bool"`、`[]→"list"`、`{}→"dict"`、float→`"float"`。
|
|
160
160
|
/// **绝不**用 Rust 的 `"null"/"string"/"number"/"boolean"/"array"/"object"`(serde 名)—— 必须是
|
|
161
161
|
/// Python 名,否则 audit payload 与真相源不一致。
|
|
162
|
-
pub fn python_type_name(value: &serde_json::Value) -> &'static str {
|
|
162
|
+
pub(crate) fn python_type_name(value: &serde_json::Value) -> &'static str {
|
|
163
163
|
match value {
|
|
164
164
|
serde_json::Value::Null => "NoneType",
|
|
165
165
|
serde_json::Value::String(_) => "str",
|
|
@@ -186,7 +186,7 @@ pub fn python_type_name(value: &serde_json::Value) -> &'static str {
|
|
|
186
186
|
/// 进 `unresumable`。
|
|
187
187
|
/// restart() **先**调它再 teardown;corrupt 非空 → `RefusedInvalidFirstSendAt`,unresumable
|
|
188
188
|
/// 非空且 !allow_fresh → `RefusedResumeAtomicity`。**refuse 早于一切 teardown,nothing created**。
|
|
189
|
-
pub fn classify_restart_plan(
|
|
189
|
+
pub(crate) fn classify_restart_plan(
|
|
190
190
|
state: &serde_json::Value,
|
|
191
191
|
allow_fresh: bool,
|
|
192
192
|
) -> Result<RestartPlan, LifecycleError> {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//!
|
|
1
2
|
//! lifecycle::restart —— 单 worker 起/停/重置/删 + 整队 Route B 重建 + plan halt/status。
|
|
2
3
|
|
|
3
4
|
use std::collections::BTreeMap;
|
|
@@ -60,9 +61,9 @@ pub(crate) use agent::start_agent_at_paths;
|
|
|
60
61
|
// this to replace a stuck provider process without going through the
|
|
61
62
|
// public start-agent CLI path.
|
|
62
63
|
pub(crate) use agent::start_agent_at_paths_for_recovery;
|
|
63
|
-
pub use agent::{
|
|
64
|
-
|
|
65
|
-
stop_agent_with_transport,
|
|
64
|
+
pub use agent::{reset_agent, start_agent, stop_agent};
|
|
65
|
+
pub(crate) use agent::{
|
|
66
|
+
reset_agent_with_transport, start_agent_with_transport, stop_agent_with_transport,
|
|
66
67
|
};
|
|
67
68
|
pub(crate) use common::refresh_missing_provider_sessions;
|
|
68
69
|
pub(crate) use common::restart_required_missing_session_agent_ids;
|
|
@@ -71,7 +72,7 @@ pub(crate) use common::session_identity_probe_for_agent;
|
|
|
71
72
|
// `lifecycle::launch::add_agent` / `fork_agent` so all three (restart / add / fork)
|
|
72
73
|
// route to the SAME tmux socket the live team uses.
|
|
73
74
|
pub(crate) use common::lifecycle_worker_tmux_backend_for_selected_state;
|
|
74
|
-
pub use orchestrator::{halt_plan, plan_status};
|
|
75
|
+
pub(crate) use orchestrator::{halt_plan, plan_status};
|
|
75
76
|
pub(crate) use rebuild::restart_with_transport_with_session_convergence_deadline;
|
|
76
77
|
// 0.5.38 (`.team/artifacts/startup-latency-locate.md` §5): expose the phase
|
|
77
78
|
// timer + worker timing writer so `lifecycle::launch::launch_with_transport_in_workspace`
|
|
@@ -79,14 +80,15 @@ pub(crate) use rebuild::restart_with_transport_with_session_convergence_deadline
|
|
|
79
80
|
pub(crate) use rebuild::{
|
|
80
81
|
provider_wire_from_state, write_worker_spawn_timing_event, RestartPhaseTimer,
|
|
81
82
|
};
|
|
82
|
-
pub use rebuild::{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
pub use remove::{remove_agent, remove_agent_flag_requirements, remove_agent_with_transport};
|
|
87
|
-
pub use selection::{
|
|
88
|
-
classify_first_send_at, classify_restart_plan, decide_start_mode, python_type_name,
|
|
83
|
+
pub use rebuild::{restart, restart_with_session_convergence_deadline};
|
|
84
|
+
pub(crate) use rebuild::{
|
|
85
|
+
restart_candidates, restart_with_transport, restart_with_transport_with_readiness_deadline,
|
|
86
|
+
select_restart_state,
|
|
89
87
|
};
|
|
88
|
+
pub use remove::{remove_agent, remove_agent_flag_requirements};
|
|
89
|
+
pub(crate) use remove::remove_agent_with_transport;
|
|
90
|
+
pub(crate) use selection::{classify_first_send_at, classify_restart_plan, python_type_name};
|
|
91
|
+
pub use selection::decide_start_mode;
|
|
90
92
|
// Layer 2 (leader follow-up 2026-06-22): test-visible workspace-aware
|
|
91
93
|
// classification so lifecycle/tests/restart.rs can exercise the
|
|
92
94
|
// SessionBackingStoreMissing + checked_paths + RecoveryHint path
|