X corpus refresh
The tool
bashpython bots/anser/scripts/corpus.py refresh --accounts NousResearch Teknium --limit 50 python bots/anser/scripts/corpus.py import --from-json posts.json # no credentials needed python bots/anser/scripts/corpus.py search "web app" --days 90 --top 5 python bots/anser/scripts/corpus.py pack "is hermes free" # citation-ready answer stub python bots/anser/scripts/corpus.py status
refresh shells out to xurl; on auth failure it records stale: true and the
error in data/corpus-state.json instead of leaving a silent gap. pack returns
grounded: false and the "not publicly stated" stub when nothing matches — that
string is the answer.
Procedure
- Pull the latest posts for
NousResearchandTeknium, newest first, withid,created_at,text,url, andis_reply. - Upsert into
data/x-corpus.jsonlkeyed on post id. Append-only; never rewrite an existing line (an edited post is a new record with a note). - Drop replies to unrelated users unless they contain a technical claim; keep reply context one level deep so a quote is not misread.
- Write
data/corpus-state.json:{last_run, newest_id, count, accounts}. - If the API fails, update only
last_runand setstale: true. A stale corpus is stated in answers, never hidden. - Never store DMs, emails, or anything from a protected account.
Verify
wc -l data/x-corpus.jsonl grows or stays equal; newest id moves forward;
every line parses as JSON with a URL.


