From 66ce095eb13b5f3cd1be4423e0c5d2fccdf5f2e4 Mon Sep 17 00:00:00 2001 From: dawn <90008@klbr.net> Date: Wed, 1 Jul 2026 12:36:17 +0300 Subject: [PATCH] split web app components --- .beads/interactions.jsonl | 1 + .beads/issues.jsonl | 2 +- klbr-web/src/App.svelte | 942 ++---------------- klbr-web/src/components/AddDaemonModal.svelte | 56 ++ klbr-web/src/components/ChatHeader.svelte | 364 +++++++ klbr-web/src/components/Composer.svelte | 68 ++ klbr-web/src/components/ConnectionRail.svelte | 91 ++ klbr-web/src/components/ReflinkPopover.svelte | 56 ++ .../src/components/ResolutionTraces.svelte | 174 ++++ klbr-web/src/lib/ui-types.ts | 120 +++ 10 files changed, 1021 insertions(+), 853 deletions(-) create mode 100644 klbr-web/src/components/AddDaemonModal.svelte create mode 100644 klbr-web/src/components/ChatHeader.svelte create mode 100644 klbr-web/src/components/Composer.svelte create mode 100644 klbr-web/src/components/ConnectionRail.svelte create mode 100644 klbr-web/src/components/ReflinkPopover.svelte create mode 100644 klbr-web/src/components/ResolutionTraces.svelte create mode 100644 klbr-web/src/lib/ui-types.ts diff --git a/.beads/interactions.jsonl b/.beads/interactions.jsonl index 707e16b..d76a330 100644 --- a/.beads/interactions.jsonl +++ b/.beads/interactions.jsonl @@ -95,3 +95,4 @@ {"id":"int-24fd625d","kind":"field_change","created_at":"2026-07-01T09:18:07.32698818Z","actor":"dawn","issue_id":"klbr-q53","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Moved external crate versions into root workspace.dependencies and switched member manifests to workspace=true; verified cargo metadata, workspace check, and workspace tests."}} {"id":"int-04183019","kind":"field_change","created_at":"2026-07-01T09:25:30.275787695Z","actor":"dawn","issue_id":"klbr-so2","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Split agent run_turn into stream_iteration and execute_tool_iteration phase helpers, reducing run_turn to a smaller dispatcher while preserving tool/preemption behavior; verified core and workspace tests."}} {"id":"int-5dcd101a","kind":"field_change","created_at":"2026-07-01T09:26:28.189416219Z","actor":"dawn","issue_id":"klbr-ds9","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Satisfied by e61b0e5 and 453b014: deduplicated run-loop failure handling and split run_turn into stream/tool phase helpers while preserving behavior; workspace tests passed."}} +{"id":"int-706d5ee3","kind":"field_change","created_at":"2026-07-01T09:35:51.422527514Z","actor":"dawn","issue_id":"klbr-6m2","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Split App.svelte into ConnectionRail, ChatHeader, Composer, AddDaemonModal, ReflinkPopover, ResolutionTraces, and shared UI types; verified svelte-check, build, diff check, and local Vite smoke."}} diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index afbefcc..6e4dff9 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -56,7 +56,7 @@ {"_type":"issue","id":"klbr-ow7","title":"core: refactor agent.rs run() loop failure-handling duplication","description":"agent.rs run() loop copy-pastes the exact same ~30-line backoff/failure-handling parsing block 4 times across different event stream branches. Extract to a helper function.","status":"closed","priority":2,"issue_type":"task","assignee":"dawn","owner":"90008@klbr.net","created_at":"2026-06-30T21:39:23Z","created_by":"dawn","updated_at":"2026-07-01T09:14:49Z","started_at":"2026-07-01T09:12:29Z","closed_at":"2026-07-01T09:14:49Z","close_reason":"Extracted duplicated agent run-loop stream-failure backoff handling into a shared helper with a named retry limit; verified klbr-core tests.","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"klbr-7e0","title":"core: clean up dead tool files in src/tools/","description":"There are 12 unused tool files in klbr-core/src/tools/ (remember.rs, recall.rs, tag_memory.rs, etc.) that are not declared as submodules or registered. They should be deleted.","status":"closed","priority":2,"issue_type":"task","assignee":"dawn","owner":"90008@klbr.net","created_at":"2026-06-30T21:39:16Z","created_by":"dawn","updated_at":"2026-06-30T22:08:24Z","started_at":"2026-06-30T22:05:01Z","closed_at":"2026-06-30T22:08:24Z","close_reason":"Removed unregistered old memory tool modules and updated memory docs","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"klbr-q53","title":"workspace: consolidate dependency versions via workspace.dependencies","description":"Workspace is not utilizing cargo workspace dependencies, causing version drift between core, daemon, discord, and ipc. Consolidate them in the root Cargo.toml.","status":"closed","priority":2,"issue_type":"task","assignee":"dawn","owner":"90008@klbr.net","created_at":"2026-06-30T21:39:10Z","created_by":"dawn","updated_at":"2026-07-01T09:18:07Z","started_at":"2026-07-01T09:15:45Z","closed_at":"2026-07-01T09:18:07Z","close_reason":"Moved external crate versions into root workspace.dependencies and switched member manifests to workspace=true; verified cargo metadata, workspace check, and workspace tests.","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"klbr-6m2","title":"web: refactor and split App.svelte monolith","description":"App.svelte is currently a 3000+ line file holding all UI, WS client, and styles. Needs to be split into modular components like Sidebar, ChatPane, Metrics, and XmlVisualizer.","status":"open","priority":2,"issue_type":"task","owner":"90008@klbr.net","created_at":"2026-06-30T21:39:03Z","created_by":"dawn","updated_at":"2026-06-30T21:39:03Z","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"klbr-6m2","title":"web: refactor and split App.svelte monolith","description":"App.svelte is currently a 3000+ line file holding all UI, WS client, and styles. Needs to be split into modular components like Sidebar, ChatPane, Metrics, and XmlVisualizer.","status":"closed","priority":2,"issue_type":"task","assignee":"dawn","owner":"90008@klbr.net","created_at":"2026-06-30T21:39:03Z","created_by":"dawn","updated_at":"2026-07-01T09:35:51Z","started_at":"2026-07-01T09:26:57Z","closed_at":"2026-07-01T09:35:51Z","close_reason":"Split App.svelte into ConnectionRail, ChatHeader, Composer, AddDaemonModal, ReflinkPopover, ResolutionTraces, and shared UI types; verified svelte-check, build, diff check, and local Vite smoke.","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"klbr-ds9","title":"refactor and simplify core agent loop without losing behaviour","status":"closed","priority":2,"issue_type":"task","assignee":"dawn","owner":"90008@klbr.net","created_at":"2026-06-30T21:20:30Z","created_by":"dawn","updated_at":"2026-07-01T09:26:28Z","started_at":"2026-07-01T09:26:28Z","closed_at":"2026-07-01T09:26:28Z","close_reason":"Satisfied by e61b0e5 and 453b014: deduplicated run-loop failure handling and split run_turn into stream/tool phase helpers while preserving behavior; workspace tests passed.","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"klbr-jae","title":"Design aggregate evidence value representation","description":"LongMemEval aggregate misses show that a prompt fix would be benchmark-shaped and brittle. The structural gap is evidence representation: EvidenceFactRow currently stores only the first numeric value from a chunk, often capturing list ordinals, dates, or distractors instead of the values needed for counts/sums. Design and implement a general value representation for memory evidence that can keep multiple numeric mentions with nearby unit/currency/date/entity context, then only enable deterministic aggregate synthesis when the rendered facts are grounded and unambiguous.","status":"closed","priority":2,"issue_type":"task","assignee":"dawn","owner":"90008@klbr.net","created_at":"2026-06-30T21:01:47Z","created_by":"dawn","updated_at":"2026-06-30T21:11:59Z","started_at":"2026-06-30T21:02:38Z","closed_at":"2026-06-30T21:11:59Z","close_reason":"Implemented typed evidence value mentions for fact rows, rendered them in memory packets, and made aggregate synthesis use only finite same-kind/unit aggregateable values. Ordinals, dates, and mixed-unit rows now abstain instead of falling back to first-number arithmetic; no prompt fixes were added.","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"klbr-2jh","title":"Inspect aggregate and value-synthesis LongMemEval misses","description":"The sample-100 query-time LongMemEval run showed 12 official failures where the answer ref was rendered but the answer value was not visible, plus 10 value-visible reader or synthesis failures. Inspect aggregate_count, aggregate_sum, lookup, and update_resolution misses to decide whether packet rendering, fact extraction, or final reader prompting needs the next fix. Use measured miss buckets rather than broad context fanout.","notes":"Inspected sample-100 aggregate/value misses without prompt changes. User explicitly rejected prompt-fix/hardcoding route. Findings: many aggregate misses are not simple retrieval failures; literal answer_value_visible is misleading for derived answers like 5+3=8 or component expenses summing to 85, and short numeric answers can produce false positives from unrelated dates/list ordinals. Also found a real diagnostic bug: assemble_context marked every selected packet ref as used/rendered even when render_evidence_packet omitted that ref under packet budget. Fixed core ref accounting so render_evidence_packet_with_refs reports emitted body/fact/timeline refs and assemble_context.used_refs tracks only those. Tightened bench diagnostics so answer_value_visible requires an answer-bearing ref to have been emitted, and critical_fact_row_visible requires a fact row for an answer-bearing ref. Targeted retrieval-only rerun for 46a3abf7 now reports answer_bearing_ref_selected=1.0 but rendered/in_context/value_visible/critical_fact_row_visible=0.0, correctly rebucketing it as selected_not_rendered instead of value-visible reader failure. Tests: cargo fmt --check, cargo test -p klbr-core, cargo test -p klbr-bench, git diff --check.","status":"closed","priority":2,"issue_type":"task","assignee":"dawn","owner":"90008@klbr.net","created_at":"2026-06-30T20:47:37Z","created_by":"dawn","updated_at":"2026-06-30T21:01:48Z","started_at":"2026-06-30T20:49:47Z","closed_at":"2026-06-30T21:01:48Z","close_reason":"Completed structural inspection and diagnostic fix; filed aggregate value representation follow-up.","dependency_count":0,"dependent_count":0,"comment_count":0} diff --git a/klbr-web/src/App.svelte b/klbr-web/src/App.svelte index fdfe47a..3e75c66 100644 --- a/klbr-web/src/App.svelte +++ b/klbr-web/src/App.svelte @@ -1,7 +1,12 @@ + +
{sessionLine(active)}
+{popover.body}
+ {:else}
+