You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Introduce a dedicated assistant-reply renderer in:
77
+
-`src/frontend/agent_workspace.js`
78
+
-`src/frontend/workspace_panes.js`
79
+
-`src/frontend/index.html`
80
+
-`src/frontend/styles.css`
81
+
82
+
4.**HTML artifact path**
83
+
- Do not inject arbitrary full HTML into the main chat DOM.
84
+
- Treat large HTML payloads as artifacts with a sandboxed preview flow.
85
+
- This should mirror the existing product direction already proven in external references like Cherry Studio, while staying stack-native to NoteConnection.
86
+
87
+
5.**Streaming and transition safety**
88
+
- Keep current SSE + sync fallback behavior.
89
+
- Stream into `main_markdown` blocks rather than directly mutating plain-text message nodes.
90
+
- Preserve current `knowledgePoints` and capability execution behavior during the transition so the upgrade is forward-compatible rather than a rewrite.
91
+
92
+
### Acceptance criteria for this next slice
93
+
94
+
1. Tauri agent replies can render markdown headings, lists, tables, KaTeX, and Mermaid without leaving persistent error overlays in the visible chat surface.
95
+
2. The reply surface still works when only legacy `assistantMessage` is present.
96
+
3. Existing `knowledgePoints`, capability execution, and card registries remain backward-compatible.
97
+
4. The same shared render substrate can later be materialized or downgraded for Godot instead of forcing Godot constraints into the Tauri-first UX now.
98
+
16
99
## Current Branch Status
17
100
18
101
The branch has already crossed the "plan only" stage for this slice.
- The branch has moved materially beyond the last Program F-only status snapshot.
9
+
- Current code truth now spans five distinct slices that the older dashboard under-reported:
10
+
- scoped knowledge-workspace grounding is now real rather than graph-only optimistic,
11
+
- Tauri reader markdown/math/mermaid rendering is materially hardened,
12
+
- provider settings and TOML template management are now productized in the frontend,
13
+
- conversation preflight/CORS compatibility is fixed for turn-resume headers,
14
+
- desktop/runtime debug capture tooling is now part of the repo rather than an ad hoc local workflow.
15
+
16
+
Implemented now at current HEAD:
17
+
18
+
- Knowledge workspace closure:
19
+
-`src/frontend/source_manager.js` now publishes the active source target,
20
+
-`src/frontend/agent_workspace.js` now forwards `activeTarget` and scoped prefixes with conversation requests,
21
+
-`src/server.ts` now performs active-target-aware workspace hydration plus selective title-like hydration,
22
+
-`src/routes/data.ts` no longer shadows the real build / restore-cache path with stub behavior,
23
+
-`src/learning/KnowledgeLearningPlatform.ts` now exposes `workspaceReadiness`, `missDiagnostics`, title-hit planning, and request inspection helpers.
24
+
- Reader/runtime rendering hardening:
25
+
-`src/frontend/reader.js` now renders raw markdown, KaTeX, and Mermaid through one runtime path, with frontend render first and backend PNG fallback retained,
26
+
-`src/frontend/app.js` now suppresses leaked Mermaid error artifacts so long-lived error blocks stop occupying the visible Tauri surface,
27
+
-`src/notemd/MermaidProcessor.ts`, `src/reader_renderer.ts`, and `src/routes/render.ts` now strengthen parity and render-service behavior around Mermaid/Math handoff.
28
+
- Provider and settings delivery:
29
+
-`src/frontend/index.html`, `src/frontend/settings.js`, `src/notemd/AppConfigToml.ts`, `src/notemd/providerTemplates.ts`, and the locale bundles now expose a dedicated agent/provider settings page with preset templates and TOML materialization support,
30
+
- the API-version field is now documented in-product instead of being left as unexplained raw config.
31
+
- Runtime transport compatibility:
32
+
-`src/middleware/cors.ts` now explicitly allows `x-agent-conversation-turn-id` and `x-agent-conversation-resume-turn-id`, which closes the preflight failure that previously broke browser/Tauri conversation retries.
33
+
- Debug and evidence tooling:
34
+
- the repository now ships runtime/webview/window capture helpers plus Mermaid stage/export tooling under `scripts/`, so live Tauri failures can be inspected with first-party evidence commands instead of one-off manual probing.
35
+
36
+
Current Tauri product gap:
37
+
38
+
- The agent reply area is still plain-text oriented.
39
+
-`src/frontend/agent_workspace.js` still consumes `assistantMessage` as a flat string, and `src/frontend/workspace_panes.js` still mounts conversation messages via `node.textContent = message`.
40
+
- This means the current Tauri chat shell can issue grounded requests and action cards, but it still does not reuse the mature Reader markdown/math/mermaid rendering path for assistant replies.
41
+
- The next delivery step is therefore not another generic shell expansion. It is a Tauri-first reply-rendering upgrade that preserves the current contract while introducing a richer message model.
42
+
43
+
Code-vs-plan reality for this slice:
44
+
45
+
| Area | Prior expectation | Current HEAD reality | Status |
46
+
|---|---|---|---|
47
+
| Knowledge workspace grounding | scoped queries should resolve the selected corpus instead of only the loaded graph | active target, scope prefixes, title-like hydration, workspace readiness, and miss diagnostics are now wired across frontend, server, and KLP | Operational |
48
+
| Tauri markdown reader parity | markdown, math, and Mermaid should survive real runtime conditions without persistent error overlays | reader/runtime paths now render Mermaid with frontend-first + backend-PNG fallback and suppress leaked error artifacts | Operational |
49
+
| Provider settings | provider/model/API-key controls should be isolated and write durable TOML configuration | dedicated agent/provider settings surface plus preset/TOML template helpers are now present | Operational |
50
+
| Conversation retry transport | turn/replay headers should survive browser/Tauri preflight | CORS now allows both conversation turn headers | Closed |
51
+
| Tauri agent reply rendering | assistant replies should render rich markdown instead of plain text | reply area still uses `assistantMessage` + `textContent` and therefore remains rendering-incomplete | Open |
52
+
6
53
## 2026-05-26 Program F Closure
7
54
8
55
- The deep-student-derived next-phase program is now implemented through Program F at current HEAD.
@@ -84,10 +131,12 @@ Operational implication:
84
131
85
132
| File | Current Lines | Implication |
86
133
|---|---:|---|
87
-
|`src/server.ts`| 14,992 | routing is modularized, but the main server monolith is still large |
88
-
|`src/learning/KnowledgeLearningPlatform.ts`| 7,706 | KLP still carries major implementation gravity despite domain extraction |
89
-
|`src/frontend/path_app.js`| 4,649 | path workbench/controller split is incomplete |
90
-
|`src/frontend/app.js`| 4,713 | graph runtime still keeps a large host-side control surface |
134
+
|`src/server.ts`| 15,920 | routing is modularized, but the main server monolith is still large and now also carries more runtime orchestration |
135
+
|`src/learning/KnowledgeLearningPlatform.ts`| 10,043 | KLP remains the dominant implementation gravity well and now also carries workspace-readiness and planner logic |
136
+
|`src/frontend/path_app.js`| 4,943 | path workbench/controller split is still incomplete and now additionally carries reader-parity responsibilities |
137
+
|`src/frontend/app.js`| 5,953 | graph runtime still keeps a large host-side control surface and now also carries Mermaid error-guard behavior |
138
+
|`src/frontend/reader.js`| 1,334 | reader/runtime rendering is now a first-class subsystem rather than a lightweight helper |
139
+
|`src/frontend/agent_workspace.js`| 3,214 | agent orchestration exists, but reply rendering still has not crossed from text shell to rich message surface |
91
140
|`src/routes/knowledge.ts`| 690 | knowledge routes need another split before claiming route-layer compaction |
92
141
93
142
Use these numbers as the current HEAD truth. Older size-reduction tables later in this page remain useful as historical traceability, but they no longer describe the current branch state exactly.
@@ -101,6 +150,7 @@ It is the end-to-end delivery of:
101
150
- local knowledge-point listing,
102
151
- docked Tauri graph `focus mode` pane,
103
152
- docked learning-path pane that can coexist with graph focus and be promoted fullscreen.
153
+
- Tauri-first assistant reply rendering that can reuse the mature Reader markdown/math/mermaid pipeline.
104
154
105
155
Execution reference:
106
156
@@ -117,7 +167,10 @@ Current branch status for this slice:
117
167
- clicking `Learning Path` now mounts the existing path workspace (`path-container` + sidebars) into the docked learning-path pane instead of stopping at a text-only preview (`src/frontend/workspace_panes.js`, `src/frontend/agent_workspace.js`),
118
168
- the graph surface now reserves workspace width so conversation + graph-focus + learning-path can coexist in one host-owned layout (`src/frontend/styles.css`),
119
169
- graph-focus fullscreen now promotes the real graph workspace instead of only enlarging a metadata card (`src/frontend/workspace_panes.js`, `src/frontend/styles.css`),
170
+
- the scoped-knowledge conversation flow is now materially more honest about corpus readiness: active folder target flows into the request contract, the server selectively hydrates likely title-matching documents into the workspace, and conversation traces now include readiness + miss diagnostics instead of only returning an empty top-k result (`src/frontend/source_manager.js`, `src/frontend/agent_workspace.js`, `src/server.ts`, `src/routes/data.ts`, `src/learning/KnowledgeLearningPlatform.ts`),
120
171
- the new agent workspace shell now has i18n coverage for static shell strings plus runtime button/empty-state messaging, existing knowledge-card actions / localized system messages now re-render on language change instead of staying in the previous locale, conversation card rerender is now centralized through a card-kind renderer registry, and a source-level parity guard now checks append-kind vs registry alignment (`src/frontend/index.html`, `src/frontend/locales/en.json`, `src/frontend/locales/zh.json`, `src/frontend/workspace_panes.js`, `src/frontend/agent_workspace.js`, `src/agent_workspace.frontend.test.ts`),
172
+
- provider/model/API-key settings are now isolated into a dedicated agent settings page with preset-template and TOML-template flows, but reply rendering in that same workspace still remains plain-text and is therefore the next obvious Tauri-first closure item (`src/frontend/index.html`, `src/frontend/settings.js`, `src/notemd/AppConfigToml.ts`, `src/notemd/providerTemplates.ts`),
173
+
- the reader/runtime render stack is now substantially more robust for Tauri markdown usage: raw markdown, KaTeX, Mermaid frontend render, Mermaid backend PNG fallback, and leaked Mermaid error suppression are all present; the missing step is to reuse that stack inside the agent reply surface instead of keeping it isolated to the Reader (`src/frontend/reader.js`, `src/frontend/app.js`, `src/reader_renderer.ts`, `src/routes/render.ts`, `src/notemd/MermaidProcessor.ts`),
121
174
- locale governance now includes backend-to-frontend capability label-key parity blocking: emitted conversation capability `labelKey` values must resolve to non-empty bilingual `agentWorkspace.actions.*` entries (`src/learning/KnowledgeLearningPlatform.ts`, `src/frontend/locales/en.json`, `src/frontend/locales/zh.json`, `src/agent_workspace.locale.contract.test.ts`),
122
175
- modular knowledge-route closure now includes live browser strict proof instead of snapshot-only recovery: conversation response wiring, capability-triggered request routes, card-title localization, and graph-focus compatibility now pass `STRICT`, `UI_STRICT`, and `UI_DYNAMIC_STRICT` against real browser/network traces (`src/routes/knowledge.ts`, `src/learning/KnowledgeLearningPlatform.ts`, `src/frontend/app.js`, `src/frontend/locales/en.json`, `src/frontend/locales/zh.json`, `scripts/verify-agent-workspace-browser.js`),
123
176
- locale governance now also blocks capability failure-message drift: emitted `failure.messageKey` values must resolve to bilingual `agentWorkspace.messages.*` entries with aligned interpolation placeholders and stable fallback placeholder sets (`src/learning/KnowledgeLearningPlatform.ts`, `src/frontend/locales/en.json`, `src/frontend/locales/zh.json`, `src/agent_workspace.locale.contract.test.ts`),
0 commit comments