feat: DSL→SQL teaching echo — Phase 3 cat-3 caveat (ADR-0038)

Lands the only piece of category-3 prose not already covered by the
existing `client_side.*` notes infrastructure: the `change column …
--dont-convert` *caveat* (ADR-0038 §6, the only Bucket A caveat —
every other category-3 line is illuminating).

`--dont-convert` skips the client-side layer entirely, so the headline
SQL echo (`ALTER TABLE … SET DATA TYPE …`) is the nearest SQL but
*not* equivalent: running the line in advanced mode would convert the
stored values, but the playground left them as-is. The new caveat
states that divergence explicitly.

* New i18n key `client_side.dont_convert_caveat` (no placeholders) —
  registered in keys::KEYS_AND_PLACEHOLDERS.
* New `dont_convert_caveat: bool` field on DslChangeColumnSucceeded,
  set in the runtime when submission_mode is advanced *and* the
  command is ChangeColumnType { mode: DontConvert, .. }. Gated on
  advanced mode because the caveat references "the line above" — the
  echo, which only fires in advanced mode.
* App's handle_dsl_change_column_success emits the caveat line
  between the existing client-side notes and the structure render,
  so it reads alongside the echo, not after the table view.

The other two category-3 lines from §6 (shortid generation,
type-conversion transforms) were already in place via
`client_side.auto_fill_*` / `client_side.transformed*` — those notes
already render after the echo via handle_dsl_add_column_success /
handle_dsl_change_column_success, in the right position per the ADR.
This commit just adds the missing caveat.

Tests: 2014 passed / 0 failed / 1 ignored (pre-existing); clippy
clean. An App-level test pins the rendering order (caveat sits
after the echo, before the structure) and the simple-mode gate
(no caveat without an echo to refer to).

The §4 de-emphasised styled-runs rendering polish remains —
the echo + caveat lines are still plain `[system]` lines.
This commit is contained in:
claude@clouddev1
2026-05-28 08:50:08 +00:00
parent 275c726ad4
commit e6ad1aec3d
5 changed files with 130 additions and 8 deletions
+8 -2
View File
@@ -100,9 +100,15 @@ pub enum AppEvent {
command: Command,
result: ChangeColumnTypeResult,
/// The DSL → SQL teaching echo (ADR-0038): `ALTER TABLE T ALTER
/// COLUMN c SET DATA TYPE …`. `None` in simple mode. (The
/// `--dont-convert` caveat line is category-3, a later slice.)
/// COLUMN c SET DATA TYPE …`. `None` in simple mode.
echo: Option<Vec<String>>,
/// The `--dont-convert` caveat (ADR-0038 §6 category 3): set by the
/// runtime to `true` when the command ran with
/// `ChangeColumnMode::DontConvert` in an advanced effective mode
/// (the only case where it is meaningful — the line references
/// "the line above," i.e. the echo). The App renders the prose
/// caveat between the existing client-side notes and the structure.
dont_convert_caveat: bool,
},
/// An `add column …` succeeded. `result` carries the
/// post-add description plus any `[client-side]` notes