Repository navigation
CatCup Tavern 0.4.0
Early-access release. Moves your existing data in and handles single-character and group roleplay end to end. The Windows installer is unsigned, and what works and what does not says exactly where the line is.
Added
-
A plan for removing the last of the adapted code.
docs/REUSE-ISOLATION.mdreplaces the earlier assessment with an evaluation and a phased plan. Its finding is that the risk is not where intuition points: the 1,034-line world info scanner is an algorithm, close to the idea/expression line and implementable from the format documentation, while the highest-expression content in the repository is a handful of short instruction strings, and short creative text is exactly what copyright protects. The plan therefore rewrites the instruction text first, re-sorts the format bucket next, and rewrites the behaviour last. The goal is independence of authorship rather than a change of licence: AGPL-3.0 is the project's own choice and stays, and the plan only notes that a tree with no borrowed code keeps any later decision in the project's hands. It also records plainly what no amount of refactoring can buy: this tree cannot make a clean-room claim, because the test suite that would gate a rewrite was itself written against the adapted code, and anyone who needs that claim needs a different process rather than a smaller diff. -
The default instructions are CatCup's own wording. A fresh install, or a preset that never set these fields, now starts from text written for this project rather than copied from another client: the Main Prompt, Enhance Definitions, the continue and impersonate nudges, both memory summarize instructions, the two image drafting instructions, and the group-chat opening line. A preset that carries its own text is unaffected, which is most of them — the stored identifiers, order and marker flags are untouched, because those are the preset format. Two things were deliberately left alone: the bracketed
[Start a new Chat]style markers, which are labels rather than instruction, and the Stable Diffusion prefix and negative prompt, which are a comma-separated list of artefact names closer to a vocabulary than to prose. -
The key matcher is rewritten from the format documentation.
packages/compat-st/src/matching.tswas the first module of the behaviour bucket to be replaced. It decides whether a world info entry fires: substring keys,/pattern/flagsregular expressions, the@@activate/@@dont_activatedecorator prefix, and the whole-word option. The rules are unchanged and the tests that pin them are unchanged; what changed is that the file is now CatCup's, written fromdocs/DATA-FORMATS.mdrather than carried over, so it has noDerived fromheader and can be changed on its own terms. One behaviour is now written down rather than implied: an empty key matches everything, which is what keeps an entry whose keys were all blank after trimming from going silently inert. -
The regex engine is CatCup's own.
packages/shared/src/regex.tsdecides which regex scripts run and how one rewrites a string: the markdown/prompt/source gate, the edit gate, the depth window,/pattern/flagsparsing,{{match}}/$1/$<name>expansion and the trim filter. No test changed. The rewrite also removed a duplicated parser:keywords.tscarried its own copy of the/pattern/flagsgrammar to decide whether a world info key is a regex, and now delegates to the engine's. -
Timed effects and the memory modules are CatCup's own.
packages/compat-st/src/timedEffects.ts(sticky, cooldown, delay and the sticky-to-cooldown hand-off),apps/server/src/memory/summary.ts(when a summary is due, which messages it covers, the request) andapps/server/src/memory/inject.ts(which summaries reach a prompt, and how they are formatted). No behaviour changed and no test was edited.The rewrite writes down what the code relied on silently: the four deletion rules in timed effects and why their order matters, that a record is never refreshed so its window starts at the first activation, that
check()runs sticky before cooldown because an expiring sticky pushes its successor onto the cooldown buffer for the same scan, and that a summary always covers history before the newest message. -
Two more modules are CatCup's own.
compat-st/src/prompt.tsshapes a scan into the prompt buckets and applies the author'swi_format;shared/src/macros.tsexpands{{char}}and friends. Both were rewritten from the format documents, so neither carries aDerived fromheader any more. Behaviour is unchanged and no test changed. One thing was made explicit in the macros: an unknown{{name}}is left exactly as written rather than blanked, so a card written for a richer engine loses nothing visible and its author can see which macros this client does not know. -
The prompt pipeline is CatCup's own. Four modules rewritten from the format and their own tests:
compat-st/src/prompt-history.ts(stored messages and a card's example dialogue into prompt turns),compat-st/src/prompt-messages.ts(the assembled prompt as ordered slots),compat-st/src/prompt-tokenizer.ts(which vocabulary a model counts with) andapps/server/src/prompt/manager.ts(filling a preset's gaps and resolving the render order). No behaviour changed and no test was edited.Two rules the code relied on are now written down: the tiktoken table is ordered most-specific-first and re-sorting it would silently give several models the wrong vocabulary, and an empty global prompt order is a real saved state that has to be replaced with the default rather than left empty — a prompt with no main, no history and no examples fails for a reason nothing in the UI explains.
-
The image and speech adapters are CatCup's own. Seven files: the A1111, OpenAI-images and OpenAI-speech request builders, the draft-from-chat prompt cleanup, the speech text preparation and chunking, and the TTS and image settings models. These were written against each service's published HTTP API rather than adapted from another client, so they now say so. No behaviour changed and no test was edited.
One thing made explicit in the speech cleaner: the tag list is a fixed set rather than a general
<[^>]+>pattern, because card text and model replies legitimately contain<in prose, and a catch-all would delete real sentences. -
Prompt assembly and the quick reply executor are CatCup's own.
apps/server/src/prompt/assemble.ts(the nine phases that turn a card, persona, preset and scan into a message array) andapps/server/src/quickreplies/execute.ts(the command subset and/runexpansion). No behaviour changed.execute.tshad no direct tests, so this addsexecute.test.tsfirst — 17 assertions covering what each command appends, the argument rules, the recursion guard and, the promise the API makes, that a malformed reply leaves the chat untouched. The rewrite then landed against them. -
Every file adapted from another client now says so, accurately.
docs/REUSE.mdlisted 48 files, 9,948 lines, as adapted or format-implementing, but 22 of them carried no provenance comment at all — so grepping for a header undercounted the real figure by about 4,500 lines. Each of the 48 now opens with a line saying which of two things it is: the specification it implements, or the upstream file it was adapted from.packages/compat-st/src/keywords.tswas a duplicate of the copy in@catcup/sharedthat nothing imported, and is gone.hash.tsis now sourced from cyrb53's own publication rather than from another project's utility module, which takes it off the list of things that cannot be replaced.Ten of the 48 are now marked as what they are — implementations of a published format — rather than as adapted code: the six schemas, card parsing, card writing, PNG chunk handling and the favourite flag. Three went the other way, and they are the useful record: world info parsing keeps its adapted header because the hash payload's field order is only written down in another client's source; the card-book converter keeps it because what an absent field means follows another client's defaults; and the loader loses it because the adapted code moved into the package split and what remains is CatCup's file I/O.
-
A public landing page, in nine languages.
site/is a static page published togh-pagesby
.github/workflows/pages.yml, with English at the root andzh-CN,ja,ko,de,fr,es,
ruandpt-BRbeside it, each with its own<html lang>, title, description, canonical and
hreflangalternates. The page's one moving part is the product itself: a chat window built in HTML
and CSS from the real components' structure and the app's own tokens, which accepts what you type and
streams Mira's canned reply word by word, with Browser / LAN / Windows tabs that change only the
window chrome around it.scripts/build-site.mjsrenders the decks insite/content/, writes
sitemap.xml,robots.txtand the assets, and fails when a locale is missing a key or leaves a
placeholder behind; it has no dependencies and no bundler.scripts/preview-site.mjsserves the
result on:4173, andpnpm sitebuilds it. Every download button points at the installer asset
itself (releases/download/v<version>/CatCup.Tavern_<version>_x64-setup.exe, named by the Tauri
bundler and built frompackage.jsonat build time) rather than at the release page, and the install
section names the file it downloads beside a link to every release. The language menu's links are
computed against the page they sit on rather than written as./and../<code>/, which only
resolve from inside a locale folder: from the English page they left the project path altogether and
landed on whatever else the account hosts, and from a locale page./pointed back at itself. The
build now also resolves every relativehrefandsrcin every page against the folder it was
written to, and fails when one has no file behind it or climbs out of the site. -
An entry can answer to more than one name.
公主never fired on a chat saying王女, and the lexical pass cannot close that — it ranks shared words, it does not know two words mean the same thing. Each world info entry can now carry an Also matches list of extra names, edited as chips under its keywords, and the scanner treats every alias as an additional primary key: same matcher, same per-entry options, and the context inspector names the alias that fired. Because it is a primary key it is not merely additive — an alias also satisfies the secondary-key logic and shares inclusion groups, probability and the token budget, so a bad alias can hide an entry as well as reveal one, which is why the editor says so.Aliases are stored in
<book>.aliases.jsonbeside the book, never inside it. An entry's identity hash covers its whole raw record,extensionsincluded, and a chat'stimedWorldInforecords are matched by that hash — writing aliases into the entry would have silently detached its sticky and cooldown effects in every chat that already had them. Nothing in the book changes, so a book with no sidecar behaves exactly as it did, and the file moves, copies and is deleted with its book. They do not travel in a SillyTavern export; seedocs/LIMITATIONS.md. -
The model can propose those names. Generate aliases in the book editor asks the active model about every entry — one request each, four at a time — and the sidecar is written only from a review sheet you accept. Each row starts at what the entry already carries plus what the model added, and a proposed name can be dropped without dropping the row, because unticking a row means "keep the old list" rather than "delete it". A proposal repeating one of the entry's own keys is filtered out before it is ever stored, as is anything too long to match a chat, and the list is capped at twelve per entry — a model asked for "other names" answers with thirty often enough that the cap is what stops an entry matching every scene. The dialog shows the request count and prompt tokens before it starts, counted with the same tokenizer the chat budget uses.
An import offers it. The finished import dialog lists the books it just wrote with the request count each would spend, and one Generate button per book — because an alias set is worth most the moment a book arrives, and least three weeks later when the button has to be remembered. Nothing runs unless asked.
Each generated set records the model that wrote it, shown beside Also matches. Nothing acts on it: it is there so a book filled in over several runs, possibly with a cheaper model for the bulk, can say which rows came from which — the difference between "these look wrong" and "the cheap model wrote these".
One command answers whether a book needs any of this.
pnpm --filter @catcup/server recall <book.json> <chat.txt>runs the real scanner over one paragraph three ways — the book's own keys, the same book with its alias sidecar, and that plus the lexical pass — and reports how many entries each reached. No provider, no cost, and it reads the app's own loader and scanner rather than reimplementing them. That is the measurement #127 said should decide whether an embedding layer is worth building.A run is resumable, which book distillation deliberately is not: records live in
<profile>/alias-runs/and carry per-entry state, so a stop costs nothing already answered. A resume keeps a row's proposal only when the entry's content still hashes to what it was generated from, and leaves a row that was skipped (nothing to read) skipped unless the entry has since gained text. The book editor marks a generated set Stale once its entry has been edited and offers Refresh on that entry alone; a hand-typed list carries no provenance and is never stale, because a person wrote it against whatever the entry says today. A failed row says which kind of failure it was — the provider refused the request, or the reply could not be read — since the fix for one is not the fix for the other. -
A lexical pass for world info. Off by default, and switched on with
worldInfo.lexicalMatch. A BM25F index over each entry's keywords, comment and content lets an entry fire on what the chat is about rather than only on whether it repeats one of the author's substrings — so a chat mentioning the northern peaks can reach an entry keyed on "dragon" whose text describes where dragons roost. Nothing a keyword matched is removed, and inclusion groups, probability, the token budget, timed effects and the trigger and character filters all still apply; the pass only ever adds candidates, the same contract SillyTavern's Vector Storage keeps throughWORLDINFO_FORCE_ACTIVATE. The inspector shows a lexical hit with its score and the reasonlexical.lexicalThreshold(a fraction of the scan's best hit, because a BM25 score has no absolute meaning) andlexicalLimitbound the pass. Fields, documents and any other ST file are untouched: the setting lives insettings.json. The pass works from one shared chat window rather than a per-entry haystack, so an entry's ownscanDepthand itsmatch*opt-ins do not widen what it is matched against. -
World info retrieval has settings you can reach. The lexical pass, and the three values that bound it, were previously reachable only by editing
settings.jsonby hand. Settings → World Info now ends with a collapsible Retrieval group: a checkbox for Match by meaning, not only keywords, a slider for Entries per turn (1–50), and Trim weak matches (0–100% of this turn's best hit). The group opens itself when the pass is already on. Two of the three controls are honest about what they can do: Entries per turn is a hard cap, so every step changes the turn's result, whereas Trim weak matches only ever trims the tail behind the best hit — the best hit is kept whatever the setting, which is why the control is not called strictness. Edits save immediately, like the book checkboxes above them, and a slider commits once per gesture rather than once per pixel. -
Two more request protocols: OpenAI Responses and Gemini native. The Request protocol list now has five entries instead of three. OpenAI Responses (
POST /responses) is OpenAI's newer API, and it is not Chat Completions under another path: the body takesinputrather thanmessages, the system text moves toinstructions, streaming arrives as typed events (response.output_text.delta,response.reasoning_summary_text.delta) and the token limit ismax_output_tokens. It is called statelessly —store: false— like every other adapter here, so the conversation stays in CatCup's chat log rather than on the provider's side. Gemini native speaks Google's ownmodels/{model}:streamGenerateContentwithalt=sse; the model is in the path,assistantturns becomemodel, system turns becomesystemInstruction, and thinking parts (part.thought) arrive as reasoning. Its key goes in thex-goog-api-keyheader rather than a URL query, so it does not land in a proxy log. A Google Gemini service template joins the picker. Seedocs/PROVIDERS.md. -
The desktop window has its own title bar. On Windows the native frame is gone and the window buttons are drawn by the app instead — fused rather than added as a strip: they float over the top-right corner of the library rail and the chat header, which reserve 32 px for them, so the brand stays where it already was and nothing gains a row. Dragging anywhere along the top strip moves the window, double-clicking it maximises, and the three buttons minimise, toggle maximise and close, with the glyph flipping to Restore while maximised. The window keeps its resize borders, Aero Snap and its rounded corners. Dragging and the buttons go through the Tauri window API from the page, not through the window procedure: WebView2 covers the client area and takes every mouse message itself, so a hit test over the bar never reaches it — measured, and the reason a subclassed
WM_NCHITTESTimplementation could neither drag the window nor press its buttons. Hovering the maximise button does not raise the Windows 11 Snap Layout flyout, because that needs a non-clientHTMAXBUTTONhit the webview hides;Win+arrow and edge snapping still work.tauri-plugin-decorumwas evaluated and rejected: its snap support simulatesWin+Zrather than raising the native flyout. Seedocs/DESKTOP.md#custom-title-bar. -
A long chat can stop forgetting its own beginning. The rolling summary is a chain —
summary_n = f(summary_{n-1})— and prompt assembly drops the oldest messages first, so a detail that fell out of the summary and out of the window existed nowhere the model could see. That is now optional to fix. Keep every summary (memory.appendOnly, off by default) stops re-summarizing: each summary covers a settled range and is final, so the chain stops destroying at the source, and the prompt carries the newest summaries plus the earliest — a chat forgets its middle rather than its opening. The stock prompt tells the model to "use that as a base and expand", which is incoherent once nothing is carried, so it is swapped for a version that asks for the new range alone; a prompt you wrote yourself is sent as written.Nothing about the chat file changes. SillyTavern already stores one summary per covered message on
extra.memoryand never clears an older anchor — only the read path stopped at the newest, and this setting is what makes it read the list. It is off by default because the other client still injects only the newest, so a chat written this way reads correctly in both but only CatCup uses the extra summaries. The larger fix — indexing the messages themselves so the middle is reachable too — is tracked in #129 and deliberately not in this change; the plan attached to that issue starts with this.The measurement that decides whether that larger fix is worth building is a command:
pnpm --filter @catcup/server chat-recall <chat.jsonl>. For each turn it rebuilds the window the prompt would have kept and counts what a BM25 pass would have surfaced from messages the window had already dropped. No provider, no cost. It reports an upper bound — a hit scored, which is not the same as a hit being useful — so read a few turns by hand before acting on it. -
Generation is no longer welded to HTTP. The code that calls the provider and stores the reply is now a plain async generator (
generateReply), and the SSE handler is a thin wrapper that relays its events and turns "the browser closed the socket" into a stop. The SSE contract is unchanged — same five events, same abort and partial-reply behaviour — but a second transport can now run the same generation without aFastifyReplyor a socket, which is what RFC 0004 needs for an IM client. No user-visible change today. -
Two more IM commands, and the bot stops repeating itself after a restart.
/statussays whether a reply is being written and what this conversation is bound to;/providernames the provider and model a generation would call, so a misconfigured install and a provider that is down stop looking identical from a failed reply. Both appear in/help.The poll offset is persisted in
im-telegram-offset.jsonbeside the profile. Telegram keeps an update until agetUpdatescall acknowledges it — about 24 hours — so with the offset only in memory every restart re-answered everything that had arrived since the last acknowledged batch. The libraries that do not persist it either accept that replay or drop the backlog on start; this keeps neither loss. The offset is written after a batch is handled, so a crash mid-message repeats that batch rather than losing it: at-least-once, with the window as small as the platform allows. A corrupt sidecar reads as zero rather than stopping the bot.Replies are sent as Telegram HTML, so a character's
*she smiles*renders as emphasis instead of visible asterisks. It is conservative by design:<,&and>are escaped first, only*/**/***and__are converted, a span that crosses a line break or contains only whitespace is left alone, and a single_is never touched because it lives inside ordinary words. If the conversion ever produced unbalanced tags the message goes out unformatted instead — Telegram rejects a whole message on a parse error, and a reply nobody sees is worse than one with a stray asterisk. -
A Telegram bot can receive messages, and nothing else yet.
im/telegram.tslong-polls the Bot API; a message from the one allowlisted user id reaches a sink, and anything else is dropped without a reply, because answering would confirm the bot exists. Polling rather than a webhook is the point: no public address, no TLS, no domain, so an install at home exposes nothing. A failed poll backs off and retries instead of taking the server down, and a409says "another process is already polling this bot" rather than "Telegram refused" — the two send a person to different problems.The token lives in
data/secrets.jsonbeside the provider keys and no endpoint returns it; the client seeshasToken. Off by default, follows the settings across a restart, and stops before the server closes rather than holding the process open for a long-poll timeout. Where a received message goes is the next slice — this one proves a message can arrive and that the allowlist holds.Turning it on means message text and replies travel through Telegram's servers. See SECURITY.md: the provider key still never leaves the server, but "local-first" no longer covers the messages themselves.
-
A Telegram chat can become a CatCup chat. Export the conversation in Telegram Desktop as JSON and choose it in Import from another app. The scan shows the participants and how many messages each sent, because the one decision that cannot be automated is which one is you — getting it wrong reverses every "I" in the story and is invisible until someone reads the import back. The chat is then written through the same storage path as any other, so it reads back in the app, exports to SillyTavern and distils like a chat made here.
What it keeps is deliberate. Service rows, joins and messages with no text are counted and dropped, not invented into prose. Media becomes a short marker (
[photo],[voice message]), never a file path — a chat file can be exported or shared, and a path from the exporting machine is a leak. A conversation with more than one other speaker is refused rather than flattened into one name, because collapsing two people rewrites who said what. No bot and no token: this reads a file the user already has. -
The Telegram bot can hold a conversation.
/chat <character>binds a Telegram chat to one of their chats — the newest one, because that is the one a person means;/newstarts a fresh one,/stopinterrupts a reply,/whosays what this conversation is bound to,/helplists the rest. A plain message talks to the bound character.Four decisions worth knowing before using it. A second message while a reply is being written is refused with a sentence, not queued — a queue needs its own UI and its own failure modes. A provider failure answers with a sentence, because silence looks exactly like a bot that has died. A chat deleted in the app is reported and unbound, not recreated, since recreating would fork the story without telling anyone. And long replies are split on paragraph boundaries, then sentences, then characters — with CJK punctuation included, because a Chinese reply has no spaces and would otherwise be cut mid-word.
The binding lives in
im-telegram.jsonbeside the profile, never in a chat file: it is wiring about which phone reaches which story, and it means nothing to SillyTavern. -
Tell me when a reply finishes — when you are looking somewhere else (
im.notifyOnReply, off by default). A Telegram message with the character's name and the first sentence, never the reply itself.It is for the case the app cannot cover by itself: a generation started from the browser or desktop and then left. The client reports whether its window was out of sight at the moment the request went out, because that is the one thing the server cannot tell — an IM message and a background tab arrive the same way. A reply someone is watching sends nothing, a reply they stopped sends nothing (they were watching it, and they pressed the button), and a reply that came over IM sends nothing, since it is already in the conversation a notification would go to.
A failure does notify, because silence is most expensive exactly there: without it a stopped reply and a slow reply look identical from another room. The target is the allowlisted owner id rather than a bound chat, so it works before anyone has messaged the bot and never lands in a stranger's conversation. A delivery that fails is logged and dropped — a "reply finished" message twenty minutes late is noise.
-
A chat can be a directed scene. A per-chat director, off by default, that decides who may speak, keeps the character you play in the prompt without letting the model write them, and offers a short list of options after a reply. Settled by RFC 0003; story mode's graph is reserved but not built, because it needs a plot distillation that has no design yet.
It works in a group chat too, which is the case it was designed for: several characters, one of them yours. A group has no self-play refusal — there is no contradiction between "you are {{char}}" and "never write this member", because the speaker is chosen per turn and a played member is muted for the whole chat — and a played member whose card is temporarily out of the group is accepted rather than blocking the save. The config lives on the group chat rather than the group, so two chats with the same cast can be two different stories.
Tools → Director in the chat header is where you set it up: a Rules tab for the standing instructions, the speaker mode and the option count, and a Who you play tab listing the chat's cast. The two are separate tabs because the cast line is the half that makes a guided scene work and the half most easily scrolled past. Explicit save with a leave guard, like every other configuration form here — a rule that saved on every keystroke would drift the scene while it was still being written.
A single chat refuses to play its own card — a
400that names both ways out (a group chat, or a narrator card with the cast played from the world book). The card block tells the model "you are {{char}}", so a chat that both speaks as its character and forbids writing them contradicts itself, and the failure would show up as a model that occasionally writes the person's lines.Choices are a line-oriented sentinel block, not JSON, and that is the reliability plan rather than a detail: a streamed JSON object has to balance its brackets and survive an unescaped quote, while a line format degrades — a block cut off mid-way still yields the lines before the cut, and no block means no options rather than a failure. The block is stripped before regex scripts run, so a stored chat never contains the sentinels, and clicking an option sends its label through the ordinary send path. Choices can never fail a reply.
A chat with no
directorkey produces the same prompt and the same file it always did, which is the compatibility promise this rests on. -
The code adapted from another tavern client has its own package.
packages/compat-stnow holds the card parser and writer, the world info scanner and its helpers, the prompt definitions and history shaping, and the tokenizer's model map — 22 files that used to be scattered throughapps/server/srcandpackages/shared/srcwith only a header to mark them.This is a home for the attribution, not a licence boundary. The app imports the package and is built with it, so it is one program; a directory does not change what anyone may do with the build. What it buys is a list that cannot drift as files are added.
docs/REUSE-ISOLATION.mdnow sorts that list into the files that implement a published format and the files that reproduce one client's behaviour, and sets out the plan for rewriting the second set — which is the only thing that would change what the tree is.Three things stayed where they were, and the reasons are the interesting part: the loader's file I/O, prompt assembly and the memory service all need storage, providers or the app's own modules, and a package that imports its own consumer is not a boundary. The key-splitting helper stayed for a different reason — the browser needs it, and pulling this package into the web bundle would drag Node code along. Where a dependency pointed the wrong way, it was inverted: the scanner now takes its lexical index as an argument instead of importing the app's cache, and the tokenizer takes its vocabulary path.
Changed
-
The project moved to trunk-based development.
mainis now the only long-lived branch: there is nodevintegration branch, every PR targetsmain, and PRs are squash-merged so the trunk stays a linear list of changes. Branch protection moved with it —mainkeeps the required check and now requires the branch to be current with its base, because CI only watches the trunk.release/<version>andhotfix/<version>still exist, cut frommainand merged back, but only when a release or a fix genuinely needs stabilising; a version bump is an ordinary PR. CI, the PR template, the issue-template doc links,CLAUDE.md,CONTRIBUTING.md,README.mdand the docs that described the old two-branch flow were all updated.This exists because the old flow had the failure this session hit twice: work sitting on a branch the trunk had not seen, so a
git checkoutto another branch silently put unreviewed files back on disk. With one trunk that class of mistake disappears — there is nothing to be "ahead of" exceptmainitself.Completed.
devwas 103 commits ahead ofmain— every change since the 0.3.2 release — and was landed with #180 before deletion. The remote branch and its protection rule are gone,mainaccepts squash merges only, and the repository deletes merged branches automatically. -
No file in the tree carries a
Derived fromheader any more. The last twelve went in this batch, which completes phase 3 ofdocs/REUSE-ISOLATION.md: the card and world info adapters (charx.ts,characterBook.ts,entries.ts), the storage layer (images.ts,quickReplies.ts,characterAssets.ts), the ComfyUI client, the shared quick-reply parser and memory module, the browser speech hook, and — the substantial one — the 1,034-line world info scanner. Behaviour is unchanged and no assertion was weakened;pnpm testpasses 873 in the server.The rule the batch followed is the one the document set out: a header comes off when the behaviour underneath is written down in a specification, never because the header became inconvenient. That is why
parse.tscould be rewritten —docs/DATA-FORMATS.mdrecords the entry hash's payload exactly — and whyprompt-definitions.tskeeps its identifier table described as the preset format even though the instruction text in it is CatCup's own. -
The scanner was rewritten only after its tests were. Six assertions were added first, describing what the existing code did; five of them were initially written from what the reader expected rather than what the code did, and every failure was a real fact — a chat that shrinks drops a sticky record by design, a group of one is not a decision, a total group weight of zero picks the first member rather than failing open, a multi-group entry never locks a group because its
groupfield is the whole CSV. Two of the new assertions also turned out to depend on an unseededMath.random, which is why they passed or failed at random until the roll was seeded; an existing test in the same file had the same flaw and had been passing by luck.The rewrite then dropped a state transition — a
minActivationspass handing off to recursion — that only those assertions caught. That is the argument for writing them first, made concretely rather than in the abstract. -
The README leads with what the product is and the Windows download, before the install notes, and
merges its duplicated "why another tavern" and "compatibility" prose into one bullet list plus one
table; the desktop features that shipped in 0.3.1 are no longer marked next, the provider entry
names all five request protocols, and a License section states the AGPL position and points at
NOTICE. -
Compatibility is stated as two rules rather than one. Data formats stay a hard constraint — every file CatCup writes must remain readable by SillyTavern, with field names, the JSONL header shape and unknown-field preservation intact. Runtime semantics are now a default rather than a mandate: a divergence is allowed when it is opt-in, leaves imported data readable by both clients, and is recorded in
docs/ST-COMPATIBILITY.mdwith the reason and the setting that controls it.CLAUDE.md,docs/ST-COMPATIBILITY.mdanddocs/LIMITATIONS.mdfollow. -
CatCup-only derived state — indexes, embeddings, caches — lives in a sidecar beside its source, and anything that must be written into a SillyTavern object goes under
extensions.catcup, which SillyTavern preserves and ignores. -
GET /api/auth/statusanswersdesktopandtitleBar, so the page can tell the shell from a browser tab and draw the bar only where the frame was removed. The geometry is passed in from the shell asCATCUP_TITLE_BAR_*rather than duplicated in the SPA.
Fixed
-
The production server no longer fails to start after
@catcup/compat-stlanded.pnpm start(and sopnpm build && pnpm start, the documented web and LAN path) died before opening a socket:ERR_MODULE_NOT_FOUNDforpackages/shared/src/director.js, and past thatERR_UNKNOWN_FILE_EXTENSIONonpackages/compat-st/src/index.ts. tsup'snoExternallist named only@catcup/shared, so the new workspace package — which, like it, exports TypeScript source rather than built output — was left as a runtime import for Node to resolve against a./foo.jsspecifier that only exists asfoo.ts. Both packages are bundled now andapps/server/dist/index.jsstarts and answers on its port. The desktop bundle was unaffected, because itsCATCUP_BUNDLE_DEPS=1path already inlines every dependency. This was found by starting the built server during release preparation, not by CI: CI built the server and never ran it. AStart the built serverstep now does, so the next package that lands this way fails the pull request instead of the release. -
The Telegram bot no longer answers into a group. Only a private conversation is answered; a group, supergroup, channel or a chat whose type this code does not recognise is dropped silently, the same way a message from a stranger is. RFC 0004 §8 always said groups should be ignored — the check was simply never written, so a message the owner sent in any group they were in was answered there, and the reply is public and cannot be taken back. Silent rather than a refusal, because a refusal posted into a group would announce that the bot exists.
-
/stopstops the generation. It answered "Stopped." and then delivered the whole reply anyway: the abort controller existed and was tripped, but the signal was never handed to the generation, so nothing was listening.GenerateInputnow requires one and the loopback request carries it, which closes the socket and lets the route's own close handler abort — the same path a browser tab closing takes. What had been written is still kept, withextra.stopped, exactly as a stop from the app is. A stop is also no longer reported as a provider failure: "Something went wrong: the reply was stopped" sent the person looking for a problem that did not exist. -
Switching profile restarts the Telegram bot. The bot's token is machine-wide while its allowlist, switches and bindings belong to a profile, and the switch did not re-sync — so after switching, the bot kept answering the previous profile's owner id until the next restart. The notification path reads the new profile's id, so the two disagreed, and which one lost depended on the setup: with one account across profiles nothing looked wrong at all. The transport is now stopped before the scope moves and rebuilt from the new profile after it, because the switch's busy check does not see a transport reply in flight.
-
Enabling or disabling a world info book no longer resets the other scan settings. The book checkbox sent a patch carrying only
globalBooks, but the request schema applied every other field's default to that patch on the way in, so the merge in storage overwrote the saved depth, budget percentage, budget cap, recursion, minimum activations and the matching flags with their defaults.PATCH /api/settingsnow treatsworldInfoas a true partial, the same way it already treatedmemory. Nothing on disk changes shape; a saved value simply survives the next book toggle.