Watch
1
0
Fork
You've already forked souveraine
0
Commit graph souveraine/src/ui/chat/mod.rs
Author SHA1 Message Date
Fimeg
45d25b25a4 pin CI to rust 1.94, fix agents detail pane + settings test
agents: wire the rest of the detail widgets into the section children so
PRIMARY badge etc actually render; drop the HARDCODED debug text.
settings: test needs a provider in the map before navigating to Providers
cat.
clippy: pin CI to rust 1.94 per Cargo.toml rust-version; also apply what
cargo clippy --fix could auto-fix for 1.96 compat.
2026-06-19 12:02:54 -04:00
Fimeg
d35370b9c9 merge fork work onto public: cockpit/portrait/sidebar widgets, select_list, expression_cache, sensorium+settings rework
new TUI work that had been living in a detached re-init'd checkout, replayed
onto the public lineage. keeps CI + skills. src-only; local scaffolding stays local.
2026-06-19 10:10:13 -04:00
Fimeg
f9122c3230 fix: safety hardening pass — eliminate unsafe, panics, and stubs
- Replace unsafe raw-pointer render callback in message_list with Arc<Mutex<>>
- Replace unsafe Cell::as_ptr() in splash with safe Copy derive + .get()
- Add .max(0.0) guards on all f32→u16 casts in bloom animation
- Replace unreachable!() with bail/return/match in 4 locations
- Replace expect() with Result propagation in 4 constructors (RemoteBackend, VoiceClient, BifrostClient, OpenAiOAuth)
- Wire manager kill/restart keys to signals (backend TODO remains)
- Pass agent name through TUI message render chain (was hardcoded "Ani")
- Implement scroll_page in message_list using List::scroll_by
2026-06-15 15:41:35 -04:00
Fimeg
6a4f5faea0 tuie: port settings, screens, and widget set to the tuie engine
New tuie widgets (buttons, dropdown, slider, accordion, checkbox, etc.),
settings screen port with model picker + text editor, and screen ports
for chat, cron, presence, welcome, and the agents manager.
2026-06-04 14:17:21 -04:00
Fimeg
a7e909d39d fix: review fixes for PRs #1 and #2
PR #1 (LlmProvider + OAuth) fixes:
- Move provider selection from [bifrost].provider to [inference].provider
  (Bifrost is a provider, not the parent category — they are peers)
- Add Inference category to settings TUI with provider picker
- Wire build_provider() into CLI/chat/model-refresh paths so OAuth
  works outside server mode
- Update ServerConversation to use Arc<dyn LlmProvider> for consistency

PR #2 (web UI) assessment:
- Remove entire web/ directory — not aligned with substrate ethos
  (client-side compaction model contradicts Constitution Article IV;
   autoCommit toggle misunderstands git-backed memory physics;
   vocabulary doesn't match project architecture)
- Keep the 3 new REST endpoints (config, compaction-logs, token metrics)
- Revert run_reflect path change (keep canonical ~/.souveraine/agents/)
- Delete souveraine_fixes.patch (dev artifact)
- Restore demo example (was commented out as workaround for missing file)
- Copy examples/demo.rs from primary branch (was never pushed to public)

Tests: 184 passed, 0 failed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 19:47:54 -04:00
Fimeg
d8707611da feat: chunked-replay token streaming for subconscious
Mirrors the primary's pattern at `src/server/turn.rs:445-471` — bifrost
returns the full response in one shot, we chop it into 10-char chunks
and emit each as a `SubconsciousToken` with a 20ms sleep between, so
the subconscious appears to be typing in real time.

The TUI side needed a small refit so the chunks don't each become their
own line in the stream Vec (a 10-char-wide vertical waterfall):

- `ChatState.subconscious_current: String` — the live-building line.
  Token chunks `push_str` here. The render path shows it as the
  brightest bottom line, ahead of finalized history lines above.
- `SubconsciousToolCall`/`SubconsciousToolResult` flush the buffer to
  `subconscious_stream` (as a finalized line), clear it, then push
  their own line. New `SubconsciousPass(active=true)` clears both.
- Render packs the visible window from newest backward, including the
  live line as the bottom entry; old history lines above fade upward
  toward `agent_dim` and gain the `DIM` modifier in the upper third.

If the stream receiver is dropped mid-chunk, the inner loop bails out
but the round itself completes — bifrost is already done, only the UX
narration is interrupted.
2026-05-22 15:11:09 -04:00
Fimeg
2e1f913acc feat: subconscious streaming line render, memory-tool routing for journal/ledger, 1.0.0 + dep bumps
TUI — subconscious live stream:
- Add `subconscious_stream: Vec<String>` to `ChatState`; events.rs already
  pushes here via `SubconsciousToken`/`SubconsciousToolCall`/`SubconsciousToolResult`.
- Render below the phase bar during `TurnPhase::Subconscious`. Newest at
  bottom in `palette.surfacing`; older lines fade upward toward
  `palette.agent_dim` via `lerp_color`; the oldest visible line gets the
  `DIM` modifier on top. Render path now builds `Vec<Line>` instead of
  collapsing into `Line::from(spans)` (the latter forced everything onto
  one horizontal row, which was the visible "1 2 3 across" bug). Lines
  are width-clipped with an ellipsis fallback.

Seeds — journal/ledger routing:
- Aster mandate Phase 3 now records journal entries via the `memory`
  tool at `journal/YYYY/MM/DD.md` (relative to memory root), never via
  `write`/`edit`. Previous phrasing read as a filesystem path and the
  model resolved it against cwd — when souveraine runs from the project
  tree that landed `journal/` and `memory/ledger/` directly in the
  source tree instead of the agent's memfs.
- "How I record" section likewise anchors ledger reads/writes to the
  `memory` tool's `append`/`read`/`write` commands.

Cargo:
- 0.1.0 → 1.0.0.
- tower-http 0.5 → 0.6, notify 6 → 7, crossterm 0.27 → 0.28.

Bug docs (`docs/bugs.md`):
- B-012: TUI doesn't auto-refresh after tool calls complete (event
  pipeline missing a redraw kick after `BackendEvent::ToolResult`).
