feat(scripts): 002 記分 pre-commit 自動守門(issue 608) - #652
Merged
s123104 merged 1 commit intoJul 6, 2026
Conversation
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
s123104
force-pushed
the
fix/608-002-score-guard
branch
from
July 6, 2026 21:53
aa6a530 to
5d94de5
Compare
Contributor
Author
|
重新觸發 CI(force-push 後 Actions 未收到 synchronize 事件),隨即 reopen。 |
s123104
force-pushed
the
fix/608-002-score-guard
branch
2 times, most recently
from
July 6, 2026 22:12
4f51e30 to
009e341
Compare
Contributor
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
- 新增 scripts/verify-002-log.mjs:驗證 002 檔頭「本次分數變化:+N(reward a、penalty b、neutral c)」 - 與 staged 新增條目前綴計數對帳(a+b+c = 新增條目數、N = a - b),累計總分鏈以 HEAD 前版 + N 驗證 - 條目格式守門:四行模板(日期/ID/原因/解法)、日期 YYYY-MM-DD、ID 全檔唯一;歷史條目不回溯擋 commit - 歷史條目不可靜默刪除:HEAD 條目 ID 必須為 staged 子集(不限標準前綴),缺失列出 ID 並擋下 - 掛入 .husky/pre-commit 第 6 步,僅 002 檔在 staged set 時執行(對齊既有條件執行模式) - 新增 18 例 vitest 單元測試並掛入 test:root;AGENTS.md/CLAUDE.md 同步 6 步驟清單、記分行固定格式 - 文件註記 rebase --continue 不觸發 pre-commit,需手動跑守門腳本或 amend 觸發 測試:npx vitest run scripts/__tests__/verify-002-log.test.ts(18 passed);pre-commit 6 步驟全過 Co-authored-by: Cursor <cursoragent@cursor.com>
s123104
force-pushed
the
fix/608-002-score-guard
branch
from
July 6, 2026 22:23
009e341 to
e90c183
Compare
Contributor
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
This was referenced Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #608
摘要
scripts/verify-002-log.mjs:002 記分自動守門,掛入.husky/pre-commit第 6 步(僅docs/dev/002_development_reward_penalty_log.md在 staged set 時執行,對齊既有 verify-ssot-sync / verify-version-ssot 條件執行模式)。scripts/__tests__/verify-002-log.test.ts,純函式 fixture,沿用 repo scripts 測試慣例)並掛入test:root。AGENTS.md/CLAUDE.md同步:pre-commit 5 步驟 → 6 步驟、002 記分行固定格式與守門規則、rebase--continue不觸發 hook 的手動驗證註記(Documentation Sync Rules MUST)。守門規則
檔頭記分行固定格式:
> 本次分數變化:+N(reward a、penalty b、neutral c)|累計總分:+Ta+b+c= 本次 staged 新增條目數(staged vs HEAD 以 ID 差集判定);a/b/c依條目 ID 前綴reward-/penalty-/neutral-分類N = a − bT=git show HEAD:docs/dev/002...前版累計 +N;前版檔頭為歷史自由格式仍可取累計(相容);初始 commit 情境跳過YYYY-MM-DD、新增條目 ID 前綴必須合法自舉驗證(本 PR 的 002 條目通過自己的守門)
本 PR 新增 002 條目
reward-608-002-score-precommit-guard,rebase 至最新 base(#657/#658 後檔頭 +173)重算為+1(reward 1、penalty 0、neutral 0)|累計總分:+174。commit 時 pre-commit 實錄(rebase 解衝突後依文件註記手動執行node scripts/verify-002-log.mjs通過):擋下證據 1:計數不符(宣稱 reward 3 實際新增 1 筆、總分亂寫 +199)
擋下證據 2:靜默刪除歷史條目(S1——刪一筆歷史條目、檔頭完全不動)
Changeset
不需要:僅 root scripts、husky hook、docs 與 root
package.json的test:root清單,未觸及apps/ratewiseruntime;verify-version-ssot 的isRuntimeChange判定不涵蓋上述路徑,pre-commit Step 5 實測通過、未要求 changeset。並行線注意
fix/content-page-skeleton(#658)已先合;本線作為後合者已 rebase 兩輪並重算檔頭(+170 → +172 → +173 base,各輪守門直接給出正確期望值)。rebase 解 002 衝突後rebase --continue不觸發 pre-commit,需手動node scripts/verify-002-log.mjs或 amend 觸發(已寫入 AGENTS.md/CLAUDE.md)。測試
npx vitest run scripts/__tests__/verify-002-log.test.ts:18 passed(原 15 例+S1 刪除防護 3 例)pnpm --filter @app/ratewise exec vitest run:4814 passed(1 skipped file)