Repository navigation
chore(workspace): land the first two crates — M0 of the walking skeleton - #62
Merged
Merged
Conversation
…ntumssh The workspace gains its members (ADR-0017: two crates, flat layout) and the lint flip ADR-0018 requires in this same PR: unsafe_code = 'forbid', no allow escape hatch. Only functional code, per the no-stubs rule: quantumssh-core ships the server module — Server::bind/local_addr/serve with the ADR-0022 sequential spawn-and-join accept loop (Send enforced from line one, JoinError captured and logged as connection.closed, never discarded) — and the quantumssh binary is the thin entrypoint: std-only CLI (--listen, --log-format, --help, --version), tokio multi-thread runtime, and the only subscriber construction (ADR-0024: all logs to stderr, JSON when stderr is not a TTY, human on a TTY, EnvFilter). Protocol modules land with their logic in later milestones; M0's observable contract — accept TCP, clean FIN, survive to the next connection — is asserted by an integration test on an ephemeral port. Dependencies (each per its decision record): tokio ~1.51 (tilde keeps the 1.51.x LTS line per ADR-0022; resolved 1.51.3), tracing, tracing-subscriber. The crypto pins (ml-kem 0.3.0 et al., ADR-0019) land with the kex milestone that uses them. Cargo.lock committed and un-ignored — the .gitignore note anticipated exactly this moment, and audit.yml's guard (ADR-0011) keys on the lockfile's presence. Pre-existing scaffold fix activated by the first member: the 'unused' lint group needed priority -1 next to individual lints. Refs #9 (M0 of the walking skeleton). Signed-off-by: Gonzalo Fleming <[email protected]>
…ers, schema Three findings from #62, applied: - ADR-0022's handshake budget was specified but not implemented: new --handshake-timeout flag (default 30 s, documented in --help, zero rejected), Config.handshake_timeout, and tokio::time::timeout wrapping each connection — expiry logs connection.closed with reason 'handshake-timeout'. The slow-handshake test lands in M1 with the first read that can actually be slow. - ADR-0024's two-layer subscriber was deferred to M4; now in place from the first crate: the audit layer's filter is compiled in and never consults the environment, the general layer is RUST_LOG- governed with the audit target excluded — the guarantee exists before its first consumer. - server.started is deferred to the host-key milestone: its schema mandates host_key_fingerprint, and the posture is schema-complete or nothing. M0 emits only events it can emit completely (connection.accepted / connection.closed). The fourth finding (fabricated serde tree) is refuted with registry evidence in the thread: serde_core and zmij are the real, current crates.io dependency graph; index checksums match the lockfile. Signed-off-by: Gonzalo Fleming <[email protected]>
Contributor
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
cargo deny's bans check treats a version-less path dependency as a
wildcard (error[wildcard]); the explicit version on
quantumssh-core = { path, version } satisfies it without loosening
deny.toml. Advisories, licenses and sources all passed on the first
real run.
Signed-off-by: Gonzalo Fleming <[email protected]>
This was referenced Jun 12, 2026
gonzafg2
added a commit
that referenced
this pull request
Jun 12, 2026
…ange (#63) The entry of the pre-authentication path (threat model 4.1), with the security rules as structural properties rather than conventions: - Reader: zero-copy parser over byte slices where EVERY variable-length read takes an explicit caller-supplied bound — the no-unbounded-allocation rule is the API's type signature, not a guideline. No panics on input; all failures are typed WireError. Pure functions, fuzzable by construction. - sshtype primitives (RFC 4251 sec. 5): byte/boolean/uint32/uint64/ string/name-list/mpint. Strict parsing, fail closed: non-canonical mpints (redundant leading zero, negative, non-empty zero) and malformed name-lists (non-ASCII, empty names, stray commas) are rejected, not normalised. - Binary Packet Protocol framing (RFC 4253 sec. 6), plaintext phase: encode with random padding (getrandom), packet_length validated against the 35000 hard cap and block alignment BEFORE any allocation — the first attacker-controlled length the server observes is bounded at the door. - Version exchange (RFC 4253 sec. 4.2): SSH-2.0 only (SSH-1.99 compatibility marker rejected — zero legacy), peer line bounded byte-by-byte at 255, integrated into the connection handler: the server now sends its banner, validates the peer's, and closes (KEXINIT picks up from here in M2). - getrandom 0.3 added (workspace-pinned): BPP padding now, KEXINIT cookie in M2. Tests: 23 unit (round-trips per type, RFC 4251 worked examples for mpint, truncation/oversize/misalignment/padding attacks, bound-trips- before-data proof, identification edge cases) + 4 integration over real TCP, including the threat-model 5.1.3 slow-handshake scenario promised in the #62 review (client sends nothing, server cuts at the budget) and the oversized-line cut. Refs #9 (M1 of the walking skeleton). Signed-off-by: Gonzalo Fleming <[email protected]>
Merged
4 of 12 tasks
gonzafg2
added a commit
that referenced
this pull request
Sep 22, 2026
…each edit touched Claude checked the Links lines against the milestone PRs' file lists and found four wrong attributions: server.rs (ADR-0016) and everything ADR-0022 names landed in M0 (#62), not M5/M3; transport.rs (ADR-0021) landed in M3 (#65), not M2; and log_fields.rs (ADR-0024) came with #101 on 2026-07-06, after the ADR's acceptance. All four corrected, with the banners' milestone references. Each banner now says which section the edit touched (Context in 0018/0019, Related in 0021/0023/0024, both in 0022) instead of the same sentence everywhere. ADR-0020's Links line no longer carries a note about the unimplemented package pin — that is decision-level content and lives in ADR-0034 (#161). ADR-0023 no longer points at "PR #50 in review" for the event schema, and ADR-0021 drops a "(TBD)" next to the kex module. docs/adr/README.md step 5 distinguishes the governance state from the file's Status line and lists what actually happened (ADR-0027 merged Accepted; 0028/0029 flipped in their implementing PRs; 0030-0032 in #158) instead of calling one instance the practice. docs/infrastructure.md says first-party unsafe would need a superseding ADR, as ADR-0018 states, not an RFC. Findings by Claude and opencode on #159. Claude-Session: https://claude.ai/code/session_018UmL9wcgKBGFjdjGSSLafa Signed-off-by: Gonzalo Fleming <[email protected]>
gonzafg2
added a commit
that referenced
this pull request
Sep 22, 2026
…ame every edited section README.md's vision bullet still allowed a justified unsafe; it now states the forbid posture the rest of the repository already describes. ADR-0024's Links line attributed the tracing-subscriber initialisation to M4/M5; it landed in M0 (#62). ADR-0018's Decision and Consequences and ADR-0022's Alternative 2 still spoke of the current deny lint and the empty workspace; they now read as of drafting time. The banners of ADR-0018, 0021, 0022 and 0023 name every section their edits touched. Raised by Claude and opencode on #159. Claude-Session: https://claude.ai/code/session_018UmL9wcgKBGFjdjGSSLafa Signed-off-by: Gonzalo Fleming <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The first Rust code in the repository: the two-crate workspace (ADR-0017), the
unsafe_code = "forbid"flip (ADR-0018, in this same PR as that ADR requires), and the minimal functional server —quantumssh-core::serverwith the ADR-0022 sequential spawn-and-join accept loop, plus thequantumsshbinary as the thin entrypoint with the ADR-0024 logging posture. This is M0 of the walking skeleton (#9): protocol milestones (wire → kex → transport → auth → channel → interop gate) follow as separate PRs.With this merge, the CI workspace-state guards (ADR-0011) self-enable for the first time: the full check matrix (
fmt,clippy -D warningswith pedantic+nursery,test,build --release,cargo deny, andcargo auditonce the lockfile is seen) becomes load-bearing.What lands
crates/quantumssh-core—servermodule only, all of it functional (the project forbids stubs):Server::bind(emitsserver.startedwithlisten_addr),local_addr(ephemeral-port support for tests),serve— the sequential spawn-and-join loop:tokio::spawn(handle(...)).awaitkeeps effective concurrency at one while the compiler enforcesSendon the per-connection future from line one, and a panicking handler surfaces as a captured and loggedJoinError(connection.closedwith reason) — neverlet _ =discarded, per the ADR-0022 review.connection.accepted→ clean shutdown (explicit FIN) →connection.closed. The version exchange lands in M1.crates/quantumssh— the ≤150-line entrypoint: std-only CLI (--listen,--log-format,--help,--version; noclap— not decided by any ADR, not needed yet),#[tokio::main]multi-thread, and the only subscriber construction: all logs to stderr (threat model §2.7), JSON when stderr is not a TTY, human-readable on a TTY,EnvFilterhonouringRUST_LOG.forbidflip, pinned deps withtokio = "~1.51"(the tilde keeps the 1.51.x LTS line per ADR-0022 — a bare"1.51"resolved to 1.52.3; resolved now to 1.51.3),Cargo.lockcommitted and un-ignored (the.gitignorenote anticipated exactly this moment;audit.yml's guard keys on the lockfile).Deliberately not in M0 (per the no-stubs rule)
wire/kex/transport/auth/channelmodules — they land with their logic in M1–M5.server.startedcarrieshost_key_fingerprintfrom M2 when a host key exists.Proposed: they advance toAcceptedwhen the walking skeleton completes (M6), not at M0.Verification
cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings(pedantic + nursery),cargo test --workspace— all green locally../target/release/quantumssh --listen 127.0.0.1:0emitsserver.startedas JSON (stderr non-TTY detection working);--version/--helpbehave.Type of change
Checklist
git commit -s).unsafe_code = "forbid"— zero first-partyunsafe.Security considerations
No protocol surface yet: the server accepts TCP and closes with a clean FIN. The pre-auth path starts existing in M1, where the parser rules (bounded allocations, fuzzable-by-construction) apply. The logging posture (stderr, JSON off-TTY) follows ADR-0024 as reviewed.
Refs #9.