From 9061c39ef3dd9e49ca9e8d7caff2551e648f880f Mon Sep 17 00:00:00 2001 From: XingfenD Date: Sun, 4 Oct 2026 02:18:08 +0800 Subject: [PATCH] docs(spec): close the P15-A branch review's A1 and A3 advisories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A1 - the four-gate line said `internal/api ~11.0s 含真库集成`. It does not include the real-database integration tests: without TEST_DATABASE_URL they skip silently, and the 11s is the mock path. The wording mattered because it hid the fact that every run in this batch - implementer, task reviewer, fix-forward and controller alike - skipped them, including the two concurrency/TOCTOU guards that §1.6 names as the behavioural evidence for phase six. Replaced with the measured picture: 4 skips in internal/api, 26 `--- SKIP` lines repo-wide, and the full list of the 11 Test functions gated on that variable (cmd 2, api 4, repository 2, service 3). Also recorded the branch review's DB-parity run - base fe810dd 194 PASS/0 FAIL versus HEAD b15c2a8 199 PASS/0 FAIL, +5 being exactly this batch's new guards, state multisets identical - which is the first runtime proof of zero behaviour change on the postgres path; everything before it was static. The pre-merge checklist now has to include a DB-enabled comparison or the next batch skips them again. A3 - fix-evidence/rv-t3-v2-filtered.py prints 6 ORDER VIOLATIONS while the fix report's prose says both trees have 0. The prose is right and the script is the artefact: it assigns repeated text lines to destinations with a greedy pop(0), so identically-named lines land in the wrong bucket. The branch review redid the check with an unambiguous-unique-text method and got pre=0, post=0. Annotated the archived script in place (it lives in the gitignored evidence area, kept for auditability) so nobody cites its violation count as evidence again, and pointed at the review's §12 reproduction method. Post-write checks: 20/20 assertions, 12 table blocks with 0 column anomalies, 8 code fences paired, 28 headings with no duplicates, and the annotated script still passes py_compile. --- docs/specs/2026-10-03-p15a-approve-phases-design.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/specs/2026-10-03-p15a-approve-phases-design.md b/docs/specs/2026-10-03-p15a-approve-phases-design.md index 34f99f9..1e6b5c5 100644 --- a/docs/specs/2026-10-03-p15a-approve-phases-design.md +++ b/docs/specs/2026-10-03-p15a-approve-phases-design.md @@ -11,7 +11,7 @@ ## §0 基线(已实测,2026-10-03 12:50) -**四门**(dockerized `golang:1.24-alpine`,AGENTS.md 硬红线;host Go 1.18 不可用):**`test -z "$(gofmt -l .)"` exit 0**(⚠️ **不能用 `gofmt -l . ; echo $?`**:`gofmt -l` 的语义是「列出需要格式化的文件」,**列出时仍 exit 0**,只在解析失败时 exit 2 → 旧配方的 `gofmt_exit=0` 不是证据。审查者 F3 实测。同时须把 `gofmt -l .` 的**原始输出**一并存证以证明为空)· `go vet ./...` exit 0 · `go build ./...` exit 0 · `go test ./... -count=1` **11 包 ok**(`internal/api` ~11.0s 含真库集成、`internal/service` ~3.7s)。 +**四门**(dockerized `golang:1.24-alpine`,AGENTS.md 硬红线;host Go 1.18 不可用):**`test -z "$(gofmt -l .)"` exit 0**(⚠️ **不能用 `gofmt -l . ; echo $?`**:`gofmt -l` 的语义是「列出需要格式化的文件」,**列出时仍 exit 0**,只在解析失败时 exit 2 → 旧配方的 `gofmt_exit=0` 不是证据。审查者 F3 实测。同时须把 `gofmt -l .` 的**原始输出**一并存证以证明为空)· `go vet ./...` exit 0 · `go build ./...` exit 0 · `go test ./... -count=1` **11 包 ok**(`internal/api` ~11.0s、`internal/service` ~3.7s)。⚠️ **这两个耗时是 mock 路径**:未设 `TEST_DATABASE_URL` 时真库测试**静默 SKIP**(实测 `internal/api` 4 个、全仓 `--- SKIP` 行 26 条)。受该变量门控的 Test 函数**全仓共 11 个**:`cmd` 2(`TestRewrapRotatesVersionsInPostgres`、`TestUserSetRoleCommand`)· `api` 4(`TestFullPublishChainOnPostgres`、`TestHostedPublishChainOnPostgres`、`TestAccountDeletionChainOnPostgres`、`TestAdminConsoleEndpointsOnPostgres`)· `repository` 2(`TestPostgresReactionGated`、`TestUserUsernameBackfillMigration`)· `service` 3(`TestApproveConcurrentOnlyOneWins`、`TestApproveSameWorkIDConcurrent`、`TestApproveOptionalFieldsRoundTrip`)。**「11 包 ok」不等于真库路径被验过**:本批实现者、任务级审查者、fix-forward 与控制者的**所有**跑批都 SKIP 了它们(§1.6 点名的两个并发/TOCTOU 守卫正在其中),直到全分支终审另起 `postgres:16-alpine` 对 base 与 HEAD 各跑全量 `-p 1 -v` 才补上这一层:**base `fe810dd` 194 PASS / 0 FAIL vs HEAD `b15c2a8` 199 PASS / 0 FAIL**(+5 恰为本批新增守卫),状态多重集完全一致、5 个 DB 守卫两树均真跑 PASS —— 这是「零行为变更」在 postgres 生产路径上的第一份运行时证明(此前所有证据都是静态的:T3 语句级比对、needle/标识符计数、mock 路径测试)。**合并前验证清单须含 DB-enabled 对照,否则下一批仍会静默 SKIP。** **目标函数**:`internal/service/moderation.go:47-215` = **169 行**(`wc -l` 口径,P14 spec §5 已钉该口径)。