Commit Graph
291 Commits
Author SHA1 Message Date
lotherk 93aa5bacf2 MCDE: make debian / debian-install -- the desktop as one Debian package
Konrad, 2026-11-22: "i want mcde to support 'make debian' and it'll fully
create and download all required build dependencies and shit and make debian
debian-install would make the deb and all and then even install" and
"inkluding our own motif stuff xyz".

tools/mcde-debian.sh does the three steps in one lock:

  build    installs the build dependencies through apt-get (the ones
           configure.ac stops on and each -dev the tree compiles against),
           builds MCDE from a copy of ext/src/mcde with the path step of
           tools/mcde-host.sh, installs into build/mcde-debian-stage, strips,
           and packs build/mcde-debian/mcde_<version>_<arch>.deb
  install  installs that package
  clean    removes both directories

The package carries its own Motif: libXm, libMrm, libUil, the uil compiler
and the headers live in /usr/mdt, so the desktop runs from its own toolkit
and never from the system's libxm4 (--with-private-motif, as Konrad asked).

Four things cost a run each and are written where they bit:

- dpkg-shlibdeps matches a shlibs line on the SONAME version (libXm.so.4 ->
  4), not on the file version (4.0.4).  With 4.0.4 it ignored the line, found
  the system's libxm4 and put it in Depends.
- -L is the override file dpkg-shlibdeps READS; -T is where it writes the
  substvars it produced.  The first version passed -T and got nothing.
