ADR-0019 §9 sweep (1/2): replay/client_side/ok/mode/messages/project/parse

First half of the catalog migration sweep. Six categories of
user-visible literals moved from inline `format!` calls to the
i18n catalog via `t!()`:

- **replay.*** — `[ok] replay … N command(s) run`,
  `replay … failed at line N: …`, the `> command` echo, and
  the inner `could not open` / `parse error` / `nested replay`
  wordings the runtime constructs inside `ReplayFailed.error`.
- **client_side.*** — the four [client-side] pedagogical notes
  from ADR-0017 §6 / ADR-0018 §9 (transformed,
  transformed_lossy, auto_fill_transition,
  auto_fill_add_serial, auto_fill_add_shortid). The
  `format_auto_fill_add_note` helper in db.rs now routes via
  the catalog too.
- **ok.*** — the `[ok] {verb} {subject}` summary header
  (consolidated through a new `App::note_ok_summary` helper)
  plus the per-operation row-count footers
  (`{count} row(s) inserted/updated/deleted`).
- **mode.*** — `mode: simple/advanced` set/show banners +
  `usage: mode …` + `unknown mode '{value}' …` errors.
- **messages.*** — `messages: short/verbose` set/show + the
  `unknown messages mode` error.
- **project.*** — `[ok] rebuild — {summary}`, `[ok] now
  editing: {display_name}`, `[ok] export — wrote {path}`, plus
  matching failure variants and the `usage: export/import`
  + `import: empty target after as` argument-parsing errors.
- **parse.*** — the `parse error: {detail}` wrapper around
  chumsky's structural output, the `{padding}^` caret pointer,
  and the `empty input` fallback for `ParseError::Empty`.

Catalog total: 99 lines of YAML across the new categories,
44 new entries declared in `keys.rs::KEYS_AND_PLACEHOLDERS`.
The validator (`keys_validate_against_catalog`) walks the
expanded list and confirms placeholder coverage / no format
specifiers / no engine vocabulary across every entry.

Anchor phrases (ADR-0019 §10) preserved verbatim; existing
substring assertions in the test suite hold.

## Tally

610 tests passing (no change in count — pure refactor).
Clippy clean with nursery lints. Release builds.

## Still ahead in the sweep

- Sweep 7: HELP_TEXT (CLI banner) + in-app `note_help` —
  large multi-line blocks.
- Sweep 8: modal labels (load picker, rebuild confirm,
  save-as path entry) + any remaining strays. Final pass.

Both shipping in a follow-up commit so this checkpoint
stays reviewable.
This commit is contained in:
claude@clouddev1
2026-05-09 22:20:34 +00:00
parent 431645ae60
commit aff528aa3f
5 changed files with 240 additions and 86 deletions
+7 -3
View File
@@ -1355,7 +1355,11 @@ pub async fn run_replay(
path: path.to_string(),
line_number: 0,
command: String::new(),
error: format!("could not open `{}`: {e}", resolved.display()),
error: crate::t!(
"replay.error_could_not_open",
path = resolved.display(),
detail = e
),
});
return events;
}
@@ -1378,7 +1382,7 @@ pub async fn run_replay(
path: path.to_string(),
line_number,
command: trimmed.to_string(),
error: format!("parse error: {e}"),
error: crate::t!("replay.error_parse", detail = e),
});
return events;
}
@@ -1394,7 +1398,7 @@ pub async fn run_replay(
path: path.to_string(),
line_number,
command: trimmed.to_string(),
error: "nested `replay` is not allowed inside a replay file".to_string(),
error: crate::t!("replay.error_nested"),
});
return events;
}