Fix F2 verify command for the markdown-list token file format

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).
This commit is contained in:
2026-10-05 10:49:29 +00:00
parent efa701279f
commit 6518f6ed0a
2 changed files with 48 additions and 1 deletions
+47
View File
@@ -57,3 +57,50 @@ $ printf 'token 0123456789abcdef0123456789abcdef01234567 hello\n'
[exit 0 | HEAD ba83a17c11 | sha256:aae6a8955c582b4b] 输出尾部 15 行:
token <redacted> hello
```
| 2026-10-05T10:48:31Z | `make precheck` | efa701279f | 0 | SELF | d7a230052e4ac220 |
<!-- evidence:run 2026-10-05T10:48:31Z -->
```
$ 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 |
<!-- evidence:run 2026-10-05T10:48:46Z -->
```
$ 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 |
<!-- evidence:run 2026-10-05T10:49:21Z -->
```
$ 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'
```
+1 -1
View File
@@ -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/&lt;Repo&gt;.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 |