Commit Graph

40 Commits

Author SHA1 Message Date
0629f8c6d3 fix dialog navigation and sidebar data construction
Dialog: use consistent cl-tty.dialog: prefix for all select accessors.
The :cl-tty.select and :cl-tty.dialog packages each define their own
SELECT class with separate accessor generic functions. Mixing prefixes
caused "no applicable method" errors. Now all 14 references use
cl-tty.dialog: (make-select, select-filter, select-next, etc.)

Sidebar: fix sidebar-lines append arguments. Each item must be a
proper list of cons cells, not a bare cons. Replaced all quoted
'("x" . :y) with (list (cons "x" :y)). Also fixed the quoted
cons call that was never evaluated.

Bash script: add --disable-debugger and --eval '(uiop:quit 0)' to
the tui sbcl invocation. Prevents the debugger from entering raw
terminal mode on error and ensures clean exit.

cl-tty: delete stale select-package.lisp and select.lisp orphan files
(not tangled by any current org file).
2026-05-20 12:07:56 -04:00
b61191bec2 v0.8.0: TUI simplification — process-key-event, with-frame, inline reader
Replace queue-based key dispatch with process-key-event (inline in reader,
zero latency between keypress and render).
Add with-frame to cl-tty.backend (error-safe begin-sync/end-sync wrapper).
Use with-frame in redraw instead of manual begin-sync/end-sync.
Add initial render before main loop (UI appears before first read-event).
Remove position-cursor (replaced by inline block cursor in view-input).
Remove input-string/input-insert-char/input-delete-char wrappers.
Remove :input-buffer/:cursor-pos from state (managed by text-input widget).
passepartout script: set *debugger-hook* nil and failure-behaviour :warn
before quickload to survive compile warnings; remove cache-clear line.
2026-05-18 20:55:22 -04:00
20cfe2a75b v0.8.0: fix tui command stty failure handling with set -e
Add || true after stty commands so set -e doesn't kill the script
when stdin is not a terminal.
2026-05-18 13:57:04 -04:00
4b0034c1a5 v0.8.0: replace fragile /tmp/tui-load.lisp with direct ql:quickload :passepartout/tui
The generated temp script manually compiled and loaded TUI files from
/lisp/, silently swallowing compile errors and
leaving the user with a blank screen. Replaced with a direct ASDF load
that gives proper error messages and lets ASDF handle compilation.
2026-05-18 13:44:31 -04:00
73d42a812a v0.8.0: cl-tty input primitives, on-key keyword dispatch, XDG tangle paths, remove croatoan
- read-raw-byte: sb-unix:unix-read instead of read-char-no-hang
- raw-mode: sb-posix:tcsetattr instead of stty
- read-event: no probe-file /dev/stdin guard
- on-key: accepts &key ctrl alt shift code
- .asd: :croatoan dropped, :cl-tty added
- script: detection fix (empty lisp/ -> XDG)
2026-05-18 13:04:26 -04:00
e04b12c31c v0.8.0: TUI stabilization, command palette reverse-video highlight, hint bar redesign
- ROADMAP: consolidate all TUI work under v0.8.0 (removed premature
  v0.9.0/v0.10.x labels), restored original v0.9.0 eval harness plan
- channel-tui-view.org: Emacs-style reverse-video cursor (swap fg/bg
  instead of drawing █), hint bar now shows F:focus/MCP:count on left
  and token gauge + keybindings on right, sidebar reorganized to show
  GATE TRACE, RULES + BLOCK COUNT, COST, FILES panels
- channel-tui-main.org: command palette selection now uses reverse-video
  highlight (bg-input fg on input-fg bg, matching cursor style), fixed
  cond order so sel-p is checked before cat (all items had :category
  making sel-p unreachable), added session-cost extraction from daemon
- passepartout: export COLORTERM=truecolor for modern backend detection
2026-05-17 15:37:40 -04:00
7eca785b0a fix: TUI startup — bash script debugger-hook and tangled file regen 2026-05-16 17:43:20 -04:00
df33e8d6db fix: main loop never closed, disconnect-daemon ran every iteration
The main loop's closing paren was missing — (sleep 0.1)) only closed
sleep and the minibuffer let, but NOT the loop itself. The next form
(progn (disconnect-daemon)) was INSIDE the loop body, called on every
iteration. On first call it added '* Disconnected *' and cleared the
daemon stream, making the TUI permanently disconnected.

