* ci, tests: run all tests in CI
* ci: test with PostgreSQL agent store on one entry
* ci: link libsodium-sumo module for xftp-web tests
* tests: run stress tests at 1k messages
* tests: wait for subscription events from all servers of remaining connections
* ci, tests: fail on stale generated files, update agent PostgreSQL schema dump
* ci: give the PostgreSQL test server 1 GB of shared memory
* ci, tests: run slow XFTP server test in a flagged test build only
* agent: skip work items deleted by a concurrent transaction
* agent: retry a work item batch whose items were all deleted, test skipping
* tests: skip work items deleted after their IDs were read
* agent: revert skipping of work items deleted after their ID query
* agent: lock work items and their connections in ID queries on PostgreSQL
* xftp: report a file deleted during transfer as NO_FILE, not INTERNAL
* tests: delete work items during worker reads and file transfers
* agent: retry worker reads aborted by PostgreSQL deadlock detection
* xftp: report NO_FILE when a file is deleted before its chunks are saved
* tests: lock tests on readers without item locks, deterministic NO_FILE tests
* agent: keep the SQLite text of work item ID queries unchanged
* tests: resume the upload in a new agent with the server down
* agent: retry transactions and batches aborted by PostgreSQL deadlocks
* tests: lock tests for six ID queries, NO_FILE when adding recipients
* agent: read work items in one snapshot, retry serialization failures
* xftp: report NO_FILE after a failed write when the file is deleted
* tests: work item reads with concurrent deletions on PostgreSQL
* tests: start the prepared file read by the prepare worker test
* agent: export transaction retry for chat work item reads
* agent: avoid shadowing STM retry in the transaction retry loop
* tests: wait for the lock held by the test's own transaction
* agent: retry read conflicts on the same database connection
* tests: retry bound of work item reads on PostgreSQL
* tests: qualify the agent INTERNAL error in retry bound tests
* tests: check retried reads use one connection and report the state
* tests: match the SQLSTATE field in retry bound tests
* tests: failed work item read is marked failed on PostgreSQL
* xftp: apply the deleted-file handler in infix form
* xftp: apply the deleted-file handler before multi-line writes
* agent: remove the unused read committed isolation level
* agent: MSGERR event, test of a skipped message before QCONT
* agent: report skipped messages followed by agent messages
* tests: keep the sender online until the expired message is deleted
* agent: report integrity errors in one guard before the message dispatch
* agent: skip integrity notices of HELLO and QEND, check message types in one guard
* agent: report integrity errors in the dispatch branches of QCONT, QADD, QKEY, QUSE and QTEST
* agent: use one integrity notice helper in the dispatch and the receipt branch
* agent: report integrity errors as MSG without body, remove MSGERR
* agent: report integrity errors as MSGERR again, MSG unchanged
* tests: cover deletion of accepted contact requests
* agent: delete contact requests after they are accepted
* tests: check the type of received contact requests
* tests: cover retried and offline async accept of contact requests
* servers: prevent partial reads of metrics files
* tests: compare metrics time with shouldNotReturn
* servers: log metrics file errors instead of stopping
* servers, tests: test metrics written while read and after a failed write
* tests: retry failed tests outside the exception handler, so timeouts end them
* servers: log metrics collection errors instead of stopping
* servers: log errors of periodic tasks instead of stopping
* servers: count expired files after deletion, read stats counts each period
* tests: cover XFTP files prepared concurrently
* xftp: create unique work directories for concurrent file transfers
* xftp: test whether a candidate path is taken
* xftp: compute candidate names apart from checking and creating paths
* xftp: create unique directories in a separate function
* xftp: share the candidate path between unique names and directories
* agent: authorize sender commands with X25519 keys
* tests: check that new sender keys are X25519
* docs: sender command authorization in the crypto registry
* agent: accept confirmations only with the client version that the agent version implies
* tests: connections with apps of earlier versions
* agent: send confirmation with the client version agreed when the join is retried
* smp-server: forward worker queue length and command time metrics
* smp-server: describe forward worker time metric start, test queue wait
* smp-server: state worker queue wait in forward worker time metric
* smp-server: state counted commands and max period in forward worker metrics
* smp-server: process forwarded messages to different queues in parallel
* smp-server: name forward workers without "forwarded"
* smp server: process messages of all clients in a shared worker pool
* smp server: revert the shared worker pool
* smp server: run forwarded commands in workers without join
* smp server: queue server actions to forward workers
* smp server: choose the forward worker by queue ID outside the command loop
* smp server: define the server monad with the environment
* smp server: queue forwarded sender commands to workers after verification
* smp server: verify forwarded sender commands in their worker
* smp server: reject or verify forwarded commands in their worker
* smp server: dispatch forwarded commands in one case
* smp: restrict forwarded commands to forward parties at type level
* smp server: return no response for commands queued to workers
* smp server: queue forwarded sender commands in their dispatch branch
* smp server: define the forward worker where it is used
* smp server: plan to deliver messages sent while a subscription is registered
* tests: reproduce subscription races with SEND and DEL
* smp server: move subscriber registration functions to top level
* smp server: deliver messages sent while a subscription is registered
* smp server: deliver later messages after SUB while a delivery waits
* smp server: correct the subscription race plan and a comment
* smp server: remove delivery thread state change and its test
* smp server: remove PostgreSQL performance changes of SUB batches
* smp server: record the split of the subscription race fix in the plan
* smp server: link the split pull requests in the subscription race plan
* smp server: shorten row locks of PostgreSQL SUB batches
* smp server: read first messages of SUB batches without queue lookups
* servers: omit database connection string from output, save stats first
* smp server: remove the plan of the closed subscription race fix
* smp server: plan for notification delivery in bounded transactions
* smp server: deliver notifications in bounded transactions
* smp server: test that notifications are delivered in chunks
* smp server: correct line references in notification delivery plan
* smp server: update line references in notification delivery plan
* tests: service subscription counts after queue deletion
* smp server: decrease service subscription count on DEL and SUBS
* tests: service subscription count after the client service changes
* smp server: on DEL, decrease the count of the queue's own service only
* tests: reproduce SUB and SEND race in one block
* smp server: move subscriber registration out of serverThread
* smp server: deliver messages sent while the recipient subscribes
* smp server: keep subscriber registration in smpServer, pass it to client
* tests: receive SUB and SEND responses in order
* smp server: register subscription of a new queue directly
* smp server: name server subscribers srvSubs in runClient
* tests: sign SUB with authTransmission, keep test helpers unchanged
* smp server: remove do and mask_ from subscribeNewQueue
* smp server: send the first message once when SEND delivers it during SUB
* smp server: plan with SUB and SEND sequences before and after the change
* smp server: one sequence diagram with added and removed steps in the plan
* smp server: process all subscription changes in the client thread, remove subQ and serverThread
* smp server: send the first message once after SUBS, keep service counts exact
* smp server: name the reader monad in the type of setService
* plans: correct the diagrams and decisions of subscription processing
* plans: diagrams of a duplicate SUB and of SUBS, corrected decisions
* plans: duplicate SUB with SEND, service counts before and after the change
* tests: switch subscription with SUB and SEND in one block
* docs: remove the outdated SMP server design diagram
* smp server: move processClientSub back to the place of serverThread, passed to client threads as a parameter
* smp server: pass the pair of subscription processors to client, applied to the client where called
* smp server: show subscribeQueue and sharedSubscribeQueue as comments at their master places, temporary [skip ci]
* smp server: remove the temporary comments, the tree equals 966701dd [skip ci]
* tests: cover the changed subscription paths with concurrent, blocked, service and notifier scenarios
* tests: cover SMP server subscription changes
* smp server: remove the subscription branch for a disconnected client
* tests: accept UP and MSG in either order when subscribing
* tests: add the type of the UP and MSG reader
* tests: accept SENT of two connections in any order
* core: reject empty server key hash and null byte in host
* core: reject notification subscription to a server without key hash
* lib: exclude null byte in host with the other excluded characters
* tests: name the subscription server address test by the rejected values
* agent: continue XFTP uploads started in foreground while suspending
* tests: verify XFTP upload stage of agent suspension
* docs: plan for XFTP uploads while suspending
* docs: revise plan for XFTP uploads while suspending
* docs: revise plan wording for XFTP uploads while suspending
* agent: exclude ended and stopped XFTP uploads from suspension wait
* tests: verify suspension wait for ended and stopped XFTP uploads
* docs: plan decisions for ended XFTP uploads while suspending
* agent: simplify tryBeginAgentOperation with orElse
* agent: rename upload wait functions by the conditions they check
* tests: verify database check and deleted rows at suspension start
* docs: plan residual case, conditions and names for XFTP suspension
* docs: plan tests for the remaining XFTP suspension paths
* tests: verify the remaining XFTP suspension paths
* docs: update plan line references and the query error test
* tests: foreground agent before checking the query error result
* docs: plan line references after merging master and stage diagrams
* agent: one check of the begun database operation when removing deleted or failed counted files
* agent: suspendAgent returns before the database query of counted files
* tests: closed database store tests excluded from PostgreSQL agent builds
* tests: suspension timeout test waits for the timeout and bounds SUSPENDED
* tests: one setup helper for suspension tests with a small sent file, one for the bounded SUSPENDED wait
* tests: suspendAgent returns while the agent database is in use
* docs: plan states the forked removal at suspension start, uncounted redirects, offline files and the changed tests
* docs: plan links the simplex-chat pull request
* agent: suspend timeout starts when suspendAgent returns, not after the database query of counted files
* docs: plan states the separate removal thread and the TTL cleanup interval
* agent: acquire connection locks in order when sending
* tests: enable OverloadedStrings for lock acquisition tests
* agent: acquire connection locks with explicit recursion
* agent: test version 2 ratchets with previous header encoding
* agent: deliver messages between 7.0 and 7.1 apps in old connections
* agent: test version 2 ratchets with v7.0 encoding on master code
* agent: decode headers in version 2 ratchet tests without attoparsec
* agent: deliver messages to and from 7.0 apps in old connections
* agent: choose the header format by its length prefix
* xftp: test decoding handshake of servers before v6.5.0
* xftp: send and receive files through servers before v6.5.0
* xftp: refuse server handshake with invalid signature
* names: an available name carries its bona fide community terms
A bona fide community name can be registered only by someone who
accepts the community terms its name policy keeps. NRAvailable gains
bonaFideTerms_: the terms' text when it fits the answer, else the 0x
hex keccak256 of the text; Nothing for any other name. Nothing is
omitted from the JSON, so a plain name's answer is unchanged, and an
answer without the field decodes as a plain name.
Claude-Session: https://claude.ai/code/session_014JqabRiGc38JjH4KrE5LEU
* names: the bona fide terms travel as the zstd frame the name policy keeps
The name policy keeps the community terms' text compressed in one zstd
frame, and a buyer accepts the keccak256 of that frame. An available
bona fide name carries the frame when it fits the answer, else its hash.
ZstdTerms is base64url in JSON, as other bytes are.
Claude-Session: https://claude.ai/code/session_014JqabRiGc38JjH4KrE5LEU
* names: every available name carries the terms its buyer accepts
Every registration accepts terms, not only a bona fide name's. The name
policy keeps the general name terms and the community terms, each as a
zstd frame. NRAvailable's nameTerms is NTName with the general terms, or
NTBonaFide with a bona fide name's community terms, which include them;
either carries the frame when it fits the answer, else its hash. It is
absent only from a router before v24.
Claude-Session: https://claude.ai/code/session_014JqabRiGc38JjH4KrE5LEU
* names: NTBonaFide is NTCommunity
Claude-Session: https://claude.ai/code/session_014JqabRiGc38JjH4KrE5LEU
* names: terms are the policy's link to a file, and the file when it fits
* names: general and community terms, as the name policy now names them
---------
Co-authored-by: brenzi-agent <346870783+brenzi-agent@users.noreply.github.com>
* agent, ntf server: add lookupOrInsertIO, use it for locks and stats
* agent, server: use lookupOrInsertIO for map entries
* agent: use lookupOrInsertIO for server stats, keep GET lock in one transaction
* smp server: update getSubscription comment for lookupOrInsertIO result
* agent, server: keep original function names, reduce diff
* agent, server: simplify incServerStat and getMessage
* agent, ntf server: stat under whenPendingSub, lookupOrInsertIO in addPendingSubs
* smp server, session: use lookupOrInsertIO directly, drop the newSub alias
* agent, server: fromEither, remove unused incXFTPServerStat'
* util: hide UnliftIO fromEither where Util fromEither is used
* agent, server: use either id id, remove fromEither
* agent, server: keep isPendingSub, reword service delivery comment
* ci: one reduced build job on draft pull requests and manual runs
* ci: reject manual runs on tags
* ci: reduced job by job condition, tests only when selected
* ci: test selection and retries in scripts/ci/run-tests.sh
* ci: guide to reduced builds and test selection