Skip to content

docs(spec-ssh-host-key-in-beacon): feat(minvmd): include SSH host public key in the ready beacon - #579

Merged
norrietaylor merged 2 commits into
mainfrom
spec/ssh-host-key-in-beacon-3c4d22af94a3a068
Jun 26, 2026
Merged

docs(spec-ssh-host-key-in-beacon): feat(minvmd): include SSH host public key in the ready beacon#579
norrietaylor merged 2 commits into
mainfrom
spec/ssh-host-key-in-beacon-3c4d22af94a3a068

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

This is the spec pull request for #467 — extending the minvmd ready-beacon protocol to carry the VM's SSH host public key, so the host can pre-populate known_hosts before the first SSH connection.

Demoable Units

Unit 1 — Beacon enrichment (minimald, guest side)

  • R1.1: emit_ready_marker() emits READY\n<openssh-pubkey>\n
  • R1.2: vsock boot path passes the host public key to emit_ready_marker()

Unit 2 — Key reception and known_hosts write (minvmd, host side)

  • R2.1: Both boot.rs and run.rs read the second beacon line
  • R2.2: Key is parsed and written to providers/local-0/known_hosts via learn_known_hosts_path
  • R2.3: Absent or malformed key logs a warning and does not abort boot
  • R2.4: providers/local-0/ directory hierarchy is created before the write
  • R2.5: russh promoted from dev-dep to production dep in minvmd/Cargo.toml

Files in scope

  • crates/minimald/src/guest.rs
  • crates/minimald/src/main.rs
  • crates/minvmd/src/cmd/boot.rs
  • crates/minvmd/src/cmd/run.rs
  • crates/minvmd/Cargo.toml

Next step

Merging this spec PR returns the tracking issue #467 from sdd:fastpath-review to sdd:fastpath. After the merge, comment /approve on the tracking issue to dispatch the implementation — or comment /approve now (while this PR is open) to record the approval and let the merge dispatch automatically. Merge and approve commute (ADR 0024).

Generated by sdd-spec for issue #467 ·

Closes #578

Summary by CodeRabbit

  • Documentation
    • Added a new specification to extend the ready-beacon handshake with SSH host key information.
    • Documented how the host should validate a second line after the READY marker and handle missing/invalid data non-fatally with warnings.
    • Included guidance on where the key is stored, expected testing behavior, and backward-compatibility/security considerations.

Light spec for #467: extend the minvmd ready-beacon wire format from
one line (READY\n) to two lines (READY\n<openssh-pubkey>\n) so minvmd
can pre-populate known_hosts on the host before the first SSH connect.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0ef56242-d113-4a14-8d54-9e3b0769f746

📥 Commits

Reviewing files that changed from the base of the PR and between f206024 and 3057c40.

📒 Files selected for processing (1)
  • docs/specs/06-spec-ssh-host-key-in-beacon/06-spec-ssh-host-key-in-beacon.md
✅ Files skipped from review due to trivial changes (1)
  • docs/specs/06-spec-ssh-host-key-in-beacon/06-spec-ssh-host-key-in-beacon.md

📝 Walkthrough

Walkthrough

Adds a spec for extending the READY beacon so minimald emits the SSH host public key, minvmd parses it, and the host writes it to known_hosts. The document also records compatibility, non-fatal error handling, security notes, and verification steps.

Changes

SSH host key beacon spec

Layer / File(s) Summary
Front matter and goals
docs/specs/06-spec-ssh-host-key-in-beacon/06-spec-ssh-host-key-in-beacon.md
Adds the spec metadata and describes the READY beacon extension that carries an SSH host public key.
Beacon emission and host write path
docs/specs/06-spec-ssh-host-key-in-beacon/06-spec-ssh-host-key-in-beacon.md
Specifies two-line beacon emission, host parsing, learn_known_hosts_path writes, parent directory creation, and expected test coverage.
Constraints and verification notes
docs/specs/06-spec-ssh-host-key-in-beacon/06-spec-ssh-host-key-in-beacon.md
Records non-goals, fixed host/port assumptions, non-fatal invalid-key handling, security considerations, and verification steps.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related issues

  • #467: The spec directly matches the requested feature to include the SSH host public key in the ready beacon and write it into known_hosts.

Suggested labels

needs-human

Suggested reviewers

  • norrietaylor

Poem

