@team-agent/installer 0.5.128 → 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 +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,1514 +0,0 @@
|
|
|
1
|
-
use super::*;
|
|
2
|
-
use serde_json::{json, Value};
|
|
3
|
-
use serial_test::serial;
|
|
4
|
-
use std::collections::BTreeMap;
|
|
5
|
-
use std::path::{Path, PathBuf};
|
|
6
|
-
#[cfg(unix)]
|
|
7
|
-
use std::time::{Duration, Instant};
|
|
8
|
-
|
|
9
|
-
fn brief_workspace(tag: &str) -> PathBuf {
|
|
10
|
-
let dir = std::env::temp_dir().join(format!(
|
|
11
|
-
"ta-status-brief-{}-{}-{}",
|
|
12
|
-
tag,
|
|
13
|
-
std::process::id(),
|
|
14
|
-
std::time::SystemTime::now()
|
|
15
|
-
.duration_since(std::time::UNIX_EPOCH)
|
|
16
|
-
.unwrap()
|
|
17
|
-
.as_nanos()
|
|
18
|
-
));
|
|
19
|
-
std::fs::create_dir_all(dir.join(".team").join("runtime")).unwrap();
|
|
20
|
-
dir
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
fn write_state(ws: &Path, state: &Value) {
|
|
24
|
-
std::fs::write(
|
|
25
|
-
ws.join(".team").join("runtime").join("state.json"),
|
|
26
|
-
serde_json::to_vec_pretty(state).unwrap(),
|
|
27
|
-
)
|
|
28
|
-
.unwrap();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
fn production_agent(id: &str, pane: &str) -> Value {
|
|
32
|
-
json!({
|
|
33
|
-
"status": "running",
|
|
34
|
-
"provider": "pi",
|
|
35
|
-
"agent_id": id,
|
|
36
|
-
"window": id,
|
|
37
|
-
"layout_window": id,
|
|
38
|
-
"pane_id": pane,
|
|
39
|
-
"display": {
|
|
40
|
-
"backend": "adaptive",
|
|
41
|
-
"status": "opened",
|
|
42
|
-
"window": id,
|
|
43
|
-
"pane_id": pane,
|
|
44
|
-
"target_worker_session": "team-demo",
|
|
45
|
-
"linked_session": null,
|
|
46
|
-
"display_session": null
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
fn production_state(agents: Value) -> Value {
|
|
52
|
-
json!({
|
|
53
|
-
"session_name": "team-demo",
|
|
54
|
-
"tmux_endpoint": "/tmp/ta-status-brief.sock",
|
|
55
|
-
"tmux_socket": "/tmp/ta-status-brief.sock",
|
|
56
|
-
"active_team_key": "demo",
|
|
57
|
-
"agents": agents
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
struct BriefWorkspaceGuard(PathBuf);
|
|
62
|
-
|
|
63
|
-
impl std::ops::Deref for BriefWorkspaceGuard {
|
|
64
|
-
type Target = Path;
|
|
65
|
-
|
|
66
|
-
fn deref(&self) -> &Self::Target {
|
|
67
|
-
&self.0
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
impl Drop for BriefWorkspaceGuard {
|
|
72
|
-
fn drop(&mut self) {
|
|
73
|
-
let _ = std::fs::remove_dir_all(&self.0);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
fn guarded_brief_workspace(tag: &str) -> BriefWorkspaceGuard {
|
|
78
|
-
BriefWorkspaceGuard(brief_workspace(tag))
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
fn status_agent(
|
|
82
|
-
name: &str,
|
|
83
|
-
pane: &str,
|
|
84
|
-
endpoint: &str,
|
|
85
|
-
session: &str,
|
|
86
|
-
model: &str,
|
|
87
|
-
effort: &str,
|
|
88
|
-
) -> Value {
|
|
89
|
-
let mut agent = production_agent(name, pane);
|
|
90
|
-
agent["tmux_endpoint"] = json!(endpoint);
|
|
91
|
-
agent["session_name"] = json!(session);
|
|
92
|
-
agent["model"] = json!(model);
|
|
93
|
-
agent["effort"] = json!(effort);
|
|
94
|
-
agent
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
#[cfg(unix)]
|
|
98
|
-
fn producer_report_nodes(socket: &str, rows: &[(String, String, String, String)]) -> String {
|
|
99
|
-
let nodes = rows
|
|
100
|
-
.iter()
|
|
101
|
-
.map(|(session, window, pane, native_session)| {
|
|
102
|
-
json!({
|
|
103
|
-
"socket": socket,
|
|
104
|
-
"workspace_path": "/ws",
|
|
105
|
-
"project_name": "demo",
|
|
106
|
-
"session": session,
|
|
107
|
-
"window_index": 1,
|
|
108
|
-
"window_name": window,
|
|
109
|
-
"pane_id": pane,
|
|
110
|
-
"name": window,
|
|
111
|
-
"provider": "pi",
|
|
112
|
-
"state": "idle",
|
|
113
|
-
"activity": "idle",
|
|
114
|
-
"session_name": native_session,
|
|
115
|
-
"health": "normal",
|
|
116
|
-
"background_tasks": {"running": 0},
|
|
117
|
-
"evidence": {"method": "pi_activity_channel", "detail": "channel"}
|
|
118
|
-
})
|
|
119
|
-
})
|
|
120
|
-
.collect::<Vec<_>>();
|
|
121
|
-
serde_json::to_string(&json!({
|
|
122
|
-
"schema_version": 1,
|
|
123
|
-
"socket": socket,
|
|
124
|
-
"sampled_at": "2026-01-01T00:00:00Z",
|
|
125
|
-
"nodes": nodes
|
|
126
|
-
}))
|
|
127
|
-
.unwrap()
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
#[cfg(unix)]
|
|
131
|
-
fn write_nodeprobe_reports(dir: &Path, reports: &[(String, String)]) -> (PathBuf, PathBuf) {
|
|
132
|
-
std::fs::create_dir_all(dir).unwrap();
|
|
133
|
-
let log = dir.join("calls.log");
|
|
134
|
-
let mut body = format!(
|
|
135
|
-
"printf '%s\\t%s\\n' \"$1\" \"$2\" >> {}\ncase \"$2\" in\n",
|
|
136
|
-
shell_quote_for_status_test(&log.to_string_lossy())
|
|
137
|
-
);
|
|
138
|
-
for (index, (endpoint, report)) in reports.iter().enumerate() {
|
|
139
|
-
let path = dir.join(format!("report-{index}.json"));
|
|
140
|
-
std::fs::write(&path, report).unwrap();
|
|
141
|
-
body.push_str(&format!(
|
|
142
|
-
" {} ) cat {} ;;\n",
|
|
143
|
-
shell_quote_for_status_test(endpoint),
|
|
144
|
-
shell_quote_for_status_test(&path.to_string_lossy())
|
|
145
|
-
));
|
|
146
|
-
}
|
|
147
|
-
body.push_str(" *) exit 2 ;;\nesac\n");
|
|
148
|
-
(write_nodeprobe(dir, &body), log)
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
fn shell_quote_for_status_test(value: &str) -> String {
|
|
152
|
-
format!("'{}'", value.replace('\'', "'\\''"))
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
fn logged_probe_calls(log: &Path) -> Vec<(String, String)> {
|
|
156
|
-
std::fs::read_to_string(log)
|
|
157
|
-
.unwrap()
|
|
158
|
-
.lines()
|
|
159
|
-
.map(|line| {
|
|
160
|
-
let (flag, endpoint) = line.split_once('\t').expect("probe call fields");
|
|
161
|
-
(flag.to_string(), endpoint.to_string())
|
|
162
|
-
})
|
|
163
|
-
.collect()
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
fn human_text(result: CmdResult) -> String {
|
|
167
|
-
match result.output {
|
|
168
|
-
CmdOutput::Human(text) => text,
|
|
169
|
-
other => panic!("expected human status output, got {other:?}"),
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
fn legacy_human_node(node: &Value) -> String {
|
|
174
|
-
let text = |key: &str| {
|
|
175
|
-
node.get(key)
|
|
176
|
-
.and_then(Value::as_str)
|
|
177
|
-
.unwrap_or("null")
|
|
178
|
-
.to_string()
|
|
179
|
-
};
|
|
180
|
-
format!(
|
|
181
|
-
"name: {} provider: {} model: {} effort: {} runtime_status: {} activity: {} health: {} session_name: {} tmux_command: {}",
|
|
182
|
-
text("name"),
|
|
183
|
-
text("provider"),
|
|
184
|
-
text("model"),
|
|
185
|
-
text("effort"),
|
|
186
|
-
text("runtime_status"),
|
|
187
|
-
text("activity"),
|
|
188
|
-
text("health"),
|
|
189
|
-
text("session_name"),
|
|
190
|
-
text("tmux_command")
|
|
191
|
-
)
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
fn human_token_count(text: &str, expected: &str) -> usize {
|
|
195
|
-
text.split(|ch: char| !(ch.is_ascii_alphanumeric() || ch == '_'))
|
|
196
|
-
.filter(|token| token.eq_ignore_ascii_case(expected))
|
|
197
|
-
.count()
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
fn status_table_header(text: &str) -> Option<&str> {
|
|
201
|
-
text.lines().find(|line| {
|
|
202
|
-
!line.trim_start().starts_with("name:")
|
|
203
|
-
&& [
|
|
204
|
-
"name",
|
|
205
|
-
"provider",
|
|
206
|
-
"model",
|
|
207
|
-
"effort",
|
|
208
|
-
"activity",
|
|
209
|
-
"health",
|
|
210
|
-
"session_name",
|
|
211
|
-
]
|
|
212
|
-
.iter()
|
|
213
|
-
.all(|field| human_token_count(line, field) == 1)
|
|
214
|
-
&& human_token_count(line, "runtime_status") + human_token_count(line, "runtime")
|
|
215
|
-
== 1
|
|
216
|
-
&& human_token_count(line, "tmux_command") + human_token_count(line, "attach") == 1
|
|
217
|
-
})
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
fn status_args(ws: &Path, json_out: bool, agent: Option<&str>, team: Option<&str>) -> StatusArgs {
|
|
221
|
-
StatusArgs {
|
|
222
|
-
agent: agent.map(str::to_string),
|
|
223
|
-
workspace: ws.to_path_buf(),
|
|
224
|
-
detail: false,
|
|
225
|
-
summary: false,
|
|
226
|
-
json: json_out,
|
|
227
|
-
team: team.map(str::to_string),
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
fn json_nodes(result: CmdResult) -> Vec<Value> {
|
|
232
|
-
match result.output {
|
|
233
|
-
CmdOutput::Json(value) => value
|
|
234
|
-
.get("nodes")
|
|
235
|
-
.and_then(Value::as_array)
|
|
236
|
-
.cloned()
|
|
237
|
-
.unwrap_or_default(),
|
|
238
|
-
other => panic!("expected JSON nodes, got {other:?}"),
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
fn snapshot_tree(root: &Path) -> BTreeMap<String, Vec<u8>> {
|
|
243
|
-
let mut out = BTreeMap::new();
|
|
244
|
-
fn walk(dir: &Path, root: &Path, out: &mut BTreeMap<String, Vec<u8>>) {
|
|
245
|
-
let Ok(entries) = std::fs::read_dir(dir) else {
|
|
246
|
-
return;
|
|
247
|
-
};
|
|
248
|
-
for entry in entries.flatten() {
|
|
249
|
-
let path = entry.path();
|
|
250
|
-
let rel = path
|
|
251
|
-
.strip_prefix(root)
|
|
252
|
-
.unwrap()
|
|
253
|
-
.to_string_lossy()
|
|
254
|
-
.replace('\\', "/");
|
|
255
|
-
if path.is_dir() {
|
|
256
|
-
walk(&path, root, out);
|
|
257
|
-
} else if let Ok(bytes) = std::fs::read(&path) {
|
|
258
|
-
out.insert(rel, bytes);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
walk(root, root, &mut out);
|
|
263
|
-
out
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
#[cfg(unix)]
|
|
267
|
-
fn producer_report(socket: &str, window: &str, pane: &str, method: &str) -> String {
|
|
268
|
-
format!(
|
|
269
|
-
r#"{{"schema_version":1,"socket":"{socket}","sampled_at":"2026-01-01T00:00:00Z","nodes":[{{"socket":"{socket}","workspace_path":"/ws","project_name":"demo","session":"team-demo","window_index":1,"window_name":"{window}","pane_id":"{pane}","name":"{window}","provider":"pi","state":"idle","activity":"idle","session_name":"pi-session","health":"normal","background_tasks":{{"running":0}},"evidence":{{"method":"{method}","detail":"channel"}}}}]}}"#
|
|
270
|
-
)
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
#[cfg(unix)]
|
|
274
|
-
fn write_nodeprobe(dir: &Path, body: &str) -> PathBuf {
|
|
275
|
-
use std::os::unix::fs::PermissionsExt;
|
|
276
|
-
std::fs::create_dir_all(dir).unwrap();
|
|
277
|
-
let path = dir.join("nodeprobe");
|
|
278
|
-
std::fs::write(&path, format!("#!/bin/sh\n{body}\n")).unwrap();
|
|
279
|
-
std::fs::set_permissions(&path, std::fs::Permissions::from_mode(0o755)).unwrap();
|
|
280
|
-
path
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
#[cfg(unix)]
|
|
284
|
-
fn make_fifo(path: &Path) {
|
|
285
|
-
use std::ffi::CString;
|
|
286
|
-
use std::os::unix::ffi::OsStrExt;
|
|
287
|
-
let raw = CString::new(path.as_os_str().as_bytes()).unwrap();
|
|
288
|
-
let result = unsafe { libc::mkfifo(raw.as_ptr(), 0o600) };
|
|
289
|
-
assert_eq!(result, 0, "mkfifo {}: {}", path.display(), std::io::Error::last_os_error());
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
fn status_run(ws: &Path, extra: &[&str]) -> ExitCode {
|
|
293
|
-
let mut argv = vec![
|
|
294
|
-
"status".to_string(),
|
|
295
|
-
"--workspace".to_string(),
|
|
296
|
-
ws.to_string_lossy().to_string(),
|
|
297
|
-
];
|
|
298
|
-
argv.extend(extra.iter().map(|item| item.to_string()));
|
|
299
|
-
run(&argv, Path::new("."))
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
#[cfg(unix)]
|
|
303
|
-
#[test]
|
|
304
|
-
#[serial(status_brief)]
|
|
305
|
-
fn cmd_status_from_production_registration_and_report() {
|
|
306
|
-
let ws = brief_workspace("prod");
|
|
307
|
-
write_state(
|
|
308
|
-
&ws,
|
|
309
|
-
&production_state(json!({ "worker": production_agent("worker", "%7") })),
|
|
310
|
-
);
|
|
311
|
-
let scratch = ws.join("probe");
|
|
312
|
-
let report = producer_report("/tmp/ta-status-brief.sock", "worker", "%7", "pi_activity_channel");
|
|
313
|
-
let log = scratch.join("calls.log");
|
|
314
|
-
let bin = write_nodeprobe(
|
|
315
|
-
&scratch,
|
|
316
|
-
&format!(
|
|
317
|
-
"printf '%s %s\\n' \"$1\" \"$2\" >> '{}'\ncat <<'EOF'\n{}\nEOF\n",
|
|
318
|
-
log.display(),
|
|
319
|
-
report
|
|
320
|
-
),
|
|
321
|
-
);
|
|
322
|
-
let result = status_port::with_test_nodeprobe(bin, || {
|
|
323
|
-
cmd_status(&status_args(&ws, true, None, None)).expect("status")
|
|
324
|
-
});
|
|
325
|
-
let nodes = json_nodes(result);
|
|
326
|
-
assert_eq!(nodes.len(), 1);
|
|
327
|
-
assert_eq!(nodes[0]["name"], "worker");
|
|
328
|
-
assert_eq!(nodes[0]["provider"], "pi");
|
|
329
|
-
assert_eq!(nodes[0]["runtime_status"], "running");
|
|
330
|
-
assert_eq!(nodes[0]["activity"], "idle");
|
|
331
|
-
assert_eq!(nodes[0]["health"], "normal");
|
|
332
|
-
assert_eq!(nodes[0]["session_name"], "pi-session");
|
|
333
|
-
assert_eq!(
|
|
334
|
-
nodes[0]["tmux_command"],
|
|
335
|
-
"tmux -S '/tmp/ta-status-brief.sock' attach -t 'team-demo:worker.%7'"
|
|
336
|
-
);
|
|
337
|
-
let calls = std::fs::read_to_string(&log).unwrap();
|
|
338
|
-
assert_eq!(calls.lines().count(), 1);
|
|
339
|
-
assert!(calls.contains("-S /tmp/ta-status-brief.sock"), "{calls}");
|
|
340
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
#[cfg(unix)]
|
|
344
|
-
#[test]
|
|
345
|
-
#[serial(status_brief)]
|
|
346
|
-
fn cmd_status_dedupes_same_endpoint_across_agents() {
|
|
347
|
-
let ws = brief_workspace("dedupe");
|
|
348
|
-
write_state(
|
|
349
|
-
&ws,
|
|
350
|
-
&production_state(json!({
|
|
351
|
-
"alpha": production_agent("alpha", "%7"),
|
|
352
|
-
"beta": production_agent("beta", "%8"),
|
|
353
|
-
})),
|
|
354
|
-
);
|
|
355
|
-
let scratch = ws.join("probe");
|
|
356
|
-
let log = scratch.join("calls.log");
|
|
357
|
-
let report_alpha = producer_report("/tmp/ta-status-brief.sock", "alpha", "%7", "pi_activity_channel");
|
|
358
|
-
let bin = write_nodeprobe(
|
|
359
|
-
&scratch,
|
|
360
|
-
&format!(
|
|
361
|
-
"printf '%s %s\\n' \"$1\" \"$2\" >> '{}'\ncat <<'EOF'\n{}\nEOF\n",
|
|
362
|
-
log.display(),
|
|
363
|
-
report_alpha
|
|
364
|
-
),
|
|
365
|
-
);
|
|
366
|
-
let nodes = status_port::with_test_nodeprobe(bin, || {
|
|
367
|
-
json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("status"))
|
|
368
|
-
});
|
|
369
|
-
assert_eq!(nodes.len(), 2);
|
|
370
|
-
assert_eq!(std::fs::read_to_string(&log).unwrap().lines().count(), 1);
|
|
371
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
#[cfg(unix)]
|
|
375
|
-
#[test]
|
|
376
|
-
#[serial(status_brief)]
|
|
377
|
-
fn issue271_status_human_dedupes_six_nodes_and_preserves_json() {
|
|
378
|
-
let ws = guarded_brief_workspace("issue271-six");
|
|
379
|
-
let endpoint = "/tmp/271 shared.sock";
|
|
380
|
-
let session = "team-271";
|
|
381
|
-
let mut agents = serde_json::Map::new();
|
|
382
|
-
let mut rows = Vec::new();
|
|
383
|
-
for index in 1..=6 {
|
|
384
|
-
let name = format!("worker-{index}");
|
|
385
|
-
let pane = format!("%{}", index + 20);
|
|
386
|
-
agents.insert(
|
|
387
|
-
name.clone(),
|
|
388
|
-
status_agent(
|
|
389
|
-
&name,
|
|
390
|
-
&pane,
|
|
391
|
-
endpoint,
|
|
392
|
-
session,
|
|
393
|
-
&format!("gpt-5.6-luna-{index}"),
|
|
394
|
-
if index % 2 == 0 { "high" } else { "max" },
|
|
395
|
-
),
|
|
396
|
-
);
|
|
397
|
-
rows.push((
|
|
398
|
-
session.to_string(),
|
|
399
|
-
name.clone(),
|
|
400
|
-
pane,
|
|
401
|
-
format!("native-{name}"),
|
|
402
|
-
));
|
|
403
|
-
}
|
|
404
|
-
write_state(
|
|
405
|
-
&ws,
|
|
406
|
-
&json!({
|
|
407
|
-
"session_name": session,
|
|
408
|
-
"tmux_endpoint": endpoint,
|
|
409
|
-
"active_team_key": "demo",
|
|
410
|
-
"agents": agents
|
|
411
|
-
}),
|
|
412
|
-
);
|
|
413
|
-
let report = producer_report_nodes(endpoint, &rows);
|
|
414
|
-
let (bin, log) = write_nodeprobe_reports(
|
|
415
|
-
&ws.join("probe"),
|
|
416
|
-
&[(endpoint.to_string(), report)],
|
|
417
|
-
);
|
|
418
|
-
let nodes = status_port::with_test_nodeprobe(bin.clone(), || {
|
|
419
|
-
json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("JSON status"))
|
|
420
|
-
});
|
|
421
|
-
assert_eq!(nodes.len(), 6);
|
|
422
|
-
for node in &nodes {
|
|
423
|
-
assert_eq!(node.as_object().unwrap().len(), 9);
|
|
424
|
-
for key in [
|
|
425
|
-
"name",
|
|
426
|
-
"provider",
|
|
427
|
-
"model",
|
|
428
|
-
"effort",
|
|
429
|
-
"runtime_status",
|
|
430
|
-
"activity",
|
|
431
|
-
"health",
|
|
432
|
-
"session_name",
|
|
433
|
-
"tmux_command",
|
|
434
|
-
] {
|
|
435
|
-
assert!(node.get(key).is_some(), "missing JSON field {key}");
|
|
436
|
-
}
|
|
437
|
-
let name = node["name"].as_str().unwrap();
|
|
438
|
-
let index = name.strip_prefix("worker-").unwrap().parse::<u32>().unwrap();
|
|
439
|
-
let pane = index + 20;
|
|
440
|
-
assert_eq!(node["provider"], "pi");
|
|
441
|
-
assert_eq!(node["model"], format!("gpt-5.6-luna-{index}"));
|
|
442
|
-
assert_eq!(node["effort"], if index % 2 == 0 { "high" } else { "max" });
|
|
443
|
-
assert_eq!(node["runtime_status"], "running");
|
|
444
|
-
assert_eq!(node["activity"], "idle");
|
|
445
|
-
assert_eq!(node["health"], "normal");
|
|
446
|
-
assert_eq!(node["session_name"], format!("native-{name}"));
|
|
447
|
-
let target = format!("{session}:{name}.%{pane}");
|
|
448
|
-
assert_eq!(
|
|
449
|
-
node["tmux_command"],
|
|
450
|
-
json!(format!(
|
|
451
|
-
"tmux -S {} attach -t {}",
|
|
452
|
-
shell_quote_for_status_test(endpoint),
|
|
453
|
-
shell_quote_for_status_test(&target)
|
|
454
|
-
))
|
|
455
|
-
);
|
|
456
|
-
}
|
|
457
|
-
let before = nodes
|
|
458
|
-
.iter()
|
|
459
|
-
.map(legacy_human_node)
|
|
460
|
-
.collect::<Vec<_>>()
|
|
461
|
-
.join("\n");
|
|
462
|
-
let human = status_port::with_test_nodeprobe(bin, || {
|
|
463
|
-
human_text(cmd_status(&status_args(&ws, false, None, None)).expect("human status"))
|
|
464
|
-
});
|
|
465
|
-
let prefix = format!("tmux -S {}", shell_quote_for_status_test(endpoint));
|
|
466
|
-
let prefix_count = human.matches(&prefix).count();
|
|
467
|
-
let labels_once = status_table_header(&human).is_some();
|
|
468
|
-
let targets_once = nodes.iter().all(|node| {
|
|
469
|
-
let name = node["name"].as_str().unwrap();
|
|
470
|
-
let index = name.strip_prefix("worker-").unwrap().parse::<u32>().unwrap();
|
|
471
|
-
let pane = index + 20;
|
|
472
|
-
let target = format!("{name}.%{pane}");
|
|
473
|
-
let rows = human.lines().filter(|line| line.contains(&target)).collect::<Vec<_>>();
|
|
474
|
-
rows.len() == 1 && rows[0].contains("1:")
|
|
475
|
-
});
|
|
476
|
-
let calls = logged_probe_calls(&log);
|
|
477
|
-
assert_eq!(calls.len(), 2, "one native query per status invocation: {calls:?}");
|
|
478
|
-
assert!(
|
|
479
|
-
calls.iter().all(|(flag, called)| flag == "-S" && called == endpoint),
|
|
480
|
-
"{calls:?}"
|
|
481
|
-
);
|
|
482
|
-
assert!(
|
|
483
|
-
prefix_count == 1 && labels_once && targets_once && human.len() * 4 < before.len() * 3,
|
|
484
|
-
"six-node human output must dedupe shared text and retain targets; prefix_count={prefix_count}, labels_once={labels_once}, targets_once={targets_once}, before_bytes={}, after_bytes={}\n{human}",
|
|
485
|
-
before.len(),
|
|
486
|
-
human.len()
|
|
487
|
-
);
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
#[cfg(unix)]
|
|
491
|
-
#[test]
|
|
492
|
-
#[serial(status_brief)]
|
|
493
|
-
fn issue271_status_human_groups_socket_session_pairs_without_cross_routing() {
|
|
494
|
-
let ws = guarded_brief_workspace("issue271-groups");
|
|
495
|
-
let endpoint_a = "/tmp/271 socket 'α.sock";
|
|
496
|
-
let endpoint_b = "shared named socket";
|
|
497
|
-
let session_red = "red team α";
|
|
498
|
-
let session_blue = "blue's team";
|
|
499
|
-
let specs = [
|
|
500
|
-
("a-red", endpoint_a, session_red, "%31", 1),
|
|
501
|
-
("b-red", endpoint_a, session_red, "%32", 1),
|
|
502
|
-
("c-other", endpoint_a, session_blue, "%33", 2),
|
|
503
|
-
("d-named", endpoint_b, session_red, "%34", 3),
|
|
504
|
-
("e-named", endpoint_b, session_red, "%35", 3),
|
|
505
|
-
];
|
|
506
|
-
let mut agents = serde_json::Map::new();
|
|
507
|
-
let mut rows_a = Vec::new();
|
|
508
|
-
let mut rows_b = Vec::new();
|
|
509
|
-
for &(name, endpoint, session, pane, _) in &specs {
|
|
510
|
-
agents.insert(
|
|
511
|
-
name.to_string(),
|
|
512
|
-
status_agent(name, pane, endpoint, session, "model", "high"),
|
|
513
|
-
);
|
|
514
|
-
let row = (
|
|
515
|
-
session.to_string(),
|
|
516
|
-
name.to_string(),
|
|
517
|
-
pane.to_string(),
|
|
518
|
-
format!("native-{name}"),
|
|
519
|
-
);
|
|
520
|
-
if endpoint == endpoint_a {
|
|
521
|
-
rows_a.push(row);
|
|
522
|
-
} else {
|
|
523
|
-
rows_b.push(row);
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
write_state(
|
|
527
|
-
&ws,
|
|
528
|
-
&json!({
|
|
529
|
-
"session_name": session_red,
|
|
530
|
-
"tmux_endpoint": endpoint_a,
|
|
531
|
-
"active_team_key": "demo",
|
|
532
|
-
"agents": agents
|
|
533
|
-
}),
|
|
534
|
-
);
|
|
535
|
-
let reports = [
|
|
536
|
-
(
|
|
537
|
-
endpoint_a.to_string(),
|
|
538
|
-
producer_report_nodes(endpoint_a, &rows_a),
|
|
539
|
-
),
|
|
540
|
-
(
|
|
541
|
-
endpoint_b.to_string(),
|
|
542
|
-
producer_report_nodes(endpoint_b, &rows_b),
|
|
543
|
-
),
|
|
544
|
-
];
|
|
545
|
-
let (bin, log) = write_nodeprobe_reports(&ws.join("probe"), &reports);
|
|
546
|
-
let nodes = status_port::with_test_nodeprobe(bin.clone(), || {
|
|
547
|
-
json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("JSON status"))
|
|
548
|
-
});
|
|
549
|
-
assert_eq!(nodes.len(), specs.len());
|
|
550
|
-
for node in &nodes {
|
|
551
|
-
let name = node["name"].as_str().unwrap();
|
|
552
|
-
let (_, endpoint, session, pane, _) =
|
|
553
|
-
*specs.iter().find(|spec| spec.0 == name).unwrap();
|
|
554
|
-
let target = format!("{session}:{name}.{pane}");
|
|
555
|
-
assert_eq!(
|
|
556
|
-
node["tmux_command"],
|
|
557
|
-
json!(format!(
|
|
558
|
-
"tmux {} {} attach -t {}",
|
|
559
|
-
if Path::new(endpoint).is_absolute() { "-S" } else { "-L" },
|
|
560
|
-
shell_quote_for_status_test(endpoint),
|
|
561
|
-
shell_quote_for_status_test(&target)
|
|
562
|
-
))
|
|
563
|
-
);
|
|
564
|
-
}
|
|
565
|
-
let human = status_port::with_test_nodeprobe(bin, || {
|
|
566
|
-
human_text(cmd_status(&status_args(&ws, false, None, None)).expect("human status"))
|
|
567
|
-
});
|
|
568
|
-
let abs_prefix = format!("tmux -S {}", shell_quote_for_status_test(endpoint_a));
|
|
569
|
-
let named_prefix = format!("tmux -L {}", shell_quote_for_status_test(endpoint_b));
|
|
570
|
-
let calls = logged_probe_calls(&log);
|
|
571
|
-
assert_eq!(calls.len(), 4, "one probe per endpoint per invocation: {calls:?}");
|
|
572
|
-
assert_eq!(calls.iter().filter(|(_, value)| value == endpoint_a).count(), 2);
|
|
573
|
-
assert_eq!(calls.iter().filter(|(_, value)| value == endpoint_b).count(), 2);
|
|
574
|
-
assert!(calls.iter().all(|(flag, value)| {
|
|
575
|
-
(value == endpoint_a && flag == "-S") || (value == endpoint_b && flag == "-L")
|
|
576
|
-
}));
|
|
577
|
-
let expected_groups = [
|
|
578
|
-
("a-red", "%31", 1),
|
|
579
|
-
("b-red", "%32", 1),
|
|
580
|
-
("c-other", "%33", 2),
|
|
581
|
-
("d-named", "%34", 3),
|
|
582
|
-
("e-named", "%35", 3),
|
|
583
|
-
];
|
|
584
|
-
let rows_routed = expected_groups.iter().all(|(name, pane, group)| {
|
|
585
|
-
let target = format!("{name}.{pane}");
|
|
586
|
-
let matching = human
|
|
587
|
-
.lines()
|
|
588
|
-
.filter(|line| line.contains(&target))
|
|
589
|
-
.collect::<Vec<_>>();
|
|
590
|
-
matching.len() == 1 && matching[0].contains(&format!("{group}:"))
|
|
591
|
-
});
|
|
592
|
-
assert!(
|
|
593
|
-
human.matches(&abs_prefix).count() == 2
|
|
594
|
-
&& human.matches(&named_prefix).count() == 1
|
|
595
|
-
&& human.matches(session_red).count() == 2
|
|
596
|
-
&& human.matches("blue").count() == 1
|
|
597
|
-
&& rows_routed,
|
|
598
|
-
"each (endpoint, session) needs one stable group and its own targets; abs={}, named={}, red={}, blue={}, rows_routed={rows_routed}\n{human}",
|
|
599
|
-
human.matches(&abs_prefix).count(),
|
|
600
|
-
human.matches(&named_prefix).count(),
|
|
601
|
-
human.matches(session_red).count(),
|
|
602
|
-
human.matches("blue").count()
|
|
603
|
-
);
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
#[cfg(unix)]
|
|
607
|
-
#[test]
|
|
608
|
-
#[serial(status_brief)]
|
|
609
|
-
fn issue271_status_single_empty_unknown_and_stopped_compatibility() {
|
|
610
|
-
let endpoint = "/tmp/271-single.sock";
|
|
611
|
-
let single = guarded_brief_workspace("issue271-single");
|
|
612
|
-
write_state(
|
|
613
|
-
&single,
|
|
614
|
-
&json!({
|
|
615
|
-
"session_name": "team-single",
|
|
616
|
-
"tmux_endpoint": endpoint,
|
|
617
|
-
"agents": {
|
|
618
|
-
"solo": status_agent(
|
|
619
|
-
"solo",
|
|
620
|
-
"%7",
|
|
621
|
-
endpoint,
|
|
622
|
-
"team-single",
|
|
623
|
-
"gpt-5.6-luna-xhigh",
|
|
624
|
-
"high"
|
|
625
|
-
)
|
|
626
|
-
}
|
|
627
|
-
}),
|
|
628
|
-
);
|
|
629
|
-
let single_report = producer_report_nodes(
|
|
630
|
-
endpoint,
|
|
631
|
-
&[(
|
|
632
|
-
"team-single".to_string(),
|
|
633
|
-
"solo".to_string(),
|
|
634
|
-
"%7".to_string(),
|
|
635
|
-
"pi-native-solo".to_string(),
|
|
636
|
-
)],
|
|
637
|
-
);
|
|
638
|
-
let (single_bin, single_log) =
|
|
639
|
-
write_nodeprobe_reports(&single.join("probe"), &[(endpoint.to_string(), single_report)]);
|
|
640
|
-
let single_nodes = status_port::with_test_nodeprobe(single_bin.clone(), || {
|
|
641
|
-
json_nodes(cmd_status(&status_args(&single, true, None, None)).expect("single JSON"))
|
|
642
|
-
});
|
|
643
|
-
let single_human = status_port::with_test_nodeprobe(single_bin, || {
|
|
644
|
-
human_text(cmd_status(&status_args(&single, false, None, None)).expect("single human"))
|
|
645
|
-
});
|
|
646
|
-
assert_eq!(single_nodes.len(), 1);
|
|
647
|
-
assert_eq!(single_human, legacy_human_node(&single_nodes[0]));
|
|
648
|
-
assert_eq!(logged_probe_calls(&single_log).len(), 2);
|
|
649
|
-
let unknown_agent = cmd_status(&status_args(&single, false, Some("ghost"), None))
|
|
650
|
-
.unwrap_err()
|
|
651
|
-
.to_string();
|
|
652
|
-
assert!(unknown_agent.contains("unknown agent id: ghost"), "{unknown_agent}");
|
|
653
|
-
|
|
654
|
-
let empty = guarded_brief_workspace("issue271-empty");
|
|
655
|
-
write_state(&empty, &production_state(json!({})));
|
|
656
|
-
assert!(
|
|
657
|
-
human_text(cmd_status(&status_args(&empty, false, None, None)).expect("empty")).is_empty()
|
|
658
|
-
);
|
|
659
|
-
|
|
660
|
-
let mixed = guarded_brief_workspace("issue271-mixed");
|
|
661
|
-
let mut agents = serde_json::Map::new();
|
|
662
|
-
agents.insert(
|
|
663
|
-
"worker".to_string(),
|
|
664
|
-
status_agent("worker", "%7", endpoint, "team-mixed", "gpt-worker", "max"),
|
|
665
|
-
);
|
|
666
|
-
agents.insert(
|
|
667
|
-
"unknown".to_string(),
|
|
668
|
-
status_agent("unknown", "%8", endpoint, "team-mixed", "gpt-unknown", "high"),
|
|
669
|
-
);
|
|
670
|
-
let mut stopped = status_agent(
|
|
671
|
-
"stopped",
|
|
672
|
-
"%9",
|
|
673
|
-
endpoint,
|
|
674
|
-
"team-mixed",
|
|
675
|
-
"gpt-stopped",
|
|
676
|
-
"low",
|
|
677
|
-
);
|
|
678
|
-
stopped["status"] = json!("stopped");
|
|
679
|
-
agents.insert("stopped".to_string(), stopped);
|
|
680
|
-
write_state(
|
|
681
|
-
&mixed,
|
|
682
|
-
&json!({
|
|
683
|
-
"session_name": "team-mixed",
|
|
684
|
-
"tmux_endpoint": endpoint,
|
|
685
|
-
"agents": agents
|
|
686
|
-
}),
|
|
687
|
-
);
|
|
688
|
-
let mixed_report = producer_report_nodes(
|
|
689
|
-
endpoint,
|
|
690
|
-
&[(
|
|
691
|
-
"team-mixed".to_string(),
|
|
692
|
-
"worker".to_string(),
|
|
693
|
-
"%7".to_string(),
|
|
694
|
-
"pi-native-worker".to_string(),
|
|
695
|
-
)],
|
|
696
|
-
);
|
|
697
|
-
let (mixed_bin, mixed_log) =
|
|
698
|
-
write_nodeprobe_reports(&mixed.join("probe"), &[(endpoint.to_string(), mixed_report)]);
|
|
699
|
-
let mixed_nodes = status_port::with_test_nodeprobe(mixed_bin.clone(), || {
|
|
700
|
-
json_nodes(cmd_status(&status_args(&mixed, true, None, None)).expect("mixed JSON"))
|
|
701
|
-
});
|
|
702
|
-
let node = |name: &str| mixed_nodes.iter().find(|node| node["name"] == name).unwrap();
|
|
703
|
-
assert_eq!(node("worker")["runtime_status"], "running");
|
|
704
|
-
assert_eq!(node("worker")["session_name"], "pi-native-worker");
|
|
705
|
-
assert_eq!(node("unknown")["runtime_status"], "unknown");
|
|
706
|
-
assert_eq!(node("unknown")["model"], "gpt-unknown");
|
|
707
|
-
assert_eq!(node("unknown")["effort"], "high");
|
|
708
|
-
assert!(node("unknown")["tmux_command"].is_null());
|
|
709
|
-
assert!(node("unknown")["session_name"].is_null());
|
|
710
|
-
assert_eq!(node("stopped")["runtime_status"], "stopped");
|
|
711
|
-
assert_eq!(node("stopped")["model"], "gpt-stopped");
|
|
712
|
-
assert_eq!(node("stopped")["effort"], "low");
|
|
713
|
-
assert!(node("stopped")["tmux_command"].is_null());
|
|
714
|
-
let mixed_human = status_port::with_test_nodeprobe(mixed_bin.clone(), || {
|
|
715
|
-
human_text(cmd_status(&status_args(&mixed, false, None, None)).expect("mixed human"))
|
|
716
|
-
});
|
|
717
|
-
let agent_human = status_port::with_test_nodeprobe(mixed_bin, || {
|
|
718
|
-
human_text(
|
|
719
|
-
cmd_status(&status_args(&mixed, false, Some("worker"), None))
|
|
720
|
-
.expect("status AGENT"),
|
|
721
|
-
)
|
|
722
|
-
});
|
|
723
|
-
assert_eq!(agent_human, legacy_human_node(node("worker")));
|
|
724
|
-
let calls = logged_probe_calls(&mixed_log);
|
|
725
|
-
assert_eq!(calls.len(), 3, "one native query per status invocation");
|
|
726
|
-
assert!(
|
|
727
|
-
status_table_header(&mixed_human).is_some()
|
|
728
|
-
&& mixed_human
|
|
729
|
-
.matches(&format!("tmux -S {}", shell_quote_for_status_test(endpoint)))
|
|
730
|
-
.count()
|
|
731
|
-
== 1,
|
|
732
|
-
"mixed output must retain one shared header and only the observed worker target:\n{mixed_human}"
|
|
733
|
-
);
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
#[cfg(unix)]
|
|
737
|
-
#[test]
|
|
738
|
-
#[serial(status_brief)]
|
|
739
|
-
fn issue271_status_human_escapes_fields_and_quotes_shared_template() {
|
|
740
|
-
let ws = guarded_brief_workspace("issue271-escape");
|
|
741
|
-
let endpoint = "/tmp/271 space '雪.sock";
|
|
742
|
-
let session = "team '雪";
|
|
743
|
-
let window_a = "win '甲";
|
|
744
|
-
let window_b = "win β";
|
|
745
|
-
let mut agent_a = status_agent(
|
|
746
|
-
"node-a",
|
|
747
|
-
"%51",
|
|
748
|
-
endpoint,
|
|
749
|
-
session,
|
|
750
|
-
"gpt\tα\nmax",
|
|
751
|
-
"xhigh\nhigh",
|
|
752
|
-
);
|
|
753
|
-
agent_a["window"] = json!(window_a);
|
|
754
|
-
let mut agent_b = status_agent(
|
|
755
|
-
"node-b",
|
|
756
|
-
"%52",
|
|
757
|
-
endpoint,
|
|
758
|
-
session,
|
|
759
|
-
"grok\tβ\nxhigh",
|
|
760
|
-
"high\tmax\nlow",
|
|
761
|
-
);
|
|
762
|
-
agent_b["window"] = json!(window_b);
|
|
763
|
-
write_state(
|
|
764
|
-
&ws,
|
|
765
|
-
&json!({
|
|
766
|
-
"session_name": session,
|
|
767
|
-
"tmux_endpoint": endpoint,
|
|
768
|
-
"agents": {"node-a": agent_a, "node-b": agent_b}
|
|
769
|
-
}),
|
|
770
|
-
);
|
|
771
|
-
let report = producer_report_nodes(
|
|
772
|
-
endpoint,
|
|
773
|
-
&[
|
|
774
|
-
(
|
|
775
|
-
session.to_string(),
|
|
776
|
-
window_a.to_string(),
|
|
777
|
-
"%51".to_string(),
|
|
778
|
-
"pi\tα\nchannel".to_string(),
|
|
779
|
-
),
|
|
780
|
-
(
|
|
781
|
-
session.to_string(),
|
|
782
|
-
window_b.to_string(),
|
|
783
|
-
"%52".to_string(),
|
|
784
|
-
"pi β native".to_string(),
|
|
785
|
-
),
|
|
786
|
-
],
|
|
787
|
-
);
|
|
788
|
-
let (bin, log) = write_nodeprobe_reports(
|
|
789
|
-
&ws.join("probe"),
|
|
790
|
-
&[(endpoint.to_string(), report)],
|
|
791
|
-
);
|
|
792
|
-
let nodes = status_port::with_test_nodeprobe(bin.clone(), || {
|
|
793
|
-
json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("JSON status"))
|
|
794
|
-
});
|
|
795
|
-
let node_a = nodes.iter().find(|node| node["name"] == "node-a").unwrap();
|
|
796
|
-
assert_eq!(node_a["model"], "gpt\tα\nmax");
|
|
797
|
-
assert_eq!(node_a["effort"], "xhigh\nhigh");
|
|
798
|
-
assert_eq!(node_a["session_name"], "pi\tα\nchannel");
|
|
799
|
-
let target_a = format!("{session}:{window_a}.%51");
|
|
800
|
-
assert_eq!(
|
|
801
|
-
node_a["tmux_command"],
|
|
802
|
-
json!(format!(
|
|
803
|
-
"tmux -S {} attach -t {}",
|
|
804
|
-
shell_quote_for_status_test(endpoint),
|
|
805
|
-
shell_quote_for_status_test(&target_a)
|
|
806
|
-
))
|
|
807
|
-
);
|
|
808
|
-
let human = status_port::with_test_nodeprobe(bin, || {
|
|
809
|
-
human_text(cmd_status(&status_args(&ws, false, None, None)).expect("human status"))
|
|
810
|
-
});
|
|
811
|
-
let row_a = human
|
|
812
|
-
.lines()
|
|
813
|
-
.find(|line| line.contains("node-a"))
|
|
814
|
-
.unwrap_or("");
|
|
815
|
-
let row_b = human
|
|
816
|
-
.lines()
|
|
817
|
-
.find(|line| line.contains("node-b"))
|
|
818
|
-
.unwrap_or("");
|
|
819
|
-
let calls = logged_probe_calls(&log);
|
|
820
|
-
assert_eq!(calls.len(), 2, "one native query per status invocation");
|
|
821
|
-
assert!(
|
|
822
|
-
human
|
|
823
|
-
.matches(&format!("tmux -S {}", shell_quote_for_status_test(endpoint)))
|
|
824
|
-
.count()
|
|
825
|
-
== 1
|
|
826
|
-
&& row_a.contains("gpt\\tα\\nmax")
|
|
827
|
-
&& row_a.contains("xhigh\\nhigh")
|
|
828
|
-
&& row_a.contains("pi\\tα\\nchannel")
|
|
829
|
-
&& row_a.contains("win '甲")
|
|
830
|
-
&& row_a.contains("%51")
|
|
831
|
-
&& row_b.contains("grok\\tβ\\nxhigh")
|
|
832
|
-
&& row_b.contains("high\\tmax\\nlow")
|
|
833
|
-
&& row_a.matches("node-a").count() == 1
|
|
834
|
-
&& row_b.matches("node-b").count() == 1,
|
|
835
|
-
"human fields must be escaped without splitting node rows and the shared template must quote its context:\n{human}"
|
|
836
|
-
);
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
#[test]
|
|
840
|
-
#[serial(status_brief)]
|
|
841
|
-
fn cmd_status_is_readonly_on_legacy_and_multi_team_state() {
|
|
842
|
-
let ws = brief_workspace("readonly");
|
|
843
|
-
let legacy = json!({
|
|
844
|
-
"session_name": "sess",
|
|
845
|
-
"team_dir": format!("{}/.team/tk", ws.display()),
|
|
846
|
-
"agents": {
|
|
847
|
-
"w1": {
|
|
848
|
-
"agent_id": "w1",
|
|
849
|
-
"status": "running",
|
|
850
|
-
"provider": "pi"
|
|
851
|
-
}
|
|
852
|
-
},
|
|
853
|
-
"team_owner": {"pane_id": "%1", "machine_fingerprint": "fp"}
|
|
854
|
-
});
|
|
855
|
-
write_state(&ws, &legacy);
|
|
856
|
-
let before = snapshot_tree(&ws);
|
|
857
|
-
let result = cmd_status(&status_args(&ws, true, None, None)).expect("status");
|
|
858
|
-
let after = snapshot_tree(&ws);
|
|
859
|
-
assert_eq!(before, after, "status must not migrate or write runtime state");
|
|
860
|
-
assert_eq!(json_nodes(result).len(), 1);
|
|
861
|
-
let pid_path = crate::coordinator::coordinator_pid_path(&crate::coordinator::WorkspacePath::new(
|
|
862
|
-
ws.clone(),
|
|
863
|
-
));
|
|
864
|
-
assert!(!pid_path.exists(), "status must not spawn a coordinator");
|
|
865
|
-
|
|
866
|
-
let multi = brief_workspace("readonly-multi");
|
|
867
|
-
write_state(
|
|
868
|
-
&multi,
|
|
869
|
-
&json!({
|
|
870
|
-
"teams": {
|
|
871
|
-
"alpha": {"status": "alive", "agents": {"a": {"status": "running", "provider": "pi"}}},
|
|
872
|
-
"beta": {"status": "alive", "agents": {"b": {"status": "running", "provider": "pi"}}}
|
|
873
|
-
}
|
|
874
|
-
}),
|
|
875
|
-
);
|
|
876
|
-
let before_multi = snapshot_tree(&multi);
|
|
877
|
-
let err = cmd_status(&status_args(&multi, true, None, None)).unwrap_err();
|
|
878
|
-
assert!(
|
|
879
|
-
err.to_string().contains("multiple alive teams"),
|
|
880
|
-
"{err}"
|
|
881
|
-
);
|
|
882
|
-
assert_eq!(before_multi, snapshot_tree(&multi));
|
|
883
|
-
let chosen = cmd_status(&status_args(&multi, true, None, Some("alpha"))).expect("team");
|
|
884
|
-
assert_eq!(json_nodes(chosen).len(), 1);
|
|
885
|
-
assert_eq!(before_multi, snapshot_tree(&multi));
|
|
886
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
887
|
-
let _ = std::fs::remove_dir_all(&multi);
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
#[test]
|
|
891
|
-
#[serial(status_brief)]
|
|
892
|
-
fn cmd_status_human_and_json_fail_on_selector_errors() {
|
|
893
|
-
let multi = brief_workspace("ambiguous");
|
|
894
|
-
write_state(
|
|
895
|
-
&multi,
|
|
896
|
-
&json!({
|
|
897
|
-
"teams": {
|
|
898
|
-
"alpha": {"status": "alive", "agents": {"a": {"status": "running", "provider": "pi"}}},
|
|
899
|
-
"beta": {"status": "alive", "agents": {"b": {"status": "running", "provider": "pi"}}}
|
|
900
|
-
}
|
|
901
|
-
}),
|
|
902
|
-
);
|
|
903
|
-
for json_out in [false, true] {
|
|
904
|
-
let err = cmd_status(&status_args(&multi, json_out, None, None)).unwrap_err();
|
|
905
|
-
assert!(err.to_string().contains("multiple alive teams"), "{err}");
|
|
906
|
-
}
|
|
907
|
-
assert_ne!(status_run(&multi, &[]), ExitCode::Ok);
|
|
908
|
-
assert_ne!(status_run(&multi, &["--json"]), ExitCode::Ok);
|
|
909
|
-
|
|
910
|
-
let one = brief_workspace("one");
|
|
911
|
-
write_state(
|
|
912
|
-
&one,
|
|
913
|
-
&production_state(json!({ "worker": production_agent("worker", "%7") })),
|
|
914
|
-
);
|
|
915
|
-
for json_out in [false, true] {
|
|
916
|
-
let err = cmd_status(&status_args(&one, json_out, Some("ghost"), None)).unwrap_err();
|
|
917
|
-
assert!(err.to_string().contains("unknown agent id: ghost"), "{err}");
|
|
918
|
-
let err = cmd_status(&status_args(&one, json_out, None, Some("missing"))).unwrap_err();
|
|
919
|
-
assert!(
|
|
920
|
-
err.to_string().contains("not found") || err.to_string().contains("missing"),
|
|
921
|
-
"{err}"
|
|
922
|
-
);
|
|
923
|
-
}
|
|
924
|
-
assert_ne!(status_run(&one, &["ghost"]), ExitCode::Ok);
|
|
925
|
-
assert_ne!(status_run(&one, &["ghost", "--json"]), ExitCode::Ok);
|
|
926
|
-
|
|
927
|
-
let bad = brief_workspace("bad-state");
|
|
928
|
-
std::fs::write(
|
|
929
|
-
bad.join(".team").join("runtime").join("state.json"),
|
|
930
|
-
b"{not-json",
|
|
931
|
-
)
|
|
932
|
-
.unwrap();
|
|
933
|
-
for json_out in [false, true] {
|
|
934
|
-
assert!(cmd_status(&status_args(&bad, json_out, None, None)).is_err());
|
|
935
|
-
}
|
|
936
|
-
let before_bad = snapshot_tree(&bad);
|
|
937
|
-
assert_ne!(status_run(&bad, &[]), ExitCode::Ok);
|
|
938
|
-
assert_eq!(before_bad, snapshot_tree(&bad));
|
|
939
|
-
assert_ne!(status_run(&bad, &["--json"]), ExitCode::Ok);
|
|
940
|
-
assert_eq!(before_bad, snapshot_tree(&bad));
|
|
941
|
-
|
|
942
|
-
let missing = std::env::temp_dir()
|
|
943
|
-
.join(format!(
|
|
944
|
-
"ta-status-brief-absent-{}-{}",
|
|
945
|
-
std::process::id(),
|
|
946
|
-
std::time::SystemTime::now()
|
|
947
|
-
.duration_since(std::time::UNIX_EPOCH)
|
|
948
|
-
.unwrap()
|
|
949
|
-
.as_nanos()
|
|
950
|
-
))
|
|
951
|
-
.join("nested");
|
|
952
|
-
for json_out in [false, true] {
|
|
953
|
-
let err = cmd_status(&status_args(&missing, json_out, None, None)).unwrap_err();
|
|
954
|
-
assert!(
|
|
955
|
-
err.to_string().contains("invalid workspace"),
|
|
956
|
-
"{err}"
|
|
957
|
-
);
|
|
958
|
-
}
|
|
959
|
-
assert_ne!(status_run(&missing, &[]), ExitCode::Ok);
|
|
960
|
-
assert_ne!(status_run(&missing, &["--json"]), ExitCode::Ok);
|
|
961
|
-
assert!(!missing.exists(), "status errors must not create workspace paths");
|
|
962
|
-
|
|
963
|
-
let _ = std::fs::remove_dir_all(&multi);
|
|
964
|
-
let _ = std::fs::remove_dir_all(&one);
|
|
965
|
-
let _ = std::fs::remove_dir_all(&bad);
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
#[cfg(unix)]
|
|
969
|
-
#[test]
|
|
970
|
-
#[serial(status_brief)]
|
|
971
|
-
fn cmd_status_does_not_spawn_unbound_or_mismatched_nodeprobe() {
|
|
972
|
-
let cases = [
|
|
973
|
-
("missing-receipt", None, None),
|
|
974
|
-
("wrong-hash", Some(("binary_sha256", json!("0".repeat(64)))), None),
|
|
975
|
-
("wrong-source", Some(("source_commit", json!("0".repeat(40)))), None),
|
|
976
|
-
("wrong-target", Some(("target", json!("unknown-target"))), None),
|
|
977
|
-
(
|
|
978
|
-
"wrong-capability",
|
|
979
|
-
Some(("capabilities", json!(["tmux.capture-pane"]))),
|
|
980
|
-
None,
|
|
981
|
-
),
|
|
982
|
-
("replaced-binary", None, Some("replace")),
|
|
983
|
-
];
|
|
984
|
-
for (tag, mutation, replacement) in cases {
|
|
985
|
-
let ws = brief_workspace(tag);
|
|
986
|
-
write_state(
|
|
987
|
-
&ws,
|
|
988
|
-
&production_state(json!({ "worker": production_agent("worker", "%7") })),
|
|
989
|
-
);
|
|
990
|
-
let scratch = ws.join("probe");
|
|
991
|
-
let log = scratch.join("spawned.log");
|
|
992
|
-
let bin = write_nodeprobe(
|
|
993
|
-
&scratch,
|
|
994
|
-
&format!("printf spawned >> '{}'\n", log.display()),
|
|
995
|
-
);
|
|
996
|
-
let run = || {
|
|
997
|
-
let nodes = json_nodes(
|
|
998
|
-
cmd_status(&status_args(&ws, true, None, None)).expect("status"),
|
|
999
|
-
);
|
|
1000
|
-
assert_eq!(nodes[0]["runtime_status"], "unknown", "{tag}");
|
|
1001
|
-
assert!(!log.exists(), "{tag} must not spawn an unbound probe");
|
|
1002
|
-
};
|
|
1003
|
-
if mutation.is_none() && replacement.is_none() {
|
|
1004
|
-
status_port::with_test_nodeprobe_unbound(bin, run);
|
|
1005
|
-
} else {
|
|
1006
|
-
status_port::with_test_nodeprobe(bin.clone(), || {
|
|
1007
|
-
if let Some((field, value)) = mutation {
|
|
1008
|
-
let receipt = scratch.join("nodeprobe.capability.json");
|
|
1009
|
-
let mut body: Value = serde_json::from_slice(
|
|
1010
|
-
&std::fs::read(&receipt).unwrap(),
|
|
1011
|
-
)
|
|
1012
|
-
.unwrap();
|
|
1013
|
-
body[field] = value;
|
|
1014
|
-
std::fs::write(&receipt, serde_json::to_vec(&body).unwrap()).unwrap();
|
|
1015
|
-
}
|
|
1016
|
-
if replacement.is_some() {
|
|
1017
|
-
use std::io::Write;
|
|
1018
|
-
std::fs::OpenOptions::new()
|
|
1019
|
-
.append(true)
|
|
1020
|
-
.open(&bin)
|
|
1021
|
-
.unwrap()
|
|
1022
|
-
.write_all(b"# replaced\n")
|
|
1023
|
-
.unwrap();
|
|
1024
|
-
}
|
|
1025
|
-
run();
|
|
1026
|
-
});
|
|
1027
|
-
}
|
|
1028
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
#[cfg(unix)]
|
|
1033
|
-
#[test]
|
|
1034
|
-
#[serial(status_brief)]
|
|
1035
|
-
fn cmd_status_resolver_rejects_fifo_and_oversized_receipts_without_spawn() {
|
|
1036
|
-
let cases = ["fifo-receipt", "oversized-receipt"];
|
|
1037
|
-
for tag in cases {
|
|
1038
|
-
let ws = brief_workspace(tag);
|
|
1039
|
-
write_state(
|
|
1040
|
-
&ws,
|
|
1041
|
-
&production_state(json!({ "worker": production_agent("worker", "%7") })),
|
|
1042
|
-
);
|
|
1043
|
-
let scratch = ws.join("probe");
|
|
1044
|
-
let log = scratch.join("spawned.log");
|
|
1045
|
-
let bin = write_nodeprobe(
|
|
1046
|
-
&scratch.join("candidate"),
|
|
1047
|
-
&format!("printf spawned >> '{}'\n", log.display()),
|
|
1048
|
-
);
|
|
1049
|
-
let started = Instant::now();
|
|
1050
|
-
status_port::with_test_nodeprobe(bin.clone(), || {
|
|
1051
|
-
let receipt = scratch.join("candidate/nodeprobe.capability.json");
|
|
1052
|
-
if tag == "fifo-receipt" {
|
|
1053
|
-
std::fs::remove_file(&receipt).unwrap();
|
|
1054
|
-
make_fifo(&receipt);
|
|
1055
|
-
} else {
|
|
1056
|
-
std::fs::write(&receipt, vec![b'x'; 65 * 1024]).unwrap();
|
|
1057
|
-
}
|
|
1058
|
-
let nodes = json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("status"));
|
|
1059
|
-
assert_eq!(nodes[0]["runtime_status"], "unknown", "{tag}");
|
|
1060
|
-
});
|
|
1061
|
-
assert!(!log.exists(), "{tag} must not spawn the candidate");
|
|
1062
|
-
assert!(
|
|
1063
|
-
started.elapsed() < Duration::from_secs(1),
|
|
1064
|
-
"{tag} resolver exceeded bounded wall clock: {:?}",
|
|
1065
|
-
started.elapsed()
|
|
1066
|
-
);
|
|
1067
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
let ws = brief_workspace("lazy-candidate");
|
|
1071
|
-
write_state(
|
|
1072
|
-
&ws,
|
|
1073
|
-
&production_state(json!({ "worker": production_agent("worker", "%7") })),
|
|
1074
|
-
);
|
|
1075
|
-
let scratch = ws.join("probe");
|
|
1076
|
-
let first_log = scratch.join("first.log");
|
|
1077
|
-
let second_log = scratch.join("second.log");
|
|
1078
|
-
let first = write_nodeprobe(
|
|
1079
|
-
&scratch.join("first"),
|
|
1080
|
-
&format!("printf first >> '{}'\n", first_log.display()),
|
|
1081
|
-
);
|
|
1082
|
-
let second = write_nodeprobe(
|
|
1083
|
-
&scratch.join("second"),
|
|
1084
|
-
&format!("printf second >> '{}'\n", second_log.display()),
|
|
1085
|
-
);
|
|
1086
|
-
let started = Instant::now();
|
|
1087
|
-
status_port::with_test_nodeprobe_candidates(vec![first, second.clone()], || {
|
|
1088
|
-
let second_receipt = scratch.join("second/nodeprobe.capability.json");
|
|
1089
|
-
std::fs::remove_file(&second_receipt).unwrap();
|
|
1090
|
-
make_fifo(&second_receipt);
|
|
1091
|
-
let nodes = json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("status"));
|
|
1092
|
-
assert_eq!(nodes[0]["runtime_status"], "unknown");
|
|
1093
|
-
});
|
|
1094
|
-
assert!(first_log.exists(), "valid first candidate must be spawned");
|
|
1095
|
-
assert!(!second_log.exists(), "later blocking candidate must not be scanned");
|
|
1096
|
-
assert!(
|
|
1097
|
-
started.elapsed() < Duration::from_secs(1),
|
|
1098
|
-
"lazy resolver exceeded bounded wall clock: {:?}",
|
|
1099
|
-
started.elapsed()
|
|
1100
|
-
);
|
|
1101
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
#[cfg(unix)]
|
|
1105
|
-
#[test]
|
|
1106
|
-
#[serial(status_brief)]
|
|
1107
|
-
fn cmd_status_resolver_late_result_cannot_spawn_after_deadline() {
|
|
1108
|
-
let ws = brief_workspace("resolver-late-result");
|
|
1109
|
-
write_state(
|
|
1110
|
-
&ws,
|
|
1111
|
-
&production_state(json!({ "worker": production_agent("worker", "%7") })),
|
|
1112
|
-
);
|
|
1113
|
-
let scratch = ws.join("probe");
|
|
1114
|
-
let log = scratch.join("spawned.log");
|
|
1115
|
-
let bin = write_nodeprobe(
|
|
1116
|
-
&scratch,
|
|
1117
|
-
&format!("printf spawned >> '{}'\n", log.display()),
|
|
1118
|
-
);
|
|
1119
|
-
status_port::with_test_nodeprobe(bin, || {
|
|
1120
|
-
let caller_started = Instant::now();
|
|
1121
|
-
let signal = status_port::with_test_nodeprobe_resolver_delay(
|
|
1122
|
-
Duration::from_millis(2500),
|
|
1123
|
-
|signal| {
|
|
1124
|
-
let result = cmd_status(&status_args(&ws, true, None, None)).expect("status");
|
|
1125
|
-
let caller_elapsed = caller_started.elapsed();
|
|
1126
|
-
assert!(
|
|
1127
|
-
caller_elapsed < Duration::from_millis(2400),
|
|
1128
|
-
"resolver delay blocked status caller: {:?}",
|
|
1129
|
-
caller_elapsed
|
|
1130
|
-
);
|
|
1131
|
-
let nodes = json_nodes(result);
|
|
1132
|
-
assert_eq!(nodes[0]["runtime_status"], "unknown");
|
|
1133
|
-
signal.clone()
|
|
1134
|
-
},
|
|
1135
|
-
);
|
|
1136
|
-
let entered_deadline = Instant::now() + Duration::from_secs(1);
|
|
1137
|
-
while !signal.entered() && Instant::now() < entered_deadline {
|
|
1138
|
-
std::thread::yield_now();
|
|
1139
|
-
}
|
|
1140
|
-
assert!(signal.entered(), "resolver delay seam was not entered");
|
|
1141
|
-
let finished_deadline = Instant::now() + Duration::from_secs(3);
|
|
1142
|
-
while !signal.finished() && Instant::now() < finished_deadline {
|
|
1143
|
-
std::thread::yield_now();
|
|
1144
|
-
}
|
|
1145
|
-
assert!(signal.finished(), "resolver worker did not release the gate");
|
|
1146
|
-
assert!(!log.exists(), "late resolver result must not spawn probe");
|
|
1147
|
-
|
|
1148
|
-
let nodes = json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("status"));
|
|
1149
|
-
assert_eq!(nodes[0]["runtime_status"], "unknown");
|
|
1150
|
-
assert!(
|
|
1151
|
-
log.exists(),
|
|
1152
|
-
"one normal selection must prove resolver gate release"
|
|
1153
|
-
);
|
|
1154
|
-
});
|
|
1155
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
#[cfg(unix)]
|
|
1159
|
-
#[test]
|
|
1160
|
-
#[serial(status_brief)]
|
|
1161
|
-
fn cmd_status_rejects_producer_error_and_wrong_socket_as_unknown() {
|
|
1162
|
-
let cases = [
|
|
1163
|
-
(
|
|
1164
|
-
"exit0-error-nodes",
|
|
1165
|
-
0,
|
|
1166
|
-
r#"{"schema_version":1,"socket":"/tmp/ta-status-brief.sock","sampled_at":"2026-01-01T00:00:00Z","nodes":[{"socket":"/tmp/ta-status-brief.sock","session":"team-demo","window_name":"worker","pane_id":"%7","provider":"pi","activity":"idle","health":"normal","evidence":{"method":"pi_activity_channel"}}],"error":{"kind":"corpus_error","message":"providers corpus failed"}}"#,
|
|
1167
|
-
),
|
|
1168
|
-
(
|
|
1169
|
-
"exit1-error-empty",
|
|
1170
|
-
1,
|
|
1171
|
-
r#"{"schema_version":1,"socket":"/tmp/ta-status-brief.sock","sampled_at":"2026-01-01T00:00:00Z","nodes":[],"error":{"kind":"tmux_inventory","message":"missing"}}"#,
|
|
1172
|
-
),
|
|
1173
|
-
(
|
|
1174
|
-
"exit1-valid",
|
|
1175
|
-
1,
|
|
1176
|
-
r#"{"schema_version":1,"socket":"/tmp/ta-status-brief.sock","sampled_at":"2026-01-01T00:00:00Z","nodes":[{"socket":"/tmp/ta-status-brief.sock","session":"team-demo","window_name":"worker","pane_id":"%7","provider":"pi","activity":"idle","health":"normal","evidence":{"method":"pi_activity_channel"}}]}"#,
|
|
1177
|
-
),
|
|
1178
|
-
(
|
|
1179
|
-
"wrong-socket",
|
|
1180
|
-
0,
|
|
1181
|
-
r#"{"schema_version":1,"socket":"/tmp/other.sock","sampled_at":"2026-01-01T00:00:00Z","nodes":[{"socket":"/tmp/other.sock","session":"team-demo","window_name":"worker","pane_id":"%7","provider":"pi","activity":"idle","health":"normal","evidence":{"method":"pi_activity_channel"}}]}"#,
|
|
1182
|
-
),
|
|
1183
|
-
];
|
|
1184
|
-
for (tag, code, payload) in cases {
|
|
1185
|
-
let ws = brief_workspace(tag);
|
|
1186
|
-
write_state(
|
|
1187
|
-
&ws,
|
|
1188
|
-
&production_state(json!({ "worker": production_agent("worker", "%7") })),
|
|
1189
|
-
);
|
|
1190
|
-
let scratch = ws.join("probe");
|
|
1191
|
-
let bin = write_nodeprobe(
|
|
1192
|
-
&scratch,
|
|
1193
|
-
&format!("cat <<'EOF'\n{payload}\nEOF\nexit {code}\n"),
|
|
1194
|
-
);
|
|
1195
|
-
let nodes = status_port::with_test_nodeprobe(bin, || {
|
|
1196
|
-
json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("status"))
|
|
1197
|
-
});
|
|
1198
|
-
assert_eq!(nodes[0]["runtime_status"], "unknown", "{tag}");
|
|
1199
|
-
assert_eq!(nodes[0]["activity"], "unknown", "{tag}");
|
|
1200
|
-
assert!(nodes[0]["tmux_command"].is_null(), "{tag}");
|
|
1201
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
#[cfg(unix)]
|
|
1206
|
-
#[test]
|
|
1207
|
-
#[serial(status_brief)]
|
|
1208
|
-
fn cmd_status_zero_match_and_stopped_conflict_stay_unknown() {
|
|
1209
|
-
let ws = brief_workspace("zero-match");
|
|
1210
|
-
write_state(
|
|
1211
|
-
&ws,
|
|
1212
|
-
&production_state(json!({ "worker": production_agent("worker", "%7") })),
|
|
1213
|
-
);
|
|
1214
|
-
let miss = producer_report("/tmp/ta-status-brief.sock", "worker", "%9", "pi_activity_channel");
|
|
1215
|
-
let bin = write_nodeprobe(&ws.join("probe"), &format!("cat <<'EOF'\n{miss}\nEOF\n"));
|
|
1216
|
-
let nodes = status_port::with_test_nodeprobe(bin, || {
|
|
1217
|
-
json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("status"))
|
|
1218
|
-
});
|
|
1219
|
-
assert_eq!(nodes[0]["runtime_status"], "unknown");
|
|
1220
|
-
|
|
1221
|
-
let conflict = brief_workspace("stopped-live");
|
|
1222
|
-
let mut agent = production_agent("worker", "%7");
|
|
1223
|
-
agent["status"] = json!("stopped");
|
|
1224
|
-
write_state(&conflict, &production_state(json!({ "worker": agent })));
|
|
1225
|
-
let live = producer_report(
|
|
1226
|
-
"/tmp/ta-status-brief.sock",
|
|
1227
|
-
"worker",
|
|
1228
|
-
"%7",
|
|
1229
|
-
"pi_activity_channel",
|
|
1230
|
-
);
|
|
1231
|
-
let bin = write_nodeprobe(&conflict.join("probe"), &format!("cat <<'EOF'\n{live}\nEOF\n"));
|
|
1232
|
-
let nodes = status_port::with_test_nodeprobe(bin, || {
|
|
1233
|
-
json_nodes(cmd_status(&status_args(&conflict, true, None, None)).expect("status"))
|
|
1234
|
-
});
|
|
1235
|
-
assert_eq!(nodes[0]["runtime_status"], "unknown");
|
|
1236
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
1237
|
-
let _ = std::fs::remove_dir_all(&conflict);
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
#[cfg(unix)]
|
|
1241
|
-
#[test]
|
|
1242
|
-
#[serial(status_brief)]
|
|
1243
|
-
fn cmd_status_shared_deadline_reaps_inherited_stdout_child() {
|
|
1244
|
-
let ws = brief_workspace("hang");
|
|
1245
|
-
write_state(
|
|
1246
|
-
&ws,
|
|
1247
|
-
&production_state(json!({ "worker": production_agent("worker", "%7") })),
|
|
1248
|
-
);
|
|
1249
|
-
let pid_file = ws.join("probe").join("child.pid");
|
|
1250
|
-
let bin = write_nodeprobe(
|
|
1251
|
-
&ws.join("probe"),
|
|
1252
|
-
&format!(
|
|
1253
|
-
"/bin/sleep 12 &\nprintf '%s\\n' \"$!\" > '{}'\nexit 0\n",
|
|
1254
|
-
pid_file.display()
|
|
1255
|
-
),
|
|
1256
|
-
);
|
|
1257
|
-
let started = Instant::now();
|
|
1258
|
-
let nodes = status_port::with_test_nodeprobe(bin, || {
|
|
1259
|
-
json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("status"))
|
|
1260
|
-
});
|
|
1261
|
-
let elapsed = started.elapsed();
|
|
1262
|
-
assert_eq!(nodes[0]["runtime_status"], "unknown");
|
|
1263
|
-
assert!(
|
|
1264
|
-
elapsed < Duration::from_secs(3),
|
|
1265
|
-
"shared deadline exceeded: {elapsed:?}"
|
|
1266
|
-
);
|
|
1267
|
-
let pid: u32 = std::fs::read_to_string(&pid_file)
|
|
1268
|
-
.unwrap()
|
|
1269
|
-
.trim()
|
|
1270
|
-
.parse()
|
|
1271
|
-
.unwrap();
|
|
1272
|
-
let deadline = Instant::now() + Duration::from_millis(200);
|
|
1273
|
-
while Instant::now() < deadline && pid_alive(pid) {
|
|
1274
|
-
std::thread::sleep(Duration::from_millis(10));
|
|
1275
|
-
}
|
|
1276
|
-
assert!(!pid_alive(pid), "inherited stdout child {pid} was not reaped");
|
|
1277
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
#[cfg(unix)]
|
|
1281
|
-
#[test]
|
|
1282
|
-
#[serial(status_brief)]
|
|
1283
|
-
fn cmd_status_multi_endpoint_uses_total_budget() {
|
|
1284
|
-
let ws = brief_workspace("budget");
|
|
1285
|
-
let mut beta = production_agent("beta", "%8");
|
|
1286
|
-
beta["tmux_endpoint"] = json!("/tmp/ta-status-brief-b.sock");
|
|
1287
|
-
write_state(
|
|
1288
|
-
&ws,
|
|
1289
|
-
&json!({
|
|
1290
|
-
"session_name": "team-demo",
|
|
1291
|
-
"tmux_endpoint": "/tmp/ta-status-brief.sock",
|
|
1292
|
-
"agents": {
|
|
1293
|
-
"alpha": production_agent("alpha", "%7"),
|
|
1294
|
-
"beta": beta
|
|
1295
|
-
}
|
|
1296
|
-
}),
|
|
1297
|
-
);
|
|
1298
|
-
let bin = write_nodeprobe(&ws.join("probe"), "/bin/sleep 5\nexit 0\n");
|
|
1299
|
-
let started = Instant::now();
|
|
1300
|
-
let nodes = status_port::with_test_nodeprobe(bin, || {
|
|
1301
|
-
json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("status"))
|
|
1302
|
-
});
|
|
1303
|
-
let elapsed = started.elapsed();
|
|
1304
|
-
assert_eq!(nodes.len(), 2);
|
|
1305
|
-
assert!(
|
|
1306
|
-
elapsed < Duration::from_secs(3),
|
|
1307
|
-
"total probe budget exceeded: {elapsed:?}"
|
|
1308
|
-
);
|
|
1309
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
#[cfg(unix)]
|
|
1313
|
-
#[test]
|
|
1314
|
-
#[serial(status_brief)]
|
|
1315
|
-
fn cmd_status_uses_canonical_roster_and_filters_same_team_retired_tombstones() {
|
|
1316
|
-
let ws = brief_workspace("canonical-roster");
|
|
1317
|
-
let mut stale = serde_json::Map::new();
|
|
1318
|
-
for index in 0..220 {
|
|
1319
|
-
stale.insert(
|
|
1320
|
-
format!("stale-{index}"),
|
|
1321
|
-
production_agent(&format!("stale-{index}"), &format!("%{index}")),
|
|
1322
|
-
);
|
|
1323
|
-
}
|
|
1324
|
-
let mut stopped = production_agent("stopped", "%9");
|
|
1325
|
-
stopped["status"] = json!("stopped");
|
|
1326
|
-
let state = json!({
|
|
1327
|
-
"session_name": "team-demo",
|
|
1328
|
-
"tmux_endpoint": "/tmp/ta-status-brief.sock",
|
|
1329
|
-
"tmux_socket": "/tmp/ta-status-brief.sock",
|
|
1330
|
-
"active_team_key": "demo",
|
|
1331
|
-
"agents": stale,
|
|
1332
|
-
"teams": {
|
|
1333
|
-
"demo": {
|
|
1334
|
-
"status": "alive",
|
|
1335
|
-
"session_name": "team-demo",
|
|
1336
|
-
"tmux_endpoint": "/tmp/ta-status-brief.sock",
|
|
1337
|
-
"agents": {
|
|
1338
|
-
"live": production_agent("live", "%7"),
|
|
1339
|
-
"retired": production_agent("retired", "%8"),
|
|
1340
|
-
"stopped": stopped
|
|
1341
|
-
},
|
|
1342
|
-
"agent_lifecycle": {
|
|
1343
|
-
"retired": {"state": "retired"}
|
|
1344
|
-
}
|
|
1345
|
-
},
|
|
1346
|
-
"sibling": {
|
|
1347
|
-
"status": "alive",
|
|
1348
|
-
"agent_lifecycle": {"live": {"state": "retired"}}
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
});
|
|
1352
|
-
write_state(&ws, &state);
|
|
1353
|
-
let bin = write_nodeprobe(
|
|
1354
|
-
&ws.join("probe"),
|
|
1355
|
-
"printf '%s\\n' '{\"schema_version\":1,\"socket\":\"/tmp/ta-status-brief.sock\",\"nodes\":[]}'\n",
|
|
1356
|
-
);
|
|
1357
|
-
let nodes = status_port::with_test_nodeprobe(bin, || {
|
|
1358
|
-
json_nodes(cmd_status(&status_args(&ws, true, None, Some("demo"))).expect("status"))
|
|
1359
|
-
});
|
|
1360
|
-
let mut names = nodes
|
|
1361
|
-
.iter()
|
|
1362
|
-
.filter_map(|node| node["name"].as_str())
|
|
1363
|
-
.collect::<Vec<_>>();
|
|
1364
|
-
names.sort_unstable();
|
|
1365
|
-
assert_eq!(names, vec!["live", "stopped"]);
|
|
1366
|
-
assert_eq!(
|
|
1367
|
-
nodes
|
|
1368
|
-
.iter()
|
|
1369
|
-
.find(|node| node["name"] == "stopped")
|
|
1370
|
-
.and_then(|node| node["runtime_status"].as_str()),
|
|
1371
|
-
Some("stopped")
|
|
1372
|
-
);
|
|
1373
|
-
let err = cmd_status(&status_args(&ws, true, Some("retired"), Some("demo"))).unwrap_err();
|
|
1374
|
-
assert!(err.to_string().contains("unknown agent id: retired"), "{err}");
|
|
1375
|
-
|
|
1376
|
-
let empty = brief_workspace("canonical-empty");
|
|
1377
|
-
write_state(
|
|
1378
|
-
&empty,
|
|
1379
|
-
&json!({
|
|
1380
|
-
"active_team_key": "demo",
|
|
1381
|
-
"agents": {"stale": production_agent("stale", "%1")},
|
|
1382
|
-
"teams": {
|
|
1383
|
-
"demo": {
|
|
1384
|
-
"status": "alive",
|
|
1385
|
-
"agents": {},
|
|
1386
|
-
"agent_lifecycle": {}
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
}),
|
|
1390
|
-
);
|
|
1391
|
-
assert!(json_nodes(cmd_status(&status_args(&empty, true, None, None)).expect("status")).is_empty());
|
|
1392
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
1393
|
-
let _ = std::fs::remove_dir_all(&empty);
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
#[cfg(unix)]
|
|
1397
|
-
#[test]
|
|
1398
|
-
#[serial(status_brief)]
|
|
1399
|
-
fn cmd_status_allows_only_missing_window_compatibility_match() {
|
|
1400
|
-
let ws = brief_workspace("missing-window");
|
|
1401
|
-
let mut agent = production_agent("worker", "%7");
|
|
1402
|
-
agent.as_object_mut().unwrap().remove("window");
|
|
1403
|
-
agent.as_object_mut().unwrap().remove("layout_window");
|
|
1404
|
-
agent
|
|
1405
|
-
.get_mut("display")
|
|
1406
|
-
.and_then(Value::as_object_mut)
|
|
1407
|
-
.unwrap()
|
|
1408
|
-
.remove("window");
|
|
1409
|
-
write_state(
|
|
1410
|
-
&ws,
|
|
1411
|
-
&production_state(json!({"worker": agent})),
|
|
1412
|
-
);
|
|
1413
|
-
let report = producer_report(
|
|
1414
|
-
"/tmp/ta-status-brief.sock",
|
|
1415
|
-
"observed-window",
|
|
1416
|
-
"%7",
|
|
1417
|
-
"pi_activity_channel",
|
|
1418
|
-
);
|
|
1419
|
-
let bin = write_nodeprobe(&ws.join("probe"), &format!("cat <<'EOF'\n{report}\nEOF\n"));
|
|
1420
|
-
let nodes = status_port::with_test_nodeprobe(bin, || {
|
|
1421
|
-
json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("status"))
|
|
1422
|
-
});
|
|
1423
|
-
assert_eq!(nodes[0]["runtime_status"], "running");
|
|
1424
|
-
assert_eq!(nodes[0]["activity"], "idle");
|
|
1425
|
-
assert_eq!(
|
|
1426
|
-
nodes[0]["tmux_command"],
|
|
1427
|
-
"tmux -S '/tmp/ta-status-brief.sock' attach -t 'team-demo:observed-window.%7'"
|
|
1428
|
-
);
|
|
1429
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
1430
|
-
|
|
1431
|
-
let conflict = brief_workspace("present-window-conflict");
|
|
1432
|
-
write_state(
|
|
1433
|
-
&conflict,
|
|
1434
|
-
&production_state(json!({"worker": production_agent("worker", "%7")})),
|
|
1435
|
-
);
|
|
1436
|
-
let report = producer_report(
|
|
1437
|
-
"/tmp/ta-status-brief.sock",
|
|
1438
|
-
"different-window",
|
|
1439
|
-
"%7",
|
|
1440
|
-
"pi_activity_channel",
|
|
1441
|
-
);
|
|
1442
|
-
let bin = write_nodeprobe(&conflict.join("probe"), &format!("cat <<'EOF'\n{report}\nEOF\n"));
|
|
1443
|
-
let nodes = status_port::with_test_nodeprobe(bin, || {
|
|
1444
|
-
json_nodes(cmd_status(&status_args(&conflict, true, None, None)).expect("status"))
|
|
1445
|
-
});
|
|
1446
|
-
assert_eq!(nodes[0]["runtime_status"], "unknown");
|
|
1447
|
-
assert!(nodes[0]["tmux_command"].is_null());
|
|
1448
|
-
let _ = std::fs::remove_dir_all(&conflict);
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
#[cfg(unix)]
|
|
1452
|
-
#[test]
|
|
1453
|
-
#[serial(status_brief)]
|
|
1454
|
-
fn cmd_status_accepts_envelope_bound_node_socket_but_rejects_explicit_mismatch() {
|
|
1455
|
-
let ws = brief_workspace("envelope-node-socket");
|
|
1456
|
-
write_state(
|
|
1457
|
-
&ws,
|
|
1458
|
-
&production_state(json!({"worker": production_agent("worker", "%7")})),
|
|
1459
|
-
);
|
|
1460
|
-
let mut report: Value =
|
|
1461
|
-
serde_json::from_str(&producer_report(
|
|
1462
|
-
"/tmp/ta-status-brief.sock",
|
|
1463
|
-
"worker",
|
|
1464
|
-
"%7",
|
|
1465
|
-
"pi_activity_channel",
|
|
1466
|
-
))
|
|
1467
|
-
.unwrap();
|
|
1468
|
-
report["nodes"][0].as_object_mut().unwrap().remove("socket");
|
|
1469
|
-
let report = serde_json::to_string(&report).unwrap();
|
|
1470
|
-
let bin = write_nodeprobe(&ws.join("probe"), &format!("cat <<'EOF'\n{report}\nEOF\n"));
|
|
1471
|
-
let nodes = status_port::with_test_nodeprobe(bin, || {
|
|
1472
|
-
json_nodes(cmd_status(&status_args(&ws, true, None, None)).expect("status"))
|
|
1473
|
-
});
|
|
1474
|
-
assert_eq!(nodes[0]["runtime_status"], "running");
|
|
1475
|
-
assert_eq!(nodes[0]["activity"], "idle");
|
|
1476
|
-
assert_eq!(nodes[0]["health"], "normal");
|
|
1477
|
-
assert_eq!(nodes[0]["session_name"], "pi-session");
|
|
1478
|
-
assert_eq!(
|
|
1479
|
-
nodes[0]["tmux_command"],
|
|
1480
|
-
"tmux -S '/tmp/ta-status-brief.sock' attach -t 'team-demo:worker.%7'"
|
|
1481
|
-
);
|
|
1482
|
-
let _ = std::fs::remove_dir_all(&ws);
|
|
1483
|
-
|
|
1484
|
-
let mismatch = brief_workspace("explicit-node-socket-mismatch");
|
|
1485
|
-
write_state(
|
|
1486
|
-
&mismatch,
|
|
1487
|
-
&production_state(json!({"worker": production_agent("worker", "%7")})),
|
|
1488
|
-
);
|
|
1489
|
-
let mut report: Value =
|
|
1490
|
-
serde_json::from_str(&producer_report(
|
|
1491
|
-
"/tmp/ta-status-brief.sock",
|
|
1492
|
-
"worker",
|
|
1493
|
-
"%7",
|
|
1494
|
-
"pi_activity_channel",
|
|
1495
|
-
))
|
|
1496
|
-
.unwrap();
|
|
1497
|
-
report["nodes"][0]["socket"] = json!("/tmp/other.sock");
|
|
1498
|
-
let report = serde_json::to_string(&report).unwrap();
|
|
1499
|
-
let bin = write_nodeprobe(
|
|
1500
|
-
&mismatch.join("probe"),
|
|
1501
|
-
&format!("cat <<'EOF'\n{report}\nEOF\n"),
|
|
1502
|
-
);
|
|
1503
|
-
let nodes = status_port::with_test_nodeprobe(bin, || {
|
|
1504
|
-
json_nodes(cmd_status(&status_args(&mismatch, true, None, None)).expect("status"))
|
|
1505
|
-
});
|
|
1506
|
-
assert_eq!(nodes[0]["runtime_status"], "unknown");
|
|
1507
|
-
assert!(nodes[0]["tmux_command"].is_null());
|
|
1508
|
-
let _ = std::fs::remove_dir_all(&mismatch);
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
|
-
#[cfg(unix)]
|
|
1512
|
-
fn pid_alive(pid: u32) -> bool {
|
|
1513
|
-
unsafe { libc::kill(pid as i32, 0) == 0 }
|
|
1514
|
-
}
|