diff --git a/.doc/ops/CURRENT.md b/.doc/ops/CURRENT.md index c8b281f2..d4fff13b 100644 --- a/.doc/ops/CURRENT.md +++ b/.doc/ops/CURRENT.md @@ -18,6 +18,7 @@ | owner | task | branch | worktree | mutex | status | |---|---|---|---|---|---| +| Cursor | agentctl-mgmt-go-live-2026-09-23 | feature/agentctl-mgmt-go-live-2026-09-23 | .worktrees/agentctl-mgmt-go-live-2026-09-23 | agentctl-mgmt-go-live | in_progress | | Cursor | w3-u6-current-fix-2026-09-23 | feature/w3-u6-current-fix-2026-09-23 | .worktrees/w3-u6-current-fix-2026-09-23 | w3-u6-current-fix | done | | Cursor | integrate-w3-u6-closeout-2026-09-23 | feature/integrate-w3-u6-closeout-2026-09-23 | .worktrees/integrate-w3-u6-closeout-2026-09-23 | git:dev | done | | Cursor | integrate-matrix-record-id-2026-09-23 | feature/integrate-matrix-record-id-2026-09-23 | .worktrees/integrate-matrix-record-id-2026-09-23 | git:dev | done | diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/bootstrap.out b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/bootstrap.out new file mode 100644 index 00000000..8696ed5f --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/bootstrap.out @@ -0,0 +1 @@ +bootstrap: ok diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/daemon-bounded-run.jsonl b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/daemon-bounded-run.jsonl new file mode 100644 index 00000000..347baa0b --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/daemon-bounded-run.jsonl @@ -0,0 +1,5 @@ +{"interval": 1.0, "max_cycles": 3, "pid": 63316, "status": "daemon_started"} +{"processed": 0, "results": [], "status": "ok"} +{"processed": 0, "results": [], "status": "ok"} +{"processed": 0, "results": [], "status": "ok"} +{"cycles": 3, "pid": 63316, "reason": "max_cycles", "status": "daemon_stopped"} diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/daemon-status-after-load.json b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/daemon-status-after-load.json new file mode 100644 index 00000000..8decc18b --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/daemon-status-after-load.json @@ -0,0 +1 @@ +{"epoch": "7fa35ad9-518f-4a0d-a446-49baf12c666c", "heartbeat": {"cycle": 2, "pid": 63557, "updated": 1790157919.612233}, "heartbeat_age_seconds": 0.8667151927947998, "lock_root": "/private/tmp/Agent-System/.locks", "manager_lock": {"held": true, "holder_pid": 63557, "path": "/private/tmp/Agent-System/.locks/os/manager.lock"}, "queue": {"claimed": 0, "pending": 0}, "status": "ok"} diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/err-log-head.txt b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/err-log-head.txt new file mode 100644 index 00000000..e69de29b diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/host.txt b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/host.txt new file mode 100644 index 00000000..d9856522 --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/host.txt @@ -0,0 +1 @@ +Darwin WeiCHENdeMac-mini.local 25.6.0 Darwin Kernel Version 25.6.0: Fri Jul 31 19:17:26 PDT 2026; root:xnu-12377.161.14~5/RELEASE_ARM64_T6041 arm64 diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/launchctl-print-summary.txt b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/launchctl-print-summary.txt new file mode 100644 index 00000000..dbe75a28 --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/launchctl-print-summary.txt @@ -0,0 +1,13 @@ +2: active count = 1 +3: path = /Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist +5: state = running +7: program = /usr/bin/python3 +17: working directory = /private/tmp/Agent-System +19: stdout path = /tmp/agentctl-coordinator.out.log +20: stderr path = /tmp/agentctl-coordinator.err.log +38: runs = 1 +39: pid = 63557 +55: state = active +56: active count = 1 +63: state = active +64: active count = 1 diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/load-commands.txt b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/load-commands.txt new file mode 100644 index 00000000..59c846fb --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/load-commands.txt @@ -0,0 +1,3 @@ +domain=gui/501 +dest=/Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist +cmd: launchctl bootstrap gui/501 /Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/loaded-plist.plist b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/loaded-plist.plist new file mode 100644 index 00000000..15de15b9 --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/loaded-plist.plist @@ -0,0 +1,27 @@ + + + + + KeepAlive + + Label + com.agentctl.coordinator + ProgramArguments + + /usr/bin/python3 + /private/tmp/Agent-System/scripts/agentctl.py + daemon + run + --interval + 1.0 + + RunAtLoad + + StandardErrorPath + /tmp/agentctl-coordinator.err.log + StandardOutPath + /tmp/agentctl-coordinator.out.log + WorkingDirectory + /private/tmp/Agent-System + + diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/loaded_at_utc.txt b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/loaded_at_utc.txt new file mode 100644 index 00000000..32cf26c3 --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/loaded_at_utc.txt @@ -0,0 +1 @@ +2026-09-23T10:05:09Z diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/owner.txt b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/owner.txt new file mode 100644 index 00000000..fcad2d5f --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/owner.txt @@ -0,0 +1 @@ +weichen diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/plutil-lint.txt b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/plutil-lint.txt new file mode 100644 index 00000000..ccc1941a --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/plutil-lint.txt @@ -0,0 +1 @@ +/Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist: OK diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/rollback.txt b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/rollback.txt new file mode 100644 index 00000000..a5d5d67f --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/rollback.txt @@ -0,0 +1,6 @@ +# Rollback (fail-closed) +launchctl bootout gui/501/com.agentctl.coordinator +rm -f /Users/weichen/Library/LaunchAgents/com.agentctl.coordinator.plist +# verify: +launchctl print gui/501/com.agentctl.coordinator # expect not found +python3 /private/tmp/Agent-System/scripts/agentctl.py daemon status diff --git a/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/unittest-summary.txt b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/unittest-summary.txt new file mode 100644 index 00000000..2171785e --- /dev/null +++ b/.doc/ops/evidence/2026-09-23-agentctl-mgmt-go-live/unittest-summary.txt @@ -0,0 +1,2 @@ +146:Ran 134 tests in 118.996s +148:OK (skipped=3) diff --git a/.doc/ops/short-term/2026-09-23-agentctl-mgmt-go-live.md b/.doc/ops/short-term/2026-09-23-agentctl-mgmt-go-live.md new file mode 100644 index 00000000..362e0574 --- /dev/null +++ b/.doc/ops/short-term/2026-09-23-agentctl-mgmt-go-live.md @@ -0,0 +1,58 @@ +--- +title: "agentctl 管理面启用(launchd go-live)" +task_id: agentctl-mgmt-go-live-2026-09-23 +status: in_progress +created: 2026-09-23 +updated: 2026-09-23 +owner: Cursor +task_type: ops +task_tier: single +policy_revision: "agent-governance-2026-09-21-r1 @ eebe83e0c5e61ad81beeb59bc9138954555afd52" +branch: feature/agentctl-mgmt-go-live-2026-09-23 +worktree: .worktrees/agentctl-mgmt-go-live-2026-09-23 +base_dev_sha: "eebe83e0c5e61ad81beeb59bc9138954555afd52" +write_scope: [".doc"] +allowed_environments: [] +mutex: agentctl-mgmt-go-live +review_state: pending +integration_state: pending +deployment: pending_loaded_local_launchd +cleanup: pending +cleanup_owner: "独立维护者" +cleanup_trigger: "合入后复查;卸载用 evidence/rollback.txt" +remote_sync: not_requested +--- + +# agentctl 管理面启用(launchd go-live) + +## 用户目标与授权 + +- 目标:将 L1 协调库从按会话 CLI 提升为常驻管理面(macOS launchd)。 +- 授权:用户批准「agentctl 管理面:启用(上线)计划」并要求实现全步骤(含装载)。 +- 禁止:push;晋升 test/main;装载外的产品环境写;L2/ADR。 + +## 验收证据 + +| 步骤 | 结果 | 证据 | +|---|---|---| +| unittest discover | 134 ran / 3 skipped OK @ `eebe83e0` | [unittest-summary](../evidence/2026-09-23-agentctl-mgmt-go-live/unittest-summary.txt) | +| daemon 有界试运行 | `--max-cycles 3` 正常启停,锁释放 | [daemon-bounded-run](../evidence/2026-09-23-agentctl-mgmt-go-live/daemon-bounded-run.jsonl) | +| launchd bootstrap | `gui/501/com.agentctl.coordinator` state=running | [launchctl-print-summary](../evidence/2026-09-23-agentctl-mgmt-go-live/launchctl-print-summary.txt) | +| stderr | 空 | [err-log-head](../evidence/2026-09-23-agentctl-mgmt-go-live/err-log-head.txt) | +| 回滚 | `launchctl bootout` + 删 plist | [rollback](../evidence/2026-09-23-agentctl-mgmt-go-live/rollback.txt) | + +装载命令:`launchctl bootstrap gui/501 ~/Library/LaunchAgents/com.agentctl.coordinator.plist`(UTC `2026-09-23T10:05:09Z`)。 + +## 端到端 + +本 short-term 本身作为已 validate 候选入队,由常驻 daemon 自动 `--ff-only` 合入(见收口字段更新)。 + +## 收口 + +| 字段 | 值 | +|---|---| +| review_state | pending | +| integration_state | pending | +| deployment | pending_loaded_local_launchd | +| cleanup | pending | +| remote_sync | not_requested |