A rabbit hopped by, ears all bright,
With READY and a key in sight.
The host wrote home, the path was tame,
And SSH greeted without a name. 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding the SSH host public key to the ready beacon spec.
Linked Issues check ✅ Passed The spec change directly addresses #578 by extending the ready beacon to carry the SSH host public key.
Out of Scope Changes check ✅ Passed The changes stay within the requested spec work and do not introduce unrelated code or features.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/specs/06-spec-ssh-host-key-in-beacon/06-spec-ssh-host-key-in-beacon.md`:
- Around line 43-45: The SSH host-key beacon flow needs an inverse compatibility
guarantee in the guest-side spec: if the host only waits for READY and does not
consume the second line, the guest must treat a failed second-line write as
best-effort and continue booting. Update the spec wording around the beacon
handshake to explicitly cover this additive-protocol case, alongside the
existing malformed-or-missing key behavior, so the guest-side write path never
turns compatibility into a boot failure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2ba7ba92-3d0c-49fd-a671-ad2661b7d82a

📥 Commits

Reviewing files that changed from the base of the PR and between e14f4b6 and f206024.

📒 Files selected for processing (1)
  • docs/specs/06-spec-ssh-host-key-in-beacon/06-spec-ssh-host-key-in-beacon.md

@gominimal-aw-bot

This comment has been minimized.

@norrietaylor

Copy link
Copy Markdown
Member

/revise address code rabbit concerns

… R-IDs

Move function names, file paths, and Rust API calls out of requirement
bodies; each R-ID now states the observable behavior only. The specific
implementation details (emit_ready_marker signature, from_openssh call,
learn_known_hosts_path invocation, create_dir_all, tracing::warn!) are
preserved in the Design Considerations section where they belong.

Addresses the gate 2 (implementation leakage) warnings from sdd-validate
and the CodeRabbit review noting that R-IDs contained code-level detail.
@gominimal-aw-bot

Copy link
Copy Markdown
Contributor Author

Commit pushed: 3057c40

Generated by sdd-spec

@norrietaylor
norrietaylor enabled auto-merge (squash) June 26, 2026 06:13
@norrietaylor
norrietaylor merged commit bf05ff4 into main Jun 26, 2026
10 checks passed
@norrietaylor
norrietaylor deleted the spec/ssh-host-key-in-beacon-3c4d22af94a3a068 branch June 26, 2026 06:13
@gominimal-aw-bot

Copy link
Copy Markdown
Contributor Author

sdd-validate findings — spec boundary

Resolved boundary: Spec (file added: docs/specs/06-spec-ssh-host-key-in-beacon/06-spec-ssh-host-key-in-beacon.md)
Fast-path: yes (light spec, ADR 0024 — no architecture record required)


Gate 1 — Acceptance criteria testable ✅

All R-IDs (R1.1, R1.2, R2.1–R2.5) state observable outcomes. No finding.

Gate 2 — No implementation leakage ⚠️ Warning

docs/specs/06-spec-ssh-host-key-in-beacon/06-spec-ssh-host-key-in-beacon.md:85–87

R2.5 — russh is promoted from [dev-dependencies] to [dependencies] in minvmd/Cargo.toml so the production code can call russh::keys::known_hosts::learn_known_hosts_path.

This R-ID names a specific build file (minvmd/Cargo.toml), specific Cargo manifest sections ([dev-dependencies][dependencies]), and a fully-qualified function path. Where a behavioral statement belongs — e.g. "the SSH key-parsing library is available to production code in minvmd" — the R-ID instead prescribes the mechanism. Warning per spec gate 2.

All other R-IDs are clean. R2.2's "using the same known-hosts API path" is a consistency constraint whose primary content is behavioral; below the 80% confidence floor for a Warning.

Gate 3 — Assumptions explicit ✅

The instance-0 assumption, the marker socket as the sole synchronization point, the XDG_STATE_HOME path derivation, and the port-22 / local-0 hostname mapping are all stated in Context or Design Considerations. No finding.

Gate 4 — Proof artifacts present and behavioral ✅

  • Unit 1: one Test artifact. States "does not pass against the current single-line implementation" — passes the empty-PR rule.
  • Unit 2: one Test artifact ("cannot pass against the current single-line reader") and one File artifact (known_hosts would not exist on the current code). Both pass the empty-PR rule.

Gate 5 — Demoable unit sized to a reviewable PR ✅

Unit 1 (guest-side beacon emission) and Unit 2 (host-side key reception) are separated by a real producer/consumer dependency edge — Unit 2 reads what Unit 1 emits. This exempts the pair from the under-sizing check. No finding.


Summary: 1 Warning, 0 Blockers. Spec boundary passes clean; no needs-human hand-off required.

Generated by sdd-validate for issue #579 ·

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.

spec: feat(minvmd): include SSH host public key in the ready beacon

1 participant