Skip to content

docs(rfc): draft RFC 0003 -- Phase 1 SSH stack greenfield vs russh - #28

Merged
gonzafg2 merged 3 commits into
mainfrom
rfc/0003-phase-1-ssh-stack-greenfield-vs-russh
Jun 10, 2026
Merged

gonzafg2 merged 3 commits into
mainfrom
rfc/0003-phase-1-ssh-stack-greenfield-vs-russh

Conversation

@gonzafg2

Copy link
Copy Markdown
Owner

Summary

Draft RFC formalising the foundational choice for Phase 1's SSH-2 layers: implement transport, KEX, authentication, and channel layers greenfield on audited cryptographic primitive crates, rather than depend on russh.

Three options analysed:

  • A. Greenfield-modular on ml-kem, x25519-dalek, ed25519-dalek, chacha20poly1305, aes-gcm, sha2, hmac — proposed.
  • B. russh with maximum mitigations — documented fallback if a future constraint forces the trade.
  • C. Hybrid — narrow extension of A that uses ssh-key for authorized_keys parsing only, greenfield everything else.

The decision is RFC-level (not ADR-level) because Phase 1's foundation determines what code runs in QuantumSSH's pre-auth path — the highest-trust surface in the system — for the lifetime of the project.

Why now

The README.md §Roadmap Phase 0 entry records a "tentatively russh; formal RFC pending" commitment. Phase 1's tracking issue #9 cannot begin in earnest without resolving this — the first crate's Cargo.toml settles the choice for the duration of the phase.

The only dimension where russh clearly won the prior analysis was the README's old "Phase 1 takes weeks" commitment. PR #25, merged on 2026-05-27, removed per-phase calendar estimates in favour of "each phase ships when it is ready, not on a calendar." That removed the load-bearing argument for russh and made it correct to revisit.

How the decision was reached

The full evidence — six adversarial agent positions (RUSSH-PRO, RUSSH-CON, ML-KEM, WORKSPACE-TOPOLOGY, SCOPE-EXEC, INTEROP), eight-row dimension table scored against the MANIFIESTO, external citations, cost estimates — lives in claudedocs/phase1-open-decisions.md §"Decisión 1" (dated 2026-05-13). The RFC is the public, normative synthesis of that analysis. The claudedocs file remains a working-notes artefact, not part of the RFC's canonical record.

Adversarial verdict: A wins 6 of 8 dimensions (MANIFIESTO #1 memory safety, #3 zero legacy, #4 small surface, correctness-over-cleverness, threat-model containment of RFC-0001 §3.2.6, cargo audit cleanliness). The two non-A wins are "we don't invent crypto" (a tie — both options re-use audited primitives) and the now-defunct calendar promise.

Follow-ups this RFC unblocks

If accepted, four ADRs become writable (numbering assigned at merge per docs/adr/README.md):

  1. Workspace topology — two crates, flat layout (crates/quantumssh binary + crates/quantumssh-core library).
  2. unsafe_code = \"forbid\" workspace-wide promotion.
  3. RustCrypto/ml-kem 0.3.0 as the ML-KEM-768 implementation, with libcrux-ml-kem as named fallback.
  4. CI interop hard gate (Debian trixie container, OpenSSH 10.0p1).

Plus a small follow-up PR to README.md updating the Phase 0 roadmap entry from "tentatively russh" to "greenfield-modular per RFC-0003". Not bundled here — one decision per PR.

Comment period

Per docs/rfcs/README.md §5, this RFC stays open for at least 14 days before merge. The 14-day window ends ~2026-06-10. Decided by lazy consensus per §"Decision rule": absent a substantive unresolved objection from a maintainer at the end of the comment period, the RFC is accepted.

Test plan

  • Diff review of the two files: docs/rfcs/0003-phase-1-ssh-stack-greenfield-vs-russh.md (new, ~270 lines) and CHANGELOG.md (one bullet under Added).
  • Confirm the RFC follows the convention codified in docs/rfcs/0000-template.md (Summary, Motivation, Guide-level, Reference-level, Drawbacks, Rationale and alternatives, Prior art, Unresolved questions, Future possibilities).
  • Confirm Roadmap issue: field cites #9 per the convention introduced in PR #25.
  • Verify the four cross-citations to other open work resolve: PR #24 (RFC-0002), PR #25 (merged), PR #23 (merged), RFC-0001 §3.2.6 (merged).
  • CI green (workspace-state guards remain self-disabled per ADR-0011).

Proposes the foundational decision for Phase 1's SSH-2 transport,
KEX, authentication, and channel layers. Three options analysed
against the five MANIFIESTO commitments and threat-model §3.2.6:

  A. Greenfield-modular on audited primitive crates (chosen).
  B. russh with maximum mitigations (named fallback).
  C. Hybrid -- ssh-key for authorized_keys parsing only.

A wins on MANIFIESTO #1 (memory safety), #3 (zero legacy),
#4 (small surface), on threat-model containment, and on cargo audit
cleanliness. The only dimension where B won -- the README's old
'Phase 1 takes weeks' commitment -- no longer exists after PR #25
removed per-phase calendar estimates on 2026-05-27.

The decision is RFC-level (not ADR-level) because Phase 1's
foundation determines what code runs in QuantumSSH's pre-auth path
for the lifetime of the project; reversing later costs an order of
magnitude more than choosing once. Four follow-up ADRs become
unblocked when this RFC merges (workspace topology, unsafe_code
forbid promotion, ML-KEM crate selection, CI interop hard gate).

Source material: claudedocs/phase1-open-decisions.md (2026-05-13)
adversarial panel analysis with external citations. This RFC is
the public, normative version of that analysis.

Roadmap issue: #9 (Phase 1 / Hito 1).
Copilot AI review requested due to automatic review settings May 27, 2026 03:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds draft RFC-0003 to formalize the Phase 1 SSH-2 stack decision (greenfield-modular implementation over depending on russh), and records the draft in the project changelog.

Changes:

  • Add docs/rfcs/0003-phase-1-ssh-stack-greenfield-vs-russh.md (Draft) describing options A/B/C and proposing greenfield-modular as the default.
  • Update CHANGELOG.md to include an [Unreleased] -> Added entry for RFC-0003.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/rfcs/0003-phase-1-ssh-stack-greenfield-vs-russh.md New draft RFC documenting the Phase 1 SSH stack decision and rationale.
CHANGELOG.md Adds an entry under Unreleased/Added documenting the new RFC draft.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gonzafg2
gonzafg2 merged commit 1c2fde5 into main Jun 10, 2026
6 checks passed
@gonzafg2
gonzafg2 deleted the rfc/0003-phase-1-ssh-stack-greenfield-vs-russh branch June 10, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants