Commit Graph
274 Commits
Author SHA1 Message Date
lotherk 2428bf1052 dtchat: verify adapter files whose hash arrives at the end (T4.5)
Telegram and WhatsApp learn a document's SHA-256 only when the transfer is
finished, so their file-offer carries none and the digest comes with
file-end.  The UI used to verify only the offer hash, which meant those two
paths wrote the bytes unchecked.  accounts_run now takes the offer's hash
when there is one and the file-end's otherwise, hashes the .part file after
the last chunk and renames only on a match; a mismatch still removes the
part file and reports it in the status line and the transcript.

The fake adapter gained the matching modes: latehash offers without a hash
and sends the right one in file-end, badendhash sends a wrong one there.
tests/file_ui.sh drives all four shapes through the real UI under its own
Xvfb with DTCHAT_TEST_FILE_ACCEPT: files and latehash write the verified
hello world, badhash and badendhash are rejected and leave neither the file
nor a .part.  Measured with the built binaries: four ok, exit 0.

Harness entry DtChat/file_ui added; the full run is 53 ok/0 bad
(make mcde-host exit=0, build/logs/mcde-host-2026-11-17-endhash.log).
2026-11-17 13:08:55 +00:00
lotherk d0015a17da mcde: record the packaged-layout test in the gate
The harness now has 52 entries (DtChat/packaged_layout starts an account with an empty adapter path and checks that dtchat finds dtchat-telegram next to itself, in both the libtool and the installed layout).
2026-11-17 13:04:24 +00:00
lotherk 0edae73ab8 mcde: record the adapter-installation gate
All three protocol adapters install next to dtchat; mcde-linux install exit=0 and the PLIST check reports 3714 installed names, 8911 listed, ok. The installed dtchat-xmpp's NULL-connection crash on exit was fixed (7597394ec2), the installed binaries answer hello, and the harness is 51 ok/0 bad.
2026-11-17 12:56:49 +00:00
lotherk 2de121513b mcde: install the protocol adapters next to dtchat
dtchat-telegram joins bin_PROGRAMS (always built: TDLib when available, otherwise a stub that reports the missing library); dtchat-xmpp is installed when MCDE_STROPHE built it; the Go-built dtchat-whatsapp is installed by install-exec-hook when MCDE_GO is set. The PLIST lists dtchat-telegram unconditionally and the other two behind PLIST_VARS xmpp/whatsapp (left unset in the recipe, so a target without libstrophe/Go omits them while the host build installs all three). The accounts editor's default adapter path becomes <bindir>/dtchat-<protocol> in the packaged layout. Host build and mcde-linux install/plist follow.
2026-11-17 12:36:46 +00:00
lotherk fe564fcf42 mcde: name the WhatsApp-file gate log
The WhatsApp fake-file seam was built and the harness run against build/logs/mcde-host-2026-11-17-wafile.log (51 ok); the built adapter reassembled the 9000-byte file with the right SHA-256.
2026-11-17 12:33:23 +00:00
lotherk 655af81203 mcde: document the WhatsApp fake-file seam
The paragraph named only the Telegram seam; WhatsApp now has DTCHAT_WHATSAPP_FAKE_FILE and the DownloadAny path with SHA-256 as well.
2026-11-17 12:30:00 +00:00
lotherk 62d7323df2 dtchat: exercise WhatsApp incoming files with a real fake file (T9.1)
DTCHAT_WHATSAPP_FAKE_FILE makes the fake adapter offer that file (name, size, SHA-256), and on file-accept read it in 4 KiB blocks, emit file-data and a file-end carrying the hash; the real accept path (DownloadAny) now also sends the SHA-256 in file-end, and the static fake keeps its hello-world hash. tests/whatsapp_fake.py uses a 9000-byte deterministic file, checks the offer name/size/hash, reassembles every chunk byte-for-byte and verifies the file-end hash (31 checks, green stand-alone). Harness entry already exists; in-tree build and harness follow.
2026-11-17 12:29:27 +00:00
lotherk 7d7ca4ea2b mcde: record the persistent account-editor gate
The editor was built and the harness run against build/logs/mcde-host-2026-11-17-acctedit.log (51 ok); with the built dtchat an account was created in the dialog, accounts.json/secrets.json were written 0600 and its fake adapter went online.
2026-11-17 12:26:55 +00:00
lotherk 1480b67f1f dtchat: make the account editor persistent (T2.4)
The dialog now edits real accounts instead of in-memory demo entries: the schema is Label, Protocol (irc/xmpp/telegram/whatsapp/demo), Adapter path, Settings (JSON) and Secrets (JSON). It loads accounts.json/secrets.json through the runtime (label, protocol, adapter, settings, masked secrets), and Save builds the complete accounts/secrets documents for every account, extracts label/protocol/adapter and parses the two JSON fields, then calls the runtime's writer. The runtime saves via dc_store_save_accounts/_secrets (files 0600), swaps its stored JSON, removes deleted accounts from the model, and restarts all adapters from the new set; the UI data pointers are refreshed. Add/Delete/Save semantics are now file-backed. Verified through the real UI under Xvfb: Add filled (Label 'Fake via UI', adapter /tmp/opencode/fake_adapter, settings {"mode":"echo"}), Save wrote both files (0600) and started the fake adapter online; restarting dtchat shows the account and all fields again (screenshots dtchat-accounts-editor.png, dtchat-accounts-loaded.png). In-tree build and harness follow.
2026-11-17 12:23:15 +00:00
lotherk 72a90d1f08 mcde: name the Telegram-download gate log
The downloadFile/updateFile path and the fake file seam were built and the harness run against build/logs/mcde-host-2026-11-17-tgfile.log (51 ok); the built dtchat-telegram passed the 9000-byte reassembly/hash test.
2026-11-17 12:16:40 +00:00
lotherk 468be523ab dtchat: download accepted Telegram documents (T8.1)
An incoming messageDocument is remembered with its TDLib file id; file-accept sends downloadFile (priority 1, whole file) and updateFile is followed until local.is_downloading_completed, then the local file is read in 4 KiB blocks and sent as file-data with a file-end carrying the SHA-256 computed with dc_file_sha256. Unknown offers answer file-error. The fake mode can offer a real local file through DTCHAT_TELEGRAM_FAKE_FILE and exercises the same read/hash/chunk/event path; tests/telegram_fake.py now uses a 9000-byte file, checks the offer size and SHA-256, reassembles the chunks byte-for-byte and verifies the file-end hash (25 checks, green stand-alone). The adapter links CRYPTOLIB for EVP/dc_file_sha256. The TDLib downloadFile/updateFile branch is compiled but not exercised without an account. Full build and harness follow.
2026-11-17 12:12:44 +00:00
lotherk 1684789c16 mcde: record the join-dialog gate
Join Channel and the IRC join/part commands were built and the harness run against build/logs/mcde-host-2026-11-17-join.log (51 ok); the built UI joined #built through the fake adapter, the built IRC adapter passed irc_join, and both smokes pass.
2026-11-17 12:09:32 +00:00
lotherk 81a7f3010b dtchat: add the Join Channel dialog and the IRC join/part commands (T3.3/T4.4)
Conversation > Join Channel opens a Motif prompt (channel on IRC or room on XMPP); the OK callback calls the new join hook with the current account. accounts_run sets the hook, sends dc_adapter_join, adds the conversation (channel for IRC, group otherwise) and shows it; the adapter's conversation event updates it later. The IRC adapter now handles the join and part commands (JOIN <conv>, PART <conv> :reason) instead of ignoring them; XMPP already implemented join. Tests: tests/irc_join.py checks JOIN #new on the wire, the self-JOIN conversation event, PART #new and a clean bye (10 checks, standalone built adapter green); the UI path was verified with the fake adapter under Xvfb (DTCHAT_TEST_JOIN=#new -> 'accounts fake: join #new' and conversation #new) and the dialog screenshot build/mcde-shots/dtchat-join-dialog.png. Harness entry added (51). In-tree build follows.
2026-11-17 12:06:04 +00:00
lotherk 14cec80127 mcde: name the adapter-feature gate log
Typing, contacts and the file paths of both adapters were built and the harness run against build/logs/mcde-host-2026-11-17-adapters.log (50 ok); the built fake-mode suites have 24 (Telegram) and 28 (WhatsApp) checks.
2026-11-17 12:01:49 +00:00
lotherk cace5a3bfc dtchat: typing, contacts and files in the Telegram/WhatsApp adapters
Telegram: updateUser becomes roster events (name and online from userStatus), the typing command sends sendChatAction (typing/cancel), file-send sends a document via inputFileLocal, an incoming messageDocument becomes a file-offer, and the fake mode emits two contacts, an offer, data/end on accept and file-sent. WhatsApp: Connected emits the address-book contacts as roster, the typing command uses SendChatPresence and incoming ChatPresence becomes typing events, file-send uploads and sends a DocumentMessage, an incoming DocumentMessage becomes a file-offer (download on accept), and the fake mode emits contacts, an offer with SHA-256, data/end on accept, a typing echo and file-sent. tests/telegram_fake.py (24 checks) and tests/whatsapp_fake.py (28 checks) cover all of it and pass with the stand-alone binaries. In-tree build and harness follow; real incoming downloads and accounts remain.
2026-11-17 11:58:27 +00:00
lotherk 12b2258e12 mcde: name the QR-bitmap gate log
The QR bitmap was built and the harness run against build/logs/mcde-host-2026-11-17-qr.log (50 ok); the built dtchat shows the fake WhatsApp QR as a pixmap (build/mcde-shots/dtchat-whatsapp-qr.png).
2026-11-17 11:54:09 +00:00
lotherk acc12d85f6 dtchat: draw WhatsApp pairing QRs as a bitmap (T9.1)
The Go adapter encodes every whatsmeow QR code with github.com/skip2/go-qrcode and sends both the text (qrText) and the module bitmap the UI's request dialog already understands: qr {width,height,data}, one byte per module, 1 = dark, quiet zone included, base64. The fake pairing goes through the same request function, so tests/whatsapp_fake.py now checks a square bitmap, one byte per module, both module values and the empty quiet-zone corner; all 17 checks pass with the stand-alone binary. go.mod/go.sum carry the new module. In-tree build and harness follow.
2026-11-17 11:50:28 +00:00
lotherk 402b40b022 mcde: record the Telegram/WhatsApp skeleton gate
The TDLib link fix made the build green (build/logs/mcde-host-2026-11-17-tgwa2.log); the built dtchat-telegram and dtchat-whatsapp pass their fake-mode suites, the harness is 50 ok/0 bad and both smokes pass.
2026-11-17 11:48:33 +00:00
lotherk 491c010345 dtchat: add the Telegram and WhatsApp adapter skeletons (T8.1/T9.1)
Telegram: telegram_adapter.c speaks protocol v1 with settings api_id/api_hash/phone/database, TDLib 1.8.57 through td_json (setTdlibParameters, phone/code/password as request/answer, updateNewMessage, sendMessage), states and disconnect; without TDLib it still answers hello and reports the missing library as a fatal error. Debian's versioned TDLib directories are found by configure (header and lib scan) and passed as TDLIB_CPPFLAGS/TDLIBLIB; the adapter is always built (stub without the library). WhatsApp: a Go program under whatsapp_adapter/ with go.mod/go.sum using whatsmeow from the module cache and modernc sqlite, QR pairing through whatsmeow, message events and SendMessage; without Go it is not built (MCDE_GO). Its QR is sent as qrText, which the request dialog now shows when there is no bitmap. Both adapters have DTCHAT_*_FAKE modes; tests/telegram_fake.py (15 checks) and tests/whatsapp_fake.py (13 checks) drive hello, configure, connect, the pairing request/answer, online, send echo and bye, all green stand-alone. The harness runs them when the binaries exist (50 entries with both). TDLib and golang-go were installed with apt; the WhatsApp module builds with GOPROXY=off from the cache. Real accounts, QR bitmap and files follow.
2026-11-17 11:40:59 +00:00
lotherk 80a222d368 mcde: name the IRC-typing gate log
The IRC typing change was built and the harness (now 48 entries including the adapter suites) run against build/logs/mcde-host-2026-11-17-irctyping.log.
2026-11-17 11:31:56 +00:00
lotherk 1d59d8a2e8 dtchat: put the adapter suites in the harness (48 tests)
tools/mcde-tests.sh now runs tests/irc_typing.py against the built dtchat-irc and, when dtchat-xmpp exists, xmpp_fake/xmpp_muc/xmpp_drop/xmpp_ibb against the built XMPP adapter; the run is 48 ok/0 bad. The docs name the new count. This makes the protocol work part of the same gate as the C tests instead of a manual step.
2026-11-17 11:31:47 +00:00
lotherk c8fa15572a dtchat: add IRCv3 typing to the IRC adapter (T3.4)
The adapter requests the message-tags capability when the server offers it (together with sasl when a password is set) and remembers the ACK. Incoming @+typing=active|paused tags on TAGMSG or PRIVMSG become typing events with conv (channel or sender), on and who; the typing command sends @+typing=active|paused TAGMSG <conv> through the output queue, and is ignored when the capability was not negotiated. tests/irc_typing.py offers message-tags, checks the CAP REQ, sends alice's active/paused TAGMSGs, and verifies the adapter's own TAGMSG lines for typing on/off; all checks pass. The four existing IRC fake-server suites (adapter, channels, messages, reconnect) still pass with the new binary. In-tree build and harness follow.
2026-11-17 11:26:59 +00:00
lotherk 6e48d7992a mcde: name the typing gate log
The typing hook and the SHA-256 verification were built together and the harness run against build/logs/mcde-host-2026-11-17-typing.log (43 ok); typing on/off and the checksum mismatch were seen with the built dtchat.
2026-11-17 11:21:19 +00:00
lotherk 56b7a73662 dtchat: report typing from the input field (T4.3)
The UI gains a typing hook: XmNmodifyVerifyCallback sends typing on for the first change (and after a pause) with the current conversation, resets a 2.5 s timeout that sends off, finishes the old conversation when the selection changes, and ignores programmatic set_input (suppress flag). accounts_run sets the hook to dc_adapter_send_typing of the account that owns the conversation, so XMPP sends XEP-0085 composing/paused; the IRC adapter ignores the command it does not implement. DTCHAT_ACCOUNTS_DEBUG logs the on/off transitions. In-tree build and a focus-based check follow.
2026-11-17 11:17:41 +00:00
lotherk dd5f8b8472 mcde: name the SHA-256 gate log
The hash verification was built and the harness run against build/logs/mcde-host-2026-11-17-sha.log (43 ok); the built adapter passes the IBB hash checks and the built UI writes a matching file while refusing a mismatch.
2026-11-17 11:16:37 +00:00
lotherk 71718ce00f dtchat: verify adapter files with SHA-256 (T4.5)
The file protocol now carries the sender's SHA-256: the adapter computes it with dc_file_sha256 for an outgoing transfer, puts it into the IBB open metadata (urn:dtchat:file:0 sha256 attribute) and into file-sent, and passes the attribute of an incoming open through in file-offer. The UI stores the offered hash, hashes the part file at file-end and only renames when it matches; a mismatch removes the part file, reports 'file rejected: checksum mismatch' in the status line and the transcript, and never exposes the bytes under the final name. The fake adapter offers the correct hash in mode files and a wrong one in mode badhash. tests/xmpp_ibb.py checks the SHA-256 in the outgoing open and in the incoming offer. Verified stand-alone under Xvfb: mode files writes the 11-byte hello world, mode badhash leaves no file and no .part; the XMPP IBB suite passes with the hash checks. In-tree build and harness follow.
2026-11-17 11:13:07 +00:00
lotherk ee7e9fccfd mcde: name the file-UI gate log
The adapter file path in the UI was built and the harness run against build/logs/mcde-host-2026-11-17-fileui.log (43 ok); the built dtchat accepted a fake-adapter offer, wrote hello world and sent a file back.
2026-11-17 11:08:17 +00:00
lotherk 59f6453d5e dtchat: wire adapter file offers into the UI (T4.5)
accounts_run.c handles file-offer/file-data/file-end/file-reject/file-error: an offer creates the conversation and opens the existing file dialog, accepts send file-accept and write the base64 chunks into NAME.part (0600) in the state directory, file-end renames to a free name and adds a system line to the transcript, a reject sends file-reject and removes the part file; a file-sent confirms our own transfer. The runtime sets the UI file hook, so Conversation > Send File now works for an adapter account: send_file_cb falls back to the open conversation when there is no Nearby peer, and the hook sends file-send with the generated id. dc_adapter_send_file()/dc_adapter_file_answer() are the core side. The offer dialog was only 128x52 because its shell size was overridden before the popup; it now sets form and shell and repeats after 50 ms, and the timer is removed on destroy. The fake adapter gained a 'files' mode (offer, data, end on accept, reject on reject, file-sent on send). Verified under Xvfb: offer dialog 460x190, Accept by click writes hello world (11 bytes), Reject leaves no file, and DTCHAT_TEST_UI_SEND_FILE produces file-send/file-sent; screenshots build/mcde-shots/dtchat-file-offer.png and dtchat-file-received.png. In-tree build and harness follow.
2026-11-17 11:04:19 +00:00
lotherk ab38ad89ae mcde: name the T4.5 gate log
IBB (file transfer) was built and the harness run against build/logs/mcde-host-2026-11-17-t45b.log (43 ok); the four XMPP suites pass against the built adapter.
2026-11-17 10:53:21 +00:00
lotherk c0ad65b394 dtchat: file transfer over XMPP IBB (T4.5)
The adapter protocol gains additive file events: file-send (conv, id, name, path), file-accept/reject/cancel commands, and file-offer/file-data/file-end/file-sent/file-reject/file-error events, with a 32 MiB limit, 4 KiB blocks and an explicit accept before data flows; docs/reference/dtchat-adapter-protocol.txt defines them. xmpp_adapter.c implements XEP-0047: outbound open (with the name/size in a urn:dtchat:file:0 child), base64 data IQs acknowledged one by one and close, then file-sent; inbound open is held until file-accept answers the IQ, data chunks become file-data events, close becomes file-end, and a reject is an IQ error. libstrophe serialises a tag's text through a separate text stanza (set_text on a named tag returns -2), which the data blocks now do. tests/xmpp_ibb.py drives a minimal server: outgoing bytes arrive unchanged, an accepted incoming file yields offer/data/end with the right size, and a rejected offer becomes an IQ error; all 26 checks pass, exit 0, no stderr. The UI file path for adapter accounts (offer dialog, accept, writing the chunks) is the next piece; the adapter itself is complete.
2026-11-17 10:46:04 +00:00
lotherk 0d09f40d6b mcde: name the T4.6 gate log
The XMPP robustness change was built and the harness run against build/logs/mcde-host-2026-11-17-t46.log (43 ok); accounts are in the same binary.
2026-11-17 10:38:47 +00:00
lotherk 4dc38f6406 mcde: record the XMPP robustness and the account runtime
The XMPP paragraph still said the UI accounts were not wired; they run now (accounts_run.c). T4.6 (unexpected stream end -> exit 1, core restarts) is documented with tests/xmpp_drop.py; only the typing trigger in the input field is still missing.
2026-11-17 10:35:01 +00:00
lotherk bc3eb1f07b mcde: name the accounts gate log
The runtime build (autotools after the Makefile.am change) is build/logs/mcde-host-2026-11-17-accounts.log; the harness run after it is 43 ok.
2026-11-17 10:27:36 +00:00
lotherk d3cbb6c745 dtchat: run the configured accounts as adapters in the UI
accounts_run.c loads accounts.json (id, protocol, label, adapter, settings, enabled) and secrets.json (per account id) and starts one DcAdapter per enabled account, pumping the DcLoop from an Xt timeout. Its events go into the model and the panel: state into the status line, conversation (direct/channel/group) and roster entries into the model (roster sets presence), messages into the transcript via dtchat_ui_message_added, presence/typing/errors into the status/dialog, request events into the existing request dialog with the answer routed to that adapter. The UI send hook resolves the selected account (dtchat_ui_current_account) or the account that owns the conversation and calls dc_adapter_send_text; dtchat_accounts_join/_typing expose join and XEP-0085 for menus and tests. Normal GUI runs (not --demo/--local/--perf/--smoke) start with an empty model and the configured accounts; the demo peers are gone in that mode. dtchat-irc is installed next to dtchat and listed in the PLIST; dtchat-xmpp and the demo adapter remain build artifacts. Verified with the fake adapter under Xvfb (accounts fake: starting/online/sent alice/message alice), including the real UI send path (DTCHAT_TEST_UI_SEND), screenshot build/mcde-shots/dtchat-accounts.png; --smoke-test still passes.
2026-11-17 10:22:27 +00:00
lotherk cf71747e02 mcde: name the latest gate log
The XMPP work was built and the harness run against build/logs/mcde-host-2026-11-17-t44.log (43 ok); the paragraph still pointed at t71d.
2026-11-17 10:06:50 +00:00
lotherk 5a3b62283a dtchat: add XMPP MUC rooms (T4.4)
join sends a presence to room/nick with the http://jabber.org/protocol/muc <x/>; the room's self-presence is answered with a conversation event (kind group, title room), other occupants are reported as presence events with buddy=room/nick, groupchat messages are filed under the room with the sender's nick in from, and part sends an unavailable presence. The nick is the JID's local part. The hello caps gain muc. tests/xmpp_muc.py drives a minimal server through stream, SASL PLAIN, bind, join (checks the MUC element), self-presence, alice's presence, a groupchat message and the part; all 17 checks pass, exit 0, no stderr. UI wiring for adapter accounts is still open, as is the live test.
2026-11-17 10:02:33 +00:00
lotherk c772f3a0d9 dtchat: add XMPP carbons and chat states (T4.3)
After the bind the adapter enables XEP-0280 carbons and unwraps sent/received forwarded messages: a message another of our resources sent becomes a normal message event with self=true and the contact as conv, a received one self=false. XEP-0085 chat states are handled before the body: composing emits typing on, paused/active/inactive/gone off. The typing command sends composing or paused to the conversation, and dc_adapter_send_typing() puts it on the core side. tests/xmpp_fake.py checks carbons were enabled, the forwarded message (self, conv bob, text), typing on/off from bob, and that a typing command reaches the server as <composing> addressed to bob. Standalone adapter: all checks ok. The UI does not send typing for adapter accounts yet (adapter account wiring is still open), which the commit documents.
2026-11-17 09:56:18 +00:00
lotherk 245c5cea8d dtchat: add the XMPP roster and presence (T4.2)
After the bind the adapter sends <presence/> and asks for the roster (iq get, jabber:iq:roster) and handles the result and pushes: every item becomes a roster event with the contact's id, name, subscription and current online state. Presence from contacts is tracked per bare JID and emitted as presence events (online with the XMPP show and status, offline, subscribe/unsubscribe); libstrophe 0.14's get_text is used for child text. The hello caps gain roster and presence, and the event shapes follow docs/reference/dtchat-adapter-protocol.txt (buddy, contact, away). tests/xmpp_fake.py now checks that the client announces itself and asks for the roster, delivers bob (name/subscription) and carol, the online-with-show/status and offline presence, and still carries messages both ways. Run against the standalone adapter: 22 checks, all ok. In-tree build pending: make mcde-host is running after the configure change.
2026-11-17 09:48:58 +00:00
lotherk 90ced8b44b dtchat: build the camera on NetBSD's video(4) (T7.1)
NetBSD's sys/videoio.h speaks the V4L2 API (VIDIOC_*, v4l2_buffer,
v4l2_format, V4L2_PIX_FMT_YUYV), so media_capture.c's backend is shared:
linux/videodev2.h with HAVE_V4L2 on Linux, sys/videoio.h with HAVE_VIDEOIO
on NetBSD. configure checks sys/videoio.h in the NetBSD branch and
linux/videodev2.h otherwise; the guards for the mmap/poll/QBUF code accept
either. A build with neither header still gets the test pattern.

