From 6518f6ed0a5a6e9ebe0ef89b2887b9eb7b255e88 Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 5 Oct 2026 10:49:29 +0000 Subject: [PATCH] Fix F2 verify command for the markdown-list token file format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: facts-verify failed closed on first run — the real token file stores keys as markdown bullets ("- ACCESS_TOKEN=..."), so the ^-anchored sed match in the registry never fired; the earlier manual probe had used grep (anywhere-in-line) and passed, which is exactly the drift the registry re-verification exists to surface. Evidence: re-run recorded in the task card — [facts-verify] total=4 pass=4 fail=0 (sha256 919401b838d77909), after fixing the sed pattern to "^[ -]*ACCESS_TOKEN=". Impact: policy/facts.md F2 command now matches the actual file shape and the fact text documents the file format; no behavior change elsewhere. Refs: task card evidence table (failed run sha256 6c61e644395042fa, then pass). --- .task/feature-evidence-driven-gates.md | 47 ++++++++++++++++++++++++++ policy/facts.md | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/.task/feature-evidence-driven-gates.md b/.task/feature-evidence-driven-gates.md index c18ba60e..733da3b8 100644 --- a/.task/feature-evidence-driven-gates.md +++ b/.task/feature-evidence-driven-gates.md @@ -57,3 +57,50 @@ $ printf 'token 0123456789abcdef0123456789abcdef01234567 hello\n' [exit 0 | HEAD ba83a17c11 | sha256:aae6a8955c582b4b] 输出尾部 15 行: token hello ``` +| 2026-10-05T10:48:31Z | `make precheck` | efa701279f | 0 | SELF | d7a230052e4ac220 | + + +``` +$ make precheck +[exit 0 | HEAD efa701279f | sha256:d7a230052e4ac220] 输出尾部 15 行: +make[1]: Entering directory '/home/weichen/projects/Agent-System-Dev-wt-feature-evidence-driven-gates' +[repo] branch=feature/evidence-driven-gates head=efa701279f +[remote] origin/main=602d2ce9c6 ahead=3 behind=0 +[tree] clean submodules_drift=0 uninit=0 +[worktrees] linked=1 +[hooks] core.hooksPath=scripts/hooks(pre-commit/post-merge 实际接线) +[facts] policy/facts.md 4 条事实均在有效期内 +[required-reading] core/baseline.md, workflows/delivery.md §1 +[R0] 602d2ce9c6(完整:602d2ce9c6900343155f2a9c7ccb4f1c83aa4a59) +[verdict] READY — 可建任务工作区:make task-start NAME=feature/your-branch +make[1]: Leaving directory '/home/weichen/projects/Agent-System-Dev-wt-feature-evidence-driven-gates' +``` +| 2026-10-05T10:48:46Z | `make facts-verify` | efa701279f | 2 | SELF | 6c61e644395042fa | + + +``` +$ make facts-verify +[exit 2 | HEAD efa701279f | sha256:6c61e644395042fa] 输出尾部 15 行: +make[1]: Entering directory '/home/weichen/projects/Agent-System-Dev-wt-feature-evidence-driven-gates' +[F1] PASS :: curl -fsS -m 10 https://git-home.u1680832.nyat.app:30319/api/v1/version +[F2] FAIL :: t=$(sed -n "s/^ACCESS_TOKEN=//p" ~/.secrets/gitea); test -n "$t" && curl -fsS -m +[F3] PASS :: GIT_SSH_COMMAND="ssh -i ~/.ssh/home_gitea -o BatchMode=yes" git ls-remote ssh:// +[F4] PASS :: ! curl -fsS -m 8 https://git-panel.u1680832.nyat.app:30319/api/v1/version +[facts-verify] total=4 pass=3 fail=1 +make[1]: *** [Makefile:52: facts-verify] Error 1 +make[1]: Leaving directory '/home/weichen/projects/Agent-System-Dev-wt-feature-evidence-driven-gates' +``` +| 2026-10-05T10:49:21Z | `make facts-verify` | efa701279f | 0 | SELF | 919401b838d77909 | + + +``` +$ make facts-verify +[exit 0 | HEAD efa701279f | sha256:919401b838d77909] 输出尾部 15 行: +make[1]: Entering directory '/home/weichen/projects/Agent-System-Dev-wt-feature-evidence-driven-gates' +[F1] PASS :: curl -fsS -m 10 https://git-home.u1680832.nyat.app:30319/api/v1/version +[F2] PASS :: t=$(sed -n "s/^[ -]*ACCESS_TOKEN=//p" ~/.secrets/gitea); test -n "$t" && curl -f +[F3] PASS :: GIT_SSH_COMMAND="ssh -i ~/.ssh/home_gitea -o BatchMode=yes" git ls-remote ssh:// +[F4] PASS :: ! curl -fsS -m 8 https://git-panel.u1680832.nyat.app:30319/api/v1/version +[facts-verify] total=4 pass=4 fail=0 +make[1]: Leaving directory '/home/weichen/projects/Agent-System-Dev-wt-feature-evidence-driven-gates' +``` diff --git a/policy/facts.md b/policy/facts.md index e6be6d33..16052763 100644 --- a/policy/facts.md +++ b/policy/facts.md @@ -11,6 +11,6 @@ | ID | 事实 | 验证命令 | last_verified | TTL(天) | |---|---|---|---|---| | F1 | Gitea Web/API 可达:https://git-home.u1680832.nyat.app:30319(1.27.3) | `curl -fsS -m 10 https://git-home.u1680832.nyat.app:30319/api/v1/version` | 2026-10-05 | 30 | -| F2 | API token 存在且可用(值在 ~/.secrets/gitea,不入仓不回显) | `t=$(sed -n "s/^ACCESS_TOKEN=//p" ~/.secrets/gitea); test -n "$t" && curl -fsS -m 10 -o /dev/null -H "Authorization: token $t" https://git-home.u1680832.nyat.app:30319/api/v1/user` | 2026-10-05 | 30 | +| F2 | API token 存在且可用(值在 ~/.secrets/gitea,文件为 markdown 列表格式 `- ACCESS_TOKEN=…`,不入仓不回显) | `t=$(sed -n "s/^[ -]*ACCESS_TOKEN=//p" ~/.secrets/gitea); test -n "$t" && curl -fsS -m 10 -o /dev/null -H "Authorization: token $t" https://git-home.u1680832.nyat.app:30319/api/v1/user` | 2026-10-05 | 30 | | F3 | Git over SSH 可达:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/<Repo>.git(key ~/.ssh/home_gitea) | `GIT_SSH_COMMAND="ssh -i ~/.ssh/home_gitea -o BatchMode=yes" git ls-remote ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Development-Guidelines.git HEAD` | 2026-10-05 | 30 | | F4 | 旧端点 git-panel.u1680832.nyat.app:30319 已失效(TLS 握手失败),不得使用 | `! curl -fsS -m 8 https://git-panel.u1680832.nyat.app:30319/api/v1/version` | 2026-10-05 | 180 |