Compare commits
130
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9ce771954 | ||
|
|
9f7bbc25a0 | ||
|
|
0634ffb8ee | ||
|
|
a9c9a9182e | ||
|
|
7cfd6851f6 | ||
|
|
7bdb045272 | ||
|
|
44161d2ad2 | ||
|
|
340342faf8 | ||
|
|
d93c1ab3d6 | ||
|
|
35f845168b | ||
|
|
42436f754d | ||
|
|
5201f14173 | ||
|
|
088ff307c0 | ||
|
|
2abc23ac65 | ||
|
|
c0e556b167 | ||
|
|
d653e32e7b | ||
|
|
b74b92920e | ||
|
|
caba4b086a | ||
|
|
12bbe948b2 | ||
|
|
bc94080332 | ||
|
|
1da17a282c | ||
|
|
2f9a6eb588 | ||
|
|
1fd2f16726 | ||
|
|
5a70fd6940 | ||
|
|
725181de4a | ||
|
|
fd0ea3f2d7 | ||
|
|
675e09a1a7 | ||
|
|
b5a308dd11 | ||
|
|
728567c778 | ||
|
|
9424d19106 | ||
|
|
86e9d3706b | ||
|
|
dc29b84cdf | ||
|
|
4e410efbab | ||
|
|
6cbe7e6e56 | ||
|
|
cc90d39205 | ||
|
|
69645cb07b | ||
|
|
59ad970ad5 | ||
|
|
c428fc5e91 | ||
|
|
b812d1d30f | ||
|
|
67cc8f13af | ||
|
|
edbe592478 | ||
|
|
610b97b93e | ||
|
|
f6eaff7878 | ||
|
|
77c602c8f4 | ||
|
|
f5cdae1a41 | ||
|
|
f9f055bee1 | ||
|
|
6eb2d11eeb | ||
|
|
0d58e6fb2d | ||
|
|
ae7fcc1557 | ||
|
|
fad32cd820 | ||
|
|
4844041b1b | ||
|
|
9eea950d57 | ||
|
|
ab450c1181 | ||
|
|
2c6088c200 | ||
|
|
f2644db6d8 | ||
|
|
f29a69b8a1 | ||
|
|
0d1840da96 | ||
|
|
a2afa67d47 | ||
|
|
d7d951542d | ||
|
|
da42769160 | ||
|
|
2d91f0ee7d | ||
|
|
a81b9554c0 | ||
|
|
2d42cbd678 | ||
|
|
275624591c | ||
|
|
50b1a6144b | ||
|
|
ab52f79034 | ||
|
|
0f50991288 | ||
|
|
245e6202d2 | ||
|
|
18fbec23e4 | ||
|
|
fabd85a65e | ||
|
|
24a5e6dbbb | ||
|
|
26673d0ae0 | ||
|
|
e98e2d716c | ||
|
|
8b2621a4d1 | ||
|
|
b739f358f8 | ||
|
|
e43f4c6970 | ||
|
|
f769385853 | ||
|
|
80a7736199 | ||
|
|
a1d70f5bd0 | ||
|
|
143ee934b8 | ||
|
|
098c1fd73a | ||
|
|
d0b4d3d4dd | ||
|
|
4e0e6a1418 | ||
|
|
ebb36fb85c | ||
|
|
36793a4ea5 | ||
|
|
03fd135593 | ||
|
|
476e97c993 | ||
|
|
5392db8ecb | ||
|
|
ea1457231e | ||
|
|
57cbd57139 | ||
|
|
2b3b1c6f5b | ||
|
|
5618cfc8cf | ||
|
|
4490b6ef76 | ||
|
|
0217ce354b | ||
|
|
e1796cc858 | ||
|
|
319b397419 | ||
|
|
28ed7005dd | ||
|
|
cfc80b34a4 | ||
|
|
9744a2e2d0 | ||
|
|
e6dad5b25e | ||
|
|
5a8540804e | ||
|
|
655397547f | ||
|
|
930447a78c | ||
|
|
c1a70e67e5 | ||
|
|
de2ba94933 | ||
|
|
77ba9deee1 | ||
|
|
614ebb8d1b | ||
|
|
4bbbd0f8bc | ||
|
|
866254de0e | ||
|
|
6e74203857 | ||
|
|
1d8b50d5ac | ||
|
|
6fc828a9ce | ||
|
|
58bf83f755 | ||
|
|
8ca448ddca | ||
|
|
39f8c1d134 | ||
|
|
69ffaa677e | ||
|
|
8c4200c888 | ||
|
|
6f0e43cab2 | ||
|
|
b514a3c5e0 | ||
|
|
52462b45e9 | ||
|
|
c1ae90cea3 | ||
|
|
f27af1d3d2 | ||
|
|
ca55354034 | ||
|
|
80caa785e2 | ||
|
|
f04f14ff01 | ||
|
|
2844bbfe1c | ||
|
|
734aa72527 | ||
|
|
22ed51cf1f | ||
|
|
e7262d4d65 | ||
|
|
0d98016511 |
@@ -5,7 +5,44 @@
|
||||
{
|
||||
"command": ".cursor/hooks/guard-git.sh",
|
||||
"matcher": "^git ",
|
||||
"timeout": 10,
|
||||
"failClosed": true
|
||||
},
|
||||
{
|
||||
"command": ".cursor/hooks/guard-pi-shell.sh",
|
||||
"matcher": "pi_subagents\\.py|pkill",
|
||||
"timeout": 10,
|
||||
"failClosed": true
|
||||
}
|
||||
],
|
||||
"beforeMCPExecution": [
|
||||
{
|
||||
"command": ".cursor/hooks/guard-pi-dispatch.sh",
|
||||
"matcher": "pi-subagents|pi_subagent_",
|
||||
"timeout": 10,
|
||||
"failClosed": true
|
||||
}
|
||||
],
|
||||
"postToolUse": [
|
||||
{
|
||||
"command": ".cursor/hooks/pi-receipt-context.sh",
|
||||
"matcher": "MCP: pi-subagents|pi_subagent_",
|
||||
"timeout": 10,
|
||||
"failClosed": false
|
||||
}
|
||||
],
|
||||
"sessionStart": [
|
||||
{
|
||||
"command": ".cursor/hooks/audit-session.sh",
|
||||
"timeout": 20,
|
||||
"failClosed": false
|
||||
}
|
||||
],
|
||||
"stop": [
|
||||
{
|
||||
"command": ".cursor/hooks/audit-session.sh",
|
||||
"timeout": 10,
|
||||
"failClosed": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Shared helpers for project Cursor hooks (advisory gates + audit/probe)."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
KNOWN_ROLES = frozenset(
|
||||
{
|
||||
"research",
|
||||
"planning",
|
||||
"requirements_review",
|
||||
"plan_review",
|
||||
"code_review",
|
||||
"diagnosis",
|
||||
"test_run",
|
||||
"acceptance_check",
|
||||
"stage_notes",
|
||||
"report",
|
||||
"auxiliary",
|
||||
}
|
||||
)
|
||||
TEST_ROLES = frozenset({"test_run", "acceptance_check"})
|
||||
FULL_SHA = re.compile(r"^[0-9a-fA-F]{40}$")
|
||||
REQUEST_ID = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$")
|
||||
|
||||
|
||||
def repo_root() -> Path:
|
||||
env = os.environ.get("CURSOR_PROJECT_DIR") or os.environ.get("CURSOR_WORKSPACE_ROOT")
|
||||
if env:
|
||||
return Path(env).resolve()
|
||||
# hooks run with cwd = project root
|
||||
return Path.cwd().resolve()
|
||||
|
||||
|
||||
def audit_path() -> Path:
|
||||
return repo_root() / ".cursor" / "hook-audit.jsonl"
|
||||
|
||||
|
||||
def probe_path() -> Path:
|
||||
return repo_root() / ".cursor" / "hook-probe.jsonl"
|
||||
|
||||
|
||||
def inventory_dir() -> Path:
|
||||
return repo_root() / ".cursor" / "hook-audit"
|
||||
|
||||
|
||||
def append_jsonl(path: Path, record: dict[str, Any]) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
record = dict(record)
|
||||
record.setdefault("ts", datetime.now(timezone.utc).isoformat())
|
||||
with path.open("a", encoding="utf-8") as fh:
|
||||
fh.write(json.dumps(record, ensure_ascii=False) + "\n")
|
||||
|
||||
|
||||
def read_stdin() -> str:
|
||||
return sys.stdin.read()
|
||||
|
||||
|
||||
def maybe_probe(raw: str, hook: str) -> None:
|
||||
if os.environ.get("CURSOR_HOOKS_PROBE", "").strip() not in ("1", "true", "TRUE", "yes"):
|
||||
return
|
||||
append_jsonl(
|
||||
probe_path(),
|
||||
{"hook": hook, "raw": raw[:65536], "raw_len": len(raw)},
|
||||
)
|
||||
|
||||
|
||||
def parse_json_loose(raw: str) -> dict[str, Any] | None:
|
||||
raw = (raw or "").strip()
|
||||
if not raw:
|
||||
return None
|
||||
try:
|
||||
data = json.loads(raw)
|
||||
except json.JSONDecodeError:
|
||||
return None
|
||||
return data if isinstance(data, dict) else None
|
||||
|
||||
|
||||
def first_key(data: dict[str, Any], *names: str) -> Any:
|
||||
for name in names:
|
||||
if name in data and data[name] is not None:
|
||||
return data[name]
|
||||
return None
|
||||
|
||||
|
||||
def normalize_tool_name(name: str | None) -> str | None:
|
||||
"""Strip Cursor MCP prefixes such as 'MCP:' / 'MCP: pi-subagents/'."""
|
||||
if name is None:
|
||||
return None
|
||||
n = str(name).strip()
|
||||
# Observed IDE postToolUse: tool_name == "MCP:pi_subagent_roles"
|
||||
if n.upper().startswith("MCP:"):
|
||||
n = n[4:].lstrip()
|
||||
# Rare: "MCP: pi-subagents/pi_subagent_run"
|
||||
if "/" in n and n.rsplit("/", 1)[-1].startswith("pi_subagent_"):
|
||||
n = n.rsplit("/", 1)[-1]
|
||||
return n or None
|
||||
|
||||
|
||||
def tool_name(data: dict[str, Any]) -> str | None:
|
||||
v = first_key(data, "tool_name", "mcp_tool_name", "name", "toolName")
|
||||
return normalize_tool_name(str(v) if v is not None else None)
|
||||
|
||||
|
||||
def mcp_server(data: dict[str, Any]) -> str | None:
|
||||
v = first_key(data, "mcp_server_name", "server", "mcpServer", "server_name")
|
||||
return str(v) if v is not None else None
|
||||
|
||||
|
||||
def tool_input(data: dict[str, Any]) -> dict[str, Any] | None:
|
||||
v = first_key(data, "tool_input", "arguments", "input", "toolInput", "params")
|
||||
if isinstance(v, dict):
|
||||
return v
|
||||
if isinstance(v, str):
|
||||
try:
|
||||
parsed = json.loads(v)
|
||||
return parsed if isinstance(parsed, dict) else None
|
||||
except json.JSONDecodeError:
|
||||
return None
|
||||
return None
|
||||
|
||||
|
||||
def shell_command(data: dict[str, Any]) -> str:
|
||||
v = first_key(data, "command", "shell_command", "cmd")
|
||||
return str(v) if v is not None else ""
|
||||
|
||||
|
||||
def emit(obj: dict[str, Any]) -> None:
|
||||
sys.stdout.write(json.dumps(obj, ensure_ascii=False))
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
def allow() -> None:
|
||||
emit({"permission": "allow"})
|
||||
raise SystemExit(0)
|
||||
|
||||
|
||||
def ask(user_message: str, agent_message: str) -> None:
|
||||
emit(
|
||||
{
|
||||
"permission": "ask",
|
||||
"user_message": user_message,
|
||||
"agent_message": agent_message,
|
||||
}
|
||||
)
|
||||
raise SystemExit(0)
|
||||
|
||||
|
||||
def additional_context(text: str) -> None:
|
||||
emit({"additional_context": text})
|
||||
raise SystemExit(0)
|
||||
|
||||
|
||||
def audit(hook: str, code: str, **extra: Any) -> None:
|
||||
rec = {"hook": hook, "code": code}
|
||||
rec.update(extra)
|
||||
try:
|
||||
append_jsonl(audit_path(), rec)
|
||||
except OSError:
|
||||
pass
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
exec python3 -B "$DIR/audit_session.py"
|
||||
@@ -0,0 +1,101 @@
|
||||
#!/usr/bin/env python3
|
||||
"""sessionStart / stop: audit + optional fail-open inventory (no context injection)."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import _lib as lib # noqa: E402
|
||||
|
||||
HOOK = "audit-session"
|
||||
INVENTORY_TIMEOUT = 15
|
||||
|
||||
|
||||
def _run_inventory(root: Path) -> dict:
|
||||
out: dict = {"cleanup_report": None, "docs_drift": None, "errors": []}
|
||||
if os.environ.get("CURSOR_HOOKS_NO_INVENTORY", "").strip() in ("1", "true", "TRUE", "yes"):
|
||||
out["skipped"] = "CURSOR_HOOKS_NO_INVENTORY"
|
||||
return out
|
||||
agentctl = root / "scripts" / "agentctl.py"
|
||||
if not agentctl.is_file():
|
||||
out["errors"].append("agentctl.py missing")
|
||||
return out
|
||||
for label, args in (
|
||||
("cleanup_report", ["cleanup", "report"]),
|
||||
("docs_drift", ["docs", "drift"]),
|
||||
):
|
||||
try:
|
||||
r = subprocess.run(
|
||||
["python3", "-B", str(agentctl), *args],
|
||||
cwd=str(root),
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=INVENTORY_TIMEOUT,
|
||||
check=False,
|
||||
)
|
||||
payload = None
|
||||
for stream in (r.stdout, r.stderr):
|
||||
for line in (stream or "").splitlines():
|
||||
line = line.strip()
|
||||
if line.startswith("{"):
|
||||
try:
|
||||
payload = json.loads(line)
|
||||
break
|
||||
except json.JSONDecodeError:
|
||||
continue
|
||||
if payload is not None:
|
||||
break
|
||||
out[label] = {
|
||||
"exit_code": r.returncode,
|
||||
"payload": payload,
|
||||
"stdout_tail": (r.stdout or "")[-2000:],
|
||||
"stderr_tail": (r.stderr or "")[-1000:],
|
||||
}
|
||||
except subprocess.TimeoutExpired:
|
||||
out["errors"].append(f"{label}: timeout>{INVENTORY_TIMEOUT}s")
|
||||
except OSError as exc:
|
||||
out["errors"].append(f"{label}: {exc}")
|
||||
return out
|
||||
|
||||
|
||||
def main() -> None:
|
||||
raw = lib.read_stdin()
|
||||
lib.maybe_probe(raw, HOOK)
|
||||
data = lib.parse_json_loose(raw) or {}
|
||||
event = str(
|
||||
lib.first_key(data, "hook_event_name", "event", "event_name", "type") or "unknown"
|
||||
)
|
||||
root = lib.repo_root()
|
||||
if "start" in event.lower() or event == "unknown":
|
||||
inv = _run_inventory(root)
|
||||
inv_path = None
|
||||
try:
|
||||
inv_dir = lib.inventory_dir()
|
||||
inv_dir.mkdir(parents=True, exist_ok=True)
|
||||
ts = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
|
||||
path = inv_dir / f"inventory-{ts}.json"
|
||||
path.write_text(json.dumps(inv, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
|
||||
inv_path = str(path)
|
||||
except OSError:
|
||||
pass
|
||||
lib.audit(
|
||||
HOOK,
|
||||
"SESSION_AUDIT",
|
||||
event=event,
|
||||
inventory_path=inv_path,
|
||||
inventory_errors=inv.get("errors"),
|
||||
)
|
||||
else:
|
||||
lib.audit(HOOK, "SESSION_AUDIT", event=event)
|
||||
|
||||
lib.emit({})
|
||||
raise SystemExit(0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Thin wrapper: preserve stdin for Cursor hook JSON (do not use heredoc).
|
||||
set -euo pipefail
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
exec python3 -B "$DIR/guard_pi_dispatch.py"
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
exec python3 -B "$DIR/guard_pi_shell.py"
|
||||
@@ -0,0 +1,113 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Advisory beforeMCPExecution gate for pi-subagents MCP tools."""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import _lib as lib # noqa: E402
|
||||
|
||||
HOOK = "guard-pi-dispatch"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
raw = lib.read_stdin()
|
||||
lib.maybe_probe(raw, HOOK)
|
||||
data = lib.parse_json_loose(raw)
|
||||
if data is None:
|
||||
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="non_json_or_empty")
|
||||
lib.allow()
|
||||
|
||||
name = lib.tool_name(data)
|
||||
server = lib.mcp_server(data)
|
||||
if not name:
|
||||
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="missing_tool_name", keys=sorted(data.keys())[:40])
|
||||
lib.allow()
|
||||
|
||||
if server and "pi-subagents" not in server and not name.startswith("pi_subagent_"):
|
||||
if not name.startswith("pi_subagent_"):
|
||||
lib.allow()
|
||||
|
||||
if name in ("pi_subagent_roles", "pi_subagent_result"):
|
||||
lib.allow()
|
||||
|
||||
if name != "pi_subagent_run":
|
||||
if name.startswith("pi_subagent_"):
|
||||
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="unknown_pi_tool", tool=name)
|
||||
lib.allow()
|
||||
|
||||
args = lib.tool_input(data) or {}
|
||||
req = args.get("request") if isinstance(args.get("request"), dict) else args
|
||||
if not isinstance(req, dict):
|
||||
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="missing_request")
|
||||
lib.ask(
|
||||
"pi_subagent_run 缺少可识别的 request 对象。请核对 MCP 参数后再继续。",
|
||||
"Hook: unrecognized request shape for pi_subagent_run.",
|
||||
)
|
||||
|
||||
role = req.get("role_id")
|
||||
request_id = req.get("request_id")
|
||||
goal = req.get("goal")
|
||||
auth = req.get("authorization_ref")
|
||||
source_sha = req.get("source_sha")
|
||||
input_files = req.get("input_files")
|
||||
timeout = req.get("timeout_seconds")
|
||||
|
||||
problems: list[str] = []
|
||||
|
||||
if not role or not isinstance(role, str):
|
||||
problems.append("role_id 缺失")
|
||||
elif role not in lib.KNOWN_ROLES:
|
||||
problems.append(f"role_id={role!r} 不在已知角色表")
|
||||
|
||||
if not request_id or not isinstance(request_id, str) or not lib.REQUEST_ID.match(request_id):
|
||||
problems.append("request_id 非法(需字母数字开头,长度≤128)")
|
||||
|
||||
if not goal or not isinstance(goal, str) or not goal.strip():
|
||||
problems.append("goal 为空")
|
||||
|
||||
if not auth or not isinstance(auth, str) or not auth.strip():
|
||||
problems.append("authorization_ref 为空")
|
||||
|
||||
if not isinstance(source_sha, str) or not lib.FULL_SHA.match(source_sha):
|
||||
problems.append("source_sha 必须是完整 40-hex 提交(禁止 HEAD/分支名/短 hash)")
|
||||
|
||||
if not isinstance(input_files, list):
|
||||
problems.append("input_files 必须是数组")
|
||||
|
||||
if not isinstance(timeout, int) or isinstance(timeout, bool) or timeout <= 0:
|
||||
if isinstance(timeout, float) and timeout.is_integer() and timeout > 0:
|
||||
pass
|
||||
else:
|
||||
problems.append("timeout_seconds 必须是正整数")
|
||||
|
||||
if isinstance(role, str) and role in lib.TEST_ROLES:
|
||||
cmds = req.get("approved_commands")
|
||||
digest = req.get("plan_digest")
|
||||
if not isinstance(cmds, list) or not cmds:
|
||||
problems.append("test 角色需要 approved_commands(argv 数组的数组)")
|
||||
elif any(not isinstance(c, list) or not all(isinstance(x, str) for x in c) for c in cmds):
|
||||
problems.append("approved_commands 形状错误(应为字符串数组的数组)")
|
||||
if not isinstance(digest, str) or len(digest) != 64 or any(
|
||||
c not in "0123456789abcdefABCDEF" for c in digest
|
||||
):
|
||||
problems.append("plan_digest 必须是 64-hex SHA-256")
|
||||
|
||||
if "model_override" in req and req.get("model_override") is not None:
|
||||
problems.append("出现 model_override(禁止静默换模型;请用任务 override)")
|
||||
|
||||
if problems:
|
||||
detail = ";".join(problems)
|
||||
lib.audit(HOOK, "SHAPE_ASK", tool=name, problems=problems, role=role, request_id=request_id)
|
||||
lib.ask(
|
||||
f"pi_subagent_run 形状检查未通过:{detail}。执行器仍会硬校验;确认后继续或修正参数。",
|
||||
f"Hook advisory: {detail}",
|
||||
)
|
||||
|
||||
lib.audit(HOOK, "ALLOW", tool=name, role=role, request_id=request_id)
|
||||
lib.allow()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Advisory beforeShellExecution: bare pi_subagents.py run / broad pkill."""
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import _lib as lib # noqa: E402
|
||||
|
||||
HOOK = "guard-pi-shell"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
raw = lib.read_stdin()
|
||||
lib.maybe_probe(raw, HOOK)
|
||||
data = lib.parse_json_loose(raw)
|
||||
if data is None:
|
||||
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="non_json_or_empty")
|
||||
lib.allow()
|
||||
|
||||
cmd = lib.shell_command(data)
|
||||
if not cmd:
|
||||
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="missing_command", keys=sorted(data.keys())[:40])
|
||||
lib.allow()
|
||||
|
||||
compact = re.sub(r"\s+", " ", cmd).strip()
|
||||
|
||||
if re.search(r"(^|[;&|]\s*)pkill(\s|$)", compact) and re.search(r"\s-f(\s|$)", compact):
|
||||
lib.audit(HOOK, "PKILL_ASK", command=compact[:500])
|
||||
lib.ask(
|
||||
"检测到 pkill -f(广谱杀进程)。AGENTS/PI 规则禁止广谱杀;请确认范围后再继续。",
|
||||
"Hook requires confirmation for pkill -f.",
|
||||
)
|
||||
|
||||
if re.search(r"pi_subagents\.py(\s|$)", compact) and re.search(r"(^|\s)run(\s|$)", compact):
|
||||
has_lease = (
|
||||
re.search(r"agentctl(\.py)?\s+with\b", compact) is not None
|
||||
and re.search(r"--resource\s+path:", compact) is not None
|
||||
)
|
||||
if re.search(r"pi_subagents\.py\s+(roles|result|status|config)\b", compact):
|
||||
lib.allow()
|
||||
if not has_lease:
|
||||
lib.audit(HOOK, "BARE_RUN_ASK", command=compact[:500])
|
||||
lib.ask(
|
||||
"裸调 pi_subagents.py run 缺少 agentctl with --resource path:… 租约。"
|
||||
"报告路径须在 path:.doc/test-reports/assets/pi-subagents/<task>/<request> 租约内。",
|
||||
"Hook: bare PI run without lease resource.",
|
||||
)
|
||||
|
||||
lib.allow()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
exec python3 -B "$DIR/pi_receipt_context.py"
|
||||
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python3
|
||||
"""postToolUse: inject receipt-check reminders after pi-subagents tools."""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import _lib as lib # noqa: E402
|
||||
|
||||
HOOK = "pi-receipt-context"
|
||||
|
||||
REMINDER = """[PI subagent receipt checklist]
|
||||
- 核对 report/receipt 路径:.doc/test-reports/assets/pi-subagents/<task_id>/<request_id>/
|
||||
- 记录 config_revision / config_sha256 / configured vs actual_model(不可观察填 unknown)
|
||||
- run_status=succeeded 不等于阶段 PASS;review_state 仍可为 pending
|
||||
- 测试 pass 只来自批准命令证据(approved_commands),不能用模型叙事冒充
|
||||
- 推进门禁前用 subagent-stage-record skill 写回传与阶段收据
|
||||
"""
|
||||
|
||||
|
||||
def main() -> None:
|
||||
raw = lib.read_stdin()
|
||||
lib.maybe_probe(raw, HOOK)
|
||||
data = lib.parse_json_loose(raw)
|
||||
if data is None:
|
||||
lib.audit(HOOK, "UNRECOGNIZED_INPUT", reason="non_json_or_empty")
|
||||
lib.emit({})
|
||||
raise SystemExit(0)
|
||||
|
||||
name = lib.tool_name(data) or ""
|
||||
server = lib.mcp_server(data) or ""
|
||||
blob = raw
|
||||
is_pi = (
|
||||
name.startswith("pi_subagent_")
|
||||
or "pi-subagents" in server
|
||||
or "pi_subagent_" in blob
|
||||
)
|
||||
if not is_pi:
|
||||
lib.emit({})
|
||||
raise SystemExit(0)
|
||||
|
||||
lib.audit(HOOK, "CONTEXT_INJECT", tool=name or "unknown")
|
||||
lib.additional_context(REMINDER)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+9
-2
@@ -1,17 +1,24 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"agentctl": {
|
||||
"type": "stdio",
|
||||
"command": "node",
|
||||
"args": ["${workspaceFolder}/scripts/mcp/agentctl-mcp.mjs"]
|
||||
"args": ["scripts/mcp/agentctl-mcp.mjs"]
|
||||
},
|
||||
"jev": {
|
||||
"type": "stdio",
|
||||
"command": "node",
|
||||
"args": ["${workspaceFolder}/scripts/mcp/jev-mcp.mjs"]
|
||||
"args": ["scripts/mcp/jev-mcp.mjs"]
|
||||
},
|
||||
"codegraph": {
|
||||
"type": "stdio",
|
||||
"command": "codegraph",
|
||||
"args": ["serve", "--mcp", "--path", "${workspaceFolder}"]
|
||||
},
|
||||
"pi-subagents": {
|
||||
"type": "stdio",
|
||||
"command": "node",
|
||||
"args": ["scripts/mcp/pi-subagents-mcp.mjs"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,9 @@ alwaysApply: true
|
||||
|
||||
1. **写仓库**:必须 `agentctl with` / MCP `lease_run`。裸 `git commit` 会被 agentctl pre-commit hook 拒绝。
|
||||
2. **共享文档**:`.doc/ops/CURRENT.md`、`.doc/status/FEATURE-MATRIX.md` 只能 `docs apply`(行级 CAS;MATRIX 键为 `record_id`)。
|
||||
3. **合入 local dev**:`validate` 后 `queue enqueue`(daemon `--ff-only`)或受控 `integrate`;禁止直接改主目录 `dev` tip。
|
||||
3. **合入 local dev**:`validate` 后 `queue enqueue`(daemon `--ff-only`)或受控 `integrate`;禁止直接改主目录 `dev` tip。
|
||||
4. **禁止默认**:未授权 `git push`、晋升 test/main、`--force` 清理、卸载 launchd coordinator、改 gap-matrix / 升 MATRIX 状态值冒充发布。
|
||||
5. **需求重叠**:跨对话新设计须 `catalog overlap`;硬重叠拒绝;软重叠须 `catalog ack` 留痕后方可编码(见 `.doc/ops/2026-09-24-governance-catalog-plan.md`)。
|
||||
|
||||
## 会话路径
|
||||
|
||||
@@ -20,4 +21,7 @@ alwaysApply: true
|
||||
- 建场 → `agentctl-worktree-setup`
|
||||
- 写回 → `agentctl-lease-write`
|
||||
- 合入/收口 → `agentctl-integrate-closeout`
|
||||
- MCP 工具定义见 `.cursor/mcp.json` → `scripts/mcp/agentctl-mcp.mjs`
|
||||
- PI 派发 → skill `pi-subagent-dispatch`(MCP `pi-subagents`)
|
||||
- 阶段落盘 → skill `subagent-stage-record`
|
||||
- MCP 工具定义见 `.cursor/mcp.json` → `scripts/mcp/agentctl-mcp.mjs` / `pi-subagents-mcp.mjs`
|
||||
- 客户端 hook 边界见规则 `cursor-hooks`
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
description: Cursor 对话自动生成的会话名称使用简体中文
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# 会话名称(中文)
|
||||
|
||||
Cursor 为本对话自动生成或建议的**会话名称 / 聊天标题**必须使用**简体中文**。
|
||||
|
||||
## 要求
|
||||
|
||||
- 用简短中文概括当前任务主题(约 6–16 字)
|
||||
- 优先动词/对象:如「创建会话中文命名规则」「修复登录超时」
|
||||
- 禁止默认英文标题(专有名词、命令、路径可保留原文,整体仍以中文为主)
|
||||
|
||||
## 示例
|
||||
|
||||
| 场景 | 可用标题 |
|
||||
|---|---|
|
||||
| 新建 Cursor 规则 | 创建会话中文命名规则 |
|
||||
| 排查 hook | 排查 pi-dispatch hook |
|
||||
| 合入 feature | 合入治理目录库变更 |
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
description: Project Cursor hooks are advisory gates layered on agentctl/PI executor hard checks; scripts exist does not mean Cursor loaded them.
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Cursor hooks(客户端门禁)
|
||||
|
||||
配置:`.cursor/hooks.json`;脚本:`.cursor/hooks/`。规范登记修订 `cursor-governance-2026-09-24-r1`。
|
||||
|
||||
## 分层
|
||||
|
||||
| 层 | 能力 | 说明 |
|
||||
|---|---|---|
|
||||
| 执行器 / agentctl | **enforced** | `scripts/pi_subagents.py`、租约、pre-commit 等硬拒绝 |
|
||||
| hook 脚本行为 | **enforced**(有单元回归) | stdin→stdout 契约可测 |
|
||||
| hook ↔ Cursor 接线 | **advisory / manual** | 官方事件字段未完全文档化;待 probe 采样后收紧 |
|
||||
|
||||
命中策略:与 `guard-git.sh` 一致,一律 `permission: ask`(不静默 deny)。
|
||||
|
||||
## 事件与脚本
|
||||
|
||||
- `beforeShellExecution`:`guard-git.sh`(破坏性 git);`guard-pi-shell.sh`(裸调 `pi_subagents.py run`、`pkill -f`)
|
||||
- `beforeMCPExecution`:`guard-pi-dispatch.sh`(`pi_subagent_run` 形状)
|
||||
- `postToolUse`:`pi-receipt-context.sh`(注入收据核对提醒)
|
||||
- `sessionStart` / `stop`:`audit-session.sh`(审计 + 可选只读盘点;**不注入上下文**)
|
||||
|
||||
IDE 实测(2026-09-24):`postToolUse` 的 `tool_name` 形如 `MCP:pi_subagent_roles`;hooks 须剥 `MCP:` 前缀后再匹配角色工具名。
|
||||
|
||||
## 审计与 probe
|
||||
|
||||
- 审计:`.cursor/hook-audit.jsonl`(gitignore;勿提交)
|
||||
- 盘点:`.cursor/hook-audit/inventory-*.json`
|
||||
- 采样:`CURSOR_HOOKS_PROBE=1` → `.cursor/hook-probe.jsonl`
|
||||
- 关闭盘点:`CURSOR_HOOKS_NO_INVENTORY=1`
|
||||
|
||||
异形/未知字段:**fail-open + 审计 `UNRECOGNIZED_INPUT`**,不因契约未知卡死会话。
|
||||
|
||||
## 红线
|
||||
|
||||
- 不把 hook 复刻成第二套执行器门禁
|
||||
- 脚本存在 ≠ Cursor 已加载;改 hooks 后检查 Hooks 设置页或通道
|
||||
- 审计日志不得放进被 git 跟踪的 `.cursor/hooks/` 目录
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
description: Route PI analysis/review/test subagent work through scripts/pi_subagents.py (not Cursor native agents).
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# PI subagents(工程工具)
|
||||
|
||||
本机 PI 子任务走 `scripts/pi_subagents.py` + 模型配置 `.doc/ops/2026-09-24-subagent-model-config.md`。可执行步骤见 skill `pi-subagent-dispatch`;阶段记录见 `subagent-stage-record`。
|
||||
|
||||
## 自动派发(主 Agent)
|
||||
|
||||
1. **预览配置**:`pi_subagent_roles` / CLI `roles`(不调模型)。
|
||||
2. **按阶段选角色**:research → planning → reviews → diagnosis → test_run / acceptance_check → report;实施/修复仍由 Cursor Auto。
|
||||
3. **派发 `run`**:携带 task_id、role_id、唯一 request_id、goal、authorization_ref、冻结 source_sha、input_files、timeout;test 角色另附 approved_commands + plan_digest。
|
||||
4. **租约**:报告路径 `path:.doc/test-reports/assets/pi-subagents/<task>/<request>`;裸调拒绝。
|
||||
5. **取回**:`pi_subagent_result` / CLI `result`;`run_status` 与 `verdict`/`review_state` 分离——模型成功仅 `pending`,测试 pass 仅来自批准命令证据。
|
||||
6. **门禁**:审查/测试结论须带回报告路径与 receipt 字段;不得用模型叙事冒充 PASS。
|
||||
|
||||
## 边界
|
||||
|
||||
- **Cursor Auto**:唯一代码实施车道;本规则不把 implementation 派给 PI。
|
||||
- **禁止**:自动换模型、M3 关键角色、伪造 lease、递归把本修复任务再派给 PI worker、`pkill -f` 广谱杀进程。
|
||||
- **MCP**:`.cursor/mcp.json` → `pi-subagents`(roles/run/result);executor 来自 MCP 安装根。
|
||||
- **Hook(advisory)**:`.cursor/hooks/guard-pi-dispatch.sh` / `guard-pi-shell.sh` 可在形状错误时 `ask`;**硬拒绝以执行器为准**,见规则 `cursor-hooks`。
|
||||
@@ -1,14 +1,13 @@
|
||||
---
|
||||
description: 规定项目中所有自动化测试、功能测试、集成测试报告的存放路径与结构标准规范
|
||||
globs: ["**/*test*.go", ".doc/test-reports/**/*.md"]
|
||||
description: Cursor-side test report path/naming conventions; validation scope comes from the validation contract.
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# 测试报告规范准则 (Test Reports Standard)
|
||||
|
||||
本仓库严格遵循标准化、可追溯的质量测试管理体系。所有测试报告必须归档于指定的文档目录下,并遵循固定结构。
|
||||
本仓库严格遵循标准化、可追溯的质量测试管理体系。**验证范围、套件选择与模型证据的唯一来源**为 [验证契约](../../.doc/ops/2026-09-21-validation-contract.md);本规则只约定 Cursor 侧的报告路径、命名与结构提醒,不另设第二套测试门禁。
|
||||
|
||||
**范围判定**:纯工程规范/文档变更按 [PROJECT.md](../../PROJECT.md) §8 和 [worktree 工作规范](../../.doc/ops/2026-09-21-agent-worktree-workflow.md) 检查链接、规则一致性及 Git 差异;不适用下述产品 PI 全链路与全量 Go 回归要求。报告注明 NOT REQUIRED 及依据,不能记成产品测试 PASS。运行模板、提示词和业务变更不属于此例外。
|
||||
**范围判定**:纯工程规范/文档变更按 [PROJECT.md 验证入口](../../PROJECT.md#验证入口) 与 [worktree 工作规范](../../.doc/ops/2026-09-21-agent-worktree-workflow.md) 检查链接、规则一致性及 Git 差异;不适用产品 PI 全链路。报告注明 NOT REQUIRED 及依据,不能记成产品测试 PASS。运行模板、提示词和业务变更不属于此例外——按验证契约选层级。
|
||||
|
||||
## 一、 测试报告归档路径规范
|
||||
|
||||
@@ -17,11 +16,9 @@ alwaysApply: true
|
||||
- 例如:`.doc/test-reports/2026-09-07-three-branch-intent-framework-test-report.md`
|
||||
- **证据附件**:运行产物(json/jsonl、workspace 快照、截图)放 `.doc/test-reports/assets/<report-slug>/`,**不得**与 `*-test-report.md` 混放在同一层级目录。
|
||||
|
||||
---
|
||||
|
||||
## 二、 测试报告固定结构模板
|
||||
|
||||
每份测试报告必须包含以下核心板块:
|
||||
每份独立测试报告应包含以下核心板块(小型文档/脚本任务可在任务主文档设验证节,无需机械拆报告):
|
||||
|
||||
```markdown
|
||||
# [功能/模块名称] 测试报告
|
||||
@@ -30,38 +27,37 @@ alwaysApply: true
|
||||
- 简述被测功能/特性的产生背景、业务痛点或上一轮测试中发现的缺陷与瓶颈。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
- 列举本次测试需要验证的核心功能点、质量指标(如通过率 100%、无流程卡点、非阻塞人机协同等)。
|
||||
- 列举本次测试需要验证的核心功能点、质量指标。
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
- 测试环境(OS、Go 版本、后端 Stub/Real 模型);
|
||||
- 测试层级分层(单元测试、协同集成测试、CLI 真实交互测试);
|
||||
- 测试环境(OS、工具版本、目标环境批准配置);
|
||||
- 测试层级分层(按验证契约矩阵选行);
|
||||
- 核心测试用例矩阵设计。
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
- 明确给出各用例输入下的理论判定分支、目标意图、提取槽位、参谋回复风格与状态机流转。
|
||||
- 明确给出各用例输入下的理论判定。
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
- 必须包含针对每一个典型测试用例的真实记录:
|
||||
- **测试输入 (Input)**
|
||||
- **实际输出 (Actual Output)**:贴出真实的终端/日志输出文本
|
||||
- **评价判定 (Evaluation / Verdict)**:PASS / FAIL 标志及判定依据
|
||||
- **实际输出 (Actual Output)**:贴出真实的终端/日志输出文本(可脱敏)
|
||||
- **评价判定 (Evaluation / Verdict)**:PASS / FAIL / SKIP / 未运行
|
||||
- **性能与耗时 (Duration & Latency)**
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
- 附带 `go test -v ./...` 全量回归测试输出与通过率统计。
|
||||
- 只列本次适用并**实际运行**的检查与通过率;不无条件要求全量 `go test`。
|
||||
- 工程工具改动优先 `python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v`(见验证契约「工程工具验收补充」)。
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
- 总结测试是否达到上线/合并标准,提出后续演进或强化点。
|
||||
- 总结测试是否达到授权交付终点,提出后续演进或强化点。
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 三、 执行要求与真实 Agent 交付铁律
|
||||
|
||||
1. **真实 Agent 交付铁律(红线)**:
|
||||
- **开发实现阶段**:可以快速使用 `stub` 验证状态机、协议分流、数据落盘与逻辑契约,加速反馈;
|
||||
- **交付前验收与测试报告生成**:**必须切回真实环境与真实 Agent(`pi-agent` + 实际运行的 `MiniMax-M2.7-highspeed` 容器)进行全链路端到端实测**;
|
||||
- **严禁**使用 stub 的测试输出作为最终交付报告的验收数据。
|
||||
2. **严禁散落存放**:测试报告统一归档至 `.doc/test-reports/` 目录下,禁止散落在根目录或临时沙箱中。
|
||||
- **开发实现阶段**:可以快速使用 stub 验证状态机、协议分流、数据落盘与逻辑契约,加速反馈;
|
||||
- **交付前验收与测试报告生成**:涉及产品 Agent/工作流时,必须按验证契约「产品 PI 基线」在获授权环境用真实产品 PI Agent Runner 全链路实测;模型以目标环境批准配置为准,不得在本规则中硬编码模型名;
|
||||
- **严禁**使用 stub、SKIP、未运行输出作为最终交付报告的验收数据。
|
||||
2. **严禁散落存放**:测试报告统一归档至 `.doc/test-reports/`,禁止散落在根目录或临时沙箱中。
|
||||
3. **真实控制台取样**:测试报告中的输入、输出、耗时与判定必须取自实际环境运行的真实控制台输出与日志。
|
||||
4. **Git 规范管理**:测试报告伴随对应阶段的 `docs(test)` 或 `test(...)` 规范提交入库。
|
||||
|
||||
@@ -9,19 +9,18 @@ description: Validate a merge candidate, enqueue for daemon ff-only integrate, a
|
||||
|
||||
## 候选
|
||||
|
||||
优先一层封装(创建 integrate worktree、`task register`、`--no-ff` merge;**不** validate/enqueue):
|
||||
|
||||
```bash
|
||||
D=$(git -C /path/to/Agent-System rev-parse HEAD) # 冻结 expected-dev
|
||||
ID=integrate-<task>-YYYY-MM-DD
|
||||
git worktree add -b feature/$ID .worktrees/$ID "$D"
|
||||
cd .worktrees/$ID
|
||||
python3 ../../scripts/agentctl.py task register --id "$ID" --owner Cursor --scope . --capability git:dev
|
||||
python3 ../../scripts/agentctl.py with --task "$ID" \
|
||||
--resource path:. --resource git:index --resource git:dev -- bash -lc '
|
||||
git merge --no-ff -m "merge: candidate <feature> into dev" feature/<task>
|
||||
'
|
||||
python3 scripts/agentctl.py integrate prepare \
|
||||
--task <feature-task-id> --expected-dev "$D" \
|
||||
[--integrate-id integrate-<task>-YYYY-MM-DD]
|
||||
# 进入返回的 worktree 继续 validate → enqueue
|
||||
cd .worktrees/integrate-<task>-YYYY-MM-DD # 或 emit 中的 worktree
|
||||
```
|
||||
|
||||
第一父必须等于 `$D`。
|
||||
第一父必须等于 `$D`。手工 `worktree add` + `with` + `merge --no-ff` 仍可用。
|
||||
|
||||
## validate → enqueue(daemon ff)
|
||||
|
||||
|
||||
@@ -29,11 +29,23 @@ codegraph sync -q
|
||||
跨文件定位优先用 CodeGraph MCP/`explore`;**grep 仍是完整性唯一权威**(假阴性时以 grep 为准)。
|
||||
|
||||
4. 若任务已存在:在注册 worktree 内工作,确认 `tasks.state=active`。
|
||||
5. 若新任务:跟 [agentctl-worktree-setup](../agentctl-worktree-setup/SKILL.md)。
|
||||
6. 任何仓库写 → [agentctl-lease-write](../agentctl-lease-write/SKILL.md);合入 → [agentctl-integrate-closeout](../agentctl-integrate-closeout/SKILL.md)。
|
||||
5. **开工前需求重叠探测**(治理目录库):新设计或可能与其他对话重叠时:
|
||||
|
||||
```bash
|
||||
python3 scripts/agentctl.py catalog search --query '<关键词>'
|
||||
python3 scripts/agentctl.py catalog overlap --task "$ID" --statement '<设计原文>' [--requirement R-xxx] [--feature <record_id>] [--mutex <key>]
|
||||
# soft 命中须显式裁决后才可编码:
|
||||
python3 scripts/agentctl.py catalog overlap ack --task "$ID" --overlap <oid> --decision proceed|merge_into|supersede|defer --reason '...'
|
||||
```
|
||||
|
||||
硬重叠(同 mutex/feature/scope/R-ID)直接拒绝;向量层失败自动降级到 FTS5,不阻断。
|
||||
|
||||
6. 若新任务:跟 [agentctl-worktree-setup](../agentctl-worktree-setup/SKILL.md)。
|
||||
7. 任何仓库写 → [agentctl-lease-write](../agentctl-lease-write/SKILL.md);合入 → [agentctl-integrate-closeout](../agentctl-integrate-closeout/SKILL.md)。
|
||||
|
||||
## 禁止
|
||||
|
||||
- 主目录直接开发提交;未授权 `git push` / 晋升 test/main
|
||||
- 绕过 `docs apply` 改 CURRENT / FEATURE-MATRIX
|
||||
- 卸载或重启 launchd coordinator(除非用户明示)
|
||||
- 未执行 `catalog overlap` / 未裁决 soft 命中即编码(有 `--requirement`/`--intent`/`--feature`/`--mutex` 绑定时机器强制)
|
||||
|
||||
@@ -23,24 +23,37 @@ python3 ../../scripts/agentctl.py task register \
|
||||
--scope scripts --scope .doc \
|
||||
--capability docs:publish
|
||||
# 需要整文/行级 admin 时再加 --capability docs:admin;证据升 done 加 docs:approve
|
||||
# 若已知需求/功能绑定,追加:
|
||||
# --requirement R-<slug> --intent '<设计原文>' --feature <record_id> --mutex <key>
|
||||
# 有 soft 重叠时 register 会 OVERLAP_ACK_REQUIRED:先 catalog overlap + ack 再重试 register
|
||||
codegraph sync -q # 若建场已 init,此处只需 sync;缺失 CLI 可跳过
|
||||
```
|
||||
|
||||
## CURRENT 认领(docs apply)
|
||||
## 开工前重叠裁决(catalog)
|
||||
|
||||
```bash
|
||||
python3 ../../scripts/agentctl.py docs snapshot \
|
||||
--file .doc/ops/CURRENT.md --record "$ID" > /tmp/claim-snap.json
|
||||
# 新建行:expected_sha256=null
|
||||
cat > /tmp/claim.json <<EOF
|
||||
{"request_id":"$ID-claim-1","changes":[{
|
||||
"file":".doc/ops/CURRENT.md","record_id":"$ID","expected_sha256":null,
|
||||
"replacement":"| <Owner> | $ID | feature/$ID | $WT | <mutex> | in_progress |"
|
||||
}]}
|
||||
EOF
|
||||
python3 ../../scripts/agentctl.py docs apply --task "$ID" --request /tmp/claim.json
|
||||
python3 ../../scripts/agentctl.py catalog overlap \
|
||||
--task "$ID" --statement '<新设计原文>' \
|
||||
[--requirement R-xxx] [--feature <record_id>] [--mutex <key>]
|
||||
# hard → 换 mutex/合并到持有者任务;soft → ack 留痕
|
||||
python3 ../../scripts/agentctl.py catalog ack \
|
||||
--task "$ID" --overlap <oid> \
|
||||
--decision proceed|merge_into|supersede|defer \
|
||||
--reason '<理由>'
|
||||
```
|
||||
|
||||
## CURRENT 认领
|
||||
|
||||
优先用一层封装(内部仍走 `docs apply` CAS):
|
||||
|
||||
```bash
|
||||
python3 ../../scripts/agentctl.py claim new \
|
||||
--task "$ID" --owner <Owner> --mutex <mutex> \
|
||||
[--branch feature/$ID] [--worktree "$WT"] [--replace]
|
||||
```
|
||||
|
||||
手工 `docs snapshot` + `docs apply` 仍可用;行已存在且内容不同时需 `--replace`。
|
||||
|
||||
## short-term 模板字段
|
||||
|
||||
`status`、`write_scope`、`mutex`、`base_dev_sha`、`review_state`/`integration_state`/`deployment`/`cleanup`/`remote_sync`。命名 `.doc/ops/short-term/YYYY-MM-DD-<slug>.md`。
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
name: pi-subagent-dispatch
|
||||
description: Dispatch gmktec PI analysis/review/test subagents via project MCP pi-subagents (roles/run/result). Use when delegating research, planning, reviews, diagnosis, test_run, acceptance_check, or report work—not for code implementation.
|
||||
---
|
||||
|
||||
# PI Subagent 派发
|
||||
|
||||
权威:[模型配置](../../../.doc/ops/2026-09-24-subagent-model-config.md)、[执行器说明](../../../.doc/ops/2026-09-24-pi-subagent-executor.md)、[流程规范](../../../.doc/ops/2026-09-24-subagent-workflow-standard.md)。客户端规则:[pi-subagents](../../rules/pi-subagents.mdc)。阶段落盘:[subagent-stage-record](../subagent-stage-record/SKILL.md)。
|
||||
|
||||
**Cursor Auto 独占代码实施与修复**;本 skill 只走本机 PI 子任务。
|
||||
|
||||
## 调用序列
|
||||
|
||||
1. `pi_subagent_roles` — 只读预览角色/模型(不调 PI)。
|
||||
2. 选 `role_id`(research → planning → reviews → diagnosis → test_run / acceptance_check → report)。
|
||||
3. (推荐)`agentctl pi packet` 生成派发包;**不**触发 run:
|
||||
```bash
|
||||
python3 -B scripts/agentctl.py pi packet \
|
||||
--task "$ID" --role research \
|
||||
--goal '…' --authorization-ref 'user:…' \
|
||||
--source-sha "$(git rev-parse HEAD)" \
|
||||
[--input-file …] [--approved-command '…']… \
|
||||
--request-id "$RID" --write
|
||||
# → .doc/test-reports/assets/pi-subagents/<task>/<request>/packet.json
|
||||
```
|
||||
4. `pi_subagent_run` — 按 packet 字段在 agentctl 租约下异步启动。
|
||||
5. `pi_subagent_result` — 取回收据;轮询至终态。
|
||||
|
||||
CLI 等价:`python3 -B scripts/pi_subagents.py roles|run|result`;`run` 必须包在 `agentctl with --resource path:.doc/test-reports/assets/pi-subagents/<task>/<request>` 内。
|
||||
|
||||
## 请求字段(MCP `pi_subagent_run`)
|
||||
|
||||
外层:`worktree`(已登记任务工作区绝对路径)、`task_id`、`request` 对象。
|
||||
|
||||
`request` 必填:
|
||||
|
||||
| 字段 | 约束 |
|
||||
|---|---|
|
||||
| `role_id` | 配置 §3 中 enabled 角色 |
|
||||
| `request_id` | 任务内稳定唯一;同参重放不重复调模型 |
|
||||
| `goal` | 具体目标;子任务不依赖主会话未传入历史 |
|
||||
| `authorization_ref` | 可回链真实用户授权,禁止日志自授 |
|
||||
| `source_sha` | **完整** 40-hex 提交;禁止 `HEAD`/分支名/短 hash |
|
||||
| `input_files` | 已跟踪 UTF-8 普通文件相对路径数组 |
|
||||
| `timeout_seconds` | 正整数 |
|
||||
|
||||
测试角色(`test_run` / `acceptance_check`)另需:
|
||||
|
||||
- `approved_commands`:argv 数组的数组(如 `[["go","test","-short","./"]]`)
|
||||
- `plan_digest`:外部已批准计划的 SHA-256 hex
|
||||
|
||||
禁止静默 `model_override`;临时改模型写任务 override 并说明用户来源。
|
||||
|
||||
## 租约与输出
|
||||
|
||||
- 资源:`path:.doc/test-reports/assets/pi-subagents/<task_id>/<request_id>`
|
||||
- 产物:`receipt.json`、`report.md`、命令日志(同目录)
|
||||
- 裸调 `run`(无租约)被拒绝
|
||||
|
||||
## 状态分离(红线)
|
||||
|
||||
| 字段 | 含义 |
|
||||
|---|---|
|
||||
| `run_status` | running / succeeded / failed / cancelled / unknown |
|
||||
| `verdict` | pass / changes_required / blocked / not_applicable |
|
||||
| `review_state` | 阶段门禁;模型 succeeded **仅** pending |
|
||||
|
||||
测试 `commands_passed`/`pass` 只针对批准命令证据,不能直接赋给任务 `acceptance`。
|
||||
|
||||
## 常见拒绝码(执行器权威)
|
||||
|
||||
| 码 | 处置 |
|
||||
|---|---|
|
||||
| `INVALID_SOURCE_SHA` | 换完整提交 hash |
|
||||
| `APPROVED_COMMANDS_REQUIRED` | 补 approved_commands + plan_digest |
|
||||
| `MINIMAX_ROLE_FORBIDDEN` | 不把 M3 用于关键角色 |
|
||||
| `INPUT_NOT_TRACKED` / `PATH_OUT_OF_SCOPE` | 收窄 input_files |
|
||||
| `CONCURRENCY_LIMIT` | 串行或等空闲槽 |
|
||||
| `ORPHAN_RUNNING` | 先核进程/副作用,勿盲目重派 |
|
||||
|
||||
Cursor hooks 对形状错误可能 `permission=ask`(advisory);**硬拒绝以执行器为准**。
|
||||
|
||||
## 禁止
|
||||
|
||||
- 把 implementation 派给 PI
|
||||
- 自动换模型 / 伪造 lease / 递归把本修复再派给 PI worker
|
||||
- 用模型叙事冒充 PASS;审查结论须带回报告路径与 receipt 字段
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: subagent-stage-record
|
||||
description: Record PI/Cursor stage handoffs using the subagent stage template (dispatch packet, return, S0–S9 receipt, R-AC-T mapping). Use after PI results, before gate advances, or when closing a multi-stage task.
|
||||
---
|
||||
|
||||
# Subagent 阶段记录
|
||||
|
||||
权威模板:[subagent-stage-record.md](../../../.doc/ops/templates/subagent-stage-record.md);流程:[协作规范](../../../.doc/ops/2026-09-24-subagent-workflow-standard.md)。派发入口:[pi-subagent-dispatch](../pi-subagent-dispatch/SKILL.md)。
|
||||
|
||||
原则:**一步一记录,不必一步一文件**。小任务可把适用段落并入任务主文档;跨模块才拆独立审查/测试/验收证据。
|
||||
|
||||
## 何时写
|
||||
|
||||
- 每次 `pi_subagent_run` 前后:派发包 + 回传
|
||||
- 阶段门禁推进前:S0–S9 收据行
|
||||
- 收口前:R→AC→改动→审查→T→运行验收映射
|
||||
|
||||
## 派发包(最小字段)
|
||||
|
||||
复制到任务文档并填实值:
|
||||
|
||||
- `parent_task_id` / `subtask_id` / `stage_id` / `role_id`
|
||||
- 配置路径 / `config_revision` / `config_sha256`(来自 roles 或 receipt)
|
||||
- 解析后的 provider/model;任务 override 与用户来源
|
||||
- 目标、非目标、授权来源、交付终点
|
||||
- 输入版本:R-ID / AC-ID / 方案版本 / `base_sha` / `head_sha` 或 `source_sha`
|
||||
- cwd / branch / allowed_paths / 只读或写入 / mutex
|
||||
- 完成条件、输出路径、预算与异常处理
|
||||
|
||||
## 子任务回传
|
||||
|
||||
- PI `run_id` / producer / 起止时间
|
||||
- `configured_model` / `actual_model`(不可观察填 `unknown`)
|
||||
- `run_status` 与 `verdict` **分列**(不得把退出成功当质量通过)
|
||||
- 结论与依据、证据链接、脱敏范围
|
||||
- 未覆盖项、风险、遗留进程/产物、接管建议
|
||||
|
||||
只读子 Agent 结论由主 Agent 转存时:保留 `agent_id` 与原结论,注明「由主 Agent 转存」。
|
||||
|
||||
## 阶段收据表
|
||||
|
||||
| 阶段 | 输入版本 | 产物/证据 | producer | reviewer/独立性 | 决定 | 下一步 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| S0–S9 适用项 | | | | independent / self_review / not_required | pass / changes_required / blocked / not_applicable | |
|
||||
|
||||
未执行阶段写 `not_applicable` + 原因。报告存在不自动满足门禁。
|
||||
|
||||
## 需求追踪
|
||||
|
||||
| R-ID | AC-ID | 改动/版本 | 审查 | T-ID / 结果 | 运行验收 | acceptance_owner |
|
||||
|---|---|---|---|---|---|---|
|
||||
| | | | | | | |
|
||||
|
||||
## 与任务五态
|
||||
|
||||
继续用任务模板的 `status`、`review_state`、`integration_state`、`deployment`、`cleanup`、`remote_sync`;额外记 `phase`、`acceptance`、待回收 `subtask_id`。`done` 取决于授权交付终点,不因会话结束自动完成。
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
| 我要… | 读这里 |
|
||||
|--------|--------|
|
||||
| Subagent 模型配置 / 流程 | [可调整模型配置](ops/2026-09-24-subagent-model-config.md) · [PI 执行器](ops/2026-09-24-pi-subagent-executor.md) · [流程草案](ops/2026-09-24-subagent-workflow-standard.md) · [研究依据](audit/2026-09-24-subagent-workflow-research.md) |
|
||||
| 规则来源/生效版本 | [规范登记](ops/2026-09-21-policy-registry.md) |
|
||||
| 选择测试/报告范围 | [验证契约](ops/2026-09-21-validation-contract.md) |
|
||||
| 任务模板与会话收口 | [任务模板](ops/templates/short-term-task.md) · [收口清单](ops/templates/session-close-checklist.md) |
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
# 管理员重置密码 / 登录凭据缺陷 — 问题主记录
|
||||
|
||||
更新:2026-09-24。任务:`admin-password-reset-2026-09-24`。
|
||||
|
||||
## ISSUE-20260924-admin-reset-dead
|
||||
|
||||
### 问题
|
||||
|
||||
管理台「重置密码」按钮调用 `authClient.adminResetPassword`,客户端硬 `throw`,后端无 `reset-password` 路由;UI 仍硬编码 `ResetPass123` 暗示成功。验收脚本曾重置 `chenwei` 哈希且不披露口令后,管理员无法通过 UI 恢复访问。
|
||||
|
||||
### 根因
|
||||
|
||||
T20-F4 已设计未实施(选项 B 卡产品)。`password_changed_at` 停在 2026-09-20 证明重置从未入库。
|
||||
|
||||
### 修复
|
||||
|
||||
`POST /api/v1/admin/users/{id}/reset-password`:服务端随机临时口令、`must_change_password=true`、撤销会话、审计表 `user_password_reset_audits`(goose 00067);前端接线并去掉硬编码。
|
||||
|
||||
### 状态
|
||||
|
||||
resolved(本任务合入后)。
|
||||
|
||||
---
|
||||
|
||||
## ISSUE-20260924-login-error-envelope
|
||||
|
||||
### 问题
|
||||
|
||||
登录失败响应 `code=AUTHZ` / `message=无权访问`,前端再把整段 JSON 原文塞进 `Error.message`,用户误判为权限问题。
|
||||
|
||||
### 根因
|
||||
|
||||
`httpx.CodeFromStatus(401)=AUTHZ` + `SafeMessage`;`auth.ts` login 未用信封解析、未优先 `error` 领域字段。
|
||||
|
||||
### 修复
|
||||
|
||||
`authErrorMessage` 优先取信封 `error`;不改全局 AUTHZ 映射(事件复用与安全取舍另立专项)。
|
||||
|
||||
### 状态
|
||||
|
||||
resolved。
|
||||
|
||||
---
|
||||
|
||||
## ISSUE-20260924-zombie-credentials
|
||||
|
||||
### 问题
|
||||
|
||||
`CreateUser` 在 `PasswordHash==""` 时静默跳过 `user_credentials` 插入;`LEFT JOIN` + `COALESCE` 使登录哈希为空串,任意密码均失败且报错与真凭据错误相同。
|
||||
|
||||
### 盘点(只读,2026-09-24)
|
||||
|
||||
| 环境 | total | missing_cred | empty_username |
|
||||
|---|---|---|---|
|
||||
| dev | 416 | 263 | 255 |
|
||||
| test | 9 | 0 | 0 |
|
||||
| main | 4 | 3 | 0 |
|
||||
|
||||
main 三行为 goose 00011 seed(`seed-admin` 等),非业务用户。本任务**不清理**存量;仅 fail-closed 防新增。
|
||||
|
||||
### 修复
|
||||
|
||||
PgStore/MemoryStore `CreateUser` 拒绝空哈希;`Login` 对空哈希记 `slog.Warn(user_id)` 仍统一 401。
|
||||
|
||||
### 状态
|
||||
|
||||
resolved(机制);存量清理 = open / 另授权。
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
issue_id: ISSUE-20260924-cursor-hook-event-contract
|
||||
issue_state: open
|
||||
severity: medium
|
||||
owner: Cursor
|
||||
task_ids: [cursor-governance-hooks-2026-09-24]
|
||||
created: 2026-09-24
|
||||
occurred_at: 2026-09-24
|
||||
updated: 2026-09-24
|
||||
recurrence_count: 0
|
||||
evidence_basis: current
|
||||
lesson_ids: [LESSON-20260924-cursor-hook-advisory-gates]
|
||||
---
|
||||
|
||||
# Cursor hook 事件字段契约未文档化
|
||||
|
||||
## 事实与证据
|
||||
|
||||
预期:`beforeMCPExecution` / `sessionStart` / `stop` 的 stdin 字段名与 matcher 匹配串在官方文档中明确,便于 failClosed 硬门禁。
|
||||
实际:官方 create-hook skill 仅明确 `beforeShellExecution` 的 `command` 字段;`beforeMCPExecution` 不支持 `updated_input`;`sessionStart` 无文档化返回字段可注入上下文;`MCP: ...` matcher 形式只写给 `preToolUse` 族。实现层字符串探测存在 `mcp_server_name`/`tool_name`/`tool_input`,但非文档契约。
|
||||
|
||||
证据:本任务调研记录;单元测试用多名容错驱动;真实 Cursor IDE 事件采样待 `CURSOR_HOOKS_PROBE=1`。
|
||||
|
||||
## 根因与同类范围
|
||||
|
||||
客户端 hook API 文档滞后于实现。同类:任何依赖未文档化 hook 输入的 failClosed 门禁都有假阴性/假阳性风险。
|
||||
|
||||
## 修复思路与过程
|
||||
|
||||
| 日期 | 动作 | 结果 | 下一步 |
|
||||
|---|---|---|---|
|
||||
| 2026-09-24 | 落地 advisory hooks + 多名容错 + probe 开关;异形 fail-open | 单元回归 PASS | 用户触发真实 MCP/shell 事件采样后收紧 |
|
||||
|
||||
## 验收与关闭
|
||||
|
||||
- 静态/单元:已覆盖(见测试报告)
|
||||
- 实机:打开 `CURSOR_HOOKS_PROBE=1`,触发一次 `pi_subagent_roles` 与一次 shell,归档 `.cursor/hook-probe.jsonl` 片段到测试报告 assets;确认字段名后可将 matcher/`failClosed` 收紧并将本 issue → verifying/resolved
|
||||
|
||||
## 经验与复发
|
||||
|
||||
见 [LESSON-20260924-cursor-hook-advisory-gates](../ops/lessons/2026-09-24-cursor-hook-advisory-gates.md)。
|
||||
|
||||
## 2026-09-24 IDE 采样更新
|
||||
|
||||
- `postToolUse` 审计:`tool_name` / 审计字段为 `MCP:pi_subagent_roles`(带 `MCP:` 前缀)。
|
||||
- 修复:`_lib.normalize_tool_name` 剥前缀;回归 `test_ask_mcp_prefixed_tool_name_bad_sha`。
|
||||
- `pi_subagent_roles` IDE MCP 调用 PASS;`postToolUse` 收据 checklist 已注入。
|
||||
- `beforeMCPExecution` 完整 stdin 仍缺(Cursor 进程未设 `CURSOR_HOOKS_PROBE=1`);issue 保持 verifying。
|
||||
- `agentctl`/`jev` 未出现在 IDE MCP 缓存目录;进程可手动 stdio 启动;与路径修复独立,另记。
|
||||
@@ -0,0 +1,37 @@
|
||||
# ISSUE-20260924-non-author-400-duty
|
||||
|
||||
## 摘要
|
||||
|
||||
非编制项目成员无法上传/总结/对话写草稿;权限错误经 `writeDocGovError` 默认落成 HTTP **400**。
|
||||
|
||||
## 根因
|
||||
|
||||
1. `domainHTTPStatus` 未映射 `ErrOnlyAuthorCanEdit` / `ErrReviewerCannotEdit` / `ErrApproverCannotEdit` → 403。
|
||||
2. `classifyAccess` / `AllowedTaskKeys` / `CanEditDocumentContent` 将 run/edit 绑编制职责(三道门协同过宽)。
|
||||
3. 前端写意图路由偶发把「总结+写动词」送入 task run。
|
||||
|
||||
## 处置(deny_only_submit)
|
||||
|
||||
- run/edit → 项目成员级;submit/review/approve 保留职责门禁。
|
||||
- AuthorID 仍归编制职责人(`docduty.Resolve` 不变)。
|
||||
- 人工编辑传 `ActorIsMember`,不复用 `RoleSystem`。
|
||||
|
||||
## 验证
|
||||
|
||||
见 [测试报告](../test-reports/2026-09-24-non-author-member-access-test-report.md);真实 PI PASS。
|
||||
|
||||
## 状态
|
||||
|
||||
resolved(2026-09-24)
|
||||
|
||||
## 五态收口(2026-09-24)
|
||||
|
||||
| 字段 | 值 |
|
||||
|---|---|
|
||||
| review_state | accepted(真实 PI `TestNonAuthorMember_PiAgent_RunEditSubmitGates` PASS;工程门禁 PASS) |
|
||||
| integration_state | merged_local_dev(`dev@e98e2d71`;feature tip `8b2621a4` 为祖先) |
|
||||
| deployment | not_required(本轮未要求加载 launchd 业务制品) |
|
||||
| cleanup | pending(`.worktrees/non-author-member-access-2026-09-24` 与 integrate 现场待独立维护者复查后清理;禁止 `--force`) |
|
||||
| remote_sync | pushed(`origin/dev` = `e98e2d71`,`./scripts/git-push-dev.sh dev` 已成功) |
|
||||
|
||||
相关 agentctl 任务:`non-author-member-access-2026-09-24`、`non-author-member-access-docs-2026-09-24`、`integrate-non-author-docs-2026-09-24` 均为 `done`。
|
||||
@@ -0,0 +1,45 @@
|
||||
# PI Subagent 执行器初版边界审查
|
||||
|
||||
task_id:subagent-workflow-standard-2026-09-24;issue_id:ISSUE-20260924-pi-executor-boundaries。
|
||||
owner:Cursor(修复)/ Codex(复核);issue_state:resolved;severity:high。
|
||||
本记录针对尚未发布的执行器初版,不表示 dev 或产品 Runner 存在这些实现。
|
||||
|
||||
## 事实与机制
|
||||
|
||||
1. 独立验证发现 PI 内置工具的路径规范化与扩展守卫不一致。安装版本 0.85.1 的 tools/path-utils.js 中 resolveToCwd 使用 stripAtPrefix 并展开 home;初版守卫使用 path.resolve(root,input)。
|
||||
2. 以专门创建的 /tmp/pi-guard-audit-* 临时目录及 outside.txt 假文件测试 @绝对路径,实际结果为 guard_blocked=false、actual_tool_path_escapes=true。没有读取真实密钥或业务文件。
|
||||
3. 同类范围:@ 前缀、~ 前缀、相对父路径、符号链接、Unicode/读取路径规范化;MCP 的同仓/工作区验证和临时文件写入;报告幂等与损坏收据;进程树/输出上限/环境变量隔离。
|
||||
4. 初版静态阅读另发现:跨仓 MCP 可能执行目标仓脚本;输出仅在 communicate 完成后截断;只回收仍存活 leader 的进程组;测试环境黑名单不足;模型报告用关键词推导 PASS。上述需要实现修复和负例,不以本行代替实测。
|
||||
5. 初版测试夹具存在 eager stderr.read(),在 MCP 仍存活时阻塞。host 两次仅终止 /tmp/pi-subagent-test-* 的假 MCP 子进程以释放测试,未终止产品或用户进程。
|
||||
|
||||
## 复现与迭代
|
||||
|
||||
- 初次 RED:19 项,7 failures / 11 errors,主实现未创建;存在性/调用失败为已缺失功能,不当作实现通过。
|
||||
- 初版回归:19 项,4 failures / 7 errors;耗时含夹具死锁处理。后续错误数不作为发布质量结论,待主机完整重跑。
|
||||
- Cursor 首轮 supervisor 已由 host 为明确的修复交接发送 TERM,退出143;源文件保留。没有未知写副作用后盲目重派,第二轮是带具体修复清单的新执行。
|
||||
- 本机 Qwen3.8-Flash、GLM-5.3-Flash 无工具短请求连通通过,实际 provider/model 与配置一致,正常 stop + agent_end/agent_settled。仅连接证据。
|
||||
- GLM-5.3 对初版整包快照的只读审查 300 秒超时,无完整结论;不报审查 PASS。进程由 subprocess 超时处理结束,未授予工具,无仓库写入。
|
||||
|
||||
## 修复与验收要求
|
||||
|
||||
Cursor 修复清单已交接:统一/拒绝路径规范化;MCP 同仓注册验证和无租约写入;有界双向进程通信/整体回收;测试环境白名单;严格请求/配置与冻结 SHA;损坏收据禁止重派;报告完成与审查通过分离;最终事件完整性;禁用 PI 隐式重试;相关真实 Git/进程/MCP 回归。
|
||||
|
||||
关闭条件:静态发现均落实对应修复或有证据排除;原例与同类负例通过;真实 PI 调用经新执行器完成;审查与测试报告保存。修复中,不新增 validated 经验;验证后再总结。
|
||||
|
||||
## 2026-09-24 修复关闭
|
||||
|
||||
issue_state=resolved 仅针对未发布初版的约定缺陷;代码提交 69ffaa677e23a1dd9aa0528bb09b3acfcd38b119,主机完整工程回归 173 项通过,提交后专项 34 项通过;最终 Cursor CLI→MCP→PI 中 ls/read 全通过。实际覆盖、早期失败和独立 GLM 审查边界见[报告](../test-reports/2026-09-24-pi-executor-test-report.md)。
|
||||
新增[经验](../ops/lessons/2026-09-24-pi-tool-boundaries.md)。本文件前面的“修复中/待验证”为初版历史,当前结论以本节为准。dev 集成/客户端 IDE 验收不由本问题关闭状态推导。
|
||||
|
||||
## cursor-cli-mcp-path
|
||||
|
||||
issue_id:ISSUE-20260924-cursor-cli-mcp-path;issue_state:deferred;severity:medium;owner:工程维护;日期:2026-09-24。
|
||||
本机 Cursor CLI 2026.09.18 在项目 MCP args 中未展开 workspaceFolder 变量,原样传给 Node。pi-subagents 新入口已改工作区相对路径并实测通过。
|
||||
同类只读检查:agent mcp list 也显示既有 agentctl / jev Connection failed,它们仍使用相同变量写法;codegraph ready。未进一步修改/验收这两个既有服务,也未断言 IDE 同样失败。官方支持声明与本机观测须分开。
|
||||
此残差不阻塞 PI MCP(其内部直接调用主仓治理 CLI),不构成本轮产品发布结论;后续由工程维护在 Cursor CLI 升级或这两项 MCP 接入验收时检查路径/stdio 协议,形成独立修复与实际客户端证据。仅保留问题,不宣称已修复。
|
||||
|
||||
|
||||
## cursor-cli-mcp-path 续:NDJSON 回包
|
||||
|
||||
2026-09-24 IDE:`pi-subagents`/`codegraph` ready;`agentctl`/`jev` 不在 MCP 缓存。
|
||||
根因补充:后两者 `send()` 使用 `Content-Length` 帧,而可加载的 `pi-subagents` 使用换行分隔 JSON-RPC。已改为 NDJSON 回包并补 `"type":"stdio"`;仍接受 Content-Length 请求。单元:`scripts/tests/test_mcp_ndjson_framing.py`。IDE 重载后需再核 `list-tools`。
|
||||
@@ -0,0 +1,111 @@
|
||||
# Cursor Auto 与 Subagent 工作流研究及文档验证报告
|
||||
|
||||
日期:2026-09-24;owner:Codex;task_id:subagent-workflow-standard-2026-09-24。
|
||||
范围:现行规范、Cursor 项目配置及官方文档;交付[规范草案](../ops/2026-09-24-subagent-workflow-standard.md)。未运行 Cursor 对话/真实 subagent,未修改产品或运行环境。
|
||||
|
||||
## 1. 研究结论
|
||||
|
||||
推荐主 Agent 协调、按需委派、独立审查与验证的流程。用户提出的八步可作为起点,但需在开始明确授权/验收标准,在方案阶段设计测试,在实施中自测,合并后核对实际运行结果,最后归档和清理。
|
||||
|
||||
| 方案 | 收益 | 代价/缺陷 | 结论 |
|
||||
|---|---|---|---|
|
||||
| 单 Agent 顺序完成全部阶段 | 简单、额外上下文成本低 | 实施者自审容易沿用错误假设 | 适合小型文档/研究;代码交付补独立审查 |
|
||||
| 每阶段固定一个 Agent / 固定模型 | 阶段职责直观 | 无效启动和文档重复;固定模型背离 Auto;阶段间易丢授权/版本 | 不采用 |
|
||||
| 主 Agent + 按需 analyst/reviewer/verifier | 保留上下文入口,独立检查,成本可控 | 需可靠派发包、证据接收和异常恢复 | 推荐;实现并行按风险逐步启用 |
|
||||
|
||||
这是本项目基于现状的设计判断,不是 Cursor 平台保证。
|
||||
|
||||
## 2. 官方能力与推论
|
||||
|
||||
查阅日期为 2026-09-24。在线文档会变化,客户端接入必须另验;不采用社区传闻作为技术契约。
|
||||
|
||||
| 来源 | 查证事实 | 对本规范的影响 |
|
||||
|---|---|---|
|
||||
| [Cursor Subagents](https://cursor.com/docs/subagents) | 自定义角色可位于 .cursor/agents;model 默认 inherit;readonly 与后台字段可配置;子上下文需要主 Agent 提供输入;默认共享 checkout | 采用继承策略、显式交接、仓库管理的写隔离;只读报告由主 Agent 保存 |
|
||||
| [Cursor Models & Pricing](https://cursor.com/docs/models-and-pricing) | Auto 是平台模型路由选项,公开文档列有不同优化模式 | 规则不绑定模型、价格或固定路由;按实际 UI/账户能力记录 |
|
||||
| [Cursor Rules](https://cursor.com/docs/rules) | 支持 AGENTS.md 和项目规则 .mdc | 根入口/客户端入口只指向单一规范,避免重复规则漂移 |
|
||||
|
||||
推论与限制:inherit 能表达继承意图,不足以证明实际模型身份或所有 Auto 请求的路由;独立上下文不保证跨模型独立性;只读权限与运行测试的写产物需要区别处理。Auto 可用性、角色加载、权限、真实派发及费用均未在本会话实测,不保证任何套餐或所有版本可用。云执行不在本次授权与建议默认范围内。
|
||||
|
||||
## 3. 当前仓库证据
|
||||
|
||||
检查基线:dev = 5423b261f97f371bdf7fa5066e9305f9eddaef42;本地 origin/dev 跟踪引用比较为 ahead 74 / behind 0。未 fetch,不能据此声明服务器当前引用。
|
||||
|
||||
- AGENTS / PROJECT:已定义授权分级、任务 worktree、独立状态、业务实施和研究边界。
|
||||
- worktree 操作规范:已有 agentctl 租约、候选验证/合入、共享环境持锁、清理负例和收口要求。
|
||||
- 验证契约:依据变更范围取并集,要求真实用户流程与持久证据;文档变更不要求产品回归。
|
||||
- 文档地图/任务模板:已有最小文档原则,可以按阶段留证而不制造九份重复文档。
|
||||
- .cursor/rules:已有 agentctl、文档、Git 和测试入口。rg --files .cursor 未发现项目 .cursor/agents 角色定义;不推断用户全局目录没有角色。
|
||||
- .cursor/hooks.json:存在 beforeShellExecution 的 Git 守卫;未见本流程阶段完整性校验。此处仅配置阅读,没有实际触发 hook。
|
||||
- cursor --version:3.21.16 / 8ae78e8eee1e63479c7e0504b664bc0a80c68000 / x64;agent --version:2026.09.18-9a7762b。CLI 版本不代表 IDE 当前会话配置已验收。
|
||||
- agentctl status:当前配置 policy_revision 为 agent-governance-2026-09-23-fav-constraint-restored;存在其他任务持 env:dev。研究不使用该环境,不改他人任务。
|
||||
|
||||
已读规范修订与工具配置 revision 不同,记录两者分别是什么,不把一个全局字段视作所有 Markdown 修订版本。
|
||||
|
||||
## 4. ISSUE-20260924-cursor-test-rule-drift
|
||||
|
||||
issue_state:open;严重度:medium;owner:Codex(研究);evidence_basis:本次源码/配置阅读;产品影响未复现。
|
||||
预期:客户端测试规则只引用验证契约,由适用范围和批准环境决定套件/Runner。
|
||||
实际:.cursor/rules/test-reports-standard.mdc(alwaysApply=true)仍要求报告附全量 go test -v ./...,固定 MiniMax-M2.7-highspeed,并指向已不存在的 PROJECT §8。与验证契约中的范围选择、实际批准模型、普通小任务记录方式不一致。
|
||||
|
||||
已证实机制:客户端复制完整测试规则形成第二份来源,主规范修订后副本继续陈旧。未证实:实际 Cursor 是否因此执行了错误模型/测试、费用或运行行为是否受影响。
|
||||
为何已有保护不足:静态读取显示没有针对该副本文案与验证契约的一致性证据;本次没有运行 hook/CI,不能断言所有自动防护都缺失。
|
||||
同类检查范围:.cursor/rules 下五个规则文件及 hooks 配置、根 AGENTS/PROJECT、验证契约、规范登记、任务/收口模板。其余四个 mdc 主要转发入口;本次未检查所有其他客户端和全局规则。
|
||||
|
||||
推荐修复:将该 mdc 缩为验证契约与报告路径指针;结构要求归并现有权威文件,避免再复制模型与全量命令。不是改产品 Runner 模型或删除必要验证。
|
||||
验收:规则文本无固定模型/无条件全量测试/失效章节;文档任务、Go 任务、产品 PI 任务分别映射到既有验证矩阵;Cursor 实际读取入口并正确选择验证层级。静态修复与实机行为分别报告。
|
||||
时间线:2026-09-24 发现并登记;本次仅提出修复,未实施,issue 保持 open。无新 validated lesson;未验证修复不包装成经验。
|
||||
|
||||
## 5. 风险和关键设计
|
||||
|
||||
- 阶段和角色不是一对一关系:固定九名 Agent 会增加交接成本;初期三角色足够,主 Agent 可实施。
|
||||
- 只读 reviewer 无法自行写审查文件:主 Agent 转存并保留作者/ID,避免“要求只读同时要求落盘”的矛盾。
|
||||
- verifier 运行构建/测试会写缓存、数据甚至环境:单独授权,持对应租约,不能装作普通只读检查。
|
||||
- 子 Agent 默认共享目录:采用单写者;并行写另建登记 worktree,主会话的自动隔离配置不替代仓库门禁。
|
||||
- 审查和测试必须绑定版本:修复后重审受影响范围;候选变化重验;运行制品与报告提交分开。
|
||||
- 清理在验收后:唯一日志/截图先归档,owner 退出后由维护者复查,不主动删除当前使用的工作区。
|
||||
- 人工确认默认在可审方案形成后;已有端到端授权则沿用。用户未回复偏好,本草案采用该可调整默认,不把沉默当批准。
|
||||
- 模型路由和自动审批不同:Auto 不扩大业务或环境权限,普通 Cursor 不套用 Herdr 固定模型。
|
||||
- 阶段规范为 manual;文档审核通过不等于自动执行系统已实现。
|
||||
|
||||
## 6. 文档验收与未运行项
|
||||
|
||||
本次仅文档研究。静态检查结果在任务“验证与证据”节记录;检查对象为本次全部变更文件内容。
|
||||
情景自审覆盖:研究-only、简单文档、标准功能、修复回环、并行冲突、readonly 转存、子任务未知、候选变化、验收失败、清理拒绝、上下文恢复。该项是文档推演,不能作为运行负例 PASS。
|
||||
|
||||
本次未执行:Cursor Auto 真实派发、Cursor 项目角色配置安装、并行写锁实测、业务测试、产品 PI、浏览器、部署和清理。新规范的 V1–V10 实机清单是后续接入验收项。
|
||||
|
||||
## 7. 文档情景自审记录
|
||||
|
||||
审查者:Codex 主 Agent;独立性:self_review。以下为阅读草案逐项推演,结果仅表示文字路径可执行,不表示已运行客户端。
|
||||
|
||||
| 情景 | 对照位置 | 结论 |
|
||||
|---|---|---|
|
||||
| 只研究方案,未授权实现 | §2、S3 | 可交付研究,其后标不适用;不会顺推业务实现 |
|
||||
| 一处低风险文档修改 | §4、§7 | 主 Agent 自检,一份主文档可承载阶段,无需九个角色 |
|
||||
| 代码已修改但审查未回收 | S5、§5 | 不进入集成;后台结果需接收 |
|
||||
| 修复后旧审查/旧测试仍通过 | S5–S7 | 新版本需适用复核与验证,旧 PASS 不覆盖 |
|
||||
| readonly reviewer 需要报告 | §4、§7 | 子角色回传,主 Agent 在租约内转存 |
|
||||
| 测试生成缓存或写环境 | S6、§8 | verifier 可写但须明确产物范围/环境与租约 |
|
||||
| 两个子任务争用同路径 | §5 | 单写者或独立登记隔离,不能无锁并发 |
|
||||
| 子任务超时且副作用未知 | §6 | 保留 unknown,核对现场后决定恢复 |
|
||||
| 合并前 dev 已变化 | S7 | 重建候选并重新验证 |
|
||||
| 已合入但运行验收失败 | S8、S9 | 不宣布完成、不清理;修复/交接 |
|
||||
| owner 仍在 worktree 或有唯一日志 | S9、§5 | 保留现场,归档后由独立维护者复查 |
|
||||
| 会话中断后恢复 | §6、§7 | 从首个未满足门禁继续,核对未回收子任务 |
|
||||
|
||||
初次静态检查真实输出:`FILES=8 LOCAL_LINKS=84 STAGES=10 ISSUE_IDS=5 / PASS`。
|
||||
命令:`git diff --check`(exit 0);Python 内联检查全部本次 Markdown 变更(含 untracked)的相对链接/锚点、S0–S9、规则状态字段和 issue ID 唯一性(exit 0)。不验证外部网页永久可达或实际 Cursor 行为。
|
||||
只读 `agentctl docs drift`:status=ok、regressions=[];开放能力候选未修改,不等于产品就绪。
|
||||
|
||||
## 8. 后续决策:本机 PI 与可调整模型配置
|
||||
|
||||
用户在同一任务后续对话明确:子智能体采用 gmktec 本机 PI;仅允许 minimax-cn/MiniMax-M3、zai-coding-cn/glm-5.3、zai-coding-cn/glm-5.3-flash、qwen-token-plan-cn/qwen3.8-max、qwen-token-plan-cn/qwen3.8-flash。随后明确代码由 Cursor 实施,并因 M3 的实际使用反馈将其移出默认流程,最后确认该默认安排并要求可调整文档。
|
||||
|
||||
这些用户决策取代本报告前文 r1 中 Cursor 原生 .cursor/agents/inherit 的接入建议;前文保留为研究历史,不再作为当前实现方向。现行模型映射唯一来源为[模型配置](../ops/2026-09-24-subagent-model-config.md),流程草案同步到 r2。没有改变 Herdr 或产品 Runner。
|
||||
|
||||
2026-09-24 再次执行 pi --offline --no-extensions --no-skills --no-prompt-templates --no-themes --no-context-files --no-approve --list-models,exit 0;精确五个 provider/model 均存在。此命令没有模型推理,不证明各角色能力或连接状态。配置字段由主 Agent 人工读取,当前不含执行器/热加载/自动校验实现。
|
||||
|
||||
## 9. 执行器已接入(后续实现)
|
||||
|
||||
用户进一步授权接入自动调用 PI 的执行器。代码提交 69ffaa677e23a1dd9aa0528bb09b3acfcd38b119,真实 Cursor CLI→MCP→PI 和 173 项工程回归通过,详情见[验证报告](../test-reports/2026-09-24-pi-executor-test-report.md)及[运行说明](../ops/2026-09-24-pi-subagent-executor.md)。前文关于未接入/未调用的说明属于当时研究阶段;当前交付范围与未覆盖项以上述新报告为准。完整流程草案审批、dev 集成和远端同步分别记录。
|
||||
+10
-2
@@ -2,11 +2,19 @@
|
||||
|
||||
维护规则:[问题记录与开发经验闭环](../ops/2026-09-23-issue-learning-workflow.md)。每个问题一个稳定 ID;主记录是事实与状态来源,本表为可检索投影。新发现及时登记,修复后保留记录;发布 blocker 仍见 [gap-matrix](../remediation/gap-matrix.md)。
|
||||
|
||||
更新:2026-09-23。本轮为初始建库,仅补录两个历史案例;下列历史 resolved 不表示本日运行回归通过。
|
||||
更新:2026-09-24。Cursor 治理层:测试规则漂移/MCP 路径改为 verifying;新登记 hook 事件契约 issue;历史 resolved 不表示本日产品回归通过。
|
||||
|
||||
| issue_id | 模块 / 检索词 | 问题 | 严重度 | issue_state | owner | 证据日期 / 范围 | 唯一主记录 | 经验 |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
| ISSUE-20260923-nullable-duty | docgov / nullable / 23503 / reviewer_id | 可选职责空值写 0 导致 FK 失败 | high | resolved | Codex(历史补录) | 2026-09-17;历史 PG / API 冒烟;当前未复测 | [主记录](2026-09-23-historical-issue-records.md#nullable-duty) | [LESSON-20260923-nullable-duty](../ops/lessons/2026-09-23-nullable-duty.md) |
|
||||
| ISSUE-20260923-content-hash | docrevision / canonicalize / hard-break / 404 | 规范化破坏 Markdown 语义并造成正文哈希漂移 | critical | resolved | Codex(历史补录) | 2026-09-14;历史真实 UI / 重启;当前未复测 | [主记录](2026-09-23-historical-issue-records.md#content-hash) | [LESSON-20260923-content-hash](../ops/lessons/2026-09-23-content-hash.md) |
|
||||
| ISSUE-20260923-coordination-authority | agentctl / claim / SQLite / CAS / CURRENT / FEATURE-MATRIX | 本地副本 CAS 与任务许可不能表达跨主机全局权威认领 | high | investigating | Codex(研究) | 2026-09-23;源码/只读状态,未复现具体丢写 | [主记录](../ops/short-term/2026-09-23-coordination-db-daemon-research.md#issue-20260923-coordination-authority) | 沿用 content-hash 投影经验;跨机结论待实施验证 |
|
||||
| ISSUE-20260923-matrix-status-regression | FEATURE-MATRIX / module-batches-ag / merge / docs-apply | 矩阵行 done 被 closeout 合并冲突手解回退为 planned | high | resolved | Cursor | 2026-09-23;本机 dev tip 与 git 考古;docs apply 已恢复 | [主记录](2026-09-23-matrix-status-regression.md) | [LESSON-20260923-matrix-status-cas](../ops/lessons/2026-09-23-matrix-status-cas.md) |
|
||||
| ISSUE-20260923-matrix-status-regression | FEATURE-MATRIX / module-batches-ag / merge / docs-apply | 矩阵行 done 被 closeout 合并冲突手解回退为 planned | high | resolved | Cursor | 2026-09-23;本机 tip 与 git 考古;docs apply 已恢复 | [主记录](2026-09-23-matrix-status-regression.md) | [LESSON-20260923-matrix-status-cas](../ops/lessons/2026-09-23-matrix-status-cas.md) |
|
||||
| ISSUE-20260924-admin-reset-dead | auth / adminResetPassword / T20-F4 / chenwei | 管理台重置密码死按钮;验收口令不可知后无法恢复 | high | resolved | Cursor | 2026-09-24;test 库实查 + API 单测 | [主记录](2026-09-24-admin-password-reset-issues.md#issue-20260924-admin-reset-dead) | 待补 LESSON |
|
||||
| ISSUE-20260924-login-error-envelope | auth / AUTHZ / 无权访问 / auth.ts | 登录失败展示裸 JSON / 「无权访问」误导 | medium | resolved | Cursor | 2026-09-24;wire 复现 + 前端单测 | [主记录](2026-09-24-admin-password-reset-issues.md#issue-20260924-login-error-envelope) | 待补 LESSON |
|
||||
| ISSUE-20260924-zombie-credentials | auth / user_credentials / LEFT JOIN / CreateUser | 空哈希静默建号导致永久无法登录 | high | resolved | Cursor | 2026-09-24;三环境只读盘点;机制修复不含存量清理 | [主记录](2026-09-24-admin-password-reset-issues.md#issue-20260924-zombie-credentials) | 待补 LESSON |
|
||||
| ISSUE-20260924-cursor-test-rule-drift | Cursor / test-reports / 固定模型 / 规则副本 | Cursor 测试规则与验证契约存在固定模型及范围冲突 | medium | verifying | Cursor | 2026-09-24;规则文本已缩为验证契约指针;客户端实际读取行为待实机 | [主记录](2026-09-24-subagent-workflow-research.md#4-issue-20260924-cursor-test-rule-drift) | [LESSON-20260924-cursor-hook-advisory-gates](../ops/lessons/2026-09-24-cursor-hook-advisory-gates.md) |
|
||||
| ISSUE-20260924-pi-executor-boundaries | PI executor / 路径规范化 / MCP / 子进程 / 幂等 | 未发布初版只读边界与执行可靠性缺陷 | high | resolved | Cursor/Codex | 2026-09-24;173 工程回归与真实 Cursor CLI/MCP/PI | [主记录](2026-09-24-pi-executor-boundaries.md) | [工具路径与输入隔离](../ops/lessons/2026-09-24-pi-tool-boundaries.md) |
|
||||
| ISSUE-20260924-cursor-cli-mcp-path | Cursor CLI / MCP / workspaceFolder / NDJSON | agentctl/jev MCP 加载失败(路径 + Content-Length 回包) | medium | verifying | Cursor | 2026-09-24;相对路径+NDJSON 已修;待 IDE 重载后 list-tools 实机 | [主记录](2026-09-24-pi-executor-boundaries.md#cursor-cli-mcp-path) | [LESSON-20260924-cursor-hook-advisory-gates](../ops/lessons/2026-09-24-cursor-hook-advisory-gates.md) |
|
||||
| ISSUE-20260924-cursor-hook-event-contract | Cursor / hooks / beforeMCPExecution / probe | hook 事件 stdin 字段名与 matcher 官方未文档化 | medium | verifying | Cursor | 2026-09-24;IDE postToolUse tool_name=`MCP:pi_subagent_roles` 已采样;beforeMCP 全量 stdin 仍缺 | [主记录](2026-09-24-cursor-hook-event-contract.md) | [LESSON-20260924-cursor-hook-advisory-gates](../ops/lessons/2026-09-24-cursor-hook-advisory-gates.md) |
|
||||
| ISSUE-20260924-non-author-400-duty | iam-authz / docgov / duty / 400 / 非编制 | 权限不足误报 400;run/edit 与编制职责绑死导致成员无法上传总结写草稿 | high | resolved | Cursor | 2026-09-24;真实 PI `TestNonAuthorMember_PiAgent_RunEditSubmitGates` PASS | [主记录](2026-09-24-non-author-member-access.md) | [LESSON-20260924-deny-only-submit](../ops/lessons/2026-09-24-deny-only-submit.md) |
|
||||
|
||||
@@ -16,7 +16,10 @@
|
||||
| GET /api/v1/tasks/runs/{id} | task_run | view | taskrun | 403 非 owner/非 owner 成员 |
|
||||
| POST /api/v1/tasks/runs/{id}/cancel | task_run | cancel | taskrun | 403 取消他人 |
|
||||
| POST /api/v1/chat/stream | chat | send | chat+stage | 403 无阶段权限 |
|
||||
| GET /api/v1/docgov/* | document | * | docgov+duty | 403 非职责人 |
|
||||
| GET /api/v1/docgov/* | document | * | docgov+duty | view:成员;run/edit:成员(deny_only_submit);submit/review/approve:对应职责,403 |
|
||||
| POST /api/v1/docgov/content | document | edit | docgov+member | 403 非项目成员或锁定态 |
|
||||
| POST /api/v1/docgov/submit-review | document | submit | docgov+author | 403 非编制职责人 |
|
||||
| POST /api/v1/tasks/run | task | run | bizdev+member | 403 非成员 / 非活动阶段;不再要求编制职责 |
|
||||
| GET /api/v1/admin/* | admin | * | authz RBAC | 403 非 admin/细粒度 perm |
|
||||
| GET /health, /api/v1/health | system | health | server | 公开 |
|
||||
|
||||
|
||||
@@ -45,3 +45,23 @@ CURRENT 是带时间的活跃协调快照;Git/机器状态用于核验实际
|
||||
修订 ID:`codegraph-governance-2026-09-24-r1`;owner:`Cursor`;state:`active`(生效 tip `19eb56e3744d3c7d4b69b065c87e27689e8caa53` / fixup `0c676afe1faf831020c7c3201509d7cec0328d53`);工具能力:盘点命令与 hooks sync 为 `enforced`(脚本已落地);常驻 daemon 装载仍为 `manual`(本机默认不装载)。用户授权:将 CodeGraph 纳入治理启动/建场/sync,并对 worktree 清理与 FEATURE-MATRIX 做只读盘点提醒(不自动删除、不自动升 done)。
|
||||
|
||||
唯一来源增补:[AGENTS §1/§4](../../AGENTS.md)、[worktree 操作规范 §8](./2026-09-21-agent-worktree-workflow.md)、[收口清单](./templates/session-close-checklist.md)。命令入口:`agentctl cleanup report`、`agentctl docs drift`、`agentctl hooks codegraph-sync`、建场 `agent-worktree.sh create` 的 best-effort `codegraph init`。不改产品 SWBOOT-10 stub,不装载 systemd coordinator(需另授)。
|
||||
|
||||
## Subagent 工作流拟议修订
|
||||
|
||||
修订 ID:`subagent-workflow-2026-09-24-r2`;owner:Codex;state:`proposed`;能力:`manual`;effective_commit:无。
|
||||
用户要求研究 Cursor Auto 下的 subagent 分工、阶段流程及报告,授权与本次验收见[任务](short-term/2026-09-24-subagent-workflow-standard.md)。[规范草案](2026-09-24-subagent-workflow-standard.md)为拟议行为的唯一来源,[研究报告](../audit/2026-09-24-subagent-workflow-research.md)给出事实和待修冲突,[模板](templates/subagent-stage-record.md)承载交接。
|
||||
用户后续明确采用 Cursor Auto 实施 + gmktec 本机 PI 子任务,并批准默认模型分工及可调整文档。[模型配置](2026-09-24-subagent-model-config.md)为模型路由唯一来源,decision_state=approved;流程整体仍 proposed;已批准的模型配置与执行器已合入本地 dev。原 Cursor 原生角色/inherit 方案被替代。执行器已在任务分支实现并验证 Cursor CLI→MCP→PI,代码 69ffaa677e23a1dd9aa0528bb09b3acfcd38b119;[运行说明](2026-09-24-pi-subagent-executor.md)与[验证报告](../test-reports/2026-09-24-pi-executor-test-report.md)限定已验证的机器边界。dev 集成/完整流程审批仍独立记录;不以派发器可用宣称全阶段自动门禁。
|
||||
|
||||
## Cursor 治理层局部修订
|
||||
|
||||
修订 ID:`cursor-governance-2026-09-24-r1`;owner:`Cursor`;state:合入 local_dev 后 `active`(effective_commit 以集成收据为准);工具能力分层:
|
||||
- 规则/skill 文本:`manual`(Agent 读取执行)
|
||||
- hook 脚本 stdin→stdout 行为:`enforced`(`scripts/tests/test_cursor_hooks.py`)
|
||||
- hook ↔ Cursor IDE 接线:`advisory`/`manual`(事件字段待 probe 采样;见 ISSUE-20260924-cursor-hook-event-contract)
|
||||
|
||||
用户授权:在 PI 执行器合入后补齐 skills/rules/hooks;范围与验收见[任务](short-term/2026-09-24-cursor-governance-hooks.md)。客户端入口:`.cursor/rules/cursor-hooks.mdc`、`pi-subagents.mdc`、`test-reports-standard.mdc`(缩为验证契约指针);skills `pi-subagent-dispatch` / `subagent-stage-record`;hooks 见 `.cursor/hooks.json`。不改变产品 Runner、不扩大执行器硬门禁语义。
|
||||
|
||||
## 治理目录库与需求重叠检测拟议修订
|
||||
|
||||
修订 ID:`governance-catalog-2026-09-24-r1`;owner:`Cursor`;state:`proposed`;能力:schema/门禁落地后为 `enforced`,向量层 `fail-open`;effective_commit:无(随受控合入记录)。
|
||||
用户授权实施跨对话需求重叠检测与治理目录(扩展既有 `.locks/state.sqlite`,不碰业务 PG)。唯一来源:[方案](./2026-09-24-governance-catalog-plan.md);任务:[short-term](./short-term/2026-09-24-governance-catalog.md)。策略键 `catalog_gate`/`catalog_vector` 为可选,不得破坏 `shared_docs` 等集合相等校验。
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# 治理目录库与跨对话需求重叠检测(方案)
|
||||
|
||||
**修订 ID**:`governance-catalog-2026-09-24-r1`
|
||||
**state**:`proposed` → 实施后随合入升 `active`
|
||||
**owner**:Cursor
|
||||
**工具能力**:schema/CRUD/门禁 `enforced`(落地后);向量层 `fail-open`
|
||||
**任务**:[short-term](./short-term/2026-09-24-governance-catalog.md)
|
||||
|
||||
## 问题
|
||||
|
||||
跨对话新设计与既有功能/需求重叠时,现有 agentctl 仅做路径级 `overlaps()` 互斥,无需求语义比对。CURRENT/ISSUES/test-reports 为 Markdown 台账,机器无法强制开工前探测。
|
||||
|
||||
## 方案摘要
|
||||
|
||||
在既有 `.locks/state.sqlite`(与业务 PG 物理隔离)上 additive 扩展 Catalog 表:
|
||||
|
||||
| 表 | 用途 |
|
||||
|---|---|
|
||||
| `catalog_requirements` | R-ID 需求条目 |
|
||||
| `catalog_features` | 对齐 FEATURE-MATRIX record_id |
|
||||
| `catalog_req_text` | FTS5 CJK 逐字索引(禁用 trigram) |
|
||||
| `catalog_overlaps` / `catalog_decisions` | 检测结果与裁决留痕 |
|
||||
| `catalog_issues` / `catalog_tests` / `catalog_releases` | 缺陷/测试/发布投影 |
|
||||
| `catalog_embeddings` | 可降级向量增强 |
|
||||
|
||||
### 分级门禁
|
||||
|
||||
1. **L1 结构化**:`same_mutex` / `same_feature` / `same_scope` / `same_req_id` → hard deny
|
||||
2. **L2 语义**:FTS5 bm25 软门,须 `catalog overlap ack` 显式裁决后才可编码
|
||||
3. **L3 向量**:读 `EMBEDDING_*`;401/超时/缺钥 → `vector_layer=degraded`,不阻断
|
||||
|
||||
### 策略
|
||||
|
||||
`catalog_gate` / `catalog_vector` 为**可选键**(不得加入 `shared_docs` 等集合相等校验字段)。
|
||||
|
||||
### 权威关系
|
||||
|
||||
`.doc` Markdown 仍为事实来源;Catalog 为可检索投影 + 门禁依据;冲突时 `catalog drift` 告警,不自动改文档。
|
||||
|
||||
## 边界
|
||||
|
||||
不新建第二库/容器;不读写业务 PostgreSQL;不改 `overlaps()` 既有语义;不做跨机权威。
|
||||
|
||||
## CLI / MCP
|
||||
|
||||
`agentctl catalog {add,list,show,search,overlap,ack,status,drift}`;MCP:`catalog_requirement_add` / `catalog_overlap_probe` / `catalog_overlap_ack` / `catalog_search` / `catalog_status`。
|
||||
@@ -0,0 +1,47 @@
|
||||
# 本机 PI Subagent 执行器接入方案与实施记录
|
||||
|
||||
task_id:subagent-workflow-standard-2026-09-24;operation_task_id:subagent-workflow-standard-2026-09-24-executor。
|
||||
用户授权:“接入自动调用 pi 的执行器”;既有约束:Cursor Auto 实施,PI 模型限[配置](2026-09-24-subagent-model-config.md),M3 默认停用。本次是同任务的实现续作。
|
||||
|
||||
## 目标与边界
|
||||
|
||||
Cursor 能通过项目 MCP 自动按角色调用 gmktec 本机 PI,读取配置,提供冻结输入,获得持久报告和可核验状态。CLI 同步提供可复现入口。
|
||||
不修改产品服务/Runner、不操作真实业务数据、不安装 daemon、不 push。代码只在原登记 worktree 修改,当前 main 有其他任务的未跟踪 promotion receipt,保留不动。
|
||||
本次复核 local dev=6858e21d477571696a8458032e2c884449e773fd;原任务 HEAD=52462b45e985f596b2a503fc70ac12c3bd5fe571;新增 dev 差异为 internal/squad,与本次脚本无交叉。没有重新建场或切换主目录分支。
|
||||
|
||||
## 分工与执行方式
|
||||
|
||||
- Cursor Auto:编写执行器、MCP 接口、权限限制与测试。host Codex:需求/契约、文档、证据核验、审查与受控提交。
|
||||
- Cursor CLI 在已登记原任务 worktree、agentctl with 监督和精确路径租约内执行;不授予提交/合并/推送/环境操作权限。模型请求 Auto;实际底层模型不可见时记录 unknown。
|
||||
- 本次使用 ce-work 的执行/验证思路、CodeGraph 定位、test-driven-development 和 writing-for-agents。仓库 AGENTS 的原任务 worktree/agentctl 规则优先于技能中 detached 临时工作区机制;使用仓库 supervisor 派发 Cursor,代码路径单写者,外层核对差异。该隔离不是 OS 沙箱。
|
||||
- 范围:scripts/pi_subagents.py、scripts/pi-subagent-readonly.ts、scripts/mcp/pi-subagents-mcp.mjs、scripts/tests/test_pi_subagents.py、scripts/mcp/README.md、.cursor/mcp.json、.cursor/rules/pi-subagents.mdc,以及本任务相关 .doc 文档。
|
||||
- 认领能力仅 docs:publish;不注册 env:* 或 git:dev。后续集成另按受控候选流程处理。
|
||||
|
||||
## 设计契约
|
||||
|
||||
1. 配置文档是唯一模型来源,每次派发解析严格表格,记录 revision/hash 和实际 provider/model。禁用、未知、循环、M3 关键职责路由失败关闭;没有静默备用。
|
||||
2. 新鲜 PI 会话;冻结 source SHA 与显式 tracked 输入文件(拒绝秘密/业务 data/路径穿越/符号链接),上限限制。模型只得到选定输入与允许的只读工具,无任意 shell、源码写入或递归派发。
|
||||
3. 测试角色仅运行主 Agent 显式提供、带来源的 argv 计划;独立源码副本、净化环境、超时和输出限制,模型不生成可执行命令。共享业务环境本版不接入,返回明确限制。
|
||||
4. MCP 提供角色预览、运行、结果查询;跨 worktree 调用核对同仓与 task 注册;运行由权威 agentctl with 包裹,并由执行器校验继承租约。
|
||||
5. 每个 request_id 绑定输入摘要;同请求重放只查询,变更载荷拒绝,running/unknown 不重派。每请求独立短范围 report 路径锁,跨调用者统一并发上限。
|
||||
6. 运行前保存 running;完成保存 receipt.json/report.md,含命令、版本、输入摘要、配置摘要、状态/结论、报告来源。结果未知/失败不冒充通过,进程退出0不替代模型最终事件和必需测试结果。
|
||||
7. timeout/cancel 处理进程组并回收;未知副作用保留现场。凭证仅由 PI 客户端读取,绝不进入模型输入/报告;测试子进程不继承模型密钥或租约身份。
|
||||
8. MCP 用标准 stdio JSON-RPC,查询不被运行调用阻塞。项目规则告诉 Cursor 何时选择哪种 role_id,具体模型仍从配置读取。
|
||||
9. 实施与修复始终交给 Cursor;PI 负责分析/审查/验证。模型结论和 acceptance_owner 的最终验收分开。
|
||||
|
||||
## 验证计划
|
||||
|
||||
- 隔离真实 Git/agentctl:注册/租约负例、路径范围、报告落盘、请求幂等、并发与异常退出。
|
||||
- 本地假 PI 仅作为协议传输夹具:模型参数、权限开关、JSON 事件、错误/空响应/超时/子进程清理;不得当作真实模型能力验收。
|
||||
- MCP 实进程:initialize、tools/list、roles、run、result;错误必须 isError。
|
||||
- 实际本机 PI:至少一条真实分析请求与独立代码审查;模型/权限/配置/源码身份可追溯。不得把 CLI/MCP 接口实测写成 Cursor IDE 页面已实测。
|
||||
- 主机核验聚焦测试与工程脚本套件,按失败证据补回归;无需运行无关产品全量 Go、重建服务或产品 PI。
|
||||
- 收口保留运行结果和剩余条件,分别记录 local commit / integration / deployment / remote_sync / cleanup。
|
||||
|
||||
## 当前进度
|
||||
|
||||
2026-09-24:Cursor Auto 已在 agentctl supervisor 内启动;本轮尚未宣称实现完成。机器租约身份和终端输出由 host 核验,待实施结果后补测试与审查。
|
||||
|
||||
## 已验证结果
|
||||
|
||||
执行器代码已提交为 69ffaa677e23a1dd9aa0528bb09b3acfcd38b119。完整工程回归 173 项、提交后专项 34 项、真实 Cursor CLI→MCP→PI 自动路由与最终 ls/read 均通过,详见[报告](../test-reports/2026-09-24-pi-executor-test-report.md)。文档配置已改为程序读取;完整审批状态机仍人工/Agent 遵约。已受控合入本地 dev,集成提交 5a8540804ee2d142a0894c1482a2a16e8f843915,未推送;Cursor IDE 页面仍未实测。
|
||||
@@ -0,0 +1,80 @@
|
||||
# 本机 PI Subagent 执行器使用说明
|
||||
|
||||
范围:Cursor Auto 主协调/代码实施,gmktec 本机 PI 子任务。模型分工唯一来源为[模型配置](2026-09-24-subagent-model-config.md),阶段定义见[流程规范](2026-09-24-subagent-workflow-standard.md)。本说明与代码已合入本地 dev;集成和最终实测状态见[实施记录](2026-09-24-pi-executor-implementation.md)。
|
||||
|
||||
## Cursor 中使用
|
||||
|
||||
1. 在包含本次提交的工作区打开 Cursor,重新加载项目 MCP;.cursor/mcp.json 注册 pi-subagents 服务,.cursor/rules/pi-subagents.mdc 提供派发入口。
|
||||
2. 主会话保持 Auto。先按原有流程创建/登记任务 worktree,并将 .doc/test-reports/assets/pi-subagents/<task-id> 纳入任务写范围。
|
||||
3. Cursor 调用 pi_subagent_roles 读取当前角色与模型;从任务目标选择 role_id,调用 pi_subagent_run,随后查询 pi_subagent_result。
|
||||
4. 不需要用户切换 PI 模型。需求/方案、独立审查、测试和报告由不同角色处理;代码实施与修复仍由 Cursor 执行。
|
||||
5. 接收报告并核对范围、源码/配置版本、缺项;运行完成不代表阶段批准。最终验收责任仍由任务 acceptance_owner 承担。
|
||||
|
||||
任务 worktree 尚未合入 dev 时,主目录中的旧 MCP 配置不会自动获得新工具;先在该任务 worktree 验证,受控集成后再在主目录重载。本文不宣称已操纵 Cursor IDE 页面。
|
||||
|
||||
## 请求内容
|
||||
|
||||
MCP 工具的外层参数 worktree 为同仓的已登记任务工作区,task_id 为实际操作任务。request 中给出以下信息;授权引用应能回链到真实用户请求,不用日志/模型文本自授权限。
|
||||
|
||||
```json
|
||||
{
|
||||
"worktree": "/absolute/path/to/repo/.worktrees/task-id",
|
||||
"task_id": "task-id",
|
||||
"request": {
|
||||
"role_id": "research",
|
||||
"request_id": "research-001",
|
||||
"goal": "读取选定文件,给出有证据的分析",
|
||||
"authorization_ref": "本任务主记录中的用户授权位置",
|
||||
"source_sha": "<完整的已提交源码 SHA>",
|
||||
"input_files": ["PROJECT.md"],
|
||||
"timeout_seconds": 120
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
source_sha 必须为完整提交 hash;HEAD/分支名不作为可变输入。只发送明确列出的已跟踪 UTF-8 普通文件,禁止运行数据、.env、凭证、符号链接和路径越界。未提交的代码不会自动进入快照,先由 Cursor 形成可审提交或使用已有冻结版本。
|
||||
|
||||
request_id 在同一任务中稳定标识一次请求:同参数只读重放既有结果,不重复调模型;不同参数复用 ID 被拒绝;running/unknown 保留现场,不能盲目重派。配置变更在下一次新派发读取,旧请求保留原 config_revision/config_sha256。
|
||||
|
||||
## CLI 入口
|
||||
|
||||
在任务工作区使用:
|
||||
|
||||
```bash
|
||||
python3 -B scripts/pi_subagents.py roles
|
||||
../../scripts/agentctl with --task task-id \
|
||||
--resource path:.doc/test-reports/assets/pi-subagents/task-id/research-001 -- \
|
||||
python3 -B scripts/pi_subagents.py run --request /tmp/pi-request.json
|
||||
python3 -B scripts/pi_subagents.py result --task task-id --request-id research-001
|
||||
```
|
||||
|
||||
CLI 请求文件需包括 task_id;也可用 run --stdin 输入 JSON。直接裸调 run 会被租约校验拒绝。上述名称是示例,不构成任何任务或环境授权。
|
||||
|
||||
## 测试角色
|
||||
|
||||
test_run / acceptance_check 还需 approved_commands(argv 数组的数组)和 plan_digest(外部已批准计划 SHA-256);执行器另记录 approved_commands_sha256,不能以任意字符串冒充命令与计划的同一摘要。
|
||||
|
||||
命令在独立测试快照中运行,使用净化环境和私有 HOME/cache/tmp,标准输入关闭。PI 模型根据收到的命令摘要、退出码和日志引用分析,不生成或修改被执行命令;完整日志由主 Agent 核验并在需要时补充上下文。模型分析快照保持原始源码内容,与测试可写副本分离。必要的 stdout/stderr 保存到本请求报告目录以便核对,不仅保留一段摘要。
|
||||
|
||||
依赖未安装、用例缺失或命令失败须如实记录。本版不自动安装依赖,不直接连接共享 dev/test/main 或操作真实业务数据;相关检查继续由主 Agent 通过现有环境授权/租约流程执行。命令退出 0 只证明命令层执行成功;必需用例是否执行、SKIP、持久性/UI 和业务验收仍按验证契约核对。
|
||||
|
||||
## 证据与状态
|
||||
|
||||
输出位置:.doc/test-reports/assets/pi-subagents/<task-id>/<request-id>/。
|
||||
|
||||
- receipt.json:请求摘要、配置摘要、源码/输入文件摘要、配置与观察到的模型、运行状态、命令结果、工具调用摘要。
|
||||
- report.md:可读报告;模型分析是审查输入,主 Agent 核对后再推进阶段。
|
||||
- 命令日志:按收据记录的位置查询;报告目录受对应 path 租约保护。
|
||||
- 模型私有 thinking 不作为归档材料。错误输出与日志按敏感信息规则处理;不保存凭证。
|
||||
|
||||
run_status 与 verdict 分开:模型正常结束可以是 succeeded,但非测试报告仍为 review_state=pending / verdict=not_applicable。测试报告的 commands_passed/pass 只针对提交的命令,不能直接赋值到任务的 review_state 或 acceptance。失败、取消、结果未知不能换成 PASS。
|
||||
|
||||
超时、取消和输出超限处理整个受控进程组。只读结果查询可推断 orphan 为 unknown,但不能通过查询无租约改写收据。错误前置检查未形成业务收据时,MCP 返回可核对的执行拒绝,不能让主 Agent 一直等待不存在的结果。
|
||||
|
||||
## 调整与边界
|
||||
|
||||
角色默认模型、enabled、升级角色和并发上限在模型配置文档维护。禁用角色前同步处理指向它的升级关系。程序仅接受当前明确批准的五个 provider/model 组合;扩大模型池还需用户授权并更新硬边界校验,不是任意改一行即放宽权限。
|
||||
|
||||
本工具提供配置解析、模型启动、有限工具/输入范围、租约、进程监督和证据保存;没有把全部 S0–S9 的审批实现成不可跳过的状态机。Cursor 通过规则决定何时调用;模型失败不会触发隐式换 provider 或降级到 M3。
|
||||
|
||||
进程组和工具权限限制不是 OS 沙箱。批准的测试代码与本机工程工具属于可信执行面;外部不可信项目/代码不能因使用本工具就获得运行授权。普通 Cursor/PI 配置与 Herdr、产品 PI Runner 各自独立。
|
||||
@@ -0,0 +1,88 @@
|
||||
# Subagent 模型分配配置
|
||||
|
||||
config_revision:`subagent-models-2026-09-24-r1`
|
||||
|
||||
owner:用户;维护执行者:当前任务主 Agent。
|
||||
|
||||
decision_state:`approved`(本会话确认);integration_state:`merged`;execution:`enforced`(本执行器已验证的配置/租约/工具/进程边界);阶段审批仍为 manual。
|
||||
|
||||
**这是模型分配的唯一配置文档。** 用户调整下列表格;主 Agent 每次派发前读取,并把解析结果写入[派发记录](templates/subagent-stage-record.md)。`scripts/pi_subagents.py` 已直接解析本文件,Cursor MCP 提供角色预览、派发与结果查询;每次新派发读取配置,旧请求保留旧摘要。实测与边界见[运行说明](2026-09-24-pi-subagent-executor.md)和[报告](../test-reports/2026-09-24-pi-executor-test-report.md)。完整流程见[协作规范](2026-09-24-subagent-workflow-standard.md)。
|
||||
|
||||
## 1. 日常调整入口
|
||||
|
||||
| 想调整什么 | 修改位置 | 生效方式 |
|
||||
|---|---|---|
|
||||
| 某角色的默认模型 | §3 对应角色的“默认模型”列 | 修改后递增 config_revision;下一次派发读取 |
|
||||
| 复杂任务的升级去向 | §3 “升级角色”列 | 升级时保留原报告与原因;以目标角色重新派发 |
|
||||
| 启停某角色 | §3 enabled 列 | false 时不自动派发;引用该角色的升级关系须同时调整;必需职责暂停或显式重新分配,不能跳过门禁 |
|
||||
| 允许使用的 provider/model | §2 模型池 | 使用本机精确 ID;新增模型需用户明确调整授权范围并更新程序硬边界校验 |
|
||||
| 并发量、失败处理 | §4 | 主 Agent 按配置与任务实际资源取更严格边界 |
|
||||
| 只改本次任务 | 在任务主记录写 override | 记录用户指令、角色、原值/新值、期限;不改全局默认 |
|
||||
|
||||
文档中表格值为配置;其他文件只引用本文件,不重复维护模型名。用户可以直接编辑,也可以说“把本任务 code_review 改用 qwen_max”或“以后 report 都用 glm_full”。后者需按仓库 worktree/受控集成流程保存。
|
||||
|
||||
字段规则:enabled 只取 true/false;默认模型引用 §2 的 alias;升级角色引用 §3 的 role_id,或 none;缺字段、未知 alias、循环升级、角色越权时停止该派发并报告错误,不自行猜测模型。
|
||||
|
||||
## 2. 允许的模型池
|
||||
|
||||
主会话:**Cursor,模型选择 Auto**;工程子任务:**gmktec 本机 PI CLI**。这份配置不改变 Cursor UI 模型开关、PI 全局默认设置或产品 PI Agent Runner。
|
||||
|
||||
| alias | provider | model(精确 ID) | 使用限制 |
|
||||
|---|---|---|---|
|
||||
| qwen_max | qwen-token-plan-cn | qwen3.8-max | 可分配分析、规划、报告与复核 |
|
||||
| qwen_flash | qwen-token-plan-cn | qwen3.8-flash | 默认检索、资料与初稿;复杂任务升级 |
|
||||
| glm_full | zai-coding-cn | glm-5.3 | 默认评估、独立审查和复杂归因 |
|
||||
| glm_flash | zai-coding-cn | glm-5.3-flash | 默认测试执行与证据收集;复杂判断升级 |
|
||||
| minimax_aux | minimax-cn | MiniMax-M3 | 默认停用,仅明确启用后用于易核验辅助任务;不能承担关键判断 |
|
||||
|
||||
本机 provider 是 qwen-token-plan-cn;用户提到的 qwen-token-plan 在此明确映射到该通道。相同模型名出现在其他 provider 不构成可替换授权。M3 不进入规划、代码审查、根因裁决、最终验收或主力自动备用链;需要改变这些限制时由用户明确修订本节。
|
||||
|
||||
目录核对:2026-09-24,通过本机 pi 的离线 --list-models 核实以上五个组合。存在于目录不等于远端连通、工具调用、性能和任务质量已实测。
|
||||
|
||||
## 3. 角色路由表
|
||||
|
||||
代码实施与修复固定由 **Cursor Auto** 承担;下表只路由 PI 子任务。PI 不修改产品代码或测试源码,所需修复/新测试交回 Cursor。
|
||||
|
||||
| role_id | 工作 | enabled | 默认模型 | 升级角色 | 执行边界 |
|
||||
|---|---|---|---|---|---|
|
||||
| research | 检索、代码定位、资料摘录、需求初稿 | true | qwen_flash | planning | 只读;结论回传主 Agent |
|
||||
| planning | 需求分析、方案制定、复杂问题综合分析 | true | qwen_max | none | 只读;保留假设与依据 |
|
||||
| requirements_review | 独立评估需求与影响 | true | glm_full | none | 新上下文;不代替用户取舍 |
|
||||
| plan_review | 独立方案审查 | true | glm_full | none | 不自审自己编制的方案 |
|
||||
| code_review | 代码审查与回归风险检查 | true | glm_full | none | 冻结 diff;不修改被审内容 |
|
||||
| diagnosis | 复杂失败归因、跨模块机制分析 | true | glm_full | none | 只读分析;复现操作由 test_run 在授权环境执行 |
|
||||
| test_run | 按已批准验证计划执行测试、收集证据、初步分析 | true | glm_flash | diagnosis | 仅批准命令、测试产物与环境;不修改源码 |
|
||||
| acceptance_check | 按既定 AC 执行检查、核对真实证据 | true | glm_flash | diagnosis | 不代签最终验收;涉及业务取舍交 acceptance_owner |
|
||||
| stage_notes | 阶段记录与报告初稿 | true | qwen_flash | report | 忠实整理原证据;主 Agent 持锁落盘 |
|
||||
| report | 最终报告、复杂材料综合 | true | qwen_max | none | 汇总不能改写原始失败或推导未验证的 PASS |
|
||||
| auxiliary | 格式整理、清单提取等易核验工作 | false | minimax_aux | none | 明确启用后派发;保留来源供核验 |
|
||||
|
||||
一个模型可承担多种角色,但派发必须区分上下文与职责。即使用户将规划和审查映射到同一模型,独立审查仍须新上下文/不同执行实例;模型不同也不自动证明审查独立。
|
||||
|
||||
最终验收责任继续归任务声明的 acceptance_owner;主 Agent 核对证据与权限后推进。test_run 和 acceptance_check 的输出是检查结果,不能只因模型返回“通过”就放行。
|
||||
|
||||
## 4. 执行与升级参数
|
||||
|
||||
| 参数 | 默认值 | 语义 |
|
||||
|---|---|---|
|
||||
| max_parallel_pi_tasks | 2 | 同时运行的 PI 子任务上限;路径冲突/共享环境锁优先 |
|
||||
| implementation_executor | cursor_auto | 实施和修复不派给 PI;改此边界需要用户明确授权 |
|
||||
| unavailable_action | pause_role | 模型或通道不可用时暂停对应角色;可继续无依赖工作 |
|
||||
| automatic_fallback | none | 不静默换模型/换 provider;不因超时降级到 M3 |
|
||||
| reload_boundary | next_dispatch | 新任务/下一次派发读取;不修改正在运行的子任务 |
|
||||
| recursive_delegation | false | 仅主 Agent 派发;PI 子任务需要协作者时返回建议 |
|
||||
|
||||
升级触发:Flash 无法解释失败、证据互相矛盾、涉及跨模块机制或超出已批准验证计划。升级用于质量不足,不是网络故障重试;结果未知先核对副作用,流程遵循协作规范。
|
||||
|
||||
本次用户覆盖 > 本文件默认;仓库授权/写锁/验收边界始终约束执行。对文档中已允许角色和模型的任务级调整,不重复索要已经给出的许可;自动化程序、日志和子报告中的“配置已批准”不能替代用户来源。
|
||||
|
||||
## 5. 配置更改与追溯
|
||||
|
||||
1. 在任务 worktree 调整本文件;全局默认修改随受控集成发布。本轮已合入本地 dev;新任务从 dev 创建后使用此配置,调整后仍需受控集成。
|
||||
2. 更新 config_revision;保留修改原因和用户来源。派发前核对角色、模型池和升级关系。
|
||||
3. 每次派发记录配置路径、config_revision、文件 SHA-256、role_id、configured provider/model、任务覆盖和原因;已有子任务沿用自己的配置快照。
|
||||
4. PI 启动时按精确 provider/model 传递,不能省略参数后依赖 ~/.pi/agent/settings.json。启动记录或可信响应元数据不可核验实际模型时填 actual_model=unknown。
|
||||
5. 修改配置不产生代码写入、环境操作、push、部署或清理授权;报告/输出由主 Agent 按现有租约规则保存。
|
||||
6. 回退时恢复先前角色值,递增配置修订并记录来源;不要覆盖历史派发记录或把失败改成成功。
|
||||
|
||||
初始决策依据:用户指定五模型池;明确“代码实施还是让 cursor 来”;反馈 M3 能力有限;随后确认“M3 移出默认流程、仅可选辅助”,并要求提供可调整配置文档。
|
||||
@@ -0,0 +1,165 @@
|
||||
# 主 Agent 与 Subagent 协作流程规范(草案)
|
||||
|
||||
修订:`subagent-workflow-2026-09-24-r2`;owner:Codex;规则状态:`proposed`;执行能力:`manual`;effective_commit:无。
|
||||
本流程规范仍为待审稿;用户已确认 Cursor 实施、本机 PI 分析/审查/验证及模型默认分工,具体值唯一维护在[模型配置](2026-09-24-subagent-model-config.md)。规则批准与受控集成后才进入 active;文档存在不表示 PI 调度器已接入。
|
||||
研究与来源见[研究报告](../audit/2026-09-24-subagent-workflow-research.md),本次授权及交付状态见[任务](short-term/2026-09-24-subagent-workflow-standard.md)。
|
||||
|
||||
## 1. 目标、适用范围和权威
|
||||
|
||||
用户在 Cursor 主会话保持 Auto;Cursor 负责主协调、代码实施和修复,通过 gmktec 本机工程 PI CLI 委派分析、审查、测试和报告。每阶段产生可恢复记录。此配置不自动适用其他客户端或 Herdr。
|
||||
|
||||
本规范只定义角色、阶段、交接和证据引用。授权边界沿用 [AGENTS](../../AGENTS.md),写锁/候选合并/环境/清理沿用 [worktree 操作规范](2026-09-21-agent-worktree-workflow.md),测试层级沿用[验证契约](2026-09-21-validation-contract.md),问题闭环沿用[既有规范](2026-09-23-issue-learning-workflow.md)。不建立第二套测试门禁。
|
||||
|
||||
普通 Cursor 会话不启用 Herdr 角色和固定模型路由;只有明确使用 Herdr 时适用其专门规范。工程 subagent 与产品 PI Agent Runner 分开记录,前者的执行不能替代后者的验收。
|
||||
|
||||
## 2. Auto、授权和推进规则
|
||||
|
||||
- **模型策略**:主会话选择 Auto;PI 子任务按[模型配置](2026-09-24-subagent-model-config.md)的角色、provider 和 model 派发。Cursor 原生 subagent 的 model: inherit 方案已被用户后续选择替代,本规范不以 .cursor/agents 实现 PI 路由。
|
||||
- **能力核验**:首次接入、客户端升级或模型行为异常时,记录客户端版本、角色可发现性、派发 ID、工作目录、配置模型策略及可观察的实际模型;不可见时写 `actual_model=unknown`。不得从自我介绍推断模型。
|
||||
- **证据边界**:记录配置指定值与可核验的实际模型;未核验不声称模型调用成功。模型多样性不替代独立上下文和证据。
|
||||
- **授权策略**:Auto 只表示模型选择,不表示自动授权 shell、外部写入、合并、部署、推送或删除。任务开始记录已有授权,后续不重复询问相同范围。
|
||||
- **默认确认点(待用户采纳)**:需求形成、评估、方案编制可连续进行;方案可审后,一次确认方案与实施范围。已明确授权按该方案端到端执行,则该确认已经满足。只有范围/环境/外部副作用扩大、破坏性动作或需要用户作业务取舍时再确认。
|
||||
- **验收人**:需求阶段明确 acceptance_owner。技术验收检查可由获授权 acceptance_check 执行;产品效果/业务取舍需要用户判定时,技术通过后保留 `acceptance=pending`,不由 Agent 代签。用户预先委托按明确客观标准验收时,记录委托来源和证据即可。
|
||||
- 仅请求研究/方案的任务交付可审产物后结束。实现、运行验证、合并等阶段逐项写 `not_applicable + 原因`,不为了流程齐全擅自执行。
|
||||
|
||||
## 3. 标准流程
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[建场与授权记录] --> B[形成需求和验收标准]
|
||||
B --> C[评估需求与影响]
|
||||
C --> D[制定方案和验证计划]
|
||||
D --> E{实施授权是否满足}
|
||||
E -->|是| F[实施和开发自测]
|
||||
E -->|否| P[交付可审方案]
|
||||
F --> G[独立代码审查]
|
||||
G -->|需修改| F
|
||||
G -->|通过| H[冻结交付版本并验证]
|
||||
H -->|失败| F
|
||||
H -->|通过| I[构造候选并验证合并结果]
|
||||
I -->|通过| J[受控合入 dev]
|
||||
J --> K[按授权部署与运行验收]
|
||||
K -->|失败| R[保留现场并修复或交接]
|
||||
R --> F
|
||||
K -->|通过或不适用| L[确认交付并归档证据]
|
||||
L --> M[owner退出后独立复查清理]
|
||||
```
|
||||
|
||||
测试计划在方案阶段形成;自测贯穿实施;独立审查和必要测试必须覆盖最终版本。清理安排在验收与证据保存之后。合并前的工程验证与合并后的运行验收分别报告。
|
||||
|
||||
### 阶段、产物和放行条件
|
||||
|
||||
每行都是阶段记录要求,不要求每行一个文件。记录使用[阶段模板](templates/subagent-stage-record.md)。
|
||||
|
||||
| 阶段 | 责任与输入 | 最小产物 | 放行条件 / 失败去向 |
|
||||
|---|---|---|---|
|
||||
| S0 建场 | 主 Agent;用户请求、当前规则、Git/认领状态 | task 主记录:目标、授权、基线、写路径、环境、交付终点、policy_revision | 允许范围明确;持久成果在任务 worktree;按现行入口登记 |
|
||||
| S1 形成需求 | Cursor 与用户,可委派 research/planning;原始描述 | 需求记录:用户场景、范围/非目标、R-ID、AC-ID、优先级、验收人 | 可验证预期明确;影响方案的歧义解决,小型假设标注 |
|
||||
| S2 评估需求 | requirements_review;S1 和当前证据 | 评估报告:现状差距、替代方案、依赖、风险、复杂度和建议 | 结论为 proceed / revise / defer;高风险未知有验证路径;revise 回 S1 |
|
||||
| S3 制定方案 | Cursor 协调 planning 编制、plan_review 独立复核;S2 | 方案:改动位置、接口/数据影响、实施依赖、写者、验证矩阵、恢复方案;附方案审查结论 | AC 映射到验证项;必要权限齐备;授权不足交付方案等待;设计疑问回 S2 |
|
||||
| S4 实施与自测 | Cursor;已授权方案 | 实施记录:变更、提交、偏差、自测与失败记录 | 实现满足方案且自测有证据;范围变化回 S1/S3;不得降低 AC 迁就实现 |
|
||||
| S5 独立代码审查 | code_review;需求/方案、base/head、完整差异 | 审查报告:范围、审查者、严重度、位置、依据、处置与复核 | 无未解决阻断项;修复回 S4,变更后的代码需复核 |
|
||||
| S6 交付验证 | test_run;冻结版本、AC、验证契约 | 测试报告:预期用例、实际命令/输入/输出、环境、SHA、PASS/FAIL/SKIP/未运行 | 适用必需项均通过;SKIP/基础设施失败保留阻塞;失败回 S4 或 S3 |
|
||||
| S7 候选与集成 | 串行集成执行者;S5/S6、最新 dev D、冻结 T | 集成报告:D/T/M、候选验证收据、锁内结果、实际 dev | 按现行 --no-ff 候选与 --ff-only 入口;D/T/M 变化须重新准入 |
|
||||
| S8 运行与交付验收 | acceptance_check + acceptance_owner;受控制品、AC | 验收报告:实际制品、环境、用户流程、持久状态、逐项 AC 结论 | 所需运行/UI 验收通过;无运行影响写 not_required;失败不清理、不冒充完成 |
|
||||
| S9 归档与清理 | 主 Agent 固化证据,owner 退出后维护者执行清理 | 收口报告:提交/集成/部署/远端/cleanup 分离;归档证据、清理结果与遗留 owner | 满足现行普通 remove/-d 条件;拒绝保留 pending,登记触发和接管者 |
|
||||
|
||||
S5 与 S6 可以在同一不可变版本上并行;必要产物必须都回来才能进入 S7。测试产生构建目录/缓存/数据也算写副作用,先核对其环境和锁。code_review 阅读稳定 Git 快照,不在 Cursor 正在改写的工作树上宣布最终通过。
|
||||
|
||||
S7 候选需执行该范围的真实检查,不能用分支自测替代合并结果验证。S8 后新增的报告提交也需受控集成;分别记录被测业务 SHA 与报告 SHA,说明仅文档变化的复用依据。影响运行内容的后续变更使相关验收失效。
|
||||
|
||||
## 4. 角色和分工
|
||||
|
||||
角色是职责,不要求每阶段单独启动一个进程。精确 role_id、enabled、默认模型和升级链只维护在[模型配置](2026-09-24-subagent-model-config.md),下表说明权限边界。
|
||||
|
||||
| 角色 | 职责 | 写权限和独立性 |
|
||||
|---|---|---|
|
||||
| Cursor / coordinator | 与用户对话、授权核对、任务图、派发、证据汇总、冲突处理、推进门禁和交接 | 唯一任务协调者;报告汇总不改变原作者/证据/结论;不能从子报告推导额外授权 |
|
||||
| research / planning / report / stage_notes | 需求影响、方案、资料和报告 | 默认只读;返回结构化报告,由主 Agent 落盘;若编制方案,另一个上下文审查方案 |
|
||||
| Cursor / implementation | 实施方案、修复问题、编写和修改测试源码 | 产品和测试源码的实施者;按认领/租约操作,PI 建议交回 Cursor 处理 |
|
||||
| requirements_review / plan_review / code_review / diagnosis | 独立评估、审查与复杂故障归因 | 新的只读上下文;不修改被审内容;发现问题返回 Cursor;复现交给获授权的 test_run |
|
||||
| test_run / acceptance_check | 按冻结 AC 和已批准计划执行验证,核对真实行为 | 仅写批准的测试产物/环境;不改源码、不代签最终验收,需要修复交回 Cursor |
|
||||
| integrator / maintainer | 候选验证、受控合并;owner 退出后的清理 | 串行短时角色,使用现有工具/权限;不能把长驻 worker 同时当作可删除的 worktree owner |
|
||||
|
||||
同模型的独立上下文可以提供独立检查,但不消除共同盲区;验证仍以源码、命令和用户流程证据为准。主 Agent 自审只能记录 self_review。要求独立审查的代码任务如无 subagent 能力,交给另一个独立会话/人员;该项完成前不自动放行。低风险纯文档可自检并记录理由。
|
||||
|
||||
## 5. 何时派发与如何并行
|
||||
|
||||
- 适合派发 PI:较长只读研究、独立审查、按批准计划验证、报告整理。代码实施和修复保留给 Cursor。
|
||||
- 主 Agent 直接处理:一次定位、简短文案、单一顺序操作;仍留下对应阶段记录。无需为了覆盖阶段机械启动九个 Agent。
|
||||
- 并发上限及递归委派规则以模型配置为准;资源不足串行。它是项目预算,不是平台上限;子 Agent 发现进一步分解需求先返回建议。
|
||||
- 先画依赖再并行;有先后依赖的任务等待前置证据。有相同文件、公共 lockfile、路由、迁移号或共享环境的写任务不能同时认领。
|
||||
- 同一任务 worktree 的源码写者为 Cursor,PI 只读任务读取冻结快照;只读报告由 Cursor 持锁保存。PI 验证涉及产物/环境写入必须在有效 agentctl supervisor 下运行;无法保证时停止执行并报告条件缺失。
|
||||
- 若另行开展多 Cursor 并行实施,仍须独立登记 worktree,各自从明确 dev SHA 创建;父子关系用 parent_task_id/subtask_id 关联。此条不授权 PI 实施代码。
|
||||
- 父任务汇总子任务成果,源码仍由 Cursor 实施。涉及测试产物写入的子任务登记独立操作 ID/路径;只读子审查复用父任务文档,不重复创建任务链。子分支结果通过现行候选集成流程交付;不能由 Cursor 的自动隔离/自动合并绕过本仓注册和准入。
|
||||
- 有后台任务时,主 Agent 可继续独立工作,但不得在结果未回收时发布依赖它的 PASS、合并或清理。各子任务的工具可用性不代表授权可用性。
|
||||
|
||||
## 6. 派发、回传与失败处理
|
||||
|
||||
每次派发至少包含:
|
||||
|
||||
1. parent_task_id、subtask_id、role_id、具体目标、输入版本(需求/方案/代码 SHA);配置路径、config_revision、文件 SHA-256、解析后的 provider/model 和任务覆盖依据。
|
||||
2. 需要读的规范和证据、已有用户授权来源、明确的非目标。
|
||||
3. 工作目录、允许写路径、环境、mutex/租约执行方式;只读者明确只读。
|
||||
4. 完成条件、输出格式/报告路径、需要验证的 AC;子 Agent 不依赖未传入的主会话历史。
|
||||
5. 预算(时间或步骤)、进度回传点、失败/超时和副作用核对方式。
|
||||
|
||||
回传至少包括:执行身份/PI run_id、配置版本与指定/实际模型、实际输入版本、结果与证据、变更文件/提交、实际命令与环境、结论、缺项/风险、遗留进程/产物。主 Agent 校验路径、版本和证据后标记 accepted;子 Agent 自报 done 只表示执行结束。
|
||||
|
||||
- 分开记录 run_status(running/succeeded/failed/cancelled/unknown)与 verdict(pass/changes_required/blocked/not_applicable),不可把退出成功等同质量通过。
|
||||
- 超时/失联先检查进程、worktree、Git 和外部副作用;结果未知时保留 unknown,不同时重派同一写任务。纯只读且确认无副作用的失败可有限重试,并保留原记录。
|
||||
- 审查/验证角色有异议时,主 Agent 依据原需求和证据裁决。能修复则回 S4;需要业务取舍则向用户汇总一个关键问题,不以多数投票覆盖阻断证据。
|
||||
- 连续两轮修复仍未解决同类阻断时,停止机械重试,回 S2 重查机制/测试前提;授权内可继续研究。不得为放行删除失败用例或降低 AC。
|
||||
- 用户中断、客户端退出、上下文压缩时,先固化阶段、版本、未回收子任务、owner 和接管条件;恢复后从首个未满足门禁继续,不能整条流程重跑或直接跳到收口。
|
||||
|
||||
## 7. 文档与报告契约
|
||||
|
||||
“一步一记录”,无需“一步一文件”。现有文件优先复用,原始证据只存一处:
|
||||
|
||||
| 任务类型 | 最小文档集合 |
|
||||
|---|---|
|
||||
| 信息问答,无持久成果或运行副作用 | 对话答复 |
|
||||
| 小型规范/研究/低风险变更 | 一个 task 或分析主文档,含适用阶段、验证与交接 |
|
||||
| 标准功能/缺陷修复 | task + 方案 + 报告;评估/实施/审查/测试/验收可为清楚分段 |
|
||||
| 跨模块、迁移或部署 | task + 必要 plan + 分开的审查/测试/验收证据;handoff 仅在独立信息有价值时拆分 |
|
||||
|
||||
每份阶段记录包含 stage_id、输入版本、producer、reviewer/独立性、decision、证据链接、缺项和下一步。需求用 R-ID,验收用 AC-ID,测试用 T-ID;报告提供 R → AC → 改动 → 审查 → 测试 → 运行验收映射,避免仅列“文档已生成”。
|
||||
|
||||
路径沿用 .doc taxonomy:任务在 ops/short-term,研究/审查在 audit,方案在 remediation 或既有 ops 主文档,独立测试/验收在 test-reports,附件在其 assets。只读 subagent 由主 Agent 保存原始结论及必要摘录,标明“由主 Agent 转存”与 agent_id;不伪造子 Agent 已写文件。
|
||||
|
||||
任务 status 继续只有 planned/in_progress/blocked/done/cancelled;phase 与 review_state、integration_state、deployment、cleanup、remote_sync、acceptance 独立记录。done 取决于授权交付终点。清理待办不扩充任务状态,但必须有人接管。需求验收 pending 时,若验收属于授权交付终点,任务不能 done。
|
||||
|
||||
## 8. Cursor → 本机 PI 接入(任务分支已实现)
|
||||
|
||||
### 配置与能力边界
|
||||
|
||||
用户已明确选择 Cursor Auto 主协调和实施、gmktec 本机 PI 承担子任务;原 r1 的 Cursor 原生 .cursor/agents + inherit 方案废止,历史研究保留说明。当前[模型配置](2026-09-24-subagent-model-config.md)可人工调整,由执行器每次派发读取;不是 PI 原生配置格式,不改变 PI 全局模型设置。CLI/MCP 接入与限制见[运行说明](2026-09-24-pi-subagent-executor.md),实际验证见[报告](../test-reports/2026-09-24-pi-executor-test-report.md)。
|
||||
|
||||
PI 模型和角色路由以配置文档为唯一来源。主 Agent 根据任务读取 role_id,显式传入 provider/model、独立会话、输入版本、工作目录与工具范围,收取结果后按本规范形成阶段记录。不能把主会话可用工具全部自动授予子任务。
|
||||
|
||||
- 只读研究/审查不需要 bash/edit/write;后续接入时显式限制工具,并核对扩展是否引入额外能力。
|
||||
- 测试角色需要执行批准的命令并产生缓存/产物,不能假称只读;将测试工作目录、数据和环境放在批准范围内,使用既有 agentctl 租约。
|
||||
- PI 报告由主 Agent 持锁落盘;PI 不修改业务代码或测试源码。将诊断建议交回 Cursor 实施。
|
||||
- 模型不可用、实际模型不符、配置缺失或未知结果遵循配置和 §6,不隐式换通道或降级。
|
||||
- 普通本机 PI 调度不复用 Herdr 自动审批/模型预算;产品 PI Runner 仍按目标环境批准配置独立验收。
|
||||
|
||||
### 后续接入步骤与验收
|
||||
|
||||
| 步骤 | 变更 | 必需证据 |
|
||||
|---|---|---|
|
||||
| A 文档配置 | 已确认分工,维护模型配置/派发模板;流程整体另按规范登记 | 默认值与用户选择一致;修改可追溯;未合入前不称全仓 active |
|
||||
| B 消除旧规则冲突 | 修订 Cursor 测试规则副本为验证契约指针 | 相关 ISSUE 单独修复验证;本次不改变 Runner |
|
||||
| C 实现派发入口 | 已实现 CLI + 项目 MCP;本地任务分支代码 69ffaa67 | 配置/租约/模型/快照/结果校验与异常回归已验证;dev 集成另记 |
|
||||
| D 实机试运行 | 小型文档任务和受控代码任务(代码由 Cursor 写) | Auto 不需手动切模型;PI 角色/模型/run_id/证据可追溯;不冒充真实产品 PI |
|
||||
| E 异常演练 | 同路径写冲突、PI 失联、必需测试缺项、dev 变化、验收失败、清理拒绝 | 正确暂停/升级;保留失败证据 |
|
||||
| F 工具门禁 | 据试运行决定是否增加阶段校验/hook | 实现和真实负例验收后才将相应能力标 enforced |
|
||||
|
||||
接入验收 V1–V10:V1 Cursor Auto 与配置指定 PI provider/model;V2 授权/需求上下文传递;V3 独立只读审查与报告转存;V4 租约内测试;V5 输入 SHA 变化后复核;V6 写冲突拒绝;V7 缺项不合并;V8 验收失败保留现场;V9 清理拒绝有 owner;V10 中断后恢复。新增 V11:修改配置只影响下一次派发、记录 hash;V12:M3 停用/越权路由及未知 alias 被拒绝。本轮执行器已完成 173 项工程回归与真实 Cursor CLI→MCP→PI 验证,覆盖及未覆盖项以测试报告为准;这不是宣称全部 S0–S9 审批、产品 UI/共享环境或清理已自动执行。
|
||||
|
||||
### 日常使用与调整
|
||||
|
||||
用户只需保持 Cursor Auto,说明任务目标与授权终点;主 Agent 读取本规范和模型配置,按需要派发 PI。修改默认分工只编辑模型配置文档;临时调整写入任务 override,不静默改全局默认。流程、模型配置和某任务授权是三个不同对象。
|
||||
|
||||
用户可以授权“按已确认方案执行到 local dev 集成与 dev 验收”;该授权不会自动包含 push 或晋升 test/main。验收后归档证据,当前 owner 退出后再由独立维护者复查清理。
|
||||
|
||||
回退:调度入口或权限不满足时暂停相应 PI 阶段,保留现场与证据,交回 Cursor 处理;不能以主 Agent 自审替代要求的独立审查。修复接入后再验证。
|
||||
+106
-10
@@ -1,46 +1,142 @@
|
||||
# 当前焦点
|
||||
|
||||
**更新**:2026-09-22(dev 门禁复验与 test 晋升收口)。此文件是协调快照;实际分支、进程、执行租约以机器核验为准。能力和发布结论分别见 [FEATURE-MATRIX](../status/FEATURE-MATRIX.md) / [gap-matrix](../remediation/gap-matrix.md)。
|
||||
**更新**:2026-09-23(剩余 worktree 收口:go-agentx+FAV 合入 local_dev;注册 worktree 已清;FAV live 仍不放量)。此文件是协调快照;实际分支、进程、执行租约以机器核验为准。能力和发布结论分别见 [FEATURE-MATRIX](../status/FEATURE-MATRIX.md) / [gap-matrix](../remediation/gap-matrix.md)。
|
||||
|
||||
手工 CAS 前:本 macOS 宿主 `docs apply`/`with`/`validate`/`integrate` 因 `/proc` 不可用;本轮文档与环境写采用手工等效(见任务例外登记)。
|
||||
本机 macOS 已可用 `agentctl with`/`docs apply`/`validate`/`integrate`(W1-B 进程层);共享文档写走 docs apply 收据。
|
||||
|
||||
## 焦点
|
||||
|
||||
1. **dev→test 已晋升**:`origin/dev@591ea601`(schema 61 门禁绿);`origin/test@83c6a12a` + tag `rc-v1.1.0-beta.1`;test 环境 health schema=61、Runner `MiniMax-M3`。[报告](../test-reports/2026-09-22-dev-gate-and-test-promotion-test-report.md)。
|
||||
2. **本任务 cleanup=pending**:feature / integrate / promote-test worktrees 待独立维护者按门禁复查后清理;不强删。
|
||||
3. **Agent 规范与 L1 门禁**:R01–R10、共享 .locks 已启用;本机 macOS 上租约路径不可用,受测 Linux 主机仍 enforced。
|
||||
0. **全量未完成计划收口**:FEATURE-MATRIX「模块解耦批次 A–G」→ `done`;多意图 I1 / 语义摘要 S1 / 治理 W4 / rdev / 红线证据已登记残差;红线(FAV live / SWBOOT-10 / D7 物理删 / PI 叙事 flag)不放量。详见 [收口短文](./short-term/2026-09-22-unfinished-batch-closeout.md)。
|
||||
|
||||
1. **DOCREV UI 重跑已 PASS**:main 18 + post-restart UI-15;20 audit + 9 remediation `done`(`management-implementation-plan` 仍方案态)。schema 63;密封 [sealed-ledger-ui00-16-post-20260923T0400Z](../test-reports/assets/2026-09-22-docrev-ui-rerun/sealed-ledger-ui00-16-post-20260923T0400Z/);证据 [测试报告](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md);worktree cleanup=pending。
|
||||
|
||||
2. **dev→test 已晋升**:`origin/dev@591ea601`(schema 61 门禁绿);`origin/test@83c6a12a` + tag `rc-v1.1.0-beta.1`;test 环境 health schema=61、Runner `MiniMax-M3`。[报告](../test-reports/2026-09-22-dev-gate-and-test-promotion-test-report.md)。
|
||||
3. **本任务 cleanup=pending**:feature / integrate / promote-test worktrees 待独立维护者按门禁复查后清理;不强删。
|
||||
4. **Agent 规范与 L1 门禁**:R01–R10、共享 .locks 已启用;本机 macOS 租约路径可用(Darwin 进程层已落地),与 Linux 双平台 enforced。
|
||||
|
||||
## 并行认领
|
||||
|
||||
| owner | task | branch | worktree | mutex | status |
|
||||
|---|---|---|---|---|---|
|
||||
| Cursor | admin-settings-maint-b-2026-09-25 | feature/admin-env-settings-maintenance-2026-09-25 | .worktrees/admin-env-settings-maintenance-2026-09-25 | admin-settings-maintenance | done |
|
||||
| Cursor | dm-migration-2026-09-24-r2 | feature/dm-migration-2026-09-24 | .worktrees/dm-migration-2026-09-24 | dm-migration | done |
|
||||
| Cursor | governance-console-p1-impl-2026-09-24 | feature/governance-console-p1-impl-2026-09-24 | .worktrees/governance-console-p1-impl-2026-09-24 | agentctl-console | done |
|
||||
| Cursor | governance-console-p1-design-2026-09-24 | feature/governance-console-p1-design-2026-09-24 | .worktrees/governance-console-p1-design-2026-09-24 | agentctl-console-design | done |
|
||||
| Cursor | governance-visibility-p0-2026-09-24 | feature/governance-visibility-p0-2026-09-24 | .worktrees/governance-visibility-p0-2026-09-24 | agentctl-visibility | done |
|
||||
| Cursor | worktree-cleanup-closeout-2026-09-24 | feature/worktree-cleanup-closeout-2026-09-24 | .worktrees/worktree-cleanup-closeout-2026-09-24 | worktree-cleanup | in_progress |
|
||||
| Cursor | non-author-closeout-2026-09-24 | feature/non-author-closeout-2026-09-24 | .worktrees/non-author-closeout-2026-09-24 | docs+git:dev | done |
|
||||
| Cursor | integrate-non-author-docs-2026-09-24 | feature/integrate-non-author-docs-2026-09-24 | .worktrees/integrate-non-author-docs-2026-09-24 | git:dev | done |
|
||||
| Cursor | non-author-member-access-docs-2026-09-24 | feature/non-author-member-access-2026-09-24 | .worktrees/non-author-member-access-2026-09-24 | docs+matrix | done |
|
||||
| Cursor | non-author-member-access-2026-09-24 | feature/non-author-member-access-2026-09-24 | .worktrees/non-author-member-access-2026-09-24 | docgov+iam-authz+workflow-gov | done |
|
||||
| Cursor | integrate-free-collab-2026-09-24 | feature/integrate-free-collab-2026-09-24 | .worktrees/integrate-free-collab-2026-09-24 | integrate-dev | done |
|
||||
| Cursor | cursor-governance-hooks-2026-09-24 | feature/cursor-governance-hooks-2026-09-24 | .worktrees/cursor-governance-hooks-2026-09-24 | cursor-governance | done |
|
||||
| Cursor | governance-catalog-2026-09-24 | feature/governance-catalog-2026-09-24 | .worktrees/governance-catalog-2026-09-24 | agent-workflow-governance+catalog | done |
|
||||
| Codex | subagent-workflow-standard-2026-09-24-land | feature/subagent-workflow-standard-2026-09-24 | .worktrees/subagent-workflow-standard-2026-09-24 | pi-subagent-integration | done |
|
||||
| Cursor/Codex | subagent-workflow-standard-2026-09-24-executor | feature/subagent-workflow-standard-2026-09-24 | .worktrees/subagent-workflow-standard-2026-09-24 | pi-subagent-executor | done |
|
||||
| Codex | subagent-workflow-standard-2026-09-24-config-r2 | feature/subagent-workflow-standard-2026-09-24 | .worktrees/subagent-workflow-standard-2026-09-24 | subagent-workflow-docs | done |
|
||||
| Codex | subagent-workflow-standard-2026-09-24 | feature/subagent-workflow-standard-2026-09-24 | .worktrees/subagent-workflow-standard-2026-09-24 | subagent-workflow-docs | done |
|
||||
| Cursor | integrate-gate-nightly-fixes-b-2026-09-24 | feature/integrate-gate-nightly-fixes-b-2026-09-24 | .worktrees/integrate-gate-nightly-fixes-b-2026-09-24 | git:dev | done |
|
||||
| Cursor | integrate-gate-nightly-fixes-2026-09-24 | feature/integrate-gate-nightly-fixes-2026-09-24 | .worktrees/integrate-gate-nightly-fixes-2026-09-24 | git:dev | done |
|
||||
| Cursor | integrate-docs-gate-promo-report-2026-09-24 | feature/integrate-docs-gate-promo-report-2026-09-24 | .worktrees/integrate-docs-gate-promo-report-2026-09-24 | git:dev | done |
|
||||
| Cursor | promote-rc-beta3-c-2026-09-24 | feature/promote-rc-beta3-c-2026-09-24 | .worktrees/promote-rc-beta3-c-2026-09-24 | git:test+env:test+docs | done |
|
||||
| Cursor | dev-full-gate-test-promo-2026-09-24 | feature/dev-full-gate-test-promo-2026-09-24 | .worktrees/dev-full-gate-test-promo-2026-09-24 | git:dev+env:dev+env:test+docs | done |
|
||||
| Cursor | gate-promo-current-close-2026-09-24 | feature/gate-promo-current-close-2026-09-24 | .worktrees/gate-promo-current-close-2026-09-24 | docs:admin+docs | done |
|
||||
| Cursor | docs-gate-promo-report-2026-09-24 | feature/docs-gate-promo-report-2026-09-24 | .worktrees/docs-gate-promo-report-2026-09-24 | docs+git:dev | done |
|
||||
| Cursor | admin-password-reset-2026-09-24 | feature/admin-password-reset-2026-09-24 | .worktrees/admin-password-reset-2026-09-24 | auth+env:test | done |
|
||||
| Cursor | fix-fav-staging-uuid-2026-09-24 | fix/fix-fav-staging-uuid-2026-09-24 | .worktrees/fix-fav-staging-uuid-2026-09-24 | artifactvault | done |
|
||||
| Cursor | gate-e1a-unique-project-name-2026-09-24 | fix/gate-e1a-unique-project-name-2026-09-24 | .worktrees/gate-e1a-unique-project-name-2026-09-24 | docnotify | done |
|
||||
| Cursor | gate-unhook-docquery-2026-09-24 | fix/gate-unhook-docquery-2026-09-24 | .worktrees/gate-unhook-docquery-2026-09-24 | server+docquery | done |
|
||||
| Cursor | integrate-jev-assist-land-2026-09-24 | feature/integrate-jev-assist-land-2026-09-24 | .worktrees/integrate-jev-assist-land-2026-09-24 | git:dev | done |
|
||||
| Cursor | integrate-codegraph-fixup2-2026-09-24 | feature/integrate-codegraph-fixup2-2026-09-24 | (removed) | git:dev | done |
|
||||
| Cursor | integrate-codegraph-governance-2026-09-24 | feature/integrate-codegraph-governance-2026-09-24 | (removed) | git:dev | done |
|
||||
| Cursor | codegraph-governance-r2-2026-09-24 | feature/codegraph-governance-2026-09-24 | .worktrees/codegraph-governance-2026-09-24 | agent-workflow-governance+codegraph | done |
|
||||
| Cursor | jev-dev-shadow-on-2026-09-24 | feature/jev-dev-shadow-on-2026-09-24 | .worktrees/jev-dev-shadow-on-2026-09-24 | env:dev+jevdecide | done |
|
||||
| Cursor | jev-product-closeout-2026-09-24 | feature/jev-product-closeout-2026-09-24 | .worktrees/jev-product-closeout-2026-09-24 | jevdecide+coordinator | done |
|
||||
| Cursor | jev-product-shadow-2026-09-24 | feature/jev-product-shadow-2026-09-24 | .worktrees/jev-product-shadow-2026-09-24 | jevdecide+coordinator | done |
|
||||
| Cursor | jev-mcp-docs-done-2026-09-24 | feature/jev-mcp-docs-done-2026-09-24 | .worktrees/jev-mcp-docs-done-2026-09-24 | jev-mcp+docs | done |
|
||||
| Cursor | jev-mcp-integration-2026-09-24 | feature/jev-mcp-integration-2026-09-24 | .worktrees/jev-mcp-integration-2026-09-24 | jev-mcp+docs | done |
|
||||
| Cursor | integrate-intent-plan-u9u12-land-2026-09-24 | feature/integrate-intent-plan-u9u12-land-2026-09-24 | .worktrees/integrate-intent-plan-u9u12-land-2026-09-24 | git:dev | done |
|
||||
| Cursor | integrate-pi-narrative-docs-2026-09-23 | feature/integrate-pi-narrative-docs-2026-09-23 | .worktrees/integrate-pi-narrative-final-closeout-b-2026-09-23 | git:dev | done |
|
||||
| Cursor | pi-narrative-final-closeout-b-2026-09-23 | feature/pi-narrative-final-closeout-b-2026-09-23 | .worktrees/pi-narrative-final-closeout-2026-09-23 | docgov | done |
|
||||
| Cursor | chat-semantic-d3-matrix-land-2026-09-23 | feature/chat-semantic-d3-matrix-land-2026-09-23 | .worktrees/chat-semantic-d3-matrix-land-2026-09-23 | chat | done |
|
||||
| Cursor | intent-plan-i2-rollout-b-2026-09-24 | feature/intent-plan-i2-rollout-2026-09-24 | .worktrees/intent-plan-i2-rollout-2026-09-24 | intent-plan | in_progress |
|
||||
| Cursor | intent-plan-i2-impl-2026-09-24 | feature/intent-plan-i2-shadow-allowlist-2026-09-24 | .worktrees/intent-plan-i2-shadow-allowlist-2026-09-24 | intent-plan | in_progress |
|
||||
| Cursor | closeout-claim-removed-2026-09-23 | feature/closeout-claim-removed-2026-09-23 | (removed) | git:dev+worktree-cleanup | done |
|
||||
| Cursor | module-batches-ag-status-fix-2026-09-23 | feature/module-batches-ag-status-fix-2026-09-23 | .worktrees/module-batches-ag-status-fix-2026-09-23 | module-decoupling-spec | done |
|
||||
| Cursor | fav-constraint-current-2026-09-23 | feature/fav-constraint-current-2026-09-23 | (removed) | git:dev+docs | done |
|
||||
| Cursor | closeout-worktree-cleanup-2026-09-23 | feature/closeout-worktree-cleanup-2026-09-23 | .worktrees/closeout-worktree-cleanup-2026-09-23 | git:dev+worktree-cleanup | done |
|
||||
| Cursor | remaining-worktrees-closeout-2026-09-23 | feature/remaining-worktrees-closeout-2026-09-23 | (removed) | git:dev+worktree-cleanup | done |
|
||||
| Cursor | worktree-closeout-cleanup-2026-09-23 | feature/worktree-closeout-cleanup-2026-09-23 | .worktrees/worktree-closeout-cleanup-2026-09-23 | git:dev+worktree-cleanup | done |
|
||||
| Cursor | worktree-closeout-batch-2026-09-23 | feature/worktree-closeout-batch-2026-09-23 | (removed) | git:dev+worktree-cleanup | done |
|
||||
| Cursor | agentctl-cursor-integration-close-2026-09-23 | feature/agentctl-cursor-integration-close-2026-09-23 | .worktrees/agentctl-cursor-integration-close-2026-09-23 | agentctl-cursor-integration-close | done |
|
||||
| Cursor | integrate-agentctl-cursor-integration-2026-09-23 | feature/integrate-agentctl-cursor-integration-2026-09-23 | .worktrees/integrate-agentctl-cursor-integration-2026-09-23 | git:dev | done |
|
||||
| Cursor | agentctl-cursor-integration-2026-09-23 | feature/agentctl-cursor-integration-2026-09-23 | .worktrees/agentctl-cursor-integration-2026-09-23 | agentctl-cursor-integration | done |
|
||||
| Cursor | agentctl-mgmt-go-live-close-2026-09-23 | feature/agentctl-mgmt-go-live-close-2026-09-23 | .worktrees/agentctl-mgmt-go-live-close-2026-09-23 | agentctl-mgmt-go-live-close | done |
|
||||
| Cursor | integrate-agentctl-mgmt-go-live-2026-09-23 | feature/integrate-agentctl-mgmt-go-live-2026-09-23 | .worktrees/integrate-agentctl-mgmt-go-live-2026-09-23 | git:dev | done |
|
||||
| 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 | done |
|
||||
| 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 |
|
||||
| Cursor | w3-u6-closeout-2026-09-23 | feature/w3-u6-closeout-2026-09-23 | .worktrees/w3-u6-closeout-2026-09-23 | w3-u6-closeout | done |
|
||||
| Cursor | matrix-record-id-2026-09-23 | feature/matrix-record-id-2026-09-23 | .worktrees/matrix-record-id-2026-09-23 | matrix-record-id | done |
|
||||
| Cursor | w2-closeout-2026-09-23 | feature/w2-closeout-2026-09-23 | .worktrees/w2-closeout-2026-09-23 | w2-closeout | done |
|
||||
| Cursor | current-projection-2026-09-23 | feature/current-projection-2026-09-23 | .worktrees/current-projection-2026-09-23 | current-projection | done |
|
||||
| Cursor | agentctl-daemon-2026-09-23 | feature/agentctl-daemon-2026-09-23 | .worktrees/agentctl-daemon-2026-09-23 | agentctl-daemon | done |
|
||||
| Cursor | agentctl-handoff-2026-09-23 | feature/agentctl-handoff-2026-09-23 | .worktrees/agentctl-handoff-2026-09-23 | agentctl-handoff | done |
|
||||
| Cursor | agentctl-claim-2026-09-23 | feature/agentctl-claim-2026-09-23 | .worktrees/agentctl-claim-2026-09-23 | agentctl-claim | done |
|
||||
| Cursor | agent-governance-config-2026-09-23 | feature/agent-governance-config-2026-09-23 | .worktrees/agent-governance-config-2026-09-23 | agent-governance-config | done |
|
||||
| Cursor | coordination-db-daemon-impl-plan-2026-09-23 | feature/coordination-db-daemon-impl-plan-2026-09-23 | .worktrees/coordination-db-daemon-impl-plan-2026-09-23 | coordination-db-daemon-impl-plan | done |
|
||||
| Cursor | coordination-db-daemon-2026-09-23 | feature/coordination-db-daemon-2026-09-23 | .worktrees/coordination-db-daemon-2026-09-23 | coordination-db-daemon | done |
|
||||
| Cursor | integrate-pi-runner-response-size-r2-2026-09-23 | feature/integrate-pi-runner-response-size-2026-09-23 | .worktrees/integrate-pi-runner-response-size-2026-09-23 | git:dev | done |
|
||||
| Cursor | modular-decouple-residual-b-2026-09-23 | feature/modular-decouple-residual-2026-09-23 | .worktrees/modular-decouple-residual-2026-09-23 | modular-decouple-residual | done |
|
||||
| Cursor | modular-refactor-impl-plan-2026-09-23 | feature/modular-refactor-impl-plan-2026-09-23 | .worktrees/modular-refactor-impl-plan-2026-09-23 | docs-remediation-modular-impl-plan | done |
|
||||
| Cursor | modular-refactor-review-2026-09-23 | feature/modular-refactor-review-2026-09-23 | .worktrees/modular-refactor-review-2026-09-23 | ops-audit-modular-refactor-review | done |
|
||||
| Cursor | 2026-09-22-status-reconcile | feature/status-reconcile-2026-09-22 | .worktrees/status-reconcile-2026-09-22 | ops-status-reconcile | done |
|
||||
| Cursor | 2026-09-22-dev-prod-ready-test-promotion | feature/dev-prod-ready-test-promotion-2026-09-22 | .worktrees/dev-prod-ready-test-promotion-2026-09-22 | dev-runtime-migration+release-gate+test-promotion | done |
|
||||
| Cursor | integrate-dev-prod-ready-test-promotion-2026-09-22 | feature/integrate-dev-prod-ready-test-promotion-2026-09-22 | .worktrees/integrate-dev-prod-ready-test-promotion-2026-09-22 | git:dev | done |
|
||||
| Cursor | promote-test-2026-09-22 | feature/promote-test-2026-09-22 | .worktrees/promote-test-2026-09-22 | git:test | done |
|
||||
| Codex | 2026-09-21-agent-workflow-governance-adoption | feature/agent-workflow-governance-plan | (本机 clone 后不存在) | agent-workflow-governance | done |
|
||||
| Codex | issue-learning-2026-09-23 | feature/issue-learning-2026-09-23 | .worktrees/issue-learning-2026-09-23 | issue-learning-docs | done |
|
||||
| Codex | systemic-issue-analysis-2026-09-23 | feature/systemic-issue-analysis-2026-09-23 | .worktrees/systemic-issue-analysis-2026-09-23 | systemic-issue-analysis-docs | done |
|
||||
| Codex | modular-contract-standard-2026-09-22 | feature/modular-contract-standard-2026-09-22 | .worktrees/modular-contract-standard-2026-09-22 | modular-contract-docs | done |
|
||||
| Codex | herdr-orchestration-v12 | feature/herdr-orchestration-v12 | .worktrees/herdr-orchestration-v12 | herdr-policy+scripts | done |
|
||||
| Codex | 2026-09-21-agent-governance-implementation | feature/agent-governance-implementation | .worktrees/agent-governance-implementation | agent-governance | done |
|
||||
| Cursor | 2026-09-21-force-material-chunk-index | feature/force-material-chunk-index-2026-09-21 | .worktrees/force-material-chunk-index-2026-09-21 | bizdev+materialindex | done |
|
||||
| Cursor | 2026-09-21-workflow-scope-weighting | feature/workflow-scope-weighting-2026-09-21 | .worktrees/workflow-scope-weighting-2026-09-21 | intent+web+docgov | done |
|
||||
| Cursor | 2026-09-21-upload-parse-ux-dedup | feature/upload-parse-ux-2026-09-21 | .worktrees/upload-parse-ux-2026-09-21 | server+web+storage | done |
|
||||
| Cursor | 2026-09-21-mineru-doc-parsing | feature/mineru-doc-parsing-2026-09-21 | .worktrees/mineru-doc-parsing-2026-09-21 | storage+bizdev+kb | done |
|
||||
| Cursor | 2026-09-21-intent-confirm-stage-aware | fix/intent-confirm-stage-aware-2026-09-21 | .worktrees/intent-confirm-stage-aware-2026-09-21 | intent+web+docgov | done |
|
||||
| Cursor | 2026-09-21-taskrun-status-card | feature/taskrun-status-card-2026-09-21 | .worktrees/feature-taskrun-status-card-2026-09-21 | chat+web+taskrun | done |
|
||||
| Codex | 2026-09-21-agent-workflow-governance-plan | feature/agent-workflow-governance-plan | .worktrees/feature-agent-workflow-governance-plan | agent-workflow-governance-plan | done |
|
||||
| Cursor | 2026-09-21-workflow-doc-key-unification | fix/workflow-doc-key-unification-2026-09-21 | .worktrees/fix-workflow-doc-key-unification-2026-09-21 | docgov+web | done |
|
||||
| Cursor | 2026-09-21-dev-multiuser-four-issues | fix/dev-multiuser-four-issues-2026-09-21 | .worktrees/fix-dev-multiuser-four-issues | projectinstance+docgov | done |
|
||||
| Codex | 2026-09-17-initial-load-performance-plan | feature/initial-load-performance-plan | .worktrees/feature-initial-load-performance-plan | loading-performance-audit | done |
|
||||
| Cline | 2026-09-16-partial-deferred-completion | docs/partial-deferred-completion-plan | - | architecture-docs | in_progress |
|
||||
| Cursor | dialogue-context-injection-2026-09-25 | feature/dialogue-context-injection-2026-09-25 | /home/weichen/projects/Agent-System/.worktrees/dialogue-context-injection-2026-09-25 | dialogue-ctx | in_progress |
|
||||
| Cursor | dialogue-context-injection-2026-09-25-r2 | feature/dialogue-context-injection-2026-09-25 | .worktrees/dialogue-context-injection-2026-09-25 | dialogue-ctx | done |
|
||||
|
||||
## 清理接管与遗留现场
|
||||
|
||||
| 路径/事项 | 分类与保留原因 | cleanup_owner | 复查触发 |
|
||||
|---|---|---|---|
|
||||
| `.worktrees/dev-prod-ready-test-promotion-2026-09-22` 等本轮三个 worktree | 任务 done;cleanup=pending;证据已入 test-reports / gap-matrix | 独立维护者 | 核对 tip 为 origin/dev 或 origin/test 祖先、无进程后 remove |
|
||||
| `.worktrees/docrev-ui-rerun-2026-09-22` / `freeform-project-id-bigint` | 已清理 / 目录不存在(2026-09-23 核对) | Cursor | 无 |
|
||||
| `.worktrees/dev-prod-ready-test-promotion-2026-09-22` 等本轮三个 worktree | 已清理 / 目录不存在(2026-09-23 核对) | Cursor | 无 |
|
||||
| Cline `2026-09-16-partial-deferred-completion` | 仍 in_progress;W5–W7 未关闭 | Cline owner / 维护者 | 单独授权实施或交接 |
|
||||
| 保护分支 / FAV 相关 | 保护项;故意不合入、不删 | 原 owner / 维护者 | 用户调整保护边界后 |
|
||||
| 保护分支 / FAV 相关 | 已合入 local_dev(例外授权 2026-09-23);live 未放量;分支/worktree 已删 | Cursor | 无;见 integrate-fav-final 例外登记 |
|
||||
| embedding 401(dmxapi) | 非 blocker 运维债;不挡 PI | 运维 | 换钥后重跑 chunk index |
|
||||
|
||||
## 集成槽位
|
||||
|
||||
| holder | phase | since | scope | queue |
|
||||
|--------|-------|-------|-------|-------|
|
||||
| - | idle | 2026-09-22 | 本轮合入与 test 晋升已完成并推送;后续合入须重新认领串行 | - |
|
||||
| - | idle | 2026-09-21 | force-material-chunk-index 已合入 dev 并从主目录 rebuild;项目 6579 候选 535 已确认;schema=61 | - |
|
||||
|
||||
**phase**: `idle` | `merging` | `smoke` | `e2e`
|
||||
|
||||
> 合入 `dev` + 共享容器验证必须串行。实际机器锁/进程优先;详见 [操作规范](./2026-09-21-agent-worktree-workflow.md)。
|
||||
|
||||
## 受控约束
|
||||
|
||||
- 禁止整支 merge FAV;保留既有保护分支;不删 `origin/*`(本轮仅前进 `dev`/`test` 与新增 rc tag)。
|
||||
- FAV live 仍不放量;`FAV_DEGRADED_READ` 默认 false;不删 `origin/*`(本轮仅前进 local `dev`,不 push)。
|
||||
- 不默认升 `MULTI_INTENT_PLAN_TIER=full`;`SEED_DEMO_USERS=false` 在 test 保持。
|
||||
- D7 对话 ADR 仍待合规签字;追踪表类别 `record` 不授权物理删除。
|
||||
- main 未在本轮晋升。
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
# 安全红线正则误拦 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
用户发送正常文档撰写请求「请撰写详尽合规手册:…每项含理由/证据/失败模式/整改/角色/抽样方法…」时,助手返回固定文案「⚠️ 合规权限拦截…」。根因是 `isSecurityViolation` 正则 2 用裸单字动词「改」加无界 `.*`,把「整改/角色」误配为越权写操作。
|
||||
|
||||
规范归档路径应为 `.doc/test-reports/`;本报告因并行任务 `server-image-field-closeout-r3-2026-09-25` 占用该 scope,先落盘于 `.doc/ops/evidence/` 与 agent store,待 scope 释放后再迁移。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
1. 原句与同类误报变体不得返回 `SECURITY_FORBIDDEN`。
|
||||
2. 既有真阳性用例仍须拦截(confidence=1.0)。
|
||||
3. 收紧机制不破坏 `internal/intent` / `internal/coordinator` 回归。
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS: Linux;Go 1.27.1;worktree `feature/security-redline-false-positive-2026-09-25` @ base `44161d2a`
|
||||
- 层级:Go/接口(验证契约)
|
||||
- 范围:`internal/intent`、`internal/coordinator`;全量 `go test -short ./...`(旁路失败单独记)
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
| 用例 | 预期 |
|
||||
|---|---|
|
||||
| 原句合规手册撰写 | 非 SECURITY_FORBIDDEN |
|
||||
| 整改计划…角色职责 | 非 SECURITY_FORBIDDEN |
|
||||
| 改一下文档标题…角色 | 非 SECURITY_FORBIDDEN |
|
||||
| 换一份清单…姓名字段 | 非 SECURITY_FORBIDDEN |
|
||||
| 起草系统配置说明文档 | 非 SECURITY_FORBIDDEN |
|
||||
| 知识库连接失败怎么排查 | 非 SECURITY_FORBIDDEN |
|
||||
| 既有 SecurityForbidden / Extended | 仍 SECURITY_FORBIDDEN |
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### 5.1 修复前(对照)
|
||||
|
||||
命令:`go test ./internal/intent/ -run TestIntentRecognition_SecurityFalsePositives_NotBlocked -count=1`
|
||||
|
||||
- **实际输出**:6/6 子用例 FAIL,均 `got SECURITY_FORBIDDEN`
|
||||
- **判定**:FAIL(预期:用于确认红)
|
||||
- **耗时**:约 4ms
|
||||
|
||||
### 5.2 修复后 — 误报负例
|
||||
|
||||
命令:`go test ./internal/intent/ ./internal/coordinator/ -count=1 -v -run 'Security'`
|
||||
|
||||
```
|
||||
--- PASS: TestIntentRecognition_SecurityFalsePositives_NotBlocked (0.00s)
|
||||
--- PASS: .../合规手册撰写含整改角色字段
|
||||
--- PASS: .../整改+角色远距共现
|
||||
--- PASS: .../改一下文档+角色跨句
|
||||
--- PASS: .../换一份清单+姓名字段
|
||||
--- PASS: .../系统配置说明文档撰写
|
||||
--- PASS: .../知识库连接故障排查询问
|
||||
--- PASS: TestIntentRecognition_SecurityForbidden
|
||||
--- PASS: TestIntentRecognition_SecurityForbidden_Extended (全部子用例)
|
||||
--- PASS: TestCoordinatorEngine_SecurityForbidden
|
||||
ok chat-agent-system/internal/intent
|
||||
ok chat-agent-system/internal/coordinator
|
||||
```
|
||||
|
||||
- **判定**:PASS
|
||||
- **耗时**:intent ~7ms;coordinator ~4ms
|
||||
|
||||
### 5.3 门禁
|
||||
|
||||
| 检查 | 判定 |
|
||||
|---|---|
|
||||
| `./scripts/arch-check.sh --mode block` | PASS |
|
||||
| `go vet ./...` | PASS |
|
||||
| `go test ./internal/intent/ ./internal/coordinator/ -count=1` | PASS |
|
||||
| `go test -short ./...` | 旁路 FAIL:`cmd/bizdev-cli` goose duplicate version 71(`00071_...maintenance-windows` 与 `00071_...context-conflict-adjudications`),与本次 intent 改动无关;其余包 ok |
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
- 适用并实际运行:arch-check、go vet、intent/coordinator 全量、short 全仓(旁路失败已记录)
|
||||
- 新增用例:`TestIntentRecognition_SecurityFalsePositives_NotBlocked`(6 子例)
|
||||
- 真阳性零回退
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
- **结论**:机制级收紧后,原句与同类变体不再误拦;真阳性仍拦截。授权范围内验收满足。
|
||||
- **后续**:① scope 释放后将本报告迁入 `.doc/test-reports/2026-09-25-security-redline-false-positive-test-report.md`;② 独立处理 goose 71 重复(非本任务);③ 可选:对「越权」裸字面量做同类负例评估(如「防越权培训」)。
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
lesson_id: LESSON-20260924-cursor-hook-advisory-gates
|
||||
lesson_state: candidate
|
||||
owner: Cursor
|
||||
reviewer: Cursor(自审;实机采样后转 validated)
|
||||
last_reviewed: 2026-09-24
|
||||
reviewed_revision: cursor-governance-hooks-2026-09-24 worktree
|
||||
source_issues:
|
||||
- ISSUE-20260924-cursor-hook-event-contract
|
||||
- ISSUE-20260924-cursor-test-rule-drift
|
||||
- ISSUE-20260924-cursor-cli-mcp-path
|
||||
keywords: [Cursor, hooks, advisory, fail-open, probe, stdin, MCP]
|
||||
---
|
||||
|
||||
# 客户端 hook 与执行器门禁分层;契约未知时 fail-open
|
||||
|
||||
- 触发条件:为 Cursor 增加 hooks/rules,或发现 hook「写了但不生效/误拦」时。
|
||||
- 机制与来源:执行器(`pi_subagents.py` / agentctl)已有权威硬拒绝;hook 事件字段官方未完全文档化。heredoc 包装 Python 会吞掉 hook stdin。审计日志若放进被 git 跟踪的 `.cursor/hooks/` 会污染仓库。
|
||||
- 开发检查:
|
||||
1. hook 只做形状/授权类 `ask`,不复刻执行器全部校验。
|
||||
2. 用独立 `.py` + 薄 `.sh` `exec`,禁止 heredoc 占 stdin。
|
||||
3. 多名容错(`tool_name|mcp_tool_name|name` 等);识别失败 → allow + `UNRECOGNIZED_INPUT` 审计。
|
||||
4. 审计/probe 写 `.cursor/hook-audit.jsonl` / `hook-probe.jsonl`(被 `.cursor/*` ignore)。
|
||||
5. 规则副本只做指针,不复制验证契约中的模型名与全量命令。
|
||||
- 验证方式:`scripts/tests/test_cursor_hooks.py`;实机 `CURSOR_HOOKS_PROBE=1` 采样后升 validated。
|
||||
- 适用边界:本仓库项目级 hooks;不声称覆盖所有 Cursor 版本或 CLI 加载行为。
|
||||
- 防护落实:单元回归 enforced;hook↔Cursor 接线仍 advisory/manual。
|
||||
- 修订与失效:实机字段确认后收紧 matcher 并更新本条状态。
|
||||
@@ -0,0 +1,20 @@
|
||||
# LESSON-20260924-deny-only-submit
|
||||
|
||||
## 触发条件 / 关键词
|
||||
|
||||
非编制、DOC_DUTY、400、run/edit、送审、成员草稿
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. 权限哨兵必须在 `domainHTTPStatus` 显式映射到 403;默认 400 会让前端 403 文案永不命中。
|
||||
2. 放宽受控文档写权限时,`classifyAccess`、`AllowedTaskKeys`、`CanEditDocumentContent` 必须同批调整,否则单门放行仍会在下游失败。
|
||||
3. docgov 不得 import projectinstance:成员身份由 server 校验后经 `ActorIsMember` 传入;禁止用 `RoleSystem` 冒充人工成员。
|
||||
4. 审批路径走 `CheckDocTaskAccess(submit|review|approve)`,不要复用 `TaskKeyAllowed`。
|
||||
|
||||
## lesson_state
|
||||
|
||||
validated(2026-09-24 真实 PI)
|
||||
|
||||
## 主记录
|
||||
|
||||
[ISSUE-20260924-non-author-400-duty](../../audit/2026-09-24-non-author-member-access.md)
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
lesson_id: LESSON-20260924-pi-tool-boundaries
|
||||
lesson_state: validated
|
||||
owner: Cursor/Codex
|
||||
reviewer: Codex
|
||||
last_reviewed: 2026-09-24
|
||||
reviewed_revision: 69ffaa677e23a1dd9aa0528bb09b3acfcd38b119
|
||||
source_issues: [ISSUE-20260924-pi-executor-boundaries]
|
||||
keywords: [PI, MCP, readonly, path, snapshot, process-group]
|
||||
---
|
||||
|
||||
# 文件工具的路径检查须匹配实际客户端语义
|
||||
|
||||
触发:为第三方 Agent 包装只读文件工具、复制输入快照或监督子进程。
|
||||
|
||||
机制:PI 0.85.1 工具会展开 @/~,初版守卫只做 path.resolve,检查对象与实际打开对象不同;另有 exact-root 空相对路径误拒、内部扩展复制进模型快照导致合法枚举被白名单拒绝。见[问题](../../audit/2026-09-24-pi-executor-boundaries.md)与[验证](../../test-reports/2026-09-24-pi-executor-test-report.md)。
|
||||
|
||||
实施前检查:
|
||||
|
||||
1. 读实际工具的路径规范化实现;拒绝不支持的前缀/参数,核对 canonical realpath、符号链接与选定文件。不能仅假设安全的相对拼接等于最终访问路径。
|
||||
2. 模型输入、测试可写副本、客户端内部配置/扩展分开;允许清单只包含模型该读的材料。内部文件不要塞进源码快照。
|
||||
3. 同时验证拒绝路径和合法根目录/子目录、默认 path;只有负例通过不足以证明工具可用。
|
||||
4. MCP 直接协议实测和真实客户端派发都要做。官方文档支持变量不证明本机 CLI 已展开;真实路径错误用版本/命令留证。
|
||||
5. 进程完成与验收通过分开,leader 退出不证明整个进程组退出。保留报告和失败证据,再按实际运行身份回收。
|
||||
|
||||
范围:本次 gmktec/Linux、PI 0.85.1、Cursor CLI 的工程工具;客户端升级和其它系统需复核。这里的工具/进程守卫不是 OS 沙箱。
|
||||
@@ -7,5 +7,8 @@
|
||||
| LESSON-20260923-nullable-duty | docgov、SQL、nullable、23503、可选职责、创建/heal | 检查所有写入口的缺席值语义;用真实 PG 验证 NULL/FK | validated | [可选职责持久化](2026-09-23-nullable-duty.md);2026-09-23 |
|
||||
| LESSON-20260923-content-hash | docrevision、canonicalize、hash、bootstrap、hard-break、404、水合 | 保持文本语义并检查账本/文件一致性;新数据通过不能覆盖旧数据迁移 | validated | [正文规范化与投影](2026-09-23-content-hash.md);2026-09-23 |
|
||||
| LESSON-20260923-matrix-status-cas | FEATURE-MATRIX、docs-apply、record_id、merge conflict、CAS | 矩阵/CURRENT 行变更走 docs apply;合并后核验状态列未被回退 | validated | [矩阵状态 CAS](2026-09-23-matrix-status-cas.md);2026-09-23 |
|
||||
| LESSON-20260924-pi-tool-boundaries | PI、MCP、readonly、path、snapshot、process-group | 路径语义与快照边界一致,合法路径和拒绝路径都验收 | validated | [文件工具边界](2026-09-24-pi-tool-boundaries.md);2026-09-24 |
|
||||
| LESSON-20260924-cursor-hook-advisory-gates | Cursor、hooks、advisory、fail-open、probe、stdin | hook 与执行器分层;契约未知 fail-open;审计日志放 ignore 路径 | candidate | [客户端 hook 门禁](2026-09-24-cursor-hook-advisory-gates.md);2026-09-24 |
|
||||
| LESSON-20260924-deny-only-submit | 非编制、DOC_DUTY、400、run/edit、送审 | 权限哨兵映射 403;三道门协同放宽;ActorIsMember 不复用 RoleSystem | validated | [deny_only_submit](2026-09-24-deny-only-submit.md);2026-09-24 |
|
||||
|
||||
validated 的证据范围见各条目;本日复核为历史材料和源码阅读,未重跑产品回归。后续按机制补充,过时条目标 superseded/retired 并保留替代链接。
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# admin-password-reset-2026-09-24
|
||||
|
||||
| 字段 | 值 |
|
||||
|---|---|
|
||||
| status | done |
|
||||
| write_scope | internal, web, deploy/postgres/goose, .doc |
|
||||
| mutex | auth+env:test |
|
||||
| base_dev_sha | 3de5bc5c396fc21887f0f19e6e3baa8784347f99 |
|
||||
| review_state | accepted |
|
||||
| integration_state | queued_local_dev (waiting env:dev/git:dev lock from nightly) |
|
||||
| deployment | not_required(合入 local_dev;晋升 test 另授权) |
|
||||
| cleanup | pending |
|
||||
| remote_sync | not_requested |
|
||||
| policy_revision | AGENTS.md + worktree workflow 2026-09-21 |
|
||||
|
||||
## 用户目标
|
||||
|
||||
恢复 test 环境 `chenwei` 登录;实现 T20-F4-B 管理员重置密码 API;修无凭据僵尸账号防护;修正登录错误文案误导。
|
||||
|
||||
## 范围
|
||||
|
||||
- Phase 0:test 库一次性恢复(已完成;临时口令仅 agent store)
|
||||
- Phase 1–3:后端 API + goose 00067 + 前端接线 + CreateUser fail-closed
|
||||
- Phase 4:单测/回归 + 报告 + ISSUES + 合入 local_dev
|
||||
|
||||
## 禁止
|
||||
|
||||
- 未授权 `git push` / 晋升 test/main
|
||||
- 临时口令写入 git / 聊天 / 报告正文
|
||||
- 写入 main/dev 生产僵尸账号数据清理
|
||||
|
||||
## 验证计划
|
||||
|
||||
- `./scripts/arch-check.sh --mode block`;`go vet ./...`;`go test -short ./...`
|
||||
- `web npm test` / `npm run build`
|
||||
- 新增 AdminResetPassword 正负例与 authErrorMessage 单测
|
||||
- Phase 0 实测 login 200(证据不披露口令)
|
||||
@@ -0,0 +1,97 @@
|
||||
# agentctl coordinator daemon 装载记录(Linux/systemd)
|
||||
|
||||
- task_id: agentctl-daemon-load-2026-09-24
|
||||
- owner: Cursor
|
||||
- 授权来源:用户会话确认(2026-09-24 09:37,"装载 systemd 单元"选项明示批准)
|
||||
- base_dev_sha: 5423b261f97f371bdf7fa5066e9305f9eddaef42
|
||||
- status: done(验证完成;文档合入待集成)
|
||||
- write_scope: .doc/ops/short-term/(本文档)、.doc/ops/CURRENT.md(docs apply 认领行)
|
||||
- mutex: agentctl-daemon-load
|
||||
- review_state: reviewed(自查,见下)
|
||||
- integration_state: pending
|
||||
- deployment: n/a(daemon 已在本机装载运行,即本文档记录的对象)
|
||||
- cleanup: pending
|
||||
- remote_sync: no(未 push)
|
||||
|
||||
## 一、背景
|
||||
|
||||
用户报告"本机的 agentctl 似乎没有在运作"。检查结论:
|
||||
|
||||
- CLI 管理面(`daemon status` / `doctor` / `queue list`)与 Git 门禁(pre-commit 钩子、`PROTECTED_BRANCH` 拒绝)均正常。
|
||||
- **coordinator daemon 从未装载**:`.locks/os/daemon.heartbeat` 与 `manager.lock` 不存在;`scripts/daemon/README.md` 标注 "Templates only. Not loaded on this machine"。本机为 Linux/systemd(规范模板中 launchd 适用于 macOS),systemd 模板从未实例化。
|
||||
- 附带发现两条死进程残留 run 卡住 `env:dev`(详见下节)。
|
||||
|
||||
## 二、操作记录
|
||||
|
||||
### 1. 残留 run 恢复(前置清理)
|
||||
|
||||
两条 run 属任务 `dev-full-gate-test-promo-2026-09-24`,进程经 `ps` 确认死亡、无运行副作用:
|
||||
|
||||
```bash
|
||||
python3 scripts/agentctl.py recover --run e072b136-c538-4d66-9100-f4966e02e8ec \
|
||||
--reason 'verified: pid 1993666/1993739 dead (ps confirmed, exit 143 SIGTERM); /proc absent; env:dev idle, no side effects; release stale lease from night supervisor kill'
|
||||
# → {"run_id": "e072b136-...", "status": "recovered"}
|
||||
|
||||
python3 scripts/agentctl.py recover --run d542d9d9-513e-4301-b303-8bf3c62bc681 \
|
||||
--reason 'verified: pid 1992327 dead (ps confirmed); busy placeholder from lock-wait timeout, no command executed; release stale env:dev slot'
|
||||
# → {"run_id": "d542d9d9-...", "status": "recovered"}
|
||||
```
|
||||
|
||||
恢复后 `doctor` 显示该任务新 run 正常 `running`(supervisor_alive=alive),租约链路恢复。
|
||||
|
||||
### 2. daemon 装载(本次主操作)
|
||||
|
||||
依据 `scripts/daemon/README.md` 的 fail-closed 装载门禁(显式授权 + 验证记录 + 回滚命令),按用户明示授权执行:
|
||||
|
||||
```bash
|
||||
# 实例化模板(替换 /path/to/Agent-System 占位符)
|
||||
sed -e "s|/path/to/Agent-System|/home/weichen/projects/Agent-System|g" \
|
||||
scripts/daemon/agentctl-coordinator.service \
|
||||
> ~/.config/systemd/user/agentctl-coordinator.service
|
||||
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now agentctl-coordinator.service
|
||||
```
|
||||
|
||||
## 三、装载验证(fail-closed 证据)
|
||||
|
||||
| 项 | 值 |
|
||||
|---|---|
|
||||
| host | weichen(Linux 7.0.0-31-generic,systemd user session) |
|
||||
| unit | `~/.config/systemd/user/agentctl-coordinator.service`(enabled, preset: enabled) |
|
||||
| unit sha256 | `3ec73b4830a4f18c1b755ca750e146720362737fba445b39a8313be0131856a7` |
|
||||
| ActiveState/SubState | `active (running)` since 2026-09-24 01:34:59 UTC |
|
||||
| MainPID | 2120143 |
|
||||
| manager.lock | held=true, holder_pid=2120143 |
|
||||
| heartbeat | cycle 226(启动约 4.5 分钟),heartbeat_age_seconds≈0.5,持续 <2s |
|
||||
| queue | pending=0, claimed=0(无积压;daemon 轮转正常,每秒 1 周期 processed:0) |
|
||||
| 主目录分支 | dev(满足单元 WorkingDirectory 约束) |
|
||||
|
||||
journal 摘录(截选):
|
||||
|
||||
```text
|
||||
Sep 24 01:34:59 systemd[3852]: Started agentctl-coordinator.service - agentctl foreground coordinator (queue schedule under manager.lock).
|
||||
Sep 24 01:34:59 python3[2120143]: {"audit_every": 30, "interval": 1.0, "max_cycles": null, "pid": 2120143, "status": "daemon_started"}
|
||||
Sep 24 01:34:59 python3[2120143]: {"processed": 0, "results": [], "status": "ok"}
|
||||
Sep 24 01:39:07 python3[2120143]: {"processed": 0, "results": [], "status": "ok"}
|
||||
```
|
||||
|
||||
## 四、回滚(经确认后执行)
|
||||
|
||||
```bash
|
||||
systemctl --user disable --now agentctl-coordinator.service
|
||||
rm ~/.config/systemd/user/agentctl-coordinator.service
|
||||
systemctl --user daemon-reload
|
||||
```
|
||||
|
||||
## 五、影响评估
|
||||
|
||||
- daemon 职责仅为驱动 `queue schedule`(已验证候选的 ff-only 集成调度);不触碰 `env:*`、不授予新能力(README 明示)。
|
||||
- 队列当前为空,装载不改变现有 `validate`+`integrate` 流程行为。
|
||||
- 未修改仓库内文件(单元文件在 `~/.config/systemd/user/`,仓库 tracked 文件零变更)。
|
||||
|
||||
## 六、后续
|
||||
|
||||
- daemon 已 `Restart=on-failure`,崩溃后 5s 自动拉起;无需人工干预。
|
||||
- 如需停用,见回滚一节(需重新确认)。
|
||||
- 本任务剩余收口:集成(integrate)到 local dev、CURRENT 行置 done、worktree 清理。
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
title: "Cursor 治理层扩展(rules / skills / hooks)"
|
||||
task_id: cursor-governance-hooks-2026-09-24
|
||||
status: done
|
||||
created: 2026-09-24
|
||||
updated: 2026-09-24
|
||||
owner: Cursor
|
||||
task_type: implementation
|
||||
task_tier: multi_stage
|
||||
policy_revision: "agent-governance-2026-09-21-r1 + issue-learning-2026-09-23-r1 + codegraph-governance-2026-09-24-r1 + subagent-workflow-2026-09-24-r2(proposed); base_dev@cfc80b34a40e8de78e77a44839571bb684d405d5"
|
||||
branch: feature/cursor-governance-hooks-2026-09-24
|
||||
worktree: .worktrees/cursor-governance-hooks-2026-09-24
|
||||
base_dev_sha: cfc80b34a40e8de78e77a44839571bb684d405d5
|
||||
write_scope: [".cursor", "scripts/tests", ".doc"]
|
||||
allowed_environments: []
|
||||
mutex: cursor-governance
|
||||
review_state: accepted
|
||||
integration_state: merged_local_dev
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
cleanup_owner: "owner 退出后的独立维护者"
|
||||
cleanup_trigger: "合入 local_dev、证据归档且 owner 退出后复查"
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# Cursor 治理层扩展(rules / skills / hooks)
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 用户目标:在已合入的 PI subagent 执行器基础上,为本项目 Cursor 补齐 skills、rules、hooks 等治理层。
|
||||
- 授权来源:本会话确认计划 `cursor_governance_layer`,范围含 7 项全选、hook 命中一律 `ask`、session+postToolUse 双轨、字段识别 both_phases。
|
||||
- 交付终点:任务分支实现并通过工程回归;受控合入 local `dev`;不 push;不重建产品服务。
|
||||
- 禁止:未授权 push / 晋升 test/main;改产品 Runner;以 stub 冒充产品 PASS;覆盖他人 CURRENT/MATRIX。
|
||||
|
||||
## 范围与非目标
|
||||
|
||||
- 允许:`.cursor/rules|skills|hooks|mcp.json`、`scripts/tests/test_cursor_hooks.py`、相关 `.doc`(任务/台账/经验/规范登记/测试报告)。
|
||||
- 非目标:改 `scripts/pi_subagents.py` 硬门禁语义;实现 S0–S9 自动状态机;产品 Go/前端/PG。
|
||||
|
||||
## 相关问题与经验
|
||||
|
||||
- ISSUE-20260924-cursor-test-rule-drift(open → verifying)
|
||||
- ISSUE-20260924-cursor-cli-mcp-path(deferred → verifying)
|
||||
- 新建 ISSUE-20260924-cursor-hook-event-contract(open)
|
||||
- 采纳 LESSON-20260923-matrix-status-cas、LESSON-20260924-pi-tool-boundaries;新建 LESSON-20260924-cursor-hook-advisory-gates(candidate)
|
||||
|
||||
## 需求与验收
|
||||
|
||||
| R-ID | 要求 | AC-ID |
|
||||
|---|---|---|
|
||||
| R1 | 修复测试规则漂移 | AC1:无固定模型/无条件全量 Go/失效 §8;指向验证契约 |
|
||||
| R2 | PI 派发 skill | AC2:roles→run→result、租约、拒绝码、run_status≠verdict |
|
||||
| R3 | 阶段记录 skill | AC3:派发包/回传/收据/R-AC-T 可执行 |
|
||||
| R4 | PI/会话/收据 hooks | AC4:ask;fail-open 异形;probe 开关;单元可测 |
|
||||
| R5 | MCP 路径 | AC5:agentctl/jev 相对路径;CLI 证据或 verifying |
|
||||
| R6 | rules 收敛与登记 | AC6:薄指针 + policy-registry 修订 |
|
||||
| R7 | 工程回归 | AC7:unittest discover 全绿;文档静态检查;报告归档 |
|
||||
|
||||
## 步骤与验收
|
||||
|
||||
1. [ ] 建场与认领
|
||||
2. [ ] 规则漂移修复
|
||||
3. [ ] 两 skill
|
||||
4. [ ] 四 hook + hooks.json
|
||||
5. [ ] MCP 路径
|
||||
6. [ ] rules 收敛
|
||||
7. [ ] 测试与全量回归
|
||||
8. [ ] ISSUES/lesson/policy-registry
|
||||
9. [ ] 测试报告
|
||||
10. [ ] probe 独立验收(需用户配合;未采样前 advisory)
|
||||
11. [ ] 受控合入 local_dev
|
||||
|
||||
## 验证与证据
|
||||
|
||||
见后续测试报告与本记录更新。产品链路 NOT REQUIRED。
|
||||
|
||||
## 相关链接
|
||||
|
||||
- 计划:用户确认的 Cursor governance layer
|
||||
- 权威:`.doc/ops/2026-09-24-subagent-model-config.md` · `2026-09-24-subagent-workflow-standard.md` · `2026-09-24-pi-subagent-executor.md` · `2026-09-21-validation-contract.md`
|
||||
|
||||
|
||||
## 收口(合入后)
|
||||
|
||||
- review_state=accepted;integration_state=merged_local_dev(`57cbd571`);deployment=not_required;cleanup=pending;remote_sync=not_requested
|
||||
- validate:208 tests OK;enqueue daemon ff-only 成功
|
||||
- IDE probe 仍为 pending_ide_sample;hook↔Cursor 接线保持 advisory
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
title: "dev 全面门禁与 test 晋升(rc-v1.1.0-beta.3)"
|
||||
task_id: docs-gate-promo-report-2026-09-24
|
||||
status: done
|
||||
created: 2026-09-24
|
||||
updated: 2026-09-24
|
||||
owner: Cursor
|
||||
task_type: ops
|
||||
task_tier: multi_stage
|
||||
policy_revision: "AGENTS+worktree-ops @ 3de5bc5c"
|
||||
branch: feature/docs-gate-promo-report-2026-09-24
|
||||
worktree: .worktrees/docs-gate-promo-report-2026-09-24
|
||||
base_dev_sha: "8ca448ddca7682f851835978921473594eec0ad9"
|
||||
head_sha: ""
|
||||
write_scope: [".doc/"]
|
||||
allowed_environments: ["dev", "test"]
|
||||
mutex: git:dev+env:test+docs
|
||||
review_state: accepted
|
||||
integration_state: pending_merge
|
||||
deployment: test_ok_schema_66
|
||||
cleanup: pending
|
||||
cleanup_owner: 独立维护者
|
||||
cleanup_trigger: tip 为 local_dev/origin 祖先且无进程占用后 remove
|
||||
remote_sync: pending_push
|
||||
---
|
||||
|
||||
# dev 全面门禁与 test 晋升
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 用户目标:dev 全面深测后晋升 test(merge + `rc-v1.1.0-beta.3` + 部署验收 + 恢复基线 + push)
|
||||
- 授权来源:用户确认计划(推送远端 + test 验收后恢复基线);RERANKER 笔误已自改
|
||||
- 交付终点:见 [测试报告](../../test-reports/2026-09-24-dev-full-gate-test-promotion-test-report.md)
|
||||
|
||||
## 结果摘要
|
||||
|
||||
- nightly PASS @ `3de5bc5c`;promote M=`0e4b111d` + `rc-v1.1.0-beta.3`;test schema 66
|
||||
- 小队 intake completed / 6802 字 / 幂等;S1 restore MATCH
|
||||
@@ -0,0 +1,72 @@
|
||||
---
|
||||
title: "Development-Manager 治理系统迁移"
|
||||
task_id: "dm-migration-2026-09-24-r2"
|
||||
status: done
|
||||
created: 2026-09-24
|
||||
updated: 2026-09-24
|
||||
owner: Cursor
|
||||
task_type: implementation
|
||||
task_tier: multi_stage
|
||||
policy_revision: "agent-governance-2026-09-23-fav-constraint-restored @ edbe59247872ef5861bafd30068955e22288c6ff"
|
||||
branch: feature/dm-migration-2026-09-24
|
||||
worktree: .worktrees/dm-migration-2026-09-24
|
||||
base_dev_sha: "edbe59247872ef5861bafd30068955e22288c6ff"
|
||||
write_scope: [".doc/ops/short-term/2026-09-24-dm-migration.md", ".doc/test-reports/2026-09-24-dm-migration-test-report.md", ".doc/ops/CURRENT.md"]
|
||||
allowed_environments: []
|
||||
mutex: dm-migration
|
||||
review_state: pending
|
||||
integration_state: pending # DM 仓已自管;AS 侧仅文档合入
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
cleanup_owner: Cursor
|
||||
cleanup_trigger: DM 验收通过且 AS 侧 CURRENT 收口完成
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# Development-Manager 治理系统迁移
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 用户目标:将 Agent-System 内管理/规范系统复制式迁移到独立仓库 Development-Manager(`/home/weichen/projects/Development-Manager`),关联远端 [weichen/Development-Manager](https://git-home.u1680832.nyat.app:30319/weichen/Development-Manager.git);自举自治;新增项目登记表实现单机统一管理;为后续中心服务端演进预留。
|
||||
- 交付终点:DM 仓可用、治理测试绿、双 daemon 并存、迁移溯源完整;Agent-System 管理系统暂不移除。
|
||||
- 禁止项:不移除 AS 管理系统;不默认 force;push 仅在用户确认后(本任务用户已授权按方案实施含 push)。
|
||||
- 架构决策:阶段 A 单机统一管理;阶段 B(不实施)中心服务端 + 分布式客户端;git 历史全新初始提交。
|
||||
|
||||
## 范围与非目标
|
||||
|
||||
- 允许:DM 仓新建与治理工具链/文档副本;AS 侧本任务文档、测试报告、CURRENT 认领行。
|
||||
- 非目标:产品 Go/React 代码;AS 治理删除;阶段 B C/S 实现。
|
||||
|
||||
## 相关问题与经验
|
||||
|
||||
- catalog:`R-dm-migration` 已登记;overlap status=none。
|
||||
- 注:`member-permissions-doc-2026-09-24` 因持有 `.doc` 整目录硬冲突已 close=done(其文档已提交于 feature 分支,待另轨合入)。
|
||||
|
||||
## 步骤与验收
|
||||
|
||||
1. [x] P0 任务登记 / CURRENT 认领 / 本文件落盘
|
||||
2. [x] P1–P5 DM 建仓、代码/文档迁移、projects 登记、自举
|
||||
3. [x] P6 验证 + 测试报告
|
||||
4. [x] P7 push 远端 + AS CURRENT 收口
|
||||
|
||||
## 验证与证据
|
||||
|
||||
| 范围 | 命令与环境 | 预期 | 实际 | 证据 |
|
||||
|---|---|---|---|---|
|
||||
| DM 治理 unittest | `python3 -B -m unittest discover -s scripts/tests` @ DM | 全绿 | 待跑 | 测试报告 |
|
||||
| 双 daemon | 两侧 `daemon status` | 均 ok | 待跑 | 测试报告 |
|
||||
|
||||
## 相关链接
|
||||
|
||||
- 计划:`~/.cursor/plans/development-manager_治理系统迁移方案_ea32becd.plan.md`
|
||||
- 远端:https://git-home.u1680832.nyat.app:30319/weichen/Development-Manager.git
|
||||
- 主产物路径:`/home/weichen/projects/Development-Manager`
|
||||
|
||||
|
||||
## 交付摘要
|
||||
|
||||
- DM 路径:`/home/weichen/projects/Development-Manager`
|
||||
- 远端:https://git-home.u1680832.nyat.app:30319/weichen/Development-Manager.git (`dev`/`main` @ `0a58b909`)
|
||||
- 双 daemon:`dm-coordinator` + AS `agentctl-coordinator` 并存 ok
|
||||
- 核心测试:221 OK(见 DM `.doc/test-reports/2026-09-24-dm-migration-test-report.md`)
|
||||
- 过渡约束:AS 内嵌治理暂不移除;新治理开发进 DM
|
||||
@@ -0,0 +1,22 @@
|
||||
# 自由协作 + 认领提醒 — 任务记录
|
||||
|
||||
- **task_id**: free-collab-claim-notify-2026-09-24
|
||||
- **status**: in_progress
|
||||
- **owner**: Cursor
|
||||
- **mutex**: notification+supplementimpact+events+docs
|
||||
- **companion_task**: non-author-member-access-2026-09-24 (server+docgov+web)
|
||||
- **base_dev_sha**: ebb36fb85c80b83e895b29df5d9056c68f5efe31
|
||||
- **design**: [../system-design/2026-09-24-free-collab-claim-notify-design.md](../system-design/2026-09-24-free-collab-claim-notify-design.md)
|
||||
- **write_scope**: internal/{notification,events,app,bizdev,coordinator,traceimpact,supplementimpact}, deploy/postgres, .doc
|
||||
- **review_state**: pending
|
||||
- **integration_state**: pending
|
||||
- **deployment**: not_started
|
||||
- **cleanup**: pending
|
||||
- **remote_sync**: not_requested
|
||||
|
||||
## 批次
|
||||
|
||||
- A 自由协作通道(companion worktree)
|
||||
- B 认领补齐 + 互斥加固(companion)
|
||||
- C 提醒机制 + 收件箱
|
||||
- D 补充影响批次 + 确认卡 + 分流执行
|
||||
@@ -0,0 +1,70 @@
|
||||
---
|
||||
title: 治理目录库与跨对话需求重叠检测
|
||||
task_id: governance-catalog-2026-09-24
|
||||
status: done
|
||||
created: 2026-09-24
|
||||
updated: 2026-09-24
|
||||
head_sha: e1796cc858228a13cbc1fa3c8648adafa4e9f194
|
||||
owner: Cursor
|
||||
task_type: implementation
|
||||
task_tier: multi_stage
|
||||
policy_revision: agent-governance-2026-09-21-r1 @ cfc80b34a40e8de78e77a44839571bb684d405d5
|
||||
branch: feature/governance-catalog-2026-09-24
|
||||
worktree: .worktrees/governance-catalog-2026-09-24
|
||||
base_dev_sha: cfc80b34a40e8de78e77a44839571bb684d405d5
|
||||
write_scope:
|
||||
- scripts
|
||||
- configs
|
||||
- .doc
|
||||
- .cursor
|
||||
allowed_environments: []
|
||||
mutex: agent-workflow-governance+catalog
|
||||
review_state: approved
|
||||
integration_state: merged
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
cleanup_owner: Cursor
|
||||
cleanup_trigger: validate pass + queue enqueue + closeout
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# 治理目录库与跨对话需求重叠检测
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- **用户目标**:跨对话需求/功能重叠与冲突可机器检测;认领、缺陷、测试、发布版本进入与业务库隔离的治理目录。
|
||||
- **授权来源**:用户确认计划「治理目录库与需求重叠检测」并要求按 to-do 全量实施。
|
||||
- **交付终点**:Catalog schema + FTS5 中文召回 + 两级门禁 + 回填 + 可降级向量层 + MCP/技能 + 工程回归报告;受控合入 local `dev`。
|
||||
- **禁止**:不连业务 PostgreSQL;不新建第二库文件/容器;不自动升 MATRIX;不 push;不强制产品 PI 全链路(工程工具变更,NOT REQUIRED)。
|
||||
|
||||
## 范围与非目标
|
||||
|
||||
- **允许写入**:`scripts/agentctl*.py`、`scripts/catalog_backfill.py`、`scripts/mcp/agentctl-mcp.mjs`、`scripts/tests/`、`configs/agent-governance.json`、`.doc/`(方案/任务/报告/模板漂移修复)、`.cursor/skills` 与 mandatory 规则补充。
|
||||
- **非目标**:跨机权威认领、产品业务功能、自动删除 worktree。
|
||||
|
||||
## 相关问题与经验
|
||||
|
||||
- 检索词:`overlap` / `requirement` / `catalog` / `docs drift` / `FTS5`
|
||||
- 命中:路径级 `overlaps()` 已 enforced;需求语义重叠无机制;embedding 401 运维债 → 向量层 fail-open。
|
||||
- 采纳:可选策略键扩展;CJK 逐字切分禁用 trigram;测试夹具同步复制新模块。
|
||||
|
||||
## 步骤与验收
|
||||
|
||||
- [ ] W0 方案主文档 + policy-registry proposed
|
||||
- [ ] W1–W4 catalog 模块 + task register 联动
|
||||
- [ ] W5 回填 + drift
|
||||
- [ ] W6 向量降级三态
|
||||
- [ ] W7 MCP + 技能
|
||||
- [ ] W8 unittest 全绿 + 报告
|
||||
- [ ] W9 validate → queue → closeout
|
||||
|
||||
## 验证与证据
|
||||
|
||||
| 范围 / 被测 SHA | 命令与环境 | 预期 | 实际 / 判定 | 证据 |
|
||||
|---|---|---|---|---|
|
||||
| 工程工具 | `python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v` | 全绿 | (待填) | test-report |
|
||||
|
||||
## 收口与交接
|
||||
|
||||
- 五态见 frontmatter;合入后更新。
|
||||
- 相关:[方案](../2026-09-24-governance-catalog-plan.md)
|
||||
@@ -0,0 +1,66 @@
|
||||
---
|
||||
title: "治理控制台 P1 设计定稿"
|
||||
task_id: "governance-console-p1-design-2026-09-24"
|
||||
status: done
|
||||
created: 2026-09-24
|
||||
updated: 2026-09-24
|
||||
owner: Cursor
|
||||
task_type: research
|
||||
task_tier: small
|
||||
policy_revision: "agent-governance-2026-09-21-r1 + cursor-governance-2026-09-24-r1 @ 4844041b"
|
||||
branch: feature/governance-console-p1-design-2026-09-24
|
||||
worktree: .worktrees/governance-console-p1-design-2026-09-24
|
||||
base_dev_sha: "4844041b1b417b5ac415fe779a3784959c0afbbe"
|
||||
write_scope: [".doc"]
|
||||
allowed_environments: []
|
||||
head_sha: "ae7fcc15572ca7278297f51747d8db5510f5521d"
|
||||
mutex: "agentctl-console-design"
|
||||
review_state: accepted
|
||||
integration_state: merged_local_dev
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
cleanup_owner: "独立维护者"
|
||||
cleanup_trigger: "合入 local_dev 且文档验收通过后"
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# 治理控制台 P1 设计定稿
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 用户目标:把 P1 骨架扩成可实施规格(12 节),不写实现代码。
|
||||
- 交付终点:`.doc/ops/short-term/2026-09-24-governance-console-plan.md` 定稿合入 local `dev`。
|
||||
- 禁止:scripts 编码、产品 web/cmd/internal、push、晋升、跨机协调实施。
|
||||
|
||||
## 范围与非目标
|
||||
|
||||
- 允许:设计文档原地扩充、任务主记录、CURRENT 认领。
|
||||
- 非目标:P1-a…e 任何代码实施。
|
||||
|
||||
## 相关问题与经验
|
||||
|
||||
- catalog:`R-governance-console-p1`;overlap 探测无 hard/soft(与 R-governance-visibility-p0 语义相关但未命中门禁)。
|
||||
- 前序:P0 合入 `dev@4844041b`;证据见 [测试报告](../../test-reports/2026-09-24-governance-visibility-p0-test-report.md)。
|
||||
|
||||
## 步骤与验收
|
||||
|
||||
1. [x] 建场 / register / CURRENT 认领
|
||||
2. [x] 设计文档 12 节扩充
|
||||
3. [x] 链接/锚点/mermaid 检查(12 节 / 0 断链 / 4 mermaid / 594 行)
|
||||
4. [x] 合入收口
|
||||
|
||||
## 验证与证据
|
||||
|
||||
| 范围 | 命令与环境 | 预期 | 实际 / 判定 | 证据 |
|
||||
|---|---|---|---|---|
|
||||
| 纯文档 | 链接/锚点/mermaid + 符号对照 | 无断链、可渲染 | PASS:links_ok=16 broken=0 mermaid=4 符号均存在 | 本任务验证节 |
|
||||
| 产品 PI / go test | — | NOT REQUIRED | — | 验证契约「工程规范/文档」层 |
|
||||
|
||||
## 收口与交接
|
||||
|
||||
待定稿后填写五态。
|
||||
|
||||
## 相关链接
|
||||
|
||||
- 设计主体:[2026-09-24-governance-console-plan.md](./2026-09-24-governance-console-plan.md)
|
||||
- P0 任务:[2026-09-24-governance-visibility-p0.md](./2026-09-24-governance-visibility-p0.md)
|
||||
@@ -0,0 +1,41 @@
|
||||
# governance-console P1 实施
|
||||
|
||||
- task_id: `governance-console-p1-impl-2026-09-24`
|
||||
- status: `in_progress`
|
||||
- mutex: `agentctl-console`
|
||||
- requirement: `R-governance-console-p1-impl`
|
||||
- design: `.doc/ops/short-term/2026-09-24-governance-console-plan.md` (`governance-console-p1-r1`)
|
||||
- authorization: 用户 `/goal 按照方案进行实现`
|
||||
- write_scope: `scripts/` `.cursor/skills/` `.doc/`
|
||||
- base_dev_sha: `6eb2d11eeb1840286b189c07e0da524541dcbbc8`
|
||||
- review_state: accepted
|
||||
- integration_state: merged_local_dev
|
||||
- deployment: not_required
|
||||
- cleanup: pending
|
||||
- remote_sync: not_requested
|
||||
|
||||
## 交付
|
||||
|
||||
| 阶段 | 产物 |
|
||||
|---|---|
|
||||
| P1-a | `agentctl serve` + `scripts/governance-console/index.html`;GET 八端点 |
|
||||
| P1-b | `agentctl claim new` + `POST /api/claim/new` |
|
||||
| P1-c | `agentctl integrate prepare` + `POST /api/integrate/prepare` |
|
||||
| P1-d | `agentctl pi packet` + `POST /api/pi/packet`;skill 引用 packet |
|
||||
| P1-e | SPA 四区+认领/Prepare;MCP `brief`/`claim_archive` |
|
||||
|
||||
核心模块:`scripts/agentctl_console.py`(CLI/HTTP 同构)。
|
||||
|
||||
## 验证
|
||||
|
||||
见 [.doc/test-reports/2026-09-24-governance-console-p1-test-report.md](../../test-reports/2026-09-24-governance-console-p1-test-report.md)。
|
||||
|
||||
## 禁止
|
||||
|
||||
不 push;不碰产品 `web/`;不自动 `queue enqueue` 以外的 ff;不实现 `/api/shell`。
|
||||
|
||||
## 合入
|
||||
|
||||
- local_dev tip:
|
||||
- queue item:
|
||||
- validate run:
|
||||
@@ -0,0 +1,594 @@
|
||||
---
|
||||
title: "治理控制台全景设计(P1 定稿)"
|
||||
task_id: "governance-console-p1-design-2026-09-24"
|
||||
status: planned
|
||||
created: 2026-09-24
|
||||
updated: 2026-09-24
|
||||
owner: Cursor
|
||||
task_type: research
|
||||
related_p0: governance-visibility-p0-2026-09-24
|
||||
design_revision: "governance-console-p1-r1"
|
||||
base_dev_sha: "4844041b1b417b5ac415fe779a3784959c0afbbe"
|
||||
---
|
||||
|
||||
# 治理控制台全景设计(P1 定稿)
|
||||
|
||||
覆盖方向:**A 状态可视化**、**B 流程自动化**、**C MCP 只读巡览**、**D PI 派发包生成**。
|
||||
本文件是**可实施规格**;实施须另开 task + `catalog overlap`。本轮不写代码。
|
||||
|
||||
前置:P0 已合入 `dev@4844041b`(`--format table`、`brief`、MCP +4、`claim archive`)。证据:[测试报告](../../test-reports/2026-09-24-governance-visibility-p0-test-report.md)。
|
||||
|
||||
---
|
||||
|
||||
## 1. 现状与缺口
|
||||
|
||||
### 1.1 P0 已交付(机器权威层可读)
|
||||
|
||||
| 能力 | 入口 | 核心实现 |
|
||||
|---|---|---|
|
||||
| 人类可读表 | `agentctl status\|queue list\|claim list\|cleanup report --format table` | [`emit_payload`](../../../scripts/agentctl.py) + [`agentctl_visibility`](../../../scripts/agentctl_visibility.py) |
|
||||
| 一页简报 | `agentctl brief` | `collect_*` + `cmd_brief` |
|
||||
| done 行归档 | `agentctl claim archive [--apply]` | `claim_archive` → `@document` docs apply CAS |
|
||||
| MCP 只读 | `queue_list` / `claim_status` / `cleanup_report` / `catalog_drift` | [`agentctl-mcp.mjs`](../../../scripts/mcp/agentctl-mcp.mjs) |
|
||||
|
||||
### 1.2 仍存缺口(本设计覆盖)
|
||||
|
||||
| ID | 缺口 | 用户摩擦 |
|
||||
|---|---|---|
|
||||
| A2 | 无 dashboard / HTTP 面 | 终端 JSON/table 仍需手敲;多源聚合靠 `brief` 文本 |
|
||||
| B1 | 认领仍三步 | skill 要求 snapshot → 手写 JSON → apply |
|
||||
| B2 | 每任务双 worktree | 手工建 `integrate-*` + `--no-ff` |
|
||||
| D1 | PI packet 手工组装 | task_id/request_id/source_sha/approved_commands 易漏 |
|
||||
| C2 | MCP 未暴露 brief/archive | 会话内仍偶发 shell 拼装 |
|
||||
|
||||
跨机 claim 权威不在本方案:见 [coordination-db-daemon phased plan](../../remediation/2026-09-23-coordination-db-daemon-phased-plan.md)。
|
||||
|
||||
---
|
||||
|
||||
## 2. 目标与非目标
|
||||
|
||||
### 2.1 目标
|
||||
|
||||
1. 本机治理面:一眼看 tasks / runs / claims / queue / drift / cleanup。
|
||||
2. 高频动作白名单:`claim new`、`claim archive`、`integrate prepare`、`pi packet`——**全部复用既有租约与 `docs apply`,不新增旁路写入口**。
|
||||
3. CLI 与 HTTP 同构:同一 Python 函数;MCP 可薄封装。
|
||||
4. 可测:工程工具单测覆盖路由、错误码、幂等、loopback。
|
||||
|
||||
### 2.2 非目标
|
||||
|
||||
- 远程多用户 Web 登录 / 鉴权体系。
|
||||
- 产品 [`web/`](../../../web/) AdminConsole 内嵌治理页。
|
||||
- 绕过 `agentctl with` / `docs apply` 的文件写。
|
||||
- 自动 `--force` 清理 worktree、push、晋升 test/main。
|
||||
- 替代 Herdr / 产品 PI Agent Runner。
|
||||
- 把 `serve` 装进 systemd/launchd(保持手工前台进程)。
|
||||
|
||||
---
|
||||
|
||||
## 3. 总体架构
|
||||
|
||||
```mermaid
|
||||
flowchart TB
|
||||
subgraph clients [Clients]
|
||||
Cursor[Cursor_MCP_CLI]
|
||||
Term[Terminal]
|
||||
Browser[Browser_localhost]
|
||||
end
|
||||
subgraph console [Governance_Console_P1]
|
||||
Spa[static_SPA]
|
||||
Serve[agentctl_serve]
|
||||
CliExt[claim_new_integrate_prepare_pi_packet]
|
||||
end
|
||||
subgraph core [Existing_agentctl_core]
|
||||
Collect[collect_star_pure_fns]
|
||||
Docs[docs_apply_CAS]
|
||||
Lease[Lease_with]
|
||||
Queue[queue_daemon_ff]
|
||||
Db[(governance_SQLite)]
|
||||
end
|
||||
Cursor --> Serve
|
||||
Cursor --> CliExt
|
||||
Term --> CliExt
|
||||
Browser --> Spa --> Serve
|
||||
Serve --> Collect
|
||||
Serve --> CliExt
|
||||
CliExt --> Docs
|
||||
CliExt --> Lease
|
||||
CliExt --> Queue
|
||||
Collect --> Db
|
||||
Docs --> Db
|
||||
Lease --> Db
|
||||
Queue --> Db
|
||||
```
|
||||
|
||||
### 3.1 进程拓扑
|
||||
|
||||
| 进程 | 生命周期 | 说明 |
|
||||
|---|---|---|
|
||||
| `agentctl daemon` | 已装载 systemd/launchd | 仅队列 ff-only;**不**承载 HTTP |
|
||||
| `agentctl serve` | 人工前台 / 可选 tmux | 绑 `127.0.0.1:7432`;退出即停 |
|
||||
| SPA | 由 serve 静态托管 | 零构建单页;无独立 Node 服务 |
|
||||
|
||||
### 3.2 组件职责
|
||||
|
||||
| 组件 | 路径(建议) | 职责 |
|
||||
|---|---|---|
|
||||
| `agentctl serve` | [`scripts/agentctl.py`](../../../scripts/agentctl.py) 子命令 | HTTP JSON + 静态文件 |
|
||||
| 动作实现 | `scripts/agentctl_console.py`(新建)或内嵌 | `claim_new` / `integrate_prepare` / `pi_packet` 纯逻辑 |
|
||||
| SPA | `scripts/governance-console/index.html` | 四区仪表盘 |
|
||||
| MCP 增补 | [`scripts/mcp/agentctl-mcp.mjs`](../../../scripts/mcp/agentctl-mcp.mjs) | 可选:`brief`、`claim_archive`、动作薄封装 |
|
||||
|
||||
---
|
||||
|
||||
## 4. 数据模型与 API 资源映射
|
||||
|
||||
### 4.1 治理 SQLite(只读投影,不改 schema)
|
||||
|
||||
| 表 | 关键字段 | 消费端点 |
|
||||
|---|---|---|
|
||||
| `tasks` | id, owner, worktree, branch, state, scopes, capabilities | `GET /api/status` |
|
||||
| `runs` | id, task, state, pid, start, boot, resources | `GET /api/status` |
|
||||
| `queue_items` | id, task, head_sha, expected_dev, priority, state | `GET /api/queue` |
|
||||
| `claims` | id, task, resource, state, updated | `GET /api/claims` |
|
||||
| `documents` / `receipts` | run, task, file, hash | 动作审计;不直接暴露 |
|
||||
| `catalog_*` | requirements, features, overlaps | `GET /api/catalog/drift` |
|
||||
| `matrix_state_snapshot` | record_id, status | `GET /api/docs/drift` |
|
||||
|
||||
CURRENT.md / FEATURE-MATRIX.md 仍是人类投影;机器权威在 SQLite + docs apply 收据。
|
||||
|
||||
### 4.2 只读 payload 契约(与 P0 `collect_*` 同源)
|
||||
|
||||
```text
|
||||
GET /api/status → collect_status_payload(repo)
|
||||
{status, lock_root, main, version, epoch, tasks[], runs[], queue[], policy}
|
||||
GET /api/brief → cmd_brief 逻辑;?format=markdown|json
|
||||
GET /api/queue → queue_list 同构 {status, items[]}
|
||||
GET /api/claims → claim_list 同构 {status, claims[]}
|
||||
GET /api/cleanup → collect_cleanup_payload {worktrees[]}
|
||||
GET /api/docs/drift → collect_docs_drift_payload {regressions[], open_capabilities[]}
|
||||
GET /api/catalog/drift → collect_catalog_drift_payload
|
||||
GET /api/daemon → collect_daemon_payload {manager_lock, heartbeat, queue}
|
||||
```
|
||||
|
||||
查询参数:
|
||||
|
||||
- `?format=json|table`(status/queue/claims/cleanup):table 时 `Content-Type: text/plain`,body 为 `render_*_table` 文本。
|
||||
- `?all=1`(queue/claims):含终态行。
|
||||
|
||||
### 4.3 动作请求/响应信封
|
||||
|
||||
```json
|
||||
{
|
||||
"request_id": "uuid-or-client-supplied",
|
||||
"task": "governance-…",
|
||||
"authorization_ref": "optional-user-chat-ref",
|
||||
"...action_fields": {}
|
||||
}
|
||||
```
|
||||
|
||||
成功:
|
||||
|
||||
```json
|
||||
{"status": "ok|archived|prepared|created", "run_id": "…", "request_id": "…", "...": {}}
|
||||
```
|
||||
|
||||
失败(HTTP 状态见 §5.3):
|
||||
|
||||
```json
|
||||
{"status": "denied", "code": "BASE_CHANGED", "message": "…", "...details": {}}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. 后端 `agentctl serve` 详细设计
|
||||
|
||||
### 5.1 启动
|
||||
|
||||
```bash
|
||||
agentctl serve [--host 127.0.0.1] [--port 7432] [--static scripts/governance-console]
|
||||
```
|
||||
|
||||
约束:
|
||||
|
||||
- 默认 host **仅** `127.0.0.1`;传入 `0.0.0.0` → 启动前拒绝 `INVALID_REQUEST`。
|
||||
- 单线程或 `ThreadingHTTPServer`;写动作串行化靠既有 Lease/SQLite,不另造全局锁。
|
||||
- 不注册为 daemon;SIGINT 干净退出。
|
||||
|
||||
### 5.2 路由表
|
||||
|
||||
#### 只读(8)
|
||||
|
||||
| Method | Path | 处理 |
|
||||
|---|---|---|
|
||||
| GET | `/api/status` | `collect_status_payload` |
|
||||
| GET | `/api/brief` | brief 聚合 |
|
||||
| GET | `/api/queue` | `queue_list` |
|
||||
| GET | `/api/claims` | `claim_list` |
|
||||
| GET | `/api/cleanup` | `collect_cleanup_payload` |
|
||||
| GET | `/api/docs/drift` | `collect_docs_drift_payload` |
|
||||
| GET | `/api/catalog/drift` | `collect_catalog_drift_payload` |
|
||||
| GET | `/api/daemon` | `collect_daemon_payload` |
|
||||
| GET | `/` 与 `/static/*` | SPA |
|
||||
|
||||
#### 动作白名单(4)——同进程函数调用,禁止 `subprocess` 再调 CLI
|
||||
|
||||
| Method | Path | 函数 |
|
||||
|---|---|---|
|
||||
| POST | `/api/claim/new` | `claim_new(repo, args)` |
|
||||
| POST | `/api/claim/archive` | 既有 `claim_archive`(`apply=True`) |
|
||||
| POST | `/api/integrate/prepare` | `integrate_prepare(repo, args)` |
|
||||
| POST | `/api/pi/packet` | `pi_packet(repo, args)` |
|
||||
|
||||
未列出的 `/api/*` → 404。任意 shell / env-service / push / 删 worktree → **永不实现**。
|
||||
|
||||
### 5.3 错误码 → HTTP
|
||||
|
||||
| agentctl `Denied.code` | HTTP | 客户端建议 |
|
||||
|---|---|---|
|
||||
| `INVALID_REQUEST` | 400 | 修请求体 |
|
||||
| `CAPABILITY_REQUIRED` / `PATH_OUT_OF_SCOPE` | 403 | 补 capability 或换 task |
|
||||
| `BASE_CHANGED` / `WORKTREE_MISMATCH` / `LOCK_BUSY` / `UNMANAGED_DOCUMENT_CHANGE` | 409 | 重新 snapshot / prepare;不自动重试 |
|
||||
| `EVIDENCE_REQUIRED` | 422 | 补证据后重试 |
|
||||
| `UNKNOWN_*` | 404 | 检查 id |
|
||||
| 未捕获异常 | 500 | 查 run 审计;`RECOVERY_REQUIRED` |
|
||||
|
||||
### 5.4 幂等
|
||||
|
||||
- 客户端可传 `request_id`;缺省服务端生成 uuid。
|
||||
- 写路径进入 `Lease(..., request_id, digest)`:与现有 `docs_apply` replay 一致——相同 request_id 返回 `replayed`,不二次写。
|
||||
- `integrate prepare`:若 integrate worktree 已存在且 tip 已含任务分支 merge → 返回既有 `{head, integrate_task}`(幂等成功),不强制重建。
|
||||
|
||||
### 5.5 并发与 expected-dev 竞态
|
||||
|
||||
```text
|
||||
prepare 冻结 expected_dev = tip(dev)
|
||||
→ validate
|
||||
→ enqueue(expected_dev, head)
|
||||
daemon:若 tip(dev) != expected_dev → 该项失败/取消(既有行为)
|
||||
客户端:收到失败或 BASE_CHANGED → 重新 prepare,禁止盲重试同 head
|
||||
```
|
||||
|
||||
HTTP 层不自动重试;SPA 按钮在 409 时提示「dev 已前进,请重新 prepare」。
|
||||
|
||||
### 5.6 安全
|
||||
|
||||
1. Loopback only。
|
||||
2. 无 Cookie / Bearer;本机信任模型(与 CLI 相同)。
|
||||
3. 动作白名单硬编码;请求体禁止 `command` / `shell` / `argv` 字段。
|
||||
4. 所有写动作写 `runs`/`documents` 审计(既有 Lease)。
|
||||
5. CORS:仅同 origin(静态同 host);或不设 CORS(同源足够)。
|
||||
|
||||
### 5.7 实现落点(实施时)
|
||||
|
||||
- argparse:`serve` 子命令。
|
||||
- 标准库 `http.server` 或轻量 handler;**零新 pip 依赖**。
|
||||
- 静态根默认 `scripts/governance-console/`(gitignore 可选缓存,源码入库)。
|
||||
|
||||
---
|
||||
|
||||
## 6. CLI 动作详细设计
|
||||
|
||||
HTTP 与 CLI **共用**下列函数;CLI 为 argparse 薄包装。
|
||||
|
||||
### 6.1 `agentctl claim new`(B1)
|
||||
|
||||
```bash
|
||||
agentctl claim new --task "$ID" --owner Cursor --mutex <key> \
|
||||
[--branch feature/$ID] [--worktree .worktrees/$ID] \
|
||||
[--status in_progress] [--replace] [--request-id RID]
|
||||
```
|
||||
|
||||
**内部步骤**
|
||||
|
||||
1. `task_row` 校验:cwd == 注册 worktree;需 `docs:publish`(单行写 CURRENT,无需 admin)。
|
||||
2. `docs_snapshot(CURRENT, record=task)`。
|
||||
3. 若 `sha256` 非空且未 `--replace` → `deny('INVALID_REQUEST', 'row exists; pass --replace')`。
|
||||
4. 构造一行:`| {owner} | {task} | {branch} | {worktree} | {mutex} | {status} |`(worktree 用相对 `.worktrees/…`)。
|
||||
5. `docs_apply` 单行 CAS(`expected_sha256` 来自 snapshot;新建为 null)。
|
||||
6. emit `{status:'created'|'replaced', record_id, run_id}`。
|
||||
|
||||
**拒绝码**:`WORKTREE_MISMATCH`、`CAPABILITY_REQUIRED`、`BASE_CHANGED`、`AMBIGUOUS_RECORD`。
|
||||
|
||||
**替代关系**:取代 skill [`agentctl-worktree-setup`](../../../.cursor/skills/agentctl-worktree-setup/SKILL.md) 中「CURRENT 认领」三段手工;建 worktree / `task register` 仍由 skill 前半段负责(本命令不创建 git worktree)。
|
||||
|
||||
**幂等**:同 request_id replay;`--replace` 在 BASE_CHANGED 后需新 snapshot。
|
||||
|
||||
### 6.2 `agentctl integrate prepare`(B2)
|
||||
|
||||
```bash
|
||||
agentctl integrate prepare --task "$ID" --expected-dev <full_sha> \
|
||||
[--integrate-id integrate-$ID] [--request-id RID]
|
||||
```
|
||||
|
||||
**前置**:调用方 cwd 可为任务 worktree 或 main;函数内切换到新建 integrate worktree 执行 merge。
|
||||
|
||||
**内部步骤**
|
||||
|
||||
1. 校验 `expected-dev == rev-parse(refs/heads/dev)`,否则 `BASE_CHANGED`。
|
||||
2. `integrate_id = integrate-id or f"integrate-{task}"`;branch `feature/{integrate_id}`。
|
||||
3. 若 worktree 不存在:调用与 `agent-worktree.sh create` 等价逻辑(`git worktree add -b … expected-dev`)。
|
||||
4. 在 integrate worktree:`task register --capability git:dev`(若已注册且匹配则跳过)。
|
||||
5. Lease(`path:.`,`git:index`,`git:dev`) 内:`git merge --no-ff -m "merge: candidate {task} into dev" feature/{task-branch}`。
|
||||
6. 校验 `HEAD^1 == expected-dev`。
|
||||
7. emit `{status:'prepared', integrate_task, worktree, head, expected_dev, first_parent}`。
|
||||
|
||||
**不做**:validate、enqueue(留给既有命令 / SPA 分步按钮,避免隐式合入)。
|
||||
|
||||
**拒绝码**:`BASE_CHANGED`、`LOCK_BUSY`、`CAPABILITY_REQUIRED`、`GIT_ERROR`、worktree 脏 → `INVALID_REQUEST`。
|
||||
|
||||
**替代关系**:压缩 skill [`agentctl-integrate-closeout`](../../../.cursor/skills/agentctl-integrate-closeout/SKILL.md) 的「候选」段;后续仍 `validate` → `queue enqueue`。
|
||||
|
||||
### 6.3 `agentctl pi packet`(D1)
|
||||
|
||||
```bash
|
||||
agentctl pi packet --task "$ID" --role research|planning|reviews|diagnosis|test_run|acceptance_check|report \
|
||||
--goal '…' --authorization-ref '…' \
|
||||
[--source-sha FULL] [--timeout-seconds 600] \
|
||||
[--input-file PATH]… [--approved-command 'argv…']… \
|
||||
[--request-id RID] [--write]
|
||||
```
|
||||
|
||||
**内部步骤**
|
||||
|
||||
1. 读 task 行 → worktree;`source_sha = freeze_source_sha(worktree, arg or HEAD)`(复用 [`pi_subagents.freeze_source_sha`](../../../scripts/pi_subagents.py) 规则:必须满 40/64 hex)。
|
||||
2. `request_id = arg or uuid`;校验 `REQUEST_ID_RE`。
|
||||
3. 组装 packet:
|
||||
|
||||
```json
|
||||
{
|
||||
"task_id": "…",
|
||||
"request_id": "…",
|
||||
"role_id": "research",
|
||||
"goal": "…",
|
||||
"authorization_ref": "…",
|
||||
"source_sha": "<40hex>",
|
||||
"input_files": ["…"],
|
||||
"timeout_seconds": 600,
|
||||
"approved_commands": [["python3","-B","-m","unittest", "…"]]
|
||||
}
|
||||
```
|
||||
|
||||
4. 默认 stdout JSON;`--write` 时原子写入
|
||||
`.doc/test-reports/assets/pi-subagents/<task>/<request>/packet.json`
|
||||
(目录与 [`REPORT_ROOT_REL`](../../../scripts/pi_subagents.py) 一致),并要求 Lease `path:.doc/test-reports/…`。
|
||||
5. **不**调用 `pi_subagent_run`——生成与派发分离。
|
||||
|
||||
**拒绝码**:`UNKNOWN_TASK`、`INVALID_SOURCE_SHA`、`UNKNOWN_ROLE`(对照模型配置角色表)、`PATH_OUT_OF_SCOPE`。
|
||||
|
||||
**替代关系**:减少 [`pi-subagent-dispatch`](../../../.cursor/skills/pi-subagent-dispatch/SKILL.md) 手工拼包;skill 改为「packet 路径 → run」。
|
||||
|
||||
### 6.4 `claim archive`(已有,HTTP 暴露)
|
||||
|
||||
行为维持 P0:默认 dry-run;POST 等同 `--apply`。需 `docs:admin` + 任务 worktree。
|
||||
|
||||
---
|
||||
|
||||
## 7. 前端 SPA 设计
|
||||
|
||||
### 7.1 技术选型
|
||||
|
||||
- **零构建**:单 `index.html` + 内联 CSS/JS(或同目录 `app.js`)。
|
||||
- 原生 `fetch`;轮询间隔默认 **10s**(可配置);可选后续 SSE(P1-e)。
|
||||
- 不引入 React/Vite;不依赖产品 `web/node_modules`。
|
||||
|
||||
### 7.2 线框(四区)
|
||||
|
||||
```text
|
||||
+------------------------------------------------------------------+
|
||||
| agentctl console daemon: ok queue: 0 [刷新] [10s] |
|
||||
+-------------------------------+----------------------------------+
|
||||
| 1. 任务 / 租约 | 2. 队列与集成 |
|
||||
| active tasks table | pending/claimed table |
|
||||
| live runs | [Prepare…] 需选 task+确认 |
|
||||
| held claims | [Enqueue…] 仅展示指引/复制命令 |
|
||||
+-------------------------------+----------------------------------+
|
||||
| 3. 文档漂移 | 4. 清理积压 |
|
||||
| MATRIX hard regressions | cleanup report table |
|
||||
| catalog drift | 无删除按钮(只读) |
|
||||
+-------------------------------+----------------------------------+
|
||||
| brief 预览(折叠) |
|
||||
+------------------------------------------------------------------+
|
||||
```
|
||||
|
||||
### 7.3 区 ↔ 端点
|
||||
|
||||
| 区 | 数据 | 动作按钮 |
|
||||
|---|---|---|
|
||||
| 1 | `/api/status` + `/api/claims` | 「认领」→ modal → `POST /api/claim/new`(二次确认) |
|
||||
| 2 | `/api/queue` + status.queue | 「Prepare」→ `POST /api/integrate/prepare`;Enqueue 默认复制 CLI(避免 SPA 误合入) |
|
||||
| 3 | `/api/docs/drift` + `/api/catalog/drift` | 无写 |
|
||||
| 4 | `/api/cleanup` | 无写 |
|
||||
| 顶栏 | `/api/daemon` + `/api/brief` | 刷新 |
|
||||
|
||||
### 7.4 UX 规则
|
||||
|
||||
- 所有 POST 前 modal:展示将发送的 JSON;确认后才发。
|
||||
- 409/403 用红色 toast + 原始 `code`。
|
||||
- 路径只显示文本,不 `file://` 链出(避免浏览器限制)。
|
||||
|
||||
---
|
||||
|
||||
## 8. 关键时序图
|
||||
|
||||
### 8.1 claim new
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant U as User_or_SPA
|
||||
participant S as agentctl_serve_or_CLI
|
||||
participant D as docs_apply
|
||||
participant DB as SQLite
|
||||
U->>S: claim_new task owner mutex
|
||||
S->>S: snapshot CURRENT row
|
||||
alt row_exists_without_replace
|
||||
S-->>U: 400 INVALID_REQUEST
|
||||
else
|
||||
S->>D: apply single_row CAS
|
||||
D->>DB: lease documents receipts
|
||||
D-->>S: applied run_id
|
||||
S-->>U: 200 created
|
||||
end
|
||||
```
|
||||
|
||||
### 8.2 integrate prepare → enqueue → daemon ff
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant U as User
|
||||
participant P as integrate_prepare
|
||||
participant V as validate
|
||||
participant Q as queue_enqueue
|
||||
participant Daemon as agentctl_daemon
|
||||
participant Dev as refs_heads_dev
|
||||
U->>P: expected_dev tip
|
||||
P->>Dev: rev_parse
|
||||
alt tip_mismatch
|
||||
P-->>U: 409 BASE_CHANGED
|
||||
else
|
||||
P->>P: worktree_add_merge_no_ff
|
||||
P-->>U: head first_parent
|
||||
U->>V: unittest_or_scope_checks
|
||||
V-->>U: validated
|
||||
U->>Q: expected_dev head
|
||||
Q->>Daemon: pending_item
|
||||
Daemon->>Dev: ff_only_if_tip_matches
|
||||
Daemon-->>U: merged_or_failed
|
||||
end
|
||||
```
|
||||
|
||||
### 8.3 pi packet(生成与派发分离)
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant U as User
|
||||
participant Gen as pi_packet
|
||||
participant Disk as report_assets
|
||||
participant Run as pi_subagent_run
|
||||
U->>Gen: role goal auth_ref
|
||||
Gen->>Gen: freeze_source_sha
|
||||
Gen->>Disk: optional_write_packet_json
|
||||
Gen-->>U: packet
|
||||
Note over U,Run: 另一步:用户或 skill 显式 run
|
||||
U->>Run: packet_fields_plus_lease
|
||||
Run-->>U: receipt_pending_verdict
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 9. 测试矩阵
|
||||
|
||||
验证层级:验证契约「工程工具验收」(非产品 PI)。
|
||||
|
||||
### 9.1 `scripts/tests/test_agentctl_serve.py`(实施时新增)
|
||||
|
||||
| 用例 | 预期 |
|
||||
|---|---|
|
||||
| bind 127.0.0.1 成功;0.0.0.0 拒绝 | 启动失败码 |
|
||||
| GET 八端点 200 且字段与 CLI collect 一致 | JSON 同构 |
|
||||
| 未知 POST `/api/shell` | 404 |
|
||||
| POST claim/new 缺 task | 400 |
|
||||
| POST claim/new 无 docs:publish | 403 |
|
||||
| 幂等:同 request_id 两次 | 第二次 replayed |
|
||||
| 非 loopback 模拟(若可) | 拒绝或无法连接 |
|
||||
|
||||
### 9.2 CLI 黑盒(扩展 `test_agentctl.py` fixture)
|
||||
|
||||
| 命令 | 覆盖 |
|
||||
|---|---|
|
||||
| `claim new` | 新建行 / `--replace` / BASE_CHANGED |
|
||||
| `integrate prepare` | first_parent==expected_dev;脏树拒绝 |
|
||||
| `pi packet` | source_sha 拒绝符号名;`--write` 路径落盘 |
|
||||
|
||||
复用临时 git 仓 + 拷贝 `agentctl*.py` 模式(与 P0 visibility fixture 一致)。
|
||||
|
||||
### 9.3 SPA 手动验收清单
|
||||
|
||||
- [ ] 四区数据在 daemon ok 时非空或显式 empty
|
||||
- [ ] 轮询不导致写动作
|
||||
- [ ] Prepare 确认框取消无请求
|
||||
- [ ] 409 展示 code 文本
|
||||
|
||||
### 9.4 本设计任务验证(文档层)
|
||||
|
||||
- 链接/锚点可达;mermaid 三角可渲染;与 P0 符号名一致。
|
||||
- **不**要求独立 `*-test-report.md`(NOT REQUIRED:纯设计文档)。
|
||||
|
||||
---
|
||||
|
||||
## 10. 分阶段实施
|
||||
|
||||
| 阶段 | 范围 | 依赖 | 验收 |
|
||||
|---|---|---|---|
|
||||
| **P1-a** | `serve` 只读 8 端点 + 极简 HTML 展示 status/brief | P0 `collect_*` | test_agentctl_serve 只读用例绿;本机浏览器打开 |
|
||||
| **P1-b** | `claim new` CLI + POST + SPA 认领表单 | P1-a | 黑盒新建行;CURRENT 有收据 |
|
||||
| **P1-c** | `integrate prepare` CLI + POST + SPA Prepare | P1-b | first_parent 断言;不自动 enqueue |
|
||||
| **P1-d** | `pi packet` CLI + POST;skill 文档改为引用 packet | P1-a | packet JSON schema 单测;不触发 run |
|
||||
| **P1-e** | SPA 打磨、可选 MCP `brief`/`claim_archive`、可选 SSE | P1-a…d | 手动清单勾完 |
|
||||
|
||||
每阶段独立 task_id + catalog overlap + 工程工具单测;禁止跨阶段大揉。
|
||||
|
||||
---
|
||||
|
||||
## 11. 风险与缓解
|
||||
|
||||
| 风险 | 影响 | 缓解 |
|
||||
|---|---|---|
|
||||
| expected-dev 竞态(多会话并行合入) | enqueue 失败 | 明确 409/失败提示;prepare 可重入;不隐藏错误 |
|
||||
| serve 闲置占端口 | 本机冲突 | 默认 7432;文档说明与产品 8080/8081 隔离 |
|
||||
| `@document` 归档与并行 docs apply | BASE_CHANGED | archive 持 docs:admin;短租约;冲突则重跑 dry-run |
|
||||
| SPA 误 enqueue 推进 dev | 错误合入 | SPA 默认不提供一键 enqueue;仅 Prepare |
|
||||
| 与产品 web 目录混淆 | 发布门禁污染 | 静态资源仅 `scripts/governance-console/` |
|
||||
| packet 被当成已派发 | 假 PASS | 生成不写 verdict;skill 强制 run_status≠叙事 |
|
||||
|
||||
---
|
||||
|
||||
## 12. 衔接与授权
|
||||
|
||||
### 12.1 外部衔接
|
||||
|
||||
| 主题 | 文档 | 本方案关系 |
|
||||
|---|---|---|
|
||||
| 跨机权威 | [coordination-db-daemon phased plan](../../remediation/2026-09-23-coordination-db-daemon-phased-plan.md) | 不重复;控制台只读本机 SQLite |
|
||||
| P0 可视化 | [governance-visibility-p0](./2026-09-24-governance-visibility-p0.md) | 本设计复用 collect/archive |
|
||||
| Cursor hooks | 规则 `cursor-hooks` | serve 不经 hooks;CLI 写仍走既有钩子 |
|
||||
| PI 执行器 | [pi-subagent-executor](../2026-09-24-pi-subagent-executor.md) | packet 字段对齐;不改执行器门禁 |
|
||||
|
||||
### 12.2 实施授权门槛
|
||||
|
||||
1. 用户显式授权「实施 P1-a(或指明阶段)」。
|
||||
2. 新 task(建议 `governance-console-p1a-YYYY-MM-DD`)+ `catalog overlap`(相对本 R-ID / mutex `agentctl-console`)。
|
||||
3. 写路径限 `scripts/` + 必要 `.doc`;产品树禁止。
|
||||
4. 合入走 validate → queue enqueue;不 push。
|
||||
|
||||
### 12.3 设计修订
|
||||
|
||||
- `design_revision`: `governance-console-p1-r1`
|
||||
- 变更本规格须更新 revision 并在实施 task 记录 `policy_revision` 差分。
|
||||
|
||||
---
|
||||
|
||||
## 附录 A. 符号索引(实施对照)
|
||||
|
||||
| 符号 | 文件 | 状态 |
|
||||
|---|---|---|
|
||||
| `collect_status_payload` | `scripts/agentctl.py` | P0 已有 |
|
||||
| `collect_cleanup_payload` | 同上 | P0 已有 |
|
||||
| `collect_docs_drift_payload` | 同上 | P0 已有 |
|
||||
| `collect_daemon_payload` | 同上 | P0 已有 |
|
||||
| `collect_catalog_drift_payload` | 同上 | P0 已有 |
|
||||
| `claim_archive` | 同上 | P0 已有 |
|
||||
| `emit_payload` / `visibility.render_*` | agentctl + visibility | P0 已有 |
|
||||
| `claim_new` | 待建 | P1-b |
|
||||
| `integrate_prepare` | 待建 | P1-c |
|
||||
| `pi_packet` | 待建 | P1-d |
|
||||
| `agentctl serve` | 待建 | P1-a |
|
||||
| SPA `index.html` | `scripts/governance-console/` | P1-a/e |
|
||||
|
||||
## 附录 B. 端口与路径速查
|
||||
|
||||
| 项 | 值 |
|
||||
|---|---|
|
||||
| HTTP | `http://127.0.0.1:7432` |
|
||||
| 静态根 | `scripts/governance-console/` |
|
||||
| PI packet 根 | `.doc/test-reports/assets/pi-subagents/<task>/<request>/` |
|
||||
| CURRENT 归档追加 | `.doc/archive/ops/2026-09-21-current-history.md` |
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
title: "治理可视化 P0"
|
||||
task_id: "governance-visibility-p0-2026-09-24"
|
||||
status: done
|
||||
created: 2026-09-24
|
||||
updated: 2026-09-24
|
||||
owner: Cursor
|
||||
task_type: implementation
|
||||
task_tier: small
|
||||
policy_revision: "agent-governance-2026-09-21-r1 + cursor-governance-2026-09-24-r1 @ a2afa67d"
|
||||
branch: feature/governance-visibility-p0-2026-09-24
|
||||
worktree: .worktrees/governance-visibility-p0-2026-09-24
|
||||
base_dev_sha: "a2afa67d471c4edce9a6a31600811779549c8cce"
|
||||
write_scope: ["scripts", ".doc"]
|
||||
allowed_environments: []
|
||||
head_sha: "ab450c1181c832b7d91680bfbebba48c19ec61a1"
|
||||
mutex: "agentctl-visibility"
|
||||
review_state: accepted
|
||||
integration_state: merged_local_dev
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
cleanup_owner: "独立维护者"
|
||||
cleanup_trigger: "合入 dev 且验收通过后"
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# 治理可视化 P0
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 用户目标:实施治理可视化快赢(人类可读 status/brief、MCP 只读工具、claim archive)并撰写治理控制台 P1 方案。
|
||||
- 交付终点:P0 代码合入 local `dev`;工程工具单测与真实控制台证据;P1 设计文档落盘。
|
||||
- 禁止:push、晋升 test/main、跨机协调实施、产品 web/cmd/internal 改动。
|
||||
|
||||
## 范围与非目标
|
||||
|
||||
- 允许:`scripts/agentctl.py`、`scripts/mcp/agentctl-mcp.mjs`、新 visibility 模块与单测、`.doc/ops/short-term`、`.doc/test-reports`、archive 追加。
|
||||
- 非目标:dashboard 前后端、`claim new`、`integrate prepare`、`pi packet`(仅 P1 文档)、跨机协调。
|
||||
|
||||
## 相关问题与经验
|
||||
|
||||
- 关联:R04 CURRENT 膨胀(政策审查)、`ISSUE-20260923-coordination-authority`(不实施,仅衔接说明)。
|
||||
- catalog:`R-governance-visibility-p0`;overlap 探测无 hard/soft 命中。
|
||||
|
||||
## 步骤与验收
|
||||
|
||||
1. [x] 建场 / register / CURRENT 认领
|
||||
2. [ ] `--format table` 渲染
|
||||
3. [ ] `brief`
|
||||
4. [ ] MCP 只读工具 +4
|
||||
5. [ ] `claim archive`
|
||||
6. [ ] 单测 + 真实运行报告
|
||||
7. [ ] P1 控制台方案文档
|
||||
8. [ ] validate → queue enqueue → 收口
|
||||
|
||||
## 验证与证据
|
||||
|
||||
按验证契约「工程工具验收」:`python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v` + 真实 `--format table`/`brief`/`claim archive --dry-run` 控制台取样。
|
||||
|
||||
## 收口与交接
|
||||
|
||||
待实施完成后填写。
|
||||
@@ -0,0 +1,140 @@
|
||||
---
|
||||
title: "Cursor Auto 与 Subagent 协作规范研究"
|
||||
task_id: subagent-workflow-standard-2026-09-24
|
||||
status: done
|
||||
created: 2026-09-24
|
||||
updated: 2026-09-24
|
||||
owner: Codex
|
||||
task_type: implementation
|
||||
task_tier: multi_stage
|
||||
policy_revision: "agent-governance-2026-09-21-r1 + issue-learning-2026-09-23-r1 + systemic-issue-analysis-2026-09-23-r1 + codegraph-governance-2026-09-24-r1; dev@5423b261f97f371bdf7fa5066e9305f9eddaef42"
|
||||
branch: feature/subagent-workflow-standard-2026-09-24
|
||||
worktree: .worktrees/subagent-workflow-standard-2026-09-24
|
||||
base_dev_sha: 5423b261f97f371bdf7fa5066e9305f9eddaef42
|
||||
write_scope: ["scripts/pi_subagents.py", "scripts/pi-subagent-readonly.ts", "scripts/mcp/pi-subagents-mcp.mjs", "scripts/mcp/README.md", "scripts/tests/test_pi_subagents.py", ".cursor/mcp.json", ".cursor/rules/pi-subagents.mdc", ".doc", ".doc/ops/2026-09-24-subagent-model-config.md", ".doc/ops/2026-09-24-subagent-workflow-standard.md", ".doc/ops/short-term/2026-09-24-subagent-workflow-standard.md", ".doc/audit/2026-09-24-subagent-workflow-research.md", ".doc/ops/templates/subagent-stage-record.md", ".doc/ops/2026-09-21-policy-registry.md", ".doc/README.md", ".doc/audit/ISSUES.md", ".doc/ops/CURRENT.md"]
|
||||
allowed_environments: []
|
||||
mutex: subagent-workflow-docs
|
||||
review_state: approved
|
||||
integration_state: merged
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
cleanup_owner: "owner 退出后的独立维护者"
|
||||
cleanup_trigger: "规范采纳并集成、证据保存且 owner 退出后复查"
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# 用户目标与授权
|
||||
|
||||
用户原请求:在规范中加入 subagent 规范,日常在 Cursor 使用 Auto;梳理“形成需求→评估需求→制定方案→实施方案→代码审查→测试→合并并清理 worktree→验收”,每一步形成文档或报告,研究制定更合理的新规范。
|
||||
|
||||
本任务授权为研究与规范编制,交付终点为可审规范、依据、模板和接入顺序;不含业务实施、Cursor 全局设置、共享运行环境、Herdr 编排、远端 push。新规范以 proposed 交付,不宣称全仓 active 或已经实现自动工作流。
|
||||
|
||||
## 需求与验收
|
||||
|
||||
| R-ID | 用户要求 | AC-ID / 本次完成标准 |
|
||||
|---|---|---|
|
||||
| R1 | 日常无需选择模型 | AC1:解释 Auto/inherit 支持范围与实测缺口,不固定具体模型 |
|
||||
| R2 | 梳理合理流程 | AC2:阶段依赖、返工、合并前后验证和清理顺序明确 |
|
||||
| R3 | 加入 subagent 规范 | AC3:职责、派发/回传、独立性、并发写与授权边界可执行 |
|
||||
| R4 | 每步文档/报告 | AC4:阶段产物、模板、追踪和小任务减负规则明确 |
|
||||
| R5 | 基于研究制定 | AC5:引用当前仓库与官方依据,核对已有规范冲突并列接入验收 |
|
||||
|
||||
验收人:本次文档质量由 Codex 自检;新规范采纳由用户决定。未回复默认确认点问题,草案采用“方案确认后授权范围内自动推进”,可按用户反馈修订。
|
||||
|
||||
## 研究与实施记录
|
||||
|
||||
- 启动检查主目录 dev 干净,worktree/机器认领已盘点;工具创建本任务 worktree,登记八个文档写路径及 docs:publish。
|
||||
- 本地 dev 相对缓存 origin/dev ahead 74 / behind 0,未 fetch、未 push;服务器状态未核验。
|
||||
- CURRENT 在本任务 worktree 通过 docs apply 新增自己的认领,request_id=subagent-workflow-standard-start-20260924;主目录 CURRENT 未直接编辑。
|
||||
- 已读 AGENTS、PROJECT、CURRENT、文档地图、worktree/验证/规则登记/问题闭环/任务及收口模板。
|
||||
- 问题/经验检索词:subagent、Cursor、worktree、并行、清理、规范、审批。命中 ISSUE-20260923-matrix-status-regression 和 LESSON-20260923-matrix-status-cas;采纳共享状态经 docs apply、合并后核对状态,其他内容无直接 subagent 经验命中。
|
||||
- 新发现 ISSUE-20260924-cursor-test-rule-drift,见研究报告;仅登记与建议,未修复。
|
||||
- 文档组织采用 writing-for-agents 技能的单一来源与条件入口原则;brainstorming/ce-plan 用于流程与选项研究。
|
||||
- 没有执行产品代码、客户端角色安装或自动化脚本开发。未新增经验:本次设计尚无实机验证,已有经验继续复用。
|
||||
|
||||
## 产物
|
||||
|
||||
- [规范草案](../2026-09-24-subagent-workflow-standard.md):唯一流程定义与接入步骤。
|
||||
- [研究报告](../../audit/2026-09-24-subagent-workflow-research.md):来源、取舍、规则漂移问题与证据边界。
|
||||
- [阶段/派发模板](../templates/subagent-stage-record.md):输入版本、授权、角色输出与验收映射。
|
||||
- 文档地图和规范登记增加 proposed 入口;不修改 active 规范行为、不创建 .cursor/agents。
|
||||
|
||||
## 验证与证据
|
||||
|
||||
| 范围 | 实际检查 | 结果与限制 |
|
||||
|---|---|---|
|
||||
| 本次八个文档 | git diff --check;Python 内联链接/锚点/S0–S9/字段/ID 检查 | 初次 FILES=8 LOCAL_LINKS=84 STAGES=10 ISSUE_IDS=5 / PASS;收口再检 |
|
||||
| 流程一致性 | 逐项对照需求 AC1–AC5 和 12 个文档情景 | 均有对应条款;self_review,未作独立 Agent 审查 |
|
||||
| 状态盘点 | agentctl docs drift | status=ok、regressions=[];未改能力声明 |
|
||||
| 清理盘点 | agentctl cleanup report | exit 0;本任务 blocked:dirty_or_ignored_files、registry:TASK_ACTIVE;为提交前快照,不删除 |
|
||||
| CodeGraph | codegraph sync -q | exit 0;只更新可再生本地索引 |
|
||||
| 产品/客户端运行 | 未执行 | 纯文档研究不要求产品测试;Auto/角色实机 V1–V10 尚未运行 |
|
||||
|
||||
本次 AC1–AC5 达到研究交付标准;规范采纳仍 review_state=pending,规则生命周期 proposed。证据摘要与情景逐项结果见研究报告,未把未运行的项目记 PASS。
|
||||
|
||||
## 收口与交接
|
||||
|
||||
本记录与草案保存在本任务分支的本地 docs 提交,精确提交可由 git log -1 feature/subagent-workflow-standard-2026-09-24 核对;本次未合入 dev、未部署、未 push。后续按规范接入 A–F 推进,先处理采纳与客户端规则冲突,再实机验证 Auto/角色/门禁行为。
|
||||
本任务工作区保留供审阅,未合入 dev;cleanup 由独立维护者在满足祖先/证据/进程条件后复查。无需重建产品服务;未申请或使用 env:dev。
|
||||
|
||||
本地认领在结束前标记研究 done;此状态只关闭本次规范编制,不关闭 open 问题或自动批准规范。文件含可再生 .codegraph 缓存,独立维护者清理前另行盘点;草案是唯一新增研究成果,当前工作区需保留供审阅。
|
||||
|
||||
## 后续修订 r2:用户确认模型配置
|
||||
|
||||
逻辑 task_id 沿用 subagent-workflow-standard-2026-09-24;本机 agentctl 不支持重开已关闭记录,也不允许原记录隐式扩 scope,因此仅创建 operation_task_id=subagent-workflow-standard-2026-09-24-config-r2 作为本次写入租约身份,仍在原 worktree、分支和本主记录继续,不另建业务任务。
|
||||
写范围沿用原规范/研究/入口/模板/主记录并增加 .doc/ops/2026-09-24-subagent-model-config.md;未认领业务源码、PI 全局配置或任何运行环境。
|
||||
|
||||
授权来源:用户指定本机 PI 和五模型池;明确代码由 Cursor 实施;确认 M3 不进入默认流程;本轮“可以,默认这样,可以设置一个配置文档,让我可以根据需要进行调整”。
|
||||
|
||||
交付:可编辑模型配置 + 旧草案中的执行方式修正 + 配置版本/覆盖来源进入派发模板。模型分配 decision_state=approved;流程整体仍 proposed,自动派发器未实现,未扩大为客户端安装、产品实施、dev 集成或 push。
|
||||
|
||||
验收项:
|
||||
- AC6:五个精确 provider/model,Cursor 独占代码实施与修复。
|
||||
- AC7:M3 辅助角色 enabled=false,禁止关键判断/自动备用链。
|
||||
- AC8:角色默认、升级关系、启停、并发和任务覆盖可在文档中调整。
|
||||
- AC9:配置版本/hash 随派发记录,下一次派发生效;文件明确尚无自动解析器。
|
||||
- AC10:模型配置为唯一来源;流程与研究历史明确取代旧原生 Cursor/inherit 方案。
|
||||
|
||||
使用 writing-for-agents 的单一来源/短入口原则维护文档。继续采纳 LESSON-20260923-matrix-status-cas;不新增已验证经验,未将文档推演当运行证明。
|
||||
|
||||
本轮验证结果(文档静态检查,非运行验收):
|
||||
- git diff --check:exit 0。
|
||||
- Python 内联检查:五个模型精确匹配本机目录;11 个 role_id 唯一且升级关系无循环;auxiliary=false,M3 仅辅助;implementation_executor=cursor_auto;无自动备用;模板包含 config_revision/config_sha256。初次输出 MODELS=5 ROLES=11 STAGES=10,PASS。
|
||||
- 本次变更 Markdown 的相对链接及锚点检查通过;旧 PI implementer 配置已移除。保留的 inherit 提及均说明旧方案已废止。
|
||||
- agentctl docs drift:status=ok,regressions=[];cleanup report 为只读盘点,本任务因未合入/文件及登记状态不能删除。未操作其他任务。
|
||||
- codegraph sync -q:exit 0。仅文档变更,产品测试、真实模型调用和派发器验收不适用/未运行,未记 PASS。
|
||||
|
||||
本轮交付已完成;逻辑任务恢复 done,模型分工已获用户确认。新增配置与配套文档保存于本地任务分支;未合入 dev、未 push,主目录与 PI 全局设置均未修改。自动调用 PI 的执行器、角色工具限制实测、流程整体采纳和相关旧规则修复作为后续工作,不因配置文档存在视为已完成。
|
||||
|
||||
提交前检查记录:首次 git diff --cached --check 检出新配置头部两处 Markdown 行末双空格,提交未执行。已改为段落分隔并重跑检查;此前 git diff --check 不包含未跟踪新文件,最终以暂存区检查为准。
|
||||
|
||||
## 执行器实现续作
|
||||
|
||||
用户授权“接入自动调用 pi 的执行器”。继续原逻辑 task_id;操作登记 subagent-workflow-standard-2026-09-24-executor,Cursor Auto 负责代码,Codex 主协调。[实施契约与验证计划](../2026-09-24-pi-executor-implementation.md)。阶段 in_progress,原文“尚未实现”为此前交付历史,当前结果以本节后续报告为准。
|
||||
|
||||
## 执行器收口
|
||||
|
||||
- 实施与验证完成:代码由 Cursor Auto 编写,代码提交 69ffaa677e23a1dd9aa0528bb09b3acfcd38b119;Codex 主机复核与验收,本机 GLM-5.3 独立审查守卫候选。模型配置默认值按用户已确认方案。
|
||||
- [使用说明](../2026-09-24-pi-subagent-executor.md) · [完整报告](../../test-reports/2026-09-24-pi-executor-test-report.md)。实际 Cursor CLI 调用 roles/run/result,无 model_override、无 shell PI 替代;最终 ls/read 成功。
|
||||
- 完整工程 suite 173 项 PASS;提交后专项 34 项 PASS;node 检查、arch-check block、文档与证据核对通过。产品 Go/前端/PG/真实产品 Runner 无改动,未冒充验收。
|
||||
- 本轮授权交付终点:执行器源码与 Cursor CLI 本地接入验证。全套阶段审批状态机和 IDE 页面验证不在本次完成声明中。
|
||||
- integration_state=pending:本地 dev 已前进至 3de5bc5c396fc21887f0f19e6e3baa8784347f99(新增 nightly/测试修复),主目录干净;但 dev-full-gate-test-promo-2026-09-24 持 env:dev 真实验收租约,同锁还有别人的候选排队,不能抢占。未向 dev 写入本任务成果,未 push,未重建服务。
|
||||
- 接管:环境槽位释放后,从届时最新 dev 创建受控候选,重读规则并验证,再集成本任务分支。不得复用旧 expected-dev 或抢占别人队列。
|
||||
- cleanup 保留:未合入 dev,当前 worktree 用于配置审阅与运行;唯一报告/日志已纳入本任务文档提交,CodeGraph 为可再生缓存。由 owner 退出后的独立维护者按祖先/进程/证据条件复查,不强删。
|
||||
- ISSUE-20260924-pi-executor-boundaries 已按本地范围验证关闭;新增 LESSON-20260924-pi-tool-boundaries。既有测试规则漂移仍 open;其它 Cursor MCP 入口兼容性残差单独 deferred。研究/代码完成不自动关闭这些问题。
|
||||
|
||||
本轮临时操作登记为 subagent-workflow-standard-2026-09-24-executor;逻辑 task_id 保持原值。最终头部状态仅表示上述源码/本地验收完成,integration/deployment/remote_sync/cleanup 各自独立。
|
||||
|
||||
## 本地 dev 集成续作
|
||||
|
||||
用户明确授权“合入 dev”。沿用本逻辑 task_id;文档协调操作登记 subagent-workflow-standard-2026-09-24-land。读取 dev 基线 c1a70e67e5edfd4a4c52fe087933e92f3c6d1e9c,远端跟踪引用 ahead 3 / behind 0(未 fetch);主目录干净、机器 runs/queue 均为空。AGENTS/PROJECT/worktree/验证契约对比原基线无差异。
|
||||
预合并仅 CURRENT/ISSUES 文档冲突;采纳 LESSON-20260923-matrix-status-cas,在原任务 worktree 用 docs apply @document 对齐最新 dev 并保留自己的认领,问题台账保留 dev 全部行并追加本任务三行。docs:admin 仅用于本次一致性对齐;不改其他任务状态、不改集成槽位。
|
||||
下一步从此精确 dev 构造 --no-ff 候选,验证后通过 agentctl integrate 合入;不 push、不重建产品服务、不清理他人工作区。
|
||||
|
||||
## dev 集成完成
|
||||
|
||||
2026-09-24 按用户“合入 dev”授权完成本地受控集成:基线 c1a70e67e5edfd4a4c52fe087933e92f3c6d1e9c,来源 65539754,集成提交 5a8540804ee2d142a0894c1482a2a16e8f843915。候选完整工程测试、Node 语法和 arch-check block 通过,详见报告新增集成验证章节。CURRENT/ISSUES 冲突在原任务分支解决,保留 dev 全部记录;FEATURE-MATRIX 无变化。
|
||||
|
||||
review_state=approved;integration_state=merged;deployment=not_required(工程脚本及 Cursor 项目配置,无产品服务变化);remote_sync=not_requested;cleanup=pending。原任务及本轮集成工作区保留至 owner 退出后,由独立维护者复核祖先、证据、进程与唯一遗留再清理。完整流程草案仍 proposed,模型配置与执行器已进入 dev;在 Cursor 重新加载项目 MCP 后使用。前文未合入和占锁说明为历史快照,由本节更新。
|
||||
|
||||
集成恢复记录:首次源分支合并的全 staged whitespace 检查命中 dev 原有的原始 SQL/SSE 证据空白;对本任务相对 dev 的差异检查通过。保留原证据,核对主 dev 未变化、无服务操作、无未解决冲突后,以 verified 恢复该操作并继续提交。
|
||||
@@ -0,0 +1,49 @@
|
||||
# Worktree cleanup inventory (2026-09-24)
|
||||
|
||||
盘点基线 local_dev tip 在收口提交时以机器为准;本文件记录本轮已清除与 `cleanup_pending` 原因。
|
||||
|
||||
## 已清除(verdict=ready → `agent-worktree.sh remove --delete-branch`)
|
||||
|
||||
- integrate-non-author-closeout-2026-09-24
|
||||
- chat-semantic-d3-closeout-2026-09-23
|
||||
- free-collab-claim-notify-2026-09-24
|
||||
- governance-catalog-2026-09-24
|
||||
- integrate-free-collab-2026-09-24
|
||||
- integrate-gate-nightly-fixes-2026-09-24
|
||||
- integrate-gate-unhook-docquery-2026-09-24
|
||||
- integrate-jev-dev-assist-on-2026-09-24
|
||||
- integrate-non-author-docs-2026-09-24
|
||||
- jev-dev-enable-2026-09-24
|
||||
- jev-product-shadow-2026-09-24
|
||||
- non-author-closeout-2026-09-24
|
||||
- non-author-member-access-2026-09-24
|
||||
- pi-narrative-final-closeout-b-2026-09-23
|
||||
|
||||
清除前对可再生 ignored(`.codegraph/`、`web/node_modules`、`web/dist`、测试 `data/`、`.env`)做了显式删除;对可丢弃未提交 tracked 脏文件执行 `git checkout -- .`(任务已 done,内容已在 local_dev)。
|
||||
|
||||
## cleanup_pending(`not_ancestor_of_dev`;普通 remove 拒绝,未使用 --force/-D)
|
||||
|
||||
| worktree | head | blockers | 说明 |
|
||||
|---|---|---|---|
|
||||
| `admin-password-reset-2026-09-24` | `58bf83f7` | not_ancestor_of_dev,dirty_or_ignored_files | tip 含未成祖先的 docs 收口提交;任务 registry 多为 done. tasks: admin-password-reset-2026-09-24=done |
|
||||
| `dev-full-gate-test-promo-2026-09-24` | `614ebb8d` | not_ancestor_of_dev,dirty_or_ignored_files | tip 含未成祖先的 docs 收口提交;任务 registry 多为 done. tasks: dev-full-gate-test-promo-2026-09-24=done |
|
||||
| `fix-fullchain-unique-project-2026-09-24` | `8c4200c8` | not_ancestor_of_dev,dirty_or_ignored_files | patch-id/内容等价已在 local_dev;tip SHA 分叉. tasks: fix-fullchain-unique-project-2026-09-24=cancelled |
|
||||
| `fix-nightly-abs-datadir-2026-09-24` | `6f0e43ca` | not_ancestor_of_dev,dirty_or_ignored_files | patch-id/内容等价已在 local_dev;tip SHA 分叉. tasks: fix-nightly-abs-datadir-2026-09-24=done |
|
||||
| `gate-e1a-unique-project-name-2026-09-24` | `f04f14ff` | not_ancestor_of_dev,dirty_or_ignored_files | tip 含未成祖先的 docs 收口提交;任务 registry 多为 done. tasks: gate-e1a-unique-project-name-2026-09-24=done |
|
||||
| `gate-unhook-docquery-2026-09-24` | `2844bbfe` | not_ancestor_of_dev,dirty_or_ignored_files | tip 含未成祖先的 docs 收口提交;任务 registry 多为 done. tasks: gate-unhook-docquery-2026-09-24=done |
|
||||
| `integrate-codegraph-current-2026-09-24` | `734aa725` | not_ancestor_of_dev | task=cancelled;候选 tip 未成为 dev 祖先. tasks: integrate-codegraph-current-2026-09-24=cancelled |
|
||||
| `integrate-codegraph-governance-2026-09-24` | `22ed51cf` | not_ancestor_of_dev | CURRENT 认领 commit 未成祖先;主目录 CURRENT 已记 done/(removed). tasks: integrate-codegraph-governance-2026-09-24=done |
|
||||
| `integrate-fix-fav-staging-uuid-2026-09-24` | `80caa785` | not_ancestor_of_dev,dirty_or_ignored_files | patch-id/内容等价已在 local_dev;tip SHA 分叉. tasks: integrate-fix-fav-staging-uuid-2026-09-24=done |
|
||||
| `integrate-intent-plan-u9u12-close-2026-09-24` | `e7262d4d` | not_ancestor_of_dev | 正文证据已由替代 SHA 合入 local_dev;本 tip SHA 分叉. tasks: integrate-intent-plan-u9u12-close-2026-09-24=done |
|
||||
| `intent-plan-u9u12-accept-2026-09-24` | `e7262d4d` | not_ancestor_of_dev | 正文证据已由替代 SHA 合入 local_dev;本 tip SHA 分叉. tasks: intent-plan-u9u12-accept-2026-09-24=done |
|
||||
| `promote-rc-beta3-c-2026-09-24` | `0e4b111d` | not_ancestor_of_dev | test 晋升线产物,本非 local_dev 合入目标. tasks: promote-rc-beta3-c-2026-09-24=done |
|
||||
| `sync-local-test-origin-2026-09-24` | `9984c68d` | not_ancestor_of_dev | test 晋升线产物,本非 local_dev 合入目标. tasks: sync-local-test-origin-2026-09-24=done |
|
||||
| `worktree-cleanup-closeout-2026-09-24` | `fabd85a6` | dirty_or_ignored_files,registry:TASK_ACTIVE,process_cwd:1269150 | tip 含未成祖先的 docs 收口提交;任务 registry 多为 done. tasks: worktree-cleanup-closeout-2026-09-24=active |
|
||||
|
||||
## 孤儿目录(非 git worktree)
|
||||
|
||||
- `.worktrees/codegraph-governance-2026-09-24`:仅残留 scripts 副本,可直接 `rm -rf`(非 `git worktree remove`)。
|
||||
|
||||
## 规范依据
|
||||
|
||||
- `.doc/ops/2026-09-21-agent-worktree-workflow.md` §8:仅 `verdict=ready` 可 remove;拒绝保留 cleanup_pending。
|
||||
@@ -0,0 +1,24 @@
|
||||
# 管理员设置页与维护公告系统
|
||||
|
||||
- **task_id**: admin-settings-maint-2026-09-25
|
||||
- **status**: in_progress
|
||||
- **owner**: Cursor
|
||||
- **branch**: feature/admin-env-settings-maintenance-2026-09-25
|
||||
- **worktree**: .worktrees/admin-env-settings-maintenance-2026-09-25
|
||||
- **mutex**: admin-settings-maintenance
|
||||
- **base_dev_sha**: 4e410efbabeea5b944909d8a0de49bda1265c975
|
||||
- **write_scope**: internal/sysadmin, internal/maintenance, internal/handoff, cmd/*, deploy/pi-agent, web admin/maintenance, goose 00071, server wiring
|
||||
- **authorization**: 用户确认计划实施(dev 管理员设置页 + 维护计划公告系统)
|
||||
- **requirement**: R-admin-env-settings-maintenance
|
||||
|
||||
## 交付终点
|
||||
|
||||
1. 管理台可编辑模型/Tavily 等设置,DB 持久化;runner 热更新;secret 掩码
|
||||
2. 维护计划可调度;到点 FD 交接公告进程;管理员 token 启动新服务并下线公告
|
||||
3. 单测 + 真实 handoff E2E 报告
|
||||
|
||||
## 五状态
|
||||
|
||||
| review_state | integration_state | deployment | cleanup | remote_sync |
|
||||
|---|---|---|---|---|
|
||||
| pending | pending | not_applicable | pending | not_requested |
|
||||
@@ -0,0 +1,15 @@
|
||||
# 对话上下文注入(short-term)
|
||||
|
||||
- **task_id**: dialogue-context-injection-2026-09-25
|
||||
- **status**: in_progress
|
||||
- **write_scope**: internal/dialoguectx, internal/conflictresolve, internal/squad, internal/bizdev, internal/coordinator, internal/chat, internal/ctxmgr, internal/sysadmin, deploy/postgres/goose, .doc
|
||||
- **mutex**: dialogue-ctx
|
||||
- **base_dev_sha**: 4e410efbabeea5b944909d8a0de49bda1265c975
|
||||
- **review_state**: pending
|
||||
- **integration_state**: pending
|
||||
- **deployment**: not_applicable
|
||||
- **cleanup**: pending
|
||||
- **remote_sync**: not_requested
|
||||
|
||||
设计:[2026-09-25-dialogue-context-injection-design.md](../../system-design/2026-09-25-dialogue-context-injection-design.md)
|
||||
报告:[2026-09-25-dialogue-context-injection-test-report.md](../../test-reports/2026-09-25-dialogue-context-injection-test-report.md)
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
title: "docrev 实施方案 11 条验收收口核对"
|
||||
task_id: planned-tasks-closeout-plan-2026-09-25(P1 子产物)
|
||||
status: in_progress
|
||||
created: 2026-09-25
|
||||
owner: Cursor
|
||||
task_type: audit
|
||||
mutex: planned-tasks-closeout
|
||||
review_state: pending
|
||||
integration_state: pending
|
||||
---
|
||||
|
||||
# docrev 实施方案 11 条验收收口核对
|
||||
|
||||
对 [management-implementation-plan](../../remediation/2026-09-13-document-revision-management-implementation-plan.md) §11 的 11 条验收逐条映射现状证据。原则:**证据充分才勾,不充分列残差**;不因「大体做过」假勾。
|
||||
|
||||
## 逐条核对
|
||||
|
||||
| # | 验收 | 证据 | 判定 |
|
||||
|---|------|------|------|
|
||||
| 1 | 模板/Agent 开 Version、人工只加 Revision 在 API/UI/DB 一致 | `internal/docrevision`(45 文件:service_agent `CommitAgentVersion`、service_human、pg_mutate、contract_test);[13日报告](../../test-reports/2026-09-13-document-revision-management-test-report.md) T0 时间线 PASS;Round20 UI | ✅ 可勾 |
|
||||
| 2 | 人工高亮永远 baseline→head,Agent commit 后归零 | `ManualChangeOverlay.tsx` + [Round20 UI](../../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md) PASS(21 条);[DOCREV rerun](../../test-reports/2026-09-22-docrev-ui-rerun-test-report.md) main 18+post-restart PASS | ✅ 可勾 |
|
||||
| 3 | 任意两 Version 默认 final→final/head 比较,可看 baseline/revision | `VersionCompareView.tsx` + `DiffNavigator.tsx`;同上 UI 证据 | ✅ 可勾 |
|
||||
| 4 | 用户/单 agent/squad 主体与不可变 actor snapshot 可追溯 | service_agent.go actor snapshot;`commit_idempotent_test.go`、[Track T](../../remediation/2026-09-20-capability-enablement-impact-plan.md) 五表追踪 | ✅ 可勾 |
|
||||
| 5 | 智能体输出与 change report 同次运行产生并绑定精确快照 | `commit_report_test.go`、pending_fact_source_test;PI 叙事 fallback 属显式行为([MATRIX docgov-revision 行](../../status/FEATURE-MATRIX.md)) | ✅ 可勾(fallback 为声明内行为) |
|
||||
| 6 | 真实 diff/影响集合/风险下限服务端确定,模型不能篡改/降级 | `narrative_test.go`、risk floor 见 [R13](../../audit/2026-09-16-r13-data-safety-checklist.md);[PI 叙事收口](../../test-reports/2026-09-23-pi-narrative-closeout-test-report.md) 默认 off 但链路 PASS | ✅ 可勾 |
|
||||
| 7 | 当前负责人收版本摘要;受影响负责人收授权裁剪通知 | `internal/notification/document_events.go` + `NotificationInbox.tsx`;[Wave5](../../test-reports/2026-09-13-document-revision-management-test-report.md) 通知负例 | ✅ 可勾 |
|
||||
| 8 | 并发/重试/重启/迁移/故障注入无静默覆盖、双版本、丢通知 | `document_commit_concurrency_pg_test.go`、`concurrency_test.go`、[12日 fault-injection](../../test-reports/2026-09-12-phase4-lease-phase5-fault-injection-test-report.md)、M7(00053 投影同事务+重放) | ✅ 可勾 |
|
||||
| 9 | 已批准文档、跨项目/跨阶段、私密文档负例全绿 | `document_revision_authz_test.go` 5 组负例(401/orphan/受控路由/author-only/幂等)+ [12日 IAM](../../test-reports/2026-09-16-iam-route-inventory-test-report.md) | ✅ 可勾 |
|
||||
| 10 | 右侧栏主题/宽度/键盘/色觉/大文档可用 | Round20 + DOCREV rerun Playwright;**色觉与键盘无障碍未见专项断言** | ⚠️ 部分可勾:无障碍专项缺证据 |
|
||||
| 11 | 证据归档 + MATRIX 逐波次更新 | `.doc/test-reports/` 全套 + MATRIX docgov-revision=done | ✅ 可勾 |
|
||||
|
||||
## 结论
|
||||
|
||||
- 11 条中 **10 条证据充分**;第 10 条「无障碍专项」(色觉、键盘完备性)无专项测试证据——不假勾,列为**残差 R-docrev-a11y**。
|
||||
- 处置建议:方案文 §11 勾选 1–9、11;第 10 条标注「Playwright 主链路已过、无障碍专项未测,残差登记」;frontmatter `status: in_progress → done`(以 10/11 全证据 + 1 登记残差收口),W1-D 降级说明保留。
|
||||
- 本核对为只读产物;方案文的勾选更新需在 docgov mutex 空闲时以 docs 提交落地(列入 P1 后续动作)。
|
||||
|
||||
## 残差登记
|
||||
|
||||
| ID | 内容 | 关闭条件 |
|
||||
|---|------|---------|
|
||||
| R-docrev-a11y | 版本比较视图色觉多重编码 + 键盘完备性专项断言 | 新增 Playwright a11y 用例(axe 或手动断言)PASS 后勾第 10 条 |
|
||||
@@ -0,0 +1,94 @@
|
||||
---
|
||||
title: "已规划任务总控:批次计划与推进"
|
||||
task_id: planned-tasks-closeout-plan-2026-09-25
|
||||
status: in_progress
|
||||
created: 2026-09-25
|
||||
updated: 2026-09-25
|
||||
owner: Cursor
|
||||
task_type: planning
|
||||
policy_revision: "AGENTS.md + agent-worktree-workflow @ 725181de"
|
||||
branch: feature/planned-tasks-closeout-plan-2026-09-25
|
||||
worktree: .worktrees/planned-tasks-closeout-plan-2026-09-25
|
||||
base_dev_sha: "725181de4aa4480f77c52e40eeaef040c6563c3f"
|
||||
write_scope:
|
||||
- .doc/ops/short-term/2026-09-25-planned-tasks-closeout-plan.md
|
||||
mutex: planned-tasks-closeout
|
||||
review_state: pending
|
||||
integration_state: pending
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# 已规划任务总控:批次计划与推进
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 用户 `/goal`(2026-09-25):把 [盘点](#盘点来源) 出的「已规划未开工 / 未收口」任务全部规划并推进至完成。
|
||||
- 红线边界不变:SWBOOT-10 stub、FAV 不 live、D7 不物理删、PI 叙事 flag off、`MULTI_INTENT_PLAN_TIER` 不升 full、F4-B/F7-1/I6/I7 未授权不实施。
|
||||
- 授权内自主推进;每个实施批次独立 task_id + worktree + 验证证据;本总控只写本文件(scope 已收窄避免与活跃任务 `.doc` 宽 scope 假冲突)。
|
||||
|
||||
## 盘点来源
|
||||
|
||||
FEATURE-MATRIX(SSOT)非 done 行、CURRENT 并行认领表、`2026-09-19-audit-remainder` T20 区、两份 backlog、各任务文五状态。盘点结论见对话记录;本文件将其转为可执行批次。
|
||||
|
||||
## 批次总表
|
||||
|
||||
| 批 | 内容 | 来源 | 依赖/互斥 | 状态 |
|
||||
|----|------|------|-----------|------|
|
||||
| **P0** | 存量 panic 修复:`engine_stage.go:306` 裸解引用 `stageRes.AdvisorBrief`(空产物时 nil deref,dev 基线复现)+ `matchAdvanceStage` 疑问句误判(`做.*报价` 命中问句) | 本总控新发现(属 audit-remainder M3/M5 家族) | ~~blocked:scope 被 dialogue-r2 硬占~~ **已解锁**:持有者收口后经 `dialogue-context-layout-fix` 布局修正合入 dev(`1da17a28`),P0 随后 validate+integrate 落地(dev `12bbe948`) | **done** |
|
||||
| **P1** | docrev `management-implementation-plan` 收口核对:11 条验收逐条映射既有证据(Wave1–5 + Round20 UI + DOCREV rerun),产出勾选或残差清单;无法证明的条目列为显式残差,不假勾 | CURRENT 焦点1「仍方案态」 | 只读核对 + 文档更新;mutex `docgov` | pending |
|
||||
| **P2** | T20 S1 小改批:B11(GET 禁 message)、F1(loadOlder generation)、F8(poll 去重+blob revoke)、F4-A(隐藏死按钮) | [T20 设计](../../system-design/2026-09-22-t20-hardening-design.md) 实施拆批 S1 | mutex `web`;无环境写 | pending |
|
||||
| **P3** | T20 S2 配置/池批:B1(XFF 可信代理)、B4(statement_timeout 分级)、B7(SHUTDOWN_DRAIN 对齐) | 同上 S2 | mutex `server`/`infra`;需回归 | pending |
|
||||
| **P4** | T20 S3 锁批:B3(docgov/docrevision 分锁 + 锁外 hydrate) | 同上 S3 | mutex `docgov`;独立大改,`go test -race` | pending |
|
||||
| **P5** | T20 S4 镜像批:I1(非 root + limits)、I4(init mount 统一)——代码/compose 可合;共享环境部署另授权 | 同上 S4 | mutex `infra`;部署不自动 | pending |
|
||||
| **P6** | T20 观测:B5(FailChatTurn 可观测 + 孤儿扫描) | 同上 | mutex `chat` | pending |
|
||||
| **P7** | Server 镜像字段增量收口(module-batches-ag 剩余「另立任务」) | MATRIX `module-batches-ag` 行尾注 | mutex `module-decoupling-spec` | pending |
|
||||
| **P8** | U9–U12 剩余键逐键放量:`document.review.approve/reject`、`document.final.*`、`document.proposal.decide`、`workflow.switch`、`run.restart`(validated_only,逐键独立 flag + 真实 PI 证据,禁 full 一次放量) | MATRIX `intent-plan-u9u12` 行尾注 | mutex `intent-plan`;每键独立任务 | pending |
|
||||
| **P9** | web-sysadmin 残差:Playwright 实跑、KB 运维动作、白名单项接消费方 | MATRIX `web-sysadmin` 行尾注 | mutex `web+sysadmin` | pending |
|
||||
| **P10** | backlog 价值评估 + 择优实施:B5 报价复核、A5/A6 小队降级、D5 KB 隔离评估、R1/R4–R7 rdev 增强 | 两份 backlog | 逐项评估后定做/不做及理由 | pending |
|
||||
| **P11** | 未收口任务推进:`intent-plan-i2` 两行、`worktree-cleanup-closeout`、cleanup=pending 批量复查(`cleanup report` 门禁) | CURRENT 表 | `cleanup report` 只读盘点先行 | pending |
|
||||
| **P12** | 红线项推进至授权边界:FAV 观察窗计时核查、D7 合规签字追踪、SWBOOT L5/L6 授权申请登记、PI 叙事 dev 常驻开启申请登记——只登记与证据核查,不越权实施 | CURRENT 受控约束 | 只读 | pending |
|
||||
|
||||
## 执行顺序与理由
|
||||
|
||||
1. **P0 先行**:dev 基线 panic 是所有后续 `go test` 的噪音源,必须先修。
|
||||
2. **P1 只读核对**并行做(不占代码 mutex)。
|
||||
3. **P2(S1 小改)** → **P3(S2)** → **P6(B5)**:按设计文档优先级 P1 软件项排完。
|
||||
4. **P4(B3 锁)**独立大改单独排。
|
||||
5. **P5(I1/I4)**代码层完成后停在「待部署授权」。
|
||||
6. **P7–P9** 各自独立,按 mutex 空闲插入。
|
||||
7. **P10 评估先行**,产出做/不做决策再实施。
|
||||
8. **P11 cleanup** 用 `agentctl cleanup report` 机器门禁复查,不手工删。
|
||||
9. **P12** 全程只读登记。
|
||||
|
||||
## 每批验收口径
|
||||
|
||||
- 代码批:`go test`(含 `-race` where applicable)+ 工程/产品分层按 [验证契约];报告落 `.doc/test-reports/`。
|
||||
- 文档批:链接可达、状态真实、无假勾选。
|
||||
- 红线批:只登记 blocker 与授权申请,不实施。
|
||||
- 合入:`validate` → `queue enqueue`(daemon ff-only),串行。
|
||||
|
||||
## 状态机
|
||||
|
||||
| 字段 | 值 |
|
||||
|---|---|
|
||||
| review_state | done(P0 已合入 dev `12bbe948`) |
|
||||
| integration_state | partial(P0 done;P1–P12 待续) |
|
||||
| deployment | not_required |
|
||||
| cleanup | pending |
|
||||
| remote_sync | not_requested |
|
||||
|
||||
## 进展日志
|
||||
|
||||
- 2026-09-25:建场、盘点转批次、P0 根因定位(`engine_stage.go:306` nil deref,空 `executedArtifacts` 时 `stageBrief=nil`;dev@725181de 复现 `TestBizDev_CaseRecommendation_FullLink_E2E` panic)。
|
||||
- 2026-09-25:P0 双层修复完成并全绿(nil 保护 + `isInterrogative` 疑问句排除;新增回归 `TestCoordinatorEngine_AdvanceStageNilBriefNoPanic`;intent/coordinator/bizdev/squad/dialoguectx/conflictresolve/ctxmgr 全 PASS,chat 存量失败 `TestChatSession_SemanticMemoryRecallAndAsyncTurnRecord` 为基线同款)。**落地受阻**:catalog hard same_scope(持有者任务未收口,hard 不可 ack)→ 补丁与测试报告存 `~/fix-stage-brief-panic-patches/`,登记 blocked 待持有者收口后落地。
|
||||
- 2026-09-25:存量遗留新登记:chat 语义记忆异步轮记录用例失败(dev 基线同款),候选批次。
|
||||
- 2026-09-25:**P0 落地**:`dialogue-context-injection-2026-09-25-r2` 经布局修正(r1/r2 行移表尾,`docs apply @document` + 新任务 `dialogue-context-layout-fix-2026-09-25` 持 docs:admin)解除 integrate 相邻插入冲突,merge 一枪成功合入 dev(`1da17a28`)。P0 补丁随即 apply 到 `fix-stage-brief-nil-panic-2026-09-25` worktree,`go test ./internal/coordinator/... ./internal/intent/...` 全 PASS(含新增回归 `TestCoordinatorEngine_AdvanceStageNilBriefNoPanic`),validate+integrate 合入 dev `12bbe948`(5 文件 +231 行:nil 保护、疑问句门控、回归测试、任务文与测试报告)。
|
||||
|
||||
## 相关链接
|
||||
|
||||
- 盘点对话:本轮 /goal 前置盘点
|
||||
- T20 设计:[../../system-design/2026-09-22-t20-hardening-design.md](../../system-design/2026-09-22-t20-hardening-design.md)
|
||||
- docrev 方案:[../../remediation/2026-09-13-document-revision-management-implementation-plan.md](../../remediation/2026-09-13-document-revision-management-implementation-plan.md)
|
||||
- 验证契约:[../2026-09-21-validation-contract.md](../2026-09-21-validation-contract.md)
|
||||
@@ -0,0 +1,83 @@
|
||||
---
|
||||
title: "P7: Server 镜像字段增量收口"
|
||||
task_id: server-image-field-closeout-r3-2026-09-25
|
||||
status: in_progress
|
||||
created: 2026-09-25
|
||||
updated: 2026-09-25
|
||||
owner: cursor-auto
|
||||
task_type: implementation
|
||||
task_tier: small
|
||||
policy_revision: "agent-governance-2026-09-21-r1"
|
||||
branch: feature/server-image-field-closeout-2026-09-25
|
||||
worktree: .worktrees/server-image-field-closeout-2026-09-25
|
||||
base_dev_sha: "44161d2ad2d7aada3e9ff88127b52148543278e5"
|
||||
write_scope:
|
||||
- internal/server/
|
||||
- internal/app/
|
||||
- internal/storage/
|
||||
- deploy/postgres/goose/
|
||||
- .doc/ops/short-term/
|
||||
- .doc/test-reports/
|
||||
allowed_environments: []
|
||||
head_sha: ""
|
||||
mutex: module-decoupling-spec
|
||||
review_state: pending
|
||||
integration_state: pending
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
cleanup_owner: independent maintainer after owner exit
|
||||
cleanup_trigger: acceptance green + optional owner exit
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# P7: Server 镜像字段增量收口
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 用户目标:`/goal 把这些任务都进行规划,并推进至完成` → 总控 [P7 批次](./2026-09-25-planned-tasks-closeout-plan.md)。
|
||||
- 来源:MATRIX `module-batches-ag` 行尾注「Server 镜像字段增量收口另立任务」;[batch A 残留债务表](./2026-09-22-server-assembly-cleanup.md)「`gov` 等镜像字段:迁完用例前保留镜像」。
|
||||
- 交付终点:删除 `Server` 全部 Runtime 镜像字段、短测+race 绿、arch-check PASS、可合入 dev。
|
||||
- 禁止项:不 push;不改 HTTP 状态码语义;不动 FAV live / production_ready。
|
||||
|
||||
## 开工检索
|
||||
|
||||
- `matrix|镜像字段|module-batches-ag` → [ISSUES](../../audit/ISSUES.md) 无命中;[lessons INDEX](../lessons/INDEX.md) 无命中。
|
||||
- 采纳检查:全仓 grep(镜像字段访问 `s.X` 穷举 485 处)+ 基线 race 复测(临时 worktree 对照)。
|
||||
|
||||
## 实施内容
|
||||
|
||||
1. **删除 `Server` 24 个 Runtime 镜像字段**(`svc/pwSvc/rec/engine/authSvc/taskRuns/authorizer/authzSvc/wfDefSvc/instSvc/notifySvc/resolver/wsCap/cmds/stageflow/gov/rev/ctxMgr/cas/freeDoc/kb/sysadmin/maintenance` 及 stop 通道),`NewFromRuntime` 装配行同步删除。
|
||||
2. **新增 `internal/server/runtime_accessors.go`**:同名 nil 安全访问器(`s.gov()` → `s.rt.Gov`),集中承接领域服务访问;测试注入走 `serverTestOverrides` + `setOverride*` setter(显式 nil 经 `authorizerNil`/`instSvcNil` 位标记支持 fail-closed 用例)。
|
||||
3. **574 处调用点机械替换** `s.X`/`srv.X` → `s.X()`/`srv.X()`(脚本 + 编译核对)。
|
||||
4. **附带修复(既有债务撞车)**:
|
||||
- `Shutdown` 与 4 个后台循环(sweeper/publisher/reminder/wsGC)对 stop 通道的 DATA RACE——dev 基线 `44161d2a` 复测同样失败(`chat_turn_sweeper.go:21` vs `server.go:471`)。新增 `backgroundLoop`(mutex + `sync.Once` 通道),通道只在 loop goroutine 内创建持有,`Shutdown` 经 `stop()` 通知。
|
||||
- **goose 00071 版本号冲突**:`1da17a28` dialogue 合并同时带入两个 `00071_*`(maintenance-windows、context-conflict-adjudications),goose sort panic 阻塞全仓 `go test`。dev 库(`agent_system_dev@5433`)已应用至 00070、两个 00071 均未应用 → `context-conflict-adjudications.sql` 重编号 `00072`,零数据迁移。
|
||||
- **`ListProjectRefs` 内存模式排序缺失**:map 迭代顺序随机令「同 SHA 首条引用不标 dedup」判定不稳定(`TestUploadProjectAsset_DedupHint` 20 轮 2 失败复现)。内存路径补 `sort.Slice(by ID)` 与 PG `ORDER BY id ASC` 对齐,修复后 30 连跑全绿。
|
||||
5. `task_finalize_test.go` 改用 `newMinimalRuntime`(仅测试所需字段的 `app.Runtime`)。
|
||||
|
||||
## 非目标
|
||||
|
||||
- 迁移 handler 到 `internal/app` 用例层(batch-plan 原愿景):本批完成镜像字段删除后,`app.Runtime` 已是唯一服务持有者,后续用例迁移不再受镜像字段干扰。
|
||||
- `supplementImpact` 字段保留:本包接口类型非 Runtime 镜像。
|
||||
- `intentPlans` 测试 override 经 `intentPlansOverride` 字段(setter 语义无法用访问器表达)。
|
||||
|
||||
## 验证与证据
|
||||
|
||||
| 范围 / 被测 SHA | 命令与环境 | 预期 | 实际 / 判定 | 证据 |
|
||||
|---|---|---|---|---|
|
||||
| server 包短测 | `go test -short -count=1 ./internal/server/` | PASS | PASS(19.9s) | 本机 Linux |
|
||||
| server 包 race | `go test -race -short -count=1 ./internal/server/` | PASS | PASS(232s,含既有 race 修复后) | 基线 `44161d2a` 同用例 FAIL(DATA RACE)已复测留证 |
|
||||
| 相邻包 | `go test -short ./internal/app/... ./internal/chat/... ./internal/intent/...` | PASS | PASS 全 12 包 | |
|
||||
| 全仓 short | `go test -short -count=1 ./...` | PASS | PASS(含 goose 00072 修复后 bizdev-cli) | 基线因 00071 重复 panic |
|
||||
| 架构门禁 | `./scripts/arch-check.sh --mode block` | PASS | PASS | |
|
||||
| 工程工具 | `python3 -B -m unittest discover -s scripts/tests` | PASS | PASS 234 tests | |
|
||||
|
||||
## 收口与交接
|
||||
|
||||
- 本地提交 / 待 validate + integrate 合入 dev / 不部署 / 不 push。
|
||||
- 详见测试报告:[2026-09-25-p7-server-image-field-closeout-test-report.md](../../test-reports/2026-09-25-p7-server-image-field-closeout-test-report.md)
|
||||
|
||||
## 相关链接
|
||||
|
||||
- 总控计划:[2026-09-25-planned-tasks-closeout-plan.md](./2026-09-25-planned-tasks-closeout-plan.md)
|
||||
- 债务来源:[2026-09-22-server-assembly-cleanup.md](./2026-09-22-server-assembly-cleanup.md)
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
title: "阶段推进 AdvisorBrief 空指针 panic 修复"
|
||||
task_id: fix-stage-brief-nil-panic-2026-09-25-r2
|
||||
status: in_progress
|
||||
created: 2026-09-25
|
||||
owner: Cursor
|
||||
task_type: fix
|
||||
policy_revision: "AGENTS.md @ 725181de"
|
||||
branch: fix/fix-stage-brief-nil-panic-2026-09-25(实施并入 dialogue-context-injection-2026-09-25 scope 持有者 worktree)
|
||||
worktree: .worktrees/fix-stage-brief-nil-panic-2026-09-25(注册用)/ 实际代码在 .worktrees/dialogue-context-injection-2026-09-25
|
||||
base_dev_sha: "725181de4aa4480f77c52e40eeaef040c6563c3f"
|
||||
write_scope:
|
||||
- internal/coordinator/engine_stage.go
|
||||
- internal/coordinator/engine_test.go
|
||||
- internal/intent/recognizer_matchers_task.go
|
||||
- .doc/test-reports/2026-09-25-stage-brief-nil-panic-fix-test-report.md
|
||||
mutex: coordinator-nil-panic-fix
|
||||
review_state: accepted_with_evidence
|
||||
integration_state: pending
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# 阶段推进 AdvisorBrief 空指针 panic 修复
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 总控 `/goal`(2026-09-25)批次 P0:消除 dev 基线存量 panic。
|
||||
- scope 冲突处置:`internal/coordinator` 被 `dialogue-context-injection-2026-09-25-r2` 声明(hard same_scope),按 catalog 规则「合并到持有者任务」——修复作为独立提交挂入持有者 worktree 分支。
|
||||
|
||||
## 修复内容
|
||||
|
||||
1. **panic**:`engine_stage.go` `stageRes.AdvisorBrief` nil 保护 + 降级文案。
|
||||
2. **意图误判**:`matchAdvanceStage` 前置 `isInterrogative` 疑问句排除(问句不构成推进指令)。
|
||||
3. **回归测试**:`TestCoordinatorEngine_AdvanceStageNilBriefNoPanic`。
|
||||
|
||||
## 验证
|
||||
|
||||
见 [测试报告](../../test-reports/2026-09-25-stage-brief-nil-panic-fix-test-report.md):PASS。
|
||||
|
||||
## 残差
|
||||
|
||||
- `internal/chat` 的 `TestChatSession_SemanticMemoryRecallAndAsyncTurnRecord` 存量失败(dev 基线同款,非本批引入),登记后续批次。
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
title: "T20 B5:chat 回合补偿可观测与孤儿扫描"
|
||||
task_id: t20-b5-chat-observability-2026-09-25
|
||||
status: in_progress
|
||||
created: 2026-09-25
|
||||
updated: 2026-09-25
|
||||
owner: Cursor
|
||||
task_type: hardening
|
||||
policy_revision: "AGENTS.md @ 088ff307"
|
||||
branch: feature/t20-b5-chat-observability-2026-09-25
|
||||
worktree: .worktrees/t20-b5-chat-observability-2026-09-25
|
||||
base_dev_sha: "088ff307c0c4c27cd1d1635c79227408c437346e"
|
||||
write_scope:
|
||||
- internal/ctxmgr
|
||||
- internal/chat
|
||||
mutex: chat+ctxmgr
|
||||
review_state: done
|
||||
integration_state: pending
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# T20 B5:chat 回合补偿可观测与孤儿扫描
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 来源:`planned-tasks-closeout-plan-2026-09-25` P6 批次;设计 [T20 B5](../../system-design/2026-09-22-t20-hardening-design.md#b5--chat-消息与-turn-原子性)。
|
||||
- 按「本阶段不强制同事务」决策:加固既有补偿 + 补可观测 + 孤儿批量清理。
|
||||
|
||||
## 变更清单
|
||||
|
||||
| 项 | 变更 | 文件 |
|
||||
|----|------|------|
|
||||
| 补偿可观测 | `FailChatTurn`/`CompleteChatTurn` 失败时 `slog.ErrorContext` 结构化日志(`chat_turn_fail_compensation_failed` / `chat_turn_complete_failed`),不再静默 `_ =` | `internal/ctxmgr/chat_turns.go` |
|
||||
| 孤儿扫描 | 新增 `SweepExpiredProcessingTurns(ctx, limit)`:PG 路径批量 `UPDATE ... WHERE status=processing AND lease_expires_at<now()`(批上限 + ASC 排序);内存路径同语义;扫到记 `chat_turn_sweep_expired_processing` WARN | 同上 |
|
||||
| 周期调度 | Server 启动 `startChatTurnSweeper`:2 分钟间隔、批 200、单次 30s 超时;Shutdown 关闭 | `internal/server/chat_turn_sweeper.go`、`internal/server/server.go` |
|
||||
|
||||
## 回归测试
|
||||
|
||||
- `TestSweepExpiredProcessingTurns_Memory`:过期 processing→failed;fresh/completed 不动;幂等(二次扫描 0)。
|
||||
- 既有 `TestAcquireChatTurn_*` 家族不回归。
|
||||
|
||||
## 边界确认
|
||||
|
||||
- 不改 `AcquireChatTurn` 幂等/租约语义(`client_turn_id` 重放仍拒绝双写助手)。
|
||||
- 「用户消息已写、turn 未绑定」孤儿告警为后续可选项(设计文档 2.3 条),本批未做——依赖真实失败注入数据。
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
title: "T20 S1 小改批:B11/F1/F8/F4-A"
|
||||
task_id: t20-s1-small-fixes-2026-09-25
|
||||
status: in_progress
|
||||
created: 2026-09-25
|
||||
updated: 2026-09-25
|
||||
owner: Cursor
|
||||
task_type: fix
|
||||
policy_revision: "AGENTS.md + agent-worktree-workflow @ 725181de"
|
||||
branch: feature/t20-s1-small-fixes-2026-09-25
|
||||
worktree: .worktrees/t20-s1-small-fixes-2026-09-25
|
||||
base_dev_sha: "725181de4aa4480f77c52e40eeaef040c6563c3f"
|
||||
write_scope:
|
||||
- internal/server
|
||||
- web/src
|
||||
mutex: web+server
|
||||
review_state: done
|
||||
integration_state: pending
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# T20 S1 小改批:B11/F1/F8/F4-A
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 来源:`planned-tasks-closeout-plan-2026-09-25` P2 批次;用户 `/goal` 授权批量推进。
|
||||
- 设计依据:[T20 加固设计](../../system-design/2026-09-22-t20-hardening-design.md) S1 行(B11/F1/F8/F4-A,均「无环境写」)。
|
||||
|
||||
## 变更清单
|
||||
|
||||
| ID | 变更 | 文件 |
|
||||
|----|------|------|
|
||||
| B11 | GET `/api/v1/chat/stream` 带 `message` query → 400 指向 POST;GET 分支不再读 `message`(保留订阅型参数) | `internal/server/sse.go` |
|
||||
| F1 | `loadOlder` / `loadFullDay` / `jumpToDate` 入口捕获 `generationRef.current`,resolve 后比对丢弃晚到响应;失败日志与 `setPhase` 同样受 gen 门控 | `web/src/hooks/useChatWindow.ts` |
|
||||
| F8-a | run 轮询 in-flight 合并(`Map<runId, Promise>`)防慢请求重叠;卸载清理 | `web/src/App.tsx` |
|
||||
| F8-b | `fetchChatCategories`/`fetchChatDates` 绑定 `statsGenRef`;切会话旧 stats 不落地 | `web/src/App.tsx` |
|
||||
| F8-c | 导出 Markdown blob URL 统一 `try/finally revoke` | `web/src/App.tsx` |
|
||||
| F4-A | 移除 UsersSection「重置密码」死按钮(服务端端点未开通);注释引导 F4-B 产品选型后重建 | `web/src/components/admin/console/sections/UsersSection.tsx` |
|
||||
|
||||
## 回归测试
|
||||
|
||||
- `TestChatStream_GetMessageQueryRejected`:GET+message → 400 且文案指向 POST。
|
||||
- `TestChatStream_GetWithoutMessageNotLeak`:无 message GET → 400(empty message 统一拒绝),不产生 SSE 头。
|
||||
- `useChatWindow.loadOlder.race.test.ts`:切会话后 loadOlder 晚到 resolve 不写 dayStack/cache。
|
||||
|
||||
## 验证记录
|
||||
|
||||
- `go build ./internal/server/...` PASS。
|
||||
- `go test ./internal/server/ -skip 'TestPiAgent_FullLifecycle'` PASS(20.5s;被 skip 项为 KB 离线环境依赖,dev 基线同款失败,与本批无关)。
|
||||
- `tsc --noEmit`:仅剩 `EnvSettingsSection.tsx(151)` TS6133 —— dev 基线同款(主目录同报),非本批引入。
|
||||
- node `--test` loadOlder race:1 pass。
|
||||
- 既有 `useChatWindow.race.test.ts`(主窗口竞态)不回归。
|
||||
|
||||
## 边界确认
|
||||
|
||||
- F4-B(服务端重置端点)未实施——需产品选型,见设计文档 F4 表。
|
||||
- 未动 `EventSource` 前端调用(`web/src/api/chatStream.ts` 已是 POST)。
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
title: "T20 S2 配置/池批:B1/B4/B7"
|
||||
task_id: t20-s2-config-pool-2026-09-25
|
||||
status: in_progress
|
||||
created: 2026-09-25
|
||||
updated: 2026-09-25
|
||||
owner: Cursor
|
||||
task_type: hardening
|
||||
policy_revision: "AGENTS.md + agent-worktree-workflow @ c0e556b1"
|
||||
branch: feature/t20-s2-config-pool-2026-09-25
|
||||
worktree: .worktrees/t20-s2-config-pool-2026-09-25
|
||||
base_dev_sha: "c0e556b1679ebf8032459c53219af361a27e8a50"
|
||||
write_scope:
|
||||
- internal/server
|
||||
- internal/db
|
||||
- cmd/server
|
||||
- deploy
|
||||
mutex: server+infra-config
|
||||
review_state: done
|
||||
integration_state: pending
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# T20 S2 配置/池批:B1/B4/B7
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 来源:`planned-tasks-closeout-plan-2026-09-25` P3 批次;设计依据 [T20 加固设计](../../system-design/2026-09-22-t20-hardening-design.md) S2 行。
|
||||
- 均为「无环境写」的代码/配置层改动;compose 变更只入 Git,不部署(部署另授权)。
|
||||
|
||||
## 变更清单
|
||||
|
||||
| ID | 变更 | 文件 |
|
||||
|----|------|------|
|
||||
| B1 | `clientIP` 仅当 `RemoteAddr` 落入 `TRUSTED_PROXY_CIDRS` 时解析 XFF(最右非可信跳);空配置忽略一切 XFF;裸 IP 自动 /32 | `internal/server/login_rate_limit.go` |
|
||||
| B4 | 新增 `internal/db/pool.go`:`PoolProfile`(default 30s / migrate 0)+ `OpenAppPool` 统一入口(`RuntimeParams.statement_timeout` + `MaxConns` 可配);`bizdev.NewService` 改走 `OpenAppPool(DefaultProfile())` | `internal/db/pool.go`、`internal/bizdev/service.go` |
|
||||
| B7 | `cmd/server/main.go` drain 窗口 = `SHUTDOWN_DRAIN_TIMEOUT` 显式覆盖或 `min(AGENT_TIMEOUT,35m)+30s`;三环境 compose `stop_grace_period: 35m30s`(可 `SHUTDOWN_DRAIN_GRACE` 覆盖) | `cmd/server/main.go`、`docker-compose.{dev,test,main}.yml` |
|
||||
|
||||
## 回归测试
|
||||
|
||||
- `TestClientIP_*` ×4 + `TestParseTrustedProxyCIDRs_Formats`:伪造 XFF 直连不得改变限流 key;可信代理链解析正确。
|
||||
- `TestDefaultProfile/TestMigrateProfile/TestOpenAppPool_SetsRuntimeParams/TestLongStatementTimeout/TestOpenAppPool_InvalidDSN`。
|
||||
- `TestShutdownDrainTimeout_*` ×5:封顶/跟随/覆盖/非法回落/nil 配置。
|
||||
- 三环境 `docker compose config --quiet` 全过(修正 main.yml 双依赖服务插入点)。
|
||||
|
||||
## 边界确认
|
||||
|
||||
- 旧 5s→10s Shutdown 硬编码移除;不部署(P5 镜像批一并授权后生效)。
|
||||
- 业务 SQL 无散落 timeout 改动(按设计「池默认 + SET LOCAL」原则,long 路径后续按需 `SET LOCAL`)。
|
||||
@@ -0,0 +1,69 @@
|
||||
---
|
||||
title: "T20 S3 锁批:B3 docgov/docrevision 分锁"
|
||||
task_id: t20-s3-lock-split-2026-09-25
|
||||
status: in_progress
|
||||
created: 2026-09-25
|
||||
updated: 2026-09-25
|
||||
owner: Cursor
|
||||
task_type: hardening
|
||||
policy_revision: "AGENTS.md @ d93c1ab3"
|
||||
branch: feature/t20-s3-lock-split-2026-09-25
|
||||
worktree: .worktrees/t20-s3-lock-split-2026-09-25
|
||||
base_dev_sha: "d93c1ab3d685e988f4bfc3f09a84bfc1e25f3302"
|
||||
write_scope:
|
||||
- internal/docrevision
|
||||
- internal/docgov
|
||||
- .doc/ops/short-term/2026-09-25-t20-s3-lock-split.md
|
||||
- .doc/test-reports/2026-09-25-t20-s3-lock-split-test-report.md
|
||||
mutex: docgov/docrevision
|
||||
catalog: R-t20-s3-lock-split(overlap 探测无硬/软重叠)
|
||||
review_state: done
|
||||
integration_state: pending
|
||||
deployment: not_required(纯进程内并发改造,无部署面变化)
|
||||
cleanup: pending
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# T20 S3 锁批:B3 docgov/docrevision 分锁
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 来源:`planned-tasks-closeout-plan-2026-09-25` P4 批次;设计 [T20 B3](../../system-design/2026-09-22-t20-hardening-design.md)(阶段 A)。
|
||||
- 目标:单文档慢 DB 查询不再阻塞**全部**文档的修订/租约路径。
|
||||
|
||||
## 实现方式(阶段 A,行为不变)
|
||||
|
||||
### docgov(`internal/docgov`)
|
||||
|
||||
- 新增 `lock_split.go`:`docLockIndex`(`map[docID]*sync.Mutex` + meta 锁只保护分锁表)与幂等 `docLockGuard`。
|
||||
- 迁移写路径为 `acquireDocLock(docID)`:`AcquireLease`/`ReleaseLease`/`HeartbeatLease`/`SaveDocumentContent`/`AssertLeaseFencing`/`CheckHumanCanEdit`/`AssertWritableForComment`/`AddComment`/`CreateOrGetDocument`/`LockDocumentDuty`/`MarkDocumentContentUpdated`/`SetDocumentWorkDir`/`RecordDocumentViewed`/`RecordDocumentEdited`/`CheckModificationPermission`/`SubmitForReview`/`ReviewApprove`/`ReviewReject`/`ApproverApprove`/`ApproverReject`/`ReopenForRevision`/`GetDocument`/`ListAuditLogs`/`ListComments`/`ProposeModification`。
|
||||
- 提案决策类(`DecideModificationProposal`/`MarkProposalApplied`)以 `*proposal:<id>` 命名空间分锁。
|
||||
- `ApproverApprove` 的 hook-out-of-lock 段改用 guard 释放/重取(替代原 `e.mu.Unlock()/Lock()`)。
|
||||
- 全局 `e.mu` 保留:`loadDocumentFromDBLocked` 内部短临界区写 `memDocs`、hooks 注册、`materialize` 模板段与 `hasCanonicalSibling` 内存兜底——均为纯内存操作,无 DB RTT。
|
||||
|
||||
### docrevision(`internal/docrevision`)
|
||||
|
||||
- 新增 `lock_split.go`:同构 `docLockIndex` + `Service.lockDoc`。
|
||||
- 全部公开入口改为 **doc 锁 → 全局 `s.mu`** 两段式(`GetRevisionState`/`ListVersions`/`GetVersionContent`/`ManualOverlay`/`GetCandidate`/`GetChangeReport`/`CommitHumanRevision`/`OpenTemplateVersion`/`EnsureBootstrap`/`CreateAgentCandidate`/`CommitAgentVersion`/`ImportFreeformLegacy`/`SetDocWorkDir`/`SetLifecycle`/`EnsureRoot`/`ReconcileDocument`/`CommitMigrationRepair`/`InspectProjection`/`HeadContent`/`projectOutputMarkdown`/`ContentProjectionPending`/`MarkContentProjected`)。
|
||||
- hydrate 的 PG 查询仍在 doc 锁内(保证同文档 TOCTOU 语义),但**不再进入跨文档临界路径**——这正是 B3「单文档慢查询阻塞全部文档」的修复点。
|
||||
- 锁序统一:`docLocks[docID] → s.mu`(与 docgov `docLocks[docID] → e.mu` 对称);`docLocks.meta` 仅在查表瞬间持有。
|
||||
|
||||
## 关键设计决策
|
||||
|
||||
1. **hydrate 保持在 doc 锁内**(而非完全锁外):`lockOpenVersionTX` 的 `FOR UPDATE` 行锁 + 乐观 head/etag 校验依赖「检查-写入」原子性;锁外 hydrate + 短临界区合并需要引入版本 CAS,超出阶段 A「行为不变」边界(设计文档亦将完整缓存化列为阶段 B)。
|
||||
2. **`sync.Once` 幂等 guard**:防止 `ApproverApprove` 这类显式释放/重取模式下的双重 Unlock panic(首轮 race 测试捕获后修复)。
|
||||
3. **提案命名空间锁**:提案不属于单一文档的互斥域(决策跨 doc + proposal 表),独立命名空间避免与 doc 锁混序。
|
||||
|
||||
## 验证
|
||||
|
||||
- `go test -race ./internal/...`:67 包全绿(含 docgov/docrevision/app 下游)。
|
||||
- 新增 `lock_split_test.go` 三用例:
|
||||
- `TestParallelHydrateDoesNotSerializeAcrossDocs`:docA 持锁期间 docB 可完成锁定(验收断言);
|
||||
- `TestParallelSameDocStillSerialized`:同文档串行不放松(回归保护);
|
||||
- `TestConcurrentDistinctDocsCommits`:4 文档×10 版并行提交链无交叉污染。
|
||||
- 既有并发负例(`TestConcurrentHumanRevisions`、`document_commit_concurrency_pg_test` 所在包)随 67 包回归通过。
|
||||
|
||||
## 未做(明确边界)
|
||||
|
||||
- 阶段 B(PG 为 SSOT、内存缓存化、锁外 hydrate + 版本 CAS):设计文档标注「需单独容量评估」,不与本批绑定。
|
||||
- `SaveDocumentContent` 的 `e.mu.Lock()` 中段保留为全局锁(原代码即两段式:AcquireLease(已分锁)→ 内容写段);该段无 DB hydrate,仅 persist 一条 UPDATE,非 B3 痛点。
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
title: "T20 S4 镜像批(代码层):I1/I4"
|
||||
task_id: t20-s4-image-batch-2026-09-25
|
||||
status: in_progress
|
||||
created: 2026-09-25
|
||||
updated: 2026-09-25
|
||||
owner: Cursor
|
||||
task_type: hardening
|
||||
policy_revision: "AGENTS.md @ 42436f75"
|
||||
branch: feature/t20-s4-image-batch-2026-09-25
|
||||
worktree: .worktrees/t20-s4-image-batch-2026-09-25
|
||||
base_dev_sha: "42436f754d904d7e54c2b0b0fd559a91b7889f17"
|
||||
write_scope:
|
||||
- deploy/app/Dockerfile
|
||||
- docker-compose.dev.yml
|
||||
- docker-compose.test.yml
|
||||
- docker-compose.main.yml
|
||||
mutex: infra-config
|
||||
review_state: done
|
||||
integration_state: pending
|
||||
deployment: blocked_awaiting_authorization
|
||||
cleanup: pending
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# T20 S4 镜像批(代码层):I1/I4
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 来源:`planned-tasks-closeout-plan-2026-09-25` P5 批次;设计 [T20 I1/I4](../../system-design/2026-09-22-t20-hardening-design.md)。
|
||||
- **仅代码/compose 层合入**;共享环境部署需另授权(I1 卷权限冒烟须在部署窗口做)。
|
||||
|
||||
## 变更清单
|
||||
|
||||
| ID | 变更 | 文件 |
|
||||
|----|------|------|
|
||||
| I1 | Dockerfile 建 `appuser`(uid/gid 10001)、`chown /app`、`USER appuser`;compose app/events 服务 `mem_limit`/`mem_reservation`/`cpus`(dev 1.5g/2g、test 2g/1g、main 3g/1g app) | `deploy/app/Dockerfile`、`docker-compose.*.yml` |
|
||||
| I4 | dev(context_init)与 main(goose baseline)统一改挂 `extensions_init.sql` → `01-extensions.sql`;表结构一律走 app goose 迁移 | `docker-compose.dev.yml`、`docker-compose.main.yml` |
|
||||
|
||||
## 验证
|
||||
|
||||
- `docker build --check`:无警告。
|
||||
- 三环境 `docker compose config --quiet`:PASS;渲染含 `mem_limit/cpus/01-extensions.sql`。
|
||||
- `USER appuser` 在 healthcheck/entrypoint 前生效。
|
||||
|
||||
## 部署边界(redline)
|
||||
|
||||
- **新卷首次启动顺序**:Postgres 扩展 init → app goose 迁移。已建数据卷不受挂载变更影响(init 脚本仅在空卷执行)。
|
||||
- **宿主卷权限**:`data/*` 须对 uid 10001 可写;部署窗口先冒烟 `/health` + 一次写 data。
|
||||
- I6(systemd 备份)不在本批;cap_drop ALL 列为后续可选。
|
||||
@@ -0,0 +1,73 @@
|
||||
---
|
||||
title: "P8: U9–U12 剩余键逐键放量"
|
||||
task_id: u9u12-keys-rollout-2026-09-25
|
||||
status: in_progress
|
||||
created: 2026-09-25
|
||||
updated: 2026-09-25
|
||||
owner: cursor-auto
|
||||
task_type: implementation
|
||||
task_tier: small
|
||||
policy_revision: "agent-governance-2026-09-21-r1"
|
||||
branch: feature/u9u12-keys-rollout-2026-09-25
|
||||
worktree: .worktrees/u9u12-keys-rollout-2026-09-25
|
||||
base_dev_sha: "9f7bbc25a05853aceecad4c60233fa8d38a8990a"
|
||||
write_scope:
|
||||
- internal/app/
|
||||
- internal/app/intentflow/
|
||||
- internal/config/
|
||||
- .doc/ops/short-term/
|
||||
- .doc/test-reports/
|
||||
allowed_environments: []
|
||||
head_sha: ""
|
||||
mutex: intent-plan
|
||||
review_state: pending
|
||||
integration_state: pending
|
||||
deployment: not_required
|
||||
cleanup: pending
|
||||
cleanup_owner: independent maintainer after owner exit
|
||||
cleanup_trigger: acceptance green + optional owner exit
|
||||
remote_sync: not_requested
|
||||
---
|
||||
|
||||
# P8: U9–U12 剩余键逐键放量
|
||||
|
||||
## 用户目标与授权
|
||||
|
||||
- 用户目标:`/goal 把这些任务都进行规划,并推进至完成` → 总控 [P8 批次](./2026-09-25-planned-tasks-closeout-plan.md)。
|
||||
- 来源:MATRIX `intent-plan-u9u12` 行尾注「未开放:`document.review.approve/reject`、`document.final.*`、`document.proposal.decide`、`workflow.switch`、`run.restart`(validated_only)」。
|
||||
- 交付终点:逐键独立 flag + 真实引擎路由 + 单测验收 + 真实 dev PI 证据;**禁 full 一次放量**。
|
||||
|
||||
## 实施内容
|
||||
|
||||
1. **逐键 flag**(`intentflow/flags.go`):`U11LiveReview`、`U11LiveFinal`、`U11LiveProposal`、`U12LiveSwitch`、`U12LiveRestart`(env `MULTI_INTENT_U11_LIVE_REVIEW` 等,默认全 OFF)。域名总 flag 开启后细粒度键仍须单独打开。
|
||||
2. **live 集合函数化**(`intentflow/expansion.go`):`DocGovLiveActionKeys()`/`RunControlLiveActionKeys()` 按当前 flag 动态返回;基线键(claim/review.submit、workflow.run/run.resume)不受影响。新增 `IsDocGovLiveKey`/`IsRunControlLiveKey` 判定。
|
||||
3. **DocGovOwner 路由扩展**(`app/docgov_owner.go`):
|
||||
- `document.review.approve` → `ReviewApprove`(RoleReviewer)
|
||||
- `document.review.reject` → `ReviewReject`(RoleReviewer,reason 走 slots)
|
||||
- `document.final.approve` → `ApproverApprove`(RoleApprover)
|
||||
- `document.final.reject` → `ApproverReject`(RoleApprover,rollback→drafting)
|
||||
- `document.proposal.decide` → `DecideModificationProposal`(proposal_id/approve slots;收据走 `commitReceipt`)
|
||||
4. **RunControlOwner 路由扩展**(`app/run_control_owner.go`):
|
||||
- `workflow.switch` → `ActivateWorkflow`(workflow_key slot 必填校验)
|
||||
- `run.restart` → `CreateAndStart`(全新 run,不续 workspace,幂等键防重)
|
||||
5. **policy 表**(`intentflow/policy.go`):7 个新键从 `TierFull` 提到 `TierConfirm`(confirm 档进计划;真实执行仍受 per-key flag 限制)。
|
||||
6. **验收单测**(`app/live_keys_rollout_test.go`):默认 OFF 不入 live、逐键 flag 独立、review.approve 真实状态推进(reviewing→approving)+ 幂等重放、flag OFF 时 dry-run 零状态推进。
|
||||
|
||||
## 非目标
|
||||
|
||||
- 不改 tier 默认(仍 legacy);compose 不动。
|
||||
- `run.resume` 已 live 无需动。
|
||||
- 真实 dev 逐键 PI 证据:flag 打开后另行采集(见测试报告)。
|
||||
|
||||
## 验证与证据
|
||||
|
||||
| 范围 | 命令 | 结果 |
|
||||
|---|---|---|
|
||||
| P8 新用例 | `go test -short -run 'TestP8' ./internal/app/` | PASS |
|
||||
| app/intent/coordinator 全量 | `go test -short ./internal/app/... ./internal/intent/... ./internal/coordinator/...` | PASS(13 包) |
|
||||
| 架构门禁 | `./scripts/arch-check.sh --mode block` | PASS |
|
||||
|
||||
## 收口与交接
|
||||
|
||||
- 详见测试报告:[2026-09-25-p8-u9u12-keys-rollout-test-report.md](../../test-reports/2026-09-25-p8-u9u12-keys-rollout-test-report.md)
|
||||
- 后续:dev 运维按键打开 flag(`configs/.env.dev`),采集真实 PI 证据后更新 MATRIX 行尾注。
|
||||
@@ -1,19 +1,20 @@
|
||||
# FEATURE-MATRIX 行模板
|
||||
|
||||
复制到 [FEATURE-MATRIX.md](../../status/FEATURE-MATRIX.md) 的完成度表中。能力状态与 `production_ready`(gap-matrix)正交。
|
||||
复制到 [FEATURE-MATRIX.md](../../status/FEATURE-MATRIX.md) 的完成度表中。能力状态与 `production_ready`(gap-matrix)正交。`record_id` 必须在**第一列**(docs apply 校验)。
|
||||
|
||||
| 字段 | 填写说明 |
|
||||
|------|----------|
|
||||
| record_id | 稳定 kebab-case slug;不随批次改名 |
|
||||
| 模块 | 短名 |
|
||||
| 声明范围 | 本行冻结边界;`done` 只覆盖此范围 |
|
||||
| 状态 | `done` \| `partial` \| `planned` \| `deferred` \| `blocked` |
|
||||
| 状态 | `done` \| `partial` \| `planned` \| `deferred` \| `blocked` \| `removed` |
|
||||
| 发布关系 | `non_blocker` / `补证` / `加固` / `deferred_enhancement` |
|
||||
| 证据 | 设计/代码/test-report 链接;可追 commit/环境/schema |
|
||||
| 剩余工作 / 关闭条件 | partial/planned 必填;stub/SKIP/fallback 不得冒充关闭 |
|
||||
| mutex | 与 CURRENT 并行认领一致 |
|
||||
|
||||
```markdown
|
||||
| <模块名> | <声明范围> | planned | non_blocker | (设计/代码/test-report 链接) | (关闭条件) | `<mutex>` |
|
||||
| <record_id> | <模块名> | <声明范围> | planned | non_blocker | (设计/代码/test-report 链接) | (关闭条件) | `<mutex>` |
|
||||
```
|
||||
|
||||
拆行收口时另在「边界 lineage」区记录 before/after、义务去向与证据覆盖结论。
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# Subagent 派发与阶段记录模板
|
||||
|
||||
用途:配合[协作规范草案](../2026-09-24-subagent-workflow-standard.md),复制适用段落到已有任务/报告;本模板尚未作为强制门禁启用。
|
||||
|
||||
## 派发包
|
||||
|
||||
- parent_task_id / subtask_id / stage_id / role_id:
|
||||
- [模型配置](../2026-09-24-subagent-model-config.md)路径 / config_revision / config_sha256:
|
||||
- 解析后的 provider / model / enabled / upgrade_role;本任务 override、用户来源与期限:
|
||||
- 目标、非目标、授权来源和交付终点:
|
||||
- 输入:R-ID / AC-ID / 方案版本 / base_sha / head_sha:
|
||||
- 必读规则:AGENTS、policy_revision、适用专门规范:
|
||||
- cwd / branch / allowed_paths / allowed_environments:
|
||||
- 只读或写入;mutex / agentctl supervisor 或主 Agent 应用补丁方式:
|
||||
- 前置产物 / 完成条件 / 输出位置:
|
||||
- 时间或步骤预算、回传点、异常处理:
|
||||
|
||||
## 子任务回传
|
||||
|
||||
- PI run_id / producer / 开始结束时间:
|
||||
- configured_model / actual_model(不可观察填 unknown):
|
||||
- 实际输入版本、实际 cwd:
|
||||
- run_status:running | succeeded | failed | cancelled | unknown
|
||||
- verdict:pass | changes_required | blocked | not_applicable
|
||||
- 结论及依据:
|
||||
- 变更文件 / commit / 未提交内容:
|
||||
- 真实命令 / 环境 / 退出码 / 证据链接 / 脱敏范围:
|
||||
- 已查范围、未覆盖项、风险:
|
||||
- 存活进程、外部副作用、未归档产物、接管建议:
|
||||
|
||||
## 阶段收据
|
||||
|
||||
| 阶段 | 输入版本 | 产物/证据 | producer | reviewer/独立性 | 决定与理由 | 接收者/下一步 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| S0–S9 中适用阶段 | | | | independent / self_review / not_required | pass / changes_required / blocked / not_applicable | |
|
||||
|
||||
只读子 Agent 的结论由主 Agent 转存时保留 agent_id 与原结论,注明转存者。未执行阶段记录原因;报告存在不自动满足门禁。
|
||||
|
||||
## 需求追踪与验收
|
||||
|
||||
| R-ID | AC-ID / 可观察标准 | 改动位置/版本 | 审查记录 | T-ID / 实际结果 | 运行验收证据 | acceptance_owner / 结论 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| | | | | | | |
|
||||
|
||||
## 收口字段
|
||||
|
||||
沿用[任务模板](short-term-task.md)的 status、review_state、integration_state、deployment、cleanup、remote_sync,追加 phase、acceptance、待回收 subtask_id。记录失败和重试关系;声明 PASS 需有实际证据。
|
||||
@@ -75,7 +75,7 @@
|
||||
| DOCREV-QUALITY-SELF-POLLUTE | 自检表引用禁词致 score=40 quality_failed;auto_repair 未启用;UI 映射 completed | **PASS** | [audit](../audit/2026-09-13-document-revision-quality-gate-self-pollution.md);Round20 UI-03 完成 | 不删证据;不删禁词 |
|
||||
| DOCREV-ACTIVE-DOC-ROUTING | UI-05「当前受控文档」被法规关键词改路由到 `feasibility_reg`,intake 无 pending | **PASS** | [audit](../audit/2026-09-13-document-revision-active-doc-routing.md);Round20 UI-05 pending 停在 intake V2 | **不改弱 E2E**;不删证据 |
|
||||
| DOCREV-QUALITY-STATUS-FP | 行动计划表状态列「待续」被门禁当敷衍,两轮 repair 后 quality_failed 80 | **PASS** | [audit](../audit/2026-09-13-document-revision-quality-status-false-positive.md);Round20 UI-03 | **不删禁词、不放宽正文**;不删证据 |
|
||||
| GOVERNANCE-ACTION-AUTHZ | 文档动作按职责鉴权;未激活 202-blocked;关闭创建直通 | **PASS** | [test-report](../test-reports/2026-09-14-governance-action-level-authz-test-report.md);[audit 异态](../audit/2026-09-14-planning-with-workflow-key-anomaly.md) | 不改 83 条 planning+key 夹具;none 长 PI 审批链另开 |
|
||||
| GOVERNANCE-ACTION-AUTHZ | 文档动作按职责鉴权;未激活 202-blocked;关闭实例直通 | **PASS** | [test-report](../test-reports/2026-09-14-governance-action-level-authz-test-report.md);[audit 异态](../audit/2026-09-14-planning-with-workflow-key-anomaly.md);[2026-09-24 deny_only_submit](../test-reports/2026-09-24-non-author-member-access-test-report.md) | 不改 83 条 planning+key 夹具;**after 2026-09-24**:run/edit 成员级,submit/review/approve 仍职责门禁 |
|
||||
| DOC-RELIABILITY-PILOT | 受控文档写路径与 PG 事件交付尚未形成生产闭环;闭包副作用在崩溃/重启后不可重试审计,错误 scope 或 projection 缺失仍可能导致刷新失败 | **PASS** | [初审](../audit/2026-09-14-module-decoupling-plan-review.md);[Phase 1](./2026-09-14-module-decoupling-refactor-plan.md);[Phase 2 复核](../audit/2026-09-15-module-decoupling-phase2-plan-review.md);[Phase 2 修订](./2026-09-15-module-decoupling-ipc-phase2-remediation-plan.md);[U11–U12 报告](../test-reports/2026-09-15-app-composition-u11-u12-test-report.md);[E1A](../test-reports/2026-09-15-event-e1a-notify-cutover-test-report.md);[E1B](../test-reports/2026-09-15-event-e1b-workflow-advance-test-report.md);[E1C](../test-reports/2026-09-15-event-e1c-projection-test-report.md);[E2](../test-reports/2026-09-15-event-e2-hook-guard-test-report.md);[复盘](../ops/research/2026-09-15-track-e-retrospective.md);[notify live](../test-reports/2026-09-15-event-notify-shared-live-test-report.md);[advance live](../test-reports/2026-09-15-event-workflow-advance-shared-live-test-report.md);[projection live](../test-reports/2026-09-15-event-projection-shared-live-test-report.md) | 共享 notify/workflow_advance/projection 已 live;生产不再注册 `OnOutbox=` / `AddOnApprovedHook(`。FAV 仍 off。HTTP/PI 实施不纳入本行。项目 143 只读 |
|
||||
|
||||
---
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 模块与功能完成度(SSOT)
|
||||
|
||||
**更新**: 2026-09-20(模块开发规范与耦合审计已合入文档;批次 A–G 仍为 planned,不改 `production_ready`)
|
||||
**更新**: 2026-09-23(批次 A–G 伞行 `module-batches-ag` 已 `done`;不改 `production_ready`)
|
||||
**production_ready**: yes(权威来源:[gap-matrix](../remediation/gap-matrix.md);本表不推导发布门禁)
|
||||
**发布缺口**: [../remediation/gap-matrix.md](../remediation/gap-matrix.md)
|
||||
**协作焦点**: [../ops/CURRENT.md](../ops/CURRENT.md)
|
||||
@@ -47,35 +47,38 @@
|
||||
|
||||
## 完成度矩阵
|
||||
|
||||
| 模块 | 声明范围 | 状态 | 发布关系 | 证据 | 剩余工作 / 关闭条件 | mutex |
|
||||
|------|----------|------|----------|------|---------------------|-------|
|
||||
| Agent worktree 治理自动化 | 主目录保护、任务 worktree、机器认领、候选集成、dev 部署与安全清理 | partial | non_blocker | [方案](../remediation/2026-09-21-agent-workflow-governance-plan.md);[L1 验收](../test-reports/2026-09-21-agent-governance-test-report.md) | 本机 .locks/短租约、共享文档 CAS、提交/候选/环境门禁及安全 helper 已验;主仓 7e9317b8 已启用 init/hooks,拒绝无租约 env 操作。后台调度、完整业务部署恢复闭环、产品 PI 镜像交付、OS/跨机隔离与清理可见性仍待[后续](../ops/long-term/2026-09-21-agent-workflow-governance-automation.md) | `agent-workflow-governance` |
|
||||
| 意图识别 L1 | 18 类 Intent、三分支消解、写/只读分流、双标签 `DOC_BUSY`、intent 纯依赖边界 | done | non_blocker | [intent-recognition](../system-design/intent-recognition/);[工作流作用域](../test-reports/2026-09-21-intent-workflow-scoping-test-report.md);[审计](../audit/2026-09-13-conversation-intent-runtime-state.md);[报告](../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md);[双标签](../test-reports/assets/2026-09-15-conversation-intent-dual-tab/live.json);[U1](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md)–[U3](../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md) | **边界 before**:含 U9–U12 叙事混入 → **after**:U9–U12 迁至「多意图扩面」行。关闭:纯依赖边界回归即重开 | `intent` |
|
||||
| 多意图持久计划(U1–U8 基线) | app/intentflow 生命周期、HITL、默认 `legacy`、U1–U8 代码与安全基线 | partial | non_blocker(默认 legacy) | [设计](../system-design/2026-09-15-multi-intent-hitl-plan.md);[U1](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md)–[U8](../test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md);[Wave2 真 PI](../test-reports/2026-09-16-wave2-real-pi-evidence-test-report.md);[2026-09-20 复核](../ops/research/2026-09-20-capability-enablement-impact-research.md) | legacy 有限只读多意图仍默认启用;新持久计划生产组合根仍使用 Fake query owner,confirm 后缺可靠调度,typed 参数/目标版本不足。原 U1–U8 测试证据保留,但不足以证明升 `auto_read/confirm` 可用。关闭条件见[整改方案](../remediation/2026-09-20-capability-enablement-impact-plan.md) Foundation 1 与 Track I | `intent-plan` |
|
||||
| 多意图扩面(U9–U12) | U9 LLM 分段实验;U10 mutate;U11 docgov;U12 workflow/run-control | partial | deferred_enhancement | [设计](../system-design/2026-09-15-multi-intent-hitl-plan.md);[go/no-go GO](../ops/research/2026-09-16-wave3-pu6-pu8-go-no-go.md);[脚手架](../test-reports/2026-09-16-pu8-u9-u12-flags-test-report.md);[U9](../test-reports/2026-09-17-w4-u9-segment-test-report.md);[U10](../test-reports/2026-09-17-w4-u10-mutate-test-report.md);[U11](../test-reports/2026-09-17-w4-u11-docgov-test-report.md);[U12](../test-reports/2026-09-17-w4-u12-run-control-test-report.md);[2026-09-20 复核](../ops/research/2026-09-20-capability-enablement-impact-research.md) | U9 proposer 已实现和注入但未进入生产聊天分段调用;提议请求已带 reasoning profile。U10–U12 当前为 dry-run/validated-only adapter。历史直接调用/PI 测试继续有效,不代表 live 接线。逐域实现和验收,禁止以 `full` 一次放量 | `intent-plan` |
|
||||
| 对话 / ctxmgr baseline | 多轮上下文、刷新/重登/重启恢复、授权同集正文与计数、U10 端口化停止扩面 | done | non_blocker | [multi-turn](../system-design/multi-turn-dialogue/);[刷新审计](../audit/2026-09-13-chat-history-refresh-disappears.md);[U10](../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md);[门禁 B3](../test-reports/2026-09-16-chat-refresh-gate-test-report.md)(项目 6359) | **before**:语义摘要误标 D5 混入 → **after**:摘要迁「语义摘要 D3」;D7 数据治理独立。U10 停止扩面 | `chat` |
|
||||
| 语义摘要(D3) | 授权后可见集合上的语义摘要;shadow → 可选替换 deterministic | partial | deferred_enhancement | [chat-agent-p6-backlog](../backlog/chat-agent-p6-backlog.md);[go/no-go GO](../ops/research/2026-09-16-wave3-pu6-pu8-go-no-go.md);[pu6](../ops/long-term/2026-09-16-pu6-semantic-summary-contract.md);[脚手架](../test-reports/2026-09-16-pu6-semantic-summary-test-report.md);[W2 真 PI](../test-reports/2026-09-17-w2-semantic-summary-shadow-test-report.md);[2026-09-20 复核](../ops/research/2026-09-20-capability-enablement-impact-research.md) | shadow 默认 off。`00058` 增加 `chat_summaries`,写入失败不再伪装成功;运行中的库仍是 schema 53。摘要请求已带 `tool_profile=reasoning`(argv 为 `--no-tools`),当前容器要等镜像或 dev 挂载更新后才生效。授权可见集 digest 仍空。`SEMANTIC_SUMMARY_REPLACE` 未接线。 | `chat` |
|
||||
| 对话数据治理(D7) | 留存/删除口径、库·备份·日志控制、敏感字段加密边界 | deferred | deferred_enhancement(违规则升 blocker) | [计划](../remediation/2026-09-16-feature-matrix-production-readiness-plan.md) Scope Boundaries;[收口 §7.1](../remediation/2026-09-16-partial-deferred-completion-plan.md);[D7 ADR 草案](../adr/2026-09-17-d7-chat-data-retention.md);[W7 盘点](../audit/2026-09-17-d7-data-inventory.md);[报告](../test-reports/2026-09-17-w7-d7-inventory-test-report.md);[D7-TRACE](../remediation/gap-matrix.md) | **after W7**:只读盘点完成(sessions/messages/KB/日志/备份/event)。**未发现**已确认基线违规,未写发布 blocker。口径仍 `pending-compliance-signoff`;禁止按 365/180/30 物理删除。追踪索引另定为 `record`([设计 §9](../system-design/2026-09-20-stage-backtrack-and-impact-loop-design.md)),不把本行升 done | `chat` |
|
||||
| 智能体小队 | 角色-任务-工作区-黑板 | done | non_blocker | [agent-squad](../system-design/agent-squad/);[test 2026-09-07](../test-reports/2026-09-07-dynamic-squad-planning-test-report.md) | 非关键步骤降级(A5/A6)属 backlog | `squad` |
|
||||
| 工作流治理 | 三正式工作流、设置页/DutyMode、动作级鉴权、真实 PI 三工作流 E2E、full/none 混合长链 | done | non_blocker | [三工作流整改](../remediation/2026-09-12-three-workflows-strict-governance-remediation.md);[409/职责](../test-reports/2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md);[鉴权](../test-reports/2026-09-14-governance-action-level-authz-test-report.md);[PI E2E](../test-reports/2026-09-16-pi-three-workflow-e2e-test-report.md);[Wave2 full/none](../test-reports/2026-09-16-wave2-real-pi-evidence-test-report.md) | full 跨用户审批 + none 免审批不阻塞已签。纯软件自举仍独立 planned | `workflow` |
|
||||
| 研发设计控制(rdev) | 医疗第 4 工作流:13×60 manifest/模板、`squad.rdev_doc.v1` kind 编排、main-completed 硬 precheck、StageKey 动态化;不含前端/真 PI/键名空间化 | partial | deferred_enhancement | [设计](../system-design/project-workflow/07-研发工作流rdev接入-设计与实施计划.md);[short-term](../archive/ops/2026-09-17-rdev-workflow-integration.md);[模板深度](../archive/ops/2026-09-17-rdev-template-depth.md);[S0+S1 首批报告](../test-reports/2026-09-17-rdev-template-depth-test-report.md);[S1 续批报告](../test-reports/2026-09-17-rdev-template-depth-s1-continued-test-report.md);[写作规范](../system-design/project-workflow/08-rdev模板写作规范.md);[backlog](../backlog/2026-09-17-rdev-phase2-backlog.md) | **P0+P1 done**。**模板深度 S0+S1 首批 + S1 续批 done**:60/60 模板已补强;真 PI 抽样 PASS(含 `rd_planning_review` + `rd_design_vv`,项目 6446)。剩余:S3 overlay 与 R2/R3 已接。P2 名称匹配、阶段折叠、批量审批已接。选中 rdev 时显示与服务端相同的 CDO 前置说明(`workflowPrerequisite.test.ts`)。P4 键名空间化已接:发布清单用 `bd_`/`pm_`/`tm_`/`sw_`,旧键仍走同一套步骤和模板,旧 doc_id 仍可查(`keyspace_test.go`)。P3 三样本已在 dev 真 PI 上跑过(项目 6533):`rd_sw_plan` 规划期关闭;`rd_proposal` completed 但未对齐模板标题;`rd_planning_review` 当时质量门禁 score 20,是把同节后一张法规表算进问题行。门禁已只读第一张表;保存的终稿不再报「问题行缺少」。建议书标题仍未对齐模板。没有新的真 PI。见 [P3 报告](../test-reports/2026-09-19-rdev-p3-real-pi-test-report.md)。nightly 未扩成四工作流。 | `workflow-def` / `rdev-templates` |
|
||||
| 纯软件项目自举 | 软件项目创建、Bootstrap、Delivery、受控工程交接 | partial | deferred_enhancement(明确不挡首发) | [设计](../system-design/2026-09-14-software-project-bootstrap-workflow.md);[ADR](../adr/2026-09-16-software-project-bootstrap-keys.md);[L1 报告](../test-reports/2026-09-16-software-project-bootstrap-test-report.md);[W5a](../test-reports/2026-09-17-w5a-software-bootstrap-ui-pi-test-report.md) | **before**:L1 + UI 仍克隆医疗模板。**after W5a**:catalog 驱动创建、软件不挂医疗 key、docs_only 真 PI 建议 delivery 且不自动激活。**SWBOOT-10 仍 stub**(W5b);本行不升 done | `workflow-design` |
|
||||
| IAM / 鉴权 | 项目级 API 鉴权 + RBAC;会话/阶段授权 | done | 加固 | [v3 full inventory](../audit/authorization-matrix-v3-full.md);[session 中断](../test-reports/2026-09-16-iam-route-inventory-test-report.md);[fail-closed](../test-reports/2026-09-16-wave1-iam-fail-closed-test-report.md);[410 策略](../audit/2026-09-16-bug11-410-retire-decision.md);[R13](../audit/2026-09-16-r13-data-safety-checklist.md) | 全路由 inventory + session 中断负例 + 410 冻结 + R13 基线已签 | `authz` |
|
||||
| 文档治理 | 法定文档生命周期 + 租约 + 受控正文读取 | done | non_blocker | [docgov](../test-reports/2026-09-08-docgov-lifecycle-and-claiming-framework-test-report.md);[正文 UI](../test-reports/2026-09-14-controlled-content-ui-acceptance.md);[canonical hash](../remediation/2026-09-14-controlled-content-canonical-hash-remediation.md);[键统一](../test-reports/2026-09-21-workflow-doc-key-unification-test-report.md) | 项目 143 只读;不终止。`doc_proj*` 同一发布键不能再并存 | `docgov` |
|
||||
| 文档版本 baseline | 账本、人工修订、确定性 diff+lineage、运行时 UI、负责人通知 | done | non_blocker | [管理](../test-reports/2026-09-13-document-revision-management-test-report.md);[Round20 UI](../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md);[ADR](../adr/2026-09-13-document-version-boundary.md);[proposed/authoritative](../ops/short-term/2026-09-20-proposed-authoritative-reports.md) | **before**:完整 PI narrative 混入 → **after**:迁「PI change-report 叙事」。fallback 报告是本行内显式行为,不是缺口。lineage GET 已按 URL 项目和文档可见性裁剪。test_manager 血缘的下游/上游版本改读文档版本,不再写死 1。Agent 候选报告为 `proposed`,正式提交才写 authoritative 后继并挂到版本;拒绝、替代后旧报告不能再出建议。人工修订、导入和聊天卡仍未分开预估与正式报告,见 [T1](../ops/short-term/2026-09-20-impact-loop-t1.md)。项目追踪索引见下一行 | `docgov` |
|
||||
| 阶段回溯与影响闭环 | 五表追踪索引、影响报告、L1 文档修订、L2 阶段再打开、待复核软标记、对话修订提案 | done | deferred_enhancement(不挡首发) | [设计](../system-design/2026-09-20-stage-backtrack-and-impact-loop-design.md);[Track T](../remediation/2026-09-20-capability-enablement-impact-plan.md);[对话化报告](../test-reports/2026-09-21-trace-panel-to-chat-test-report.md) | 已合入 dev。常驻「需求与影响」面板已退役,新待复核与下游影响改走已有项目会话。dev schema 59。test/main 未升。阶段推进确认门禁仍在。不签 D7 对话 ADR,不改 `production_ready` | `trace-index` |
|
||||
| PI change-report 叙事 | 只读消费 diff+lineage 的 PI 叙事;失败全量降级 fallback | partial | deferred_enhancement | [Round20](../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md);[go/no-go GO](../ops/research/2026-09-16-wave3-pu6-pu8-go-no-go.md);[pu7](../ops/long-term/2026-09-16-pu7-pi-narrative-contract.md);[脚手架](../test-reports/2026-09-16-pu7-pi-narrative-test-report.md);[W3 真 PI](../test-reports/2026-09-17-w3-pi-change-report-narrative-test-report.md);[2026-09-20 复核](../ops/research/2026-09-20-capability-enablement-impact-research.md);[最小化输入](../ops/short-term/2026-09-20-pi-narrative-clipped-diff.md) | flag 默认 off。`facts.json` 含截断后的 hunk 前后文和影响说明,以及完整 hunk/impact 计数与省略数;摘要 digest 仍不含正文。叙事请求已带 `tool_profile=reasoning`。运行中的 runner 尚未切到 `--no-tools`。不打开开关 | `docgov` |
|
||||
| 前端工作台 | 三栏 + 块文档 + SSE;错误卡/`TaskRunCard` 竖向进度/busy;版本冲突信封;demo seed 默认关;终止 preview | done | non_blocker | [workbench](../test-reports/2026-09-08-three-column-workbench-and-block-document-test-report.md);[双标签](../test-reports/assets/2026-09-15-conversation-intent-dual-tab/screenshots/tab-b-busy.png);[demo](../test-reports/2026-09-16-demo-seed-pollution-test-report.md);[B4](../test-reports/2026-09-16-frontend-gate-b4-test-report.md)(项目 6363);[TaskRunCard](../test-reports/2026-09-21-taskrun-status-card-persistence-test-report.md) | **before**:空「缺口」却 partial → **after**:本行 done。其他 409 消费方信封复用另列 hardening backlog | `web` |
|
||||
| PI Runner / 配置链 | pi-agent + MiniMax + typed-result-v1 | done | non_blocker | [piagent](../test-reports/2026-09-13-codex-audit-p0-remediation-test-report.md);[container-env](../test-reports/2026-09-13-container-env-configuration-test-report.md);[typed-result](../test-reports/2026-09-15-pi-typed-result-v1-test-report.md) | 文档生成仍使用读写和搜索工具。`tool_profile=reasoning` 的 argv 是 `--no-tools` 且不加载搜索扩展;未知 profile 拒绝启动。dev 挂载了 `pi-args.mjs`,但本轮未重启容器 | `pi-agent` |
|
||||
| 三环境运维 | dev/test/main + 共享 KB;对话/业务库隔离 | done | non_blocker | [PROJECT.md](../../PROJECT.md) §4;CURRENT 环境快照 dev/test schema **48**、main **47** | — | `infra` |
|
||||
| CI / E2E | PR CI、PG 集成、治理 PG、已签真实 PI 门禁;**nightly** schedule/`workflow_dispatch` + infra/product 分类 receipt | done | 加固(阻止**下一次**晋升,不自动否定已发布) | [BUG-08](../test-reports/2026-09-16-ci-governance-pg-bug08-test-report.md);[PI 三工作流](../test-reports/2026-09-16-pi-three-workflow-e2e-test-report.md);[Wave2B](../test-reports/2026-09-16-wave2b-nightly-promotion-receipt-test-report.md);[Wave2C](../test-reports/2026-09-16-wave2c-same-image-digest-test-report.md);[W1 green](../test-reports/2026-09-17-w1-ci-e2e-green-nightly-test-report.md) + [receipt `6e2476f0…`](../assets/promotion-receipts/6e2476f0f2e408e111fe06ca7c31a38294a340b3.json) | **before**:partial(FullNone product_fail / secrets 文案过时)→ **after**:secrets 已配;duplicate goose 00048 已清;FullNone+U8 nightly `verdict=pass` | `ci` |
|
||||
| Artifact 同 digest 晋升 | 候选 commit 一次构建、按 digest 晋升、promotion receipt | done | 加固 | [计划 PU5B](../remediation/2026-09-16-feature-matrix-production-readiness-plan.md);[Wave2B](../test-reports/2026-09-16-wave2b-nightly-promotion-receipt-test-report.md);[Wave2C](../test-reports/2026-09-16-wave2c-same-image-digest-test-report.md) | **关闭**:same-image pin(`candidate-images-*` + `PINNED_IMAGE_MODE` + promote `--require-digests`)。**声明**:单机 retag/digest pin;远程 registry 推送另立任务 | `infra` |
|
||||
| 可靠事件核心 | PG dispatcher、notify/advance/projection live、生产闭包 hook 退出、Phase2 选择性解耦已合入 | done | non_blocker | [E0A–E2](../test-reports/2026-09-15-event-e0a-production-scope-contract-test-report.md) 等;[复盘](../ops/research/2026-09-15-track-e-retrospective.md);[shared live](../test-reports/2026-09-15-event-notify-shared-live-test-report.md);[phase2 closeout](../test-reports/2026-09-15-phase2-closeout-test-report.md) | **before**:与 FAV off 混成 partial → **after**:FAV 独立行。选择性后续解耦按收益触发 | `architecture-docs` / `events` |
|
||||
| 模块开发规范 | 窄端口、领域事件、wire DTO 三种契约;故障隔离红线;新增模块/表/事件流程。不含批次 A–G 的代码整改 | done | non_blocker | [规范](../system-design/2026-09-20-module-development-standards.md);[审计](../audit/2026-09-20-module-coupling-audit.md);[ADR](../adr/2026-09-14-modular-monolith-decoupling.md) | 文档入口已立。代码整改不在本行 | `module-decoupling-spec` |
|
||||
| 模块解耦批次 A–G | server 端口装配、chat 解环、docgov 词汇、工作流单向依赖、巨型文件、前端 api client、21 条例外清零 | planned | non_blocker | [分批计划](../remediation/2026-09-20-module-decoupling-batch-plan.md);[审计](../audit/2026-09-20-module-coupling-audit.md) | 各批独立 short-term 与验收后另拆行升 `done`。G1 例外 2026-09-28 到期,到期前须迁走或书面延期。禁止把本行标成进行中来代表七批都已开工 | `module-decoupling-spec` |
|
||||
| Final Artifact Vault(FAV) | 不可变终态制品库;`FAV_DEGRADED_READ=false` | partial | deferred_enhancement | [Track E 复盘](../ops/research/2026-09-15-track-e-retrospective.md);[U7 报告](../test-reports/2026-09-16-fav-u7-incremental-test-report.md);[W6 shadow](../test-reports/2026-09-17-w6-fav-subscriber-shadow-test-report.md);[short-term](../ops/short-term/2026-09-17-w6-fav-subscriber-shadow.md) | **after W6**:subscriber `ObserveShadow` 只计算 intended outcome,不写副作用。仍**禁止**整支 merge;`FAV_DEGRADED_READ` 默认 false;**live 未放量**(staging→artifact→publication 各 ≥7 天观察窗) | `events` |
|
||||
| 系统管理台 | 全屏系统级管理视图(总览/KB/特性开关/系统设置/工作流/角色/用户/文档 8 分组);`/api/v1/admin/system/*`;`system_settings` 白名单可写;吸收下线 AdminSettingsModal | done | non_blocker | [short-term](../ops/short-term/2026-09-17-system-admin-console.md);[测试报告](../test-reports/2026-09-17-system-admin-console-test-report.md);commit `f1404d5`/`0eaca61`、merge `dc7c31e`(dev);dev 冒烟 schema 49 + 四端点 + 写读回环 PASS | 二期:Playwright 实跑、细粒度 `system:*` 权限、设置审计日志、KB 运维动作、白名单项接消费方 | `web` + `sysadmin` |
|
||||
| 个人工程中控台(已移出) | 原本地只读看板与后来的 Control Center 都不再属于本仓库 | removed | 进度管理改由独立项目承担 | [历史设计](../archive/design/2026-09-17-personal-engineering-control-center-plan.md);[历史报告](../test-reports/2026-09-17-engineering-dashboard-test-report.md) | 2026-09-19 删除 `cmd/control-center`、`internal/controlcenter`、`control-center/web`、`deploy/control-center`。不恢复 `engineering-dashboard` | — |
|
||||
| record_id | 模块 | 声明范围 | 状态 | 发布关系 | 证据 | 剩余工作 / 关闭条件 | mutex |
|
||||
|------|----------|------|----------|------|---------------------|-------|-------|
|
||||
| dialogue-ctx-injection | 对话上下文注入 | 项目成员对话清洗分层注入小队 workspace 与助手 Prompt;冲突裁决+HITL 分级路由;默认 on 紧急可关 | partial | deferred_enhancement | [设计](../system-design/2026-09-25-dialogue-context-injection-design.md);[报告](../test-reports/2026-09-25-dialogue-context-injection-test-report.md);[短文](../ops/short-term/2026-09-25-dialogue-context-injection.md) | 关闭条件:dev 迁移 goose 00071 + 真实 PI 落盘核验 + 冲突确认卡冒烟。本行不升 done | `dialogue-ctx` |
|
||||
| jevdecide-shadow | jev 产品决策 shadow/assist | jevdecide + coordinator realtime/ProfileTask;compose 默认 off;**local_dev 已开 assist**(`configs/.env.dev` → 172.17.0.1:8767);决策层漏检加成已对话验收 | partial | deferred_enhancement | [产品报告](../test-reports/2026-09-24-jev-product-shadow-test-report.md);[shadow 启用](../test-reports/2026-09-24-jev-dev-shadow-enable-test-report.md);[assist 启用+对话](../test-reports/2026-09-24-jev-dev-assist-enable-test-report.md);[assist 短文](../ops/short-term/2026-09-24-jev-dev-assist-enable.md) | 关闭条件:真实轮浸泡≥200 + 体验层检索空结果收敛;intent/risk 另立。本行不升 done | `jevdecide` |
|
||||
| chat-semantic-replace | 语义摘要 REPLACE | 以 shadow 叙事可选替换 served deterministic Narrative(fail-closed 灰度) | deferred | deferred_enhancement | [Wave5 X-2](../ops/short-term/2026-09-18-wave5-deadcode-decisions.md);[pu6](../ops/long-term/2026-09-16-pu6-semantic-summary-contract.md);[summary_flags](../../internal/ctxmgr/summary_flags.go) | 关闭条件:用户独立授权 + fail-closed 灰度设计;`SEMANTIC_SUMMARY_REPLACE` 当前密封不接线。本行不自动升 done | `chat` |
|
||||
| gov-agent-worktree | Agent worktree 治理自动化 | 主目录保护、任务 worktree、机器认领、候选集成、dev 部署与安全清理 | partial | non_blocker | [方案](../remediation/2026-09-21-agent-workflow-governance-plan.md);[L1 验收](../test-reports/2026-09-21-agent-governance-test-report.md);[W1-B macOS](../ops/short-term/2026-09-22-agentctl-macos.md);[W4](../ops/short-term/2026-09-22-governance-automation.md);residual `modular-decouple-residual-2026-09-23` | L1 与 macOS `with/docs apply/validate/integrate` 已合入。W4 landed:durable queue + 完整 docs projection apply(行/整文 CAS)+ deploy/recover 真实收据闭环 + Darwin cwd 可见性测试。仍 deferred:PI 源码镜像 compose、跨机隔离、automation/w4 实现收敛。本行不升 done | `agent-workflow-governance` |
|
||||
| intent-l1 | 意图识别 L1 | 18 类 Intent、三分支消解、写/只读分流、双标签 `DOC_BUSY`、intent 纯依赖边界 | done | non_blocker | [intent-recognition](../system-design/intent-recognition/);[工作流作用域](../test-reports/2026-09-21-intent-workflow-scoping-test-report.md);[审计](../audit/2026-09-13-conversation-intent-runtime-state.md);[报告](../test-reports/2026-09-13-conversation-intent-runtime-state-test-report.md);[双标签](../test-reports/assets/2026-09-15-conversation-intent-dual-tab/live.json);[U1](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md)–[U3](../test-reports/2026-09-15-multi-intent-u3-intentflow-pg-test-report.md) | **边界 before**:含 U9–U12 叙事混入 → **after**:U9–U12 迁至「多意图扩面」行。关闭:纯依赖边界回归即重开 | `intent` |
|
||||
| intent-plan-u1u8 | 多意图持久计划(U1–U8 基线) | app/intentflow 生命周期、HITL、默认 `legacy`、U1–U8 代码与安全基线 | done | non_blocker(默认 legacy) | [设计](../system-design/2026-09-15-multi-intent-hitl-plan.md);[U1](../test-reports/2026-09-15-multi-intent-u1-contracts-test-report.md)–[U8](../test-reports/2026-09-16-multi-intent-u8-task-generate-test-report.md);[Wave2 真 PI](../test-reports/2026-09-16-wave2-real-pi-evidence-test-report.md);[Track I1](../test-reports/2026-09-22-track-i1-query-owner-test-report.md);[I2 放量](../test-reports/2026-09-24-intent-plan-i2-rollout-test-report.md) | **after Track I2**:shadow 持久 validated_only + 项目 allowlist + 指标已合入;dev 已按 allowlist 验收 shadow→auto_read→confirm(项目 6579;确认前零写)。compose 默认仍 `legacy`。U9–U12 见独立行 | `intent-plan` |
|
||||
| intent-plan-u9u12 | 多意图扩面(U9–U12) | U9 LLM 分段实验;U10 mutate;U11 docgov;U12 workflow/run-control | done | deferred_enhancement | [设计](../system-design/2026-09-15-multi-intent-hitl-plan.md);[go/no-go GO](../ops/research/2026-09-16-wave3-pu6-pu8-go-no-go.md);[脚手架](../test-reports/2026-09-16-pu8-u9-u12-flags-test-report.md);[U9](../test-reports/2026-09-17-w4-u9-segment-test-report.md);[U10](../test-reports/2026-09-17-w4-u10-mutate-test-report.md);[U11](../test-reports/2026-09-17-w4-u11-docgov-test-report.md);[U12](../test-reports/2026-09-17-w4-u12-run-control-test-report.md);[2026-09-20 复核](../ops/research/2026-09-20-capability-enablement-impact-research.md);[I3 live](../test-reports/2026-09-24-intent-plan-u9u12-live-test-report.md) | **after Track I3**:U9 已进 `HandleTurn`;live 键=`project.fact.supplement`、`document.claim`/`document.review.submit`、`workflow.run`。未开放:`document.review.approve/reject`、`document.final.*`、`document.proposal.decide`、`workflow.switch`、`run.restart`(validated_only)。tier 停 confirm;compose 默认 legacy;dev 运维可开 U9–U12 flag。禁止 full 一次放量 | `intent-plan` |
|
||||
| chat-ctxmgr | 对话 / ctxmgr baseline | 多轮上下文、刷新/重登/重启恢复、授权同集正文与计数、U10 端口化停止扩面 | done | non_blocker | [multi-turn](../system-design/multi-turn-dialogue/);[刷新审计](../audit/2026-09-13-chat-history-refresh-disappears.md);[U10](../test-reports/2026-09-15-chatlog-contextasm-u10-test-report.md);[门禁 B3](../test-reports/2026-09-16-chat-refresh-gate-test-report.md)(项目 6359) | **before**:语义摘要误标 D5 混入 → **after**:摘要迁「语义摘要 D3」;D7 数据治理独立。U10 停止扩面 | `chat` |
|
||||
| chat-semantic-d3 | 语义摘要(D3) | 授权可见集上 shadow 语义摘要(durable jobs/租约/watermark/provenance);失败保留 deterministic served Narrative;默认 shadow off | done | deferred_enhancement | [chat-agent-p6-backlog](../backlog/chat-agent-p6-backlog.md);[go/no-go GO](../ops/research/2026-09-16-wave3-pu6-pu8-go-no-go.md);[pu6](../ops/long-term/2026-09-16-pu6-semantic-summary-contract.md);[脚手架](../test-reports/2026-09-16-pu6-semantic-summary-test-report.md);[W2 真 PI](../test-reports/2026-09-17-w2-semantic-summary-shadow-test-report.md);[Track S1](../ops/short-term/2026-09-22-track-s1-summary-consolidation.md);[2026-09-23 收口](../test-reports/2026-09-23-chat-semantic-d3-closeout-test-report.md) | **before**:声明含 shadow→可选 REPLACE → **after**:仅 durable shadow;REPLACE 义务迁「语义摘要 REPLACE」行。关闭:tip 重验 + 真 PI PASS(见收口报告)。Wave5 X-2 密封不变 | `chat` |
|
||||
| chat-data-d7 | 对话数据治理(D7) | 留存/删除口径、库·备份·日志控制、敏感字段加密边界 | deferred | deferred_enhancement(违规则升 blocker) | [计划](../remediation/2026-09-16-feature-matrix-production-readiness-plan.md) Scope Boundaries;[D7 ADR 草案](../adr/2026-09-17-d7-chat-data-retention.md);[W7 盘点](../audit/2026-09-17-d7-data-inventory.md);[红线证据](../test-reports/2026-09-22-redline-evidence-d7-test-report.md) | 只读盘点 + Track E ID-only 符合性已补。口径仍 `pending-compliance-signoff`;**禁止物理删除**。本行不升 done | `chat` |
|
||||
| squad | 智能体小队 | 角色-任务-工作区-黑板 | done | non_blocker | [agent-squad](../system-design/agent-squad/);[test 2026-09-07](../test-reports/2026-09-07-dynamic-squad-planning-test-report.md) | 非关键步骤降级(A5/A6)属 backlog | `squad` |
|
||||
| workflow-gov | 工作流治理 | 三正式工作流、设置页/DutyMode、动作级鉴权、真实 PI 三工作流 E2E、full/none 混合长链 | done | non_blocker | [三工作流整改](../remediation/2026-09-12-three-workflows-strict-governance-remediation.md);[409/职责](../test-reports/2026-09-14-workflow-plan-409-frozen-and-optional-duties-test-report.md);[鉴权](../test-reports/2026-09-14-governance-action-level-authz-test-report.md);[PI E2E](../test-reports/2026-09-16-pi-three-workflow-e2e-test-report.md);[Wave2 full/none](../test-reports/2026-09-16-wave2-real-pi-evidence-test-report.md);[deny_only_submit](../test-reports/2026-09-24-non-author-member-access-test-report.md) | full 跨用户审批 + none 免审批不阻塞已签。纯软件自举仍独立 planned **after 2026-09-24 deny_only_submit**:成员可 run/edit/上传/草稿;送审/审核/批准仍职责门禁。[重验](../test-reports/2026-09-24-non-author-member-access-test-report.md) | `workflow` |
|
||||
| workflow-rdev | 研发设计控制(rdev) | 医疗第 4 工作流:13×60 manifest/模板、`squad.rdev_doc.v1` kind 编排、main-completed 硬 precheck、StageKey 动态化;不含前端/真 PI/键名空间化 | partial | deferred_enhancement | [设计](../system-design/project-workflow/07-研发工作流rdev接入-设计与实施计划.md);[收口](../ops/short-term/2026-09-22-rdev-closeout.md);[报告](../test-reports/2026-09-22-rdev-closeout-test-report.md);[P3 历史](../test-reports/2026-09-19-rdev-p3-real-pi-test-report.md) | **after 2026-09-22 收口**:`rd_proposal` 标题门禁 + 法规表首表截止 dry PASS;nightly 脚本已扩四工作流(FullChain×3+FullNone)。P3 真 PI 三样本重跑因缺 `env:dev` **blocked**(不以 stub 冒充)。剩余:获环境后重跑 P3。本行保持 partial | `workflow-def` / `rdev-templates` |
|
||||
| workflow-swboot | 纯软件项目自举 | 软件项目创建、Bootstrap、Delivery、受控工程交接 | partial | deferred_enhancement(明确不挡首发) | [设计](../system-design/2026-09-14-software-project-bootstrap-workflow.md);[ADR](../adr/2026-09-16-software-project-bootstrap-keys.md);[L1 报告](../test-reports/2026-09-16-software-project-bootstrap-test-report.md);[W5a](../test-reports/2026-09-17-w5a-software-bootstrap-ui-pi-test-report.md);[红线证据](../test-reports/2026-09-22-redline-evidence-swboot-test-report.md) | **after W5a + 红线证据**:catalog 驱动创建、软件不挂医疗 key。**SWBOOT-10 仍 stub**(L1–L4 证据已补;L5/L6 待授权)。本行不升 done | `workflow-design` |
|
||||
| iam-authz | IAM / 鉴权 | 项目级 API 鉴权 + RBAC;会话/阶段授权 | done | 加固 | [v3 full inventory](../audit/authorization-matrix-v3-full.md);[session 中断](../test-reports/2026-09-16-iam-route-inventory-test-report.md);[fail-closed](../test-reports/2026-09-16-wave1-iam-fail-closed-test-report.md);[410 策略](../audit/2026-09-16-bug11-410-retire-decision.md);[R13](../audit/2026-09-16-r13-data-safety-checklist.md);[deny_only_submit](../test-reports/2026-09-24-non-author-member-access-test-report.md) | 全路由 inventory + session 中断负例 + 410 冻结 + R13 基线已签 **after 2026-09-24 deny_only_submit**:成员可 run/edit/上传/草稿;送审/审核/批准仍职责门禁。[重验](../test-reports/2026-09-24-non-author-member-access-test-report.md) | `authz` |
|
||||
| docgov | 文档治理 | 法定文档生命周期 + 租约 + 受控正文读取 | done | non_blocker | [docgov](../test-reports/2026-09-08-docgov-lifecycle-and-claiming-framework-test-report.md);[正文 UI](../test-reports/2026-09-14-controlled-content-ui-acceptance.md);[canonical hash](../remediation/2026-09-14-controlled-content-canonical-hash-remediation.md);[键统一](../test-reports/2026-09-21-workflow-doc-key-unification-test-report.md);[deny_only_submit](../test-reports/2026-09-24-non-author-member-access-test-report.md) | 项目 143 只读;不终止。`doc_proj*` 同一发布键不能再并存;[自由协作认领](../test-reports/2026-09-24-free-collab-claim-notify-test-report.md) **after 2026-09-24 deny_only_submit**:成员可 run/edit/上传/草稿;送审/审核/批准仍职责门禁。[重验](../test-reports/2026-09-24-non-author-member-access-test-report.md) | `docgov` |
|
||||
| docgov-revision | 文档版本 baseline | 账本、人工修订、确定性 diff+lineage、运行时 UI、负责人通知 | done | non_blocker | [管理](../test-reports/2026-09-13-document-revision-management-test-report.md);[Round20 UI](../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md);[ADR](../adr/2026-09-13-document-version-boundary.md);[proposed/authoritative](../ops/short-term/2026-09-20-proposed-authoritative-reports.md) | **before**:完整 PI narrative 混入 → **after**:迁「PI change-report 叙事」。fallback 报告是本行内显式行为,不是缺口。lineage GET 已按 URL 项目和文档可见性裁剪。test_manager 血缘的下游/上游版本改读文档版本,不再写死 1。Agent 候选报告为 `proposed`,正式提交才写 authoritative 后继并挂到版本;拒绝、替代后旧报告不能再出建议。人工修订、导入和聊天卡仍未分开预估与正式报告,见 [T1](../ops/short-term/2026-09-20-impact-loop-t1.md)。项目追踪索引见下一行 | `docgov` |
|
||||
| trace-impact | 阶段回溯与影响闭环 | 五表追踪索引、影响报告、L1 文档修订、L2 阶段再打开、待复核软标记、对话修订提案 | done | deferred_enhancement(不挡首发) | [设计](../system-design/2026-09-20-stage-backtrack-and-impact-loop-design.md);[Track T](../remediation/2026-09-20-capability-enablement-impact-plan.md);[对话化报告](../test-reports/2026-09-21-trace-panel-to-chat-test-report.md);[T 补强](../ops/short-term/2026-09-22-track-t-strengthen.md) | 已合入 dev。常驻「需求与影响」面板已退役。**2026-09-23 实测** DOCREV 路径 schema **63**;test=`rc-v1.1.0-beta.1` schema 61;main 本轮未晋升。阶段推进确认门禁仍在。不签 D7 对话 ADR;[补充影响批次](../test-reports/2026-09-24-free-collab-claim-notify-test-report.md)| `trace-index` |
|
||||
| docgov-pi-narrative | PI change-report 叙事 | 只读消费 diff+lineage 的 PI 叙事;失败全量降级 fallback | done | deferred_enhancement | [Round20](../test-reports/2026-09-14-document-revision-runtime-ui-test-report.md);[go/no-go GO](../ops/research/2026-09-16-wave3-pu6-pu8-go-no-go.md);[pu7](../ops/long-term/2026-09-16-pu7-pi-narrative-contract.md);[W3 真 PI](../test-reports/2026-09-17-w3-pi-change-report-narrative-test-report.md);[红线负例](../test-reports/2026-09-22-redline-evidence-pi-narrative-test-report.md);[收口](../test-reports/2026-09-23-pi-narrative-closeout-test-report.md) | **after 2026-09-23 收口**:修复后真实 MiniMax 复测 PASS(截断差异输入 + reasoning 目标落盘);默认 flag **off**;dev/test 常驻开启另授权 | `docgov` |
|
||||
| web-workbench | 前端工作台 | 三栏 + 块文档 + SSE;错误卡/`TaskRunCard` 竖向进度/busy;版本冲突信封;demo seed 默认关;终止 preview | done | non_blocker | [workbench](../test-reports/2026-09-08-three-column-workbench-and-block-document-test-report.md);[双标签](../test-reports/assets/2026-09-15-conversation-intent-dual-tab/screenshots/tab-b-busy.png);[demo](../test-reports/2026-09-16-demo-seed-pollution-test-report.md);[B4](../test-reports/2026-09-16-frontend-gate-b4-test-report.md)(项目 6363);[TaskRunCard](../test-reports/2026-09-21-taskrun-status-card-persistence-test-report.md) | **before**:空「缺口」却 partial → **after**:本行 done。其他 409 消费方信封复用另列 hardening backlog;[通知收件箱](../test-reports/2026-09-24-free-collab-claim-notify-test-report.md)| `web` |
|
||||
| pi-runner | PI Runner / 配置链 | pi-agent + MiniMax + typed-result-v1 | done | non_blocker | [piagent](../test-reports/2026-09-13-codex-audit-p0-remediation-test-report.md);[container-env](../test-reports/2026-09-13-container-env-configuration-test-report.md);[typed-result](../test-reports/2026-09-15-pi-typed-result-v1-test-report.md) | 文档生成仍使用读写和搜索工具。`tool_profile=reasoning` argv 为 `--no-tools`。**2026-09-22 实测** pi-agent 已 bind-mount `pi-args.mjs` | `pi-agent` |
|
||||
| infra-envs | 三环境运维 | dev/test/main + 共享 KB;对话/业务库隔离 | done | non_blocker | [PROJECT.md](../../PROJECT.md) §4;[晋升报告](../test-reports/2026-09-22-dev-gate-and-test-promotion-test-report.md);[DOCREV](../test-reports/2026-09-22-docrev-ui-rerun-test-report.md) | **2026-09-23 实测**:本地/共享 dev DOCREV 路径 schema **63**;test health schema **61**(`rc-v1.1.0-beta.1`);main 本轮未晋升 | `infra` |
|
||||
| ci-e2e | CI / E2E | PR CI、PG 集成、治理 PG、已签真实 PI 门禁;**nightly** schedule/`workflow_dispatch` + infra/product 分类 receipt | done | 加固(阻止**下一次**晋升,不自动否定已发布) | [BUG-08](../test-reports/2026-09-16-ci-governance-pg-bug08-test-report.md);[PI 三工作流](../test-reports/2026-09-16-pi-three-workflow-e2e-test-report.md);[Wave2B](../test-reports/2026-09-16-wave2b-nightly-promotion-receipt-test-report.md);[Wave2C](../test-reports/2026-09-16-wave2c-same-image-digest-test-report.md);[W1 green](../test-reports/2026-09-17-w1-ci-e2e-green-nightly-test-report.md) + [receipt `6e2476f0…`](../assets/promotion-receipts/6e2476f0f2e408e111fe06ca7c31a38294a340b3.json) | **before**:partial(FullNone product_fail / secrets 文案过时)→ **after**:secrets 已配;duplicate goose 00048 已清;FullNone+U8 nightly `verdict=pass` | `ci` |
|
||||
| infra-artifact-digest | Artifact 同 digest 晋升 | 候选 commit 一次构建、按 digest 晋升、promotion receipt | done | 加固 | [计划 PU5B](../remediation/2026-09-16-feature-matrix-production-readiness-plan.md);[Wave2B](../test-reports/2026-09-16-wave2b-nightly-promotion-receipt-test-report.md);[Wave2C](../test-reports/2026-09-16-wave2c-same-image-digest-test-report.md) | **关闭**:same-image pin(`candidate-images-*` + `PINNED_IMAGE_MODE` + promote `--require-digests`)。**声明**:单机 retag/digest pin;远程 registry 推送另立任务 | `infra` |
|
||||
| events-core | 可靠事件核心 | PG dispatcher、notify/advance/projection live、生产闭包 hook 退出、Phase2 选择性解耦已合入 | done | non_blocker | [E0A–E2](../test-reports/2026-09-15-event-e0a-production-scope-contract-test-report.md) 等;[复盘](../ops/research/2026-09-15-track-e-retrospective.md);[shared live](../test-reports/2026-09-15-event-notify-shared-live-test-report.md);[phase2 closeout](../test-reports/2026-09-15-phase2-closeout-test-report.md) | **before**:与 FAV off 混成 partial → **after**:FAV 独立行。选择性后续解耦按收益触发 | `architecture-docs` / `events` |
|
||||
| module-spec | 模块开发规范 | 窄端口、领域事件、wire DTO 三种契约;故障隔离红线;新增模块/表/事件流程。不含批次 A–G 的代码整改 | done | non_blocker | [规范](../system-design/2026-09-20-module-development-standards.md);[审计](../audit/2026-09-20-module-coupling-audit.md);[ADR](../adr/2026-09-14-modular-monolith-decoupling.md) | 文档入口已立。代码整改不在本行 | `module-decoupling-spec` |
|
||||
| module-batches-ag | 模块解耦批次 A–G | server 端口装配、chat 解环、docgov 词汇、工作流单向依赖、巨型文件、前端 api client、21 条例外清零 | done | non_blocker | [分批计划](../remediation/2026-09-20-module-decoupling-batch-plan.md);[审计](../audit/2026-09-20-module-coupling-audit.md);[A](../ops/short-term/2026-09-22-server-assembly-cleanup.md);[B](../ops/short-term/2026-09-22-chat-app-decouple.md);[C](../ops/short-term/2026-09-22-docgov-vocabulary-convergence.md);[D](../ops/short-term/2026-09-22-workflow-def-unidirect.md);[E](../ops/short-term/2026-09-22-engine-split.md);[F](../ops/short-term/2026-09-22-web-api-client.md);[G1](../ops/short-term/2026-09-22-g1-exception-clearance.md);[G2/G3](../ops/short-term/2026-09-22-g2-g3-exception-clearance.md);[状态回退修正](../ops/short-term/2026-09-23-module-batches-ag-status-fix.md);[ISSUE](../audit/2026-09-23-matrix-status-regression.md) | **2026-09-23 复核收口**:A–F + G1/G2/G3 及 residual 二轮均已合入 dev;`arch-check --mode block` PASS、baseline 全 0、exceptions 清零。此前状态曾被 closeout 合并冲突错误回退(ISSUE-20260923-matrix-status-regression),本次按证据修正。Server 镜像字段增量收口另立任务 | `module-decoupling-spec` |
|
||||
| events-fav | Final Artifact Vault(FAV) | 不可变终态制品库;`FAV_DEGRADED_READ=false` | partial | deferred_enhancement | [Track E 复盘](../ops/research/2026-09-15-track-e-retrospective.md);[U7 报告](../test-reports/2026-09-16-fav-u7-incremental-test-report.md);[W6 shadow](../test-reports/2026-09-17-w6-fav-subscriber-shadow-test-report.md);[红线证据](../test-reports/2026-09-22-redline-evidence-fav-test-report.md) | gap-fill 单测+drill 证据已合入 local_dev(例外授权 2026-09-23)。**live 未放量**;观察窗起点已登记。`FAV_DEGRADED_READ` 默认 false;保持 partial 不升 done | `events` |
|
||||
| web-sysadmin | 系统管理台 | 全屏系统级管理视图(总览/KB/特性开关/系统设置/工作流/角色/用户/文档 8 分组);`/api/v1/admin/system/*`;`system_settings` 白名单可写;吸收下线 AdminSettingsModal;细粒度 `system:*` + 设置审计日志(goose 00065) | done | non_blocker | [short-term](../ops/short-term/2026-09-17-system-admin-console.md);[测试报告](../test-reports/2026-09-17-system-admin-console-test-report.md);residual `modular-decouple-residual-2026-09-23` | 剩余 deferred:Playwright 实跑、KB 运维动作、白名单项接消费方 | `web` + `sysadmin` |
|
||||
| removed-control-center | 个人工程中控台(已移出) | 原本地只读看板与后来的 Control Center 都不再属于本仓库 | removed | 进度管理改由独立项目承担 | [历史设计](../archive/design/2026-09-17-personal-engineering-control-center-plan.md);[历史报告](../test-reports/2026-09-17-engineering-dashboard-test-report.md) | 2026-09-19 删除 `cmd/control-center`、`internal/controlcenter`、`control-center/web`、`deploy/control-center`。不恢复 `engineering-dashboard` | — |
|
||||
|
||||
---
|
||||
|
||||
@@ -88,6 +91,7 @@
|
||||
| Document revision | partial(混入完整 PI 叙事) | done | PI change-report 叙事行 | 是(Round20;fallback 为声明行为) |
|
||||
| Frontend workbench | partial(缺口栏已空) | done | Wave 3 已收口 projectMembers/freeformDoc/taskRuns/chatSessions 结构化错误信封复用 | 是(B4 项目 6363) |
|
||||
| 可靠事件 | partial(与 FAV 混行) | done | FAV 独立 deferred | 是(E0–E2 + shared live) |
|
||||
| 语义摘要 D3 | partial(声明含可选 REPLACE) | done | REPLACE → chat-semantic-replace | 是(PU6+W2+S1+2026-09-23 收口重验) |
|
||||
|
||||
---
|
||||
|
||||
@@ -100,7 +104,7 @@
|
||||
|
||||
## 2026-09-17 首次加载性能专项
|
||||
|
||||
首次加载与重启首访性能优化:**partial**(U2 静态交付已验收;U3 只做了登录壳拆包,未关闭)。[审计](../audit/2026-09-17-initial-load-performance-audit.md) · [方案](../remediation/2026-09-17-initial-load-performance-plan.md) · [U2 报告](../test-reports/2026-09-17-initial-load-perf-u2-test-report.md)。U2:自托管字体 + br/gzip。U3 进展(`fix/audit-remainder-closeout`):导出、预览、管理台、块编辑器、Mermaid/公式改为点击或出现时再加载。入口包 `index-*.js` 由 2.83 MB / br 626 KB 降到 737 kB / br 170 KB(`index-j0BIrjIR.js`,包内无 katex)。公式在气泡或正文里出现时才加载,富文本复制同样延后。U3 的浏览器资源瀑布还没测,本行不关。U5:`/auth/me` 复用本请求已核过的用户,不再第二次解析会话;会话与用户状态合成一次 JOIN。没有锁等待证据,所以不节流 `last_seen`。`TestAuthMe_LogoutNextRequestIs401`。U1、U6、U7 未做。U4 进展:登录不再按项目数拉成员名册,只同步当前项目;其他项目先种入当前用户以保持会话可见,完整名册在打开成员面板时取。会话列表不再因项目数组变化而重拉,迟到响应用代次丢弃,同一项目的在途成员请求合并。`src/data/initFanout.test.ts`。2026-09-19 浏览器证据(`e2e/initial-load-performance.spec.ts`,n=20,本仓 Vite `:3100` 代理 `:8080`):每次登录成员项目数 1、会话列表 GET 1,匿名与登录后资源路径均无 katex/mermaid/docx。同一探针在重建后的 `:8080`(`index-DOO0-Yh7.js`,schema 53,n=5)成员项目 1、会话列表 GET 1,匿名 JS 传输 172,417 B,首屏路径无 katex/mermaid/docx。重建前旧包 n=1 曾是 704/30。慢网 n=3、CPU 4 倍:10 Mbps 表单可见 558–604 ms,2 Mbps 1279–1296 ms,样本不足 20,U1 不关。U6 不加索引:测到的瓶颈是已消失的成员扇出,没有慢 SQL 证据。U7 已测未关:[报告](../test-reports/2026-09-19-initial-load-u7-restart-test-report.md)。Vite 监听约 0.3 s;314 个模块冷/热 1.45/1.11 s,不是历史十几秒。postgres+app 到 `/ready` 1.0–1.2 s。无头浏览器缺系统库,登录表单可见未测;不宣称较基线下降 50%。mutex `web + static-delivery`(U2 done)/ `loading-performance-audit`。
|
||||
首次加载与重启首访性能优化:**done(U1–U5/U7 关账口径;U6 明确不加索引)**。[审计](../audit/2026-09-17-initial-load-performance-audit.md) · [方案](../remediation/2026-09-17-initial-load-performance-plan.md) · [U2 报告](../test-reports/2026-09-17-initial-load-perf-u2-test-report.md) · [2026-09-22 收口](../test-reports/2026-09-22-initial-load-closeout-test-report.md)。U2:自托管字体 + br/gzip。U3:导出/预览/管理台/块编辑器/Mermaid/公式延迟加载;2026-09-22 对 schema 61 部署包 `index-CgkGfOP7.js` 浏览器瀑布 n=20(含慢网)确认首屏与首可操作路径无 katex/mermaid/docx。U4:登录只同步当前项目成员;会话列表代次合并。U5:`/auth/me` 复用已核用户。U6:不加索引(瓶颈曾是成员扇出,无慢 SQL 证据)。U1:慢网 + CPU 4x 各 n=20 — 10 Mbps 表单 p75 599 ms(预算 1500)、2 Mbps p75 1346 ms(预算 3000),未放宽阈值。U7:[重启报告](../test-reports/2026-09-19-initial-load-u7-restart-test-report.md) postgres+app→`/ready` 1.0–1.2 s;2026-09-22 补测 `/ready` 后冷导航表单可见 n=20,p75 75 ms,相对约 10 s 历史诊断达到 ≤5 s(50%)目标——**仅限该口径**,不宣称宿主机整机开机首访。macOS 用 `PLAYWRIGHT_CHANNEL=msedge`(沙箱无法拉 Playwright Chromium)。mutex `web + static-delivery` / `loading-performance-audit`。
|
||||
|
||||
## 2026-09-17 文档编制人兼任方案
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
# 自由协作通道 + 认领态分流 + 文档变更提醒机制
|
||||
|
||||
**status**: in_progress
|
||||
**task_id**: free-collab-claim-notify-2026-09-24
|
||||
**companion**: non-author-member-access-2026-09-24(持有 server/docgov/web 写租约)
|
||||
**base_dev_sha**: ebb36fb85c80b83e895b29df5d9056c68f5efe31
|
||||
**授权**: 用户确认方案后实施(会话 2026-09-24)
|
||||
|
||||
## 1. 目标
|
||||
|
||||
1. 任意项目成员随时自由对话、上传、总结(自由协作通道)
|
||||
2. 补充材料可按认领机制更新涉及文档(确认卡勾选)
|
||||
3. 已认领须编制负责人确认并由负责人发起修改;未认领只发摘要提醒
|
||||
4. 单文档同时只被一个任务修改;冲突提示且不执行
|
||||
|
||||
## 2. 认领语义(不变)
|
||||
|
||||
- 非模板(`is_template_only=false`)+ 编制负责人查看或编辑 → `author_claimed=true`
|
||||
- 模板态查看不算认领
|
||||
- 已认领 → `RequiresProposal`;未认领 → `AllowedDirectEdit`
|
||||
- 补齐:正文读取成功后自动 `RecordDocumentViewed`(author);claim/proposal 路由补项目鉴权
|
||||
|
||||
## 3. 自由协作通道
|
||||
|
||||
- 准入 = 项目成员(`RequireProjectAccess`),不查阶段/duty/实例状态
|
||||
- 适用:chat/help/query/impact.analyze/supplement/上传/总结
|
||||
- 受控文档写动作仍走 duty+阶段+认领
|
||||
- `allowActiveStageChatAccess` 仅约束读取他人阶段对话/受控正文,不约束发起自由对话
|
||||
|
||||
## 4. 补充 → 影响 → 确认卡 → 分流
|
||||
|
||||
- `project.fact.supplement` 成功后 → `traceimpact.Analyze` → `supplement_impact_batches/items`
|
||||
- 卡片 `SUPPLEMENT_IMPACT_CONFIRM`;决策 API 用 nonce+digest+revision CAS(不走 intentflow plan tier)
|
||||
- 未认领:直改 + info 提醒;已认领:提案 + action_required;busy:skipped_busy 不回滚
|
||||
- 批准后由负责人身份 `ForceDirectEdit` + `MarkProposalApplied`
|
||||
|
||||
## 5. 提醒聚合
|
||||
|
||||
- `notification_digests`:`(user_id, digest_kind, doc_id, window_date)` UNIQUE,ON CONFLICT DO UPDATE
|
||||
- `notifications.severity` ∈ {action_required, info}
|
||||
- 新事件 `document.proposal_required`
|
||||
- 文案:见实施计划 §4.5(单次/同日多次/多文档扇出)
|
||||
|
||||
## 6. 互斥加固
|
||||
|
||||
- `persistLeaseLocked` 条件更新;heartbeat/release holder 归属鉴权
|
||||
- fencing token 接入 HTTP;`LeaseHolderDisplay` 可读文案
|
||||
|
||||
## 7. 迁移
|
||||
|
||||
- 00068 notifications digest_id + severity
|
||||
- 00069 notification_digests
|
||||
- 00070 supplement_impact_batches + items
|
||||
|
||||
## 8. 红线
|
||||
|
||||
- 不放宽 is_locked / duty 写鉴权;不升 MULTI_INTENT_PLAN_TIER;不物理删 record 表
|
||||
- 索引缺失不得显示为无影响
|
||||
@@ -0,0 +1,62 @@
|
||||
# 对话上下文注入智能体(设计)
|
||||
|
||||
> **状态**:in_progress(实施中)
|
||||
> **task_id**:`dialogue-context-injection-2026-09-25`
|
||||
> **mutex**:`dialogue-ctx`
|
||||
> **base_dev_sha**:`4e410efbabeea5b944909d8a0de49bda1265c975`
|
||||
> **授权**:用户确认方案后实施(本会话)
|
||||
> **policy_revision**:agentctl-mandatory / AGENTS 2026-09
|
||||
|
||||
## 一、目标
|
||||
|
||||
把项目成员共享对话以「清洗 + 分层 + 带元数据」方式注入:
|
||||
|
||||
1. 智能体小队工作区 `context/dialogue/`
|
||||
2. 对话助手 Prompt(【项目成员协同近况】)
|
||||
|
||||
并配套确定性冲突裁决 + jev assist + HITL 分级路由。
|
||||
|
||||
## 二、模块
|
||||
|
||||
| 包 | 职责 |
|
||||
|---|---|
|
||||
| `internal/dialoguectx` | 采集 / 清洗 / 打包(digest.md、turns.md、facts.json) |
|
||||
| `internal/conflictresolve` | 权威级/时间窗裁决、卡片限额、CONFIRMATIONS.md、裁决表持久化 |
|
||||
| `internal/squad` | 工作区落盘 + TASK.md 导航 + `DialoguePackage` 透传 |
|
||||
| `internal/bizdev` | 全任务默认注入(`DIALOGUE_CTX_INJECTION` 紧急关闭) |
|
||||
| `internal/coordinator` / `chat` | MemoryComposer 近况段 |
|
||||
|
||||
## 三、权威度
|
||||
|
||||
`collab_dialogue` < 黑板 / 已批准文档。冲突不静默采信对话版本。
|
||||
|
||||
## 四、HITL 分级路由
|
||||
|
||||
- 事实级模糊冲突 → 触发用户(`PendingExpectation`)
|
||||
- 涉及受控文档槽位 → 文档 author(digest 通知)
|
||||
- 单任务确认卡 ≤ 3;超额自动采信规则胜者
|
||||
|
||||
## 五、开关
|
||||
|
||||
- `DIALOGUE_CTX_INJECTION` 默认 `on`;`off|false|0` 紧急关闭(`internal/dialoguectx` 读环境变量)
|
||||
- `DIALOGUE_CTX_MAX_DAYS` 默认 7(≤31)
|
||||
- `DIALOGUE_CTX_MAX_TURNS` 默认 80(≤200)
|
||||
- sysadmin Features 目录登记可后续补行(本批不改 `internal/sysadmin` 写范围)
|
||||
|
||||
## 六、迁移
|
||||
|
||||
`deploy/postgres/goose/00071_2026-09-25-context-conflict-adjudications.sql`
|
||||
|
||||
## 七、验证
|
||||
|
||||
见 `.doc/test-reports/2026-09-25-dialogue-context-injection-test-report.md`。
|
||||
|
||||
## 八、五态
|
||||
|
||||
| 字段 | 值 |
|
||||
|---|---|
|
||||
| review_state | pending |
|
||||
| integration_state | pending |
|
||||
| deployment | not_applicable(本批代码合入后需 dev 迁移) |
|
||||
| cleanup | pending |
|
||||
| remote_sync | not_requested |
|
||||
@@ -7,6 +7,15 @@
|
||||
|
||||
## 📋 报告清单
|
||||
|
||||
### 0b. 自由协作与认领提醒(2026-09-24)
|
||||
|
||||
| 项 | 链接 |
|
||||
|-----|------|
|
||||
| 主设计 | [2026-09-24-free-collab-claim-notify-design.md](2026-09-24-free-collab-claim-notify-design.md) |
|
||||
| 任务 | [../ops/short-term/2026-09-24-free-collab-claim-notify.md](../ops/short-term/2026-09-24-free-collab-claim-notify.md) |
|
||||
| 一句话总结 | 自由协作通道 + 认领态分流更新 + 通知 digest 聚合 |
|
||||
|
||||
|
||||
### 0. T20 加固设计(2026-09-22)
|
||||
|
||||
| 项 | 链接 |
|
||||
|
||||
@@ -29,16 +29,20 @@ imports:
|
||||
- authz
|
||||
- app/uow
|
||||
- config
|
||||
- conflictresolve
|
||||
- contracts/vocabulary
|
||||
- ctxmgr
|
||||
- db
|
||||
- dialoguectx
|
||||
- docduty
|
||||
- docgov
|
||||
- docrevision
|
||||
- freedoc
|
||||
- intent
|
||||
- kb
|
||||
- materialindex
|
||||
- maturity
|
||||
- notification
|
||||
- projectcontext
|
||||
- projectworkflow
|
||||
- quote
|
||||
@@ -66,6 +70,7 @@ imports:
|
||||
- config
|
||||
- contracts/vocabulary
|
||||
- ctxmgr
|
||||
- dialoguectx
|
||||
- docgov
|
||||
- intent
|
||||
- jevdecide
|
||||
@@ -81,7 +86,13 @@ imports:
|
||||
- docgov
|
||||
- replyexport
|
||||
- storage
|
||||
conflictresolve:
|
||||
- dialoguectx
|
||||
- jevdecide
|
||||
db: []
|
||||
dialoguectx:
|
||||
- ctxmgr
|
||||
- replyexport
|
||||
docduty: []
|
||||
app:
|
||||
- agent
|
||||
@@ -109,11 +120,13 @@ imports:
|
||||
- intent
|
||||
- jevdecide
|
||||
- kb
|
||||
- maintenance
|
||||
- notification
|
||||
- observability
|
||||
- projectinstance
|
||||
- projectworkflow
|
||||
- storage
|
||||
- supplementimpact
|
||||
- sysadmin
|
||||
- taskrun
|
||||
- traceimpact
|
||||
@@ -235,9 +248,11 @@ imports:
|
||||
- docrevision
|
||||
- events
|
||||
- freedoc
|
||||
- handoff
|
||||
- httpx
|
||||
- intent
|
||||
- kb
|
||||
- maintenance
|
||||
- materialindex
|
||||
- mineru
|
||||
- notification
|
||||
@@ -257,6 +272,7 @@ imports:
|
||||
- workflowdef
|
||||
- workflowscope
|
||||
- workspace
|
||||
- supplementimpact
|
||||
squad:
|
||||
- agent
|
||||
- config
|
||||
@@ -306,9 +322,32 @@ imports:
|
||||
- app/uow
|
||||
sysadmin:
|
||||
- config
|
||||
maintenance: []
|
||||
handoff: []
|
||||
localpg:
|
||||
- config
|
||||
app/eventsconsumer:
|
||||
- app/docadvance
|
||||
- app/docnotify
|
||||
- app/docproject
|
||||
- app/intentflow
|
||||
- config
|
||||
- ctxmgr
|
||||
- docgov
|
||||
- events
|
||||
- notification
|
||||
- projectinstance
|
||||
- projectworkflow
|
||||
- workflowdef
|
||||
traceimpact: []
|
||||
supplementimpact:
|
||||
- docgov
|
||||
- notification
|
||||
- traceimpact
|
||||
|
||||
table_owners:
|
||||
context_conflict_adjudications:
|
||||
- conflictresolve
|
||||
document_records:
|
||||
- docgov
|
||||
project_trace_items:
|
||||
@@ -375,6 +414,12 @@ table_owners:
|
||||
- app/docproject
|
||||
notifications:
|
||||
- notification
|
||||
notification_digests:
|
||||
- notification
|
||||
supplement_impact_batches:
|
||||
- supplementimpact
|
||||
supplement_impact_items:
|
||||
- supplementimpact
|
||||
stage_advance_requests:
|
||||
- notification
|
||||
final_artifacts:
|
||||
@@ -413,6 +458,12 @@ table_owners:
|
||||
- app/intentflow
|
||||
system_settings:
|
||||
- sysadmin
|
||||
system_settings_audits:
|
||||
- sysadmin
|
||||
system_setting_policy_audits:
|
||||
- sysadmin
|
||||
maintenance_windows:
|
||||
- maintenance
|
||||
|
||||
path_owners:
|
||||
output.md:
|
||||
@@ -466,6 +517,16 @@ event_producers:
|
||||
intent.plan.completed:
|
||||
- app/intentflow
|
||||
- events
|
||||
document.proposal_required:
|
||||
- docgov
|
||||
- bizdev
|
||||
- app/supplementimpact
|
||||
- events
|
||||
document.unclaimed_edit_applied:
|
||||
- docgov
|
||||
- bizdev
|
||||
- app/supplementimpact
|
||||
- events
|
||||
|
||||
event_consumers:
|
||||
outbox.notify:
|
||||
@@ -499,6 +560,10 @@ event_consumers:
|
||||
intent.plan.completed:
|
||||
- projection
|
||||
- notify
|
||||
document.proposal_required:
|
||||
- notify
|
||||
document.unclaimed_edit_applied:
|
||||
- notify
|
||||
|
||||
unwrap_owners:
|
||||
- docgov
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# 管理员重置密码与登录凭据修复 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
test 环境账号 `chenwei` 登录失败,表现为 `code=AUTHZ` / `message=无权访问` / `error=用户名或密码错误`。管理员 UI「重置密码」无法生效。根因调查确认:验收期曾重置哈希且不披露口令;重置按钮为 T20-F4 死功能;前端把信封 JSON 原文展示给用户。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
- Phase 0:恢复 `chenwei` 可登录且 `must_change_password=true`
|
||||
- Admin 重置 API:成功路径 + 非管理员 403 + 目标不存在 4xx + 旧会话失效
|
||||
- 登录错误文案优先领域 `error`,不再展示裸 JSON / 「无权访问」误导
|
||||
- CreateUser 拒绝空哈希;空哈希登录统一 401
|
||||
- Go short 全量与前端测试通过
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS: Linux;Go short;web npm test/build
|
||||
- test 环境:`http://127.0.0.1:8081`,schema 65(运行时);代码侧新增 goose 00067(合入后待迁移)
|
||||
- **NOT REQUIRED**:nightly 真实 PI 全链路(依据:本变更为 IAM/管理台,非产品 PI / 工作流模板 / 提示词;见 PROJECT.md §8 与测试报告规范「纯工程」例外说明)
|
||||
- **NOT REQUIRED(本报告)**:test 环境 live `reset-password` API 冒烟 — 代码尚未晋升/重建到 test 容器;以 httptest 集成测 + Phase 0 SQL 恢复为验收。晋升后应补跑 live API。
|
||||
|
||||
证据目录:[assets/2026-09-24-admin-password-reset/](./assets/2026-09-24-admin-password-reset/)
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
| 用例 | 预期 |
|
||||
|---|---|
|
||||
| chenwei 临时口令登录 | 200,token,must_change_password=true |
|
||||
| AdminResetPassword | 200,返回 temp_password;旧密 401;旧会话 401 |
|
||||
| 非管理员重置 | 403 |
|
||||
| authErrorMessage | 「用户名或密码错误」,无 `{`,非「无权访问」 |
|
||||
| CreateUser 空哈希 | 错误 `password hash required` |
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### 用例 1:Phase 0 chenwei 恢复登录
|
||||
|
||||
- **输入**:test 库 UPDATE credentials + must_change;`POST /api/v1/auth/login`
|
||||
- **实际输出**:见 `assets/.../phase0-login-verify.txt`:`HTTP 200` / `LOGIN_OK` / `must_change_password True`;`password_changed_at` 日期 2026-09-24
|
||||
- **判定**:PASS(口令不入报告,路径仅 agent store)
|
||||
|
||||
### 用例 2:AdminResetPassword 集成测
|
||||
|
||||
- **输入**:`go test -short -run AdminReset|... ./internal/auth/ ./internal/server/`
|
||||
- **实际输出**:见 `assets/.../go-focused.txt`:`ok auth` / `ok server`
|
||||
- **判定**:PASS
|
||||
|
||||
### 用例 3:前端信封解析
|
||||
|
||||
- **输入**:`authErrorMessage` 单测 + `npm test`
|
||||
- **实际输出**:497 + 34 vitest PASS;`authErrorMessage` 断言通过
|
||||
- **判定**:PASS
|
||||
|
||||
### 用例 4:三环境凭据盘点(只读)
|
||||
|
||||
- **输入**:SQL 聚合
|
||||
- **实际输出**:见 `cred-inventory.txt` — dev 263 missing / main 3 seed missing / test 0
|
||||
- **判定**:PASS(盘点);存量清理不在本任务
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
```text
|
||||
./scripts/arch-check.sh --mode block # PASS
|
||||
go vet ./... # PASS
|
||||
go test -short ./... # PASS(server ~18s)
|
||||
cd web && npm test # 497 + 34 PASS
|
||||
cd web && npm run build # PASS
|
||||
```
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
- 达到合入 local_dev 标准。
|
||||
- 合入后:授权晋升 test → 迁移 00067 → rebuild → 用管理台真实重置 API 验收。
|
||||
- 存量僵尸账号清理需独立授权;main seed 三行非业务账号。
|
||||
@@ -0,0 +1,91 @@
|
||||
# Cursor 治理层扩展(rules / skills / hooks)测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
PI subagent 执行器已合入 local `dev`(`cfc80b34`)。本任务补齐 Cursor 客户端治理层:修复 `test-reports-standard.mdc` 规则漂移、新增派发/阶段记录 skills、新增 advisory hooks、修正 agentctl/jev MCP 相对路径,并将能力分层登记进规范登记表。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
| AC | 目标 | 判定 |
|
||||
|---|---|---|
|
||||
| AC1 | 规则无硬编码模型/无条件全量 Go/失效 §8 | PASS(静态 grep) |
|
||||
| AC2–AC3 | 两 skill 存在且指向权威文档 | PASS |
|
||||
| AC4 | hooks ask + fail-open + probe;单元可测 | PASS(29 项) |
|
||||
| AC5 | mcp.json agentctl/jev 相对路径 | PASS(结构);CLI 显示 registered/needs approval(未宣称 Connection 已绿) |
|
||||
| AC6 | rules 收敛 + policy-registry 修订 | PASS |
|
||||
| AC7 | unittest discover 全绿 | PASS(202) |
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS:Linux;Python 3.14;工作区 `.worktrees/cursor-governance-hooks-2026-09-24`
|
||||
- 基线:`cfc80b34a40e8de78e77a44839571bb684d405d5`
|
||||
- 层级:工程脚本单元 + 文档静态;**产品 Go/前端/PG/真实产品 Runner:NOT REQUIRED**(无产品代码变更)
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
- hook 合法放行;形状错误/裸跑/`pkill -f` → `permission=ask`
|
||||
- 异形 JSON → allow + `UNRECOGNIZED_INPUT`
|
||||
- 全量 `scripts/tests` 无回归
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### 5.1 Cursor hooks 专项
|
||||
|
||||
命令:`python3 -B -m unittest scripts.tests.test_cursor_hooks -v`
|
||||
|
||||
- 29 tests OK(结构、guard-git、guard-pi-dispatch、guard-pi-shell、receipt-context、audit-session、skills)
|
||||
- 证据:[unittest-discover.txt](assets/2026-09-24-cursor-governance-hooks/unittest-discover.txt)
|
||||
|
||||
### 5.2 全量工程回归
|
||||
|
||||
命令:`python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v`
|
||||
|
||||
- **Ran 202 tests in 111.351s — OK**(原 173 + 新增 29)
|
||||
- 判定:PASS
|
||||
|
||||
### 5.3 文档/规则静态
|
||||
|
||||
- `grep` rules:无 `MiniMax-M2.7-highspeed`、无 `PROJECT.md) §8`、无 `go test -v ./...` → PASS
|
||||
- `git diff --check`:PASS
|
||||
- `agentctl docs drift`:`status=ok`,`regressions=[]`
|
||||
|
||||
### 5.4 MCP 路径
|
||||
|
||||
- `.cursor/mcp.json` 中 agentctl/jev/pi-subagents 均使用 `scripts/mcp/...` 相对路径
|
||||
- CLI `agent mcp list`:四服务均显示 `not loaded (needs approval)`(已注册;加载需用户在客户端批准)。**不宣称已消除 Connection failed**;issue 保持 verifying
|
||||
|
||||
### 5.5 IDE probe(独立验收)
|
||||
|
||||
状态:`pending_ide_sample` — 见 [probe-status.json](assets/2026-09-24-cursor-governance-hooks/probe-status.json)
|
||||
|
||||
用户步骤:
|
||||
|
||||
1. 重载项目 MCP / Hooks
|
||||
2. `export CURSOR_HOOKS_PROBE=1`(或在 Cursor 环境中设置)
|
||||
3. 触发一次 `pi_subagent_roles` 与任意 shell
|
||||
4. 将 `.cursor/hook-probe.jsonl` 脱敏片段归档到本 assets,再收紧 matcher
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 套件 | 结果 |
|
||||
|---|---|
|
||||
| `unittest discover scripts/tests` | 202 OK |
|
||||
| 产品 PI / Go 全量 | NOT REQUIRED |
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
达到授权交付终点(工程治理层合入 local_dev)。后续:IDE probe 采样后关闭/推进 hook 契约 issue;CLI 批准 MCP 后复核 agentctl/jev;lesson 由 candidate → validated。
|
||||
|
||||
相关:任务 [2026-09-24-cursor-governance-hooks](../ops/short-term/2026-09-24-cursor-governance-hooks.md);ISSUE hook 契约 / 规则漂移 / MCP 路径。
|
||||
|
||||
## 八、IDE 实机复测(重启并批准 MCP 后)
|
||||
|
||||
| 项 | 结果 |
|
||||
|---|---|
|
||||
| `pi_subagent_roles` | PASS(11 roles,`config_revision=subagent-models-2026-09-24-r1`) |
|
||||
| `postToolUse` 注入 | PASS(收据 checklist;tool=`MCP:pi_subagent_roles`) |
|
||||
| `codegraph_explore` | PASS(IDE ready) |
|
||||
| `agentctl` / `jev` IDE | 未进入 IDE MCP 缓存(手动 stdio initialize 可通;另跟) |
|
||||
| MCP: 前缀门禁漏拦 | 已发现并修复(见后续 commit) |
|
||||
|
||||
证据:[ide-mcp-probe-2026-09-24.json](assets/2026-09-24-cursor-governance-hooks/ide-mcp-probe-2026-09-24.json)
|
||||
@@ -0,0 +1,107 @@
|
||||
# 2026-09-24 dev 全面门禁与 test 晋升 — 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
本地 `dev` 领先 `origin/test@9984c68d`(schema 65)多轮合入(含 go-agentx、FAV、jevdecide assist、intentflow U9–U12、squad/coordinator/workspace)。本轮按验证契约做 dev 全面深测(**重点保障真实智能体小队链路**),全绿后晋升 test 并打 `rc-v1.1.0-beta.3`,部署验收后恢复 S1 基线。
|
||||
|
||||
过程中发现并修复:`cleanHeadingTitle` 多位中文序数未剥离、nightly 相对 `DATA_DIR` 导致 workspace 与 pi-agent 挂载分叉、FullChain 固定项目名 409;另修正宿主机 `.env` 中 `RERANKER_MODEL` 笔误(`qwen3-reranky`→`qwen3-rerank`,reranker 503 fail-open 不挡门禁)。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
- 静态/单元门禁全绿;真实 PI nightly(U8 + FullChain×3 + FullNoneMixed)**全部 PASS** 并写 promotion receipt
|
||||
- 合入修复后冻结 tip,晋升 test:`--no-ff` 第一父=`origin/test@9984c68d`,tag `rc-v1.1.0-beta.3`,schema **66**
|
||||
- test 验收:冒烟、真实小队 intake、助手多轮/stream、演示数据负例;`pg_restore` 回 S1
|
||||
- push `origin/dev` + `origin/test` + rc tag;文档收口
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
| 项 | 值 |
|
||||
|----|-----|
|
||||
| OS | Linux |
|
||||
| Go | 仓库 go.mod 基线 |
|
||||
| 冻结 nightly tip | `3de5bc5c`(abs DATA_DIR + unique FullChain + heading 祖先) |
|
||||
| promote tip M | `0e4b111d`(P1=`9984c68d`,含 `3de5bc5c`) |
|
||||
| rc tag | `rc-v1.1.0-beta.3` → `0e4b111d` |
|
||||
| dev Runner | `127.0.0.1:18865` / MiniMax-M2.7-highspeed |
|
||||
| test Runner | `127.0.0.1:18866` / MiniMax-M2.7-highspeed |
|
||||
| 隔离治理 PG | gate-pg `:5436` / `agent_gate` |
|
||||
| S0 | `/tmp/agent-test-snap-s0-pre-beta3-20260924T043533Z` |
|
||||
| S1 | `/tmp/agent-test-snap-s1-post-beta3-20260924T044504Z`(goose 66 / projects 9 / task_runs 9) |
|
||||
|
||||
分层:arch-check / `go vet` / `go test -short` / npm test+build / agentctl unittest → nightly 真实 PI → test 冒烟+小队+助手 → restore。
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
- nightly 五例均 `PASS`,receipt `verdict=pass`,candidate images digests 齐备
|
||||
- test health `schema_version=66`,pinned image digest 与 receipt 一致
|
||||
- 小队 intake:`completed`、正文 ≥1500 字、`client_turn_id` 幂等
|
||||
- stream 含 `turn_ack`→`delta`→`done`;演示项目 id 6001–6010 交集为空
|
||||
- restore 后 goose/projects/task_runs 与 S1 manifest 一致
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### 5.1 静态与单元(dev)
|
||||
|
||||
- arch-check / go vet / go test -short / npm test+build / scripts unittest:前序门禁轮次 PASS(证据目录 `/tmp/dev-full-gate-20260924/`)
|
||||
- 定向:`go test ./internal/squad ./internal/coordinator ./internal/workspace` PASS
|
||||
|
||||
### 5.2 真实 PI nightly(重点)
|
||||
|
||||
- **Input**:`run-nightly-real-pi.sh` @ `3de5bc5c`,`TEST_DATABASE_URL=…:5436/agent_gate`,绝对 `DATA_DIR=…/data/dev`,导出 `KB_DB_PASSWORD`
|
||||
- **Actual**(`/tmp/dev-full-gate-20260924/nightly-r9-033243`):
|
||||
|
||||
| 用例 | 结果 | 耗时 |
|
||||
|------|------|------|
|
||||
| TestMultiIntentU8_RealPI_ConfirmGenerate_PG | PASS | 214.76s |
|
||||
| TestWorkflowGovernance_PiAgent_PG_FullNoneMixedChain | PASS | 932.89s |
|
||||
| TestWorkflowGovernance_PiAgent_PG_FullChain | PASS | 307.07s |
|
||||
| …_ProductManager_FullChain | PASS | 894.51s |
|
||||
| …_TestManager_FullChain | PASS | 1316.52s |
|
||||
|
||||
- receipt:[`3de5bc5c….json`](./assets/promotion-receipts/3de5bc5c396fc21887f0f19e6e3baa8784347f99.json) `verdict=pass`;images:同前缀 `.images.json`
|
||||
- **Verdict**: **PASS**
|
||||
|
||||
### 5.3 test 晋升与部署
|
||||
|
||||
- **Input**:候选 `0e4b111d`(共享 CURRENT/MATRIX 保留 test 侧以避免 DOCUMENT_RECEIPT);`candidate-images-apply.sh test`;`env-service.sh test rebuild`(`SEED_DEMO_USERS=false`,pinned)
|
||||
- **Actual**:health schema **66**;app image `sha256:3bbf11c6…`(与 receipt 一致);端口 8081/5434/18866
|
||||
- **Verdict**: **PASS**
|
||||
|
||||
### 5.4 test 冒烟 / 负例
|
||||
|
||||
- smoke ready/health/SPA/runner:PASS([`smoke.txt`](./assets/2026-09-24-dev-full-gate-test-promotion/smoke.txt)、[`health.json`](./assets/2026-09-24-dev-full-gate-test-promotion/health.json))
|
||||
- 演示 id 负例:`overlap=[]`([`demo-negative.txt`](./assets/2026-09-24-dev-full-gate-test-promotion/demo-negative.txt))
|
||||
- **Verdict**: **PASS**
|
||||
|
||||
### 5.5 真实小队 intake(test)
|
||||
|
||||
- **Input**:项目 11 激活 main(SoD 26/27/28);`mtx_owner` `POST /api/v1/tasks/runs` `task_key=intake` `backend=pi-agent`
|
||||
- **Actual**:
|
||||
- create 202,`run_id=run_1790225874439969653`,≈300s 后 `completed`([`34b-summary.txt`](./assets/2026-09-24-dev-full-gate-test-promotion/34b-summary.txt))
|
||||
- `output.md` chars=6802 ≥1500([`36b-intake-output-summary.txt`](./assets/2026-09-24-dev-full-gate-test-promotion/36b-intake-output-summary.txt))
|
||||
- 同 `client_turn_id` 幂等 `same_run=True`([`37b-idempotent-summary.txt`](./assets/2026-09-24-dev-full-gate-test-promotion/37b-idempotent-summary.txt))
|
||||
- **Verdict**: **PASS**
|
||||
|
||||
### 5.6 助手多轮 / stream
|
||||
|
||||
- sync chat:turn1 `CASUAL_CHAT` `reply_len=1322`(`reply_source=template`);turn2 `SUPPLEMENT_INFO`(见 summaries)
|
||||
- stream:`kinds=['turn_ack','delta','done',…]`([`chat-stream-summary.txt`](./assets/2026-09-24-dev-full-gate-test-promotion/chat-stream-summary.txt)、[`chat-stream.sse`](./assets/2026-09-24-dev-full-gate-test-promotion/chat-stream.sse))
|
||||
- **Verdict**: **PASS**(stream 契约满足;sync 路径存在 template 回落,记为观察项,不挡本轮晋升——小队真实 PI 与 nightly 已覆盖核心链路)
|
||||
|
||||
### 5.7 恢复 S1
|
||||
|
||||
- **Actual**:[`50-restore-s1.txt`](./assets/2026-09-24-dev-full-gate-test-promotion/50-restore-s1.txt) — goose=66、projects=9、task_runs=9、users=9;与 S1 manifest 一致;验证 workspace 已清
|
||||
- S0 保留于 `/tmp/agent-test-snap-s0-pre-beta3-20260924T043533Z`
|
||||
- **Verdict**: **PASS**
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
- `go test -short ./...`:门禁轮次 PASS(`/tmp/dev-full-gate-20260924/03-go-test-short*.txt`)
|
||||
- nightly 真实 PI:见 §5.2(非 stub)
|
||||
- 工程规范变更不适用产品 PI 全量冒充:本报告产品链路均为真实 Runner
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
- **结论**:达到合并/晋升标准。`rc-v1.1.0-beta.3` @ `0e4b111d` 已在 test 落地 schema **66**;小队真实 intake + nightly 五链 PASS;库已回 S1。
|
||||
- **非阻塞**:embedding 401 运维债;sync chat `reply_source=template` 观察;FAV live 不放量、U9–U12 tier 停 confirm、D7 不物理删除——约束不变。
|
||||
- **收口**:`review_state=accepted`;`integration_state=merged_local_dev` + test 已晋升;`deployment=test_ok`;`remote_sync` 见 push 结果;`cleanup=pending`。
|
||||
@@ -0,0 +1,12 @@
|
||||
# Development-Manager 迁移(Agent-System 侧指针报告)
|
||||
|
||||
本报告为指针:完整验收证据在 Development-Manager 仓。
|
||||
|
||||
- 主报告:`/home/weichen/projects/Development-Manager/.doc/test-reports/2026-09-24-dm-migration-test-report.md`
|
||||
- 远端:https://git-home.u1680832.nyat.app:30319/weichen/Development-Manager.git
|
||||
- tip:`dev`/`main` @ `0a58b9090366a856b677cf2b42abb93e4df02a0d`
|
||||
- 核心 unittest:221 OK
|
||||
- 双 daemon 并存:PASS
|
||||
- Agent-System 管理系统:**未移除**(过渡期双轨)
|
||||
|
||||
层级:工程工具 / 文档迁移;产品 PI 全链路 NOT REQUIRED。
|
||||
@@ -0,0 +1,54 @@
|
||||
# 自由协作通道 + 认领态分流 + 文档变更提醒 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
实现自由协作通道、认领补齐与租约加固、通知 digest 聚合、补充材料影响确认卡与认领态分流执行。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
- A:成员级 free-lane 对话不被阶段 ABAC 误拦;非成员仍 403
|
||||
- B:负责人查看非模板正文自动认领;租约条件更新与 holder 归属;可读 DOC_BUSY
|
||||
- C:document.proposal_required + notification_digests ON CONFLICT DO UPDATE;收件箱 UI
|
||||
- D:supplementimpact 批次/确认卡/分流;批准后负责人 ForceDirectEdit(user:/supplement 触发)
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
- OS: Linux;Go short 单测;web npm test + build
|
||||
- 层级:工程工具 + Go/接口 + 前端构建(按验证契约并集)
|
||||
- 真实 PI 全链路:本批 **未运行**(见结论),记为待验证
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
各包 `go test -short` PASS;`npm test`/`npm run build` PASS;arch-check block PASS。
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### TC-GO-1 server/docgov/projectinstance/supplementimpact/notification/bizdev/app/coordinator/archtest
|
||||
- **输入**: `go test -count=1 -short` 于 non-author worktree 相关包
|
||||
- **实际输出**: `ok`(server ~19s;其余短测均 ok);附件 `assets/2026-09-24-free-collab-claim-notify/server-short.txt`
|
||||
- **判定**: PASS
|
||||
- **耗时**: ~20s 量级
|
||||
|
||||
### TC-WEB-1 npm test
|
||||
- **输入**: `cd web && npm test`
|
||||
- **实际输出**: node:test 502 pass;vitest 34 pass
|
||||
- **判定**: PASS
|
||||
|
||||
### TC-WEB-2 npm run build
|
||||
- **输入**: `cd web && npm run build`
|
||||
- **实际输出**: 构建成功(含 precompress)
|
||||
- **判定**: PASS
|
||||
|
||||
### TC-PI-1 真实产品 PI 全链路
|
||||
- **判定**: 未运行 / 待验证(交付铁律要求获授权环境 nightly;本会话未启 pi-agent)
|
||||
|
||||
### TC-BROWSER-1 收件箱铃铛与确认卡
|
||||
- **判定**: 未运行 / 待验证(组件单测已覆盖卡片类型与通知 API)
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
| 套件 | 结果 |
|
||||
|---|---|
|
||||
| arch-check --mode block | PASS(free-collab) |
|
||||
| go test -short (关键包) | PASS |
|
||||
| web npm test | PASS |
|
||||
| web npm run build | PASS |
|
||||
| 真实 PI / 浏览器 E2E | 未运行 |
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
工程验收目标达成可合入 local dev。真实 PI「补充→确认卡→分流→批准自动应用」与浏览器收件箱实测仍待授权环境补证。
|
||||
@@ -0,0 +1,77 @@
|
||||
# 治理目录库与跨对话需求重叠检测 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
跨对话新设计与既有功能/需求重叠时,agentctl 仅有路径级 `overlaps()` 互斥,无需求语义比对。本轮在 `.locks/state.sqlite` 扩展 Catalog 层(与业务 PostgreSQL 物理隔离),落地 FTS5 中文召回、两级门禁与可降级向量层。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
- Catalog schema / CRUD / FTS5 CJK(双字词召回,禁用 trigram)
|
||||
- L1 硬拒(same_req_id)与 L2 软门裁决留痕
|
||||
- `with` 在未 ack 时拒绝;ack 后放行
|
||||
- 向量层缺钥/错 URL 降级不阻断
|
||||
- 既有 agentctl 回归无破坏
|
||||
- 工程工具变更:**产品 PI 全链路 NOT REQUIRED**(依据:test-reports-standard §范围判定 — 纯工程规范/工具)
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS:Linux;Python 3.14.7;SQLite 3.53.4(FTS5)
|
||||
- 入口:`python3 -B -m unittest discover -s scripts/tests -p 'test_*.py'`
|
||||
- 新增:`scripts/tests/test_agentctl_catalog.py`(6 用例)
|
||||
- 回填:`scripts/catalog_backfill.py` → features_matrix=29, issues=10, tests=207
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
| 用例 | 预期 |
|
||||
|---|---|
|
||||
| schema/CRUD | add/list/show/status OK |
|
||||
| CJK digram | trigram `"灰度"`=0;CJK 切分 ≥2 |
|
||||
| same_req_id | `REQUIREMENT_CONFLICT` |
|
||||
| soft ack | 未 ack → `OVERLAP_ACK_REQUIRED`;ack 后 `with` 成功 |
|
||||
| vector degrade | `vector_layer` ∈ degraded/disabled/ok,exit 0 |
|
||||
| hard proceed ack | 拒绝 |
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### 5.1 Catalog 专项(6/6 PASS)
|
||||
|
||||
```text
|
||||
test_cjk_fts_digram_recall ... ok
|
||||
test_hard_proceed_ack_rejected ... ok
|
||||
test_hard_same_req_id_conflict ... ok
|
||||
test_schema_and_crud ... ok
|
||||
test_soft_overlap_requires_ack ... ok
|
||||
test_vector_layer_degrades_without_key ... ok
|
||||
```
|
||||
|
||||
**判定**:PASS
|
||||
|
||||
### 5.2 全量工程回归
|
||||
|
||||
```text
|
||||
Ran 179 tests in 123.217s
|
||||
OK
|
||||
```
|
||||
|
||||
证据:`.doc/test-reports/assets/2026-09-24-governance-catalog/unittest-full.log`
|
||||
|
||||
**判定**:PASS
|
||||
|
||||
### 5.3 回填与 drift
|
||||
|
||||
- backfill:`features_matrix=29`, `issues=10`, `tests=207`, `task_features=128`, `releases=0`
|
||||
- `catalog drift`:`regressions=[]`, `record_count=29`
|
||||
|
||||
**判定**:PASS
|
||||
|
||||
### 性能与耗时
|
||||
|
||||
全量 unittest ≈ 123 s;catalog 专项 ≈ 3 s。
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
本任务为工程工具变更,**不要求** `go test ./...` 产品回归;已跑 agentctl/unittest 全量 179 OK。产品 PI NOT REQUIRED。
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
达到合入 local `dev` 标准。后续可选:开启 `catalog_vector.enabled`(embedding 401 修复后)、把 CURRENT 认领投影到 requirements、daemon 审计周期附加 `catalog drift`。
|
||||
@@ -0,0 +1,68 @@
|
||||
# governance-console P1 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
P0 已交付 `collect_*` / `brief` / `claim archive` / table 渲染。本任务按定稿规格 `governance-console-p1-r1`(`.doc/ops/short-term/2026-09-24-governance-console-plan.md`)实施 P1-a…e:loopback HTTP console、高频动作白名单与 SPA。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
- `agentctl serve` 只读八端点 + SPA;非 loopback 拒绝;未知 `/api/shell` → 404
|
||||
- `claim new` CLI/HTTP:新建、幂等、缺能力 403、缺 task 400
|
||||
- `integrate prepare`:`first_parent == expected-dev`;脏 worktree 拒绝;不自动 enqueue
|
||||
- `pi packet`:拒绝符号 `source_sha`;`--write` 落盘且不触发 run
|
||||
- 工程工具层回归:`test_agentctl*.py` 全绿
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS:Linux;Python 3.14;隔离临时 git 仓 fixture
|
||||
- 验证层级:验证契约「工程工具验收」(非产品 PI)
|
||||
- 套件:`scripts/tests/test_agentctl_serve.py` + `unittest discover -p 'test_agentctl*.py'`
|
||||
- 真机冒烟:worktree 内 `agentctl serve` + curl `/api/status` `/api/brief` `/`
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
见方案 §9.1–9.2 矩阵。
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### 5.1 `test_agentctl_serve.py`(8)
|
||||
|
||||
| 用例 | 判定 |
|
||||
|---|---|
|
||||
| non_loopback_host_denied | PASS |
|
||||
| get_eight_endpoints_and_spa | PASS |
|
||||
| unknown_post_shell_404 | PASS |
|
||||
| claim_new_missing_task_400 | PASS |
|
||||
| claim_new_without_docs_publish_403 | PASS |
|
||||
| claim_new_cli_create_replace_and_replay | PASS |
|
||||
| integrate_prepare_first_parent_and_dirty_refuse | PASS |
|
||||
| pi_packet_rejects_symbolic_and_writes | PASS |
|
||||
|
||||
证据:`.doc/test-reports/assets/2026-09-24-governance-console-p1/unittest-serve.txt`
|
||||
|
||||
### 5.2 `test_agentctl*.py` 套件
|
||||
|
||||
- **输入**:`python3 -B -m unittest discover -s scripts/tests -p 'test_agentctl*.py' -v`
|
||||
- **实际输出**:`Ran 110 tests … OK`(约 83s)
|
||||
- **判定**:PASS
|
||||
- 证据:`.doc/test-reports/assets/2026-09-24-governance-console-p1/unittest-agentctl-suite.txt`
|
||||
|
||||
### 5.3 真机 serve 冒烟
|
||||
|
||||
- `/api/status` → 含 `tasks`/`main`
|
||||
- `/api/brief` → markdown 以 `# agentctl brief` 开头
|
||||
- `/` → 200 HTML(worktree 静态回退)
|
||||
- `POST /api/shell` → `NOT_FOUND`
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 套件 | 结果 |
|
||||
|---|---|
|
||||
| test_agentctl_serve | 8/8 PASS |
|
||||
| test_agentctl* discover | 110/110 PASS |
|
||||
|
||||
产品 PI / `go test`:**NOT REQUIRED**(工程工具变更,依据验证契约与 PROJECT 验证入口)。
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
P1-a…e 验收达标,可合入 local_dev。后续可选:SSE 推送、Enqueue 二次确认写入口(当前故意仅 CLI 指引)、浏览器手动四区清单勾选。
|
||||
@@ -0,0 +1,143 @@
|
||||
# 治理可视化 P0 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
agentctl 治理状态此前仅输出 JSON,CURRENT 并行认领表 done 行滞留(R04),MCP 缺少 queue/claim/cleanup/catalog 只读巡览工具。本轮实现人类可读渲染、`brief`、`claim archive` dry-run/apply 路径与 MCP +4。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
1. `--format table` 对 status/queue/claim/cleanup 输出可读表且默认 json 兼容。
|
||||
2. `brief` 聚合 daemon/tasks/cleanup/drift。
|
||||
3. `claim archive` 默认 dry-run,按 retain-days 筛选 done 行。
|
||||
4. MCP tools/list 含 queue_list、claim_status、cleanup_report、catalog_drift。
|
||||
5. 工程工具单测全绿。
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS: Linux;Python 3;worktree `.worktrees/governance-visibility-p0-2026-09-24`
|
||||
- 层级:验证契约「工程工具验收」——`unittest discover -s scripts/tests`
|
||||
- 不适用产品 PI 全链路(NOT REQUIRED:纯 scripts/.doc 工程工具)
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
- table 模式含任务/队列表头;json 默认不变
|
||||
- brief 为 Markdown 一页
|
||||
- archive dry-run 返回 eligible_count 与 candidates
|
||||
- 单测 226 OK(含新增 11 项 visibility)
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### TC1 status --format table
|
||||
|
||||
- **Input**: `python3 scripts/agentctl.py status --format table`
|
||||
- **Actual Output**:
|
||||
|
||||
```
|
||||
=== status --format table ===
|
||||
agentctl status main=/home/weichen/projects/Agent-System epoch=a994d494-0d9 version=1
|
||||
|
||||
## tasks active=1 closed=152 total=153
|
||||
task owner state worktree branch
|
||||
----------------------------------- ------ ------ ---------------------------------------------- ------------
|
||||
governance-visibility-p0-2026-09-24 Cursor active .worktrees/governance-visibility-p0-2026-09-24 feature/gove
|
||||
|
||||
## runs live=0
|
||||
(no live runs)
|
||||
|
||||
## queue depth=0
|
||||
(queue empty)
|
||||
|
||||
## policy loaded=ok revision=agent-governance-2026-09-23-fav-constraint-restored
|
||||
```
|
||||
|
||||
- **Verdict**: PASS
|
||||
- **Duration**: <1s
|
||||
|
||||
### TC2 brief
|
||||
|
||||
- **Input**: `python3 scripts/agentctl.py brief`
|
||||
- **Actual Output**:
|
||||
|
||||
```
|
||||
=== brief ===
|
||||
# agentctl brief (2026-09-24 13:25)
|
||||
|
||||
- daemon: **ok** manager.lock.held=True queue pending=0
|
||||
- tasks: active=1 blocked=0 live runs=0 integrate queue=0
|
||||
- cleanup pending: 4 / 4 worktrees
|
||||
- MATRIX drift hard alerts: 0
|
||||
|
||||
## Active tasks
|
||||
- `governance-visibility-p0-2026-09-24` owner=Cursor state=active wt=.worktrees/governance-visibility-p0-2026-09-24
|
||||
|
||||
## Blockers / alerts
|
||||
- cleanup backlog: 4 worktrees not removable
|
||||
|
||||
## Integrate queue
|
||||
- (empty)
|
||||
```
|
||||
|
||||
- **Verdict**: PASS
|
||||
|
||||
### TC3 claim archive dry-run
|
||||
|
||||
- **Input**: `claim archive --task governance-visibility-p0-2026-09-24 --retain-days 7`
|
||||
- **Actual Output** (节选 JSON):
|
||||
|
||||
```
|
||||
=== claim archive dry-run ===
|
||||
{"archive_file": ".doc/archive/ops/2026-09-21-current-history.md", "candidates": [{"branch": "feature/initial-load-performance-plan", "eligible": true, "line": "| Codex | 2026-09-17-initial-load-performance-plan | feature/initial-load-performance-plan | .worktrees/feature-initial-load-performance-plan | loading-performance-audit | done |", "mutex": "loading-performance-audit", "owner": "Codex", "parsed_date": "2026-09-17", "reason": "older_than_7d", "status": "done", "task": "2026-09-17-initial-load-performance-plan", "worktree": ".worktrees/feature-initial-load-performance-plan"}], "done_scanned": 85, "eligible_count": 1, "include_undated": false, "retain_days": 7, "skipped": [{"branch": "feature/non-author-closeout-2026-09-24", "eligible": false, "line": "| Cursor | non-author-closeout-2026-09-24 | feature/non-author-closeout-2026-09-24 | .worktrees/non-author-closeout-2026-09-24 | docs+git:dev | done |", "mutex": "docs+git:dev", "owner": "Cursor", "parsed_date": "2026-09-24", "reason": "within_retain_window", "status": "done", "task": "non-author-closeout-2026-09-24", "worktree": ".worktrees/non-author-closeout-2026-09-24"}, {"branch": "feature/inte
|
||||
```
|
||||
|
||||
- **Verdict**: PASS(done_scanned=85,eligible_count=1,默认不改文件)
|
||||
|
||||
### TC4 MCP tools/list
|
||||
|
||||
- **Input**: NDJSON `tools/list` against `scripts/mcp/agentctl-mcp.mjs`
|
||||
- **Actual Output**:
|
||||
|
||||
```
|
||||
catalog_drift
|
||||
catalog_overlap_ack
|
||||
catalog_overlap_probe
|
||||
catalog_requirement_add
|
||||
catalog_search
|
||||
catalog_status
|
||||
claim_status
|
||||
cleanup_report
|
||||
docs_apply
|
||||
docs_snapshot
|
||||
lease_run
|
||||
quarantine_status
|
||||
queue_enqueue
|
||||
queue_list
|
||||
status
|
||||
task_close
|
||||
task_register
|
||||
validate
|
||||
---
|
||||
has queue_list true
|
||||
has claim_status true
|
||||
has cleanup_report true
|
||||
has catalog_drift true
|
||||
```
|
||||
|
||||
- **Verdict**: PASS
|
||||
|
||||
### TC5 unittest suite
|
||||
|
||||
- **Input**: `python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v`
|
||||
- **Actual Output**: `Ran 226 tests in ~132s` → **OK**
|
||||
- **Verdict**: PASS
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 套件 | 结果 |
|
||||
|---|---|
|
||||
| `scripts/tests` unittest discover | 226 OK |
|
||||
| visibility 新增 | 11 OK |
|
||||
| 产品 go test / 真实 PI | NOT REQUIRED(工程工具) |
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
P0 验收达标。后续按 [.doc/ops/short-term/2026-09-24-governance-console-plan.md](../ops/short-term/2026-09-24-governance-console-plan.md) 实施 P1(serve/SPA/claim new/integrate prepare/pi packet)。证据附件:`.doc/test-reports/assets/2026-09-24-governance-visibility-p0/`。
|
||||
@@ -0,0 +1,73 @@
|
||||
# 非编制成员访问放行(deny_only_submit)测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
项目成员无编制职责时,上传/总结/对话及受控草稿编写被误拦;权限不足经 `writeDocGovError` 误报 **HTTP 400**。根因为错误映射缺失与 run/edit 职责门禁过宽(三道门协同)。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
1. `ErrOnlyAuthorCanEdit` 等权限哨兵映射为 **403**。
|
||||
2. 非编制成员可:上传资产、真实 PI 跑 intake、保存草稿正文。
|
||||
3. 非编制成员 **不可** 送审;编制人可送审。
|
||||
4. 前端只读意图优先、403 文案引导「可草稿、送审需编制人」。
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
| 项 | 值 |
|
||||
|---|---|
|
||||
| OS | Linux |
|
||||
| 隔离 PG | gate-pg `:5436` 临时库(测完 DROP) |
|
||||
| PI Runner | `http://127.0.0.1:18865` MiniMax-M2.7-highspeed |
|
||||
| 代码 tip | `feature/non-author-member-access-2026-09-24`(已祖先于 local `dev`) |
|
||||
| 层级 | 工程单测 + PG 集成 + 真实 PI 产品链路(验证契约产品 PI 基线) |
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
| 步骤 | 预期 |
|
||||
|---|---|
|
||||
| guest 上传 | 2xx |
|
||||
| guest `POST /tasks/run` intake | HTTP 200,产物标题非空(准入门禁放行) |
|
||||
| guest `POST /docgov/content` | 200 |
|
||||
| guest `POST /docgov/submit-review` | **403** + `DOC_DUTY_FORBIDDEN` |
|
||||
| zhanggong submit | 200 / eng 送审成功 |
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### 5.1 真实 PI:`TestNonAuthorMember_PiAgent_RunEditSubmitGates`
|
||||
|
||||
- **测试输入**:隔离 `TEST_DATABASE_URL` + 真实 pi-agent;成员 `guest`,编制人 `zhanggong`
|
||||
- **实际输出**(摘自 `assets/2026-09-24-non-author-member-access/piagent-e2e.log`):
|
||||
|
||||
```
|
||||
✓ [1. upload] non-author member asset upload OK
|
||||
✓ [2. run] non-author member pi-agent intake doc=doc_proj6011_bd_intake success=false title="用户初始需求收集表" pending_author=false elapsed=1h8m51s
|
||||
✓ [3. edit] non-author member SaveDocumentContent OK
|
||||
✓ [4. submit denied] non-author member submit → 403 DOC_DUTY_FORBIDDEN
|
||||
✓ [5. submit author] designated author submit OK
|
||||
--- PASS: TestNonAuthorMember_PiAgent_RunEditSubmitGates (4131.60s)
|
||||
PASS
|
||||
```
|
||||
|
||||
- **评价判定**:PASS(步骤 2 `success=false` 为质量/产物字段语义,HTTP 与标题已证明 run 门禁对成员放行,与本任务目标一致)
|
||||
- **性能与耗时**:约 4132s(含 PI 生成)
|
||||
|
||||
### 5.2 工程单测 / 门禁
|
||||
|
||||
| 套件 | 判定 |
|
||||
|---|---|
|
||||
| `go test ./internal/projectinstance ./internal/docgov` | PASS |
|
||||
| `go test -short ./internal/server` | PASS |
|
||||
| 隔离 PG `GoverningAccess` / StageAccess | PASS |
|
||||
| `./scripts/arch-check.sh --mode block` | PASS |
|
||||
| `go test -short ./...` | PASS |
|
||||
| 前端 `taskRunErrorInfo` / `templateMatch` / `useSendMessage` | PASS (43) |
|
||||
| `npm run build` | PASS |
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
见上表;产品 PI 用例 `TestNonAuthorMember_PiAgent_RunEditSubmitGates` 为本次授权交付主证据。
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
- **结论**:deny_only_submit 三道门协同放行已用真实 PI 验收;400→403 与前端文案已覆盖。
|
||||
- **后续**:`success=false` 但有标题的 PI 结果可单独排查质量投影;运行中成员租约需在送审前释放(用例已覆盖)。
|
||||
@@ -0,0 +1,60 @@
|
||||
# 本机 PI Subagent 执行器验证报告
|
||||
|
||||
日期:2026-09-24。task_id:subagent-workflow-standard-2026-09-24;操作任务:subagent-workflow-standard-2026-09-24-executor。
|
||||
代码提交:`69ffaa677e23a1dd9aa0528bb09b3acfcd38b119`。真实模型请求的材料来自 `52462b45e985f596b2a503fc70ac12c3bd5fe571`;输入材料提交与执行器版本分开。测试期间执行器文件冻结,随后原样提交,代码摘要见客户端证据。
|
||||
|
||||
## 范围与结论
|
||||
|
||||
Cursor Auto 经项目 MCP 自动读取模型配置、派发本机 PI、取回持久报告的 CLI 链路通过。代码实施/修复由 Cursor 承担,PI 工具与输入范围受限,M3 默认禁用且未调用。
|
||||
这是个人工程工具验收,不代表产品 PI Agent Runner、产品 UI、PG 持久性或发布门禁通过。未重建服务、修改产品模型或 push。
|
||||
|
||||
## 环境
|
||||
|
||||
gmktec / Linux;PI 0.85.1;Cursor CLI 2026.09.18-9a7762b;Node v26.9.0;Python 3.14。
|
||||
入口:scripts/pi_subagents.py、scripts/mcp/pi-subagents-mcp.mjs、scripts/pi-subagent-readonly.ts。
|
||||
[配置](../ops/2026-09-24-subagent-model-config.md) · [运行说明](../ops/2026-09-24-pi-subagent-executor.md)。
|
||||
模型身份来自 PI 结构化消息与调用参数的比对,不是服务商内部路由的独立证明。
|
||||
|
||||
## 实际执行结果
|
||||
|
||||
| 检查 | 命令 / 输入 | 结果 | 证据 |
|
||||
|---|---|---|---|
|
||||
| 完整工程回归 | python3 -B -m unittest discover -s scripts/tests -p 'test_*.py' -v | 173 tests / OK / exit 0;111.229 秒 | [日志](assets/pi-executor-2026-09-24/engineering-tests.txt) |
|
||||
| 提交后专项回归 | python3 -B -m unittest discover -s scripts/tests -p 'test_pi_subagents.py' -v | 34 tests / OK / exit 0;38.229 秒;HEAD=69ffaa67 | [日志](assets/pi-executor-2026-09-24/committed-focused.txt) |
|
||||
| 架构门禁 | ./scripts/arch-check.sh --mode block | exit 0;archtest 两组通过 | [日志](assets/pi-executor-2026-09-24/arch-check.txt) |
|
||||
| JS / 差异 | node --check scripts/mcp/pi-subagents-mcp.mjs;git diff --check | exit 0 | 本报告及最终检查 |
|
||||
| Cursor 工具发现 | agent mcp list-tools pi-subagents | 3 个工具可发现 | [客户端证据](assets/pi-executor-2026-09-24/cursor-dispatch.json) |
|
||||
| MCP 研究 | real-mcp-research-02 | Qwen3.8-Flash 返回目录声明及标记;早期 ls 误拒已保留并在最终链路重验 | [收据](assets/pi-subagents/subagent-workflow-standard-2026-09-24-executor/real-mcp-research-02/receipt.json) |
|
||||
| MCP 测试 | real-mcp-test-01;Python 检查文件及 env 隔离 | GLM-5.3-Flash;命令 exit 0,PI_ISOLATED_TEST_PASS;非产品测试 | [收据](assets/pi-subagents/subagent-workflow-standard-2026-09-24-executor/real-mcp-test-01/receipt.json) |
|
||||
| MCP 规划 | real-mcp-plan-01 | Qwen3.8-Max 正确总结 Cursor/M3/升级规则并返回 MODEL_PLAN_OK | [收据](assets/pi-subagents/subagent-workflow-standard-2026-09-24-executor/real-mcp-plan-01/receipt.json) |
|
||||
| 禁用角色 | real-mcp-disabled-01 / auxiliary | ROLE_DISABLED、isError=true,未调用 M3 | [汇总](assets/pi-executor-2026-09-24/live-mcp.json) |
|
||||
| Cursor Auto 完整派发 | roles → run → result;cursor-auto-research-02;无 model_override 或 shell PI 替代 | succeeded;Qwen3.8-Flash;ls/read 均 isError=false;CURSOR_PI_AUTOMATION_OK | [报告](assets/pi-subagents/subagent-workflow-standard-2026-09-24-executor/cursor-auto-research-02/report.md) · [工具调用](assets/pi-executor-2026-09-24/cursor-dispatch.json) |
|
||||
|
||||
PI 单测使用明确的假传输;Git/锁/进程/MCP 为隔离实测,真实模型请求另列。未操作 Cursor IDE 页面。
|
||||
|
||||
## 覆盖与审查
|
||||
|
||||
回归覆盖配置/角色/循环校验、M3 越权拒绝、注册/租约/伪造身份、冻结 SHA、路径穿越/秘密/符号链接、TS 守卫合法根目录和负例、输出上限/超时/存活子进程、终止事件、PID 身份/只读查询、幂等/损坏收据/配置重载、环境白名单、测试与模型快照隔离、命令失败不可被模型叙事升级、MCP 主仓入口及拒绝原因。
|
||||
命令 pass/commands_passed 只表示显式命令结果;必需用例、任务验收与人工批准另判。non-test 模型完成仍为 pending/not_applicable。
|
||||
|
||||
Cursor Auto 实施,Codex 主机复核完整差异和测试;本机 GLM-5.3 独立审查只读守卫:[原审查](assets/pi-executor-2026-09-24/guard-review.json)。有效目录/默认路径候选已通过隔离与 inventory 检查落实;paths[] 不属于实际 PI 内置 schema,其假设不当作已证实漏洞,接口另外拒绝未知路径载体。最终修复由主机与回归确认,未声称 GLM 对整套最终代码出具通过结论。
|
||||
|
||||
## 失败过程及修复
|
||||
|
||||
- 初版路径规范化问题用假文件复现并修复,没有读取真实敏感文件;其它进程、环境、幂等和判定问题见[主记录](../audit/2026-09-24-pi-executor-boundaries.md)。
|
||||
- 第一次 GLM 整包审查 300 秒超时,无完整结果,不记 PASS;改为有完整返回的分段审查与主机复核。
|
||||
- 第一次 Cursor 会话未挂载工具。list-tools 证明本机 CLI 未展开 ${workspaceFolder};本次新入口改为相对路径并启用本工作区 pi-subagents 后通过。[官方 CLI MCP 文档](https://cursor.com/docs/cli/mcp)描述共用配置,本机行为以实际命令为准。
|
||||
- 合法目录枚举的两次失败分别来自 exact-root 判断和内部扩展污染模型快照;修复、新回归和最终 Cursor 调用证明 ls/read 正常,旧收据保留。
|
||||
- 部分 Cursor 编码客户端退出后留下语言服务子进程,agentctl 正确保留 recovery_required;host 仅核对/终止本任务记录的进程组后 recover,没有删锁或杀他人进程。
|
||||
|
||||
## 交付边界
|
||||
|
||||
dev 集成已完成,精确提交与验证见下节。模型分工已确认,流程整体草案未因此自动全仓生效。
|
||||
执行器不是全套 S0–S9 审批状态机,也不是 OS 沙箱;批准测试代码属于可信执行面。本版不直接操作共享环境或自动安装依赖。PI 获得命令摘要/日志引用,完整日志由主 Agent 核验并按需补充上下文,不能用预览证明所有必需用例。
|
||||
原始 Cursor 会话、模型 thinking 不入 Git;只留必要工具调用/结果/摘要。未归档凭证、业务正文或敏感截图。
|
||||
|
||||
## dev 集成验证(2026-09-24)
|
||||
|
||||
候选及首次 dev 集成 SHA:5a8540804ee2d142a0894c1482a2a16e8f843915;第一父提交 c1a70e67e5edfd4a4c52fe087933e92f3c6d1e9c。agentctl validate 在干净候选运行完整 scripts/tests、node --check、arch-check --mode block,全部 exit 0;原始输出见[候选验证日志](assets/pi-executor-2026-09-24/dev-candidate-validation.txt)。FEATURE-MATRIX 相对基线无变化,CURRENT 与 ISSUES 保留已有行。随后 agentctl integrate 以期望基线检查和 ff-only 推进 dev。
|
||||
|
||||
本节收口只改文档与归档日志,后续收口候选验证确认执行器、MCP、规则及测试文件相对已测候选完全一致;无需重复模型调用或产品部署。
|
||||
@@ -0,0 +1,135 @@
|
||||
# [功能/模块名称] 单二进制化(dev)测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
将 dev 环境从「app/events/pi-agent + system-db 容器」切换为:`agent-server` 单二进制(嵌入 `web/dist`、进程内 events)、brew `postgresql@18`+pgvector 自管(`LOCALPG_MODE=managed`)、本机 PI sidecar;三环境模型统一为 MiniMax-M2.7-highspeed。test/main 容器形态本轮不动。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
- `./scripts/build-single-binary.sh` / `go build` 产出 `bin/agent-server`
|
||||
- `./scripts/launch.sh --no-docker` 拉起 localpg + PI sidecar + agent-server + Vite
|
||||
- 容器 `shuimu-context-pg-dev` 数据经 `migrate-dev-db.sh` 迁入本机 `:5433`(volume 保留可回退)
|
||||
- `/api/v1/health` `/api/v1/ready`、PI sidecar `/health`、前端 `:3100`、真实 Runner 聊天
|
||||
- 共享 KB `shuimu-kb-shared` 保持运行
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
| 项 | 值 |
|
||||
|---|---|
|
||||
| OS | Linux 7.0.0-31-generic |
|
||||
| Worktree | `.worktrees/single-binary-dev-impl-2026-09-24` |
|
||||
| Task | `single-binary-dev-impl-b-2026-09-24` |
|
||||
| PG | Homebrew postgresql@18.6 + pgvector;`DATA_DIR=…/data/dev`;socket=`$XDG_RUNTIME_DIR/as-pg-5433` |
|
||||
| PI | 本机 `pi` CLI **0.87.1**(容器曾 pin 0.85.1;差异已记录) |
|
||||
| 模型 | MiniMax-M2.7-highspeed(`.env` / sidecar health / compose defaults) |
|
||||
| 层级 | 工程 smoke(`go test` localpg/server)+ dev 集成全链路 |
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
- health/ready:`database_ready`、`events_ready`、`kb_ready` 为 true
|
||||
- 迁移后 goose ≥ 容器 dump 时版本(67);启动后可继续 Up 到仓库最新
|
||||
- PI health:`model_id=MiniMax-M2.7-highspeed`,`has_token=true`
|
||||
- 聊天可触发 sidecar `[runner] Starting pi run … model: MiniMax-M2.7-highspeed`
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### 5.1 容器 → localpg 迁移
|
||||
|
||||
- **输入**:容器 goose=67、public tables=111;`pg_dump -Fc` → restore
|
||||
- **实际输出**:restore 后 goose=67、tables=111;扩展 COMMENT 权限告警 3 条(可忽略)
|
||||
- **判定**:PASS
|
||||
- **备注**:随后 agent-server 启动继续 goose Up → **70**(00068–00070,含 00068 `StatementBegin` 修复)
|
||||
|
||||
### 5.2 `launch.sh --no-docker`
|
||||
|
||||
- **输入**:`LOCALPG_MODE=managed ./scripts/launch.sh --no-docker`
|
||||
- **实际输出**(摘要):
|
||||
|
||||
```
|
||||
模式: --no-docker(localpg + PI sidecar + agent-server + Vite)
|
||||
✅ PI sidecar 就绪
|
||||
✅ 后端已启动并通过健康检查
|
||||
⏭️ Vite 已运行于 :3100
|
||||
```
|
||||
|
||||
- **判定**:PASS
|
||||
- **耗时**:约 15s(含停容器 app/events/pi-agent)
|
||||
|
||||
### 5.3 Health / Ready
|
||||
|
||||
- **输入**:`curl http://127.0.0.1:8080/api/v1/health` / `ready`
|
||||
- **实际输出**(关键字段):
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"env": "dev",
|
||||
"agent_backend": "pi-agent",
|
||||
"kb_ready": true,
|
||||
"database_ready": true,
|
||||
"schema_version": 70,
|
||||
"schema_ready": true,
|
||||
"events_ready": true
|
||||
}
|
||||
```
|
||||
|
||||
- **判定**:PASS(`vault_*` false 为本机无 vault,与本轮范围无关)
|
||||
|
||||
### 5.4 PI sidecar
|
||||
|
||||
- **输入**:`curl http://127.0.0.1:18865/health`
|
||||
- **实际输出**:
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"service": "shuimu-pi-agent-runner",
|
||||
"model_id": "MiniMax-M2.7-highspeed",
|
||||
"has_token": true
|
||||
}
|
||||
```
|
||||
|
||||
- **判定**:PASS
|
||||
|
||||
### 5.5 Vite
|
||||
|
||||
- **输入**:`curl -o /dev/null -w '%{http_code}' http://127.0.0.1:3100/`
|
||||
- **实际输出**:`200`
|
||||
- **判定**:PASS
|
||||
|
||||
### 5.6 真实 Runner 聊天
|
||||
|
||||
- **输入**:admin 登录后 `POST /api/v1/chat`(非寒暄短句)
|
||||
- **实际输出**:HTTP 200,约 2.8s;sidecar 日志:
|
||||
|
||||
```
|
||||
[runner] Starting pi run in workspace: …/dialogue/… model: MiniMax-M2.7-highspeed
|
||||
```
|
||||
|
||||
- **判定**:PASS(真实 PI runner 已调用)
|
||||
|
||||
### 5.7 共享 KB / 回退面
|
||||
|
||||
- `shuimu-kb-shared`:仍 Up(`:5432`)
|
||||
- `shuimu-context-pg-dev`:Exited(volume 未删);回退:`docker compose -f docker-compose.dev.yml -p agent-dev up -d system-db`
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 检查 | 结果 |
|
||||
|---|---|
|
||||
| `go vet`(localpg/eventsconsumer/server/cmd) | PASS(无输出) |
|
||||
| `go test -short ./internal/localpg/ ./internal/server/ -run TestResolve\|TestMode\|TestEnsure\|TestStatic\|TestEmbed` | PASS |
|
||||
| arch-check block | NOT REQUIRED(本轮未改 arch 注册表;依据验证契约工程工具补充) |
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
**结论**:dev 单二进制非容器路径可测可用——localpg、进程内 events、embed 静态回退、PI sidecar、模型统一均已验证;容器 system-db 已停并保留 volume。
|
||||
|
||||
**后续**:
|
||||
|
||||
1. 将 `launch --no-docker` 作为日常默认入口;docker 模式保留回退
|
||||
2. configs/agents 模板 embed(backlog)
|
||||
3. PI CLI 0.87.1 vs 容器 0.85.1:差异可接受;必要时 `npx @earendil-works/pi-coding-agent@0.85.1`
|
||||
4. test/main 仅配置 pin 已对齐;运行形态下轮再议
|
||||
|
||||
**证据路径**:`.tmp/launch/{server,pi-sidecar,launch-no-docker,migrate-dev-db}.log`(worktree 本地,未入库)
|
||||
@@ -0,0 +1,88 @@
|
||||
# 管理员设置页与维护公告系统 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
dev 单二进制模式下需要:1)管理台持久化并热更新模型/Tavily 等 .env 类设置;2)维护计划到期后用 FD 交接共用 HTTP 端口,公告页接管后可由管理员 token 启动新服务并下线公告。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
- Secret 掩码与审计指纹不落明文
|
||||
- PI runner `/admin/reload` 热更新
|
||||
- maintenance 调度与状态 API
|
||||
- 真实 FD handoff:父进程 → maintpage → stub server,同端口 health 恢复
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS: Linux;Go 短测 + arch-check block;handoff E2E 非 short
|
||||
- 层级:工程工具 / 单元 + 真实 handoff 进程间交接(验证契约工程工具补充)
|
||||
- 产品 PI 全链路:NOT REQUIRED(本任务为管理面与运维能力,非产品 Agent 工作流)
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
| 用例 | 预期 |
|
||||
|---|---|
|
||||
| sysadmin secret | List 掩码、审计 sha256 |
|
||||
| arch-check | block PASS |
|
||||
| handoff E2E | maintpage active → token start → health ok |
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### 5.1 sysadmin / maintenance / handoff 单测
|
||||
|
||||
- **输入**: `go test -short ./internal/sysadmin/ ./internal/maintenance/ ./internal/handoff/`
|
||||
- **实际输出**: 均 `ok`
|
||||
- **判定**: PASS
|
||||
|
||||
### 5.2 server 设置回归
|
||||
|
||||
- **输入**: `go test -short ./internal/server/ -run TestAdminSystemSettings`
|
||||
- **实际输出**: `ok`
|
||||
- **判定**: PASS
|
||||
|
||||
### 5.3 arch-check
|
||||
|
||||
- **输入**: `./scripts/arch-check.sh --mode block`
|
||||
- **实际输出**: `arch-check block: production gate passed`
|
||||
- **判定**: PASS
|
||||
|
||||
### 5.4 runner reload
|
||||
|
||||
- **输入**: `node deploy/pi-agent/tests/reload.test.mjs`
|
||||
- **实际输出**: `reload.test.mjs PASS`
|
||||
- **判定**: PASS
|
||||
|
||||
### 5.5 真实 FD handoff E2E
|
||||
|
||||
- **输入**: `go test ./internal/handoff/ -run TestRealFDHandoffE2E -count=1 -v -timeout 30s`
|
||||
- **实际输出**(摘录):
|
||||
|
||||
```
|
||||
=== RUN TestRealFDHandoffE2E
|
||||
maintpage listening (mode=maintenance) window=1
|
||||
--- PASS: TestRealFDHandoffE2E (0.55s)
|
||||
PASS
|
||||
ok chat-agent-system/internal/handoff 0.549s
|
||||
```
|
||||
|
||||
- **判定**: PASS
|
||||
- **证据**: [.doc/test-reports/assets/2026-09-25-admin-settings-maintenance/handoff-e2e.log](./assets/2026-09-25-admin-settings-maintenance/handoff-e2e.log)
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 套件 | 结果 |
|
||||
|---|---|
|
||||
| go test sysadmin/maintenance/handoff | PASS |
|
||||
| go test server (settings) | PASS |
|
||||
| arch-check --mode block | PASS |
|
||||
| node reload.test.mjs | PASS |
|
||||
| TestRealFDHandoffE2E | PASS |
|
||||
|
||||
前端全量 `npm test`:本环境无本地 `tsx` 安装时部分用例未跑;`client.test.ts` 经 `npx tsx` 抽检 PASS。完整前端需在 `web/` 依赖就绪后补跑。
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
授权范围内工程验收达标:设置白名单扩展、runner 热更新、维护调度与 FD 交接共端口已用真实进程证据验证。后续可选:Go 侧 embedding key 进程内热载;compose 容器模式 settings 推送。
|
||||
|
||||
## 八、 集成备注 (Integration Note)
|
||||
|
||||
- 首次 `queue enqueue` 因 integrate worktree 瞬时 DIRTY_TREE 失败;清理后以本注记提交新 tip 重入队。
|
||||
@@ -0,0 +1,90 @@
|
||||
# 对话上下文注入智能体 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
核查确认项目成员对话几乎不进入智能体小队工作区;`projectcontext` 快照虽采集对话但默认不 Referenced。本轮落地清洗分层注入、冲突裁决与 HITL 路由。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
1. 清洗过滤私有/噪声/阶段不可见消息,保留元数据轮次与事实抽取
|
||||
2. 工作区写出 `context/dialogue/` 与权威度指引
|
||||
3. 冲突裁决:黑板胜对话;同级时间相近需 HITL;卡片限额生效
|
||||
4. 紧急关闭开关默认 on / off 可关
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS: Linux;Go 模块单测
|
||||
- 层级:工程工具 / Go 包单测(验证契约「工程工具验收补充」)
|
||||
- **真实 PI 全链路**:本批标记为后续获 `env:dev` 授权后补跑(NOT REQUIRED for 本批代码合入;见结论)
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
| 用例 | 预期 |
|
||||
|---|---|
|
||||
| dialoguectx 清洗 | 寒暄/状态卡/私有排除;器械类型事实抽出 |
|
||||
| 阶段过滤 | AllowedStageKey 排除他阶段 |
|
||||
| conflictresolve 权威差 | 黑板胜对话且无 HITL |
|
||||
| conflictresolve 模糊 | NeedsHITL + trigger_user |
|
||||
| 卡片限额 | 最多 3 张 HITL,超额 auto |
|
||||
| squad 工作区 | dialogue 五文件 + README collab_dialogue + TASK.md 导航 |
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### 5.1 dialoguectx
|
||||
|
||||
**输入**:`go test ./internal/dialoguectx/ -count=1`
|
||||
|
||||
**实际输出**:
|
||||
```
|
||||
ok chat-agent-system/internal/dialoguectx 0.002s
|
||||
```
|
||||
|
||||
**评价判定**:PASS
|
||||
**耗时**:~2ms
|
||||
|
||||
### 5.2 conflictresolve
|
||||
|
||||
**输入**:`go test ./internal/conflictresolve/ -count=1`
|
||||
|
||||
**实际输出**:
|
||||
```
|
||||
ok chat-agent-system/internal/conflictresolve 0.002s
|
||||
```
|
||||
|
||||
**评价判定**:PASS
|
||||
|
||||
### 5.3 squad dialogue 落盘
|
||||
|
||||
**输入**:`go test ./internal/squad/ -count=1 -run TestPrepareWorkspaceWritesDialogueContext`
|
||||
|
||||
**实际输出**:包级 `ok chat-agent-system/internal/squad`(含本用例)
|
||||
|
||||
**评价判定**:PASS
|
||||
|
||||
### 5.4 关联包编译
|
||||
|
||||
**输入**:`go test ./internal/bizdev/ -short`、`./internal/coordinator/`、`./internal/ctxmgr/`
|
||||
|
||||
**实际输出**:均 `ok`
|
||||
|
||||
**评价判定**:PASS(编译与短测)
|
||||
|
||||
### 5.5 真实 PI / PG 集成
|
||||
|
||||
**评价判定**:未运行(NOT REQUIRED 本批;需 env:dev 迁移 goose 00071 后补)
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 套件 | 结果 |
|
||||
|---|---|
|
||||
| `go test ./internal/dialoguectx/` | PASS |
|
||||
| `go test ./internal/conflictresolve/` | PASS |
|
||||
| `go test ./internal/squad/` | PASS |
|
||||
| `go test ./internal/bizdev/ -short` | PASS |
|
||||
| `go test ./internal/coordinator/` | PASS |
|
||||
| `go test ./internal/ctxmgr/` | PASS |
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
- 本批代码路径与单测达标;FEATURE-MATRIX 行以 `partial` 登记。
|
||||
- 后续:dev 环境应用 goose 00071;选真实项目跑 `system_reqs`/`test_manager` 核验 `context/dialogue/` 落盘与冲突确认卡;可选 jev assist 浸泡。
|
||||
@@ -0,0 +1,85 @@
|
||||
# P7 Server 镜像字段增量收口 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
MATRIX `module-batches-ag` 行尾注遗留「Server 镜像字段增量收口另立任务」:`internal/server.Server` 结构镜像了 `app.Runtime` 的 24 个领域服务字段(`gov/svc/pwSvc/instSvc/...`),batch A(2026-09-22)时因「多数 docgov/bizdev HTTP 仍直调引擎」保留。现由总控计划 P7 批次授权收口。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
1. `Server` 删除全部 Runtime 镜像字段后编译、vet 干净。
|
||||
2. server 包行为不变:short 全量 + race 全量 PASS。
|
||||
3. 相邻包(app/chat/intent 链路)无回归。
|
||||
4. 全仓 short 无回归(含 goose 迁移可加载)。
|
||||
5. 架构门禁 `arch-check --mode block` PASS。
|
||||
6. 附带修复验证:既有 DATA RACE(Shutdown vs 后台循环)消失;goose 00071 版本冲突解除。
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS:Linux 7.0.0-31-generic;Go 1.27.1(linuxbrew)。
|
||||
- 被测 worktree:`.worktrees/server-image-field-closeout-2026-09-25`(base dev `44161d2a`)。
|
||||
- 层级:工程工具改动层(Go 单测 + race + 架构门禁 + 工程脚本单测),按验证契约不适用产品 PI 全链路。
|
||||
- 用例矩阵:
|
||||
|
||||
| # | 用例 | 命令 |
|
||||
|---|---|---|
|
||||
| T1 | server short | `go test -short -count=1 ./internal/server/` |
|
||||
| T2 | server race(含修复验证) | `go test -race -short -count=1 ./internal/server/` |
|
||||
| T3 | 相邻包 | `go test -short -count=1 ./internal/app/... ./internal/chat/... ./internal/intent/...` |
|
||||
| T4 | 全仓 short | `go test -short -count=1 ./...` |
|
||||
| T5 | 架构门禁 | `./scripts/arch-check.sh --mode block` |
|
||||
| T6 | 工程工具 | `python3 -B -m unittest discover -s scripts/tests -p 'test_*.py'` |
|
||||
| T7 | race 基线对照 | dev `44161d2a` 临时 worktree 重跑失败用例 |
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
- T1–T6 全 PASS。
|
||||
- T7 基线复现 DATA RACE(证明非本批引入、本批修复有效)。
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### T1 server short
|
||||
- 输入:`go test -short -count=1 ./internal/server/`
|
||||
- 实际输出:`ok chat-agent-system/internal/server 19.946s`
|
||||
- 判定:**PASS**(首轮曾 FAIL `TestCreateFreeformDoc_FailClosedWhenAuthorizerNil`——override nil 语义未区分「未设置/置 nil」,补 `authorizerNil` 位标记后通过)
|
||||
|
||||
### T2 server race
|
||||
- 输入:`go test -race -short -count=1 ./internal/server/`
|
||||
- 实际输出:`ok chat-agent-system/internal/server 232.271s`
|
||||
- 判定:**PASS**
|
||||
|
||||
### T3 相邻包
|
||||
- 实际输出:`ok` × 12(internal/app、app/chatflow、app/docadvance、app/docflow、app/docnotify、app/docproject、app/fav、app/intentflow、app/stageflow、app/uow、chat、intent)
|
||||
- 判定:**PASS**
|
||||
|
||||
### T4 全仓 short
|
||||
- 实际输出:仅 `ok`/`no test files`,无 FAIL
|
||||
- 判定:**PASS**(基线因 goose `00071` 重复 panic `TestBizdevCLIListTasks`;重编号 `00072_2026-09-25-context-conflict-adjudications.sql` 后通过。dev 库已应用至 00070、两个 00071 均未应用,重编号零数据迁移)
|
||||
|
||||
### T5 架构门禁
|
||||
- 实际输出:`arch-check block: production gate passed`
|
||||
- 判定:**PASS**
|
||||
|
||||
### T6 工程工具
|
||||
- 实际输出:`Ran 234 tests in 189.907s / OK`
|
||||
- 判定:**PASS**
|
||||
|
||||
### T7 race 基线对照(附带修复证据)
|
||||
- 输入:dev `44161d2a` 临时 worktree `go test -race -short -count=1 -run 'TestAdminSystemSettings_ListAndUpdate' ./internal/server/`
|
||||
- 实际输出:`WARNING: DATA RACE`,栈:`Shutdown (server.go:471 Write)` vs `startChatTurnSweeper.func1 (chat_turn_sweeper.go:21 Read)`
|
||||
- 判定:**基线 FAIL 复现**(既有债务,非本批引入);本批 `backgroundLoop` 修复后同域用例(`TestAdminSystem*` 全组 + T2 全量)PASS。
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 套件 | 结果 | 通过率 |
|
||||
|---|---|---|
|
||||
| `go test -short ./internal/server/` | PASS | 100% |
|
||||
| `go test -race -short ./internal/server/` | PASS | 100% |
|
||||
| `go test -short ./internal/app/... ./internal/chat/... ./internal/intent/...` | PASS | 100%(12 包) |
|
||||
| `go test -short ./...`(全仓 67 包) | PASS | 100% |
|
||||
| `arch-check --mode block` | PASS | — |
|
||||
| 工程脚本单测 | PASS | 234/234 |
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
- 结论:P7 达到授权交付终点——`Server` 24 个镜像字段删除、574 处调用点迁访问器、附带修复既有 DATA RACE 与 goose 版本冲突,全部验证绿。
|
||||
- 后续:batch-plan 愿景中的「handler 迁 `internal/app` 用例层」在镜像字段移除后可独立推进,不再受本债务约束;建议列入 backlog 而非本轮。
|
||||
@@ -0,0 +1,50 @@
|
||||
# P8 U9–U12 剩余键逐键放量 测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
MATRIX `intent-plan-u9u12` 行(done / deferred_enhancement)尾注:`document.review.approve/reject`、`document.final.approve/reject`、`document.proposal.decide`、`workflow.switch`、`run.restart` 仍为 validated_only(dry-run)。总控计划 P8 授权逐键放量:每键独立 flag + 真实引擎路由,禁 full 一次放量。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
1. 默认 flag 全 OFF 时新键保持 dry-run(不进 live 集合)。
|
||||
2. 逐键 flag 独立打开只放量对应键。
|
||||
3. 新键路由真实领域引擎(docgov 状态机 / projectworkflow / taskrun)。
|
||||
4. 幂等重放返回同收据;flag OFF 时零状态推进。
|
||||
5. 既有基线键行为不变;arch-check PASS。
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS:Linux 7.0.0-31-generic;Go 1.27.1。
|
||||
- 被测 worktree:`.worktrees/u9u12-keys-rollout-2026-09-25`(base dev `9f7bbc25`)。
|
||||
- 层级:工程层 Go 单测(真实 docgov 引擎内存实例);真实 dev PI 逐键证据在本批 flag 落 configs 后采集(另见报告更新)。
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
| # | 用例 | 预期 |
|
||||
|---|---|---|
|
||||
| T1 | 默认 OFF | 5 docgov 键 + 2 run-control 键不在 live 集合;基线 4 键仍在 |
|
||||
| T2 | 逐键 flag | 全开时 7 键 live;只开 review 时 final/proposal 仍 dry-run |
|
||||
| T3 | review.approve live | 文档 reviewing→approving;收据 `docgov:<docID>`;重放同收据 |
|
||||
| T4 | review.approve flag OFF | dry-run 收据非引擎路径;状态零推进 |
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
- T1:PASS(`TestP8LiveKeysDefaultOff`)
|
||||
- T2:PASS(`TestP8LiveKeysPerKeyFlags`)
|
||||
- T3:PASS(`TestP8DocGovReviewApproveLive`;含幂等重放断言)
|
||||
- T4:PASS(`TestP8DocGovReviewApproveDryRunWhenFlagOff`)
|
||||
- 全量回归:`go test -short ./internal/app/... ./internal/intent/... ./internal/coordinator/...` 13 包全 ok
|
||||
- 架构:`arch-check --mode block` production gate passed
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 套件 | 结果 | 通过率 |
|
||||
|---|---|---|
|
||||
| `go test -run 'TestP8' ./internal/app/` | PASS | 4/4 |
|
||||
| app/intent/coordinator 短测 | PASS | 100%(13 包) |
|
||||
| arch-check block | PASS | — |
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
- 结论:代码层达到交付终点——逐键 flag 机制 + 真实引擎路由 + 单测验收全绿。
|
||||
- 后续:`configs/.env.dev` 逐键打开 flag(先 review,后 final/proposal/switch/restart)采集真实 PI 证据;证据齐后在 MATRIX 行尾注登记「已 live 键集」扩展。`run.resume` 的自然语言触发证据仍欠(既有尾注遗留)。
|
||||
@@ -0,0 +1,95 @@
|
||||
# 阶段推进 AdvisorBrief 空指针 panic 修复测试报告
|
||||
|
||||
- task: `fix-stage-brief-nil-panic-2026-09-25-r2`(合入 `dialogue-context-injection-2026-09-25-r2` scope;独立分支 `fix/fix-stage-brief-nil-panic-2026-09-25` 因 scope 硬重叠并入持有者任务执行)
|
||||
- date: 2026-09-25
|
||||
- tested_worktree: `.worktrees/dialogue-context-injection-2026-09-25`
|
||||
- base: `725181de`(dev tip;本 worktree 分支 tip `dc29b84c` 之上)
|
||||
- verdict: PASS
|
||||
|
||||
## 一、 测试背景
|
||||
|
||||
总控批次规划(`planned-tasks-closeout-plan-2026-09-25`)P0 项:dev 基线 `TestBizDev_CaseRecommendation_FullLink_E2E` 稳定 panic,阻塞所有后续批次的测试可信度。
|
||||
|
||||
## 二、 测试目标
|
||||
|
||||
1. 确认 panic 根因并修复;
|
||||
2. 意图误判层根因(问句被 `做.*报价` 误判为 ADVANCE_STAGE)一并修复;
|
||||
3. 回归无新增失败。
|
||||
|
||||
## 三、 测试方案与环境
|
||||
|
||||
- Linux 7.0.0-31-generic;Go 1.27.1(linuxbrew)
|
||||
- 层级:工程工具/单元(非产品 PI;验证契约工程修复口径)
|
||||
- 用例:新增回归 `TestCoordinatorEngine_AdvanceStageNilBriefNoPanic` + 既有 E2E 复跑 + 关联包全量
|
||||
|
||||
## 四、 预期结果
|
||||
|
||||
- nil brief 推进返回 accepted + 降级文案,不 panic;
|
||||
- 问句「我们之前做过类似的…吗?型检和报价大概怎么定的?」路由到 QUERY_SIMILAR_CASES;
|
||||
- E2E `TestBizDev_CaseRecommendation_FullLink_E2E` 全绿。
|
||||
|
||||
## 五、 实际测试结果与判定
|
||||
|
||||
### 5.1 panic 复现(修复前,dev 基线 725181de 同样复现)
|
||||
|
||||
**输入**:`go test -run 'TestBizDev_CaseRecommendation_FullLink_E2E' ./internal/bizdev/`
|
||||
|
||||
**实际输出**(节选):
|
||||
|
||||
```
|
||||
panic: runtime error: invalid memory address or nil pointer dereference
|
||||
internal/coordinator/engine_stage.go:306 +0x240c
|
||||
internal/coordinator/engine.go:281 +0x1fb4
|
||||
internal/chat/session.go:467 +0x21b0
|
||||
internal/bizdev/case_recommend_e2e_test.go:133 +0x2425
|
||||
```
|
||||
|
||||
**评价判定**:FAIL(存量缺陷,非本批引入)
|
||||
|
||||
### 5.2 根因
|
||||
|
||||
1. **panic 层**:`engine_stage.go:306` 裸解引用 `stageRes.AdvisorBrief.MaturityHeadline`;空 `executedArtifacts` 时 `primaryArtifact=nil → stageBrief=nil`。
|
||||
2. **意图层**(修复 1 后暴露):问句「…报价大概怎么定的?」被 `matchAdvanceStage` 的 `做.*报价` 命中(「定」∈`做.*`)误判 ADVANCE_STAGE,进入无产物阶段推进路径。
|
||||
|
||||
### 5.3 修复
|
||||
|
||||
1. `engine_stage.go`:`stageRes.AdvisorBrief != nil` 分支保护 + 降级文案「未生成阶段级参谋简报」。
|
||||
2. `intent/recognizer_matchers_task.go`:新增 `isInterrogative`(句尾 ?/吗/呢 + 疑问词表),`matchAdvanceStage` 疑问句直接不匹配。
|
||||
|
||||
### 5.4 回归测试(新增)
|
||||
|
||||
**输入**:`go test -run 'TestCoordinatorEngine_AdvanceStageNilBriefNoPanic' -v ./internal/coordinator/`
|
||||
|
||||
**实际输出**:
|
||||
|
||||
```
|
||||
=== RUN TestCoordinatorEngine_AdvanceStageNilBriefNoPanic
|
||||
2026/09/25 01:50:24 INFO coordinator_route intent=ADVANCE_STAGE ... channel=SQUAD_FIXED
|
||||
--- PASS: TestCoordinatorEngine_AdvanceStageNilBriefNoPanic (0.00s)
|
||||
PASS
|
||||
```
|
||||
|
||||
**评价判定**:PASS
|
||||
|
||||
### 5.5 原 E2E 复跑
|
||||
|
||||
**输入**:`go test -run 'TestBizDev_CaseRecommendation_FullLink_E2E' ./internal/bizdev/`
|
||||
|
||||
**实际输出**:`ok chat-agent-system/internal/bizdev 0.063s`
|
||||
|
||||
**评价判定**:PASS(案例推荐 + AdvisorBrief 注入断言全过)
|
||||
|
||||
## 六、 自动化测试套件汇总
|
||||
|
||||
| 套件 | 结果 |
|
||||
|---|---|
|
||||
| `go test ./internal/intent/` | PASS |
|
||||
| `go test ./internal/coordinator/` | PASS |
|
||||
| `go test ./internal/bizdev/` | PASS(含原 panic E2E) |
|
||||
| `go test ./internal/squad/ ./internal/dialoguectx/ ./internal/conflictresolve/ ./internal/ctxmgr/` | PASS |
|
||||
| `go test ./internal/chat/` | FAIL:`TestChatSession_SemanticMemoryRecallAndAsyncTurnRecord` —— **dev 基线 725181de 同款失败(存量,与本修复无关,已对照确认)** |
|
||||
|
||||
## 七、 测试结论与后续
|
||||
|
||||
- P0 达到授权交付终点:panic 消除 + 意图误判修正 + 回归绿。
|
||||
- 存量遗留:chat 语义记忆异步轮记录用例失败(独立问题,登记为后续批次候选,不冒充本批 PASS)。
|
||||
@@ -0,0 +1,50 @@
|
||||
# T20 B5(chat 回合补偿可观测与孤儿扫描)测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
T20 设计 B5:补偿已存在但错误被 `_ =` 静默吞掉;崩溃/超时后 `processing` 孤儿无批量清理,幂等键被永久占位。本批补可观测 + 周期扫描。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
- 补偿失败不再静默(结构化日志字段完整)。
|
||||
- 过期 processing 被批量标 failed;未过期/终态不受影响;重复扫描幂等。
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS:Linux 7.0.0-31-generic;Go 单测(内存模式覆盖扫描语义;PG 路径与内存同构 SQL,属工程工具层)。
|
||||
- worktree `.worktrees/t20-b5-chat-observability-2026-09-25` @ dev `088ff307`。
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
- `TestSweepExpiredProcessingTurns_Memory`:n=1,过期→failed,fresh/completed 不变,二次 0。
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
```text
|
||||
$ go test ./internal/ctxmgr/ -run 'TestSweep' -v
|
||||
--- PASS: TestSweepExpiredProcessingTurns_Memory (0.00s)
|
||||
PASS
|
||||
ok chat-agent-system/internal/ctxmgr 0.003s
|
||||
```
|
||||
|
||||
判定:PASS。
|
||||
|
||||
```text
|
||||
$ go build ./... → exit 0
|
||||
$ go test ./internal/ctxmgr/... → ok(全量含既有 AcquireChatTurn 家族)
|
||||
```
|
||||
|
||||
判定:PASS。
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 套件 | 结果 | 通过率 |
|
||||
|---|---|---|
|
||||
| `go test ./internal/ctxmgr/ -run 'TestSweep' -v` | PASS | 1/1 |
|
||||
| `go test ./internal/ctxmgr/...` | PASS | 全量 |
|
||||
| `go build ./...` | PASS | — |
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
- B5 三件套(可观测、扫描、调度)落地;PG 路径待部署后在共享环境用真实失败注入复核(见部署授权窗口)。
|
||||
- 可选后续:绑定校验(user_message_id 为空的终态 turn)告警——需产品数据支持,暂不实施。
|
||||
@@ -0,0 +1,79 @@
|
||||
# T20 S1 小改批(B11/F1/F8/F4-A)测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
[T20 加固设计](../../system-design/2026-09-22-t20-hardening-design.md) S1 批次四项低风险加固:GET 泄露用户正文(B11)、chat 窗口竞态(F1)、轮询去重与 stats 竞态(F8)、管理员重置密码死按钮(F4-A)。按 `planned-tasks-closeout-plan-2026-09-25` P2 批次推进。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
- B11:GET `/chat/stream` 带 message → 4xx;POST 不回归。
|
||||
- F1:切会话后 loadOlder/loadFullDay/jumpToDate 晚到 resolve 不写 stack/cache。
|
||||
- F8:同 runId 并发轮询只 1 个 in-flight;快切会话旧 stats 不落地;blob URL 异常路径 revoke。
|
||||
- F4-A:UI 无可用重置按钮、无硬编码口令。
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS:Linux 7.0.0-31-generic;Go(仓库 go.mod 版本);Node + tsx。
|
||||
- 层级:工程工具批(Go 单测 + node:test 单测 + tsc 静态检查),按验证契约不触发产品 PI 全链路。
|
||||
- 环境:worktree `.worktrees/t20-s1-small-fixes-2026-09-25` @ dev 基线 `725181de`。
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
- GET+message → 400(含 POST 指引);无 message GET → 400 empty message。
|
||||
- stale loadOlder resolve 后 dayStack/cache 零写入。
|
||||
- in-flight Map 复用同 runId promise;effect cleanup 清空。
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### B11 后端
|
||||
|
||||
```text
|
||||
$ go test ./internal/server/ -run 'TestChatStream_Get' -v
|
||||
--- PASS: TestChatStream_GetMessageQueryRejected (0.09s)
|
||||
--- PASS: TestChatStream_GetWithoutMessageNotLeak (0.09s)
|
||||
ok chat-agent-system/internal/server 0.181s
|
||||
```
|
||||
|
||||
判定:PASS。
|
||||
|
||||
### F1 前端竞态(node:test)
|
||||
|
||||
```text
|
||||
$ node --experimental-strip-types --test src/hooks/useChatWindow.loadOlder.race.test.ts
|
||||
ℹ tests 1 ℹ pass 1 ℹ fail 0
|
||||
```
|
||||
|
||||
判定:PASS(stale resolve 后 `dayStack.length===0`、`cacheWrites.length===0` 断言均过)。
|
||||
|
||||
### Go server 全量(排除环境依赖项)
|
||||
|
||||
```text
|
||||
$ go test ./internal/server/ -skip 'TestPiAgent_FullLifecycle'
|
||||
ok chat-agent-system/internal/server 20.468s
|
||||
```
|
||||
|
||||
判定:PASS。`TestPiAgent_FullLifecycle_MultiRole_RealWorld_E2E` 在 dev 基线(stash 后干净树)同样失败:`kb: required online ... client is offline`,属 KB 离线环境依赖,非本批回归。
|
||||
|
||||
### TypeScript 静态检查
|
||||
|
||||
```text
|
||||
$ tsc --noEmit
|
||||
src/components/admin/console/sections/EnvSettingsSection.tsx(151,19): error TS6133: 'dirty' is declared but its value is never read.
|
||||
```
|
||||
|
||||
判定:基线同款(dev 主目录同报同一条);本批新增/修改文件零错误。
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 套件 | 结果 | 通过率 |
|
||||
|---|---|---|
|
||||
| `go test ./internal/server/ -run 'TestChatStream_Get' -v` | PASS | 2/2 |
|
||||
| `go test ./internal/server/ -skip 'TestPiAgent_FullLifecycle'` | PASS | 全部 |
|
||||
| `node --test useChatWindow.loadOlder.race.test.ts` | PASS | 1/1 |
|
||||
| `tsc --noEmit` | 基线同款 1 错 | 非本批引入 |
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
- S1 四项全部落地并验证:B11/F1/F8/F4-A 均有针对性回归。
|
||||
- F4-B(服务端管理员重置端点)需产品选型后另立任务。
|
||||
- 建议 P3(S2 配置/池批)继续按同模式推进。
|
||||
@@ -0,0 +1,104 @@
|
||||
# T20 S2 配置/池批(B1/B4/B7)测试报告
|
||||
|
||||
## 一、 测试背景 (Background)
|
||||
|
||||
T20 设计 S2 批:B1 伪造 XFF 可绕过登录限流、B4 池无语句超时分级、B7 Shutdown 5s 与 AGENT_TIMEOUT 30m 错配导致滚动重启砍长任务。按 `planned-tasks-closeout-plan` P3 批次实施。
|
||||
|
||||
## 二、 测试目标 (Test Objectives)
|
||||
|
||||
- B1:伪造 XFF + 直连 RemoteAddr ∉ CIDR → key 用 RemoteAddr;∈ CIDR → 解析最右非可信跳。
|
||||
- B4:池 RuntimeParams 注入 statement_timeout=30000;migrate profile 不设超时。
|
||||
- B7:drain = min(AGENT_TIMEOUT,35m)+30s;环境变量覆盖与非法回落正确。
|
||||
- compose 三环境语法有效。
|
||||
|
||||
## 三、 测试方案与环境 (Test Plan & Environment)
|
||||
|
||||
- OS:Linux 7.0.0-31-generic;Go;docker compose v2(仅 config 校验,不启动)。
|
||||
- 层级:工程工具批(单元测试 + 静态 compose 校验),按验证契约不触发产品 PI 全链路。
|
||||
- worktree `.worktrees/t20-s2-config-pool-2026-09-25` @ dev 基线 `c0e556b1`。
|
||||
|
||||
## 四、 预期结果 (Expected Results)
|
||||
|
||||
- 全部新增单测 PASS;既有登录/限流测试不回归。
|
||||
|
||||
## 五、 实际测试结果与判定 (Actual Results & Evaluation)
|
||||
|
||||
### B1 XFF 可信代理
|
||||
|
||||
```text
|
||||
$ go test ./internal/server/ -run 'TestClientIP|TestParseTrusted' -v
|
||||
--- PASS: TestClientIP_NoTrustedCIDR_IgnoresXFF (0.00s)
|
||||
--- PASS: TestClientIP_TrustedProxy_ResolvesXFF (0.00s)
|
||||
--- PASS: TestClientIP_UntrustedDirect_UsesRemoteAddr (0.00s)
|
||||
--- PASS: TestClientIP_AllTrustedChain_FallsBackToFirst (0.00s)
|
||||
--- PASS: TestParseTrustedProxyCIDRs_Formats (0.00s)
|
||||
ok chat-agent-system/internal/server 0.007s
|
||||
```
|
||||
|
||||
判定:PASS(伪造防护核心场景 `UntrustedDirect_UsesRemoteAddr` 覆盖)。
|
||||
|
||||
### B4 池 profile
|
||||
|
||||
```text
|
||||
$ go test ./internal/db/ -v
|
||||
--- PASS: TestDefaultProfile_StatementTimeout30s (0.00s)
|
||||
--- PASS: TestMigrateProfile_NoStatementTimeout (0.00s)
|
||||
--- PASS: TestOpenAppPool_SetsRuntimeParams (0.00s)
|
||||
--- PASS: TestLongStatementTimeout_Default15m (0.00s)
|
||||
(既有迁移测试不回归)
|
||||
```
|
||||
|
||||
判定:PASS。
|
||||
|
||||
### B7 drain 对齐
|
||||
|
||||
```text
|
||||
$ go test ./cmd/server/ -v
|
||||
--- PASS: TestShutdownDrainTimeout_DefaultCapped35m (0.00s)
|
||||
--- PASS: TestShutdownDrainTimeout_FollowsShortAgentTimeout (0.00s)
|
||||
--- PASS: TestShutdownDrainTimeout_EnvOverride (0.00s)
|
||||
--- PASS: TestShutdownDrainTimeout_InvalidEnvFallsBack (0.00s)
|
||||
--- PASS: TestShutdownDrainTimeout_NilCfg (0.00s)
|
||||
```
|
||||
|
||||
判定:PASS。
|
||||
|
||||
### compose 语法
|
||||
|
||||
```text
|
||||
$ for f in dev test main; do docker compose -f docker-compose.$f.yml config --quiet; done
|
||||
三文件 exit 0
|
||||
```
|
||||
|
||||
判定:PASS(main.yml 首次插入点切在双依赖服务之间导致 YAML 错误,已修正到 depends_on 完整块后复验通过)。
|
||||
|
||||
### 登录/限流既有回归
|
||||
|
||||
```text
|
||||
$ go test ./internal/server/ -run 'Login|RateLimit'
|
||||
--- PASS: TestLoginRateLimiter_BlocksAfterMaxAttempts
|
||||
--- PASS: TestLoginRateLimiter_ResetClearsWindow
|
||||
--- PASS: TestLoginRateLimiter_WindowExpiry
|
||||
--- PASS: TestAuthHandlers_LoginAndMe
|
||||
--- PASS: TestAuthHandlers_LoginReturnsCapabilitiesFallback
|
||||
ok chat-agent-system/internal/server 0.285s
|
||||
```
|
||||
|
||||
判定:PASS。
|
||||
|
||||
## 六、 自动化测试套件汇总 (Test Suite Execution)
|
||||
|
||||
| 套件 | 结果 | 通过率 |
|
||||
|---|---|---|
|
||||
| `go test ./internal/server/ -run 'TestClientIP|TestParseTrusted'` | PASS | 5/5 |
|
||||
| `go test ./internal/db/` | PASS | 新增 4/4 + 既有不回归 |
|
||||
| `go test ./cmd/server/` | PASS | 5/5 |
|
||||
| `go test ./internal/server/ -run 'Login|RateLimit'` | PASS | 5/5 |
|
||||
| `docker compose config --quiet` ×3 | PASS | 3/3 |
|
||||
| `go build ./...` | PASS | — |
|
||||
|
||||
## 七、 测试结论与后续优化建议 (Conclusion & Next Steps)
|
||||
|
||||
- S2 三项全部落地:伪造 XFF 无法再分散限流桶;池有 30s 语句超时上限;drain 窗口与长任务量级对齐。
|
||||
- 部署生效需 compose 变更随发布流转(P5 授权窗口);`TRUSTED_PROXY_CIDRS` 生产默认留空(直连安全),接入反代后由运维填网段。
|
||||
- 建议 P4(B3 锁拆分)独立推进,带 `-race` 回归。
|
||||
@@ -0,0 +1,68 @@
|
||||
# T20 S3 锁批(B3 docgov/docrevision 分锁)测试报告
|
||||
|
||||
## 一、 测试背景
|
||||
|
||||
T20 加固设计 B3 指出:`docrevision.Service` 进程级 `sync.Mutex` 与 `docgov.GovernanceEngine` 全局 `RWMutex` 在持锁期间执行 PG hydrate/persist,导致**单文档慢查询阻塞全部文档**的修订/租约路径。本批为 planned-tasks-closeout-plan P4(阶段 A,行为不变)。
|
||||
|
||||
## 二、 测试目标
|
||||
|
||||
1. 按 `doc_id` 分锁后,不同文档的 hydrate/commit 互不阻塞。
|
||||
2. 同一文档内写路径仍然串行(TOCTOU 语义不放松)。
|
||||
3. 既有并发负例(同 etag 竞争 wins=1、idempotent replay、lease busy)不回归。
|
||||
4. `-race` 下无数据竞争。
|
||||
|
||||
## 三、 测试方案与环境
|
||||
|
||||
- OS:Linux;Go 1.27.1(linuxbrew)。
|
||||
- 层级:核心模块并发改造 → 按验证契约 L2/L3(race + 并发负例 + 全量回归)。
|
||||
- 用户目标:P4 批次推进;授权:internal/docrevision + internal/docgov 代码与配套文档合入 dev。
|
||||
- PG 并发用例(`document_commit_concurrency_pg_test`)按其自身 DSN 守卫跳过共享环境,本地 DSN 可用时执行。
|
||||
|
||||
## 四、 预期结果
|
||||
|
||||
| 用例 | 预期 |
|
||||
|---|---|
|
||||
| T1 跨文档不串行 | docA 持锁期间 docB 能获取并释放自己的锁 |
|
||||
| T2 同文档仍串行 | 32 goroutine 临界区计数峰值 ≤1 |
|
||||
| T3 多文档并行提交链 | 4 文档各 10 版,HeadRevisionNo=10,无交叉污染 |
|
||||
| T4 全量 -race 回归 | internal/... 67 包全部 ok,无 FAIL |
|
||||
|
||||
## 五、 实际测试结果与判定
|
||||
|
||||
**T1/T2/T3 新增并发用例**
|
||||
- 输入:`go test -race -count=1 -run 'TestParallel|TestConcurrentDistinct' -v ./internal/docrevision/`
|
||||
- 实际输出:
|
||||
```
|
||||
=== RUN TestParallelHydrateDoesNotSerializeAcrossDocs
|
||||
--- PASS: TestParallelHydrateDoesNotSerializeAcrossDocs (0.05s)
|
||||
=== RUN TestParallelSameDocStillSerialized
|
||||
--- PASS: TestParallelSameDocStillSerialized (0.00s)
|
||||
=== RUN TestConcurrentDistinctDocsCommits
|
||||
--- PASS: TestConcurrentDistinctDocsCommits (0.01s)
|
||||
```
|
||||
- 判定:PASS
|
||||
|
||||
**T4 全量 race 回归**
|
||||
- 输入:`go test -race -count=1 ./internal/...`
|
||||
- 实际输出:无 FAIL 行;`grep -c '^ok'` = 67
|
||||
- 判定:PASS(67/67)
|
||||
|
||||
**过程缺陷(已修复)**
|
||||
- 首轮 race 测试触发 `fatal error: sync: unlock of unlocked mutex`(`ApproverApprove` 显式释放/重取模式下 guard 双重 Unlock)。修复:`docLockGuard` 引入 `sync.Once` 幂等释放。修复后 docgov、docrevision 及全量回归均绿。
|
||||
|
||||
## 六、 自动化测试套件汇总
|
||||
|
||||
| 检查 | 结果 |
|
||||
|---|---|
|
||||
| `go build ./...` | PASS |
|
||||
| `go vet ./internal/docgov ./internal/docrevision` | PASS |
|
||||
| `go test -race -count=1 ./internal/docgov` | PASS |
|
||||
| `go test -race -count=1 ./internal/docrevision` | PASS |
|
||||
| `go test -race -count=1 ./internal/...` | 67 包 PASS |
|
||||
| B3 新增用例(3 个) | 3/3 PASS |
|
||||
| `python3 -B -m unittest discover -s scripts/tests` | NOT REQUIRED(无 scripts/ 变更) |
|
||||
|
||||
## 七、 测试结论与后续优化建议
|
||||
|
||||
- 结论:B3 阶段 A 达成验收(跨文档并行 + 同文档串行 + 负例不回归 + race 干净);可提交集成。
|
||||
- 后续:阶段 B(PG SSOT、锁外 hydrate + 版本 CAS)按设计文档单独评估;可在共享环境部署后采样锁持有时间日志进一步确认收益。
|
||||
@@ -0,0 +1,66 @@
|
||||
# T20 S4 镜像批(代码层)测试报告
|
||||
|
||||
## 一、 测试背景
|
||||
|
||||
T20 加固设计中的 I1(容器以非 root 运行 + 资源限制)与 I4(数据库容器初始化脚本统一)长期未实施,属 planned-tasks-closeout-plan P5 批次。本批完成**代码/compose 层**合入;共享环境部署需另授权。
|
||||
|
||||
## 二、 测试目标
|
||||
|
||||
1. Dockerfile 以 `appuser`(uid/gid 10001)运行应用,不再以 root。
|
||||
2. 三环境 compose 为 app/events 服务声明内存/CPU 限制。
|
||||
3. dev/main 数据库容器 init 挂载统一为 `extensions_init.sql`,表结构改由 app 侧 goose 迁移负责。
|
||||
|
||||
## 三、 测试方案与环境
|
||||
|
||||
- OS:Linux;Docker `docker build --check` + `docker compose config`(静态校验,不启动容器)。
|
||||
- 层级:工程工具改动 → 按验证契约适用 L1(构建/静态校验)+ L2(compose 渲染)。
|
||||
- 用户目标:P5 批次推进;授权范围:代码与 compose 变更合入 dev,不含共享环境部署。
|
||||
|
||||
## 四、 预期结果
|
||||
|
||||
| 用例 | 预期 |
|
||||
|---|---|
|
||||
| T1 `docker build --check` | 无 error/warning,`USER appuser` 前有 chown |
|
||||
| T2 `docker compose config`(dev/test/main) | 渲染出 `mem_limit`/`mem_reservation`/`cpus`;I4 后仅挂 `01-extensions.sql` |
|
||||
| T3 grep 复核 | 无残留 `context_init.sql` / `00001_baseline.sql` 挂载 |
|
||||
|
||||
## 五、 实际测试结果与判定
|
||||
|
||||
**T1 Dockerfile 静态校验**
|
||||
- 输入:`docker build --check deploy/app`
|
||||
- 实际输出:`[+] Building 0.4s (0/0) FINISHED`,无警告输出
|
||||
- 判定:PASS
|
||||
|
||||
**T2 compose 渲染(三环境)**
|
||||
- 输入:`docker compose -f docker-compose.dev.yml config`(test/main 同)
|
||||
- 实际输出(节选,dev):
|
||||
```
|
||||
app:
|
||||
mem_limit: 1500m
|
||||
mem_reservation: 1g
|
||||
cpus: 2.0
|
||||
system-db:
|
||||
volumes:
|
||||
- ./deploy/postgres/extensions_init.sql:/docker-entrypoint-initdb.d/01-extensions.sql:ro
|
||||
```
|
||||
- 判定:PASS(test/main 同样渲染出限制与统一 init 挂载)
|
||||
|
||||
**T3 残留检查**
|
||||
- 输入:`rg -n 'context_init\.sql|00001_baseline\.sql' docker-compose.*.yml`
|
||||
- 实际输出:无匹配
|
||||
- 判定:PASS
|
||||
|
||||
## 六、 自动化测试套件汇总
|
||||
|
||||
| 检查 | 结果 |
|
||||
|---|---|
|
||||
| `docker build --check deploy/app` | PASS |
|
||||
| `docker compose config -q`(dev/test/main) | 3/3 PASS |
|
||||
| `gofmt -l deploy`(若 Go 代码涉及) | NOT REQUIRED(本批无 Go 代码变更) |
|
||||
| `go test ./...`(涉及 Go 变更时) | NOT REQUIRED(同上) |
|
||||
|
||||
## 七、 测试结论与后续优化建议
|
||||
|
||||
- 结论:P5 代码层达成;`integration_state: pending` → 本报告入库后执行 `agentctl validate` + `integrate`。
|
||||
- 部署窗口待办:I1 卷权限冒烟(新卷/已有卷对 uid 10001 可写)、`/health` + 一次写 data。
|
||||
- 后续建议:I6 systemd 备份单元、cap_drop ALL 评估。
|
||||
@@ -0,0 +1,7 @@
|
||||
# 测试报告索引
|
||||
|
||||
本目录归档按 [测试报告规范](../../.cursor/rules/test-reports-standard.mdc) 命名的验收报告:`YYYY-MM-DD-<模块/功能/版本>-test-report.md`。附件在 `assets/<report-slug>/`,不得与报告同层混放。
|
||||
|
||||
检索:按文件名日期 + slug,或 `rg -n '判定|PASS|FAIL' .doc/test-reports`。结构化投影见 agentctl `catalog_tests`(`agentctl catalog status` / backfill)。
|
||||
|
||||
历史命名例外(保留不改):`2026-09-14-controlled-content-ui-acceptance.md`、`2026-09-17-initial-load-performance-baseline.md`。
|
||||
@@ -0,0 +1,19 @@
|
||||
=== INV inventory 2026-09-24T04:15:07Z ===
|
||||
--- dev ---
|
||||
total_users | missing_cred | empty_username
|
||||
-------------+--------------+----------------
|
||||
416 | 263 | 255
|
||||
(1 row)
|
||||
|
||||
--- test ---
|
||||
total_users | missing_cred | empty_username
|
||||
-------------+--------------+----------------
|
||||
9 | 0 | 0
|
||||
(1 row)
|
||||
|
||||
--- main ---
|
||||
total_users | missing_cred | empty_username
|
||||
-------------+--------------+----------------
|
||||
4 | 3 | 0
|
||||
(1 row)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
ok chat-agent-system/internal/auth 0.500s
|
||||
ok chat-agent-system/internal/server 0.852s
|
||||
@@ -0,0 +1,8 @@
|
||||
HTTP 200
|
||||
username chenwei
|
||||
user_id 35
|
||||
must_change_password True
|
||||
has_token True
|
||||
LOGIN_OK
|
||||
password_redacted=true
|
||||
store_path=/run/user/1000/cursor_agent_stores/2a07f859-5ca4-479f-b61d-b5c62ea42dee/files/chenwei-test-temp-password.json
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"ts": "2026-09-24T10:35:42.705540+00:00",
|
||||
"ide_mcp": {
|
||||
"pi-subagents": "ready",
|
||||
"codegraph": "ready",
|
||||
"agentctl": "not_in_ide_cache",
|
||||
"jev": "not_in_ide_cache",
|
||||
"note": "agentctl/jev stdio servers start manually (Content-Length framing) but absent from IDE mcps/ after approve of others"
|
||||
},
|
||||
"pi_subagent_roles": {
|
||||
"ok": true,
|
||||
"config_revision": "subagent-models-2026-09-24-r1",
|
||||
"roles_count": 11,
|
||||
"postToolUse_injected": true
|
||||
},
|
||||
"observed_hook_fields": {
|
||||
"postToolUse.tool_name": "MCP:pi_subagent_roles",
|
||||
"fix": "normalize_tool_name strips MCP: prefix in _lib.py"
|
||||
},
|
||||
"audit_excerpt": [
|
||||
{
|
||||
"hook": "audit-session",
|
||||
"code": "SESSION_AUDIT",
|
||||
"event": "stop",
|
||||
"ts": "2026-09-24T09:34:42.285040+00:00"
|
||||
},
|
||||
{
|
||||
"hook": "audit-session",
|
||||
"code": "SESSION_AUDIT",
|
||||
"event": "stop",
|
||||
"ts": "2026-09-24T10:28:18.049934+00:00"
|
||||
},
|
||||
{
|
||||
"hook": "audit-session",
|
||||
"code": "SESSION_AUDIT",
|
||||
"event": "stop",
|
||||
"ts": "2026-09-24T10:28:22.657265+00:00"
|
||||
},
|
||||
{
|
||||
"hook": "audit-session",
|
||||
"code": "SESSION_AUDIT",
|
||||
"event": "stop",
|
||||
"ts": "2026-09-24T10:30:53.486486+00:00"
|
||||
},
|
||||
{
|
||||
"hook": "pi-receipt-context",
|
||||
"code": "CONTEXT_INJECT",
|
||||
"tool": "MCP:pi_subagent_roles",
|
||||
"ts": "2026-09-24T10:33:59.179726+00:00"
|
||||
},
|
||||
{
|
||||
"hook": "pi-receipt-context",
|
||||
"code": "CONTEXT_INJECT",
|
||||
"tool": "MCP:pi_subagent_roles",
|
||||
"ts": "2026-09-24T10:34:23.849934+00:00"
|
||||
}
|
||||
]
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user