Verified with the cross compiler against build/obj/destdir.amd64:
media_capture.c and test_capture.c compile with -DHAVE_VIDEOIO (exit 0),
and the same sources still compile and run on Linux with -DHAVE_V4L2
(test_capture: v4l2:/dev/video0, all ok) and without either define
(test-pattern, all ok). It has not run on a NetBSD machine - no host is
available - so the release gate still needs that run.
2026-11-17 09:45:53 +00:00
lotherk 959e0044b9 mcde: put the current log and 43 tests in the gate paragraph
The old paragraph still named the t76 log and 41 tests; the T7.5/T6.7/T7.1 additions are in the 43-test run of t71d.
2026-11-17 09:42:56 +00:00
lotherk 070c1a09fd mcde: record the green 43-test gate (T6.7/T7.1)
make mcde-host exit=0 (t71d), tools/mcde-tests.sh 43 ok/0 bad with DtChat/test_capture and DtChat/p2p-audio, built smoke/xmpp_fake/p2p-audio pass, and two built UIs carried a video call with the camera and the test pattern.
2026-11-17 09:42:38 +00:00
lotherk eaef8c1bd9 mcde: record the camera and the finished call window (T7.1/T7.6)
V4L2 capture measured on the T14 camera, test pattern as fallback, video off/full screen/camera choice/LAN note in the call window, and the first video call between two UIs (90 frames each way, audio in real time).
2026-11-17 09:25:14 +00:00
lotherk 4c1063b5ba dtchat: camera capture, VP8 on the call and a real video picture (T7.1)
media_capture.c: V4L2 (YUYV, 4 mmap buffers, poll, QBUF again after use) and a
test pattern; a camera with another size is scaled to the call's 640x360, and a
build without HAVE_V4L2 gets the pattern. On this T14 the integrated camera is
/dev/video0 and gives frames (test_capture: v4l2:/dev/video0, non-uniform
frame, 320x180 through the scaler; pattern frames differ and have Y and
chroma). configure defines HAVE_V4L2 for linux/videodev2.h.

