跳到正文
DEV Community· Bryan Hamilton·· 6 小時前AI 評分35

我的首頁寫有 23 個程式碼庫,GitHub 計出 32 個

My Homepage Said 23 Repos. GitHub Counted 32.

AI 導讀

作者核對個人網站上的數字聲稱,發現程式碼庫數目、Facebook 羣組人數及首頁卡片計數均不準確。GitHub API 顯示有 32 個公開程式碼庫,且沒有 fork;Facebook 羣組有 211.9K 名成員,首頁則顯示 20 / 20 張卡片,實際有 22 張。作者用一個 token-gated PHP worker 一次完成 12 項修正,並讓 worker 在成功後自我刪除。

正文

Three days ago I wrote about a number on my own homepage that used to be true. The LCP figure. This week I stopped spot-checking and graded the whole page, because if one number could rot, they all could.

Every claim on my portfolio is typed by a human. Me. And every one of them drifts the moment reality moves and the copy doesn't.

Here's what the audit found.

Three claims, three graders

Claim one: "23 open-source repos extracted from production."

My FAQ even listed them by name. Twenty-one names. Under a "23". I'd shipped repos faster than I'd updated the copy, then updated the copy with a count nobody re-derived from anywhere.

GitHub's API is the grader: 32 public repos, zero forks. The FAQ claimed 23 and enumerated 21. Both numbers wrong, in opposite directions.

Claim two: my community size.

The About section said 212.1K. A stat tile said 212.1K. My GitHub profile badge said 212.7K. Three surfaces, three numbers, one Facebook group. There's no API I can hit for that one - the grader was me, looking at the actual group page: 211.9K. All three copies were wrong.

Claim three: "showing 20 / 20 units."

The rack on my homepage renders my repos as rack units, and a little counter beneath it reports what's showing. There are 22 cards. The counter was a string I typed in an HTML file months ago. Nothing ever recomputed it, because nothing ever needed to - it just sat there, confidently stale.

The fix is one file, and it argues with you

I shipped the corrections the same way I ship everything on my two sites: a single PHP worker, token-gated, that runs a dry mode first and self-deletes after a clean pass. Every patch is needle-guarded. If the text it expects to find isn't there - or appears a different number of times than it should - the worker aborts instead of guessing.

That guard earned its keep. The FAQ sentence I was replacing didn't appear once. It appeared three times: the visible answer, the matching answer inside my FAQPage JSON-LD, and a meta description. A naive replace would have fixed one copy and left two identical lies sitting in machine-readable markup. The worker counted, found three, replaced three, and would have aborted if the count had shifted between my fixture test and the live run.

Twelve fixes. One pass. Then it deleted itself and left a row in my receipts ledger, which is where every change to my sites gets logged - by the code that made it, not by me after the fact.

Why I bother: the numbers are for machines now

Here's the part that changed my mind about how much this matters. My llms.txt and ai.txt tell AI crawlers what my site claims. An answer engine that's assembling "how many open-source repos does Bryan Hamilton publish?" doesn't read my About section for flavor. It reads structured claims, weighs them against other citable sources, and either cites me or doesn't.

If my site says 23 and GitHub's API says 32, I don't get reconciled. I get discarded. The machine doesn't average conflicting sources - it picks the verifiable one and drops the one that disagrees.

I've started calling this AGO - artificially generated optimization. SEO made pages legible to crawlers. AGO keeps claims citable when the reader is a model assembling an answer from fragments. A structured claim that disagrees with the primary source isn't neutral; it's worse than no claim, because it teaches the machine you're noise.

The part that's now a habit

The fix took one worker. The prevention is a rule I've adopted: every number on my site has to have a source that is not my memory. Repo counts come from the GitHub API. Mileage comes from my haversine pipeline. Article counts come from the hub generator. The only number I still verify by hand is the Facebook group size, and that's because Facebook wants it that way - so I checked it, and I'll check it again.

If a number can't name where it came from, it's not a fact. It's a vibe with digits.

Question for the comments: when's the last time you re-derived a number on your own site instead of retyping it? If you can't remember, go count. The answer is probably already wrong.


Evidence, since this series runs on receipts: the live ledger logs every change with the worker that made it, the grader was the GitHub API (public_repos, all non-forks), and the worker pattern that patches, verifies, and self-deletes is open-sourced as guarded-deploy-workers.

來源:DEV Community · dev.to