Date: 2026-10-25. Repo github.com/LibreStatic/ShellDrive. Backend work continues on branch wip/m2-backend
(this document lives there); main stays clean for the frontend track. This hand-off covers every backend item
of every milestone in docs/design/00-integration-review.md §6. Frontend (GUI) work is handed off separately to
the lead session, which validates and implements it.
State update: 2026-10-27, M2 code complete; only the acceptance doc, the D38 package and the final -Clean remain
Read this first; it supersedes every section below. Branch wip/m2-backend, tree clean at cbe6439. The
striping worktree (C:\Users\facum\ShellDrive-striping, branch wip/m2-striping, clean at dccb8c2) is
fully merged - all later work went straight onto wip/m2-backend.
cc0cd3a: the CI repairs -unit.crypto_pkgets a 3600 s ctest TIMEOUT on the x86 flavours only (the suite passes by hand in ~25-30 min; x64 keeps 300 s), and thereconnect_drop_during_pipelined_readsrace is fixed inreq_submit(sftp_session.c): an operation carrying a handle submitted while the session is not READY returnsSD_E_STALE_HANDLEper the M1 contract; path ops keepSD_E_DISCONNECTED. Verified 12x on x64-analysis.c4934e9..dccb8c2(11 commits): the striping branch rebased and landed. Increment 2 (stream idx 0-4, Q_STRIPE/PH_STRIPED, unit routing with quiescent recompute, lazy sub-handles, barriers, member-loss semantics), the reals->liveaccounting fix, 22 fake-transport unit tests, the per-member generation guard, the member-lost write-wires fix (64409dc: a dropped member's sibling wires stay answerable or the server hangs the session), interop coverage with a deterministic single-member drop (freeze - burst - kill - thaw), the independent review's fixes, and the contract docs (01 section 10.9, 02 section 5.6 pointer, m2-notes).2d26f5e: pool increment 3 - 500 ms admission stagger (per-pool timer thread), backoff 500 ms then 2 s, abandonment after 3 transient refusals until the next generation via the newSD_E_POOL_ABANDONED(all consumers updated); identity mismatch still stops the generation instantly. 4 tests. Also fixed a pre-existingInterlockedOrgap on XP x86.bdf8156: system proxy opt-in (TM-R10) - pure decision functionssh_sysproxy_decide(), newallow_systemfield (policyAllowSystemProxy, default reject) onsd_proxy_cfg/sd_mount_proxy, fail-fast inssh_pxcfg_copy, SSPI verdict!discovered || AllowSystemProxySspiin one place, WinHTTP for discovery only; documented in 01 section 5.2. Decision-matrix and boundary tests inunit.ssh.5966ee3: vfs striping policy (02 section 5.6) -SD_SFTP_O_STRIPEDonly when pool > 1 connection, sequential access, file >= 8 MiB (stripe_min_file) or >= 1 MiB sequential write latch; never APPEND or directories. 5 tests (unit.vfs46/46). Benchbench.vfs_pool(labelbench, gated behindSD_IT_BENCH=1): 1 GiB vs the wsl-sshd fixture - read 1.85x with 3 members (49.9 -> 92.2 MB/s), write does not scale (write-through saturates the primary bulk channel); numbers in m2-notes.4871fcb+cabdd7f: gate repairs - C28182 (_Analysis_assume_(r->f != NULL)in the REOPEN arm), ci-local excludes labels with the single expression-LE 'matrix|bench'(repeated -LE flags REPLACE, they do not accumulate), and the big striping test frames madestaticfor the 16 KB analysis stack budget. After these, the full incrementalci-localrun was GREEN on all five presets.1fee8ee: the M2 CLI -profile import putty [<session>]|ssh-config [<file>] [--dry-run],hostkey list [--announced]|import --from putty|openssh|remove|accept-announced <id> [--add-only](list/import/remove run sd_known_hosts in-process per 03 section 5/C19; accept-announced drives the existing IPC hostkey methods),status,--jump(repeatable, max 8),--proxy,--connections; console flows for password change, proxy password, legacy acknowledge, save-response, and TM-R03 jump lines. Agent conn JSON gainspool/pool_wanted; five new exit codes. The sd_mount mapping itself was already complete (agent.cbuild_chain/handle_mount_body). 56 new strings registered; parsing + smoke tests added.cbe6439: those 56 strings localized into es (rioplatense voseo), fr (vous), pt-BR, it, de (informal), CLDR plurals, prompt answer letters matched per locale;sdl10n --checkand thel10n.*gates green.
- Acceptance: run
tests\interop\run-matrix.ps1once with the matrix fixtures up (squid/dante down is the established green state) and writedocs/dev/m2-acceptance.mdfollowingm1-acceptance.md's conventions (scoped per 00 section 6 M2 row; striping numbers from m2-notes; exact reviewer commands; date 2026-10-27; no local user names or machine paths). - The D38 review pass 1 package (decisions.md D38): all of sd_crypto (pk+pq) and sd_ssh - sources reviewed, test evidence with commands and current results (unit suites, wycheproof, CNG-diff, the CT gate output, XP import floors), the TST mapping from 05-threat-model.md, open findings. It prepares the human pass 1; it does not replace it.
- A fresh
tools\ci-local.ps1 -Cleanfor the record (the incremental run is green atcbe6439; -Clean is the milestone gate). - Then M1 remainder, M3-M6 as listed below. M3's IPC surface is what the frontend track consumes - it is the next backend priority after M2 closes.
sd_err: new codeSD_E_POOL_ABANDONED(01 section 10.2 schema, IPC exit-code table, vfs mapping).- CLI: the verbs and options above; exit codes
host_key_not_found,announcement_not_found,session_not_found,putty_not_found,file_not_found(03 section 7). - Agent connection JSON:
poolandpool_wantedfields. sd_ssh:allow_systemonsd_proxy_cfg(policyAllowSystemProxy, default 0); see 01 section 5.2.- l10n: 56 new strings in the
l10n/clidomain, complete in all six locales. - ci-local now runs ctest with
-LE 'matrix|bench'; benchmarks are opt-in viaSD_IT_BENCH=1.
- Fixtures up: all matrix instances except squid/dante (never run), wsl-sshd up. No CI running.
- Providers seen from the workflow subagents: TokenHarbor
deepseek-v4.1-flash:free$highworks but queues long; NIM rejects the harness reasoning parameters (enable_thinking/reasoning) with 400 on every model and level tried - unusable until that clears;z-ai-individual-coding-planGLM-5.3-Flash$highdid all of this session's subagent work reliably.
State update: 2026-10-26, striping session: unit-tested, hardened, interop covered, contract documented; CI gate red
Read this first; on striping state it supersedes the two 2026-10-25 sections below.
Where things stand. wip/m2-striping (worktree C:\Users\facum\ShellDrive-striping) is clean at the tip,
ten commits on top of 5923090. All six risks of the 2026-10-25 section are closed: 1 by the tests, 2/3/5 by
8703f72, 4 evaluated and dropped, 6 by the contract commit at the tip. The commits, oldest first:
99d6042"Implement pool striping over member streams (01 10.9, increment 2)" - the handed-off WIP, including this document's increment-2 section.818c000"Fix the sub-open request accounting in pool striping" - a real defect the new tests caught:start_sub_open()(sftp_session.c:885) submitted its internal request without incrementings->live, whiledeliver()(sftp_session.c:430) decrements it for every request, so after the first member sub-open(uint32_t)s->livewrapped to ~4e9 and every later submission returnedSD_E_BUSY(measured: session READY, queued=0, inflight=0, fsync -> 23 "busy"). Fixed with the matching increment;req_submit()'s SD_E_BUSY rejection path (sftp_session.c:3013-3017) verified symmetric; barriers countdata_wires/SST_OPENING, notlive, so no double counting.93cc916"Add fake-transport unit tests for pool striping" -sftp_test_tp.{c,h}now models streams 0..4 (members 1..3 at idx 2..4,SD_SFTP_TP_POOL,notify_readyadmitting throughsftp_session_pool_change(),member_statswritingout[idx-1], plusfake_drop_member,fake_stream_packets,fake_set_session);tests/unit/sd_sftp/test_striping.c(registered in CMakeLists.txt and main.c) covering unit routing, lazy sub-opens, barriers across every sub-handle with first-error-wins, member loss (in-flight READs re-issued on the primary with correct bytes, WRITEs completing SD_E_DISCONNECTED + maybe_executed + session_ready with the session still READY and a later striped open working), route recompute at the quiescent point, and regressions (plain handles / APPEND / CLASS_META / directories / no-member transports never touch a member stream).8703f72"Guard pool member events with a per-member generation" - closes hand-off risks 2, 3 and 5: stale posted member events are ignored by generation (session-side guard at sftp_session.c:2495, the transport-side guard is sftp_ssh.c:422/436/787/865/933), a double drop emits exactly one EV_POOL and runsmember_lostonce (striping_member_drop_reported_twice_acts_once),stripe_bytesis clamped to the negotiated limits (striping_stripe_unit_clamped_to_negotiated_limits). One falsified unit test per risk (each fails with its guard disabled). Risk 4 evaluated and dropped: no real concurrency - allf->subaccess is on the session I/O thread ands->filesis walked unders->lock; the only caller-threadfile_unlink_freepath runs after the I/O thread is done (sftp_session.c:1418-1427).fbf8b17"Keep a member-lost write's other wires answerable" - the wires of a failed write on the surviving channels stay in the wire table, so their late acknowledgements are discarded as stale replies instead of surfacing as "unknown id"SD_E_PROTOCOL(which had turned one lost member into a dead session).02075f2"Add striping interop coverage with member loss" -m2_striping_end_to_endandm2_striping_member_lost_mid_transferintests/unit/sd_sftp/test_ssh_interop.c: a 32 MiB striped write + read-back over a 3-connection pool, SHA-256 verified against the server, payload on every member connection; then exactly one member killed mid-transfer through the fixture (ctl.ps1freeze / drop / thaw with bursts in flight, so the kill lands on wires the member really carried): burst reads recover byte-exact on the primary, burst writes on the lost member completeSD_E_DISCONNECTEDwithmaybe_executed = 1andsession_ready = 1, the pool reports 2 connections, the session never leaves READY and a follow-up striped transfer runs on the survivor.ea076d9+6b145cf"Address review findings in the pool striping path" - three defects, tests grown to 22: (a) a refused member sub-open (server STATUS error or allocation failure) parked its units until the deadline instead of falling back -stripe_unit_member()now resolves the member per unit (SST_FAILEDfalls back at once,SST_OPENINGwaits, the next barrier recomputes the table without the member); (b) a write error on a member channel in the window between the member thread dropping the stream and the posted close killed the whole session - member channels now leave their bytes queued for the generation-guarded drop report, only channels 0/1 lose the session; (c) a striped write's statvfs refinement probe queued intoQ_STRIPEparked forever (pump_striped_reqkeyed on the op alone) - probe phases now emit throughemit()on the handle's own channel, so a full filesystem refines toSD_E_NO_SPACE. New pins: per-member WRITE placement, the threeemit_pieceparking limits with exact resume, a member dying with its barrier wire out, refused sub-open fallback, refined NO_SPACE vs unrefined FAILURE.- The tip commit documents the contract: 01 §10.9 rewritten as implemented (the transport view - stream
indices 0 meta / 1 primary bulk / 2..4 members 1..3 behind
open_stream/write_stream/consumed_stream,member_statswritingout[idx-1];Q_STRIPE/PH_STRIPED; unit routingroute_map[k % route_n]with the recompute points - the open FSTAT and completed barriers; barrier drain-then-fan-out, first error wins; the sub-open oflag mask~(CREAT|TRUNC|EXCL|APPEND|STRIPED); the member-loss mechanics), the stale "[0] of out is unused"member_statscomment insd_sftp_transport.hfixed (risk 6), and a striping section indocs/dev/m2-notes.mdwith every test name and the commands to run them.
Gates that ran green in the worktree (this session, x64-modern Debug): warning-free build;
ctest -R ^unit\.sftp$ (64 tests, 0 failed, 15 s); the striping filters sd-test-sftp --filter striping_
(22/22) and sd-test-sftp-ssh-interop --filter m2_striping (2/2 against the wsl-sshd fixture, which was up
before and after). The x64-xp gate last ran green at 8703f72; the four post-8703f72 code commits and
this one have not been through it or through ci-local - the deciding gates re-run before the landing.
The transport-side generation guard in sftp_ssh.c, previously reachable only through a real SSH session,
is exercised by m2_striping_member_lost_mid_transfer (green above).
The main-tree CI gate is RED, which blocks the landing. tools\ci-local.ps1 -Clean finished on
wip/m2-backend at 5923090 (log: build/ci-local-clean.log) with three independent causes:
- x64-modern FAIL at minute 0:
Remove-Itemofbuild\x64-modernhit a file locked by a zombie process from the previous session's interrupted run. Environment only - a plain re-run clears it. - x86-ia32-debug and x86-sse2-debug:
unit.crypto_pkexceeds ctest's 300 s TIMEOUT. It is NOT broken: run by hand it completesexit=0, 26 tests, 0 failedin roughly 25-30 minutes (Debug + 32-bit limbs + CNG-diff comparisons + bench at 3.5 ops/s for dh group16). Fix: raise the ctest TIMEOUT for that test (config- or flavour-scoped) or trim/skip the bench in x86 Debug. - x64-analysis:
reconnect_drop_during_pipelined_readsgotSD_E_DISCONNECTED(18) where the test requiresSD_E_STALE_HANDLE(19) attests/unit/sd_sftp/test_reconnect.c:466- a stale-marking race right after the drop, seen only in this preset. Decide which error is contractually first and make the marking (or the test's wait) deterministic.
What is left (increment 2 itself is code-complete, tested and documented):
- Repair the three CI causes above on
wip/m2-backend, then landwip/m2-striping(rebase or merge); a fresh fullci-local -Cleanis the M2 gate afterwards - it also re-verifies the post-8703f72commits on every flavour, including x64-xp. - Increment 3: member reconnect/backoff - the 500 ms admission stagger, and a member refused 3x is abandoned for the generation (01 §10.9, "Admission rule" and the lead of "Per-connection reconnect").
- The vfs striping policy (02 §5.6: >= 8 MiB or >= 1 MiB sequential write, never APPEND or directories)
that decides which handles the VFS opens with
SD_SFTP_O_STRIPED. - The 1 GiB pool speed-up measurement.
- Then the rest of M2 in order: system proxy opt-in + TM-R10 tests,
sd_mountmapping + CLI with l10n,docs/dev/m2-acceptance.mdand the D38 review pass 1 package. After M2: M1 remainder (the non-blocked items), then M3-M6 backend per the milestone list below.
Workflow resume (optional, only on the user's ask). The dynamic-workflow run
dwfrun-6119638b-437d-451c-874a-141e3c6b1b84 implements the phases above and was stopped by the user
mid-interop; everything through the x64-xp gate is cached under that id (ResumeWorkflowRun continues it;
its script is .zcode/workflow-drafts/Striping-del-pool-M2-incremento-2.dwf.ts). Provider notes from
this session: TokenHarbor deepseek-v4.1-flash:free$high works (it produced all the committed work
above) but queues long and rate-limits with backoff; the NIM provider rejected the harness reasoning
parameters (enable_thinking, reasoning) with 400s on every model and level tried (nemotron enabled
and disabled, glm-5.3-flash high), so it is unusable for workflow subagents until that clears;
NIM deepseek-ai/deepseek-v4.1-flash$high was switched to last and was stopped before proving itself.
Environment at hand-off: the matrix fixtures are down (start them with ctl.ps1 start / fixture.sh start
when a matrix row is needed; squid/dante still never run); the wsl-sshd fixture is up (verified before and
after the striping interop run above); a long CI run is in progress in the main tree - leave it alone; the
striping worktree is the only other checkout. Everything else in the milestone list below still applies.
Read this first. Increment 2 (striping, 01 §10.9 / 02 §5.6) is implemented but uncommitted and not
exercised by any test. It lives in a separate worktree, C:\Users\facum\ShellDrive-striping, on branch
wip/m2-striping (created from 5923090), because tools\ci-local.ps1 -Clean was still running in the main
tree. The main tree stays on wip/m2-backend; merge/cherry-pick when its gate is green. This whole section
exists only in the worktree: when the striping branch is merged, it lands with it.
Modified, not committed: src/sd_sftp/sftp_internal.h, src/sd_sftp/sftp_session.c,
src/sd_sftp/sftp_ssh.c (+829 / -29).
| Check | Result |
|---|---|
x64-modern Debug configure + build (worktree) |
Clean, zero warnings or errors |
ctest -R unit.sftp (x64-modern Debug) |
Passed, 5.72 s - existing tests only; no striping test |
ctest -R interop.sftp_ssh |
Skipped: the wsl-sshd fixture was not running |
Main-tree gate ci-local -Clean (finished) |
x64-xp pass. x64-modern failed at 0 min: -Clean could not delete a file under build\x64-modern\tests\... (a leftover test process held it; no ShellDrive process was running afterwards). x86-ia32 and x86-sse2: Release pass, Debug failed only on unit.crypto_pk Timeout 300 s (stops at cng_diff_ecdh; x64-analysis takes 136.88 s). x64-analysis: unit.sftp reconnect_drop_during_pipelined_reads failed with SD_E_DISCONNECTED (18) instead of SD_E_STALE_HANDLE (19) - that tree is wip/m2-backend at 5923090, dirty=0, so it is pre-existing, not a striping change. Log: C:\Users\facum\ShellDrive\build\ci-local-clean.log |
The worktree build and unit.sftp run overlapped the x86 Debug presets of that gate, so CPU contention may
have contributed to the 300 s timeouts; re-run x86-ia32-debug and x86-sse2-debug alone before treating them
as product bugs. The reconnect_drop_during_pipelined_reads flake (a read submitted while the drop is being
processed completes with DISCONNECTED instead of STALE_HANDLE) passed in the other presets; it still needs
a decision: either the read path should map an in-flight drop to STALE_HANDLE or the test must accept both.
Build-tooling note: cmake and ctest are not on PATH. Use
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\{cmake,ctest}.exe
(ci-local.ps1 resolves them itself).
Session core (sftp_session.c, sftp_internal.h)
NCHgrown to 5: 0 meta, 1 primary bulk, 2..4 members 1..3. NewQ_STRIPEclass queue (qh/qt[3]) andPH_STRIPEDwire phase.req_classsends READ/WRITE/FSTAT/FSETSTAT/FSYNC/FSTATVFS/CLOSE of a striped handle toQ_STRIPE;r->target_chbinds an internal request to one member channel.file_newsetsstriped(SD_SFTP_O_STRIPED, never directories, meta handles or APPEND),stripe_bytes(default 1 MiB) androute_n = 1;wire_take/detach_allmaintainf->data_wires.- Routing: unit
k = off / stripe_bytesgoes toroute_map[k % route_n]; the table is recomputed only at a quiescent point (stripe_quiescent, called from barrier replies and the open FSTAT), so a byte range always travels on the same connection in submission order. emit_piecesplits each request at stripe-unit boundaries;pump_striped_reqlazily opens one sub-handle per member (start_sub_open,oflags & ~(CREAT|TRUNC|EXCL|APPEND|STRIPED)) and stops at channel limits (inflight requests, obuf high water, inflight bytes).emit_barrier/barrier_wire: FSTAT/FSETSTAT/FSYNC/FSTATVFS/CLOSE wait forf->data_wires == 0and everySST_OPENINGto settle, then run on the primary handle and on each open sub-handle;striped_barrier_replycompletes when all wires settle (first error wins) and recomputes the route table.member_lostdrops the member's wires, re-queues its in-flight READ ranges on the primary (req_requeue_read), fails its WRITEs withSD_E_DISCONNECTEDplussession_ready = 1, releases the sub-handles and keeps the session READY.sftp_session_pool_changeopens the member stream (open_stream(1 + member)) on admission and reports drops;sink_on_open/closed/eofhandle member channels without killing the session;go_readyresets member channels and admission state; stats sum allNCH; reopen drops stale sub-handles;sd_sftp_openkeepsO_STRIPEDforfile_new(the wire masks pflags with& 0x3Fu, so the bit never reaches the server).
Pool transport (sftp_ssh.c)
- Member channels are exposed as streams 2..4 through a two-queue proxy. RX:
member thread -> queue -> posted drain on the primary thread -> session sink; the member channel is credited only when the session consumed the bytes, so the queues stay bounded by the SSH receive window. TX:session -> bounded 1 MiB queue -> posted pump on the member thread, withon_writablereported back to the session. pool_open_stream/pool_write_stream/pool_consumed_streamoverride the vtable for idx >= 2 and delegate idx 0..1 to the primary;member_statswritesout[idx-1](members 1..3);notify_readytears down and re-admits members per generation;destroystops the member threads, frees the queues and destroys the per-member locks.
- Nothing exercises striping yet: no test opens a handle with
SD_SFTP_O_STRIPED, so the whole emit and proxy path is unproven. member_stream_closedis posted to the primary thread; a generation reset can run in between, so a stale event could callon_closedon a recycledsftp_chanand take down a freshly admitted member. Add a per-member generation/sequence and ignore stale posts.- A member drop can reach
sftp_session_pool_change(..., 0, ...)twice (channelon_closedandpool_decided), producing duplicateEV_POOLevents and a duplicatemember_lost. member_lostwalkss->filesreleasing sub-handles; untested against a handle that is closing concurrently.stripe_bytesis not clamped tomax_read/max_writeor validated as a multiple of the chunk size.sd_sftp_transport.hstill says "[0] of out is unused" formember_stats; the implementation usesout[idx-1]. Fix the comment in the contract commit.
- Commit the current state on
wip/m2-striping(author and committerFacuM, no attribution), or keep it WIP but do not lose it. - Unit-test the striping path with the fake transport:
tests/unit/sd_sftp/sftp_test_tp.cstill exposes 2 streams - extend it to N streams and route by idx, or drivesftp_session_pool_change(s, 1..3, 1, SD_OK)directly. Cover: units land on the routed streams, barriers wait for data wires, member loss re-issues reads and fails writes withsession_ready, route recomputation at barriers. - Interop against the
modernfixture with a file above the VFS threshold: verify SHA-256 on both sides, traffic instats.conn[1..3], and kill one member mid-transfer (reads recover, writes reportsession_ready). - Close risks 2 and 3 with a member generation field.
- Re-run
unit.sftp, thenx64-xpDebug (theNCHchange and the queues are flavour-independent, but XP has the strictest compiler and the oldest headers). - Document the contract in
01 §10.9(stream idx 2..4,PH_STRIPED, barrier ordering,member_statsindexing) and indocs/dev/m2-notes.mdin the same commit as the code. Record the VFS policy (02 §5.6:= 8 MiB or >= 1 MiB sequential write, never APPEND or directories) when it is implemented.
- Merge/cherry-pick onto
wip/m2-backendonce the main-tree gate is green, then continue with increment 3 (member reconnect/backoff: 500 ms stagger, a member refused 3x is abandoned for the generation), the system-proxy TM-R10 tests,sd_mountmapping + CLI,docs/dev/m2-acceptance.mdand the D38 package.
Before that merge, repair the gate itself: re-run -Presets x64-modern once the stale file lock is gone, then
x86-ia32-debug and x86-sse2-debug alone (no concurrent build or test on the machine) to tell a real
unit.crypto_pk slowdown from contention, and settle the reconnect_drop_during_pipelined_reads expectation.
Require the gate green on the merged tree, not only on either branch alone.
- Worktree
C:\Users\facum\ShellDrive-striping(wip/m2-striping); main tree onwip/m2-backendwith the gate running. - Matrix fixtures were up (all instances plus the HTTP/SOCKS proxies; squid/dante stopped). The wsl-sshd
fixture was not: start it with
powershell -File tests\fixtures\wsl-sshd\start.ps1beforeinterop.sftp_ssh; fault injection ispowershell -File tests\fixtures\wsl-sshd\ctl.ps1 kill|restart|drop|freeze|reap|thaw|status. - Never run
wsl --shutdownwhile fixtures run; tests use the fixtures'direct_host.
Branch wip/m2-backend, all work committed. Commits of this session, oldest first: "Fix the failing M2 unit
suites and add the RSA reference vectors", "Add matrix-driven transport interop tests for every fixture row",
"Add auth interop: every key format and user-certificate paths", "Implement pool members and admission in
sd_sftp (01 10.9, increment 1)", "Fix the XP/x86 flavours after the M2 WIP and pool work", "Make the
x64-analysis preset green again and scope the matrix tests", "Label the srv_* interop tests with 'matrix'".
- Unit suites all green (17/17 on x64-modern Release and on x64-analysis Debug): the missing
refimpl/rsa_keys.txtregenerated (seed 8017,python -I tests/vectors/refimpl/pk_ref.py <rfc5903.txt> - - tests/vectors rsa); the M1-era auth/conn tests updated to the implemented M2 contract (cert-first offers, the RSA retry ladder, synchronous prompts ->pump_prompts(f, n)in the test harness); the fake pipe agent now always keeps a listening instance (the reconnect race was a test bug, not a product bug). - Transport interop done for every row:
tests/unit/sd_ssh/test_interop_m2.c(sd-test-ssh-interop-m2), entriesinterop.ssh_matrix_{connect,kex,pq,update,auth_keys,auth_certs}withsrv_*+matrixlabels;run-matrix.ps1green on all rows with fixtures up, includingdemo(SOCKS5-auth -> OTP bastion -> target, PPK v3, ML-KEM),jump2/jump3, HTTP CONNECT (plain/Basic), SOCKS5 (plain/RFC 1929),legacy,legacy3des,cert(+ negative certificates),rotate(hostkeys-00 apply + reconnect). TOTP computed in-process fromSD_IT_OTP_SECRET. Plainctestexcludes them via-LE matrix(they exit 77 withoutSD_IT_*); the runner fixed to not abort at the first failing row (PS 5.1 native-stderr quirk). - Connect, increment 1 of the pool (01 section 10.9):
sd_sftp_options.connections(1..4) admits secondary members after READY only when authentication was non-interactive (2FA rule; prompts on a member are cancelled), each member = ownsd_ssh_connwithSD_SSH_CFG_POOL_MEMBER+ one bulk channel, admission exchange INIT/VERSION + REALPATH(".") length-framed, admit/drop decided on the primary I/O thread comparing host-key fingerprint and realpath; a mismatch drops the member and stops admissions for the generation. EV_POOL events,info.connections,stats.conn[1..3]. Tests:m2_pool_admits_members,m2_pool_interactive_stays_at_one(tests/unit/sd_sftp/test_ssh_interop.c, both green againstmodern). - All five presets build warning-free again (the XP import floors gained four documented XP APIs;
InterlockedAdd64-> portablesd_atomic_*; Vista-onlyGetTickCount64->sd_tick_msin tests) and the x64-analysis preset is green (build + Debug unit suite) after analyzer fixes inbn.c,profile_m2.c,secret.cand several test files (details in m2-notes.md).
- Pool increment 2 - striping (the next big rock). Design is settled: grow
NCHfrom 2 to 5 (primary meta/bulk + 3 member bulk channels); the pool transport exposes member channels as streams with idx1 + member(2..4) through the existingopen_stream/write_streamvtable (caps already carrySD_SFTP_TP_POOL); wires already key replies byw->ch, so routing is a newmemberdecision in the emit path forSD_SFTP_O_STRIPEDhandles: unitk = off / stripe_bytesgoes to memberk mod live_members, sub-handles open lazily per member withoflags & ~(CREAT|TRUNC|EXCL),fstat/fsetstat/fsync/closebecome barriers (wait for the handle's member wires to drain, then run on the primary), member loss reissues in-flight reads on the primary and completes writes withSD_E_DISCONNECTED/maybe_executed = 1/session_ready = 1. Then the vfs-side striping policy (02 section 5.6: >= 8 MiB or >= 1 MiB sequential write, never APPEND/directories) and the 1 GiB pool speed-up measurement. - Pool member reconnect/backoff (member refused 3x is abandoned for the generation; 500 ms admission stagger) - increment 3.
- System proxy opt-in + TM-R10 tests (
SD_PROXY_SYSTEM,allow_discovered_sspi,AllowSystemProxySspi): untested; needs either unit tests with a scripted WinHTTP environment or a fixture row. - sd_mount mapping + CLI (original hand-off item 5): unchanged, half-done from before.
- Verification gate: a fresh
tools\ci-local.ps1 -Cleanwas started and stopped midway at this session's end - run it as the first action; everything short of it is verified green (all presets build+test incrementally, matrix runner green, sftp/ssh interop green). Thendocs/dev/m2-acceptance.md(does not exist yet) and the D38 review pass 1 package.
- Fixtures were left running when the session ended: all matrix instances + proxies except
squid/dante(never run; sudo step not done).wsl.exe -e sh tests/fixtures/matrix/fixture.sh statusto check; restart withctl.ps1 start/fixture.sh start. Never runwsl --shutdown. - Encrypted PPK fixtures exist (puttygen installed):
SD_IT_KEY_ED25519_PPK3_ARGON2ID,SD_IT_KEY_RSA_PPK2_AES- the PPK cross-check is covered byinterop.ssh_matrix_auth_keys. build/run-row.sh(untracked dev helper) runs one matrix sub-test for one row by hand:sh build/run-row.sh <row> <filter> [build-dir];SD_IT_DBG=1adds ssh log lines, row env comes fromtests/fixtures/matrix/state/endpoints.envviaSD_IT_ENV_FILE.- The Windows->WSL localhost relay can wedge; rows/tests use
direct_host. Killing sshd fixtures mid-copy is only safe via the fixture ctl scripts.
| Backend (this hand-off) | Frontend (other hand-off) |
|---|---|
All libraries: sd_base, sd_platform, sd_crypto, sd_ssh, sd_sftp, sd_vfs, sd_dokan, sd_webdav, sd_ipc, sd_config, sd_secret, sd_mount, sd_l10n runtime |
shelldrive-ui.exe: tray, main window, generated dialogs, prompt dialogs, host-key manager, logs viewer, first-run wizard, notifications |
shelldrive-host.exe (agent and service modes), the CLI shelldrive.exe and its strings |
shelldrive-shellext.dll: context menus, Explorer integration, Network locations, drive labels/icons, Windows 11 modern menu (IExplorerCommand + sparse MSIX contents) |
| IPC protocol, events and the shell-extension state snapshot producer | IPC/snapshot consumers in the UI and the shell extension |
| Setup stub engine, CAB payloads, MSI authoring, installer hooks, updater engine, ADMX/ADML generation, signing and release pipeline | Setup UI pages (incl. the D36 Dokany option page), updater consent UI, admin prompt UI |
| Build system, flavours, CI, local CI, lab, fuzzing, performance, crypto reviews | GUI string catalogs (their own l10n domain), accessibility, DPI, visual verification |
Contracts both tracks depend on are owned by backend and must be documented before frontend consumes them:
the IPC methods/events (03 §2), the snapshot layout (03 §8), the profile schema (03 §3.4.1) and policies (03 §3.5),
prompt kinds and their fields (01 §8, 03 §2.5), and error/exit codes (sd_err, 03 §7). Any change to these goes
into the owning design doc and docs/dev/m*-notes.md in the same commit.
AGENTS.md: English for code, comments, logs, docs and commits; user-facing strings in the six locales with the registers given there; full CLDR plurals.- Commits: author and committer
FacuM <facumo.fm@gmail.com>; never addCo-Authored-Byor any AI/tool attribution (commit messages and PR bodies). docs/design/decisions.mdis authoritative (D1–D46). Backend highlights: D1 zero third-party code, crypto included (specs only); D2 hashes are ours; D4 two x86 flavours; D6 service on by default per machine; D9 write-through default; D11 global WebDAV spike; D15 ML-KEM in v1; D16 UpdateHostKeys; D17 no agents in the service; D18 pool only with non-interactive auth; D19 extra pool members bulk-only; D20 HTTP CONNECT + SOCKS5, no ProxyCommand; D28 x64-modern flavour; D31 ARM32 MSI; D32 Dokany packaging; D33 legacy enabled, warning only; D34 Terrapin cipher choice; D35 no implicitservice_access; D36 Dokany install option; D37identities_only; D38 review gate; D42 two signing sessions; D45 LibreStatic names; D46 public repo.- Precedence:
decisions.md→00-integration-review.mdresolutions → owning design doc (01 SSH/SFTP/crypto, 02 filesystem, 03 apps, 04 build) →05-threat-model.mdTM-R as applied. - Verification is local:
powershell -ExecutionPolicy Bypass -File tools\ci-local.ps1 [-Clean](x64-modern, x64-xp, x86-ia32, x86-sse2, x64-analysis; Release + Debug; fails on any warning or skipped interop test; x86dokany.*skips under WOW64 are expected). GitHub CI is free (public repo) but cannot run interop/WebDAV/Dokany. - Per-area source lists in
src/sd_ssh/sources_{transport,auth,connect}.cmakeandsrc/sd_crypto/sources_{pk,pq}.cmakekeep parallel work out of shared files. - Never run
wsl --shutdownwhile fixtures run. Tests use the fixtures'direct_hostbecause the Windows→WSLlocalhost:2222relay can wedge after sshd kills.
- VS 2022 Build Tools 17.14 (v143, v141 + v141_xp, ARM/ARM64 compilers, CMake), SDK 10.0.26100 and 7.1A. Not installed yet: SDK 10.0.22621 (needed for the ARM32 flavour, 04 §1.1), WiX 3.14.1, Windows ADK (oscdimg).
- Dokany 2.3.1 x64 installed; WebClient available (trigger-start); Hyper-V enabled; QEMU 11.1
(
C:\Program Files\qemu,-cpu pentium3); LibreOffice 26.8.1. - WSL Ubuntu 24.04:
libpam-google-authenticator+/etc/pam.d/shelldrive-otp,squid,dante-server,putty-tools(installed by the user). - Fixtures (
docs/dev/m2-notes.md): OpenSSH 10.6p1 (GPG-verified, user prefix); instancesmodern2222,ossh102230,ossh10pq2239,legacy2231,legacy3des2238,bastion12232,bastion2127.0.0.2:2233,target127.0.0.2:2234,cert2235,rotate2236,otp2237; Python HTTP 2280/2281 and SOCKS5 2290/2291. Endpoints intests/fixtures/matrix/state/endpoints.env(SD_IT_*; never logSD_IT_OTP_SECRET); TOTP viash tests/fixtures/matrix/fixture.sh otp-codein WSL; matrix runnertests/interop/run-matrix.ps1. Squid/Dante rows are configured but never run. Onmain, fixture state dirs are excluded via.git/info/exclude. - Lab (
tests/lab/): Hyper-V and QEMU scripts, payload ISO builder, COM1 reader, in-guest smoke scripts. Waiting on licensed XP SP3 x86 and Windows 7 SP1 x86/x64 images from the user.
M0 complete (docs/dev/m0-acceptance.md). M1 code complete with Windows 11 acceptance (docs/dev/m1-acceptance.md):
reconnect, meta/bulk channels, caches and read-ahead, write-behind opt-in, sd_webdav, x86 flavours,
sd-isacheck, lab harness. GitHub CI green on five presets.
- Lab acceptance (00 §6): XP SP3 x86 (
x86-ia32on the QEMU Pentium III VM,x86-sse2elsewhere) and Windows 7 SP1 x86/x64, WebDAV mount + file ops + Office/LibreOffice pattern, viatests/lab/. - WebDAV with sshd killed mid-copy (not yet tested).
- TM-R19 token-only WebDAV mode + WinHTTP self-test, so non-redirector clients (LibreOffice opening files) work;
policy
AllowWebDavTokenOnly(03 §3.5). - [done, r13
wip/r13-davmove] Replacing MOVE drops the destination lock (final UNLOCK gets 409): the destination URL keeps its lock across a replacing MOVE, decided in 02 §7.5; testswebdav_server_office_save_sequenceandwebdav_server_replacing_move_drops_replaced_children_locks. Lab re-check with Office is open (m1-notes). - [done, r14
wip/r14-offwait] Negative cache while the link is down: a cached miss (and a name absent from a cached listing) reportsSD_VFS_E_DISCONNECTED, so WebDAV answers 503 +Retry-After(testsvfs_offline_negative_lookup_is_disconnected,webdav_server_cached_miss_is_503_while_link_down). Nosd_mountchange was needed (m1-notes, r14). - [done, r14] sd_vfs offline waits:
SD_SFTP_REQ_WAIT_READYrequest instead of 50 ms polling; quiesce and unmount cancel the waiters (testsvfs_offline_wait_completes_on_reconnect,vfs_offline_wait_cancel_returns_promptly). Decided (r21): unknown names fail at once while offline, not afteroffline_wait; 02 §5.2, testvfs_offline_unknown_lookup_fails_at_once(m1-notes, r14/r21). - TM-R17 watchers for long-running clients (crash filter and stop cleanup already done).
Scope per 00 §6 M2 row, its demoable outcome and gate D38. State when the area agents were stopped (tree builds warning-free on x64-modern; ctest 31/34):
| Area | Files | State |
|---|---|---|
| fixtures | tests/fixtures/{matrix,openssh10,transport}/, tests/interop/, wsl-sshd/ctl.* |
Done (self-test 53/53, OTP live). |
crypto pq |
src/sd_crypto/{sha3,mlkem,mlkem_hybrid,blake2b,argon2,des3}.c, pktcipher.c, sd_crypto_pq.h, tests/unit/sd_crypto_pq/ |
Near done: tests pass; re-run full suite, x86-ia32 CT gate, throughput. |
crypto pk |
src/sd_crypto/{bn,rsa,dh,dh_gex,ec_p,sha1}.c, pk_*, sd_crypto_pk.h, tests/unit/sd_crypto_pk/ |
RSA private-key path fails (rsa_reference_keys, cng_diff_rsa); bench_pk_throughput fails. |
ssh transport |
kex*.c, negotiate.c, packet.c, known_hosts*.c, hostkey_{verify,update}.c |
Interop tests not written; unit.ssh ssh_conn_config_validation fails (3 checks). |
ssh auth |
auth*.c, keyfile*.c, agent*.c, sd_agent.h |
7/19 unit.ssh_auth fail (mostly RSA; also password change, kbd-interactive rounds, fake agent pipe). |
ssh connect |
conn.c, channel.c, jump_chain.c, proxy_*.c |
Jump chain and proxies written; pool + SD_SFTP_O_STRIPED in src/sd_sftp/ not started. |
| apps backend | src/sd_secret/, src/sd_config/{import.c,profile_m2.c}, src/sd_mount/*, apps/shelldrive-host/agent.c |
Secrets, importers, profile keys done; sd_mount mapping half done; CLI commands not done. |
Done (TM-R31, branch wip/r18-logpriv): the typed log specifiers (%Hs, %Us, %Rs) are used at every call site
that logs a host, lookup name, user or remote path (40 call sites in src/sd_mount, src/sd_sftp, src/sd_ssh,
apps/shelldrive-host); tests/logpriv checks it in ctest. The unsupported %lu/%ld/%lc in log calls are fixed.
Order: (1) fix RSA, then config validation; (2) transport interop over every KEX × host-key alg on modern,
ossh10, ossh10pq, legacy, legacy3des, cert, rotate; (3) auth: all key types/formats (encrypted PPK v3
cross-checked with puttygen), user certs on cert, OTP on otp, password change, Pageant/OpenSSH agent clients;
(4) connect: pool 1–4 with striping and barriers, vfs side (02 §5.6), the 2FA rule proved on otp, 2/3-hop jumps,
jump via SOCKS5 with auth, HTTP CONNECT with Basic, system proxy opt-in, TM-R10; pool speed-up on 1 GiB;
(5) sd_mount mapping + CLI (profile import putty|ssh-config, hostkey list|import|remove|accept-announced,
--jump, --proxy, --connections, kbd-interactive console prompts, password change, proxy credentials,
UpdateHostKeys review) with l10n; tag interop tests srv_* and drive acceptance with run-matrix.ps1;
(6) ci-local -Clean green, docs/dev/m2-acceptance.md; (7) D38 review pass 1 package (all of sd_crypto and
sd_ssh, test evidence, CT-gate output, TST mapping). No public beta before pass 1 closes.
- IPC surface the UI needs (03 §2): profile CRUD, mount/unmount/list/status, subscription to
mount.state,warning(incl.write_failed), prompt events andprompt.answerfrom the UI, log query, settings read/write, host-key store operations incl. UpdateHostKeys review data. Version the protocol; document every method. - Prompt broker in the agent: route to CLI → tray/UI → launch UI → queue (03 §2.5), with timeouts.
- State snapshot producer for the shell extension (03 §8): shared section layout, owner/integrity checks (TM-R26), update on every state change, versioned with one-version skew tolerance.
- Host-side data the shell integration needs: per-mount drive label/icon values written by the host per 03 §8 (the frontend defines the visuals), stable targets for Network locations (02 §10.3).
- l10n tooling:
sdl10nregister lint,qpspseudo-locale generation, CLI catalog complete in six locales.
- Setup stub engine (04 §6): built from
x86-ia32, CAB payload extraction viacabinet.dll, flavour selection by CPU and OS (x86-ia32/x86-sse2,x64-xp/x64-modern, ARM64; ARM32 own EXE), per-user/per-machine/portable, two-stage elevation and%ProgramData%\LibreStaticchecks (TM-R33/R34), KnownDLLs-only imports. - Six flavours in CI and local CI, incl.
x64-modern(v143, CFG/CET) andarm32(needs SDK 10.0.22621). - WiX 3.14 MSIs per flavour incl. ARM32 (D31), language transforms for every LCID (C43), service installed and on
per machine (D6),
ENABLELINKEDCONNECTIONS(D24),DOKANYproperty (D36),REMOVESECRETS, Dokany chaining after thedokan2.dllVC++ dependency check (C31, D32), repair-safe custom actions (TM-R35),DEFAULTPROFILES. - Installer hooks run through
shelldrive-host.exe(webdav-tune,programdata-secure,user-cleanup,modern-menuregistration,signal-shutdown); upgrade with running processes (C3, C4). - Updater engine (04 §9): signed manifest + keyset with offline root keys (TM-R37), per-channel anti-rollback,
expiry, HTTPS then the static HTTP mirror (D30), staging, apply,
--selftest, rollback. The consent UI is frontend; the engine exposes it over IPC. - ADMX/ADML generated from the policy table (03 §3.5); sparse MSIX build switch and packaging (D27; its
contents are frontend); reproducible-build check (
/Brepro, double build); release pipeline with two offline signing sessions (D42), pinned Actions, maintainer rebuild (TM-R39).
- Global WebDAV spike first (D11, 02 §7.7): mechanisms
system/linkper OS, go/no-go recorded,attachfallback. ShellDriveSvc: Dokany global mounts, service-hosted WebDAV per the spike,service_access/service_access_writewith no implicit default (D35), machine stores and secrets (SYSTEM DPAPI), no agents (D17), service pipe quotas (TM-R25), admin-only prompt routing (the admin UI is frontend),hostkey add --from-server, machine-store UpdateHostKeys only under policy, fast user switching/RDP,--elevated-view,EnableLinkedConnectionsdiag/fix, threat-model review (05 §4).
- ARM64 native host and libraries, Dokany ARM64; ARM32 per D5; SHA-NI/AES-NI/ARMv8 fast paths (never in
x86-ia32); 02 §11 performance targets with write mode stated,shelldrive diag bench; pool tuning; nightly fuzzing; external crypto review pass 2 with findings closed (TST-33); Authenticode via SignPath Foundation or Certum OSS (D29);x64-modernCFG/CET checks; admin/CLI documentation; lab smoke green on every VM (04 §11.4). - The ARM64/x86/x64 shell DLLs and the modern menu are frontend.
zlib@openssh.com, adaptive channel windows, specialized NIST reductions, symlink reparse points only if an official signed Dokany gains an FSCTL callback (D12). The modern menu fallback is frontend.
Per milestone: green tools\ci-local.ps1 -Clean, an acceptance doc in docs/dev/ (no local user names or
profile paths), notes in docs/dev/m*-notes.md, and every contract change the frontend depends on listed under a
"Contract changes" heading there.