[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GYA56ABP4XP9667BWXESA0":3,"skill-same:01M6GYA56ABP4XP9667BWXESA0":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":24,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":49,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":52,"ownerDescription":53,"updatedAt":54,"install":55,"resources":68},"01M6GYA56ABP4XP9667BWXESA0","detect-a-stale-knowledge-base",null,"Use when a retrieval index may predate the documents it serves. Compares per-document source hashes against the index and flags drifted, deleted and new documents.","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-detect-a-stale-knowledge-base\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-detect-a-stale-knowledge-base\u002FSKILL.md",[19],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01JBSEEDCAT000000000000021","资料检索与研究","SCENARIO","使用场景",[25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"knowledge","stale","base","knowledge base","detect","detect a stale knowledge base","documents","index","use","document","flags","retrieval","it","source","when","new","2026-11-10 10:12:30",false,"---\nname: detect-a-stale-knowledge-base\ndescription: Use when a retrieval index may predate the documents it serves. Compares per-document source hashes against the index and flags drifted, deleted and new documents.\n---\n\n# Detect a Stale Knowledge Base\n\nAn index answers from the corpus as it was at build time, not as it is now. Staleness is invisible until an answer contradicts a document, so it must be measured on a schedule.\n\n## Procedure\n\n1. Store the source hash and mtime per document at ingest, e.g. `sha256sum` of the raw file in the index record.\n2. On each check, recompute the source hashes: `find docs -type f -name '*.md' -exec sha256sum {} + | sort > \u002Ftmp\u002Fnow.sha`.\n3. Diff against the index's recorded hashes to classify each document as `unchanged`, `changed`, `deleted`, or `new`.\n4. Treat `changed` and `deleted` as correctness bugs: the index still serves retired text as current.\n5. Age the drift: if the newest index build is older than the freshness SLO (e.g. 24h for a live KB), alert regardless of diffs.\n6. Report the ratio drifted\u002Ftotal; above a threshold (say 2%) the whole index needs a rebuild, not a patch.\n7. Feed the `changed` set to the incremental refresh path; `deleted` must remove the chunk ids, not just orphan them.\n8. Watch the answer side too: a chunk that cites a source revision that no longer exists is a stale citation.\n9. Schedule the check where the drift cannot be silently skipped — a cron with an alert on non-zero drift.\n10. Record every check to `kb\u002Ffreshness.jsonl` so staleness has a history, not just a current value.\n\n11. Alert on the age of the newest successful build, not only on a diff, so a stopped ingester is caught.\n\n## Pitfalls\n\n- Hashing normalised text instead of the raw file, so a formatting-only change looks unchanged while content moved.\n- Rebuilding on mtime alone; a copied file gets a fresh mtime with stale contents.\n- Removing a document from the index but leaving its chunk ids resolvable, so dead citations still click.\n- Checking freshness only when someone complains, which is after the wrong answer shipped.\n- Trusting a source's own \"updated\" field rather than the bytes you actually ingested.\n- A rebuild that succeeds but writes to a new collection while serving still reads the old one.\n\n- A freshness check that runs but whose exit code is ignored by the scheduler.\n- Treating a document moved between directories as unchanged because the content hash matched.\n\n## Verification\n\n    python3 freshness.py --index index\u002F --docs docs\u002F --slo-hours 24\n    # passes when drift ratio is 0 for unchanged sources and every changed\u002Fdeleted doc is queued for refresh\n\nReport to the user: documents scanned, drift ratio, the list of changed and deleted docs, and the age of the last build.\n","# Detect a Stale Knowledge Base\n\nAn index answers from the corpus as it was at build time, not as it is now. Staleness is invisible until an answer contradicts a document, so it must be measured on a schedule.\n\n## Procedure\n\n1. Store the source hash and mtime per document at ingest, e.g. `sha256sum` of the raw file in the index record.\n2. On each check, recompute the source hashes: `find docs -type f -name '*.md' -exec sha256sum {} + | sort > \u002Ftmp\u002Fnow.sha`.\n3. Diff against the index's recorded hashes to classify each document as `unchanged`, `changed`, `deleted`, or `new`.\n4. Treat `changed` and `deleted` as correctness bugs: the index still serves retired text as current.\n5. Age the drift: if the newest index build is older than the freshness SLO (e.g. 24h for a live KB), alert regardless of diffs.\n6. Report the ratio drifted\u002Ftotal; above a threshold (say 2%) the whole index needs a rebuild, not a patch.\n7. Feed the `changed` set to the incremental refresh path; `deleted` must remove the chunk ids, not just orphan them.\n8. Watch the answer side too: a chunk that cites a source revision that no longer exists is a stale citation.\n9. Schedule the check where the drift cannot be silently skipped — a cron with an alert on non-zero drift.\n10. Record every check to `kb\u002Ffreshness.jsonl` so staleness has a history, not just a current value.\n\n11. Alert on the age of the newest successful build, not only on a diff, so a stopped ingester is caught.\n\n## Pitfalls\n\n- Hashing normalised text instead of the raw file, so a formatting-only change looks unchanged while content moved.\n- Rebuilding on mtime alone; a copied file gets a fresh mtime with stale contents.\n- Removing a document from the index but leaving its chunk ids resolvable, so dead citations still click.\n- Checking freshness only when someone complains, which is after the wrong answer shipped.\n- Trusting a source's own \"updated\" field rather than the bytes you actually ingested.\n- A rebuild that succeeds but writes to a new collection while serving still reads the old one.\n\n- A freshness check that runs but whose exit code is ignored by the scheduler.\n- Treating a document moved between directories as unchanged because the content hash matched.\n\n## Verification\n\n    python3 freshness.py --index index\u002F --docs docs\u002F --slo-hours 24\n    # passes when drift ratio is 0 for unchanged sources and every changed\u002Fdeleted doc is queued for refresh\n\nReport to the user: documents scanned, drift ratio, the list of changed and deleted docs, and the age of the last build.\n",{"name":5,"description":7},"main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fpayments\u002F0xklen-detect-a-stale-knowledge-base",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-14 02:27:51",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill detect-a-stale-knowledge-base",{"tool":61,"command":62},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill detect-a-stale-knowledge-base",{"tool":64,"command":65},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill detect-a-stale-knowledge-base","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-detect-a-stale-knowledge-base\u002FSKILL.md",true,[69,73,79],{"path":70,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":16},"LICENSE","许可证",1063,{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"SOURCE.md","REFERENCE","参考文档",355,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-detect-a-stale-knowledge-base\u002FSOURCE.md",{"path":80,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":81,"sourceHtmlUrl":82},"TRUST.auto.yaml",2217,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-detect-a-stale-knowledge-base\u002FTRUST.auto.yaml",[84,112,135,153,166,176],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":88,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":41},"01M712C436EQYE43342Q4E7GG1","recipe-performance","Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold\u002Fwarm\u002Fbackground-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout\u002Fpaint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FSKILL.md",[],[92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111],"performance","recipe performance","recipe","mm","sentry","harness","app","deterministic","recipes","flow","cold","critical","analysis","tasks","react","browser","layout","screen","network","metamask",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":116,"licenseFileUrl":117,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":41},"01M70XT2F8A5CQZ81JBP98KSW3","mexc-spot-websocket","MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FSKILL.md",[],[121,122,123,124,125,126,127,128,129,130,131,132,133,134],"mexc spot websocket","spot","websocket","api","workflows","public","listen","streams","depth","keys","for","api keys","maintenance","protobuf",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":116,"licenseFileUrl":139,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":41},"01M70XT0MBXN3WZY1BKN0CPNKR","mexc-spot-rest","MEXC Spot REST workflows for public data, signed account requests, orders, wallet\u002Fadmin actions, and secure signing without exposing API keys.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FSKILL.md",[],[143,122,144,145,146,147,148,132,131,130,149,150,151,126,152,125,124],"mexc spot rest","REST","admin","signing","Wallet","requests","actions","secure","data","orders",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":116,"licenseFileUrl":157,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":41},"01M70XSYSVZ2N0N91XCAR2CAK0","mexc-futures-websocket","MEXC Futures WebSocket workflows for public streams, private account\u002Forder\u002Fposition streams, ping\u002Fpong, subscriptions, and depth maintenance.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FSKILL.md",[],[161,162,123,163,164,133,131,165,129,128,126,125],"mexc futures websocket","futures","position","ping","subscriptions",{"skillNo":167,"name":168,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":169,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":41},"01M6H0ZWHVE5W04WG2DKQE2SQC","0xklen-version-and-refresh-sanctions-lists","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FSKILL.md",[],[173,174,175],"refresh","0xklen version and refresh sanctions lists","version",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":180,"sourceHtmlUrl":181,"categories":182,"keywords":183,"publishedAt":41},"01M6H0Z28Q3R8J0S799GJQWXM3","verify-tests-cover-changed-lines","Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FSKILL.md",[],[184,185,186,187,188,189,190,33,191,192,193],"tests","cover","verify tests cover changed lines","verify","coverage","pr","exercise","patch","code","share"]