Recent commits to derivepassphrase.git (f797d5074181fc4d5a35f04367784543249315e4) https://git.schokokeks.org/derivepassphrase.git/tree/f797d5074181fc4d5a35f04367784543249315e4 Recent commits feed provided by GitList. Type generators explicitly as generators, not iterators For compatibility with `contextlib.contextmanager`, and because it is the more specific type, we annotate generators as `Generator[T, None, None]`, not as `Iterator[T]`. In January 2026, typeshed started shipping type annotations for the Python standard library that deprecate the use of `contextlib.contextmanager` with general functions returning `Iterator[T]`. `contextlib.contextmanager` actually requires a `Generator[T, None, None]` to work, but the `contextlib` and the `typing` documentation has been erroneously suggesting the `Iterator[T]` type as a "shorthand" notation for years. For `contextlib.contextmanager`, the difference matters. So, re-annotate everything explicitly with generators (when producing) or iterables (when consuming), whichever is appropriate. https://git.schokokeks.org/derivepassphrase.git/commit/f797d5074181fc4d5a35f04367784543249315e4 software@the13thletter.info (Marco Ricci) Fri, 19 Jun 2026 22:40:11 +0200 f797d5074181fc4d5a35f04367784543249315e4 Refactor the (SSH agent) testing machinery tests for modularity Use pytest parametrization and hypothesis randomization systematically: tests that have exhaustive configurations or error conditions use pytest parametrization, tests with whole classes of configurations or error conditions use hypothesis randomization. Consolidate tests that test the same thing, but under different circumstances, into pytest parametrized tests. Also, use class inheritance to share helper functions for setting up the stub agent environment across all relevant test groups. Consolidating tests usually involves variants of a test for different variants of the stubbed agent. Converting pytest parametrization to a hypothesis strategy usually means settling for a `strategies.sampled_from(existing_parameter_set)` implementation and leaving any smarter generation logic to future edits. https://git.schokokeks.org/derivepassphrase.git/commit/3a69028fe108068a7c7ba6e0cdeeefc18df56e7d software@the13thletter.info (Marco Ricci) Fri, 19 Jun 2026 21:31:13 +0200 3a69028fe108068a7c7ba6e0cdeeefc18df56e7d Re-align the stubbed SSH agent socket with "real world" behavior Let the stubbed SSH agent tolerate incomplete request messages, or multiple request messages at once, within the same `sendall` call. Furthermore, change the error type to OSError (EBADF) for I/O on closed socket connections (mirroring the behavior of UNIX domain sockets) and when closing the connection, assert that no incomplete requests have been issued to the agent. With this change, the stubbed SSH agent socket now usefully models the communication channel between agent and client, and can be sensibly used to simulate communication and protocol errors (or their absence). This differentiates it—in terms of scope and use cases—from the agent protocol response queue, which monkeypatches the client instead of faking a server, and which operates on full request/response messages. Add some commentary to the stubbed SSH agent socket docstring to this effect. https://git.schokokeks.org/derivepassphrase.git/commit/27f35e7c4101164e42e08051b0698a55735f8322 software@the13thletter.info (Marco Ricci) Thu, 18 Jun 2026 06:15:10 +0200 27f35e7c4101164e42e08051b0698a55735f8322 Serialize the SSH agent protocol numbers as request/response codes When calling `bytes` on the SSH agent protocol number enums, return their corresponding serialization as request codes or response codes. (A follow-up to 57e3b1ed832e865e9f9e8316f930b1beae3714f0.) https://git.schokokeks.org/derivepassphrase.git/commit/729c89799dc49635698c8f73a59ba79eb3c584a0 software@the13thletter.info (Marco Ricci) Tue, 16 Jun 2026 22:19:26 +0200 729c89799dc49635698c8f73a59ba79eb3c584a0 Rewrite test data initializers for nicer API docs In attribute declarations, `griffe`/`mkdocstring-python` elides the object on which the outermost method is called (but correctly autolinks the method itself). This looks good if the initializer is something like `base64.b64_decode(data)` (which gets shortened to `b64_decode(data)`), and terrible if the initializer is something like `base64.b64_decode(data).decode()` (which gets shortened to `decode()`). So, to get nicer API docs, rewrite some obvious cases where the object would otherwise be elided in the "class-bound method + self argument" style instead. https://git.schokokeks.org/derivepassphrase.git/commit/3790413fb35878eb8500e29e7c6923104869d854 software@the13thletter.info (Marco Ricci) Tue, 16 Jun 2026 19:55:01 +0200 3790413fb35878eb8500e29e7c6923104869d854 Note that "spawning" an SSH agent in the tests may actually be "interfacing" https://git.schokokeks.org/derivepassphrase.git/commit/c2efe74d47243d97f87240eee0045cbb58abff53 software@the13thletter.info (Marco Ricci) Tue, 16 Jun 2026 19:47:25 +0200 c2efe74d47243d97f87240eee0045cbb58abff53 Use the BuiltinSSHAgentSocketProvider type in the tests Again, instead of magic strings floating around in the test suite, use the already existing enum instead. https://git.schokokeks.org/derivepassphrase.git/commit/090f87b133247b5f688f5101f0229829616b22dd software@the13thletter.info (Marco Ricci) Mon, 15 Jun 2026 22:27:21 +0200 090f87b133247b5f688f5101f0229829616b22dd Use an enum for SSH agent configurations in the test suite Instead of having all these magic strings floating around all over the test suite, use a dedicated enum for consistency, discoverability, and typo-resistance. https://git.schokokeks.org/derivepassphrase.git/commit/7bccff34588cfb6ac90bc0d277a40cab5b9a5cf2 software@the13thletter.info (Marco Ricci) Mon, 15 Jun 2026 21:36:53 +0200 7bccff34588cfb6ac90bc0d277a40cab5b9a5cf2 Auto-format everything due to tooling update https://git.schokokeks.org/derivepassphrase.git/commit/b18d27971117d16358ddd511d69a11813464671e software@the13thletter.info (Marco Ricci) Mon, 15 Jun 2026 18:20:15 +0200 b18d27971117d16358ddd511d69a11813464671e Fix minor spelling/logic errors and missing TODOs in the test suite https://git.schokokeks.org/derivepassphrase.git/commit/68497eb1efa715ef461aaf33c5e55fc982b190cb software@the13thletter.info (Marco Ricci) Sun, 14 Jun 2026 22:46:36 +0200 68497eb1efa715ef461aaf33c5e55fc982b190cb