- -x$PKG, or the package depends on itself (every binary links /usr/mdt/lib).
- The version carries the commit, so a rebuild leaves a second .deb beside
  the first and `dpkg -i *.deb' installs both -- the older wins.  One package,
  one file: the old one goes.

debian-mcde/ holds what the package manager cannot do for the desktop: the
control paragraph, a postinst that indexes the fonts MCDE carries under
/usr/mdt/fonts for the X server, and the session entry (Type=XSession,
/usr/share/xsessions/mcde.desktop) -- without it a display manager lists the
host's desktops and not MCDE.

Verified on this host (2026-11-22):
  bmake debian from an empty build/mcde-debian exit=0,
    build/mcde-debian/mcde_0.1.0+git420f66c19e_amd64.deb (42M, 180280 KiB
    installed, 4583 files)
  Depends is free of libxm4/libuil4/libmrm4 and free of mcde itself
  the package carries usr/mdt/lib/libXm.so.4.0.4, libMrm, libUil and the
    uil compiler; /etc/pam.d/dtlogin and dtsession are conffiles
  dpkg -i installs it, postinst runs
  ldd /usr/mdt/bin/dtwm -> /usr/mdt/lib/libXm.so.4 (its own)
  on a private Xvfb: dtsession, dtwm, dtlaunch, dtpad, dtfile and the
    front panel (Applications/Files/Desktop/System/Network) run, no errors
  bmake debian-install exit=0, "mcde 0.1.0+git420f66c19e install ok
    installed", 0 upgraded / 0 newly installed

AGENTS.md and docs/BUILD-CONTRACT.md list mcde-debian.sh among the tools that
need the build lock, next to mcde-host.sh.

t0768
2026-11-22 17:35:17 +00:00
lotherk 420f66c19e docs: dtphoto PSD reader and writer recorded
The PSD paragraphs still said TIFF and PSD were open and that saving
wrote anything unknown as BMP.  PSD has been read and written for a while
now, so the two places that said otherwise are corrected.

The RLE layout is the part worth remembering: Photoshop writes all the row
lengths first, then the rows.  The first version interleaved them and the
program's own reader interleaved them the same way, so the round trip was
green while the file was wrong.  ImageMagick said InvalidLength; after both
sides changed it reads the composite and the layer at the pixels the test
wrote.

Measured 2026-11-22: 13 headless tests x 2 depths (24 and 8) green, a 64x64
picture with one hard edge 2436 bytes packed against 12530 raw, and
`-psdread` reads a 16x12 file ImageMagick wrote.

Tested: menutest optest selmodtest retouchtest movetest croptest typetest
cliptest viewtest drawtest layertest psdtest rletest on :91 (depth 24) and
:98 (depth 8) -- 26 of 26 PASS.
2026-11-22 17:23:49 +00:00
lotherk eb35bf6aac MCDE dtphoto: the clipboard carries the selection's shape, and Cut
stays inside it

Three faults in Edit, all measured against pixels:

- Copy took the bounding rectangle of the selection, so Paste brought
  back what a lasso had excluded.  The clipboard is now RGB plus one
  coverage byte per pixel (PasteBlend/SelectFromCover), not a pixmap,
  which also blends a feathered edge and keeps both depths identical.
- Cut was MaskClear plus a full XFillRectangle: cutting a lasso wiped
  the whole picture.  It is now Copy followed by PaintMask, which is
  mask-aware.
- Paste Into called PasteFromClip() with no limit and was a second
  Paste; it now clips to the selection's coverage.

And one fault at the root: MaskFromRect() called MaskClear(), which
drops hasSel, after every caller had set hasSel = 1 -- so the marquee
produced a mask nothing believed in.  Copy fell back to the whole
picture, Clear/Fill/Crop ignored the rectangle.  MaskFromRect claims
the selection itself now, and no caller has to remember.

Evidence:
  -cliptest  PASS on depth 24 and depth 8: lasso hole kept through
             Copy/Paste, cut-left/cut-right outside the band intact,
             paste-into limited to the selection, soft paste blends,
             a whole-picture clip stays opaque.
  full run   24 green, 0 red (12 modes x 2 depths)
  mouse      dragged 60x60 box -> "dtphoto: copied 60x60";
             Select > None, same Copy -> "dtphoto: copied 1024x768";
             Edit > Cut -> "copied 60x60" then "cut";
             Edit > Paste Into -> "pasted 60x60 into the selection"
2026-11-22 16:22:34 +00:00
lotherk 02aa4ce6d4 MCDE dtphoto: the layer stack is real -- coverage, a palette, options
A new layer used to be a white sheet that hid the picture: layers carried
RGB only, so nothing could say "this pixel is empty".  LayerAbsorb made it
worse by copying the whole composite into the active layer, so the layer
below appeared twice.

- Layer carries coverage (0..255 per pixel) beside RGB; the background has
  none (it covers everything), a new layer starts with an empty one, and
  WritePatch sets the coverage of the layer being painted, so a stroke is
  opaque while the rest of the layer stays clear.
- LayerAbsorb takes only the covered pixels of a layer that has coverage;
  the background still takes the whole picture.
- The Layers palette is a list, not a label: one row per layer, top of the
  stack first, an eye to hide it, the name to make it active.  Rows are
  rebuilt where the stack changes (new/duplicate/delete/merge), never from
  inside a row's own callback.
- Layer Options sets opacity and blend mode through FieldDialog, and does
  not absorb first: a property is not new pixels, and reading the composite
  back baked the old blend in (50% gave 127,0,0; multiply over white went
  black).
- New -layertest drives the real CanvasInput -- stack first, then the
  stroke, the order that matters, because LayerEnsure after the stroke
  would read the pixmap back and hide the fault.

Verified: 26/26 green (13 modes on depth 24 and depth 8), 206 menu paths
bound, 0 unbound, 0 doubled; build without warnings.
2026-11-22 15:54:56 +00:00
lotherk f7716b640d MCDE dtphoto: every menu entry does something, and the test proves it
-menutest read only the command table against itself, so a menu line with
no command stayed invisible: it could be green while an entry did nothing.
It now reads dtphoto.menu and counts what resolves to no command -- 206
items, 0 unbound.  Counter-check: Select/Grow set to CMD_NONE makes it
print "1 unbound" and FAIL.

Four entries only refused before and now work: Window > Show Commands
opens a palette listing the command table itself (206 rows, measured
206x26 px of text in the widget, so it cannot drift from the menu),
Publisher Options sets the EPS resolution (72 and 288 dpi, the
%%BoundingBox scales with it), Adjustment Options the default for new
adjustment layers, and Show Channels/Show Paths show measurements from the
picture and the lasso path.  File > Acquire still refuses: there is no
scan source, and saying so beats a button that does nothing.

Real bug found on the way: Layer > Type > Horizontal/Vertical switched to
tool 7, which is crop; type is slot 8.

Measured on both depths (TrueColor :91, PseudoColor :98): 14 tests x 2 =
28 green, 0 red -- filtertest optest drawtest seltest movetest croftest
croptest typetest retouchtest selecttest selmodtest menutest exporttest
placetest printtest (the last with MCDE_PRINT_COMMAND=/tmp/dtpbin/lp,
230454 bytes spooled).
2026-11-22 15:26:45 +00:00
lotherk 3e3817a83d MCDE dtphoto: the colour-model and layer entries under test, affine centre fixed
-filtertest now also covers the six entry points that sat outside every
test: CMYK Preview (must not flatten the picture to one colour), Gamut
Warning (saturated ink -> warning grey 128, printable pixel untouched),
the 5x5 Custom identity kernel, Perspective (0% identity, 50% reads the
top-left from inside the picture), a 90 degree Affine rotation as a
permutation, and Drop Shadow leaving the picture's own pixels alone.

That permutation check found a real bug: OpAffine mapped around w/2
instead of (w-1)/2, so a 90 degree turn of a 24-wide picture lost a whole
row to the background -- 552 of 576 pixels hit.  Every sampler that maps
by inverse mapping now uses the same centre.

Measured: 12 test modes x depth 24 and depth 8 = 24/24 green, build with
0 warnings (make dtphoto, forced rebuild).  The three false expectations
I wrote first were my arithmetic, not the code: gamut marks by ink above
0.9 (250,30,30 is 0.88), perspective squeezes towards the top so the
corner reads from inside, and (9,4) is 2 px from the edge.
2026-11-22 13:59:18 +00:00
lotherk c6974849ae MCDE dtphoto: the other 43 filters proven, no build warnings
-filtertest hands a structured 24x24 picture to every remaining filter
-- the four blurs, unsharp, high pass, find edges, emboss, trace contour,
facet, fragment, median, offset, clouds, crystallize, pointillize, color
halftone, mezzotint, diffuse, extrude, tiles, wind, deinterlace, NTSC
colors, dust and scratches, the nine distortions and the Image mode
family -- and checks a property of the result, not "it changed":
grayscale leaves r == g == b, bitmap only 0 and 255, indexed 4 only the
ladder 0/85/170/255, offset is a permutation (same sum and sum of
squares), equalize never narrows the range, inverting twice returns the
picture.

Two of those are judged against what the display can hold.  On a
256-cell PseudoColor map a second inversion of a 576-colour picture
drifts 42/255 -- the map, not the operation -- so the involution runs on
a four-colour picture (floor 0) and grayscale gets the 10/255 the
nearest-cell search costs.  The test prints the floor it measured (0 on
TrueColor, 30 on PseudoColor) instead of carrying a guessed tolerance.

XmLoc is now the one place that casts a catalogue string for
XmStringCreateLocalized: Tr promises const because its English fallback
is a literal, the widget asks for char *.  Six dialogs warned before,
the file builds without a single warning now.

Measured on Xvfb 1024x768x24 (:91) and x8 (:98): menutest, viewtest,
optest, selmodtest, retouchtest, selecttest, movetest, croptest,
typetest, drawtest, filtertest all PASS on both depths (22), plus
selftest PASS (64x48) on both -- 24 of 24 green, 0 build warnings.
2026-11-22 13:51:29 +00:00
lotherk 208ec91ba9 MCDE dtphoto: every menu path bound, the View switches drawn and read
All 206 paths of dtphoto.menu resolve to a command the callback switches
on.  The table had 43 doubled entries and 11 paths that named a menu
entry the menu does not have ("Image/Adjust/Image Size..." instead of
"Image/Image Size...", "@3.0" tags the reader already strips); both are
gone, CommandOf walks the table to its NULL entry, and -menutest now
proves the table against itself: 206 paths, 0 doubled, 0 bad, and an
unknown path stays CMD_NONE.  DTPHOTO_CMDS=1 used to bind 38, now 206,
none on CMD_NONE.

The View switches were flags nobody read.  SnapX/SnapY pull a marquee or
crop drag onto the grid or a guide a guide in reach wins over the grid,
Lock Guides refuses new and keeps existing ones), DrawGuides paints the
grid, the guides and the rulers on the canvas and not into the picture.

Two new headless tests, both green on depth 24 and depth 8:
  -viewtest  snapping arithmetic: 37 -> 32 on a 16 grid, 40 -> 48, a
             guide at 35 catches 37, a vertical guide leaves y alone,
             locked guides neither grow nor clear.
  -drawtest  counts the pixels on a real pixmap: grid 12509, one guide
             280 (= the canvas height), rulers 558 and none of them
             inside the canvas.

Measured: drawtest, viewtest, menutest, optest, selmodtest, retouchtest,
selecttest, movetest, croptest, typetest -> 20 green, 0 red (10 tests x
depth 24/depth 8); -selftest PASS on both, byte-identical output.
2026-11-22 13:09:53 +00:00
lotherk d6479ef90f MCDE: PNG, JPEG and GIF in dtphoto, one picture writer in libDtSvc
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.
2026-11-22 12:06:04 +00:00
lotherk d234b8be2e docs: README for the tree, drop harness-specific .claude config
README.md collects what Makronix is, the repository layout, the one build
entry point and its gate, the installer/desktop/media design, offline
sources, platforms, the documentation map and the contribution rules from
AGENTS.md, GOAL.md and docs/BUILD-CONTRACT.md. All relative links resolve.

Remove .claude/ from the repository and ignore it: AGENTS.md is the
harness-independent convention. Root AGENTS.md and tools/AGENTS.md now
describe tools/claude-build-gate.sh as a build gate rather than a Claude
hook; docs/reference/AGENTS.md notes the removal of the archived directory.

Verification: sh -n tools/claude-build-gate.sh ok; tools/claude-build-gate-test.sh
25 ok, 0 bad; git check-ignore -v .claude/settings.json matches /.claude/;
README links checked against the tree.
2026-11-22 12:04:30 +00:00
lotherk 028161f296 MCDE dtphoto: the Image and Filter menus carry real operations
Image: Invert, Desaturate, Brightness/Contrast, Flip horizontal/vertical,
Rotate 180/90 CW/90 CCW, Image Size and Canvas Size.  Filter: Blur,
Blur More, Sharpen, Sharpen More, Find Edges, Emboss, Solarize, Add Noise,
Median/Despeckle, Mosaic.  All of them read and write through the same RGB
buffer, so no operation costs an X round trip per pixel.

Two bugs found while wiring them:
 - A per-pixel correction ignored the selection.  Invert, Desaturate,
   Brightness and Solarize changed the whole picture even with a mask.
   They now share OpPerPixel, so a new operation cannot forget the mask.
 - A menu entry was bound by its label, but the reference has "Horizontal"
   in Image > Flip and in Layer > Type.  CommandOf takes the full path now
   ("Image/Flip/Horizontal"), the reader stores it in Item.path.

Verified, depth 24 and depth 8, 16 runs, 0 red:
 - -menutest: 31 paths each resolve to the command the callback switches
   on; an unknown path stays CMD_NONE.
 - -optest against the arithmetic, not "the picture changed": a hard edge
   blurred to 170 (six of nine window pixels white), the same edge
   sharpened clamped to 255 and 0, mosaic cells to their mean (100,30,128),
   noise deterministic and inside the range, mask inside changed and
   outside untouched.
 - -selftest on a 1024x768 24-bit BMP: byte-identical (2,359,350 bytes,
   0 differing).
 - -retouchtest -selecttest -movetest -croptest -typetest still green.
 - DTPHOTO_CMDS=1 reports 37 bound entries, the 11 Filter paths among them.
2026-11-22 11:05:24 +00:00
lotherk 30ff8ec5f5 MCDE dtphoto: the toolbox wired -- lasso, wand, move, crop, type, retouch
The selection was a rectangle, so the lasso, the magic wand and every
command that should honour a selected shape had nothing to work on.  It
is a bit mask now: the lasso collects a path, the wand floods by colour
distance, Select > Inverse and Edit > Clear read the same mask, and a
command paints only inside it.

Move and Crop had no press or motion branch at all -- two of the 22
buttons did nothing.  Move snapshots picture and mask at the press and
rebuilds from that snapshot on every motion event: rebuilding from the
last frame walks the pixels twice as far, and the release must not
recompute the offset, because a drag that ends on the frame gives a
position outside the canvas and moved the picture back.  Without a
selection it moves the whole picture, as the original does.  Crop drags
a rectangle and crops to it on release.  Type opens a prompt and draws
one line over an undo snapshot (the drawing moved out of the dialog
callback so it is reachable without a dialog).  The magnifier doubles on
the left button and halves on the right, the hand pans the view.

The six retouching tools (blur, sharpen, smudge, dodge, burn, sponge)
are new here -- dtpaint has none to copy -- and read a patch around the
dab in one GetImageRGB round trip, not one per pixel.

Two latent bugs found while testing: Unique() sorts the colour keys in
place but the bsearch afterwards ran over the reduced count, so lookups
past the holes failed (ReadPatch and GetImageRGB both had it), and
RGBToPixel returned 0 -- black -- when XAllocColor failed on a full
256-cell map, losing the pixel instead of taking the nearest cell.

Test evidence, headless, depth 24 and depth 8, all green:
  -movetest    10x10 block moved (10,5), mask travelled, background hole
  -croptest    40x30 -> 20x30, only blue kept
  -typetest    75 dark pixels, corner still white
  -selecttest  wand 800 of 2400 exact, inverse 1600, lasso in/out, clear
               only inside the mask
  -retouchtest all six tools move the values the expected way
  -selftest    1024x768 round trip PASS
Mouse-verified on Xvfb with xdotool: zoom 200% -> 400% -> 200%,
crop 1024x768 -> 200x150, move dragged twice (40,30 then 80,60) with
78,011 pixels changed.
2026-11-22 10:14:59 +00:00
lotherk cc7248c520 MCDE dtphoto: open and save through one RGB buffer, not per pixel (P1)
dtphoto allocated a colour in the server for every pixel it opened and
queried one for every pixel it saved -- one X round trip per pixel, the
same fault dtpaint lost on 2026-11-21.  dtpaint was carried over; dtphoto
was not.

The document now goes through an 8-bit RGB buffer (SetImageRGB,
GetImageRGB) and converts colours through the visual's masks on TrueColor,
or in one XQueryColors/XAllocColor per *distinct* colour otherwise.  The
reader takes 24-bit BMP (bottom-up and top-down), 8-bit BMP uncompressed
and RLE8, and the first image of an ICO (1/4/8/24/32 bpp, alpha 0
composited on the document's background, a PNG-compressed icon refused),
as dtpaint does; the save keeps the 2835 dpi fields the old writer wrote.
The selftest compares every pixel now, not a sample, and its two callers
pass a real file each instead of relying on a scratch document.

Measured on Xvfb (1280x1024x24), a 1024x768 24-bit BMP with 589,824
distinct colours, `dtphoto -selftest big.bmp out.bmp`: 20.3 s before the
change (the old binary, same picture, 20.326 s), 58-109 ms after (5 runs).
The round trip is byte-identical: 2,359,350 bytes, `cmp` silent, dpi
fields included.  depth 8 (PseudoColor, Xvfb 1280x1024x8): PASS, exact for
4- and 65536-colour documents alike.  8-bit BMP, RLE8 BMP, ICO 8 bpp and
ICO 32 bpp read exact on both depths (0 wrong pixels, /tmp/dtptest).
make in build/mcde-linux/programs/dtphoto: cc and libtool link exit=0, no
new warning (the two const warnings in XmStringCreateLocalized calls are
older than this change).

Documented in AGENTS.md and docs/MCDE-PROGRAMS.md (C1).
2026-11-22 08:28:41 +00:00
lotherk c543f7d910 docs: dtpaint D3/D4 (tools, formats, print) recorded
C3's status gains the 2026-11-22 paragraph: airbrush/text/curve/polygon,
rect/free selection with XOR marquee, move and Delete/Select All, zoom
1x-8x, Attributes, Edit Colors, 8-bit BMP (uncompressed and RLE8) and ICO
read, 24-bit BMP save, and Print through mcde_sys_print_file with the
temporary file removed when the job ends.  The physical page on the HP
printer stays the user's step; the spool path is verified with a fake lp.
AGENTS.md: the same in the dtpaint paragraph and the catalog count (51
messages, 52 free).
2026-11-22 07:31:31 +00:00
lotherk 0ee7098d0f MCDE dtpaint: the review's defects -- crash, undo, menus, save, i18n, speed (t0704)
Review of programs/dtpaint found and this fixes:
- Picker crash: a click in the grey strip below the image reached
  XGetImage outside the pixmap (BadMatch, X_GetImage).  The canvas is now
  a drawing area of exactly the image size inside a scrolled window, and
  CanvasInput bounds-checks; large BMPs scroll instead of being clipped.
- Undo: one snapshot taken before every image-changing operation (pencil,
  brush, eraser, fill, shapes, invert, flip, clear) and refreshed after a
  load; previously only shape tools snapshotted and OpenBMP left snap
  uninitialized, so Undo after Open turned the image black.
- Menus: Clear Selection and Edit Colors were wired to Clear Image and
  About; they are now insensitive until D3/D4.  Help Topics is real.
  Accelerator text shown; Clear Image uses 'Ctrl Shift<Key>N' (the old
  'Ctrl<Key>Shift<Key>N' never fired).
- Save remembers the path and title, asks before New/Open/Exit when
  dirty (Discard/Keep), and reports open/save errors in a dialog instead
  of stderr; the per-tool-change stderr debug is gone.
- Colour model: fg/bg are pixels (picker takes any colour, right button
  sets background) with a drawn fg/bg indicator; toolbox is radio with
  the indicator hidden (one sunken tool); swatches are 16x16.
- Open/Save/Invert no longer do one X round trip per pixel: TrueColor
  converts through the visual's masks, other visuals batch the distinct
  colours.  Measured on a 1024x768 BMP: open 18.3 s -> 0.02 s, invert
  14.9 s -> 0.05 s, save 6.3 s -> 0.23 s.
- FloodFill is scanline with a growing seed stack, not 4 neighbours per
  pixel; XmString leaks freed; message dialogs destroy their shell.
- Catalog grows to 34 messages; the German copy transliterates umlauts
  (core font has no UTF-8 rendition), re-measured under de_DE.UTF-8.
-selftest now also checks the BMP round trip and double invert/flip: PASS.
Builds clean under -Wall -Wextra -Werror; PLIST gate ok (3714 installed).
Left column is a Form so the colour box never overlaps the canvas.
2026-11-21 21:42:34 +00:00
lotherk b207c2c8ad make release builds the whole release: sets, source set, ISO, USB image
Konrad, 2026-11-18: 'make release heisst ein RELEASE, ein RELEASE enthaelt
natuerlich ALLES'.  release now runs build.sh release, then sourcesets, iso
and usb inside its own (re-entrant) lock; iso and usb keep checking the stamp
with -c, so nothing built in the same run is discarded.  cdtest no longer
calls iso a second time.  AGENTS.md and docs/BUILD-CONTRACT.md say so.
2026-11-18 14:21:06 +00:00
lotherk 9558ad4f07 www: the pages in the voice of docs/reference/website-voice.txt, license.html, new pictures
license.html carries the CNCL and the table of docs/LICENSES.md and is linked
from every page and the guide's template; shot-bar and shot-dtchat are used
by desktop.html and index.html (every href/src of www/*.html resolves).  The
guide no longer announces a photo editor (dtphoto exists).
2026-11-17 16:39:44 +00:00
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