ELNOR REPO READER TEXT MIRROR Original path: Current Specs/DOC19/DOC19_ORIG_SPEC_FILLS_AND_FIXES.md Source repo: /Users/OpenClaw1/Elnor/Elnor Specs Git branch: main Git commit: dbaa25962edc11ab30e8d4ca1715f9ae5bf77331 Generated: 2026-06-09T01:23:58.539Z --- # DOC19 — Orig Spec Fills and Fixes Fixes, additions, and undocumented behaviors implemented outside the original DOC specs. These need to be folded into the next spec rebuild so they are not lost during future code-generation passes. --- ## Staging Rule (Read First) `DOC19` is a staging ledger. Entries here are preserved implementation knowledge and promotion packets, not operative owner truth by themselves. Rules: 1. Treat every entry as `staging-only` until it is promoted into a versioned owner doc. 2. Do not assume owner-doc adoption just because an item exists in `DOC19`. 3. Keep entries in `DOC19` until promotion is completed and verified against release gates. 4. During promotion, update owner docs and ledgers first; then mark the `DOC19` entry as promoted/deprecated if desired. --- ## Table of Contents 0. [Staging Rule (Read First)](#staging-rule-read-first) 1. [Markdown Renderer Component](#1-markdown-renderer-component) 2. [Forum / Panel Text Whitespace Normalization](#2-forum--panel-text-whitespace-normalization) 3. [Forum Orchestrator Proactive Tick System](#3-forum-orchestrator-proactive-tick-system) 4. [Orchestrator Mode Gate Fixes](#4-orchestrator-mode-gate-fixes) 5. [Orchestrator Dedupe Key Fix](#5-orchestrator-dedupe-key-fix) 6. [Entity Sync Race Condition Fixes](#6-entity-sync-race-condition-fixes) 7. [Frontend Tick Response Application](#7-frontend-tick-response-application) 8. [Orchestrator Debug Logging](#8-orchestrator-debug-logging) 9. [New Dependencies](#9-new-dependencies) 10. [Backend-Side Proactive Tick Timer](#10-backend-side-proactive-tick-timer) 11. [Frontend Entity Sync Architecture Refactor](#11-frontend-entity-sync-architecture-refactor) 12. [Queue Processor Concurrency Fix](#12-queue-processor-concurrency-fix) 13. [Orchestrator Error Logging and Cost Cap Logging](#13-orchestrator-error-logging-and-cost-cap-logging) 14. [Interactive Chat / Forum / Panel Latency and Composer Architecture](#14-interactive-chat--forum--panel-latency-and-composer-architecture) --- ## Thematic Groups | Group | Focus | Sections | |-------|-------|----------| | Group A | UI rendering and presentation behavior | 1 | | Group B | Forum/panel orchestration and sync core fixes | 2, 3, 4, 5, 6, 7, 8 | | Group C | Dependency/build + reliability placement block | 9, Summary, 10, 11, 12, 13 | | Group D | Interactive latency architecture and cross-doc promotion packet | 14 | --- ## Group A — UI Rendering and Presentation ## 1. Markdown Renderer Component **Problem:** All model-generated text across the entire dashboard rendered as raw plaintext. No formatting for headings, bold, lists, code blocks, tables, etc. **Spec gap:** No DOC spec defined a shared Markdown rendering component, element-level styles, or the remark/rehype plugin chain. ### What was built New file: `apps/q-frontend/src/components/MarkdownRenderer.jsx` A shared, memoized React component using `react-markdown` with the following plugin chain: | Layer | Plugin | Purpose | |-------|--------|---------| | Remark | `remark-gfm` | GitHub Flavored Markdown (tables, task lists, strikethrough) | | Remark | `remark-breaks` | Treats single `\n` as `
` (standard Markdown needs `\n\n`) | | Rehype | `rehype-highlight` | Syntax highlighting for fenced code blocks | ### Design tokens The component mirrors the Q Dashboard design tokens so all styled elements match the rest of the UI. These must stay in sync with `QDashV11.jsx`: ``` font.sans = "Sohne, Helvetica Neue, -apple-system, BlinkMacSystemFont, sans-serif" font.mono = "Sohne Mono, SF Mono, Menlo, monospace" c.textPri = #1A1D21 c.textSec = #5E6570 c.textTer = #8B919A c.accent = #4A5060 c.accentBtn = #31588c c.border = #E0E2E5 c.borderLight = #ECEEF0 c.bgPanelAlt = #F9FAFB R.sm = 6px R.md = 10px R.lg = 14px ``` ### Styled element overrides Every Markdown element has a custom `components` override with inline styles. These are the design decisions that need to be in the spec: | Element | Font Size | Line Height | Color | Margins | Notes | |---------|-----------|-------------|-------|---------|-------| | `p` | 13px | 1.7 | textSec | 0 0 10px | Base paragraph | | `strong` | inherit | inherit | textPri | -- | fontWeight 650 | | `h1` | 20px | -- | textPri | 24px 0 12px | Bottom border, borderLight | | `h2` | 17px | -- | textPri | 20px 0 10px | Bottom border, borderLight | | `h3` | 15px | -- | textPri | 16px 0 8px | No border | | `h4` | 13.5px | -- | textPri | 14px 0 6px | No border | | `ul` | -- | 1.7 | -- | 8px 0 12px | paddingLeft 22, disc | | `ol` | -- | 1.7 | -- | 8px 0 12px | paddingLeft 22, decimal | | `li` | 13px | -- | textSec | 0 0 4px | paddingLeft 4 | | Inline `code` | 0.88em | -- | #1F2937 | -- | bg #F3F4F6, 1px border borderLight, radius 4 | | Block `code` | 12px | 1.6 | #1F2937 | -- | Inside pre wrapper | | `pre` wrapper | -- | -- | -- | 10px 0 14px | Rounded border, borderLight, overflow hidden | | `pre` inner | 12px | 1.6 | #1F2937 | 0 | bg #F3F4F6, mono font, overflowX auto | | Code lang label | 10px | -- | textTer | -- | Uppercase, bg #F3F4F6, bottom border, weight 600 | | `blockquote` | 13px | 1.6 | textSec | 10px 0 | Left border accentBtn 80% opacity, italic, bg bgPanelAlt | | `a` (link) | inherit | -- | #2563EB | -- | No underline, 1px bottom border rgba blue | | `hr` | -- | -- | -- | 16px 0 | Top border only, color border | | `table` wrapper | -- | -- | -- | 10px 0 | overflowX auto | | `th` | 12px | -- | -- | padding 8x12 | fontWeight 650, bg #F3F4F6, 2px bottom border | | `td` | 13px | -- | -- | padding 8x12 | 1px bottom border borderLight | | Striped rows | -- | -- | -- | -- | odd bg #F9FAFB via CSS nth-child | | `img` | -- | -- | -- | 8px 0 | maxWidth 100%, radius sm | | checkbox `input` | -- | -- | -- | marginRight 6 | accentColor accentBtn, readOnly, cursor default | ### Syntax highlighting theme Inline `