Skip to content

fix: 掃描修正、scan --fail-under 與 JSON-LD 結構診斷(移植 10/23 分支) - #67

Merged
cucuwang merged 1 commit into
mainfrom
claude/geo-integrate-20261101
Nov 1, 2026
Merged

cucuwang merged 1 commit into
mainfrom
claude/geo-integrate-20261101

Conversation

@cucuwang

@cucuwang cucuwang commented Nov 1, 2026

Copy link
Copy Markdown
Owner

摘要

把 10/23 未驗收分支 claude/geo-fix-20261023、claude/geo-jsonld-20261023 中仍需要的部分移植到目前 main,並保留 main 現有的 pre-commit hook 與 JSON-LD 警告合約。

修正

  • 目錄掃描遇到單一檔案解析失敗時不再吞錯回報「沒有找到檔案」。
  • Markdown fenced code(``` 與 ~~~、縮排、未閉合)中的標題與連結不再計入內容。
  • frontmatter title 不是字串(例如 2026)時回退,不再讓 audit 當掉。
  • robots 參數含空白(max-image-preview: none)不再誤判為限制索引。
  • Action 的 min-score 超大輸入先擋下,不再整數溢位後以 0 退出。

新增

  • scan --fail-under <score>:分數門檻閘門,完整報告仍輸出到 stdout。
  • 共用 JSON-LD 解析與結構診斷,附來源行號、區塊編號與物件/graph 路徑。

刻意沒帶過來

  • 舊分支「hook 讀取或掃描失敗就阻擋 commit」:main 採警告後繼續,維持不變。

嚴重度合約

  • scan/audit:malformed JSON 與缺少或空的 @context/@type 為 warning;非物件 root、graph 項目與型別錯誤的值為 critical。
  • audit-build:malformed JSON 與無效 root 維持 FAIL,其他結構診斷為 WARNING。
    已寫入 CHANGELOG 與 docs/methodology.md。

驗證

  • npx vitest run:32 個檔案、583 項全過(main 為 451 項)。
  • npx tsc --noEmit、npm run build、npm run check 通過。
  • 獨立審查另測 Action 門檻 26 組、Markdown fence 32 組、CLI 門檻 13 組邊界,未發現缺陷。

🤖 Generated with Claude Code

取自 claude/geo-fix-20261023(a2cb8b1)與 claude/geo-jsonld-20261023(418d209),
保留 main 的 pre-commit hook 警告行為與 JSON-LD 解析警告合約:
- 目錄掃描不再吞掉錯誤;排除 Markdown fenced code;非字串 title 回退;
  robots 參數含空白不誤判;Action 超大門檻先擋下、不再整數溢位。
- 新增 scan --fail-under;共用 JSON-LD 解析並附行號、區塊與路徑診斷。
- 嚴重度:malformed JSON 與缺少/空的 @context、@type 為 warning;非物件 root
  與型別錯誤的值為 critical;audit-build 新診斷為 WARNING。
測試 32 檔 583 passed,typecheck、build、npm run check 通過。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 1, 2026 12:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@cucuwang
cucuwang merged commit 33d7655 into main Nov 1, 2026
10 checks passed
@cucuwang
cucuwang deleted the claude/geo-integrate-20261101 branch November 1, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants