tier3: contracts + tests for 12 remaining modules (all 39 files now have Contracts)
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 3s

This commit is contained in:
2026-05-05 12:36:42 -04:00
parent dcb5a1f1a6
commit a34b598858
21 changed files with 474 additions and 39 deletions

View File

@@ -6,8 +6,19 @@
* Overview
The CLI Gateway is the simplest interface to Passepartout — raw stdin/stdout over TCP. It connects to the daemon's framed protocol and translates between terminal input/output and the plist-based communication format. No TUI, no ncurses, no dependencies beyond a TCP socket. Every other gateway (TUI, Emacs, Telegram) builds on this same protocol.
** Contract
1. (gateway-cli-input text): wraps text in a ~:user-input~ envelope
with ~:source :CLI~ and injects into the pipeline via
~inject-stimulus~.
* Implementation
** Package Context
#+begin_src lisp
(in-package :passepartout)
#+end_src
** CLI Command Handling
;; REPL-VERIFIED: 2026-05-03T13:00:00
#+begin_src lisp
@@ -25,3 +36,26 @@ The CLI Gateway is the simplest interface to Passepartout — raw stdin/stdout o
:trigger (lambda (ctx) (eq (getf (getf ctx :meta) :source) :CLI))
:deterministic (lambda (action ctx) (declare (ignore ctx)) action))
#+end_src
* Test Suite
#+begin_src lisp
(eval-when (:compile-toplevel :load-toplevel :execute)
(ql:quickload :fiveam :silent t))
(defpackage :passepartout-gateway-cli-tests
(:use :cl :fiveam :passepartout)
(:export #:cli-suite))
(in-package :passepartout-gateway-cli-tests)
(def-suite cli-suite :description "Verification of the CLI Gateway")
(in-suite cli-suite)
(test test-gateway-cli-input-format
"Contract 1: gateway-cli-input injects a properly formed signal without error."
(handler-case
(gateway-cli-input "hello")
(error (c)
(fail "gateway-cli-input crashed: ~a" c))))
#+end_src