media_video.c gains dc_vpx_enc_keyframe (VPX_EFLAG_FORCE_KF on the next
frame), media_packet a DC_MEDIA_KFREQ control, media_call
dc_call_request_keyframe/take and DC_MEDIA_KFREQ in the sealed type range.
dc_call_video_out now decodes the reassembled VP8 frame into I420 (it returned
the compressed frame, which the UI drew as a green picture);
dc_call_video_packet keeps the compressed frame for tests and recordings.
Video timestamps are wall clock, not frame counts, so a pump slower than 15 fps
does not drift behind the audio clock.

localui starts camera+encoder on entering the call, sends 15 fps, requests a
keyframe after a loss, forces one when asked, decodes incoming frames into the
call window, drains up to four 20 ms capture frames per 40 ms pump (one per
pump halved the audio clock), and logs video in/out under
DTCHAT_CALL_DEBUG; DTCHAT_TEST_VIDEO switches to the pattern.

Two UIs under Xvfb: A pattern, B camera, 90 frames each way in about 6 s,
audio 300 frames (real time), the window shows the peer's picture
(build/mcde-shots/dtchat-t71-video-call.png). test_video_packet uses the
packet interface; its 50 KB/42-fragment loopback check still passes. New
harness entry DtChat/test_capture (43). In-tree build pending: a foreign
make release holds the lock.
2026-11-17 09:19:48 +00:00
lotherk cbd44e34f0 mcde: record the headless voice test (T6.7)
dtchat-headless --call and tests/p2p-audio.sh carry a 2 s tone between two instances and verify it; the harness has 42 entries. In-tree build pending because foreign builds hold the lock.
2026-11-17 08:54:39 +00:00
lotherk 1dbc4b8734 uefi stick: write-stick.sh (guarded) moves the backup GPT to the device end; STUPID.md goes (t0086)
The stick boots under OVMF (measured 2026-11-17); the old finding was a serial-line artefact.
The lesson is in tools/AGENTS.md; the status file is deleted as docs/AGENTS.md wants.
2026-11-17 08:52:46 +00:00
lotherk d843466346 mcde: record the dtchat call path (T6.5)
media-key exchange, call window wiring and the two-UI audio round trip are documented; the build gate is at 41 ok and the PLIST check passes, the next in-tree run is blocked by a foreign make userland.
2026-11-17 08:50:37 +00:00
lotherk 254faf7d33 dtchat: exchange media keys and wire live calls into the UI (T6.5)
The local protocol gets media-key: each side sends its ephemeral X25519 public key (base64) and UDP port over the ready text connection; both derive the direction keys with HKDF-SHA256, the caller is the initiator. localui sends the key on Conversation > Call, answers an offer with its own key, creates the call with dc_call_new_bound on the listener port (TLS and media share the number), rings, and opens the call window; an incoming ring enables Answer. The Xt loop pumps the call: drain, Opus decode to the playback stream, capture and encode only while our own PTT is held, video frames to the window, ring timeout. dc_local_conn_remote_addr gives the numeric peer address; dc_call_new_bound binds the announced port. dc_call_talking() is now only our own key, dc_call_peer_talking() the peer's (a received PTT used to start our microphone too). The call window has an Answer button and lays the buttons above the video so they stay visible. --call-first and DTCHAT_TEST_TRUST/DTCHAT_TEST_AUTOANSWER/DTCHAT_TEST_PTT drive the test: two UI instances auto-paired, exchanged media-key, rang, answered, reached IN_CALL and carried 200 Opus frames caller->callee with the callee silent (audio out 200 on the receiver, audio in 200 on the sender); screenshot build/mcde-shots/dtchat-t65-live.png. The smoke still passes; test_media_call uses peer_talking; test_media_packet covers the base64 key exchange. The test switch is documented in the security review.
2026-11-17 08:49:25 +00:00
lotherk c41146fe78 mcde: record the dtchat call window
The window with scaled video, PTT and hang-up is built and shown with --call-demo; a live call needs the media-key exchange in the local protocol.
2026-11-17 08:35:45 +00:00
lotherk ddf2a8a53c mcde: record T7.2 and T7.5
I420 scaling/XRGB conversion and audio-clock A/V sync are built; the call-level sync sequence drops frames more than 80 ms late. Camera capture, the call UI and the two-machine test remain.
2026-11-17 08:28:13 +00:00
lotherk 842db4a7d1 mcde: record the dtchat video work (T7.3/T7.4)
VP8 with 640x360@15/500 kbit/s and keyframe every 2 s, fragment/reassembly with keyframe request; test_video_vp8 and test_video_packet measure and pass. T7.1/T7.2/T7.5-T7.7 remain.
2026-11-17 08:16:19 +00:00