mirror of
https://github.com/bitbaum/substrata.git
synced 2026-12-04 05:47:59 +01:00
Every code file the size ratchet grandfathered is now under its 300-line
ceiling, split by what it does rather than by line count:
- lib/search.ts -> entry + lib/search/{text,corpus,build,expand,score,snippets}
- lib/chat-tools.ts -> lib/chat-tools/ (one module per tool family + registry)
- lib/chat-agent.ts -> lib/chat-agent/{loop,parse,turn,prompt,stream-gate}
- lib/chat.ts -> lib/chat/{types,retrieve,models,answer}
- ResearchChat.tsx -> components/portal/chat/ (thread, turn, composer,
BYOK panel, contribute form, hooks)
- SearchBox.tsx -> components/portal/search/ (popover, page form, shared)
- profile modules, lib/bottlenecks.ts, lib/participants.ts -> build/board
and module-family files beside them
- app/page.tsx, app/markets/[slug]/page.tsx, app/policy/page.tsx -> section
components in private _home/_sections folders
globals.css (2379 -> 664 lines) keeps tokens, base and site chrome; the
feature blocks moved to app/styles/*.css, imported from the root layout in
the order they had inside globals.css so the cascade is unchanged.
Screenshots of /, /search?q=asml, /markets/asml, the EUV bottleneck, /chat,
/notes, /atlas, /policy and /talent at 390/820/1440px are pixel-identical
to main.
The config/ corpus files stay grandfathered as data; the logic that was in
them moved to lib/ (coverage-progress.ts, participants.ts, geo.ts).
Also: the desk's "Open on" select said "Last all time"; and
INFRASTRUCTURE.md now records the hourly :17 sweep timer, the everyHours
setting that decides whether a run is due, and that 005-desk.sql is applied.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
14 lines
389 B
TypeScript
14 lines
389 B
TypeScript
/** The shapes a chat answer is exchanged in: a transcript turn and a cited source. */
|
|
import type { ResearchDocument } from '../research-index';
|
|
|
|
export type ChatTurn = { role: 'user' | 'assistant'; content: string };
|
|
export type ChatSource = {
|
|
number: number;
|
|
id: string;
|
|
title: string;
|
|
href: string;
|
|
evidence: string;
|
|
primary: string[];
|
|
kind: ResearchDocument['kind'];
|
|
};
|