From cf3960186ca704484ac58f996ce41c134e9abcf9 Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Thu, 30 Apr 2026 18:55:46 -0400 Subject: [PATCH] docs(core,cli): document implicit contracts flagged in code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - import_lastpass.rs: note that password and extra are intentionally not trimmed (leading/trailing whitespace is significant for both). - cmd_import_lastpass: document the coupling between the ImportWarning message strings and the CLI summary's "skipped" filter — partial-import warnings (TOTP/URL) must not contain the word "skipped". Comment-only; no behavior change. Catches I1 and M5 from the final code review without taking on the cross-cut WarningKind enum refactor (deferred to a follow-up if it ever ships). Co-Authored-By: Claude Opus 4.7 --- crates/relicario-cli/src/main.rs | 5 +++++ crates/relicario-core/src/import_lastpass.rs | 2 ++ 2 files changed, 7 insertions(+) diff --git a/crates/relicario-cli/src/main.rs b/crates/relicario-cli/src/main.rs index e62e863..6153420 100644 --- a/crates/relicario-cli/src/main.rs +++ b/crates/relicario-cli/src/main.rs @@ -1618,6 +1618,11 @@ fn cmd_import_lastpass(csv_path: PathBuf) -> Result<()> { for w in &warnings { print_warning(w); } + // Counts only true skips, not partial imports. Coupled by convention to + // the parser's warning message strings: skip messages end in "— skipped", + // partial-import messages say "imported without TOTP" / "imported without URL". + // If a future warning uses the word "skipped" in any other sense, this filter + // will need to switch to an enum tag (see ImportWarning::message). eprintln!( "Imported {}, skipped {} (see warnings above)", total, diff --git a/crates/relicario-core/src/import_lastpass.rs b/crates/relicario-core/src/import_lastpass.rs index 5916b34..23f2be4 100644 --- a/crates/relicario-core/src/import_lastpass.rs +++ b/crates/relicario-core/src/import_lastpass.rs @@ -95,6 +95,8 @@ fn map_row( ) -> (Option, Option) { let url = record.get(0).unwrap_or("").trim(); let username = record.get(1).unwrap_or("").trim(); + // password and extra are deliberately NOT trimmed: leading/trailing + // whitespace is significant inside passwords and free-form notes. let password = record.get(2).unwrap_or(""); let totp_raw = record.get(3).unwrap_or("").trim(); let extra = record.get(4).unwrap_or("");