@team-agent/installer 0.5.127 → 0.6.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.
- package/README.md +15 -4
- package/README.zh.md +1 -1
- package/package.json +4 -8
- package/skills/team-agent/SKILL.md +41 -26
- package/skills/team-agent/command-coverage.json +170 -184
- package/skills/team-agent/docs/reference/team-agent-operator.md +66 -32
- package/skills/team-agent/references/recovery-runbook.md +1 -1
- package/skills/team-agent/references/team-agent-operator.md +66 -32
- package/templates/team_state.md +1 -1
- package/Cargo.lock +0 -1063
- package/Cargo.toml +0 -36
- package/crates/team-agent/Cargo.toml +0 -69
- package/crates/team-agent/src/app_server_test_support.rs +0 -258
- package/crates/team-agent/src/cli/adapters.rs +0 -1298
- package/crates/team-agent/src/cli/arguments.rs +0 -401
- package/crates/team-agent/src/cli/attach_app_server_leader.rs +0 -98
- package/crates/team-agent/src/cli/diagnose.rs +0 -1675
- package/crates/team-agent/src/cli/emit.rs +0 -2898
- package/crates/team-agent/src/cli/grok_slot.rs +0 -384
- package/crates/team-agent/src/cli/helpers.rs +0 -91
- package/crates/team-agent/src/cli/intent/runtime.rs +0 -1189
- package/crates/team-agent/src/cli/intent/runtime_tests.rs +0 -821
- package/crates/team-agent/src/cli/intent/tests.rs +0 -691
- package/crates/team-agent/src/cli/intent.rs +0 -664
- package/crates/team-agent/src/cli/leader.rs +0 -300
- package/crates/team-agent/src/cli/leader_prompt.rs +0 -261
- package/crates/team-agent/src/cli/leaders.rs +0 -418
- package/crates/team-agent/src/cli/mod.rs +0 -6528
- package/crates/team-agent/src/cli/models.rs +0 -449
- package/crates/team-agent/src/cli/named_address.rs +0 -1651
- package/crates/team-agent/src/cli/profile.rs +0 -342
- package/crates/team-agent/src/cli/route.rs +0 -212
- package/crates/team-agent/src/cli/send/coordinator.rs +0 -164
- package/crates/team-agent/src/cli/send/mailbox.rs +0 -145
- package/crates/team-agent/src/cli/send/persist.rs +0 -192
- package/crates/team-agent/src/cli/send/presentation.rs +0 -370
- package/crates/team-agent/src/cli/send/resolve.rs +0 -573
- package/crates/team-agent/src/cli/send.rs +0 -201
- package/crates/team-agent/src/cli/shutdown_socket.rs +0 -288
- package/crates/team-agent/src/cli/spec.rs +0 -159
- package/crates/team-agent/src/cli/status.rs +0 -280
- package/crates/team-agent/src/cli/status_port/agents.rs +0 -358
- package/crates/team-agent/src/cli/status_port/approvals.rs +0 -79
- package/crates/team-agent/src/cli/status_port/brief.rs +0 -2043
- package/crates/team-agent/src/cli/status_port/compact.rs +0 -240
- package/crates/team-agent/src/cli/status_port/format.rs +0 -146
- package/crates/team-agent/src/cli/status_port/inbox.rs +0 -62
- package/crates/team-agent/src/cli/status_port/runtime.rs +0 -197
- package/crates/team-agent/src/cli/status_port/snapshot.rs +0 -208
- package/crates/team-agent/src/cli/status_port/store.rs +0 -416
- package/crates/team-agent/src/cli/status_port/tests.rs +0 -90
- package/crates/team-agent/src/cli/status_port.rs +0 -92
- package/crates/team-agent/src/cli/tests/base.rs +0 -885
- package/crates/team-agent/src/cli/tests/divergence.rs +0 -518
- package/crates/team-agent/src/cli/tests/lane_c.rs +0 -453
- package/crates/team-agent/src/cli/tests/leader_watch.rs +0 -372
- package/crates/team-agent/src/cli/tests/main_preserved.rs +0 -430
- package/crates/team-agent/src/cli/tests/missing_subcommands.rs +0 -336
- package/crates/team-agent/src/cli/tests/mod.rs +0 -137
- package/crates/team-agent/src/cli/tests/named_address.rs +0 -760
- package/crates/team-agent/src/cli/tests/parser_safety.rs +0 -383
- package/crates/team-agent/src/cli/tests/run_delegation.rs +0 -481
- package/crates/team-agent/src/cli/tests/shutdown_kill_plan.rs +0 -2179
- package/crates/team-agent/src/cli/tests/status_brief.rs +0 -1514
- package/crates/team-agent/src/cli/tests/status_send.rs +0 -1091
- package/crates/team-agent/src/cli/tests/verb_install_skill.rs +0 -93
- package/crates/team-agent/src/cli/tests/verb_profile.rs +0 -392
- package/crates/team-agent/src/cli/triage.rs +0 -234
- package/crates/team-agent/src/cli/types.rs +0 -591
- package/crates/team-agent/src/codex_app_server.rs +0 -546
- package/crates/team-agent/src/communication_mode/mod.rs +0 -56
- package/crates/team-agent/src/compiler/tests.rs +0 -842
- package/crates/team-agent/src/compiler.rs +0 -691
- package/crates/team-agent/src/conpty/backend.rs +0 -829
- package/crates/team-agent/src/conpty/mod.rs +0 -33
- package/crates/team-agent/src/contract_runtime/backend.rs +0 -1610
- package/crates/team-agent/src/contract_runtime/commands.rs +0 -671
- package/crates/team-agent/src/contract_runtime/config.rs +0 -354
- package/crates/team-agent/src/contract_runtime/config_tests.rs +0 -56
- package/crates/team-agent/src/contract_runtime/discovery.rs +0 -438
- package/crates/team-agent/src/contract_runtime/fork.rs +0 -368
- package/crates/team-agent/src/contract_runtime/forward.rs +0 -288
- package/crates/team-agent/src/contract_runtime/framework.rs +0 -350
- package/crates/team-agent/src/contract_runtime/mcp.rs +0 -399
- package/crates/team-agent/src/contract_runtime/mod.rs +0 -17
- package/crates/team-agent/src/contract_runtime/prompt.rs +0 -216
- package/crates/team-agent/src/contract_runtime/pump.rs +0 -271
- package/crates/team-agent/src/contract_runtime/registry.rs +0 -589
- package/crates/team-agent/src/contract_runtime/workspace.rs +0 -228
- package/crates/team-agent/src/coordinator/backoff.rs +0 -741
- package/crates/team-agent/src/coordinator/conpty_shim.rs +0 -805
- package/crates/team-agent/src/coordinator/health.rs +0 -1185
- package/crates/team-agent/src/coordinator/mod.rs +0 -119
- package/crates/team-agent/src/coordinator/orphan.rs +0 -110
- package/crates/team-agent/src/coordinator/runtime_detectors.rs +0 -798
- package/crates/team-agent/src/coordinator/runtime_observation.rs +0 -84
- package/crates/team-agent/src/coordinator/steps/abnormal.rs +0 -2309
- package/crates/team-agent/src/coordinator/steps/delivery.rs +0 -15
- package/crates/team-agent/src/coordinator/steps/health_sync.rs +0 -15
- package/crates/team-agent/src/coordinator/steps/mod.rs +0 -126
- package/crates/team-agent/src/coordinator/steps/persist.rs +0 -15
- package/crates/team-agent/src/coordinator/steps/runtime_prompts.rs +0 -15
- package/crates/team-agent/src/coordinator/steps/session_gate.rs +0 -16
- package/crates/team-agent/src/coordinator/tests/a0_lostupdate.rs +0 -158
- package/crates/team-agent/src/coordinator/tests/abnormal.rs +0 -312
- package/crates/team-agent/src/coordinator/tests/api_error_recovery.rs +0 -338
- package/crates/team-agent/src/coordinator/tests/basics.rs +0 -211
- package/crates/team-agent/src/coordinator/tests/daemon.rs +0 -514
- package/crates/team-agent/src/coordinator/tests/energy.rs +0 -549
- package/crates/team-agent/src/coordinator/tests/health_sync.rs +0 -461
- package/crates/team-agent/src/coordinator/tests/main_preserved.rs +0 -186
- package/crates/team-agent/src/coordinator/tests/mod.rs +0 -295
- package/crates/team-agent/src/coordinator/tests/s3_bounded.rs +0 -207
- package/crates/team-agent/src/coordinator/tests/spine.rs +0 -308
- package/crates/team-agent/src/coordinator/tests/takeover.rs +0 -286
- package/crates/team-agent/src/coordinator/tests/tick_core.rs +0 -237
- package/crates/team-agent/src/coordinator/tick.rs +0 -3112
- package/crates/team-agent/src/coordinator/types.rs +0 -540
- package/crates/team-agent/src/db/agent_health_capture.rs +0 -126
- package/crates/team-agent/src/db/message_store.rs +0 -1585
- package/crates/team-agent/src/db/migration.rs +0 -984
- package/crates/team-agent/src/db/mod.rs +0 -26
- package/crates/team-agent/src/db/schema.rs +0 -663
- package/crates/team-agent/src/diagnose/comms.rs +0 -242
- package/crates/team-agent/src/diagnose/mod.rs +0 -44
- package/crates/team-agent/src/diagnose/orphans.rs +0 -889
- package/crates/team-agent/src/event_log.rs +0 -502
- package/crates/team-agent/src/fake_worker.rs +0 -303
- package/crates/team-agent/src/kill_audit.rs +0 -106
- package/crates/team-agent/src/layout/manager.rs +0 -248
- package/crates/team-agent/src/layout/mod.rs +0 -36
- package/crates/team-agent/src/layout/overlay.rs +0 -134
- package/crates/team-agent/src/layout/placement.rs +0 -52
- package/crates/team-agent/src/layout/recovery.rs +0 -106
- package/crates/team-agent/src/layout/runtime_sessions.rs +0 -317
- package/crates/team-agent/src/layout/sessions.rs +0 -294
- package/crates/team-agent/src/layout/tmux_endpoint.rs +0 -165
- package/crates/team-agent/src/layout/worker_env.rs +0 -721
- package/crates/team-agent/src/layout/worker_window_helpers.rs +0 -37
- package/crates/team-agent/src/leader/helpers.rs +0 -178
- package/crates/team-agent/src/leader/incident.rs +0 -6
- package/crates/team-agent/src/leader/lease.rs +0 -3356
- package/crates/team-agent/src/leader/mod.rs +0 -104
- package/crates/team-agent/src/leader/owner_bind.rs +0 -400
- package/crates/team-agent/src/leader/prompt.rs +0 -905
- package/crates/team-agent/src/leader/provider_attribution.rs +0 -247
- package/crates/team-agent/src/leader/rediscover/tests.rs +0 -689
- package/crates/team-agent/src/leader/rediscover.rs +0 -1192
- package/crates/team-agent/src/leader/registry.rs +0 -883
- package/crates/team-agent/src/leader/start.rs +0 -4500
- package/crates/team-agent/src/leader/takeover.rs +0 -65
- package/crates/team-agent/src/leader/tests/basics.rs +0 -337
- package/crates/team-agent/src/leader/tests/byte_findings.rs +0 -355
- package/crates/team-agent/src/leader/tests/claim_leader_mailbox_flush_contract.rs +0 -544
- package/crates/team-agent/src/leader/tests/historical_inventory_upgrade_gate_red.rs +0 -624
- package/crates/team-agent/src/leader/tests/identity.rs +0 -465
- package/crates/team-agent/src/leader/tests/identity_session_names.rs +0 -42
- package/crates/team-agent/src/leader/tests/idle.rs +0 -113
- package/crates/team-agent/src/leader/tests/lease_api.rs +0 -520
- package/crates/team-agent/src/leader/tests/lease_claim.rs +0 -629
- package/crates/team-agent/src/leader/tests/mod.rs +0 -106
- package/crates/team-agent/src/leader/tests/prompt_contract.rs +0 -267
- package/crates/team-agent/src/leader/tests/rediscover.rs +0 -403
- package/crates/team-agent/src/leader/tests/rehomed_env.rs +0 -83
- package/crates/team-agent/src/leader/tests/team_in_team_state_scope_red.rs +0 -1273
- package/crates/team-agent/src/leader/tests/terminal_and_replay_vs_rerender_invariants_red.rs +0 -417
- package/crates/team-agent/src/leader/tests/wake_start_owner.rs +0 -168
- package/crates/team-agent/src/leader/types.rs +0 -534
- package/crates/team-agent/src/lib.rs +0 -145
- package/crates/team-agent/src/lifecycle/helpers.rs +0 -212
- package/crates/team-agent/src/lifecycle/launch/add_agent.rs +0 -848
- package/crates/team-agent/src/lifecycle/launch/add_agent_state.rs +0 -393
- package/crates/team-agent/src/lifecycle/launch/agent_state.rs +0 -332
- package/crates/team-agent/src/lifecycle/launch/clone_agent.rs +0 -178
- package/crates/team-agent/src/lifecycle/launch/fork_agent.rs +0 -82
- package/crates/team-agent/src/lifecycle/launch/fork_entry.rs +0 -63
- package/crates/team-agent/src/lifecycle/launch/identity.rs +0 -674
- package/crates/team-agent/src/lifecycle/launch/layout.rs +0 -350
- package/crates/team-agent/src/lifecycle/launch/leader_context.rs +0 -589
- package/crates/team-agent/src/lifecycle/launch/mcp_config.rs +0 -152
- package/crates/team-agent/src/lifecycle/launch/ownership.rs +0 -105
- package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +0 -629
- package/crates/team-agent/src/lifecycle/launch/pi_mcp_extension.js +0 -226
- package/crates/team-agent/src/lifecycle/launch/plan.rs +0 -269
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +0 -5176
- package/crates/team-agent/src/lifecycle/launch/quick_start_transport.rs +0 -368
- package/crates/team-agent/src/lifecycle/launch/readiness.rs +0 -519
- package/crates/team-agent/src/lifecycle/launch/role_source.rs +0 -287
- package/crates/team-agent/src/lifecycle/launch/spawn.rs +0 -450
- package/crates/team-agent/src/lifecycle/launch/spec_state.rs +0 -801
- package/crates/team-agent/src/lifecycle/launch/state_projection.rs +0 -624
- package/crates/team-agent/src/lifecycle/launch/worker_env.rs +0 -558
- package/crates/team-agent/src/lifecycle/launch.rs +0 -534
- package/crates/team-agent/src/lifecycle/lock.rs +0 -350
- package/crates/team-agent/src/lifecycle/mod.rs +0 -79
- package/crates/team-agent/src/lifecycle/pane_input_lock.rs +0 -239
- package/crates/team-agent/src/lifecycle/profile_launch.rs +0 -757
- package/crates/team-agent/src/lifecycle/profile_smoke.rs +0 -557
- package/crates/team-agent/src/lifecycle/restart/agent.rs +0 -2198
- package/crates/team-agent/src/lifecycle/restart/common.rs +0 -2052
- package/crates/team-agent/src/lifecycle/restart/orchestrator.rs +0 -65
- package/crates/team-agent/src/lifecycle/restart/preflight.rs +0 -113
- package/crates/team-agent/src/lifecycle/restart/rebuild.rs +0 -5135
- package/crates/team-agent/src/lifecycle/restart/remove.rs +0 -1504
- package/crates/team-agent/src/lifecycle/restart/selection.rs +0 -559
- package/crates/team-agent/src/lifecycle/restart/team_state.rs +0 -329
- package/crates/team-agent/src/lifecycle/restart.rs +0 -223
- package/crates/team-agent/src/lifecycle/role_config.rs +0 -1205
- package/crates/team-agent/src/lifecycle/tests/acceptance_b_batch_red.rs +0 -1021
- package/crates/team-agent/src/lifecycle/tests/agent_ops.rs +0 -1205
- package/crates/team-agent/src/lifecycle/tests/b0_legacy_snapshot_nonauthority_contract.rs +0 -265
- package/crates/team-agent/src/lifecycle/tests/b0_reader_hideone_audit_contract.rs +0 -490
- package/crates/team-agent/src/lifecycle/tests/behavioral_diff_264_red.rs +0 -656
- package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +0 -135
- package/crates/team-agent/src/lifecycle/tests/cli_argv_routing_red.rs +0 -1415
- package/crates/team-agent/src/lifecycle/tests/clone_agent_preserves_source_tools.rs +0 -427
- package/crates/team-agent/src/lifecycle/tests/clone_fork_copilot_perms_red.rs +0 -396
- package/crates/team-agent/src/lifecycle/tests/communication_mode_runtime_contract_red.rs +0 -418
- package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +0 -2039
- package/crates/team-agent/src/lifecycle/tests/core.rs +0 -1298
- package/crates/team-agent/src/lifecycle/tests/f032_startup_prompt_best_effort_red.rs +0 -315
- package/crates/team-agent/src/lifecycle/tests/fixtures/pi_list_models_g0.stdout.txt +0 -222
- package/crates/team-agent/src/lifecycle/tests/fixtures/pi_list_models_spaced_ids.stdout.txt +0 -9
- package/crates/team-agent/src/lifecycle/tests/fixtures/pi_native_mcp_host.mjs +0 -71
- package/crates/team-agent/src/lifecycle/tests/gate_fixtures.rs +0 -562
- package/crates/team-agent/src/lifecycle/tests/grok_require_explicit_model_red.rs +0 -110
- package/crates/team-agent/src/lifecycle/tests/harvest2_a_batch_red.rs +0 -472
- package/crates/team-agent/src/lifecycle/tests/host_cotenant_death_p0_contract.rs +0 -921
- package/crates/team-agent/src/lifecycle/tests/issue238_codex_effort_contract.rs +0 -68
- package/crates/team-agent/src/lifecycle/tests/lane_ops.rs +0 -1851
- package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +0 -3981
- package/crates/team-agent/src/lifecycle/tests/lifecycle_lock.rs +0 -339
- package/crates/team-agent/src/lifecycle/tests/lifecycle_rollback_red.rs +0 -596
- package/crates/team-agent/src/lifecycle/tests/main_preserved.rs +0 -513
- package/crates/team-agent/src/lifecycle/tests/mcp_tool_name_format_red.rs +0 -69
- package/crates/team-agent/src/lifecycle/tests/phase_b_contracts.rs +0 -824
- package/crates/team-agent/src/lifecycle/tests/phase_golden.rs +0 -723
- package/crates/team-agent/src/lifecycle/tests/pi_catalog_red.rs +0 -152
- package/crates/team-agent/src/lifecycle/tests/pi_command_red.rs +0 -182
- package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +0 -374
- package/crates/team-agent/src/lifecycle/tests/pi_executable_mcp_red.rs +0 -546
- package/crates/team-agent/src/lifecycle/tests/pi_lifecycle_doctor_red.rs +0 -31
- package/crates/team-agent/src/lifecycle/tests/pi_native_mcp_capability_red.rs +0 -528
- package/crates/team-agent/src/lifecycle/tests/pi_session_delivery_red.rs +0 -134
- package/crates/team-agent/src/lifecycle/tests/quick_start_worker_readiness_red.rs +0 -333
- package/crates/team-agent/src/lifecycle/tests/realmachine_clusters_1_6_red.rs +0 -786
- package/crates/team-agent/src/lifecycle/tests/realmachine_residual_g1_g4_red.rs +0 -648
- package/crates/team-agent/src/lifecycle/tests/restart.rs +0 -185
- package/crates/team-agent/src/lifecycle/tests/restart_build_before_destroy_0540_contract.rs +0 -1053
- package/crates/team-agent/src/lifecycle/tests/restart_liveness_red.rs +0 -679
- package/crates/team-agent/src/lifecycle/tests/restart_rebind_hotfix_252_red.rs +0 -1126
- package/crates/team-agent/src/lifecycle/tests/restart_session_capture_red.rs +0 -153
- package/crates/team-agent/src/lifecycle/tests/resume_recover_red.rs +0 -427
- package/crates/team-agent/src/lifecycle/tests/stale_team_saveconflict_contract.rs +0 -431
- package/crates/team-agent/src/lifecycle/tests/startup_latency_contract.rs +0 -1066
- package/crates/team-agent/src/lifecycle/tests/status_credential_redaction_contract.rs +0 -876
- package/crates/team-agent/src/lifecycle/tests/subprep_codex_trust_roundtrip_red.rs +0 -1026
- package/crates/team-agent/src/lifecycle/tests/swallow_batch4_semantics_red.rs +0 -90
- package/crates/team-agent/src/lifecycle/tests/team_in_team_identity_scope_red.rs +0 -543
- package/crates/team-agent/src/lifecycle/tests/team_in_team_sibling_quick_start_red.rs +0 -1103
- package/crates/team-agent/src/lifecycle/tests/team_in_team_state_scope_red.rs +0 -1276
- package/crates/team-agent/src/lifecycle/tests/team_key_retirement_roster_red.rs +0 -145
- package/crates/team-agent/src/lifecycle/tests/team_key_retirement_txn_red.rs +0 -603
- package/crates/team-agent/src/lifecycle/tests/test_isolation_escape_contract.rs +0 -936
- package/crates/team-agent/src/lifecycle/tests/upgrade_compat_0211_red.rs +0 -970
- package/crates/team-agent/src/lifecycle/tests/verify_rs031_window_consistency_red.rs +0 -996
- package/crates/team-agent/src/lifecycle/tests/worker_spawn_env_red.rs +0 -827
- package/crates/team-agent/src/lifecycle/tests.rs +0 -102
- package/crates/team-agent/src/lifecycle/types.rs +0 -861
- package/crates/team-agent/src/lifecycle/worker_command_context.rs +0 -370
- package/crates/team-agent/src/main.rs +0 -52
- package/crates/team-agent/src/mcp_server/helpers.rs +0 -510
- package/crates/team-agent/src/mcp_server/lifecycle_tools/mod.rs +0 -6
- package/crates/team-agent/src/mcp_server/lifecycle_tools/state_status.rs +0 -43
- package/crates/team-agent/src/mcp_server/mod.rs +0 -119
- package/crates/team-agent/src/mcp_server/normalize.rs +0 -485
- package/crates/team-agent/src/mcp_server/readiness.rs +0 -546
- package/crates/team-agent/src/mcp_server/readiness_tests.rs +0 -369
- package/crates/team-agent/src/mcp_server/tests/golden.rs +0 -285
- package/crates/team-agent/src/mcp_server/tests/normalize.rs +0 -247
- package/crates/team-agent/src/mcp_server/tests/scoped.rs +0 -168
- package/crates/team-agent/src/mcp_server/tests/send.rs +0 -388
- package/crates/team-agent/src/mcp_server/tests/tools.rs +0 -343
- package/crates/team-agent/src/mcp_server/tests/wire.rs +0 -254
- package/crates/team-agent/src/mcp_server/tests.rs +0 -43
- package/crates/team-agent/src/mcp_server/tools.rs +0 -1015
- package/crates/team-agent/src/mcp_server/types.rs +0 -396
- package/crates/team-agent/src/mcp_server/wire.rs +0 -867
- package/crates/team-agent/src/messaging/activity.rs +0 -461
- package/crates/team-agent/src/messaging/address.rs +0 -87
- package/crates/team-agent/src/messaging/delivery.rs +0 -3785
- package/crates/team-agent/src/messaging/delivery_consumption_tests.rs +0 -234
- package/crates/team-agent/src/messaging/enter_rescue.rs +0 -362
- package/crates/team-agent/src/messaging/enter_rescue_tests.rs +0 -633
- package/crates/team-agent/src/messaging/helpers.rs +0 -354
- package/crates/team-agent/src/messaging/leader_channel.rs +0 -287
- package/crates/team-agent/src/messaging/leader_receiver.rs +0 -786
- package/crates/team-agent/src/messaging/mod.rs +0 -166
- package/crates/team-agent/src/messaging/persist.rs +0 -377
- package/crates/team-agent/src/messaging/presentation.rs +0 -417
- package/crates/team-agent/src/messaging/results/collection_tests.rs +0 -719
- package/crates/team-agent/src/messaging/results.rs +0 -1415
- package/crates/team-agent/src/messaging/scheduler.rs +0 -217
- package/crates/team-agent/src/messaging/selftest.rs +0 -315
- package/crates/team-agent/src/messaging/send.rs +0 -981
- package/crates/team-agent/src/messaging/tests/basic.rs +0 -346
- package/crates/team-agent/src/messaging/tests/dup_inject.rs +0 -551
- package/crates/team-agent/src/messaging/tests/e23.rs +0 -49
- package/crates/team-agent/src/messaging/tests/leader_channel.rs +0 -169
- package/crates/team-agent/src/messaging/tests/leader_inject_acceptance.rs +0 -817
- package/crates/team-agent/src/messaging/tests/main_preserved.rs +0 -85
- package/crates/team-agent/src/messaging/tests/mod.rs +0 -306
- package/crates/team-agent/src/messaging/tests/runtime.rs +0 -3655
- package/crates/team-agent/src/messaging/tests/spine.rs +0 -837
- package/crates/team-agent/src/messaging/tests/wave2.rs +0 -381
- package/crates/team-agent/src/messaging/trust.rs +0 -215
- package/crates/team-agent/src/messaging/types.rs +0 -471
- package/crates/team-agent/src/messaging/wait.rs +0 -366
- package/crates/team-agent/src/messaging/watchers.rs +0 -916
- package/crates/team-agent/src/model/enums.rs +0 -356
- package/crates/team-agent/src/model/errors.rs +0 -18
- package/crates/team-agent/src/model/ids.rs +0 -165
- package/crates/team-agent/src/model/mod.rs +0 -29
- package/crates/team-agent/src/model/name_similarity.rs +0 -252
- package/crates/team-agent/src/model/pane_authority_refusal.rs +0 -359
- package/crates/team-agent/src/model/paths.rs +0 -257
- package/crates/team-agent/src/model/routing.rs +0 -387
- package/crates/team-agent/src/model/spec.rs +0 -1184
- package/crates/team-agent/src/model/task_graph.rs +0 -321
- package/crates/team-agent/src/model/testdata/fuzz.golden.yaml +0 -43
- package/crates/team-agent/src/model/testdata/fuzz.yaml +0 -43
- package/crates/team-agent/src/model/testdata/spec_invalid_a.yaml +0 -209
- package/crates/team-agent/src/model/testdata/team.spec.golden.yaml +0 -208
- package/crates/team-agent/src/model/testdata/team.spec.yaml +0 -208
- package/crates/team-agent/src/model/yaml/tests.rs +0 -188
- package/crates/team-agent/src/model/yaml.rs +0 -802
- package/crates/team-agent/src/os_probe.rs +0 -280
- package/crates/team-agent/src/packaging/install.rs +0 -219
- package/crates/team-agent/src/packaging/migrate.rs +0 -38
- package/crates/team-agent/src/packaging/mod.rs +0 -91
- package/crates/team-agent/src/packaging/repair.rs +0 -33
- package/crates/team-agent/src/packaging/tests.rs +0 -822
- package/crates/team-agent/src/packaging/types.rs +0 -417
- package/crates/team-agent/src/platform/argv.rs +0 -331
- package/crates/team-agent/src/platform/errors.rs +0 -104
- package/crates/team-agent/src/platform/file_lock.rs +0 -279
- package/crates/team-agent/src/platform/mod.rs +0 -5
- package/crates/team-agent/src/platform/process.rs +0 -545
- package/crates/team-agent/src/provider/adapter.rs +0 -898
- package/crates/team-agent/src/provider/adapters/copilot.rs +0 -75
- package/crates/team-agent/src/provider/adapters/copilot_fork.rs +0 -307
- package/crates/team-agent/src/provider/adapters/fake.rs +0 -18
- package/crates/team-agent/src/provider/adapters/mod.rs +0 -28
- package/crates/team-agent/src/provider/approvals/mod.rs +0 -3
- package/crates/team-agent/src/provider/approvals/parsing.rs +0 -586
- package/crates/team-agent/src/provider/approvals/runtime_prompts.rs +0 -205
- package/crates/team-agent/src/provider/argv_route.rs +0 -405
- package/crates/team-agent/src/provider/bypass_flags.rs +0 -116
- package/crates/team-agent/src/provider/classify.rs +0 -773
- package/crates/team-agent/src/provider/command_helpers.rs +0 -45
- package/crates/team-agent/src/provider/faults.rs +0 -165
- package/crates/team-agent/src/provider/helpers.rs +0 -52
- package/crates/team-agent/src/provider/mod.rs +0 -78
- package/crates/team-agent/src/provider/model_catalog.rs +0 -722
- package/crates/team-agent/src/provider/session/capture.rs +0 -2631
- package/crates/team-agent/src/provider/session/context_fork/outcome.rs +0 -168
- package/crates/team-agent/src/provider/session/context_fork.rs +0 -264
- package/crates/team-agent/src/provider/session/mod.rs +0 -36
- package/crates/team-agent/src/provider/session/resume.rs +0 -269
- package/crates/team-agent/src/provider/session_scan/common/tests.rs +0 -316
- package/crates/team-agent/src/provider/session_scan/common.rs +0 -618
- package/crates/team-agent/src/provider/session_scan/copilot.rs +0 -280
- package/crates/team-agent/src/provider/session_scan/pi.rs +0 -152
- package/crates/team-agent/src/provider/session_scan.rs +0 -61
- package/crates/team-agent/src/provider/startup_prompt.rs +0 -757
- package/crates/team-agent/src/provider/submit_now.rs +0 -71
- package/crates/team-agent/src/provider/testdata/copilot-ready-marker.txt +0 -5
- package/crates/team-agent/src/provider/testdata/copilot-trust-prompt.txt +0 -19
- package/crates/team-agent/src/provider/testdata/grok-models-authenticated.stdout +0 -9
- package/crates/team-agent/src/provider/testdata/grok-models-unauthenticated.stdout +0 -7
- package/crates/team-agent/src/provider/tests/adapter.rs +0 -354
- package/crates/team-agent/src/provider/tests/classify.rs +0 -201
- package/crates/team-agent/src/provider/tests/command_helpers.rs +0 -26
- package/crates/team-agent/src/provider/tests/copilot_fork.rs +0 -191
- package/crates/team-agent/src/provider/tests/faults.rs +0 -200
- package/crates/team-agent/src/provider/tests/idle.rs +0 -140
- package/crates/team-agent/src/provider/tests/wire.rs +0 -213
- package/crates/team-agent/src/provider/tests.rs +0 -32
- package/crates/team-agent/src/provider/types.rs +0 -529
- package/crates/team-agent/src/provider/wire.rs +0 -406
- package/crates/team-agent/src/redaction.rs +0 -259
- package/crates/team-agent/src/state/abnormal_watch/tests/mod.rs +0 -248
- package/crates/team-agent/src/state/abnormal_watch.rs +0 -144
- package/crates/team-agent/src/state/identity.rs +0 -914
- package/crates/team-agent/src/state/identity_keys.rs +0 -132
- package/crates/team-agent/src/state/mod.rs +0 -74
- package/crates/team-agent/src/state/owner_gate.rs +0 -482
- package/crates/team-agent/src/state/ownership.rs +0 -563
- package/crates/team-agent/src/state/paths.rs +0 -395
- package/crates/team-agent/src/state/persist.rs +0 -3811
- package/crates/team-agent/src/state/projection.rs +0 -1508
- package/crates/team-agent/src/state/repository/intent.rs +0 -14
- package/crates/team-agent/src/state/repository/tests.rs +0 -184
- package/crates/team-agent/src/state/repository.rs +0 -866
- package/crates/team-agent/src/state/selector.rs +0 -160
- package/crates/team-agent/src/state/testdata/state-rich.canonical.json +0 -133
- package/crates/team-agent/src/tmux_backend/enter_rescue.rs +0 -325
- package/crates/team-agent/src/tmux_backend/enter_rescue_tests.rs +0 -432
- package/crates/team-agent/src/tmux_backend/native_input.rs +0 -513
- package/crates/team-agent/src/tmux_backend/native_input_tests.rs +0 -742
- package/crates/team-agent/src/tmux_backend/tests.rs +0 -4254
- package/crates/team-agent/src/tmux_backend.rs +0 -4527
- package/crates/team-agent/src/topology.rs +0 -537
- package/crates/team-agent/src/transport/enter_rescue.rs +0 -166
- package/crates/team-agent/src/transport/native_input.rs +0 -491
- package/crates/team-agent/src/transport/test_support.rs +0 -743
- package/crates/team-agent/src/transport/tests/behavior.rs +0 -326
- package/crates/team-agent/src/transport/tests/mod.rs +0 -194
- package/crates/team-agent/src/transport/tests/wire.rs +0 -574
- package/crates/team-agent/src/transport.rs +0 -1655
- package/crates/team-agent/src/transport_factory.rs +0 -819
|
@@ -1,430 +0,0 @@
|
|
|
1
|
-
use super::*;
|
|
2
|
-
|
|
3
|
-
fn cli_argv(items: &[&str]) -> Vec<String> {
|
|
4
|
-
items.iter().map(|s| (*s).to_string()).collect()
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
const FAKE_SPEC_YAML: &str = r#"version: 1
|
|
8
|
-
team:
|
|
9
|
-
name: "fake-e2e"
|
|
10
|
-
mode: "supervisor_worker"
|
|
11
|
-
objective: "Exercise fake provider orchestration."
|
|
12
|
-
workspace: "/WS"
|
|
13
|
-
leader:
|
|
14
|
-
id: "leader"
|
|
15
|
-
role: "leader"
|
|
16
|
-
provider: "fake"
|
|
17
|
-
model: null
|
|
18
|
-
tools:
|
|
19
|
-
- "fs_read"
|
|
20
|
-
- "fs_list"
|
|
21
|
-
- "mcp_team"
|
|
22
|
-
context_policy:
|
|
23
|
-
keep_user_thread: true
|
|
24
|
-
receive_worker_outputs: "structured_only"
|
|
25
|
-
max_worker_result_tokens: 2000
|
|
26
|
-
agents:
|
|
27
|
-
- id: "fake_impl"
|
|
28
|
-
role: "implementation_engineer"
|
|
29
|
-
provider: "fake"
|
|
30
|
-
model: null
|
|
31
|
-
working_directory: "/WS"
|
|
32
|
-
system_prompt:
|
|
33
|
-
inline: "Handle fake implementation tasks."
|
|
34
|
-
file: null
|
|
35
|
-
tools:
|
|
36
|
-
- "fs_read"
|
|
37
|
-
- "fs_write"
|
|
38
|
-
- "fs_list"
|
|
39
|
-
- "execute_bash"
|
|
40
|
-
- "git_diff"
|
|
41
|
-
- "mcp_team"
|
|
42
|
-
- "provider_builtin"
|
|
43
|
-
permission_mode: "restricted"
|
|
44
|
-
preferred_for:
|
|
45
|
-
- "implementation"
|
|
46
|
-
avoid_for: []
|
|
47
|
-
output_contract:
|
|
48
|
-
format: "result_envelope_v1"
|
|
49
|
-
required_fields:
|
|
50
|
-
- "task_id"
|
|
51
|
-
- "status"
|
|
52
|
-
- "summary"
|
|
53
|
-
- "artifacts"
|
|
54
|
-
routing:
|
|
55
|
-
default_assignee: "leader"
|
|
56
|
-
rules:
|
|
57
|
-
- id: "implementation-to-fake"
|
|
58
|
-
match:
|
|
59
|
-
type:
|
|
60
|
-
- "implementation"
|
|
61
|
-
assign_to: "fake_impl"
|
|
62
|
-
priority: 10
|
|
63
|
-
communication:
|
|
64
|
-
protocol: "mcp_inbox"
|
|
65
|
-
topology: "leader_centered"
|
|
66
|
-
worker_to_worker: true
|
|
67
|
-
ack_timeout_sec: 2
|
|
68
|
-
result_format: "result_envelope_v1"
|
|
69
|
-
message_store:
|
|
70
|
-
sqlite: ".team/runtime/team.db"
|
|
71
|
-
mirror_files: ".team/messages"
|
|
72
|
-
runtime:
|
|
73
|
-
backend: "tmux"
|
|
74
|
-
session_name: "team-agent-fake-e2e"
|
|
75
|
-
auto_launch: true
|
|
76
|
-
require_user_approval_before_launch: false
|
|
77
|
-
max_active_agents: 1
|
|
78
|
-
startup_order:
|
|
79
|
-
- "fake_impl"
|
|
80
|
-
context:
|
|
81
|
-
state_file: "team_state.md"
|
|
82
|
-
artifact_dir: ".team/artifacts"
|
|
83
|
-
log_dir: ".team/logs"
|
|
84
|
-
summarization:
|
|
85
|
-
worker_full_logs: "retain_outside_leader_context"
|
|
86
|
-
state_update: "after_each_result"
|
|
87
|
-
tasks:
|
|
88
|
-
- id: "task_impl"
|
|
89
|
-
title: "Fake implementation"
|
|
90
|
-
type: "implementation"
|
|
91
|
-
assignee: null
|
|
92
|
-
deps: []
|
|
93
|
-
acceptance:
|
|
94
|
-
- "fake result collected"
|
|
95
|
-
status: "pending"
|
|
96
|
-
requires_tools:
|
|
97
|
-
- "fs_write"
|
|
98
|
-
- "execute_bash"
|
|
99
|
-
files:
|
|
100
|
-
- "src/example.py"
|
|
101
|
-
risk: "low"
|
|
102
|
-
"#;
|
|
103
|
-
|
|
104
|
-
fn seed_team_spec(ws: &std::path::Path) {
|
|
105
|
-
let spec = FAKE_SPEC_YAML.replace("/WS", &ws.to_string_lossy());
|
|
106
|
-
std::fs::write(ws.join("team.spec.yaml"), spec).unwrap();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// ── BUG-2 [real bug] — inbox must RETURN the stored messages, not a hardcoded []. ────────────────
|
|
110
|
-
// Golden status/inbox.py:35-38 -> MessageStore.inbox(agent_id) (core.py:242, owner_team_id=None):
|
|
111
|
-
// select <MESSAGE_SELECT> from messages where sender = ? or recipient = ? order by created_at desc
|
|
112
|
-
// limit ? -> then reversed(rows) (chronological asc). At THIS call site owner_team_id is None, so
|
|
113
|
-
// there is NO team filter — a sent-and-stored message (recipient=w1, status='accepted') must show
|
|
114
|
-
// in `inbox w1`. Rust mod.rs:144 is a stub: `let _=(workspace,limit,as_json); "messages":[]`. So
|
|
115
|
-
// the row is in team.db but inbox always returns [] -> RED. The shape test above only proves the
|
|
116
|
-
// empty-state envelope; THIS proves the message actually surfaces.
|
|
117
|
-
#[test]
|
|
118
|
-
fn inbox_returns_stored_message_for_recipient() {
|
|
119
|
-
let ws = tmp_workspace();
|
|
120
|
-
let store = crate::message_store::MessageStore::open(&ws).unwrap();
|
|
121
|
-
let mid = store
|
|
122
|
-
.create_message(None, "leader", "w1", "hello w1", None, true, None)
|
|
123
|
-
.unwrap();
|
|
124
|
-
let v = status_port::inbox(&ws, "w1", 20, None).expect("inbox");
|
|
125
|
-
let messages = v["messages"].as_array().expect("messages array");
|
|
126
|
-
assert_eq!(
|
|
127
|
-
messages.len(),
|
|
128
|
-
1,
|
|
129
|
-
"golden inbox(w1) must return the stored recipient=w1 row; the stub returns [] -> RED. got {v}"
|
|
130
|
-
);
|
|
131
|
-
let m = &messages[0];
|
|
132
|
-
assert_eq!(
|
|
133
|
-
m["message_id"],
|
|
134
|
-
json!(mid),
|
|
135
|
-
"the returned row is the message we stored"
|
|
136
|
-
);
|
|
137
|
-
assert_eq!(m["recipient"], json!("w1"));
|
|
138
|
-
assert_eq!(m["sender"], json!("leader"));
|
|
139
|
-
assert_eq!(m["summary"], json!("hello w1"));
|
|
140
|
-
assert_eq!(
|
|
141
|
-
m["status"],
|
|
142
|
-
json!("accepted"),
|
|
143
|
-
"create_message persists status='accepted'"
|
|
144
|
-
);
|
|
145
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
146
|
-
}
|
|
147
|
-
// ── BUG-2 (match scope) — inbox(agent) returns rows where sender==agent OR recipient==agent, and
|
|
148
|
-
// EXCLUDES messages for other agents. Membership+exclusion form (not strict index order) so the
|
|
149
|
-
// test is deterministic regardless of created_at sub-second ties; golden order is chronological asc. ─
|
|
150
|
-
#[test]
|
|
151
|
-
fn inbox_matches_sender_or_recipient_and_excludes_others() {
|
|
152
|
-
let ws = tmp_workspace();
|
|
153
|
-
let store = crate::message_store::MessageStore::open(&ws).unwrap();
|
|
154
|
-
store
|
|
155
|
-
.create_message(None, "leader", "w1", "to w1", None, true, None)
|
|
156
|
-
.unwrap();
|
|
157
|
-
store
|
|
158
|
-
.create_message(None, "w1", "leader", "from w1", None, true, None)
|
|
159
|
-
.unwrap();
|
|
160
|
-
store
|
|
161
|
-
.create_message(None, "leader", "w2", "unrelated to w2", None, true, None)
|
|
162
|
-
.unwrap();
|
|
163
|
-
let v = status_port::inbox(&ws, "w1", 20, None).expect("inbox");
|
|
164
|
-
let messages = v["messages"].as_array().expect("messages array");
|
|
165
|
-
let mut contents: Vec<String> = messages
|
|
166
|
-
.iter()
|
|
167
|
-
.map(|m| m["summary"].as_str().unwrap().to_string())
|
|
168
|
-
.collect();
|
|
169
|
-
contents.sort();
|
|
170
|
-
assert_eq!(
|
|
171
|
-
contents,
|
|
172
|
-
vec!["from w1".to_string(), "to w1".to_string()],
|
|
173
|
-
"inbox(w1) must return BOTH the recipient=w1 and sender=w1 rows and EXCLUDE the w2 message; \
|
|
174
|
-
the stub returns [] -> RED. got {contents:?}"
|
|
175
|
-
);
|
|
176
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
#[test]
|
|
180
|
-
fn ux_doctor_secret_scan_is_present_and_non_triggering_for_normal_paths() {
|
|
181
|
-
let ws = tmp_workspace();
|
|
182
|
-
std::fs::write(
|
|
183
|
-
ws.join("normal-role.md"),
|
|
184
|
-
"---\nname: worker\nprovider: codex\n---\nUse /tmp/team-agent.\n",
|
|
185
|
-
)
|
|
186
|
-
.unwrap();
|
|
187
|
-
let value = json_output(
|
|
188
|
-
cmd_doctor(&DoctorArgs {
|
|
189
|
-
spec: None,
|
|
190
|
-
workspace: ws.clone(),
|
|
191
|
-
gate: None,
|
|
192
|
-
comms: false,
|
|
193
|
-
team: None,
|
|
194
|
-
fix: false,
|
|
195
|
-
fix_schema: false,
|
|
196
|
-
cleanup_orphans: false,
|
|
197
|
-
confirm: false,
|
|
198
|
-
json: true,
|
|
199
|
-
})
|
|
200
|
-
.expect("doctor"),
|
|
201
|
-
);
|
|
202
|
-
assert_eq!(value.pointer("/secret_scan/ok"), Some(&json!(true)));
|
|
203
|
-
assert_eq!(value.pointer("/secret_scan/findings"), Some(&json!([])));
|
|
204
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
205
|
-
}
|
|
206
|
-
#[test]
|
|
207
|
-
fn ux_doctor_secret_scan_findings_name_the_exact_trigger() {
|
|
208
|
-
let ws = tmp_workspace();
|
|
209
|
-
std::fs::write(
|
|
210
|
-
ws.join("leaky-role.md"),
|
|
211
|
-
"OPENAI_API_KEY=sk-test-red-contract\n",
|
|
212
|
-
)
|
|
213
|
-
.unwrap();
|
|
214
|
-
let value = json_output(
|
|
215
|
-
cmd_doctor(&DoctorArgs {
|
|
216
|
-
spec: None,
|
|
217
|
-
workspace: ws.clone(),
|
|
218
|
-
gate: None,
|
|
219
|
-
comms: false,
|
|
220
|
-
team: None,
|
|
221
|
-
fix: false,
|
|
222
|
-
fix_schema: false,
|
|
223
|
-
cleanup_orphans: false,
|
|
224
|
-
confirm: false,
|
|
225
|
-
json: true,
|
|
226
|
-
})
|
|
227
|
-
.expect("doctor"),
|
|
228
|
-
);
|
|
229
|
-
let finding = value
|
|
230
|
-
.pointer("/secret_scan/findings/0")
|
|
231
|
-
.and_then(serde_json::Value::as_object)
|
|
232
|
-
.expect("secret-scan must report the concrete trigger");
|
|
233
|
-
for key in ["path", "line", "rule"] {
|
|
234
|
-
assert!(
|
|
235
|
-
finding.contains_key(key),
|
|
236
|
-
"secret-scan finding missing `{key}`: {finding:?}"
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
assert_eq!(finding["path"], "leaky-role.md");
|
|
240
|
-
assert_eq!(finding["line"], 1);
|
|
241
|
-
assert_eq!(finding["rule"], "api_key_assignment");
|
|
242
|
-
assert!(!finding.contains_key("match_excerpt"));
|
|
243
|
-
assert!(!value.to_string().contains("sk-test-red-contract"));
|
|
244
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
245
|
-
}
|
|
246
|
-
#[test]
|
|
247
|
-
fn runtime_readiness_rejects_starting_workers() {
|
|
248
|
-
let value = crate::cli::diagnose::wait_readiness(&json!({
|
|
249
|
-
"agents": {"w1": {"status": "starting"}},
|
|
250
|
-
"leader_receiver": {"status": "attached"},
|
|
251
|
-
}));
|
|
252
|
-
assert_eq!(value["ready"], json!(false));
|
|
253
|
-
assert_eq!(value["all_spawned"], json!(false));
|
|
254
|
-
}
|
|
255
|
-
#[test]
|
|
256
|
-
fn runtime_readiness_counts_mcp_config_and_task_prompt_delivery() {
|
|
257
|
-
let ws = tmp_workspace();
|
|
258
|
-
let mcp_config = ws
|
|
259
|
-
.join(".team")
|
|
260
|
-
.join("runtime")
|
|
261
|
-
.join("agents")
|
|
262
|
-
.join("fake_impl")
|
|
263
|
-
.join("mcp_config.json");
|
|
264
|
-
std::fs::create_dir_all(mcp_config.parent().unwrap()).unwrap();
|
|
265
|
-
std::fs::write(&mcp_config, r#"{"mcpServers":{"team-agent":{}}}"#).unwrap();
|
|
266
|
-
let state = json!({
|
|
267
|
-
"session_name": "team-fake-ready",
|
|
268
|
-
"messages": {"delivered": 1},
|
|
269
|
-
"agents": {
|
|
270
|
-
"fake_impl": {
|
|
271
|
-
"status": "running",
|
|
272
|
-
"provider": "fake",
|
|
273
|
-
"mcp_config": mcp_config.to_string_lossy(),
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
"tasks": [{
|
|
277
|
-
"id": "task_impl",
|
|
278
|
-
"assignee": "fake_impl",
|
|
279
|
-
"status": "pending",
|
|
280
|
-
}],
|
|
281
|
-
"leader_receiver": {"status": "attached"},
|
|
282
|
-
});
|
|
283
|
-
let readiness = crate::cli::diagnose::wait_readiness(&state);
|
|
284
|
-
let value = json!({"readiness": readiness});
|
|
285
|
-
assert_eq!(
|
|
286
|
-
value.pointer("/readiness/mcp_ready"),
|
|
287
|
-
Some(&json!(true)),
|
|
288
|
-
"fake quick-start readiness must treat an existing per-agent mcp_config file as mcp_ready"
|
|
289
|
-
);
|
|
290
|
-
assert_eq!(
|
|
291
|
-
value.pointer("/readiness/task_prompt_delivered"),
|
|
292
|
-
Some(&json!(true)),
|
|
293
|
-
"fake quick-start readiness must treat message_counts>0 / persisted initial task prompt as task_prompt_delivered"
|
|
294
|
-
);
|
|
295
|
-
assert_eq!(
|
|
296
|
-
value.pointer("/readiness/ready"),
|
|
297
|
-
Some(&json!(true)),
|
|
298
|
-
"process_started + cli_prompt_ready alone is incomplete; mcp_ready and task_prompt_delivered must also be satisfied"
|
|
299
|
-
);
|
|
300
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
fn json_output(result: CmdResult) -> serde_json::Value {
|
|
304
|
-
match result.output {
|
|
305
|
-
CmdOutput::Json(v) => v,
|
|
306
|
-
other => panic!("expected JSON output, got {other:?}"),
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
fn seed_remove_agent_workspace(ws: &std::path::Path, status: &str) {
|
|
310
|
-
seed_team_spec(ws);
|
|
311
|
-
crate::state::persist::save_runtime_state(
|
|
312
|
-
ws,
|
|
313
|
-
&json!({
|
|
314
|
-
"session_name": "team-agent-fake-e2e",
|
|
315
|
-
"agents": {
|
|
316
|
-
"fake_impl": {
|
|
317
|
-
"status": status,
|
|
318
|
-
"provider": "fake",
|
|
319
|
-
"window": "fake_impl"
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
|
-
"spec_path": ws.join("team.spec.yaml").to_string_lossy()
|
|
323
|
-
}),
|
|
324
|
-
)
|
|
325
|
-
.unwrap();
|
|
326
|
-
}
|
|
327
|
-
#[test]
|
|
328
|
-
fn remove_agent_spec_running_refusal_lists_all_required_flags_once() {
|
|
329
|
-
let ws = tmp_workspace();
|
|
330
|
-
seed_remove_agent_workspace(&ws, "running");
|
|
331
|
-
let out = json_output(
|
|
332
|
-
cmd_remove_agent(&RemoveAgentArgs {
|
|
333
|
-
agent: "fake_impl".to_string(),
|
|
334
|
-
workspace: ws.clone(),
|
|
335
|
-
team: None,
|
|
336
|
-
from_spec: false,
|
|
337
|
-
confirm: false,
|
|
338
|
-
force: false,
|
|
339
|
-
json: true,
|
|
340
|
-
})
|
|
341
|
-
.unwrap(),
|
|
342
|
-
);
|
|
343
|
-
assert_eq!(out["ok"], json!(false));
|
|
344
|
-
assert_eq!(out["status"], json!("refused"));
|
|
345
|
-
assert_eq!(out["reason"], json!("remove_agent_flags_required"));
|
|
346
|
-
for flag in ["--from-spec", "--confirm", "--force"] {
|
|
347
|
-
assert!(
|
|
348
|
-
out["error"].as_str().is_some_and(|s| s.contains(flag))
|
|
349
|
-
&& out["action"].as_str().is_some_and(|s| s.contains(flag))
|
|
350
|
-
&& out["command"].as_str().is_some_and(|s| s.contains(flag)),
|
|
351
|
-
"refusal must mention {flag} in error/action/copyable command; got {out}"
|
|
352
|
-
);
|
|
353
|
-
}
|
|
354
|
-
let with_confirm = json_output(
|
|
355
|
-
cmd_remove_agent(&RemoveAgentArgs {
|
|
356
|
-
agent: "fake_impl".to_string(),
|
|
357
|
-
workspace: ws.clone(),
|
|
358
|
-
team: None,
|
|
359
|
-
from_spec: false,
|
|
360
|
-
confirm: true,
|
|
361
|
-
force: false,
|
|
362
|
-
json: true,
|
|
363
|
-
})
|
|
364
|
-
.unwrap(),
|
|
365
|
-
);
|
|
366
|
-
assert_eq!(with_confirm["reason"], json!("remove_agent_flags_required"));
|
|
367
|
-
for flag in ["--from-spec", "--confirm", "--force"] {
|
|
368
|
-
assert!(
|
|
369
|
-
with_confirm["error"].as_str().is_some_and(|s| s.contains(flag))
|
|
370
|
-
&& with_confirm["action"].as_str().is_some_and(|s| s.contains(flag))
|
|
371
|
-
&& with_confirm["command"].as_str().is_some_and(|s| s.contains(flag)),
|
|
372
|
-
"refusal with --confirm must still give the full command including {flag}; got {with_confirm}"
|
|
373
|
-
);
|
|
374
|
-
}
|
|
375
|
-
let state = crate::state::persist::load_runtime_state(&ws).unwrap();
|
|
376
|
-
assert!(
|
|
377
|
-
state["agents"].get("fake_impl").is_some(),
|
|
378
|
-
"refused remove-agent must not delete the spec-defined running agent"
|
|
379
|
-
);
|
|
380
|
-
}
|
|
381
|
-
#[test]
|
|
382
|
-
fn remove_agent_running_refusal_is_not_success_envelope() {
|
|
383
|
-
let ws = tmp_workspace();
|
|
384
|
-
seed_remove_agent_workspace(&ws, "running");
|
|
385
|
-
let out = json_output(
|
|
386
|
-
cmd_remove_agent(&RemoveAgentArgs {
|
|
387
|
-
agent: "fake_impl".to_string(),
|
|
388
|
-
workspace: ws.clone(),
|
|
389
|
-
team: None,
|
|
390
|
-
from_spec: true,
|
|
391
|
-
confirm: true,
|
|
392
|
-
force: false,
|
|
393
|
-
json: true,
|
|
394
|
-
})
|
|
395
|
-
.unwrap(),
|
|
396
|
-
);
|
|
397
|
-
assert_eq!(out["ok"], json!(false));
|
|
398
|
-
assert_eq!(out["status"], json!("refused"));
|
|
399
|
-
assert_eq!(out["reason"], json!("force_required"));
|
|
400
|
-
let state = crate::state::persist::load_runtime_state(&ws).unwrap();
|
|
401
|
-
assert!(
|
|
402
|
-
state["agents"].get("fake_impl").is_some(),
|
|
403
|
-
"refused remove-agent must not delete the running agent"
|
|
404
|
-
);
|
|
405
|
-
}
|
|
406
|
-
#[test]
|
|
407
|
-
fn remove_agent_from_spec_refusal_is_not_success_envelope() {
|
|
408
|
-
let ws = tmp_workspace();
|
|
409
|
-
seed_remove_agent_workspace(&ws, "stopped");
|
|
410
|
-
let out = json_output(
|
|
411
|
-
cmd_remove_agent(&RemoveAgentArgs {
|
|
412
|
-
agent: "fake_impl".to_string(),
|
|
413
|
-
workspace: ws.clone(),
|
|
414
|
-
team: None,
|
|
415
|
-
from_spec: false,
|
|
416
|
-
confirm: true,
|
|
417
|
-
force: false,
|
|
418
|
-
json: true,
|
|
419
|
-
})
|
|
420
|
-
.unwrap(),
|
|
421
|
-
);
|
|
422
|
-
assert_eq!(out["ok"], json!(false));
|
|
423
|
-
assert_eq!(out["status"], json!("refused"));
|
|
424
|
-
assert_eq!(out["reason"], json!("from_spec_confirm_required"));
|
|
425
|
-
let state = crate::state::persist::load_runtime_state(&ws).unwrap();
|
|
426
|
-
assert!(
|
|
427
|
-
state["agents"].get("fake_impl").is_some(),
|
|
428
|
-
"refused remove-agent must not delete the spec-defined agent"
|
|
429
|
-
);
|
|
430
|
-
}
|