Cross-Cutting Design Principles

Status: Applies to all planned features

These principles apply across Trackers, Mode-Lorebook Injection, Journal, Packages, Fuzzy Time Search, and Entity Changelog. They address concerns that cut across individual feature boundaries.


User Editability: Humans Correct Machines

Every piece of auto-generated content -- tracker values, journal profiles, state facts, location cards -- must be editable by the user. LLMs make mistakes. The evaluation call will misread the narrative, merge two characters that shouldn't be merged, miss a location change, or hallucinate a detail that wasn't there. The user is the final authority.

Principles

  1. Everything is editable. Every auto-generated field, profile, fact, and tracker value can be directly edited by the user. No read-only AI outputs.

  2. Edits are authoritative. When a user edits a profile field, that edit takes precedence over future evaluation attempts. The evaluation call should not overwrite user corrections. Options:

    • Field-level "pinned" flag: user-edited fields are marked and skipped by evaluation
    • Edit history: if the user changed appearance from X to Y, future evaluation preserves Y unless the user un-pins it
    • Simplest: user edits bump updated_at on the field; evaluation only overwrites fields it originally set
  3. Inline editing, not forms. Profile fields should be editable in-place (click to edit) rather than through a separate form. Reduces friction for quick corrections.

  4. Bulk operations. Users should be able to merge duplicate profiles (the evaluation created two entries for the same character), split incorrectly merged ones, deactivate stale entries, and reorder.

Where this applies

Feature What's editable
Trackers Current tracker values, tracker definitions, extraction hints
Journal State facts, character profile fields, location profile fields, relationship state, aliases
Journal (Living Lorebook) All materialized lorebook entries
Packages All preset values, custom instructions, settings overrides

Evaluation Error Handling: Fail Gracefully, Surface Clearly

The evaluation LLM call (shared by trackers and journal) returns structured JSON. When that JSON is malformed, the system must handle it gracefully without losing the LLM's work.

Raw Response Preservation

When JSON parsing fails:

  1. Store the raw response. The evaluation LLM's raw text output is saved alongside the message, not discarded. The LLM might have produced useful content that just wasn't valid JSON.

  2. Carry forward previous values. Tracker values and journal profiles are unchanged -- the system uses the last known good state. No corruption.

  3. Notify the user. A non-intrusive indicator appears (e.g., a warning icon on the tracker sidebar or journal panel) letting the user know the evaluation produced an unparseable result. The user can:

    • View the raw response to see what the LLM intended
    • Manually apply the changes (edit tracker values or profile fields)
    • Dismiss the notification (accept the carry-forward)
  4. Log for debugging. The raw response and parse error are logged so patterns can be identified (bad model choice, prompt needs tuning, etc.).

UI for Failed Evaluations

[!] Tracker evaluation returned an unparseable response.
    [View raw response]  [Dismiss]

    Raw response:
    "The game time has advanced to Day 3, Afternoon and the party
     moved to Level 3. HP is now about 58 after the fight."

    ← This was prose instead of JSON. The user can read it and
       manually update the tracker values.

Structured Output Preference

To minimize parse failures, the evaluation call should prefer models and configurations that support structured output:


User vs. Creator Experience

Trackers, journal, and living lorebook features introduce significant complexity. This complexity is valuable for creators building experiences but overwhelming for users who just want to chat. The UI must cleanly separate these audiences.

The Problem

Today's chat interface already has settings for mode, lorebook, persona, custom instructions, summarization, memory, and knowledge retrieval. Adding trackers, journal, profiles, materialization, and evaluation settings on top creates a configuration firehose that intimidates casual users.

The Split

Two distinct UI modes, not just different pages but different levels of visibility:

Aspect User Experience Creator Experience
Goal Chat with a character Build and tune the experience
Tracker visibility See current values in sidebar, maybe toggle non-required ones Define trackers, set types/hints, bind to characters, link lorebooks
Journal visibility See character and location cards, edit if needed Full profile management, materialization, export to lorebook
Evaluation errors Simple "something went wrong" with manual edit option Full raw response, parse errors, evaluation prompt debugging
Settings Minimal (what model, how creative) Full (evaluation LLM, journal depth, materialization options)
Lorebook injection Transparent (just works) Mode editor with lorebook targeting, budget control

How Packages Enable This

Packages are the primary mechanism for bridging this gap. A creator builds the experience (picks trackers, tunes journal settings, configures modes with lorebook targeting, sets up evaluation hints) and publishes it as a package. The user starts the package and gets a polished experience where:

Packages turn creator complexity into user simplicity.

Progressive Disclosure

Even outside packages, the UI should use progressive disclosure:

  1. Default view: Chat + minimal sidebar (tracker values, character cards from journal). No settings, no configuration.
  2. Expanded view: Click to see journal details, tracker history, edit profiles. Still no evaluation/system internals.
  3. Creator/debug view: Full control -- evaluation prompts, raw responses, parse errors, materialization tools, mode editor with lorebook targeting. Accessed via a toggle or separate page.

Settings that only matter to creators should live in the Forge (creator tools), not in the chat interface. Chat settings should be limited to things that affect the user's immediate experience (model choice, temperature, font size, streaming).


Token Budget: Lorebook Entry Sizing

Lorebook entries are injected into the prompt alongside character data, trackers, journal, persona, and memories. Every token spent on lorebook content competes with everything else for context window space.

The 500-Token Rule

Individual lorebook entries should not exceed ~500 tokens. Entries larger than this should be split into multiple focused entries or trimmed to their essential content.

Why 500 tokens:

Guidance for Creators

Platform Enforcement


Evaluation Architecture: Shared Call, Unified Error Surface

The tracker evaluation and journal evaluation share a single post-response LLM call. This section clarifies how the unified call works with the principles above.

Single Call, Multiple Outputs

After the story response completes:

Evaluation LLM call:
  Input:
    - AI response text
    - Current tracker values + definitions + hints
    - Current journal profiles (active characters/locations)
    - Journal state facts

  Output (JSON):
    {
      "trackers": { ... changed tracker values ... },
      "journal": {
        "facts": [ ... new/updated facts ... ],
        "characters": { ... new/updated character profile fields ... },
        "locations": { ... new/updated location profile fields ... }
      }
    }

Error Handling Per-Section

JSON parsing can fail at different levels:

Failure Impact Handling
Total parse failure (not JSON at all) No trackers or journal update Store raw response, notify user, carry forward everything
trackers section malformed No tracker update Carry forward tracker values, apply journal changes if valid
journal section malformed No journal update Apply tracker changes if valid, carry forward journal
Individual field invalid (e.g., HP = "lots") That field skipped Apply all valid fields, log warning for skipped ones

Partial success is better than total failure. If the evaluation returns valid tracker updates but broken journal output, apply the trackers and carry forward the journal.