Fix: add ) to close the loop. Also:
- Connect-daemon runs synchronously BEFORE with-terminal (3 ports, 6s
  max). If daemon is already running, the TUI starts connected.
- If sync connect fails, background thread retries every 5 seconds.
- start-daemon in background (no blocking wait for daemon startup),
  so TUI appears immediately.
2026-05-15 12:08:40 -04:00
bd1e8a92be fix: terminal stty restore with trap (set -e kills script before restore)
set -e on line 2 causes the bash script to exit immediately when sbcl
returns non-zero, before the stty icanon echo ixon restore runs.
Add trap cleanup EXIT to guarantee terminal restore on any exit path.
2026-05-15 11:43:29 -04:00
9fb4393c9c fix: runtime crash (sb-ext:timeout undefined), replace with listen-based polling
- Remove handler-case + sb-ext:with-timeout 0.1 pattern entirely.
  sb-ext:timeout is a condition class, not a recognized type in the
  compilation environment, causing runtime 'undefined function' crash.
- Replace with dotimes 10 * (listen *standard-input*) + sleep 0.01
  polling loop. Same 0.1s timeout, no condition type dependencies.
- Also fix handler-bind → handler-case in tui-load.lisp so the stack
  unwinds properly (running with-terminal's shutdown-backend cleanup)
  before the crash handler runs, restoring terminal to normal state.
- Fix paren imbalance (off by 1) in the new listen-based reader code.
2026-05-15 11:36:46 -04:00
6d7dd9e1ea fix: clean TUI exit, restore terminal, suppress compiler warnings
passepartout script:
- Add (uiop:quit 0) after tui-main so SBCL exits on Ctrl+Q
- Remove exec to allow stty restore after sbcl subprocess
- Restore icanon echo ixon after TUI exits (terminal stuck raw)

channel-tui-view.org:
- Remove unused fb/h vars from test-sidebar-not-shown-narrow
- Add (declare (ignore w)) to render-styled
- Qualify theme-color as passepartout.channel-tui:theme-color
  (render-styled is in :passepartout package)
- Remove dead :url clause from pick in parse-markdown-spans
  (URLs handled by dedicated branch, not via pick)
- Update literate prose for all changes
2026-05-14 16:25:36 -04:00
74621cffd2 fix: disable flow control (-ixon) for Ctrl+Q, constrain prompt/hint to chat-w
- Added -ixon to stty so Ctrl+Q (XON byte) isn't swallowed by the
  terminal driver and reaches the TUI as :CTRL-Q
- view-input now truncates the prompt (> prefix + visible text) to
  chat-w - 2 characters, and the hint to chat-w characters, so
  neither extends into the sidebar area
2026-05-14 15:48:34 -04:00
345f3f397d fix: set stty -icanon -echo in bash script before exec sbcl
uiop:run-program inside SBCL can't access the terminal, so stty
calls from within Lisp fail silently. By running 'stty -icanon -echo'
in the bash script before exec sbcl, the terminal is already in
character-at-a-time mode when the TUI starts, and Ctrl+P/B keys
arrive as individual bytes through the cat pipe.
2026-05-14 15:39:05 -04:00
369a7c93a9 fix: export MY_TERM_COLS/ROWS before exec sbcl 2026-05-14 15:03:00 -04:00
d1359eba1d fix: export MY_TERM_COLS/LINES before exec sbcl
SBCL strips COLUMNS and LINES from the process environment.
Use non-standard names that SBCL doesn't filter. The values
are captured from stty size before SBCL starts.
2026-05-14 14:55:37 -04:00
b6ceb2525a fix: remove useless export COLUMNS/LINES from script
SBCL strips these from the environment regardless.
2026-05-14 13:46:37 -04:00
337b8cdd86 fix: nil guards on w and h in all view functions
Prevents crash when backend-size returns nil for height.
Defaults to 80x24 if dimensions are nil or invalid.
2026-05-14 13:41:15 -04:00
c4c1629816 fix: auto-clear cl-tty cache before TUI startup
Every passepartout tui run now deletes stale cl-tty fasls,
ensuring the latest backend-size fixes (ioctl fd0, env vars,
stty size, tput) are always compiled in.
2026-05-14 13:38:56 -04:00
7cb43a953d fix: export COLUMNS LINES before exec sbcl
bash sets COLUMNS and LINES but doesn't export them to
subprocesses. Without export, SBCL's posix-getenv returns nil
and the terminal size fallback fails. Add explicit export
before the exec sbcl line.
2026-05-14 13:36:59 -04:00
39a9a3d7f2 fix: remove :force t from cl-tty quickload (causes slow startup)
The :force t forces recompilation of cl-tty and all its dependencies
(including ironclad) on every run, making startup take 30+ seconds.
Without :force t, quickload uses timestamp-based caching. If cl-tty
source changes, delete ~/.cache/common-lisp manually.
2026-05-14 13:24:19 -04:00
adca69d29c fix: remove hardcoded v0.5.0, show daemon version in status bar
- Removed connect-daemon's hardcoded "* Connected v0.5.0 *" message
  (fired before handshake arrived, was always stale)
- Added :daemon-version slot to state plist, filled by handshake handler
- view-status now shows version: "● passepartout v0.7.2 msgs:N Rules:N"
- passepartout script: force cl-tty recompile (:force t) to pick up
  CSI positioning, ioctl sizing, and detection fixes
2026-05-14 09:11:22 -04:00
af4d81ec9f fix: add word-wrap function, complete TUI migration
- Add missing word-wrap function (was declared in contract but never defined)
- TUI now renders correctly: draw-text on framebuffer arrays works
- Daemon connection verified
- All three view functions (status, chat, input) call draw-text correctly
2026-05-13 16:06:05 -04:00
79896c5ffd fix: bypass ASDF compile for TUI load, use direct compile-file+load 2026-05-13 14:53:27 -04:00
c227877302 v0.8.3: TUI stabilization — box calls, package fixes, sandbox, configure
Bug fixes:
- Fix box() calls: set color-pair before box, pass ACS default chtype integers
- Fix markdown functions: move to passepartout.channel-tui package where
  Croatoan is imported; use add-attributes/remove-attributes instead of
  :bold/:underline kwargs to add-string; call theme-color in gate-trace-lines
  to convert theme keys to Croatoan colors
- Fix sandbox: remove dex:get/dex:post from restricted symbols
  (blocked neuro-provider from loading)
- Export *log-lock* from passepartout (was unbound in jailed skill packages)
- Fix configure: always deploy to XDG, skip cp when source==dest
- Fix bash crash handler format string (~~ escaping)
- Revert test reorder in 28 files (caused package leakage in skill loader)

Design cleanup:
- Extract tui-run-screen from tui-main for clean separation
- Remove inject-stimulus alias
- Merge *backend-registry* into *probabilistic-backends*
- Fix read-framed-message whitespace DoS (4096-iteration max)
- Add *read-eval* nil to dispatcher-approvals-process read-from-string
2026-05-13 09:17:48 -04:00
27d203ad67 v0.8.1: deduplication cleanup — remove duplicate defpackage/defvar blocks from programming-tools, duplicate plist-keywords-normalize from programming-lisp, duplicate *VAULT-MEMORY* from security-vault; TUI defensive fixes — add word-wrap function, wrap on-key in ignore-errors; daemon startup hardening — optional skill loads with handler-case 2026-05-13 09:17:48 -04:00
f6079246ee passepartout: v0.5.1 — Compilation Hardening
Fixed 3 real compilation errors:
- security-vault.lisp: bare defvar missing opening paren
- embedding-native.lisp: CFFI struct refs updated (llama-mparams→(:struct ...), 19 places)
- symbolic-events.lisp: heartbeat vars + save-memory-to-disk → passepartout:: prefix

Suppressed ~100 harmless cross-skill STYLE-WARNINGs:
- Added grep filter for STYLE-WARNING / WARNING: redefining
  in the pre-compile step of the passepartout bash script

ROADMAP updated: all v0.5.1 items marked DONE.
Test suite: 116/116 (100%)
2026-05-08 09:16:33 -04:00
924bf8f479 passepartout: v0.5.0 hotfix 2 — daemon stable
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s
- Restore (in-package :passepartout) to core-reason
- Move *VAULT-MEMORY* back to core-skills
- Fix ASDF and defstruct/defpackage ordering
- Increase daemon timeout to 120s
- Handshake: 0.5.0

Verified: daemon processes messages, TUI clean, gate trace works
2026-05-07 20:14:51 -04:00
da160b71e3 passepartout: v0.5.0 File Reorganization
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s
Extract non-core fragments using self-repair criterion:
- core-context -> symbolic-awareness (224 lines, fboundp guards in think())
- heartbeat generation -> symbolic-events (renamed events-start-heartbeat)

Rename 23 files for clarity and new naming scheme:
- 6 core: core-package, core-transport, core-pipeline,
          core-perceive, core-reason, core-act
- 13 system: symbolic-*, neuro-*, embedding-*, channel-shell
- 4 gateway: channel-cli, channel-tui-*, channel-tui-state

Utility relocations:
- markdown-strip -> programming-markdown
- plist-keywords-normalize -> programming-lisp
- cognitive-tool-prompt -> programming-tools
- VAULT-MEMORY -> security-vault
- Merge *backend-registry* into *probabilistic-backends*

Split gateway-messaging into channel-telegram/channel-signal/
channel-discord/channel-slack (4 independent skills)

Delete dead system-model.lisp (16-line wrapper)

Document self-repair criterion in DESIGN_DECISIONS

Version bump: 0.4.3 -> 0.5.0
2026-05-07 18:20:48 -04:00
1d91fcc6cc fix: 6 quality-of-life fixes — 0 remaining failures in core suites
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s
- log-message: silence TUI send-daemon error handler (no stdout bleed)
- now function: fix get-decoded-time destructuring (seconds↔minutes swap).
  Timestamps now show HH:MM instead of SS:MM.
- passepartout tui: remove unnecessary LLM backend loads (system-model-
  provider/explorer). TUI is a client, daemon handles LLM. Faster startup.
- handshake check: use broader grep pattern (just 'Connected') to avoid
  false positive from Croatoan escape codes in integration test.
- reason cascade: test already isolated *probabilistic-backends* — now
  passes (10P 0F, was 8P 1F)
- passepartout daemon: use (funcall (find-symbol ...)) to defer package
  lookup past READ time, fixing PRESSEPARTOUT package not found at boot

Test results: reason 10/0, repl 7/0, diagnostics 3/0, literate 4/1 (env)
TUI integration: 7/7 pass
2026-05-06 11:40:08 -04:00
7d7a4be668 fix: pre-warm in setup, TUI rendering diagnostics
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 3s
- passepartout setup: add pre-compile step for :passepartout + :passepartout/tui.
  So first daemon/TUI start is fast (~10s instead of ~120s).
- TUI test: remove pre-warm (now in setup). Add 3 rendering diagnostics:
  * add-msg-render: /eval injects agent msg, verify text on screen
    (isolates TUI rendering from daemon)
  * daemon-msg-roundtrip: wait for LLM, check via /eval that :agent
    entry exists in :messages list (isolates daemon\xe2\x86\x92TUI comm)
  * agent-response-renders: full E2E \xe2\x80\x94 LLM response text on screen
    (confirms complete TUI\xe2\x86\x92daemon\xe2\x86\x92LLM\xe2\x86\x92TUI pipeline)
- Fix missing #+end_src in shell block (was preventing tangle)
- Update Contract section with new Phase 3 diagnostic items
- Test: 7/7 pass (was 5/5)
2026-05-06 09:20:42 -04:00
035aac45e3 fix: remove :force t from TUI loader (incremental dev startup)
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s
2026-05-05 16:51:50 -04:00
8a7259c5c8 fix: TUI crash on keypress — config inner cond extra paren
Root cause: config inner cond had )))) (4 closes) but needed ))) (3).
The 4th ) prematurely closed the outer cond config clause, making
(t (cond ...)) a bare function call to T instead of the cond default.

