mirror of
https://github.com/bitbaum/substrata.git
synced 2026-12-05 09:58:27 +01:00
main
10
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
901e349e6c |
fix(quality,graph): entity quality counts, registry/graph import cycle, repo docs (#425)
Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
4bf1b011cb |
quality: flag likely publisher mistakes with @bitbaum/datakit; re-read sources (#417)
Adds series/no-likely-error (correctness): each series' points run through the shared checks Solon uses, failing a point held as almost surely a mistake. All series pass today. Re-reads every series quote (573 of 574 found; one BLS page unconfirmed), re-dates the claims, and refreshes the sanctions regimes, which had passed their age limits and failed verify on main. Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
14a4ea80b9 |
fix(quality): refuse source links that redirect into the private network (#382)
* fix(quality): refuse source links that redirect into the private network
The data-quality cron (lib/quality/page-text.ts, lib/quality/network.ts)
fetched corpus source URLs with redirect:'follow' and no private-network
guard, so a cited link that 302s to localhost or the cloud metadata service
would have been fetched from the box.
Every quality fetch now goes through guardedFetch: redirect:'manual' and
@bitbaum/ai-kit/web's validateFetchTarget on the first URL and on every hop
(up to 5), per the package-first rule. A refused target is a ReadError
("refused: ..."): pageText reports the quote as unreadable, probeUrl as an
error, without retrying. A failed DNS lookup is rethrown in fetch's shape so
EAI_AGAIN still reads as unresolved (unscored) and ENOTFOUND as broken.
readPage is not used for the body: it refuses PDFs, sends its own user agent
and keeps only the article part of a page, which would change which quotes
are found. Public URLs answer as before (test/quality-network.test.ts).
package-plan.json binds the file under the ai block; README says so.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
* docs(quality): say which network checks go through the SSRF guard
Every check that opens a corpus link uses guardedFetch; the SEC ticker
file and OpenFIGI calls go to fixed hosts. The README said every check.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
3c6860d110 |
refactor(dates): validate and count days with @bitbaum/whenkit (#381)
Seven local copies of the YYYY-MM-DD regex (registry schema, entry vocabulary, graph validation, event rules, event drafts, two quality checks) and three hand-rolled day calculations (price window dayBefore and daysBetween, starter rotation day count) are replaced by whenkit's isISODate, addDays and daysBetween, per the packages-first rule. isISODate also rejects impossible calendar days (2026-02-30), which the regex let through; every stored row still passes. The entry isoDate schema carries JSON Schema format "date", and the printed shape notes YYYY-MM-DD, so the data-entry shape still states the form after the pattern is gone. package-plan.json binds the new files under the dates block. Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8 Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
a053c3390f |
fix(quality): enforce runtime budget and forward request abort signal (#341)
- Align SCHEDULED.budgetMs to 200s (200_000ms) to ensure scheduled quality runs finish well within the 300s box wrapper - Forward request.signal from POST /api/cron/quality to runQuality - Pass signal and remaining time bounds to probeUrl, quotesAt, pageText, secVerdicts, figiVerdicts, and mcsVerdicts - Stop starting new lanes and work in pool when signal is aborted or deadline is reached - Add automated test in test/quality.test.ts verifying budget bounds and signal forwarding |
||
|
|
70258beed0 |
feat(globe): Substrata's globe on the fleet's one renderer, @bitbaum/geo-kit/map (#306)
* wip(globe): Substrata's globe on @bitbaum/geo-kit/map (lockfile follows the 0.3.0 release) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC * feat(globe): Substrata's globe on the fleet's one renderer, @bitbaum/geo-kit/map The world globe moves onto @bitbaum/geo-kit/map 0.3.0, the renderer that was extracted from it and that Solon's commune map already draws with. Seven modules go (cull, trace, motion, pick, input, loop, control); globe-geo and globe-paint keep only Substrata's side (countries keyed by ISO code, the tokens, the hatch, the layer's fills); the sites, routes, figures and pulse stay Substrata's, drawn over the Earth through the renderer's `over` hook and given the first say on a tap or hover through `pickFirst`. The renderer's wiring is its own file (globe-renderer.ts), so Globe.tsx stays under its 300-line ceiling. The globe's geometry tests now live in geo-kit; the ones here test Substrata's side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
c4f7f50435 |
Re-check the stale data honestly, monthly, without a laptop; rank the Ask evals on a fixed day (#247)
* fix(index): rank the Ask evals on a fixed day, and hand every producer the build's now buildChunks(now) keyed its memo by now's day but called the event and quality producers without it, so a caller pinning now still got today's recency and today's date-dependent quality findings. On 2026-10-25 the lapsed 30-day series re-read added 139 quote-checked-recently findings to the index and one pushed science:high-na-euv to sixth for 'How ready is high-NA EUV technology?'. Reproduced at |
||
|
|
c9b421d54f |
feat(atlas): producer sites on the globe, and every chain as a route you can follow (#175)
Producers on the globe - research/producer-places.json places 997 of the 1,167 facility locations in the USGS Minerals Yearbook tables, in 37 countries, from GeoNames (CC BY 4.0), matched offline by scripts/research/geocode-producers.py. - Each point states its precision (the facility, the nearest town, or only the province) and the GeoNames entry it came from. A named province must hold the point, "N km north of X" is applied as an offset, and a bare name with distant namesakes is left out rather than guessed. - test/producer-sites.test.ts fails if a dot lands inside another country. The quality page measures the same through lib/quality/checks-places.ts. - The globe draws sites as dots, or rings when only the province is known. A click flies in close and opens the site's facilities, capacity and both sources in the panel. Chains as routes - app/atlas/chain-route.ts is the one route model: every step two levels up and down, numbered in the order material moves, each placed where it is made. - The diagram (AtlasChain) now reads left to right through every step, with makers inside the bottleneck's card. This fixes the connector that ran through the part suppliers' cards. - "On the globe" lays the same route over the Earth: one lifted arc per hop, a light running input to output, and labels numbered like the panel's list. The globe's input wiring moves to globe-control.ts; sites and routes are painted by globe-overlay.ts. Claude-Session: https://claude.ai/code/session_013Xssd1hFZCUSxqjACjoVBB Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
583df713e1 |
refactor(site): the address lives in lib/site.ts only (#131)
Five files typed the host themselves (BYOK referer, two user agents, a diagram caption, metadataBase). They now read SITE.host / SITE.url, so the move to substrata.ch is a one-line change. Guarded by one-site-host.test.ts (mutation-checked). No behaviour change. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
3cf5c26f49 |
feat(data): quality criteria, automated checks and /data/quality; fix what they found (#116)
* fix(data): correct what the quality checks and a 36-row source sample found - listings: 8 pinned home lines stored a composite FIGI that OpenFIGI cannot resolve (openfigi.com/id 404, ID_BB_GLOBAL mapping empty); pinnedLine now keeps the exchange line's own FIGI (TSMC, UMC, GlobalWafers, ASE, SMIC, Rio Tinto, NKT, TSMC Advanced Packaging) - sanctions: all 49 EU amendment dates were a day early (Brussels-midnight stamps read in UTC); 4 OFAC programmes had empty titles (menu link parsed first) - usgs-producers: wrapped workbook cells were split into bogus facilities (64 fragments -> 5); Chile's copper table had lost Escondida, Spence, Sierra Gorda and 12 more rows behind a 'Continued' commodity cell - events/dependencies: 7 paraphrased quotes replaced with the source's verbatim text; SK Siltron event names its directory company - series: 18 Cameco points get the date their MD&A states - directory: Shin-Etsu Handotai source 404 replaced; Fangyuan careers URL (domain does not resolve) set to null as its evidence already said Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * feat(data): written quality criteria per dataset, automated checks, /data/quality - config/substrata-quality.ts: 15 datasets x 6 criteria (completeness, correctness, provenance, freshness, link health, consistency); each a rule or 'na' with a reason; freshness reuses config/substrata-freshness.ts - lib/quality: pure checks (USGS world sums, quote states the value, names resolve, cross-dataset agreement with USGS) run in verify with a failure-count ratchet (test/quality.test.ts); network checks (links with 3 tries and a blocked/broken distinction, quotes on page, SEC ticker file, OpenFIGI mapping, USGS values on the chapter PDF) run on a rotation via /api/cron/quality - migration 014: research_quality_checks + research_quality_runs (trend) - /data/quality: scores, counts, trend and every failing row with its source and a prefilled correction issue; linked from /data, footer, palette - check-series.ts shares the reader (CDATA and ' ,' fixes found by the sample) - pnpm run quality [-- --network | --all | --json out.json]; no AI anywhere Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |