From 9ffae0610d8b6ee28b5f77e0087002d77ea71dd2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Aug 2026 17:31:30 +0000 Subject: [PATCH] =?UTF-8?q?docs(scripts):=20=E6=8C=89=E7=9C=9F=E5=AE=9E?= =?UTF-8?q?=E6=9C=BA=E5=88=B6=E6=94=B9=E5=86=99=E4=B8=A4=E5=A4=84=20Lychee?= =?UTF-8?q?=20=E9=97=A8=E7=A6=81=E6=8F=8F=E8=BF=B0,=E5=B9=B6=E5=88=A0?= =?UTF-8?q?=E6=8E=89=20judgeHref=20=E9=87=8D=E5=A4=8D=E6=B3=A8=E9=87=8A=20?= =?UTF-8?q?(#3587)=20(#3648)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 两处注释称 lychee 是「weekly cron with continue-on-error」,结论「gates nothing」对,机制反了:check-links.yml 里没有任何 continue-on-error,第 77 行 是 fail: true,`on:` 只有 workflow_dispatch + schedule('17 4 * * 0'),push 与 pull_request 被注释掉并附 ⛔ Do NOT enable(#3213 ruling B)。按错误理由行事的 人会去摘一行不存在的 continue-on-error,而真实风险相反 —— 取消注释 pull_request: 会让它立刻变成走网络的硬门禁。 改成同一文件 :194 起已有的正确表述(#3589 头注释措辞):schedule + workflow_dispatch、无 PR 触发器,所以它谁也拦不住。 同时删掉 judgeHref() 里被逐字复制两遍的那 4 行注释(#3629 合并时的重复粘贴)。 纯注释改动,零行为变化;test 那处只改说明文字,断言未动。scripts/ 非发布包且 无用户可见变化,故无 changeset。 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt --- scripts/__tests__/check-doc-links.test.ts | 3 ++- scripts/check-doc-links.mjs | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/__tests__/check-doc-links.test.ts b/scripts/__tests__/check-doc-links.test.ts index effa10c5a2..e29921e84c 100644 --- a/scripts/__tests__/check-doc-links.test.ts +++ b/scripts/__tests__/check-doc-links.test.ts @@ -883,7 +883,8 @@ describe("this repo's own GitHub blob/tree URLs are resolved offline — objectu it('reports the #3507 shape: a tree/main URL to a deleted example', () => { // `examples/crm` and `examples/todo` were deleted in 12b287d8b and the two // links to them stayed dead about three months: this script skipped them by - // scheme, and lychee (weekly cron, continue-on-error) gates nothing. + // scheme, and lychee (`schedule` + `workflow_dispatch`, no PR trigger) blocks + // nobody. expect( rejections({ ...SITE_FIXTURE, diff --git a/scripts/check-doc-links.mjs b/scripts/check-doc-links.mjs index af2a83bab5..df785615be 100644 --- a/scripts/check-doc-links.mjs +++ b/scripts/check-doc-links.mjs @@ -154,11 +154,15 @@ * `https://github.com/objectstack-ai/objectui/(blob|tree)/main/` is an * in-repo reference wearing an external URL's clothes, and it fell between the * two gates (#3507): this script skipped it by scheme, and lychee — the only - * thing that would resolve it — is a weekly cron with `continue-on-error`, so - * it gates nothing. Two such links stayed dead for about three months. The - * backlog was cleared to zero by PR #3509 (25 distinct targets swept, exactly - * the 2 dead), and PR #3506 then introduced 8 more of the shape with nothing - * checking them. This closes that: `` must exist in the working tree. + * thing that would resolve it — is a `schedule` + `workflow_dispatch` workflow + * with no PR trigger, so it blocks nobody. (It is `fail: true`, not a + * soft-failing job: what keeps it off pull requests is the absent trigger, not + * a tolerated failure. #3213 ruling B says keep it that way — uncommenting + * `pull_request:` would turn it into a hard gate over the network.) Two such + * links stayed dead for about three months. The backlog was cleared to zero by + * PR #3509 (25 distinct targets swept, exactly the 2 dead), and PR #3506 then + * introduced 8 more of the shape with nothing checking them. This closes that: + * `` must exist in the working tree. * * It applies to **every** surface, `content/docs` included — the shape is * decidable wherever it is written, and the `escapes-collection` hint above @@ -765,10 +769,6 @@ function judgeHref(href, context) { // and judge what is left with the same `routeExists()` every absolute href // goes through — so `/docs` strictness and the `apps/site` route table apply // here too, on every surface, `content/docs` included. - // A URL on this site is an internal route wearing an origin. Strip the origin - // and judge what is left with the same `routeExists()` every absolute href - // goes through — so `/docs` strictness and the `apps/site` route table apply - // here too, on every surface, `content/docs` included. const siteRoute = siteAbsoluteRoute(href); if (siteRoute !== null) { return routeExists(siteRoute, context) ? null : 'site-absolute-url';