- B-013: Tool calls stop working mid-conversation — model returns
  `tool_calls=0` for the rest of the session, no error or log.
  Suspected: recent `defs.rs` env-var refactor changing `retain`
  behavior on env vars, possibly nuking tool defs during schema gen.
- B-014: Subagent `run_in_background: true` blocks primary — the flag
  is parsed but never read; `Subagent::execute` unconditionally awaits;
  `SubagentPool` is a stub.

Task queue:
- Split old `live-subconscious-stream.md` into two scoped task files:
  `subconscious-live-reasoning-stream.md` (broader design — ticker,
  cockpit event log, agency-driven surfacing) and
  `subconscious-streaming-line-render.md` (this PR's narrow render
  wiring).
- New tasks: `prompt-override-system.md` (move hardcoded seeds into a
  project `prompts/` truth source the agent can override via
  `souveraine_operations/`), `pasted-content-formatting.md` (visual
  marker for pasted vs composed text).
- `CLAUDE.md` high-impact bullet: replace stale `rename-aster-to-subconscious`
  with `mid-turn-subconscious-checkpoint.md` (matches the c1f851f redesign
  that ripped out the watchdog in favour of `halt`/`intrusive` tools).

Public-branch prep:
- `docs/audit/external-security-audit-prompt.md` — scoped prompt for an
  external creds/PII/license sweep of the `public` branch.
- `commit-history-public.txt` — full public-branch log dump used as
  reference for that audit pass.
2026-05-22 15:10:44 -04:00
Fimeg
da974be3ab sync src/ from primary 2026-05-21 09:49:06 -04:00
Fimeg
4194f00635 feat: itinerary system, subconscious checkpoint, and user nickname
- Itinerary tool (set/advance/describe/clear) with YAML persistence
  and todo-linked enrichment, rendered as TUI header strip
- Mid-turn subconscious checkpoint: every N tool rounds, Aster assesses
  progress; HALT verdict breaks the loop with full correction pass
- Nickname tool: agent learns human's name via set/get/clear, stored
  in system/human.md frontmatter, TUI uses it in chat bubble labels
- Removed hardcoded human.md write from memory::init (wizard owns it)
- Prompt nudge for itinerary when live todos exist without a route
2026-05-20 09:21:11 -04:00
Fimeg
0792ece0ce Add T-035 itinerary-persistent-ui task file, update INDEX.md stats to 35 active tasks, add B-010/B-011 cross-references 2026-05-19 19:03:44 -04:00
Fimeg
61c2007226 feat: context pressure denominator, ambient sense formatting, resume timestamp, user nickname system, subagent background fork, settings LLM config, turn lifecycle, ledger lifecycle, subconscious evolution
- Context pressure footer now shows 'ctx 19% of 262k' (B-008)
- Ambient sense formatting as separate timestamp marker (B-010, T-034)
- Resume timestamp indicator with duration (T-032)
- User nickname system sourced from identity frontmatter (T-033)
- Subagent background fork task (B-009, T-031)
- Settings LLM config task (T-030)
- Turn lifecycle and sensorium completion task
- Ledger entry lifecycle task
- Subconscious evolution documentation
- Multimodal input metadata task
- Image support module (src/core/image.rs)
- Various refactors: config, seeds, session, consciousness engine, server modules, bridge, API handlers, TUI cockpit/commands/render, health panel, presence, setup wizard
- website/docs submodule update
2026-05-19 17:02:09 -04:00
Fimeg
f93f9ef45b feat: input cursor navigation, paste handling, word-boundary movement
- Left/Right arrows move cursor by char boundary, Backspace deletes at
  cursor, Char inserts at cursor (not end-of-string)
- Home/End jump to start/end, Ctrl+Left/Right skip by word
- Cursor renders at the correct visual position (wrapping-aware)
- Bracketed paste detection (crossterm 0.27 feature) — pastes >3 lines
  tagged with a system message so the agent sees pasted material
- Paste inserts at cursor position with no size cap
- docs/bugs.md updated: B-006 fixed
- CLAUDE.md, docs/tasks/INDEX.md updated for refactor status
2026-05-19 12:52:11 -04:00
Fimeg
ca2762a302 refactor: split chat.rs into focused modules
chat.rs (3265 lines) → 8 files in src/ui/chat/:
  mod.rs — re-exports, helpers, TopButtonBar
  events.rs — event/subcommand dispatch, input handling
  commands.rs — /slash command processor
  render.rs — main draw function, chat/layout rendering
  cockpit.rs — subconscious pane (the "cockpit" panel)
  overlays.rs — overlay/modal draw functions
  footer.rs — status bar rendering
  wrap.rs — word-wrap utility
2026-05-19 10:26:34 -04:00