* fix(layout): keep content clear of the feedback launcher; fit tab labels at 320px
Co-Authored-By: Claude <noreply@anthropic.com>
* test(layout): hold launcher clearance and 320px tab labels at the source
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(quality,graph): entity quality counts, registry/graph import cycle, repo docs (#425)
Co-authored-by: Claude <noreply@anthropic.com>
* fix(layout): keep content clear of the feedback launcher; fit tab labels at 320px
Co-Authored-By: Claude <noreply@anthropic.com>
* test(layout): hold launcher clearance and 320px tab labels at the source
Co-Authored-By: Claude <noreply@anthropic.com>
* style(test): format layout-clearance test
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Explore entity connections and their evidence from profiles
* Open the connection map on the entire entity registry
* Give connections stable identities and expose all registry kinds
Next preloads every link that scrolls into view, and these pages are drawn on
request. Measured in a browser on 2026-11-29: one visit to the home page made
27 preload requests to the server. Solon, built the same way, made 91 to 778
a visit and stopped answering under a handful of readers (solon#643).
components/link.tsx wraps next/link with prefetch={false}; all 167 files that
imported next/link import it instead, and ESLint (no-restricted-imports)
keeps a bare next/link from coming back.
pnpm run verify passes (format, types, lint, 1,144 tests).
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
Co-authored-by: Claude <noreply@anthropic.com>
* feat(comments): page discussion is chatkit's CommentThread
The discussion under notes, learn, resources and profile pages was a
hand-rolled list and a bare <textarea> with no microphone. The fleet rule
is that comments are chatkit's CommentThread and that anywhere a person
types words there is a microphone, so:
- Bump @bitbaum/chatkit ^0.22.1 -> ^0.25.0 (CommentThread arrived in 0.23).
Ask (ResearchChat, AskBox) type-checks and renders unchanged.
- PageDiscussion renders CommentThread: the box is chatkit's Composer with
the microphone (/api/transcribe), Enter-to-send, and a refused post keeps
the draft. Posting still goes to /api/comments, where threadkit's
canWrite decides who may write; a signed-out reader (from /api/me) sees
"Sign in to comment" linking to sign-in and back to the page instead of
a box that only fails on submit. Dates keep the YYYY-MM-DD form and
authors keep "Reader" / "Substrata". Fact-check stays Substrata's and
re-mounts the thread with its new comment.
- Drop the CSS the package now owns (.page-comments, .comment-meta,
.comment-form); bind PageDiscussion under the chat block of
package-plan.json; note it in docs/IMPLEMENTATION-PLAN.md.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
* fix(comments): a refused comment says why, and no sign-in link where sign-in is off
The route's refusals (too short, the hourly limit, sign in) are thrown as
chatkit's CommentRefused, so the thread shows them instead of a generic
"try again" that would fail the same way forever; a comment under the
route's 3-character floor is refused before it is sent. The sign-in link
shows only once /api/me says sign-in exists on this deployment.
Needs @bitbaum/chatkit 0.28.0 (CommentRefused); the bump follows.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
* chore(deps): @bitbaum/chatkit ^0.28.0 (CommentRefused)
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat(research): search through ai-kit's keyless fallback when the box's backends fail
Since 2026-11-11 the box's SearXNG has not answered and there is no paid
key, so the Ask assistant, the event sweep and producer sourcing could not
look anything up. Every web search now walks the configured backends and
then ai-kit's keyless ones (GDELT news, then Wikipedia), from one place:
lib/web-search.ts. Whether looking up is offered still follows the
configured backends (webLookupEnabled, now ai-kit's own defaultProviders),
so a deployment or a test with none makes no request.
Needs @bitbaum/ai-kit 1.25.0 (the dependency bump follows).
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
* fix(health): the web probe walks the same chain as Ask, behind the same gate
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
* chore(deps): @bitbaum/ai-kit ^1.25.0 (keyless search fallback)
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
* test(web-search): type the test env the way next build checks it
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat(contribute): chatkit Composer with microphone for contribution boxes
"Know something, or want us to look?" (Inquire, on bottleneck pages,
empty states and the world panel) and "Send evidence" beside Ask
(ContributeForm) were bare textareas: no microphone, and a different send
from Ask. The fleet rule is that anywhere a person types words there is a
microphone, and the experience belongs to the package, so both now use
chatkit's Composer with the same /api/transcribe voice leg as Ask.
- Enter sends, Shift+Enter breaks the line, as in Ask.
- useContribution.send answers Composer's onSend: a message under 10
characters, a missing consent tick (Send evidence) or a failed request
is said in the box and returns false, so the draft is kept.
- ContributeForm is no longer a <form>, so nothing submits twice; the
optional reply email and credit name stay.
- Inquire reuses useContribution instead of its own copy of the POST.
- The .inquire-form textarea style is dropped: the composer keeps its own look.
- package-plan.json binds Composer in both files.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
* fix(contribute): say the length cap before sending, and start each box clean
Composer has no maxLength, so the inbox's 12,000-character cap is now
checked before the request and said in words. Opening or closing a
contribution box clears an earlier refusal, so it never shows over a new
draft.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
---------
Co-authored-by: Claude <noreply@anthropic.com>
* refactor(charts): draw severity, quality trend and output shares with chartkit
Three charts were still drawn by hand in this app while @bitbaum/chartkit
already ships them, against the packages-first rule (every chart is
chartkit, so a fix made once reaches every product):
- SeverityBar (components/portal/Status.tsx) now draws its 0-12 bar with
chartkit's Meter (showValue off: the number beside it still opens the
severity method). The bar gains a meter role with its value and max.
- The quality run-history Trend (components/quality/Trend.tsx) is
chartkit's LineChart: axis from 80% (or lower) to 100%, dated ticks,
every run's value on hover/focus and in the hidden table. The caption
keeps the old accessible sentence. The hand-drawn SVG's CSS is removed
from app/styles/quality.css.
- Per-country share-of-world-output bars in the quantities profile
module are chartkit Meters (neutral tone, stretched to the row in
app/styles/places.css), with the same "per cent of the published world
total" label.
package-plan.json binds the three files under the charts block.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
* fix(quality): the trend draws each day's latest run
The quality run fires every six hours and chartkit places a point by its
date, so four runs a day stacked on one x. The trend now keeps one point
per day, that day's latest run, and its caption says so.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
---------
Co-authored-by: Claude <noreply@anthropic.com>
The company directory, the data series index and the careers SQL search
each hand-rolled what listkit already ships: facet parsing and validation,
facet counts with the facet's own selection lifted, a "show more" URL rebuilt
from scratch, and a LIKE escape. The package rule says use the package.
- lib/universe/directory.ts: the four filters are a ListSpec (directorySpec);
parseQuery validates them, applyQuery filters, counts and draws the rows.
Typed words stay with searchkit (textFilter), so a slip is still forgiven.
- app/data/series/page.tsx: bottleneck, measure and origin are a ListSpec;
applyQuery and matches replace the hand-written predicate and slice.
- lib/list-more.ts: "Show more" keeps the ?n= URLs and writes the next one
with writeQuery over the reader's params (empty and invalid values dropped).
- lib/careers-query.ts: title search uses likeContains instead of a local
escape.
Same rows for the same URLs: 1890 directory filter combinations compared
old against new, identical rows, matched counts and facet counts. Tests pin
the spec, the ?n= paging and that a comma in typed words is not a list.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
Co-authored-by: Claude <noreply@anthropic.com>
* feat(research): runs record what their search backends did, and /api/health/web says it now
The event sweep and producer sourcing failed for a day on production with
nothing on /data/freshness but "no search reached a search backend".
- Each sweep and sourcing run records its search backends' outcome in
ai-kit's own words (search_note, e.g. "searxng unreachable"); migration
018 adds the column. /data/freshness shows it beside a failing run.
- /api/health/web searches once for a fixed phrase and reports which
backends are configured (names only) and what each did. One probe per
ten minutes, shared by concurrent callers.
- docs/operations/auto-updates.md: what runs, when, what it needs, where
it leaves a trace, and what to do when a run is failing.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
* fix(data-layer): read double-quoted identifiers in migrations
declaredObjects read `CREATE TABLE IF NOT EXISTS "users"` as a table named
"if", so 017-accounts.sql looked incomplete on any database that predates
the ledger: it would be re-run, and the ownership hand-over would miss its
real tables. CI's real-Postgres test caught it once 017 stopped being the
newest file ("must be owner of table accounts").
Tables, indexes, ALTER TABLE targets and added columns may now be quoted.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
---------
Co-authored-by: Claude <noreply@anthropic.com>
The footer was hand-written markup and CSS in the app. It is now the
package's application footer: sitekit owns the layout, link targets and
spacing; Substrata supplies the note, the links and the freshness line.
The local footer-nav CSS is removed; sitekit's variables are mapped to
the design tokens.
Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8
Co-authored-by: Claude <noreply@anthropic.com>
- Respond with HTTP 200 from GET /api/health/freshness while preserving the ok: false payload when feeds or datasets need attention
- Prevent footer FreshnessBadge from triggering 503 Service Unavailable network errors during page browsing
- Update README documentation for /api/health/freshness
- Add automated test in test/freshness.test.ts verifying GET /api/health/freshness returns 200 with the full report
- Add timeout signals for PRICES_RUN_BUDGET_MS and PRICES_PORTION_MS in POST /api/cron/prices
- Propagate per-ticker and per-company timeout signals in fetchAllPrices and refreshMarketFacts
- Check abort signal in gatherHolders, fetchPrices, and openWebFetch
- Use abort-aware sleep in sourceFetch pacing and 429 retry waits
- Add automated tests in test/market-prices.test.ts verifying timeout signals and signal checks
substrata is the designated canary for threadkit; the fleet's rollout gate holds
every adopter until the canary has adopted a new package name. Same code and
version, now published as @bitbaum/threadkit 0.1.1.
Claude-Session: https://claude.ai/code/session_019MDtmvpWNTLxXNfwUHS7MD
Co-authored-by: Claude <noreply@anthropic.com>
- Define PRICES_RUN_BUDGET_MS (200s) and PRICES_PORTION_MS (140s) to keep daily price and fact runs well within the 300s curl timeout of the systemd wrapper
- Forward request.signal from POST /api/cron/prices to fetchAllPrices, refreshMarketFacts, and sourceFetch
- Bound individual fetch timeouts to remaining budget and abort promptly when signal is aborted
- Ensure research_price_runs and research_market_fact_runs always record completion (finished_at = now()) on early exit
- Add automated test in test/market-prices.test.ts verifying runtime budget enforcement and signal forwarding
- Export AUTO_UPDATES_RUN_BUDGET_MS (200s) to keep hourly auto-updates well within the 300s curl timeout of the systemd wrapper
- Forward request.signal from POST /api/cron/auto-updates to runAutoUpdates
- Pass signal and budget bounds down through draftLeads and byokAsk to ai-kit complete
- Stop starting new leads and abort in-flight requests when the budget expires or signal is aborted
- Bound per-request page reads to remaining budget
- Add automated test in test/update-now.test.ts verifying runtime budget enforcement and signal forwarding
- Define JOBS_RUN_BUDGET_MS (200s) to keep daily job board fetches well within the 300s curl timeout of the systemd wrapper
- Forward request.signal from POST /api/cron/jobs to fetchJobs
- Stop starting new board requests and job upserts when the budget expires or signal is aborted
- Bound per-request fetch timeouts to remaining budget
- Ensure research_job_runs always records completion (finished_at = now()) on early exit
- Add automated test in test/careers.test.ts verifying runtime budget enforcement and signal forwarding
- Read candidate pages concurrently with Promise.all in lib/sweep.ts rather than awaiting each serially, bounding page reading time per node
- Add SWEEP_RUN_BUDGET_MS (200s) and budget/signal checking to runScheduledSweep in lib/sweep-store.ts so scheduled runs finish well within the 300s box curl timeout
- Pass request.signal from POST /api/cron/sweep to runScheduledSweep
- Add automated tests in test/sweep.test.ts verifying budget enforcement and concurrent candidate reads
- 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
- Read candidate pages concurrently with Promise.all in lib/source.ts rather than awaiting each serially, bounding page reading time per row
- Define SOURCE_RUN_BUDGET_MS (200s) and budget/signal checking to runScheduledSourcing in lib/source-store.ts so scheduled runs finish well within the 300s box curl timeout
- Pass request.signal from POST /api/cron/source to runScheduledSourcing
- Add automated tests in test/source.test.ts verifying budget enforcement and concurrent candidate reads
- Define SCIENCE_RUN_BUDGET_MS (200s) to keep hourly science feed fetches well within the 300s curl timeout of the systemd wrapper
- Forward request.signal from POST /api/cron/science to fetchScience
- Stop starting bottleneck queries and source fetches when the budget expires or signal is aborted
- Bound per-request fetch timeouts to remaining budget and abort immediately on signal
- Ensure research_science_runs always records completion (finished_at = now()) on early exit
- Add automated test verifying runtime budget enforcement and signal forwarding
- Define FILINGS_RUN_BUDGET_MS (200s) to keep hourly EDGAR fetches well within the 300s curl timeout of the systemd wrapper
- Forward request.signal from POST /api/cron/filings to fetchFilings
- Stop starting feed and registrant requests when the budget expires or signal is aborted
- Bound per-request fetch timeouts to the remaining budget so individual requests do not overrun
- Ensure research_filing_runs always records completion (finished_at = now()) on early exit
- Add automated test verifying runtime budget enforcement and signal forwarding
Substrata created its account runtime with `mail: { configured: false }`, so
the sign-in link, "Forgot your password?" and address confirmation could
never appear, and a forgotten password had no way back.
- lib/auth.ts sends account mail through AccountKit's `createAuthMailer`
(mail-kit, the fleet's RESEND_API_KEY). Without a key the options stay
hidden, as before; confirming an address is never a wall.
- The sign-in, sign-up and account pages pass `mailConfigured()` to
`signInMethods`, and a reset link that lands on /sign-in is no longer
redirected away for a signed-in reader.
- The account journey first asserts every way in the env switches on:
password and passkey always, the link only with mail, "Continue with
OrangeCat" and the shared sign-in button with their clients. CI sets
synthetic, unreachable OIDC clients so both buttons are checked.
- @bitbaum/mail-kit is a direct dependency (AccountKit's optional peer).
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
Co-authored-by: Claude <noreply@anthropic.com>
The site served no manifest, so Android and desktop browsers never offered to install it; it could only be pinned as a bookmark. app/manifest.ts names the app and its colours and points at 192, 512 and maskable 512 PNG icons in public/app-icons/, rasterised from the app's own icon.
Claude-Session: https://claude.ai/code/session_019MDtmreRmsJkmf3AcYy6DS
Co-authored-by: Claude <noreply@anthropic.com>
* feat(auth): Substrata accounts on @bitbaum/accountkit, not only OrangeCat
Readers can create an account with an email and a password or a passkey,
and turn on two-step codes. Continue with OrangeCat stays one way in.
next-auth and lib/identity.ts are gone; /api/auth serves AccountKit's
runtime, and /sign-in, /sign-up and the account panel in
/account/settings are its shared screens in Substrata's look.
Desks, follows, saved AI keys and SUBSTRATA_REVIEWER_ACTOR_IDS stay keyed on
the OrangeCat actor id: legacyIdentityProvider keeps it for anyone whose
first way in was OrangeCat. The six account tables are
scripts/db/017-accounts.sql, additive and re-runnable, applied by the deploy.
Rebuilds the stale draft #184 on current main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
* test(data-layer): the pre-ledger case names the newest migration, not 016
Adding 017-accounts.sql made the test treat 016 as one of the files that
predate the ledger; it now asks for whatever file is newest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat(deploy): the deploy applies migrations, installs timers and runs the one-time price backfill
Before the release goes live, deploy.yml now applies pending scripts/db/*.sql
(one transaction each, recorded in public.schema_migrations, first run checks
existing objects before baselining) and installs deploy/systemd units. A failure
stops the deploy with the live release untouched. After the release, the price
backfill runs once and is recorded in public.schema_oneshots.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* docs: name no migration file that does not exist
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
---------
Co-authored-by: Claude <noreply@anthropic.com>
* refactor(ask): chatkit 0.19 — send handle and initial message, thrown turn failures
Delete lib/chat/drive-composer.ts and useAutoAsk.ts, which typed into
chatkit's composer and pressed Send. /chat?q= is ChatApp's deepLinkParam
(sent at once, as before), the home box's ?send= handoff is its
initialMessage, and "Check this" goes through the ref's send with
newChat. The transport throws ChatTurnError instead of returning a failed
message, so the bubble keeps the server's words and Retry re-sends the
pictures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* fix(ask): an attributed claim is Reported when the source only shows it was said
"Confirmed" over "Gartner estimates a $4.9T gap [W2]" told the reader
the gap was real when the page showed only that Gartner said so. The
writer is told the difference, and code downgrades an attributed
claim's Confirmed to Reported when its source line names the speaker or
reports a saying. Partly and Not found are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* fix(ask): never cut a markdown link in two when dropping sentences
A link whose title held a full stop was split at it; when a guard dropped
the first half the reader saw "…IaaS… ](https://x.com/…))" in the
Reasoning. withoutMaterialFigures, withoutSentencesHolding and
uncitedForecasts split with a bare regex; default-deny masked links
itself. All four now split through lib/chat-agent/sentences.ts, which
masks links (URLs with one level of parentheses included) while
splitting.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* fix(ask): a web chip only on a sentence its page supports
The opening of a screenshot answer ended its generic analysis in [W1],
drawn as a finance.yahoo.com chip, and the page (a stock quote) said
nothing of the kind. Before default deny, a [W#] now stays only on a
sentence that carries a figure the cited passage prints or a name it
gives; otherwise the marker comes off and the sentence is judged as
uncited.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* fix(ask): the panel's chat list is a drawer at every width
ChatApp's rail follows the window (64rem), so in the ~30rem panel on a
desktop the list took half the panel and left the answer a 12rem column.
The panel passes railQuery="not all"; /chat keeps the rail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* docs(changelog): the answer fixes and the panel's chat list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
---------
Co-authored-by: Claude <noreply@anthropic.com>
One JSON file per company in registry/companies, one per area in registry/areas,
validated on load (no cite, no value). The registry is the list; the old filter
is a proposer. The 793 admitted companies are migrated with identical output.
pnpm run company:add resolves identity from Wikipedia and Wikidata. /areas and
/areas/[slug] are new.
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
Co-authored-by: Claude <noreply@anthropic.com>
* feat(markets): a directory of every company in the universe, and an honest count of what each page can show
/markets/directory filters the universe by theme, country, tier and page kind
and searches by name, ticker or theme through searchkit; one column of rows on
a phone, sixty at a time. /data/companies now counts what each page can show
(quote and SEC filings, quote only, identity only) from identifiers alone, and
lists every company considered and out with the test it failed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* fix(markets): the directory's Show more is a 44px target
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
---------
Co-authored-by: Claude <noreply@anthropic.com>
The daily run kept prices and filings for the 28 hand-checked seed lines only;
every other company page read its source live, per request. It now walks the
seed first, then every admitted universe line the price source serves, stalest
first, within its time.
A ticker can be another company's on another exchange, so a line that is not
a seed line is stored and drawn only if the source's own name for the symbol
agrees with the company's; a mismatch is refused with both names. More venue
codes are read (Sao Paulo, Madrid, Milan, Stockholm, Oslo, Warsaw, Johannesburg,
Singapore, Shanghai/Shenzhen by symbol, TSX then TSX Venture).
Each company page gets 'What we do not know yet': every gap with its reason,
the documents that would fill it and a work-queue task, and a 'Why it is here'
sentence built only from the rows that admit it.
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
Co-authored-by: Claude <noreply@anthropic.com>
* feat(company): quote first on a listed company; Ask pill never covers a figure
- A listed company reads like a quote page: name, quote, then the share
price's range row and chart. Its role in the chain (the lede, the five
tiles at a glance, why it is graded so, where the role is cited, and the
update news) moves below Key statistics as "Role in the chain"
(section id chain-role; `role` is already the "What this holds up"
module). Unlisted, identified and stub companies are unchanged.
- From 768px the page column keeps a right gutter as wide as the floating
Ask pill, which sat on NVIDIA's "Largest fall from a peak" at 1440px.
- On a phone the floating pill is hidden again: Ask is the top-bar button
there. The rule was lost in the chatkit move (#140), leaving two Asks and
the pill over the same figure at 390px.
- docs/design/company-page.md follows the new order and the rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* feat(company): a year of closes is a clean line with a light fill
chartkit 0.3.0 (LineChart markers + area): the price chart passes
markers="auto" and area, so a range of more than 60 closes draws no dot
per close (about 120 beads on 1Y before); each close still shows its
value on hover and keyboard focus, and the table holds them all. Short
ranges (1M) keep their dots.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat(markets): a company page that reads like a markets product
The owner, 2026-10-25: "I don't see any beautiful charts on stock
performance … think Bloomberg, think Yahoo Finance", and on NVIDIA's
holders, "'other' is 87%. We have a vague idea of what that means."
Every company page now carries one market frame, in one order, whatever
the company is (docs/design/company-page.md): a header quote (ticker,
exchange, currency, last close, 1-day change, date, "delayed end-of-day ·
Yahoo Finance"), then share price, key statistics, revenue and net income
by year, who owns it, how it does business, and peers. A section with no
data stays and says what source would fill it, with a Send-evidence link.
- Share price: a line chart with one row of six equal range cells
(1M·3M·6M·YTD·1Y·5Y), the page's only client island. Every range is
computed on the server, along with its return, span and largest fall,
the 52-week range, a returns table and the 50/200-day averages
(prices/compute.ts).
- Key statistics: eight equal cells. Market value is computed only where
close × cover shares is the value; otherwise "Not computed" with the
reason. Each annual figure shows its fiscal year, growth and filing.
- Financials: chartkit's new ColumnChart (0.2.0) for five fiscal years
from XBRL, plus rows with growth and margin computed in code.
- Who owns it: holders from 13G/13D/proxy. The remainder is labelled
"Others, each below 5%" in the legend (chartkit's new ShareBars
otherLabel) and explained in its row. A company with no listing shows
the owners the relation graph states.
- How it does business: customers, suppliers, competitors (always), and
stakes, sites and partners from lib/graph, one row anatomy. An empty
group names the filings that would fill it, and points to the quoted
dependency rows where they exist.
- Peers: the same chain step (tier A) or the same theme (tier B), with
last close, 1Y return and a sparkline.
Tier B companies get prices, financials and holders: lib/market-data/company.ts
joins a slug to a listing. It tries the seed first, then the universe
ticker on a venue the price source serves. New venues (US composite,
London, Hong Kong, Korea, Taiwan, Toronto, SIX) are added to Yahoo's
suffixes. Ambiguous venue codes are not guessed. Sections stream in their
own Suspense boundaries, with reads deduplicated per request, so a slow
price source never delays the header. Ask charts link "Open <Company>" to
the page, and the holders bar in answers carries the remainder label.
Verified: pnpm run verify; pnpm run build; test/company-page.test.ts;
scripts/ux/company-layout.mjs at 320/390/768/1440 on NVIDIA, Oklo,
SpaceX, NAC Kazatomprom and a stub, against live Yahoo and SEC.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* docs(design): the header's quote lives in price-view.ts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
---------
Co-authored-by: Claude <noreply@anthropic.com>
The Ask panel and /chat were Substrata's own assembly of chatkit's pieces
(ChatScreen, Composer, ChatThread) with no chat list, no New chat and no
reload. They are now chatkit 0.18's ChatApp, the same app Heidi, Loki and
OrangeCat move onto: Chats drawer (a rail on a wide screen) with search,
rename and delete, New chat, temporary chat, titles, the queue, Stop and
the open chat reopened on reload. Chats are kept on the reader's device
(localConversationStore); no server conversations, no migration.
Substrata keeps only its own parts: the transport (askTransport: /api/chat
with pictures, the stream into turn.update, the evidence on the message,
the server's own words on a failed turn), chartkit renderers, AnswerFooter,
the key and "Send evidence" under the composer, one composer configuration
shared with the home box. Panel and /chat share the store and the open
chat, so Expand is only a bigger frame (lib/ask-thread.ts goes). A message
from elsewhere (Check this, ?q=, the home box's ?send= with its pictures)
opens a new chat and is sent through the composer, since ChatApp has no
send handle yet (lib/chat/drive-composer.ts says so).
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
Co-authored-by: Claude <noreply@anthropic.com>
* feat(ask): attach screenshots, read them, check their claims
The owner could not ask Substrata about a screenshot of a post: every
composer passed attach={false}, and /api/chat took no pictures.
- One composer (AskComposer) on the home box, the Ask panel and /chat:
Camera / Photos / Files, paste and drop, pictures shrunk to 1024px in
the browser (Heidi's limits), text files inlined, a message queued while
a turn runs, the draft shared between surfaces.
- /api/chat validates pictures (strict data URLs, three at most, 1.5 MB,
never stored or logged) and attached text, with a larger body cap.
- A turn that brings material is a claim check: one read call returns the
visible text and checkable claims as JSON (claims whose numbers the
material never printed are dropped), each claim is searched and, for a
seed company, priced; the answer is bottom line first, one status per
claim with a citation or "Not found", reasoning labelled, and no figure
only the material gives repeated as fact. Every existing guard runs.
- No model that can see: one sentence (paste the text, or add a key);
nothing is guessed.
- The home box hands its message and attachments to /chat (?send=).
Tests: claim-check (fixture, fake vision model, fake web), handoff, image
validation; two eval rows; ask-layout picks a picture into /chat's box.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* feat(home): open like a new chat; listed names from stored closes
- The hero is a new-chat screen: one question, ONE large box (the same
AskComposer as /chat: + for a screenshot, microphone, send) and four
questions to start from. Sending opens /chat with the message and its
attachments.
- A strip of listed names on the chain (NVIDIA, TSMC, ASML, Micron, GE
Vernova, Cameco): the last close, the change on the previous close and a
month's line, drawn only from the closes the daily run stored, the day
named, end of day said. No stored closes, no strip; a slow store does not
hold the page past two seconds.
- The floating Ask pill keeps room at the end of a page, so it never sits
on a page's last lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
---------
Co-authored-by: Claude <noreply@anthropic.com>
The owner could not ask Substrata about a screenshot of a post: every
composer passed attach={false}, and /api/chat took no pictures.
- One composer (AskComposer) on the home box, the Ask panel and /chat:
Camera / Photos / Files, paste and drop, pictures shrunk to 1024px in
the browser (Heidi's limits), text files inlined, a message queued while
a turn runs, the draft shared between surfaces.
- /api/chat validates pictures (strict data URLs, three at most, 1.5 MB,
never stored or logged) and attached text, with a larger body cap.
- A turn that brings material is a claim check: one read call returns the
visible text and checkable claims as JSON (claims whose numbers the
material never printed are dropped), each claim is searched and, for a
seed company, priced; the answer is bottom line first, one status per
claim with a citation or "Not found", reasoning labelled, and no figure
only the material gives repeated as fact. Every existing guard runs.
- No model that can see: one sentence (paste the text, or add a key);
nothing is guessed.
- The home box hands its message and attachments to /chat (?send=).
Tests: claim-check (fixture, fake vision model, fake web), handoff, image
validation; two eval rows; ask-layout picks a picture into /chat's box.
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
Co-authored-by: Claude <noreply@anthropic.com>
* feat(market-data): share prices, SEC fundamentals and filing-based holders, with Ask tools and charts
Prices: daily split-adjusted closes from Yahoo Finance's chart endpoint (query1,
then query2), stored in research_price_points by /api/cron/prices, read by
priceHistory(ticker, range) with a live fallback; returns, 52-week extremes,
drawdown and moving averages computed in code. Stooq (browser challenge),
Nasdaq (browser agent only) and Alpha Vantage (unadjusted free closes) were
tested and rejected; the reasons and the licence position are in
lib/market-data/prices/chain.ts.
Fundamentals: SEC XBRL company facts per CIK — revenue, margins, R&D, capex,
cash, assets, debt, shares — each point with form, accession and filing link;
a typed "unavailable" with the reason for companies the SEC holds nothing for.
Holders: the proxy's ownership table, structured Schedules 13G/13D filed since
(issuer checked, 0% amendments honoured) and recent Forms 4, with the rest as a
typed remainder that says what it is — never a bare "Other 87%". The company
page's ownership view and share bar carry the same remainder.
Ask: price_history, fundamentals and holders tools; a price question plans
price_history and the answer draws a line chart built in code (answer charts
routed like answer tables); four ask-evals rows.
Keyed by ticker in lib/market-data/identity.ts with a committed seed
(config/market-seed.ts) as the seam for the company universe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* fix(market-data): fundamentals lists newest first so a length cut keeps the latest years
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
---------
Co-authored-by: Claude <noreply@anthropic.com>
The owner, 2026-10-25: asked about future demand for neon, the Ask read six
pages and answered with one US table. Analytical questions (outlooks,
forecasts, what-ifs, comparisons of impact, "when could X be commercial") are
now routed to a research mode:
- route.ts classifies `analysis`; loop.ts hands those to research.ts
- research-plan.ts: one model call writes 3-6 sub-questions with a query each,
validated in code (listed corpus tools, their own arguments); a code plan by
question kind when the call fails or times out (7 s)
- research-read.ts: every sub-question searched in parallel through lookUp
(SSRF-safe readPage, PDFs), one 15 s deadline, passages kept round-robin,
one URL once, two per site, primary/trade/analyst before farms, as [W#]
- research-shape.ts: bottom line first, then What is established, What drives
it, Scenarios, What would change this, Confidence and gaps, Sources (from
the citations); uncited forecasts dropped; unanswered sub-questions said by
code and filed through gaps.ts
- scenario-calc.ts: the model names cited inputs and cases, code checks every
input against its passage, computes low/base/high with the formula shown and
draws a line chart through the chat_ui chart block
- default deny holds reasoning sections to the labelled-background rule
- api/chat: "Reading <site>…" now reaches the reader (onRead was dropped);
analysis answers get more output room
- tests with fakes for the five owner questions; ask-evals rows; a script to
ask them live after deploy (scripts/ux/ask-live.ts)
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
Co-authored-by: Claude <noreply@anthropic.com>
* docs(universe): the company-universe methodology — three tests, tiers, evidence
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* feat(universe): admit companies by a written rule — theme, materiality, identity, each cited
A company is in when cited sources place it in a frontier-technology theme,
show it clears a size floor, and identify it in a registry. admit() applies
the rule from config/universe-themes.ts; whyCompany() answers for any name
(in, out with the failed test, considered, named, or queued as a GapTask);
company_membership lets the Ask answer it; /data/companies prints the rule
from the same config. Tier B companies are a derived entity source with an
'Identified, not profiled' page; a stub the universe identifies is promoted
in place. Adapters: issuer fund holdings (ARK, Global X, First Trust,
Defiance, State Street), SEC EDGAR tickers/public float/SIC, GLEIF and
Wikidata by ISIN, Wikidata industry classes; tested on recorded responses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* data(universe): first wave — 461 tier B companies from 14 funds, EDGAR, GLEIF, Wikidata
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
---------
Co-authored-by: Claude <noreply@anthropic.com>
* 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 8e85c7e, 71978bd and 2fd9194 with the clock
pinned: every one passes on 2026-10-24 and fails on 2026-10-25 (before #242
the row that fell out was jobs-niger instead). No commit introduced it.
The evals test ranking, not the calendar; staleness has its own gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* feat(research): --write dates only what a re-check actually found
check-series.ts --write sets checkedOn on a series only when every point's
quote was re-read in that run and found; misses and unreachable pages keep
their last real date. check-job-boards.ts re-opens each careers page and
re-dates only records that still hold; the file's own date is the oldest
record's. Both are named as the refresh in config/substrata-freshness.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* data: re-read 2026-10-25 — 128 of 139 series, 109 of 138 job-board records
check-series.ts --write: 535 of 574 quotes found, 0 missing, 39 unreachable
from the sandbox (31 www.asml.com press releases now 301 to investor.asml.com,
which answers 403; 8 data.bls.gov 503). The 11 series behind them keep
2026-09-24. check-job-boards.ts --write: 109 records held, 29 not confirmed
(kept at 2026-09-24).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* data: listings re-searched 2026-10-25 (SEC tickers + OpenFIGI, all 138)
pnpm run research:listings, full mode (not --revalidate, which re-applies the
rule to stored rows without searching): every OpenFIGI search answered. Two
rows moved: Air Liquide's SEC OTC line (AIQUF) is no longer in the SEC ticker
table; Fanuc now has one (FANUF, CIK 1446596). The 7 private rows come from
config/substrata-listing-overrides.ts, as the script defines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* ci(data): a monthly re-check that commits only what it re-read and found
.github/workflows/recheck-data.yml runs check-series --write, check-claims
--write and check-job-boards --write (and the ~70-minute listings re-search
on the schedule or when asked), then commits to the dispatched branch or
opens a bot/recheck-data-<date> PR. Token: FLEET_PAT, else GITHUB_TOKEN, as
in auto-merge.yml; a GITHUB_TOKEN push triggers no CI, so the PAT is preferred.
check-claims.ts dates research/claims.json only when every claim's sentence
still reads in its file and every series it cites was re-read and found
today, and prints the latest values beside each claim for the reviewer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* data: three dead ASML source URLs point at the same releases as filed with the SEC
The 2019-Q4, 2020 annual and 2024-Q2 press releases on www.asml.com now 301
to ASML's generic press-release index. The same releases are exhibits to
ASML's Form 6-K filings (0000937966-20-000003, -21-000003, -24-000019);
all seven quotes were re-read there and found. One quote is shortened to a
verbatim span of the same sentence: the filed HTML splits 'at' across a tag
('a t'), so the sentence's opening cannot be matched mechanically.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* ci(data): run the re-check once on this branch (temporary push trigger)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* data: re-check 2026-10-25 (scheduled re-read)
Dates moved only for what was re-read and found in this run; see the workflow summary for every row that was not.
* fix(quality): a word split across two style runs reads as one word
SEC filings print some words as two font runs ('EU</font><font …>V'), and the
reader turned every tag into a space, so 'EUV' read 'EU V' and a quote copied
from the rendered page missed. Only a letter-run-letter split is joined; a
footnote run ('billion</font><font>2') and every other tag stay a space.
Full re-read before/after: no quote that was found is lost.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* data: ASML points the runner cannot open, re-sourced to the same releases on SEC EDGAR
investor.asml.com answers 403 to GitHub's runners as well as to the sandbox.
Sixteen points whose page could not be opened from either now cite the same
press release as filed with the SEC (Form 6-K); each quote was re-read there
and found. The 2020-Q4 bookings quote is back to its full sentence (the page
reader now joins 'a t'). SICC: the quotes carried the old reader's split
('S iC'); they now read 'SiC', as the page does, and are found.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* feat(research): job boards re-checked in a browser, and absences re-checked too
A careers page whose served HTML lacks the system's mark is drawn in Chromium
(the workspace's Playwright); failing that, the tenant the evidence names
must still answer as that system. A record saying something is NOT there
holds while it still is not (no careers link, site still down, hosts named
still not answering). The workflow installs Chromium for it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* data: re-check 2026-10-25 (scheduled re-read)
Dates moved only for what was re-read and found in this run; see the workflow summary for every row that was not.
* data: job boards — every site the evidence names may show the system; 4 more held
Run from the sandbox with Chromium on the 11 records the runner could not
confirm: chalco, openai, supermicro and ase-technology… held where a site the
record names still shows its system; 7 stay at 2026-09-24 (listed in the PR).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* ci(data): drop the one-off push trigger; schedule and dispatch only
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* feat(freshness): rows tried and not confirmed are a visible, expiring exception
A re-check that cannot confirm a row (a source that refuses our servers, a
page that changed) now records it in the dataset file's 'unconfirmed' list
with the reason and the day it was tried — written by check-series and
check-job-boards --write, never by hand; a row confirmed later leaves it.
The gate counts a listed row as tried on that day: the dataset is judged by
the oldest of each row's own check or recorded try, so an entry expires like
any date and next month's run must try again. A dataset with listed rows is
never 'fresh' (it reads 'late' and is under Needs attention), and
/data/freshness and /api/health/freshness name every row with its reason.
Tests: a row neither dated nor listed fails, an expired entry fails, a
listing for another row covers nothing, and the table renders the list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
* data: record the rows no re-check could confirm on 2026-10-25
check-series --write lists us-employment-semiconductor-related-device-
manufacturing (data.bls.gov answered 503 to the sandbox and to GitHub's
runner; BLS refuses datacenter addresses). check-job-boards --write lists
air-products, umc (403), tanaka-kikinzoku (504), baosteel-gases,
element-six and yaskawa. nippon-steel was re-opened: its recruit page's
yelloop.jp link is an alumni network; /recruit/hq/ still links its axol
entry (job.axol.jp/bx/s/nipponsteel_27), so the evidence names that page
and the record held.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
The dossier queue blocked law_licensing for every producer country because
the instruments register knew ten jurisdictions. Jurisdictions now live in
config/substrata-jurisdictions.ts: the curated ten unchanged (ids, order,
lines), then every country in config/substrata-countries.ts by its ISO2,
branded so a bare string cannot pass for one, with one neutral generated
line that asserts nothing about its law.
- add.ts's instrument schema accepts any jurisdiction id (a refinement,
not a 175-value enum).
- A derived jurisdiction stays out of the /policy table, tiles and map
links until an adopted or in-force rule is recorded under it; its
/policy/<iso2> page renders on request and says nothing is recorded,
with a way to send a source and a link to the country.
- law_licensing tasks are no longer blocked for map countries; the task
says what to record and lists the sources (gazette, ministry, OECD
inventory entry with its document, law firm summaries only as
secondary). Totals, pages and the ten curated rows are unchanged.
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
Co-authored-by: Claude <noreply@anthropic.com>
The stub page grouped by what each relation says (Owns a stake in (16),
Operates, Owned by, Ships to), one line per relation: counterparty, share or
volume where stated, year, grade. A quote sits in a collapsed per-row
disclosure; a cell that backs several rows is printed once below with its
row count. Nothing in a quote is cut. NAC Kazatomprom JSC at 390px goes from
5,193px to 2,349px tall.
Ownership holders: a founder printed by a personal name (Jensen Huang, Lee
Jae-yong) and a group of holders (a family, ADR holders) are skipped when
the graph mints company nodes, with the reason counted in graphStats. The
ownership rows and pages keep every holder. Stubs: 1,188 to 1,186.
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
Co-authored-by: Claude <noreply@anthropic.com>