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
+44
View File
@@ -118,6 +118,50 @@ pub const KEYS_AND_PLACEHOLDERS: &[(&str, &[&str])] = &[
"error.type_mismatch.update.hint",
&["table", "column", "expected_type"],
),
// ---- Parse error rendering ----
("parse.caret", &["padding"]),
("parse.empty", &[]),
("parse.error", &["detail"]),
// ---- Project lifecycle event notes ----
("project.export_failed", &["error"]),
("project.export_ok", &["path"]),
("project.export_usage", &[]),
("project.import_empty_target", &[]),
("project.import_usage", &[]),
("project.rebuild_failed", &["error"]),
("project.rebuild_ok", &["summary"]),
("project.switch_failed", &["error"]),
("project.switched_ok", &["display_name"]),
// ---- mode / messages banners ----
("messages.set_short", &[]),
("messages.set_verbose", &[]),
("messages.show", &["current"]),
("messages.unknown", &["value"]),
("mode.set_advanced", &[]),
("mode.set_simple", &[]),
("mode.show_advanced", &[]),
("mode.show_simple", &[]),
("mode.unknown", &["value"]),
("mode.usage", &[]),
// ---- DSL command success summaries (ADR-0019 §9 sweep) ----
("ok.rows_deleted", &["count"]),
("ok.rows_inserted", &["count"]),
("ok.rows_updated", &["count"]),
("ok.summary", &["verb", "subject"]),
// ---- Client-side success notes (ADR-0017 §6, ADR-0018 §9) ----
("client_side.auto_fill_add_serial", &["count"]),
("client_side.auto_fill_add_shortid", &["count"]),
("client_side.auto_fill_transition", &["count", "kind"]),
("client_side.transformed", &["count"]),
("client_side.transformed_lossy", &["count", "lossy"]),
// ---- Replay command surfaces (ADR-0019 §9 sweep) ----
("replay.command_echo", &["command"]),
("replay.completed", &["path", "count"]),
("replay.error_could_not_open", &["path", "detail"]),
("replay.error_nested", &[]),
("replay.error_parse", &["detail"]),
("replay.failed_at_line", &["path", "line_number", "error"]),
("replay.failed_open", &["path", "error"]),
// ---- UNIQUE violations (anchor: "already has the value") ----
(
"error.unique.insert.headline",