Also fixed chat-render coordinate bug (:y 1 :x y -> :y y :x 1)
Added backtrace diag (handler-bind all errors, sb-debug to stderr)
Added asdf central-registry push + :force t for stale-cache prevention
2026-05-04 13:42:44 -04:00
d1951668cc fix: TUI undefined-function T crash + add backtrace diagnostics
- Added (push PASSEPARTOUT_DATA_DIR asdf:*central-registry*) before quickload
  so TUI loads from deployed code, not stale Quicklisp cache
- Added :force t to ql:quickload :passepartout/tui to ensure recompilation
- Added handler-bind for undefined-function around tui-main call:
  prints function name + full backtrace, then exits cleanly
- Added sb-debug:print-backtrace to *debugger-hook* for all unhandled errors
- TUI now starts without crash in tmux with TERM=screen-256color
2026-05-04 12:57:16 -04:00
02e0c21f06 fix: symlink target passepartout.sh → passepartout 2026-05-04 11:32:05 -04:00
2e19db80ce fix: setup to org/lisp dirs, TUI protocol, deploy test
- Rewrite setup_system: deploy to org/ and lisp/ instead of harness/ and skills/
- Rewrite doctor_repair: same paths
- TUI: add  fallback for tui subcommand (matching daemon)
- Fix send-message: use ~s instead of (~a) to avoid double-wrapping
- Fix input-submit: send proper (:type :event :payload ...) plist format
- Remove :timeout arg from get-char (croatoan doesn't support it)
- Remove debug log-message from event loop (was noisy)
- Verify: TUI runs from XDG deploy, sends messages, daemon processes
2026-05-04 11:28:46 -04:00
31e53e675e TUI config panel: full implementation, working through tmux
- Package: passepartout.gateway-tui (uses croatoan, usocket, bordeaux-threads)
- Config panel with 4 sections: Providers, Cascade, Models, View
- Config-render functions for each section with live provider data
- Fixed add-string keyword argument order (was positional)
- Added function-keys-enabled-p for arrow key handling
- Fixed config-render-models balance (missing close paren)
- Fixed config-render balance (missing close paren)
- Added providers-configured-p to core-loop
- First-run welcome messages when no providers configured
- Daemon-side: WELCOME log on empty *probabilistic-backends*
Known: F2 function key needs terminal-level keypad mode; /config typed command works
2026-05-04 11:09:22 -04:00
908936d4d3 rename gateway-* → system-model-* + gateway-messaging, de-ollama, add system-model-explorer
- Rename gateway-provider → system-model-provider (generic :local provider, no hardcoded ollama)
- Rename gateway-llm → system-model (model-request dispatcher)
- Rename system-embedding-gateway → system-model-embedding
- Rename gateway-manager → gateway-messaging (public api renamed to messaging-*)
- Add system-model-explorer (model discovery via OpenRouter API, cached, per-slot recommendations)
- Fix skill loader export: replace prefix-matching with fbound/boundp-based export (20 skills now export)
- Add model-router to skill-loader exclusion list (loaded via CLI)
- De-ollama: remove hardcoded assumed-available patterns from provider pipeline
- Default cascade: cloud-only (openrouter, openai, groq, gemini, deepseek, nvidia, anthropic)
- Env example: add LOCAL_BASE_URL, fix cascade order
- All org files updated with architectural prose (literate programming)
2026-05-04 09:58:59 -04:00
b728f73ded fix: remove stale ASDF push and apt spam from CLI script
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s
- Remove push of deleted XDG dir from TUI/daemon subcommands (quicklisp
  local-projects symlink covers it)
- check_dependencies now only checks sbcl/git/curl/emacs (not nc/socat),
  and runs apt-get update only when packages are actually missing
2026-05-03 20:16:35 -04:00
ff64556924 fix: passepartout CLI command — daemon/tui/repl now work from bash
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 3s
- PASSEPARTOUT_DATA_DIR now respects environment variable (was hardcoded to XDG)
- Daemon subcommand loads model-router and embedding-gateway lisp files
- TUI subcommand uses correct package name (passepartout.gateway-tui)
- Symlink created to ~/.local/bin/passepartout for PATH access
- Quicklisp local-projects symlink for ql:quickload without manual ASDF push
2026-05-03 20:13:52 -04:00
95d1ea3fed feat: add DeepSeek and NVIDIA NIM providers
- Add deepseek and nvidia entries to gateway-provider config

- Add DEEPSEEK_API_KEY and NVIDIA_API_KEY to .env.example

- Add deepseek and nvidia to doctor's LLM provider check

- Fix remaining harness-log → log-message reference
2026-05-02 22:25:24 -04:00