mirror of
https://github.com/bitbaum/substrata.git
synced 2026-12-04 08:39:02 +01:00
main
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
78943594ab |
fix: restore the data-entry contract (#211) and the search index (#212), removed by #213 (#216)
* feat(entry): the data-entry contract — candidate rows a cheaper model may add, validated at the gate (#211) PR 5 of docs/architecture/2026-10-23-knowledge-system.md §3. - lib/entry/candidate.ts: candidate types derived from each config row (CandidateOf<Row>), and the folds that merge a sidecar row into its config list flagged `evidence: 'candidate'`. No runtime config import, so config modules include it without a cycle. - lib/entry/schemas.ts (+ vocab.ts, shape.ts): one Zod schema per facet, each `satisfies z.ZodType<…Candidate>`, refs resolved through resolveIn / the config's closed lists; events reuse lib/event-rules eventProblems. - config/candidates/<facet>.json: eight empty sidecars, merged into COVERAGE, EVENTS, ENDOWMENTS, FACILITIES, INSTRUMENTS, SCIENCE, OWNERSHIP and the corpus series the way substrata-events-accepted.json is merged into EVENTS. - A candidate producer reads "Candidate source", never "Sourced" (verificationFor takes the row's evidence), and coverage progress does not count it. - scripts/research/add.ts <facet> <json|-> [--dry-run] [--branch] [--schema]: exit 2 schema, 3 unreachable, 4 quote absent (verbatimIn), 5 duplicate; appends sorted, idempotent; --branch commits on data/<facet>-<key>. - test/candidates.test.ts: every sidecar row passes its schema, is `candidate`, has url + asOf <= today; the gate exits 4 / appends sorted / exits 5 against a local HTTP server. - prompts/data-entry.md: the §3.4 prompt, how to run it, the printed shapes. - NODE_TYPE_LABEL moves to config/substrata.ts and the ownership labels to config/substrata-ownership-labels.ts (both re-exported) to keep the two config files under their size ceilings. Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE Co-authored-by: Claude <noreply@anthropic.com> (cherry picked from commit |
||
|
|
366d3edb30 |
feat(ask): the Ask panel scrolls, expands to /chat, and answers draw charts (#213)
The owner's phone (2026-10-23, /atlas, Ask Substrata over a bottleneck): the
answer could not be scrolled, there was no way to expand it, "Quick replies"
was a heading over nothing, "3 records read" a stray line, and the composer
carried "Model: Auto" and a paperclip.
- The panel is chatkit's ChatScreen in a sheet (AskPanel): on a phone a
bottom sheet to 92% of the visual viewport with a grip; from 768px a
right-hand panel. One title row: Ask Substrata · Expand · Close.
- Expand hands the whole thread to /chat (lib/ask-thread.ts); the URL
carries only an id and the conversation id continues.
- Suggested replies are chatkit's reply row (nothing drawn when empty);
records read are the thought row above the answer ("Read 3 records").
- Composer: microphone and send; the key chip only with a BYOK key.
- Charts in answers (chatkit 0.15): chart blocks drawn by chartkit
(LineChart, BarChart, ShareBars, Timeline, StatTiles) on every chat
surface; chartable tools return page links and plain numbers.
- --ck-page mapped to the surface token: unmapped, the dark theme drew
light text on chatkit's near-white page.
- check:ask-layout (scripts/ux/ask-layout.mjs): 320/390/1440, light and
dark — the thread scrolls, no sideways overflow, 44px targets, no cut
words, Expand lands on /chat with the same turns.
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
329dd587d8 |
feat(entry): the data-entry contract — candidate rows a cheaper model may add, validated at the gate (#211)
PR 5 of docs/architecture/2026-10-23-knowledge-system.md §3. - lib/entry/candidate.ts: candidate types derived from each config row (CandidateOf<Row>), and the folds that merge a sidecar row into its config list flagged `evidence: 'candidate'`. No runtime config import, so config modules include it without a cycle. - lib/entry/schemas.ts (+ vocab.ts, shape.ts): one Zod schema per facet, each `satisfies z.ZodType<…Candidate>`, refs resolved through resolveIn / the config's closed lists; events reuse lib/event-rules eventProblems. - config/candidates/<facet>.json: eight empty sidecars, merged into COVERAGE, EVENTS, ENDOWMENTS, FACILITIES, INSTRUMENTS, SCIENCE, OWNERSHIP and the corpus series the way substrata-events-accepted.json is merged into EVENTS. - A candidate producer reads "Candidate source", never "Sourced" (verificationFor takes the row's evidence), and coverage progress does not count it. - scripts/research/add.ts <facet> <json|-> [--dry-run] [--branch] [--schema]: exit 2 schema, 3 unreachable, 4 quote absent (verbatimIn), 5 duplicate; appends sorted, idempotent; --branch commits on data/<facet>-<key>. - test/candidates.test.ts: every sidecar row passes its schema, is `candidate`, has url + asOf <= today; the gate exits 4 / appends sorted / exits 5 against a local HTTP server. - prompts/data-entry.md: the §3.4 prompt, how to run it, the printed shapes. - NODE_TYPE_LABEL moves to config/substrata.ts and the ownership labels to config/substrata-ownership-labels.ts (both re-exported) to keep the two config files under their size ceilings. Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
cfaf05a10c |
refactor: split the god files by job, and globals.css by feature (#83)
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>
|