Skip to content

Scheduled snapshot refresh, offline tests, README kept in step - #64

Draft
RahilBhavan wants to merge 1 commit into
mainfrom
grok/cr-29972269
Draft

RahilBhavan wants to merge 1 commit into
mainfrom
grok/cr-29972269

Conversation

@RahilBhavan

Copy link
Copy Markdown
Owner

Summary

Four things from the request. The README said the stablecoin snapshot "is stale until someone reruns the backfill scripts", and npm test appeared to reach the network.

  1. Scheduled refresh. .github/workflows/refresh-snapshots.yml runs Mondays 06:00 UTC and on demand. It reruns backfill-issuance.mjs (retried once), backfill-context.mjs and snapshot-last-good.ts, rewrites the README figures and the study guide, then runs tsc and npm test. It opens or updates a PR from data/refresh-snapshots, as a draft if a check fails, and opens an issue if the run fails. It never pushes to main. Modelled on dat-accretion's snapshot.yml.
  2. Offline tests. npm test now preloads scripts/no-network.mjs, which makes any fetch, DNS lookup or socket connect throw.
  3. README dates. The README had drifted: it said the event logs were read 2026-10-24, but issuance.json has asOf 2026-10-25, and the event count was 3,212,656 against 3,217,426. Dates, results table, counts and the DefiLlama reconciliation are now generated from src/data by npm run sync:readme. readmeSync.check.ts fails npm test on drift. The study guide date had the same drift and is rebuilt.
  4. "How this was built" README section (see below).

Needs Rahil

  • Confirm or edit "How this was built". An agent drafted it from the git history, ADRs, METHODOLOGY and DEVLOG. It says what Rahil designed (scope, integrity rules, metric definitions) and what was checked independently. The commit history does not show who made each decision, so check those claims. An HTML comment in the README marks it as a draft; delete the comment once confirmed.
  • Secrets: none are needed. Every source is public and keyless (Tenderly public gateway, DefiLlama, FRED, Blockscout, public chain RPCs). I added none and no value appears anywhere.
  • Repo setting: Settings > Actions > General > "Allow GitHub Actions to create and approve pull requests" must be on, or the refresh job cannot open its PR.
  • PRs opened with the workflow token do not trigger ci.yml. The refresh job runs tsc and npm test itself, but lint and build need a close and reopen of the refresh PR.

Finding on the offline request

The request said something still reaches the network. It does not. The [chainSupply] USDY:solana read failed ... Error: timeout line comes from chainSupply.check.ts simulating a failed read with new Error('timeout'). Its last buildRows call did not silence console.warn. I silenced it, and no fixtures were needed. npm test already passed with networking removed (unshare -rn, no interfaces) before this change. The new guard makes the property enforced rather than assumed.

Other changes worth a look

  • issuance.check.ts: the caps on OUSG mints (< $1.45B) and USDY mints (< $260M) were about to trip on normal growth (USDY is $250.1M), which would fail every weekly refresh. They are now sanity caps ($10B and $5B). The floors are unchanged. The "about $1T" headline checks (0.9 to 1.1T, and < 1.25T with CCTP) are kept on purpose as a tripwire for the page copy. When gross volume passes $1.1T the refresh PR will be a failing draft that asks for a copy decision.
  • README reconciliation wording: it said "within 17% for USDC and 7% for PYUSD", but the true diffs are 17.4% and 7.3%. It now rounds up (18% and 8%).
  • README still has one hand-written bullet (the rate-cut sigmas). The refresh PR checklist asks for it to be reread.
  • Not regenerated by the workflow: docs/img/summary.png and the USDC share card.

Checks run (local, Node 26.8.1)

Check Result
npx tsc --noEmit pass
npm run lint pass
npm test (8 check scripts, with the guard) pass
unshare -rn npm test (no network interfaces) exit 0
Guard negative probe: fetch and https.get under the preload both throw; control without it is not blocked
Rehearsal on a scratch copy: backfill-context.mjs, sync:readme, tsc, npm test pass; README dates moved to 2026-10-29 and the reconciliation bullet updated (11% and 3%)

Not run: npm run build (CI does), backfill-issuance.mjs (about 25 to 40 minutes, would rewrite committed data), snapshot-last-good.ts, and the workflow itself on GitHub. The first scheduled or manual run is the real test of the workflow. YAML parses; there is no actionlint here.

I did not use the full-send skill's merge step, per the fixed rules: nothing is merged or deployed.

🤖 Generated with Claude Code

…ates in step

- refresh-snapshots.yml: weekly (Mon 06:00 UTC) and on demand. Reruns the backfill
  scripts and snapshot-last-good, rewrites the README figures and study guide, runs
  tsc and npm test, and opens a PR (draft if a check fails). Needs no secrets.
- npm test preloads scripts/no-network.mjs: any fetch, DNS lookup or socket connect
  throws. The "USDY:solana read failed" line was a simulated failure in
  chainSupply.check.ts whose warning was not silenced; no real call was made.
- readmeSync: README snapshot dates, results table, event counts and the DefiLlama
  reconciliation are generated from src/data; readmeSync.check.ts fails on drift.
  Fixes README (event logs read 2026-10-25, 3,217,426 events) and the study guide date.
- issuance.check.ts: growth-driven upper caps on OUSG and USDY mints loosened so the
  weekly refresh does not trip them; logVsSupply shared with the README.
- README: "How this was built" section, drafted from the history for Rahil to confirm.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ondo-nexus Ready Ready Preview Oct 29, 2026 4:42pm UTC

This branch was successfully deployed

1 active deployment
Preview — ce5382fb Deployed Oct 29, 2026 by vercel[bot]
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.

1 participant