The plain-file ext/src/mcde of the Makronix tree carried dtphoto (layers, PSD,
clipboard shape, JPEG/GIF/XPM writers), dtbar, dtsystemsettings (Startup Disk,
dock), dtwm and icon changes that this fork did not have. Resolved by hand:
dtphoto.c, McdeThumb.c, Thumb.h, dtsystemsettings, dtphoto.msg, AGENTS.md take
the Makronix side (a strict continuation of what the fork mirrored); the fork's
own changes are kept (M_PI guard and the front[] fix of 4e51d6dd, 'No
dttoolchest menu', DeskLowerBackdrops, distinfo until the next ext-dist).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Two defects in the test suite, both of the kind that fails on another
machine but not on the one it was written on.
1. Seven tests put their scratch directories below /tmp/opencode --
a directory of the environment they were written in, not of the
system. mkdtemp() returns NULL when the parent is missing, so on a
machine without /tmp/opencode every one of them failed with a "NULL"
check or perror("mkdtemp"), and nothing was wrong with the code under
test. dc_test_tmpdir() (dc_internal.h, instance.c) now uses $TMPDIR,
or /tmp when it is unset or not absolute.
Measured: after renaming /tmp/opencode away (sudo mv), make check in
lib/libDtChat is 24/24; before the change the same run failed on
test_identity, test_pair, test_store, test_instance, test_filexfer,
test_local and test_i18n.
2. test_i18n takes <de.msg> <en.msg> but TESTS runs it without arguments
(f46a914c added it to TESTS without a runner), so `make check' always
reported "FAIL: test_i18n" with the usage line -- measured 2026-11-22
on the merge build, and identically on build/mcde-host, so not a
regression of that merge. tools/mcde-tests.sh names the files and
passes; the test now falls back to $srcdir (which automake's test
driver exports) and finds them itself, the arguments still winning.
Test: make check in lib/libDtChat -> 24/24 PASS (was 23/24). Both call
forms of test_i18n give "test_i18n: all ok": with the two arguments and
without them. With /tmp/opencode renamed away the full check is green as
well, and the seven scratch directories appear under $TMPDIR when set.
The 404 commits of the local Makronix tree's ext/src/mcde subtree
(tree 2694129d, the fork's 6a620b12 is the common base) onto the fork's
own 411.
Conflicts, all three resolved to this branch because the fork is the
newer side and the split would only have brought the older text back:
- programs/dtsystemsettings/panes.c: the split lacks the Dock pane
(bc84289d's re-indent included).
- programs/dtsystemsettings/main.c: the split still calls MakeStartupDisk,
which 345c5410 removed ("no call to the removed Startup Disk pane").
- programs/dttoolbox/dttoolbox.msg: the split still says "No ToolChest
menu", bc84289d made message 2 match message 1's spelling.
Carried over from the split: dtphoto (1280 -> 13908 lines), dtpaint
(997 -> 3108), Mcde/Thumb.h and McdeThumb.c, printers.c, the de_DE
catalogs.
Test: git merge-base main origin/split = 9b8e5b12; per-file three-way
diff before resolving (only the fork's own text was dropped); no conflict
markers left (git grep -I -E '^(<<<<<<<|>>>>>>>|=======$)'); merge index
carries dtphoto.c and dtpaint.c from the split side.
libDtChat's text.c converts the session charset with iconv, and AM_ICONV
finds GNU libiconv, but libDtChat_la_LIBADD did not carry LTLIBICONV: the
library kept libiconv_open/-close/- undefined, and dtchat, dtchat-headless
and dtchat-irc failed to link ("undefined reference to libiconv_open",
measured 2026-11-22 on the MacBook). The library carries the dependency now,
so every program that links it gets it too.
Measured: after the change lib/libDtChat/libDtChat.la lists
/usr/pkg/lib/libiconv.la in dependency_libs; make -C programs/dtchat rc=0,
0 errors (dtchat-build3.log).
dtphoto read only BMP and ICO and wrote only BMP; PNG, JPEG and GIF were
listed as open in docs/MCDE-PROGRAMS.md since 2026-11-12. The reader was
already there: McdeThumbRead in libDtSvc has all five formats, is X-free and
is what dtfile uses for its miniatures. dtphoto calls it for everything its
own reader does not know, so the program carries no second decoder.
There was no picture writer anywhere in the tree, so McdeThumbWrite now sits
next to the reader: PNG through libpng's simplified API, BMP in C99, the
ending decides, an unknown ending is refused instead of silently becoming a
BMP.
Measured on Xvfb depth 24 (2026-11-22):
- 40x30 PNG -> PNG, 1200 of 1200 pixels identical, CRC checked.
- 40x30 GIF -> PNG, 0 of 1200 pixels different.
- 40x30 JPEG q100 -> PNG, at most 3 steps per channel (compression, not the
reader); the same picture written from libpng is 0 steps.
- Depth 8: a 32-colour picture comes back 0 of 256 pixels different; a
1200-colour ramp differs by mean 28.6/255, which is the colormap -- the
same ramp is 0 on depth 24.
test_thumb writes a 13x7 ramp (every pixel unique) as PNG and BMP and reads
it back pixel for pixel. Proved the test bites: writing the BMP rows
top-down turns it red at 78 of 91 pixels, PNG_FORMAT_BGR at 91 of 91. The
unknown-ending and zero-size cases are checked too.
dtphoto: the file dialog filters on every format it reads, not on *.bmp.
All 18 dtphoto test modes stay green on depth 24 and depth 8, test_thumb ok.
McdeSys gains mcde_sys_print_file(path, printer): it looks for lp(1)
(/usr/bin, /usr/local/bin, /usr/sbin, pkg prefix; MCDE_PRINT_COMMAND
overrides it for tests), passes -d PRINTER when one is named, and runs it
as the existing job (fd into the event loop, finish/cancel). dtpaint links
libMcdeSys, adds File > Print... (Ctrl+P): it picks the default queue from
mcde_sys_printers (or the first), writes the image to /tmp/dtpaint-PID.bmp,
starts the job and removes the file when the job ends; errors and 'no
printer is set up' go to the information dialog. Measured under Xvfb with
MCDE_PRINT_COMMAND=fake lp: argv '-d HP_LaserJet_M110w_CC1016
/tmp/dtpaint-3543226.bmp', the fake copied a valid 640x480 BMP and the
temporary file was gone; no physical page was printed (the real queue is
the user's step).
- dtsystemsettings: the shell is 1022x550 and stays so (min/max equal); every
pane lives in it instead of growing the window (thirteen per-pane
XtVaSetValues(shell, width, height) calls are gone), and a taller pane
scrolls (the pages sit in an XmScrolledWindow with XmAUTOMATIC).
- panes.c: CDs & DVDs had no icon (Dtmedia.m.pm does not exist) - it shows
IrixCD.m.pm; Energy Saver shows SDtpowermgr.m.pm; Accounts had the same icon
as Startup (DtStart.pm) and shows McdeUser.t.pm. The "Startup Disk" entry
and the disabled "Dock" entry (no icon, PANE_LATER) are removed.
- McdePrefs: the tab strip is one of many (XmNradioBehavior,
XmNradioAlwaysOne). Without it every visited tab stayed pressed
(measured 2026-11-21: Keyboard, Mouse and Shortcuts all down at once).
- dttoolbox: the window title is "dttoolchest" (msg 1 of the catalog).
- McdeSys: mcde_sys_keyboard_is_mac asks the machine (hw.model "Mac...")
before usbdevs. At session start the internal keyboard may not be
enumerated yet, so dtkeys took a MacBook for a PC keyboard and exchanged
Alt and Command (_MCDE_KEYS said "pc", measured 2026-11-21).
- dtsystemsettings: the shell is 1022x550 and stays so (min/max equal); every
pane lives in it instead of growing the window (thirteen per-pane
XtVaSetValues(shell, width, height) calls are gone), and a taller pane
scrolls (the pages sit in an XmScrolledWindow with XmAUTOMATIC).
- panes.c: CDs & DVDs had no icon (Dtmedia.m.pm does not exist) - it shows
IrixCD.m.pm; Energy Saver shows SDtpowermgr.m.pm; Accounts had the same icon
as Startup (DtStart.pm) and shows McdeUser.t.pm. The "Startup Disk" entry
and the disabled "Dock" entry (no icon, PANE_LATER) are removed.
- McdePrefs: the tab strip is one of many (XmNradioBehavior,
XmNradioAlwaysOne). Without it every visited tab stayed pressed
(measured 2026-11-21: Keyboard, Mouse and Shortcuts all down at once).
- dttoolbox: the window title is "dttoolchest" (msg 1 of the catalog).
- McdeSys: mcde_sys_keyboard_is_mac asks the machine (hw.model "Mac...")
before usbdevs. At session start the internal keyboard may not be
enumerated yet, so dtkeys took a MacBook for a PC keyboard and exchanged
Alt and Command (_MCDE_KEYS said "pc", measured 2026-11-21).
Measured on the MacBook: keyboard _MCDE_KEYS "pc" with an Apple Internal
Keyboard / Trackpad on usb1 port 2 addr 7.
build/logs/userland-2026-11-17f.log:22437: the 25 test programs of
libDtChat, dtchat-demo and McdeSys's test_audio/test_netwatch were
noinst_PROGRAMS, so the package build compiled them for NetBSD and
tools/check-buildtools.sh took them for build tools. configure.ac has
MCDE_CROSS now; in a cross build they are check_PROGRAMS (dtchat-demo
EXTRA_PROGRAMS), in a native one noinst as before, so tools/mcde-tests.sh
still finds them in build/mcde-host. autoreconf -fi of the tree: exit 0,
the Makefile.in lines are @MCDE_CROSS_TRUE@check_PROGRAMS /
@MCDE_CROSS_FALSE@noinst_PROGRAMS.
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).
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.
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.
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.
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.
Video frames are timestamped by wall clock now, so test_video_packet can no longer make the old frame-count timestamps by sending quickly. dc_call_send_video_at() takes the timestamp as an argument (dc_call_send_video passes the elapsed time since the call began), and the test sends 0/66/132 ms after 200 ms of decoded audio: the first two are dropped, the third renders with offset -68 ms and two drops. Standalone and in-tree (43 ok/0 bad) green.
configure AC_DEFINEs HAVE_V4L2 into include/cde_config.h; media_capture.c did not include it, so an in-tree build would have compiled the test pattern only. The file now includes <cde_config.h> under HAVE_CONFIG_H, which the automake build defines and the standalone test compile does not (it passes -DHAVE_V4L2 itself).
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.
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.
SvcPam.c: a fresh PAM handle per authenticate, pam_end on failure, the PAM_USER
check was inverted, the conv default case did not advance, failures go to
authlog (follows xsrc/external/mit/xdm greeter/greet.c).
pkgsrc/Makefile: ac_cv_path_XRDB=${X11BASE}/bin/xrdb - the cross build baked the
Linux host's /usr/bin/xrdb into dtlogin; /var/dt/Xerrors on an installed system
said 'sh: /usr/bin/xrdb: not found', so Xresources never loaded and the CDE logo
showed (measured in a VM 2026-11-17).
tradcpp/config.h: CONFIG_OS is the ident as given; the stringify macro turned the
quoted -DCONFIG_OS_IDENT into an invalid macro name and wm/mcde stopped in
lib/tt (tradcpp: Invalid macro name "__NetBSD__", build/logs/userland-2026-11-16-atomic.log)
so the sysroot kept the Nov 15 MCDE. t0436 t0438 t0217
ui_call.c: a Motif window for one call with a 480x270 video area, status line, Push to talk (a toggle wired to dc_call_send_ptt), Hang up (dc_call_hangup + owner callback) and Close. The newest I420 frame is scaled bilinearly to an aspect-preserving rectangle, converted with dc_i420_to_xrgb, composed into one 0x00RRGGBB buffer (black bars around it) and blitted with one XPutImage on expose or a new frame; no per-plane drawing. dc_call_new_bound() binds the UDP socket to the announced port, so a peer's service port serves TLS and media. --call-demo opens the window with a synthetic gradient frame; --smoke-test creates the window, sets a frame and checks it is there. Standalone build: smoke PASS, screenshot build/mcde-shots/dtchat-t76.png (video, status, Push to talk/Hang up/Close). A live call still needs the media-key exchange in the local text protocol (next: T6.5); camera capture is T7.1.
media_sync.c: audio is the clock (20 ms per decoded frame); a video frame whose timestamp is more than DC_SYNC_LATE_MS (80 ms) behind it is dropped, anything else is rendered and its video-audio offset recorded. media_call.c advances the clock on every decoded audio frame, timestamps video at 1000/15 ms per frame, drops late frames in dc_call_video_out (-1) and counts them; the reassembler now carries the media packet's timestamp with the frame. test_media_sync: on-time, 20 ms late, exactly 80 ms (rendered), 81 ms (dropped), early, a one-minute call and NULL arguments. test_video_packet gains a call-level sequence: 200 ms of decoded audio, then four video frames at 0/66/132/198 ms; the first two are dropped, the third renders with offset -68 ms and the dropped counter is 2. Standalone and ASan/UBSan clean. In-tree build pending: the next make mcde-host carries it and the harness reaches 41 entries.
media_render.c: dc_i420_scale resizes Y/U/V bilinearly (chroma at half size), so a 640x360 call fits a tile or a full-screen window; dc_i420_to_xrgb converts to 0x00RRGGBB for an XImage with the BT.601 limited-range matrix (Y 16..235, Cb/Cr 16..240) and an optional pixel stride. test_video_render: white/black/red solids, 1:1 identity, 2x up then down with PSNR > 28 dB, corners of the upscale, odd sizes with rounded chroma and stride padding untouched; standalone and ASan/UBSan clean. In-tree build pending: the next make mcde-host carries it.
media_video_packet.c: a frame travels in 1200-byte DC_MEDIA_VIDEO packets with an 8-byte header (start/end/keyframe flags, reserved, frame id, fragment index and count, big-endian) and 1192 data bytes. The reassembler keeps one frame, accepts fragments out of order, ignores duplicates, bounds the frame at 256 KiB and refuses a fragment count that cannot fit, drops an incomplete frame when the next frame id starts and then asks for a keyframe. media_call.c gains dc_call_send_video (fragments + seals while in a call), dc_call_video_out and dc_call_wants_keyframe; drained VIDEO packets feed the reassembler. test_video_packet: 50 KB in 42 fragments in order and reversed with a duplicate, missing fragment -> no frame then wants_keyframe on the next id, bad/oversize fragments refused, and a loopback call where an 11-frame sequence (50 KB each) crosses sealed UDP and reassembles byte-identical in 0.6 ms per frame; standalone and ASan/UBSan clean. In-tree build still pending: make mcde-host was running when this landed.
The plan asks for VP8 640x360 at 15 fps, 500 kbit/s and a keyframe every two seconds; the wrapper now does that (kf_max_dist = 2*fps) and the test prints the measurement: 30 frames in 175.7 ms encode+decode (5.86 ms/frame), 89 KB for 2 s (about 356 kbit/s on the synthetic scene), decoded PSNR > 20 dB. Standalone and ASan/UBSan clean. T7.1 in the task list is video capture (V4L2/uvideo), which is still open; this is the codec part.
Motif 2.3 has wheel translations for XmText and XmList (in MCDE's Motif),
but a custom drawing area in an XmScrolledWindow has none, and buttons 6/7
(a tilt wheel or a touchpad's horizontal scroll) are not even an event type
Xt's translation table knows. DtInitialize now installs
lib/DtSvc/DtUtil2/McdeWheel.c for every CDE program: it hooks the
ButtonPress/ButtonRelease wire conversion (XESetWireToEvent), looks up the
widget under the pointer, scrolls it by three increments in the event loop
(a 0 ms timeout -- the wire conversion must not run scrollbar callbacks, the
first horizontal bar change deadlocked there, measured), and turns the wheel
event into a NoExpose so no widget sees it twice.
- nearest XmScrolledWindow: its vertical/horizontal scrollbar, value moved
and clamped to maximum - sliderSize (XmScrollBar refuses more; measured
warning), XmScrollBarSetValues(notify) -- custom panes, lists, containers
follow their bar;
- XmText: its topCharacter moved by three lines (the scrolled window's bar
does not move a text's view), so dtpad/DtEditor and every text pane scroll;
- a scrollbar under the pointer is moved itself;
- 4 up, 5 down, 6 left, 7 right, Shift+4/5 horizontal too.
Measured on an out-of-tree copy of the configured build (the tree's build
lock was held by another session's release and host runs): the library
builds, and under Xvfb a scrolled XmText with 200 lines
- three times button 4: "text scroll text -3" three times, the view moved
(screenshot: lines 167.. -> 165..);
- nine times button 7: "scroll HorScrollBar 0 -> 3 ... 26", the horizontal
bar moved and stopped at its end without the previous warning or hang;
- buttons 4/5 kept working after the horizontal scroll (before the deferral
the client froze after the first horizontal bar change).
Known limit: XmText's horizontal view does not follow the scrolled window's
horizontal bar (Motif has no public horizontal text scroll); vertical text
and horizontal panes with a real scrollbar work. MCDE_WHEEL_DEBUG=1 prints
the widget, the bars and the values.
The official make mcde-linux and the install into /usr/mdt follow when the
build lock is free; the same configured tree was used for the isolated build.
media_video.c wraps libvpx: VP8, I420, realtime deadline, CBR, error resilience, one keyframe per second, 320x240 at 15 fps and 300 kbit/s by default; dc_vpx_enc_frame returns the packet (0: none, -1: error, too small a buffer refused), dc_vpx_dec_frame copies Y/U/V into the caller's I420 buffer and drops damaged packets (0) or refuses a size that does not match (-1). configure checks vpx/vpx_encoder.h and libvpx as an optional build dependency (HAVE_VPX, VPXLIB); without it the functions answer 'no libvpx' and the test skips. test_video_vp8: 30 frames of a moving square on a gradient, encode/decode round trip, decoded PSNR > 20 dB on the last frame, corrupted packet and plain garbage without a crash, small output buffer and odd dimensions refused; standalone and ASan/UBSan clean with libvpx 1.17.0, and 'no libvpx, skipped' in the stub build. In-tree build pending: make mcde-host was already running when this landed, so the next build carries it.
The call now has IDLE, RINGING, IN_CALL and ENDED with dc_call_ring/accept/hangup/tick: RING and ACCEPT cross the wire as sealed control packets, an incoming RING during a call is answered BUSY, an unanswered ring ends after 30 s (dc_call_tick), and audio/PTT are refused outside IN_CALL. An authenticated packet also updates the peer address, so an incoming call is answered on the address it came from (no manual peer needed). test_media_call: audio refused before answer, ring seen on the other side, accept on both, PTT and ten audio frames in the call, hangup ending both sides and stopping audio; standalone and ASan/UBSan clean. Also widened the media packet type range to DC_MEDIA_HANGUP (the PTT fix was incomplete). In-tree build pending: make mcde-linux MCDE_DIRS=install is still running.
The type check in dc_media_seal/open still ended at DC_MEDIA_BYE, so a DC_MEDIA_PTT packet was refused; both now accept it up to DC_MEDIA_PTT. test_media_packet and test_media_call pass.
McdeSys.h: mcde_sys_net_announce()/poll/ready/stop and mcde_sys_net_watch()/poll/next/close with McdeSysService (name, type, host, TXT, port, gone). mdns_avahi.c uses avahi-client with an own AvahiSimplePoll per handle (no thread; the poll call runs one iteration), publishes an entry group while the daemon runs, frees it for the goodbye, browses and resolves NEW services, queues REMOVE, and survives a missing daemon (AVAHI_CLIENT_NO_FAIL, CONNECTING). mdns_netbsd.c does the same with libdns_sd (DNSServiceRegister with a TXTRecordRef, DNSServiceBrowse, DNSServiceResolve per NEW service, poll on DNSServiceRefSockFD then DNSServiceProcessResult); it compiles against the sysroot with -ldns_sd and has not run on NetBSD. mdns_stub.c answers ENOTSUP when the build has no client. configure checks avahi-client/avahi-common on non-NetBSD with AM_CONDITIONAL MCDE_AVAHI. test_netwatch announces _mcde-test._tcp on 4711 with a TXT record, sees it through its own watch (name, TXT, port, address) and stops the announce; against the running avahi-daemon it reports 'announced and seen' and 'goodbye seen', all ok. test_netwatch is a noinst program and a harness entry. In-tree build pending: a foreign release chain holds the lock (pid 141722).
media_call.c: one UDP socket per call (bound, non-blocking, pollable through dc_call_fd), the two direction keys of T6.3, Opus 48 kHz mono and a jitter buffer. dc_call_drain authenticates every datagram and only then puts it into the buffer; dc_call_audio_out decodes one frame (a lost one becomes PLC), dc_call_audio_in encodes and sends one 20 ms frame, dc_call_send_ptt tells the peer about the key (DC_MEDIA_PTT). The jitter buffer starts after DEPTH frames (3 = 60 ms), reorders, drops duplicates and late frames, turns a proved gap into one frame of length 0 and is bounded by 32 slots. test_media_call: jitter below depth/reorder, loss -> concealment, duplicates/late/oversize, depth clamping, and a real loopback UDP run between two calls (PTT on/off seen, ten frames decoded in order with RMS > 1000, a damaged datagram dropped); standalone and ASan/UBSan clean. In-tree build pending: a foreign release chain holds the lock (pid 141722).
media_packet.c: X25519 key pairs, HKDF-SHA256 over the shared secret with the sorted public keys as salt gives two 32-byte direction keys (the responder mirrors send/recv); ChaCha20-Poly1305 seals the payload with a 12-byte header (version, type, flags, reserved, 32-bit sequence, 32-bit timestamp) as additional data, the nonce is the 64-bit sequence after four zero bytes (fresh keys per session), 16-byte tag, payload at most 1200 bytes. dc_media_replay_ok is the 64-packet RFC 3711 window and is only advanced after the tag verified, so a forged packet cannot move it. test_media_packet: key agreement mirrors, roundtrip with payload and empty payload, changed header/payload/tag/truncation/wrong key refused, out-of-order delivery inside the window accepted once, replays and packets 64 behind refused, window slide, size/type limits and 1000 random payloads round-tripping; standalone and ASan/UBSan clean. In-tree build pending: a foreign release chain holds the lock (pid 141722).
McdeSys.h gains mcde_sys_pcm_open/wait/read/write/close/backend: signed 16-bit interleaved frames, one direction per handle, non-blocking (0 = would block). audio_linux.c drives ALSA (S16_LE, the wanted rate, 20 ms periods, four periods of buffer, EAGAIN -> 0, xrun recovery, snd_pcm_wait); it compiles to ENOTSUP without HAVE_ALSA so the desktop still builds. audio_netbsd.c sets audio(4) (/dev/audio or /dev/sound) to SLINEAR_LE 16 bit with AUDIO_SETINFO and verifies with AUDIO_GETINFO, then polls the descriptor; it compiles against the NetBSD sysroot (-D_NETBSD_SOURCE for u_int, play/record sub-structs) but has not run on NetBSD. audio_null.c is silence in/discard out. configure checks alsa/asoundlib.h+libasound on non-NetBSD (optional, with a warning) and passes ALSA_CPPFLAGS/ALSALIB. test_audio checks the null stream frame by frame (both directions, wrong-direction errors, bad arguments) and tries the real playback/capture device, skipping without a card: standalone and ASan/UBSan pass, and the container's ALSA device played and captured 5 periods each. test_audio is a noinst program and a harness entry. All four files compile with x86_64--netbsd-gcc against destdir.amd64.
media_audio.c wraps libopus for 48 kHz mono, 20 ms frames (960 samples), 24 kbit/s, in-band FEC and a 10 percent loss hint; dc_opus_dec_frame with len 0 conceals a lost frame. configure requires libopus (OPUSLIB). test_audio_opus encodes/decodes 2 s of a 440 Hz sine, checks the frame size, a decoded RMS above half the input, a 3-12 KB budget for 24 kbit/s and a non-silent PLC frame after a loss; standalone and ASan/UBSan clean. libopus 1.6.1 was installed on the build host together with libstrophe, avahi-client and libvpx, so T4/T5.2/T6/T7 are no longer missing libraries. In-tree build pending: a foreign release chain holds the lock (pid 141722).
i18n.c opens catopen("dtchat", NL_CAT_LOCALE) and dc_text(id, fallback) reads set 1; the program calls dc_i18n_init after setlocale. The visible labels of the main window, the account editor, the request/peer/file/pair dialogs and the local status texts use ui_text.h ids; dtchat.msg (English) has 75 entries and programs/localized/de_DE.UTF-8/msg/dtchat.msg the German copy (ASCII transliteration, core font). test_i18n builds both catalogs with gencat and checks File/Datei, Send/Senden and the fallback; the German run under Xvfb shows Datei/Bearbeiten/Ansicht/Konversation/Hilfe, In der Naehe and Senden (screenshot build/mcde-shots/dtchat-t104-de.png) and the smoke stays green. Dynamic formatted statuses are partly still English. The in-tree build is pending: a foreign release chain holds the lock (pid 141722).
Security review findings: (1) the local peer identity was only a claimed pin; the listener now requests the client certificate and compares the certificate hash that completed the handshake with the pin in hello, refusing a mismatch or a missing certificate, and the client presents its identity certificate (test_local uses real identities: matching, other identity, any). (2) unpaired peers could send file offers; the UI manager carries a paired flag, answers offers from unpaired peers with file-reject 'pairing required' and refuses to send. The review document lists both fixes and the accepted limits (no passphrase, public pins, media nonces later, adapter spawn, file names, QR, parser limits). Standalone: test_local, test_filexfer, tests/p2p.sh and the UI pairing/message run pass with the changes. The in-tree build is pending because another release chain holds the lock (pid 4040149).
fuzz.c is a deterministic harness: 1,000,000 iterations of random bytes, mutations of valid seeds, generated JSON (valid and broken) and IRC lines (long trailing, NULs, extra params). A parsed document is written and parsed again; an IRC result must have a command and at most 15 parameters; the splitter must finish. The input of iteration I depends only on the seed and I, so a crash reproduces with 'test_fuzz 1 SEED I'. Standalone: 1,000,000 iterations in 6.3 s; ASan/UBSan 1,000,000 clean (the only finding was the harness's own overlapping memcpy, fixed). Built test_fuzz 1M ok; make mcde-host exit=0; tools/mcde-tests.sh 31 ok/0 bad.
pair.c derives the 6-digit SAS from both certificate pins (sorted, SHA-256, mod 1000000) so both sides compute the same code; peers.json keeps id -> pin and the blocked flag (0600, atomic store). dc_pins_check answers 1 for a known pin, 0 for an unknown id and -1 for a changed pin; only dc_pins_confirm stores a new pin after the person compared the SAS; a changed pin stays blocked until then. test_pair: known SAS answers (448183 for A+B, 500498 for A+A), order independence, malformed pins, empty store, confirm/check, changed pin, block persistence, save/reload. Standalone and ASan/UBSan clean. make mcde-host still blocked by pid 2126511.
dtchat-headless starts the TLS listener (--listen [HOST:]PORT, port 0 prints the real port) and one reconnecting link per --peer, loads/creates the identity in --config, prints JSON events (ready, peer-online, peer-offline, message, typing, file-offer, error) and takes JSON commands on stdin (send by host:port or peer id, quit). dc_local_peer_conn() and the ack id let a link know its peer. tests/p2p.sh runs two instances over loopback: A listens, B connects, B sends, A answers by id, both quit; standalone run prints 'tests/p2p.sh: all ok'. Wired into noinst_PROGRAMS and mcde-tests.sh (expect 29 ok). make mcde-host still blocked by pid 2126511 (release/sourcesets/usb).
filexfer.c offers name/size/sha256, sends 64 KiB chunks as base64 file-data lines and a file-end; the receiver writes NAME.part, enforces the 512 MiB limit, checks size and SHA-256 and renames to a sanitized name without overwriting. Cancel removes the part. Names take the basename, drop dot-dot and control characters. The local connection buffers grow to 128 KiB for one chunk per line; dc_local_conn_busy() lets the sender pace itself. test_filexfer: safe names, 1 MiB+12345 transfer with 64 KiB chunks and matching hash, oversized offer refused, cancel leaves no part file; standalone and ASan/UBSan clean; test_local still green. make mcde-host still blocked by the foreign release/sourcesets/usb chain (pid 2126511).
local.c now has the client side of the peer protocol: dc_local_connect verifies that the server's hello-ack pin is the pin of the certificate it actually saw (and against the expected pin), sends our hello after the handshake, and has a 5 s hello-ack timeout. Ready connections exchange presence, msg, msg-ack and typing as JSON lines; the server and client dispatch input line by line from a shifted buffer. dc_local_peer_* wraps a client with 2, 4, 8 ... 60 s reconnect and online/offline callbacks. configure now requires libtls (the ADR does). test_local covers the three T5.4 pin cases, a full protocol round trip (msg -> ack, typing, presence) and a reconnect after the server restarts; standalone and ASan/UBSan clean. make mcde-host is still blocked by the foreign release chain (pid 2126511).
local.c binds a nonblocking TLS listener (identity certificate, 127.0.0.1 or all interfaces, port 0 = ephemeral) and drives the handshake from DcLoop. A peer sends one JSON line {type:hello,id,pin}; the listener checks id and pin against what it expects, answers {type:hello-ack,ok:true|false,pin:...} and closes on a wrong pin, a lying or malformed hello. The accepted hello goes to the callback once; connections stay open for the protocol of T5.5. identity.c now also exposes the private key as PEM for libtls. test_local starts a listener per case and connects with a blocking libtls client: matching pin accepted (callback sees id/pin), wrong pin rejected (no callback, ok:false), any-pin accepted. Standalone test all ok; make mcde-host could not run because another agent's release+sourcesets+usb chain holds build/.build.lock (pid 2126511); the next build verifies the wiring.
peers.c keeps one peer per identity id: the TXT record (v/id/name/pin/port, ';'-joined) merges by id and marks the peer online; a service that disappears is marked offline, a manual peer stays; blocking is a property that survives announcements. Strings are owned by the peer. test_peers covers announce/merge, port preference, offline per peer, block survival, manual peers and malformed records; built test all ok, make mcde-host exit=0, tools/mcde-tests.sh 26 ok/0 bad.
identity.c generates an Ed25519 key, a self-signed X.509 certificate (CN dtchat, ten years) and its SHA-256 pin; identity.json holds version/algo/public/private/cert/pin and is written atomically through the store (dir 0700, file 0600). Load verifies that the pin, the raw public key and the certificate match; a corrupt file is moved to .bad and load_or_create fails instead of replacing the identity. configure requires libcrypto and passes CRYPTOLIB. test_identity covers creation, modes, restart persistence, a second identity, and the corrupt-file path; the built test passes and tools/mcde-tests.sh is 25 ok/0 bad after make mcde-host exit=0.
Incoming PRIVMSG/NOTICE become text/notice messages, CTCP ACTION becomes an action message and direct messages open a direct conversation. dc_irc_split_next() splits at UTF-8 boundaries, prefers spaces and always breaks at newlines; the adapter budgets 512 bytes per PRIVMSG line. Sends go through a 128-line queue with a 4-message burst and 2 messages/s, pumped from the poll timeout. test_irc covers the splitter (ASCII, multibyte, over-wide character, newlines, empty); the fake-server test passes 19/19 with three chunks rejoining exactly, every line <= 512 bytes and a 0.50s max gap under flood. make mcde-host still blocked by pid 1207058.
lib/libDtChat/irc.c parses IRCv3 tags, the prefix, the command, up to 15 parameters and the trailing text into a DcIrcMessage; NUL in the line, a missing command, more than 15 parameters and lines over 1 MiB are clean errors. test_irc covers PRIVMSG, tags+prefix, 001/005/353, PING, MODE, CAP, an empty trailing, repeated spaces, the error cases and 1 MiB of rubbish; all ok and ASan/UBSan clean. The IRC adapter now routes PING/001/ERROR/433 through the parser; the fake-server harness still passes 13/13. Added test_irc to tools/mcde-tests.sh. make mcde-host still held by another agent's sourcesets/usb build (pid 1207058).
ui_accounts.c builds the account list and a settings form from the adapter schema: text, secret, int, bool, choice, info and button. Secrets are collected into a separate JSON object and never shown; a modifyVerify callback keeps the masked text while the field stores the real value (this Motif has no XmNechoChar). Add/Delete create or remove accounts through dc_model_remove_account, Save validates required fields and numbers and updates the account label. Wired to File/Accounts... with a demo IRC schema. Standalone build clean; dialog opens on Xvfb, password masked, Save shows 'saved (demo)'; test_conv and ASan/UBSan green. make mcde-host could not run: another agent's release build holds build/.build.lock (pid 175328).
DcPresence on DcConv (offline default, online/away/dnd); the roster lists accounts and conversations with presence marks and unread counts, 45 demo rooms make it scroll, selection sets the title/topic, fills the transcript from the 2000-message ring and clears unread. The demo model lives in main.c; --smoke-test selects jabber/bob@example.org and checks viewable, selection, transcript and unread==0. make mcde-host exit=0; built smoke PASS; test_conv all ok; screenshot build/mcde-shots/dtchat-t22.png; PSS 5.6 MB.
instance.c: DIR/run 0700, dtchat.lock 0600 with flock(LOCK_EX|LOCK_NB), primary Unix listener at dtchat.sock 0600, one open request per client with a 2 s timeout, non-primary instance plus dc_instance_notify with connect retries, and socket/lock cleanup on close. test_instance covers primary/secondary, modes, open callback, malformed client, notify after close and re-acquisition. make mcde-host exit=0; all eight dtchat tests 'all ok'; ASan/UBSan clean. SIGPIPE is ignored so a dead local client cannot kill the core.
adapter.c spawns a helper, waits for hello (ipc 1), sends configure/connect, routes events, drains stderr, buffers stdin, reaps zombies and restarts with 2..60 s backoff unless the child said bye. fake_adapter.c and test_adapter.c cover normal handshake, send/message echo, join/answer, stop/bye, crash restart and invalid JSON. make mcde-host exit=0; test_adapter 'all ok'; ASan/UBSan clean. test_adapter_DEPENDENCIES now includes libDtChat/libDtChatIpc to avoid the parallel relink race.