help: surface ADR-0017/0018 auto-fill semantics (B1)

ADR-0017 added --force-conversion / --dont-convert as
opt-in flags on `change column`; the help text already
mentioned the flags but didn't explain when they apply.
ADR-0018 generalised serial beyond PK and added auto-fill
on `add column ... (serial|shortid)` for non-empty tables;
none of that was reflected in user-visible help.

This commit:

- Annotates the `add column` line with a continuation note
  that adding serial/shortid to a non-empty table
  auto-fills existing rows.
- Annotates the `change column` line with a continuation
  note that converting to serial/shortid auto-fills null
  cells.
- Appends an "Auto-generated types" section explaining
  serial and shortid: how they auto-fill, that they imply
  UNIQUE outside a PK (serial) or always (shortid), and
  that adding/converting-to either type on a non-empty
  table auto-fills existing/null cells.

The new test
`help_describes_auto_generated_type_behaviour` pins these
phrases so a future help-text edit can't silently drop the
pedagogical lines. The existing
`help_command_lists_supported_commands` and
`help_lists_export_and_import` tests still pass — they
only assert substring presence.

No engine vocabulary leaks (ADR-0002 posture preserved).
536 -> 537 passing, clippy clean.
This commit is contained in:
claude@clouddev1
2026-05-08 14:51:15 +00:00
parent 0d7a7bcd49
commit 3dbaedc1da
2 changed files with 40 additions and 0 deletions
+30
View File
@@ -67,6 +67,36 @@ fn help_command_lists_supported_commands() {
}
}
#[test]
fn help_describes_auto_generated_type_behaviour() {
// ADR-0017 / ADR-0018: the in-app help must surface the
// auto-fill contract for serial / shortid columns and the
// change-column conversion flags. Captured as a regression
// check so a future help-text edit doesn't silently drop the
// pedagogical lines.
let mut app = App::new();
type_str(&mut app, "help");
submit(&mut app);
let body = app
.output
.iter()
.map(|l| l.text.as_str())
.collect::<Vec<_>>()
.join("\n");
for keyword in [
"--force-conversion",
"--dont-convert",
"Auto-generated types",
"auto-filled",
"UNIQUE",
] {
assert!(
body.contains(keyword),
"help output missing `{keyword}`:\n{body}",
);
}
}
#[test]
fn save_on_temp_opens_path_entry_modal() {
let mut app = App::new();