@team-agent/installer 0.5.128 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/README.zh.md +1 -1
- package/package.json +4 -8
- package/skills/team-agent/SKILL.md +37 -20
- package/skills/team-agent/command-coverage.json +169 -183
- package/skills/team-agent/docs/reference/team-agent-operator.md +64 -30
- package/skills/team-agent/references/recovery-runbook.md +1 -1
- package/skills/team-agent/references/team-agent-operator.md +64 -30
- 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 -1288
- package/crates/team-agent/src/cli/arguments.rs +0 -405
- package/crates/team-agent/src/cli/attach_app_server_leader.rs +0 -98
- package/crates/team-agent/src/cli/diagnose.rs +0 -1721
- package/crates/team-agent/src/cli/emit.rs +0 -2930
- 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 -1216
- package/crates/team-agent/src/cli/intent/runtime_tests.rs +0 -912
- package/crates/team-agent/src/cli/intent/tests.rs +0 -689
- 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 -6545
- package/crates/team-agent/src/cli/models.rs +0 -1206
- 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/schedule.rs +0 -175
- 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 -156
- 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 -199
- package/crates/team-agent/src/cli/shutdown_socket.rs +0 -288
- package/crates/team-agent/src/cli/spec.rs +0 -165
- 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 -1981
- 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 -322
- 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 -761
- package/crates/team-agent/src/cli/tests/parser_safety.rs +0 -383
- package/crates/team-agent/src/cli/tests/run_delegation.rs +0 -484
- 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 -888
- 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 -827
- package/crates/team-agent/src/compiler.rs +0 -890
- 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 -1744
- package/crates/team-agent/src/contract_runtime/commands.rs +0 -671
- package/crates/team-agent/src/contract_runtime/config.rs +0 -364
- package/crates/team-agent/src/contract_runtime/config_tests.rs +0 -76
- package/crates/team-agent/src/contract_runtime/discovery.rs +0 -449
- package/crates/team-agent/src/contract_runtime/fork.rs +0 -361
- package/crates/team-agent/src/contract_runtime/forward.rs +0 -288
- package/crates/team-agent/src/contract_runtime/framework.rs +0 -367
- package/crates/team-agent/src/contract_runtime/mcp.rs +0 -394
- 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 -553
- 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 -300
- 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 -503
- 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 -3024
- 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 -1527
- 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/direct_delivery.rs +0 -368
- 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/inbox_store.rs +0 -169
- 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 -888
- package/crates/team-agent/src/leader/start.rs +0 -4501
- 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 -268
- 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 -147
- package/crates/team-agent/src/lifecycle/helpers.rs +0 -212
- package/crates/team-agent/src/lifecycle/launch/add_agent.rs +0 -881
- package/crates/team-agent/src/lifecycle/launch/add_agent_state.rs +0 -598
- package/crates/team-agent/src/lifecycle/launch/agent_state.rs +0 -332
- package/crates/team-agent/src/lifecycle/launch/clone_agent.rs +0 -204
- package/crates/team-agent/src/lifecycle/launch/fork_agent.rs +0 -107
- package/crates/team-agent/src/lifecycle/launch/fork_entry.rs +0 -144
- 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 -160
- package/crates/team-agent/src/lifecycle/launch/ownership.rs +0 -105
- package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +0 -899
- package/crates/team-agent/src/lifecycle/launch/pi_mcp_extension.js +0 -225
- package/crates/team-agent/src/lifecycle/launch/plan.rs +0 -269
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +0 -5200
- 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 -473
- 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 -557
- 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 -1067
- package/crates/team-agent/src/lifecycle/profile_smoke.rs +0 -557
- package/crates/team-agent/src/lifecycle/restart/agent.rs +0 -2199
- package/crates/team-agent/src/lifecycle/restart/avatar.rs +0 -1798
- package/crates/team-agent/src/lifecycle/restart/claude_fork.rs +0 -163
- package/crates/team-agent/src/lifecycle/restart/common.rs +0 -2362
- 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 -227
- package/crates/team-agent/src/lifecycle/role_config.rs +0 -1230
- 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_compatible_config_red.rs +0 -325
- package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +0 -447
- package/crates/team-agent/src/lifecycle/tests/cli_argv_routing_red.rs +0 -1638
- 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 -770
- package/crates/team-agent/src/lifecycle/tests/communication_mode_runtime_contract_red.rs +0 -419
- package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +0 -2035
- package/crates/team-agent/src/lifecycle/tests/core.rs +0 -1327
- 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 -72
- 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 -512
- 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 -3983
- 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 -164
- package/crates/team-agent/src/lifecycle/tests/pi_command_red.rs +0 -200
- package/crates/team-agent/src/lifecycle/tests/pi_compiler_red.rs +0 -210
- package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +0 -527
- package/crates/team-agent/src/lifecycle/tests/pi_executable_mcp_red.rs +0 -1062
- package/crates/team-agent/src/lifecycle/tests/pi_fork_session_inheritance_red.rs +0 -1419
- package/crates/team-agent/src/lifecycle/tests/pi_lifecycle_doctor_red.rs +0 -98
- package/crates/team-agent/src/lifecycle/tests/pi_native_mcp_capability_red.rs +0 -550
- package/crates/team-agent/src/lifecycle/tests/pi_session_delivery_red.rs +0 -226
- package/crates/team-agent/src/lifecycle/tests/quick_start_worker_readiness_red.rs +0 -332
- 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 -342
- 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 -995
- package/crates/team-agent/src/lifecycle/tests/worker_spawn_env_red.rs +0 -836
- package/crates/team-agent/src/lifecycle/tests.rs +0 -105
- package/crates/team-agent/src/lifecycle/types.rs +0 -877
- package/crates/team-agent/src/lifecycle/worker_command_context.rs +0 -363
- 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 -527
- package/crates/team-agent/src/mcp_server/readiness_tests.rs +0 -348
- 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 -158
- package/crates/team-agent/src/mcp_server/tests/send.rs +0 -353
- package/crates/team-agent/src/mcp_server/tests/tools.rs +0 -341
- 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 -889
- 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 -3727
- 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 -336
- 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 -167
- 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/reminders.rs +0 -316
- 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 -223
- 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 -657
- 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 -3549
- package/crates/team-agent/src/messaging/tests/spine.rs +0 -853
- 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 -472
- 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 -1150
- package/crates/team-agent/src/provider/adapters/claude.rs +0 -78
- package/crates/team-agent/src/provider/adapters/claude_fork.rs +0 -131
- 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 -30
- package/crates/team-agent/src/provider/adapters/pi.rs +0 -106
- 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 -708
- 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 -910
- package/crates/team-agent/src/provider/session/capture.rs +0 -2731
- package/crates/team-agent/src/provider/session/context_fork/claude.rs +0 -123
- package/crates/team-agent/src/provider/session/context_fork/outcome.rs +0 -172
- package/crates/team-agent/src/provider/session/context_fork.rs +0 -396
- 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/claude.rs +0 -523
- package/crates/team-agent/src/provider/session_scan/common/tests.rs +0 -316
- package/crates/team-agent/src/provider/session_scan/common.rs +0 -654
- package/crates/team-agent/src/provider/session_scan/copilot.rs +0 -280
- package/crates/team-agent/src/provider/session_scan/pi.rs +0 -185
- package/crates/team-agent/src/provider/session_scan.rs +0 -71
- 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 -441
- package/crates/team-agent/src/provider/tests/classify.rs +0 -148
- package/crates/team-agent/src/provider/tests/command_helpers.rs +0 -35
- 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 -177
- 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 -394
- 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/test_support/models_timeout_fixture.rs +0 -144
- 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 -4103
- package/crates/team-agent/src/tmux_backend.rs +0 -4492
- 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,226 +0,0 @@
|
|
|
1
|
-
use std::path::{Path, PathBuf};
|
|
2
|
-
use std::sync::atomic::{AtomicU32, Ordering};
|
|
3
|
-
|
|
4
|
-
use crate::lifecycle::launch::pi_mcp::pi_seat_paths;
|
|
5
|
-
use crate::messaging::delivery::{
|
|
6
|
-
recipient_allows_explicit_queue_flush, recipient_requires_single_enter,
|
|
7
|
-
};
|
|
8
|
-
use crate::model::enums::{Provider, ProviderEffort};
|
|
9
|
-
use crate::provider::adapters::pi::{build_pi_command_argv, PiCommandRequest, PiSessionSelector};
|
|
10
|
-
use crate::provider::session_scan::{scan_session_candidates_once, CaptureSessionContext};
|
|
11
|
-
use crate::provider::{get_adapter, AuthMode, ProviderError, SessionId};
|
|
12
|
-
|
|
13
|
-
static NEXT_ROOT: AtomicU32 = AtomicU32::new(0);
|
|
14
|
-
|
|
15
|
-
fn temp_root(label: &str) -> PathBuf {
|
|
16
|
-
let seq = NEXT_ROOT.fetch_add(1, Ordering::Relaxed);
|
|
17
|
-
let root = std::env::temp_dir().join(format!(
|
|
18
|
-
"team-agent-pi-{label}-{}-{seq}",
|
|
19
|
-
std::process::id()
|
|
20
|
-
));
|
|
21
|
-
std::fs::create_dir_all(&root).expect("create fixture root");
|
|
22
|
-
root
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
fn write_header(path: &Path, id: &str, cwd: &Path, timestamp: &str) {
|
|
26
|
-
std::fs::create_dir_all(path.parent().expect("session parent")).expect("create session parent");
|
|
27
|
-
let header = serde_json::json!({
|
|
28
|
-
"type": "session",
|
|
29
|
-
"version": 3,
|
|
30
|
-
"id": id,
|
|
31
|
-
"cwd": cwd,
|
|
32
|
-
"timestamp": timestamp,
|
|
33
|
-
});
|
|
34
|
-
std::fs::write(
|
|
35
|
-
path,
|
|
36
|
-
format!("{header}\nsecret conversation body must not be read\n"),
|
|
37
|
-
)
|
|
38
|
-
.expect("write session fixture");
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
fn scan_context(cwd: &Path, root: &Path, id: &str, generation: &str) -> CaptureSessionContext {
|
|
42
|
-
CaptureSessionContext {
|
|
43
|
-
agent_id: "worker-a".to_string(),
|
|
44
|
-
spawn_cwd: cwd.to_path_buf(),
|
|
45
|
-
pane_id: None,
|
|
46
|
-
pane_pid: None,
|
|
47
|
-
spawned_at: Some(generation.to_string()),
|
|
48
|
-
expected_session_id: Some(SessionId::new(id)),
|
|
49
|
-
provider_projects_root: Some(root.to_path_buf()),
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
fn resume_argv(path: &Path) -> Result<Vec<String>, ProviderError> {
|
|
54
|
-
build_pi_command_argv(PiCommandRequest {
|
|
55
|
-
extension: Path::new("/workspace/.team/runtime/pi/team-a/worker-a/team-mcp.ts"),
|
|
56
|
-
model: Some("team-agent/qwen3.8-27b"),
|
|
57
|
-
effort: Some(ProviderEffort::Medium),
|
|
58
|
-
system_prompt: "worker contract",
|
|
59
|
-
session_dir: Some(Path::new(
|
|
60
|
-
"/workspace/.team/runtime/pi/team-a/worker-a/sessions",
|
|
61
|
-
)),
|
|
62
|
-
session: PiSessionSelector::Resume { path },
|
|
63
|
-
agent_id: "worker-a",
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
#[test]
|
|
68
|
-
fn pi_session_capture_requires_header_id_cwd_generation_and_unique_claim() {
|
|
69
|
-
let root = temp_root("session-capture");
|
|
70
|
-
let cwd = root.join("workspace");
|
|
71
|
-
let sessions = root.join("seat/sessions");
|
|
72
|
-
std::fs::create_dir_all(&cwd).expect("create cwd");
|
|
73
|
-
let id = "652756ea-aaee-4437-a30f-40c5606826d5";
|
|
74
|
-
let generation = "2026-08-29T10:00:00Z";
|
|
75
|
-
let session_timestamp = "2026-08-29T10:00:01Z";
|
|
76
|
-
let expected_path = sessions.join("2026/08/29/session.jsonl");
|
|
77
|
-
write_header(&expected_path, id, &cwd, session_timestamp);
|
|
78
|
-
|
|
79
|
-
let context = scan_context(&cwd, &sessions, id, generation);
|
|
80
|
-
let candidates = scan_session_candidates_once(Provider::Pi, &context).expect("Pi scan");
|
|
81
|
-
assert_eq!(candidates.len(), 1);
|
|
82
|
-
assert_eq!(
|
|
83
|
-
candidates[0]
|
|
84
|
-
.captured
|
|
85
|
-
.session_id
|
|
86
|
-
.as_ref()
|
|
87
|
-
.map(SessionId::as_str),
|
|
88
|
-
Some(id)
|
|
89
|
-
);
|
|
90
|
-
assert_eq!(
|
|
91
|
-
candidates[0]
|
|
92
|
-
.captured
|
|
93
|
-
.rollout_path
|
|
94
|
-
.as_ref()
|
|
95
|
-
.map(|path| path.as_path()),
|
|
96
|
-
Some(expected_path.as_path())
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
for (label, header_id, header_cwd, header_timestamp) in [
|
|
100
|
-
("wrong-id", "wrong-id", cwd.as_path(), session_timestamp),
|
|
101
|
-
("wrong-cwd", id, root.as_path(), session_timestamp),
|
|
102
|
-
(
|
|
103
|
-
"wrong-generation",
|
|
104
|
-
id,
|
|
105
|
-
cwd.as_path(),
|
|
106
|
-
"2026-08-29T09:00:00+00:00",
|
|
107
|
-
),
|
|
108
|
-
] {
|
|
109
|
-
let case_root = root.join(label);
|
|
110
|
-
let case_path = case_root.join(format!("{id}.jsonl"));
|
|
111
|
-
write_header(&case_path, header_id, header_cwd, header_timestamp);
|
|
112
|
-
let case_context = scan_context(&cwd, &case_root, id, generation);
|
|
113
|
-
assert!(
|
|
114
|
-
scan_session_candidates_once(Provider::Pi, &case_context)
|
|
115
|
-
.expect("negative scan")
|
|
116
|
-
.is_empty(),
|
|
117
|
-
"filename or mtime must not override a mismatched header: {label}"
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
let second = sessions.join("duplicate/session.jsonl");
|
|
122
|
-
write_header(&second, id, &cwd, session_timestamp);
|
|
123
|
-
assert_eq!(
|
|
124
|
-
scan_session_candidates_once(Provider::Pi, &context)
|
|
125
|
-
.expect("ambiguous scan")
|
|
126
|
-
.len(),
|
|
127
|
-
2,
|
|
128
|
-
"multiple exact candidates must remain ambiguous for the shared allocator"
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
std::fs::remove_dir_all(root).expect("remove session fixture");
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
#[test]
|
|
135
|
-
fn pi_fresh_capture_reads_the_header_id_pi_wrote() {
|
|
136
|
-
let root = temp_root("native-header");
|
|
137
|
-
let cwd = root.join("workspace");
|
|
138
|
-
let sessions = root.join("seat/sessions");
|
|
139
|
-
std::fs::create_dir_all(&cwd).expect("create cwd");
|
|
140
|
-
let native_id = "410271aa-2a95-46fe-a92e-41927688fb0c";
|
|
141
|
-
let path = sessions.join("pi-created.jsonl");
|
|
142
|
-
write_header(&path, native_id, &cwd, "2026-08-29T10:00:01Z");
|
|
143
|
-
let mut context = scan_context(&cwd, &sessions, "unused", "2026-08-29T10:00:00Z");
|
|
144
|
-
context.expected_session_id = None;
|
|
145
|
-
|
|
146
|
-
let candidates = scan_session_candidates_once(Provider::Pi, &context).expect("native header scan");
|
|
147
|
-
assert_eq!(candidates.len(), 1);
|
|
148
|
-
assert_eq!(
|
|
149
|
-
candidates[0].captured.session_id.as_ref().map(SessionId::as_str),
|
|
150
|
-
Some(native_id)
|
|
151
|
-
);
|
|
152
|
-
std::fs::remove_dir_all(root).expect("remove native header fixture");
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
#[test]
|
|
156
|
-
fn pi_restart_uses_exact_path_and_refuses_missing_backing() {
|
|
157
|
-
let root = temp_root("resume");
|
|
158
|
-
let cwd = root.join("workspace");
|
|
159
|
-
let sessions = root.join("seat/sessions");
|
|
160
|
-
std::fs::create_dir_all(&cwd).expect("create cwd");
|
|
161
|
-
let id = "cc09d133-878f-4241-920f-f7ebfefc2a9e";
|
|
162
|
-
let generation = "2026-08-29T10:00:00Z";
|
|
163
|
-
let exact = sessions.join("nested/exact.jsonl");
|
|
164
|
-
write_header(&exact, id, &cwd, "2026-08-29T10:00:01Z");
|
|
165
|
-
|
|
166
|
-
let candidates =
|
|
167
|
-
scan_session_candidates_once(Provider::Pi, &scan_context(&cwd, &sessions, id, generation))
|
|
168
|
-
.expect("resume preflight scan");
|
|
169
|
-
assert_eq!(
|
|
170
|
-
candidates.len(),
|
|
171
|
-
1,
|
|
172
|
-
"exact backing must revalidate before restart"
|
|
173
|
-
);
|
|
174
|
-
|
|
175
|
-
let argv = resume_argv(&exact).expect("resume exact path");
|
|
176
|
-
assert!(argv
|
|
177
|
-
.windows(2)
|
|
178
|
-
.any(|pair| { pair[0] == "--session" && pair[1] == exact.to_string_lossy().as_ref() }));
|
|
179
|
-
assert!(!argv.iter().any(|arg| {
|
|
180
|
-
matches!(
|
|
181
|
-
arg.as_str(),
|
|
182
|
-
"--session-id" | "-c" | "--continue" | "-r" | "--resume"
|
|
183
|
-
)
|
|
184
|
-
}));
|
|
185
|
-
|
|
186
|
-
std::fs::remove_file(&exact).expect("remove backing tooth");
|
|
187
|
-
let missing = resume_argv(&exact);
|
|
188
|
-
assert!(
|
|
189
|
-
matches!(missing, Err(ProviderError::ResumeUnavailable(_))),
|
|
190
|
-
"missing exact backing must refuse rather than create a new session: {missing:?}"
|
|
191
|
-
);
|
|
192
|
-
std::fs::remove_dir_all(root).expect("remove resume fixture");
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
#[test]
|
|
196
|
-
fn pi_delivery_submits_one_enter_and_never_flushes_or_retries() {
|
|
197
|
-
let idle = serde_json::json!({
|
|
198
|
-
"agents": {
|
|
199
|
-
"worker-a": {"provider": "pi", "status": "running"}
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
assert!(recipient_requires_single_enter(&idle, "worker-a"));
|
|
203
|
-
assert!(!recipient_allows_explicit_queue_flush(&idle, "worker-a"));
|
|
204
|
-
let busy = serde_json::json!({
|
|
205
|
-
"agents": {
|
|
206
|
-
"worker-a": {"provider": "pi", "status": "busy"}
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
// Working native CLIs queue the same single-Enter input; no idle admission.
|
|
210
|
-
assert!(recipient_requires_single_enter(&busy, "worker-a"));
|
|
211
|
-
assert!(!recipient_allows_explicit_queue_flush(&busy, "worker-a"));
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
#[test]
|
|
215
|
-
fn pi_clone_is_fresh_and_fork_is_not_clone() {
|
|
216
|
-
let workspace = Path::new("/workspace");
|
|
217
|
-
let source_paths = pi_seat_paths(workspace, "team-a", "source");
|
|
218
|
-
let clone_paths = pi_seat_paths(workspace, "team-a", "clone");
|
|
219
|
-
assert_ne!(source_paths.runtime_root, clone_paths.runtime_root);
|
|
220
|
-
assert_ne!(source_paths.wrapper, clone_paths.wrapper);
|
|
221
|
-
assert_eq!(source_paths.sessions, clone_paths.sessions);
|
|
222
|
-
|
|
223
|
-
let source_session = SessionId::new("652756ea-aaee-4437-a30f-40c5606826d5");
|
|
224
|
-
let fork = get_adapter(Provider::Pi).fork(Some(&source_session), AuthMode::Subscription, None);
|
|
225
|
-
assert!(matches!(fork, Err(ProviderError::CapabilityUnsupported(_))));
|
|
226
|
-
}
|
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
//! BUG-7 (RS 0.3.1 dogfood): `quick-start` must NEVER report bare `ready`
|
|
2
|
-
//! while worker MCP tool-set load is unverified or any agent is observably
|
|
3
|
-
//! degraded. Real-machine evidence (see ../测试rust/BUG-0.3.0-codex-mcp-schema.md
|
|
4
|
-
//! 次要问题#2): `quick-start` printed `quick-start ready: ...` while the codex
|
|
5
|
-
//! worker had already silently rejected the team_orchestrator tool schema and
|
|
6
|
-
//! returned to IDLE — the user had no observable to distinguish "actually
|
|
7
|
-
//! ready" from "spawned but worker dead".
|
|
8
|
-
//!
|
|
9
|
-
//! Coverage:
|
|
10
|
-
//! T1 — worker spawned with a live window but the framework cannot confirm
|
|
11
|
-
//! the worker's MCP tool set finished loading. The report's
|
|
12
|
-
//! `worker_readiness` must signal `pending_tool_load` (NOT bare Ready),
|
|
13
|
-
//! and the CLI summary must NOT be the historical bare
|
|
14
|
-
//! `quick-start ready: <session>` string.
|
|
15
|
-
//! T2 — at least one worker silently failed to spawn (BUG-2 observable: tmux
|
|
16
|
-
//! window missing after launch). The report's `worker_readiness` must
|
|
17
|
-
//! be `Degraded { unhealthy_agents: [<id>] }`, the summary must call
|
|
18
|
-
//! out `degraded`, and `ok` in the JSON envelope must be false.
|
|
19
|
-
|
|
20
|
-
#![allow(clippy::expect_used, clippy::panic, clippy::unwrap_used)]
|
|
21
|
-
|
|
22
|
-
use std::collections::BTreeMap;
|
|
23
|
-
use std::path::{Path, PathBuf};
|
|
24
|
-
use std::sync::{Arc, Mutex};
|
|
25
|
-
|
|
26
|
-
use team_agent::lifecycle::{quick_start_with_transport, QuickStartReadiness, QuickStartReport};
|
|
27
|
-
use team_agent::transport::{
|
|
28
|
-
AttachOutcome, BackendKind, CaptureRange, CapturedText, InjectPayload, InjectReport,
|
|
29
|
-
InjectStage, InjectVerification, Key, PaneField, PaneId, PaneInfo, PaneLiveness, SessionName,
|
|
30
|
-
SetEnvOutcome, SpawnResult, SubmitVerification, Target, Transport, TransportError,
|
|
31
|
-
TurnVerification, WindowName,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
#[path = "../../../tests/support/hermetic.rs"]
|
|
35
|
-
mod hermetic;
|
|
36
|
-
use hermetic::HermeticTestEnv;
|
|
37
|
-
|
|
38
|
-
const TEAM_MD: &str =
|
|
39
|
-
"---\nname: bug7\nobjective: BUG-7 worker readiness honesty contract.\nprovider: codex\n---\n\nTeam.\n";
|
|
40
|
-
|
|
41
|
-
const FAKE_ROLE: &str = "---\nname: faker\nrole: Fake Worker\nprovider: fake\nmodel: fake\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nFake worker.\n";
|
|
42
|
-
|
|
43
|
-
const CLAUDE_ROLE: &str = "---\nname: clauder\nrole: Claude Worker\nprovider: claude\nmodel: claude-sonnet-4-6\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nClaude worker.\n";
|
|
44
|
-
|
|
45
|
-
#[test]
|
|
46
|
-
#[ignore = "real-machine: quick-start worker readiness gate"]
|
|
47
|
-
fn t1_quick_start_must_not_emit_bare_ready_when_worker_tool_load_is_unverified() {
|
|
48
|
-
let hermetic = HermeticTestEnv::enter("quick-start-readiness-t1");
|
|
49
|
-
hermetic.scrub_tmux();
|
|
50
|
-
hermetic.assert_no_real_tmux();
|
|
51
|
-
let team = bug7_team_dir(&hermetic, "t1-pending");
|
|
52
|
-
// Both agents spawn successfully (recording transport reports both windows live)
|
|
53
|
-
// but the framework has no way to verify the worker MCP tool set actually
|
|
54
|
-
// loaded — claude can still reject schemas asynchronously. The report
|
|
55
|
-
// therefore must be PendingToolLoad, not bare Ready.
|
|
56
|
-
let transport = RecordingTransport::new()
|
|
57
|
-
.with_windows(vec![WindowName::new("faker"), WindowName::new("clauder")]);
|
|
58
|
-
let report = quick_start_with_transport(&team, None, true, None, &transport)
|
|
59
|
-
.expect("quick_start_with_transport should succeed for healthy spawn");
|
|
60
|
-
let QuickStartReport::Ready {
|
|
61
|
-
worker_readiness,
|
|
62
|
-
session_name,
|
|
63
|
-
..
|
|
64
|
-
} = &report
|
|
65
|
-
else {
|
|
66
|
-
panic!("quick-start must return Ready for healthy spawn; got {report:?}");
|
|
67
|
-
};
|
|
68
|
-
assert_eq!(
|
|
69
|
-
worker_readiness,
|
|
70
|
-
&QuickStartReadiness::PendingToolLoad,
|
|
71
|
-
"T1: post-spawn report MUST be PendingToolLoad (framework cannot itself \
|
|
72
|
-
confirm worker MCP tool set load); bare Ready would lie. got {report:?}"
|
|
73
|
-
);
|
|
74
|
-
// Drive the CLI rendering path that the user sees — it must not contain the
|
|
75
|
-
// historical bare `quick-start ready: <session>` phrasing.
|
|
76
|
-
let rendered = render_quick_start_summary(&report);
|
|
77
|
-
assert!(
|
|
78
|
-
!rendered.starts_with("quick-start ready:"),
|
|
79
|
-
"T1: CLI summary must NOT begin with the bare `quick-start ready:` phrase \
|
|
80
|
-
while worker tool-load is unverified; got {rendered:?}"
|
|
81
|
-
);
|
|
82
|
-
assert!(
|
|
83
|
-
rendered.contains(session_name.as_str()),
|
|
84
|
-
"T1: CLI summary should still identify the session; got {rendered:?}"
|
|
85
|
-
);
|
|
86
|
-
assert!(
|
|
87
|
-
rendered.to_lowercase().contains("pending")
|
|
88
|
-
|| rendered.to_lowercase().contains("unverified"),
|
|
89
|
-
"T1: CLI summary must label the readiness as pending / unverified; got {rendered:?}"
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
#[test]
|
|
94
|
-
#[ignore = "real-machine: quick-start worker readiness gate"]
|
|
95
|
-
fn t2_quick_start_must_report_degraded_when_a_worker_spawn_yields_no_live_window() {
|
|
96
|
-
let hermetic = HermeticTestEnv::enter("quick-start-readiness-t2");
|
|
97
|
-
hermetic.scrub_tmux();
|
|
98
|
-
hermetic.assert_no_real_tmux();
|
|
99
|
-
let team = bug7_team_dir(&hermetic, "t2-degraded");
|
|
100
|
-
// Recording transport simulates the Mac mini final capture: only the fake
|
|
101
|
-
// worker window exists after launch; the claude window never materialized (no
|
|
102
|
-
// `claude` binary on PATH, etc.). BUG-2 fix already marks `clauder` as
|
|
103
|
-
// spawn_failed in runtime state; BUG-7 must surface that as a Degraded
|
|
104
|
-
// verdict so quick-start cannot pretend the team is ready.
|
|
105
|
-
let transport = RecordingTransport::new().with_windows(vec![WindowName::new("faker")]);
|
|
106
|
-
let report = quick_start_with_transport(&team, None, true, None, &transport)
|
|
107
|
-
.expect("quick_start_with_transport should reach the spawn/state path even when an agent fails to spawn");
|
|
108
|
-
let QuickStartReport::Ready {
|
|
109
|
-
worker_readiness, ..
|
|
110
|
-
} = &report
|
|
111
|
-
else {
|
|
112
|
-
panic!("quick-start must still return Ready (with Degraded verdict) so the user sees session details; got {report:?}");
|
|
113
|
-
};
|
|
114
|
-
let QuickStartReadiness::Degraded { unhealthy_agents } = worker_readiness else {
|
|
115
|
-
panic!(
|
|
116
|
-
"T2: silent-spawn-failure must produce Degraded verdict, NOT PendingToolLoad / bare Ready; got {worker_readiness:?}"
|
|
117
|
-
);
|
|
118
|
-
};
|
|
119
|
-
assert!(
|
|
120
|
-
unhealthy_agents.iter().any(|id| id == "clauder"),
|
|
121
|
-
"T2: Degraded verdict must list the agent whose window never materialized \
|
|
122
|
-
(clauder); got unhealthy_agents={unhealthy_agents:?}"
|
|
123
|
-
);
|
|
124
|
-
let rendered = render_quick_start_summary(&report);
|
|
125
|
-
assert!(
|
|
126
|
-
rendered.to_lowercase().contains("degraded"),
|
|
127
|
-
"T2: CLI summary must call out `degraded` so the user does not interpret \
|
|
128
|
-
the report as ready; got {rendered:?}"
|
|
129
|
-
);
|
|
130
|
-
assert!(
|
|
131
|
-
rendered.contains("clauder"),
|
|
132
|
-
"T2: CLI summary should mention the unhealthy agent id (clauder); got {rendered:?}"
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// ---------------------------------------------------------------------------
|
|
137
|
-
// Fixture: minimal team layout + recording transport for the BUG-7 contracts.
|
|
138
|
-
// The transport returns whichever WindowName values are seeded via
|
|
139
|
-
// `with_windows(...)` from `list_windows`, simulating the post-spawn observable.
|
|
140
|
-
// ---------------------------------------------------------------------------
|
|
141
|
-
|
|
142
|
-
fn bug7_team_dir(hermetic: &HermeticTestEnv, tag: &str) -> PathBuf {
|
|
143
|
-
let base = hermetic.workspace(tag);
|
|
144
|
-
let team = base.join("teamdir");
|
|
145
|
-
std::fs::create_dir_all(team.join("agents")).expect("mkdir teamdir/agents");
|
|
146
|
-
std::fs::write(team.join("TEAM.md"), TEAM_MD).expect("write TEAM.md");
|
|
147
|
-
std::fs::write(team.join("agents").join("faker.md"), FAKE_ROLE).expect("write faker.md");
|
|
148
|
-
std::fs::write(team.join("agents").join("clauder.md"), CLAUDE_ROLE).expect("write clauder.md");
|
|
149
|
-
team
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
fn render_quick_start_summary(report: &QuickStartReport) -> String {
|
|
153
|
-
// Mirror `cli/mod.rs::quick_start_value`'s summary projection so the contract
|
|
154
|
-
// tests can verify the user-visible string without re-running the full CLI
|
|
155
|
-
// path. Keep this in lock-step with the CLI emit branch.
|
|
156
|
-
match report {
|
|
157
|
-
QuickStartReport::Ready {
|
|
158
|
-
session_name,
|
|
159
|
-
worker_readiness,
|
|
160
|
-
..
|
|
161
|
-
} => match worker_readiness {
|
|
162
|
-
QuickStartReadiness::Degraded { unhealthy_agents } => format!(
|
|
163
|
-
"quick-start degraded: {}; unhealthy: {}",
|
|
164
|
-
session_name.as_str(),
|
|
165
|
-
unhealthy_agents.join(",")
|
|
166
|
-
),
|
|
167
|
-
QuickStartReadiness::PendingToolLoad => format!(
|
|
168
|
-
"quick-start launched (worker tool load unverified): {}",
|
|
169
|
-
session_name.as_str()
|
|
170
|
-
),
|
|
171
|
-
},
|
|
172
|
-
_ => "non-ready".to_string(),
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
#[derive(Clone, Default)]
|
|
177
|
-
struct RecordingTransport {
|
|
178
|
-
state: Arc<Mutex<RecordingState>>,
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
#[derive(Default)]
|
|
182
|
-
struct RecordingState {
|
|
183
|
-
windows: Vec<WindowName>,
|
|
184
|
-
sessions: Vec<SessionName>,
|
|
185
|
-
pane_seq: u64,
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
impl RecordingTransport {
|
|
189
|
-
fn new() -> Self {
|
|
190
|
-
Self::default()
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
fn with_windows(self, windows: Vec<WindowName>) -> Self {
|
|
194
|
-
{
|
|
195
|
-
let mut guard = self.state.lock().expect("lock");
|
|
196
|
-
guard.windows = windows;
|
|
197
|
-
}
|
|
198
|
-
self
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
fn next_pane_id(&self) -> PaneId {
|
|
202
|
-
let mut guard = self.state.lock().expect("lock");
|
|
203
|
-
guard.pane_seq += 1;
|
|
204
|
-
PaneId::new(format!("%{}", guard.pane_seq))
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
impl Transport for RecordingTransport {
|
|
209
|
-
fn kind(&self) -> BackendKind {
|
|
210
|
-
BackendKind::Tmux
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
fn spawn_first(
|
|
214
|
-
&self,
|
|
215
|
-
session: &SessionName,
|
|
216
|
-
window: &WindowName,
|
|
217
|
-
_argv: &[String],
|
|
218
|
-
_cwd: &Path,
|
|
219
|
-
_env: &BTreeMap<String, String>,
|
|
220
|
-
) -> Result<SpawnResult, TransportError> {
|
|
221
|
-
{
|
|
222
|
-
let mut guard = self.state.lock().expect("lock");
|
|
223
|
-
if !guard
|
|
224
|
-
.sessions
|
|
225
|
-
.iter()
|
|
226
|
-
.any(|s| s.as_str() == session.as_str())
|
|
227
|
-
{
|
|
228
|
-
guard.sessions.push(session.clone());
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
Ok(SpawnResult {
|
|
232
|
-
pane_id: self.next_pane_id(),
|
|
233
|
-
session: session.clone(),
|
|
234
|
-
window: window.clone(),
|
|
235
|
-
child_pid: None,
|
|
236
|
-
})
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
fn spawn_into(
|
|
240
|
-
&self,
|
|
241
|
-
session: &SessionName,
|
|
242
|
-
window: &WindowName,
|
|
243
|
-
_argv: &[String],
|
|
244
|
-
_cwd: &Path,
|
|
245
|
-
_env: &BTreeMap<String, String>,
|
|
246
|
-
) -> Result<SpawnResult, TransportError> {
|
|
247
|
-
Ok(SpawnResult {
|
|
248
|
-
pane_id: self.next_pane_id(),
|
|
249
|
-
session: session.clone(),
|
|
250
|
-
window: window.clone(),
|
|
251
|
-
child_pid: None,
|
|
252
|
-
})
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
fn inject(
|
|
256
|
-
&self,
|
|
257
|
-
_target: &Target,
|
|
258
|
-
_payload: &InjectPayload,
|
|
259
|
-
_submit: Key,
|
|
260
|
-
_bracketed: bool,
|
|
261
|
-
) -> Result<InjectReport, TransportError> {
|
|
262
|
-
Ok(InjectReport {
|
|
263
|
-
stage_reached: InjectStage::Submit,
|
|
264
|
-
inject_verification: InjectVerification::CaptureContainsToken,
|
|
265
|
-
submit_verification: SubmitVerification::EnterSentWithoutPlaceholderCheck,
|
|
266
|
-
turn_verification: TurnVerification::NotYetObserved,
|
|
267
|
-
attempts: 1,
|
|
268
|
-
submit_diagnostics: None,
|
|
269
|
-
})
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
fn send_keys(&self, _target: &Target, _keys: &[Key]) -> Result<(), TransportError> {
|
|
273
|
-
Ok(())
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
fn capture(
|
|
277
|
-
&self,
|
|
278
|
-
_target: &Target,
|
|
279
|
-
range: CaptureRange,
|
|
280
|
-
) -> Result<CapturedText, TransportError> {
|
|
281
|
-
Ok(CapturedText {
|
|
282
|
-
text: String::new(),
|
|
283
|
-
range,
|
|
284
|
-
})
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
fn query(&self, _target: &Target, _field: PaneField) -> Result<Option<String>, TransportError> {
|
|
288
|
-
Ok(None)
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
fn liveness(&self, _pane: &PaneId) -> Result<PaneLiveness, TransportError> {
|
|
292
|
-
Ok(PaneLiveness::Live)
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
fn list_targets(&self) -> Result<Vec<PaneInfo>, TransportError> {
|
|
296
|
-
Ok(Vec::new())
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
fn has_session(&self, session: &SessionName) -> Result<bool, TransportError> {
|
|
300
|
-
let guard = self.state.lock().expect("lock");
|
|
301
|
-
Ok(guard
|
|
302
|
-
.sessions
|
|
303
|
-
.iter()
|
|
304
|
-
.any(|s| s.as_str() == session.as_str()))
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
fn list_windows(&self, _session: &SessionName) -> Result<Vec<WindowName>, TransportError> {
|
|
308
|
-
let guard = self.state.lock().expect("lock");
|
|
309
|
-
Ok(guard.windows.clone())
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
fn set_session_env(
|
|
313
|
-
&self,
|
|
314
|
-
_session: &SessionName,
|
|
315
|
-
_key: &str,
|
|
316
|
-
_value: &str,
|
|
317
|
-
) -> Result<SetEnvOutcome, TransportError> {
|
|
318
|
-
Ok(SetEnvOutcome::Applied)
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
fn kill_session(&self, _session: &SessionName) -> Result<(), TransportError> {
|
|
322
|
-
Ok(())
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
fn kill_window(&self, _target: &Target) -> Result<(), TransportError> {
|
|
326
|
-
Ok(())
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
fn attach_session(&self, _session: &SessionName) -> Result<AttachOutcome, TransportError> {
|
|
330
|
-
Ok(AttachOutcome::Attached)
|
|
331
|
-
}
|
|
332
|
-
}
|