feat(seed): SeedResult outcome, capped preview, advisory, count cap (ADR-0048 P1.3c)

A dedicated SeedResult replaces the borrowed insert outcome (X5):
- CommandOutcome::Seed + DslSeedSucceeded event + handle_dsl_seed_success
  render: the echo, "N row(s) seeded into T", a capped preview table
  (D18, first 20 rows; full count always reported), and a Hint-styled
  advisory naming enum-ish / un-derivable-CHECK columns filled with
  generic text (D12/D13, Phase-1 wording).
- SeedResult carries requested vs produced, so a junction cap is now
  reported to the user, not only logged.
- Count cap (D6): a seed over 10000 rows is refused with a friendly error.
- Catalog keys ok.rows_seeded / seed.capped / seed.advisory_generic.

4 new tests (advisory flag, IN-check not flagged, preview cap, excess
count). 2346 pass / 0 fail / 0 skip, clippy clean.
This commit is contained in:
claude@clouddev1
2026-06-11 19:11:18 +00:00
parent 9c135010ba
commit 0b3ab3cc13
7 changed files with 191 additions and 32 deletions
+7 -4
View File
@@ -1492,6 +1492,10 @@ fn spawn_dsl_dispatch(
command: command.clone(),
result,
},
Ok(CommandOutcome::Seed(result)) => AppEvent::DslSeedSucceeded {
command: command.clone(),
result,
},
Ok(CommandOutcome::Update(result)) => AppEvent::DslUpdateSucceeded {
command: command.clone(),
result,
@@ -2364,6 +2368,7 @@ enum CommandOutcome {
ShowRelationship(Option<Box<crate::db::RelationshipDiagramData>>),
QueryPlan(QueryPlan),
Insert(InsertResult),
Seed(crate::db::SeedResult),
Update(UpdateResult),
Delete(DeleteResult),
ChangeColumn(ChangeColumnTypeResult),
@@ -2911,9 +2916,7 @@ async fn execute_command_typed(
.insert(table, columns, values, src)
.await
.map(CommandOutcome::Insert),
// ADR-0048 (SD1). Phase 1 reuses the insert outcome for the
// auto-show; a dedicated `SeedResult` (capped preview +
// enum/CHECK advisory) replaces this in a later phase.
// ADR-0048 (SD1).
Command::Seed {
table,
count,
@@ -2921,7 +2924,7 @@ async fn execute_command_typed(
} => database
.seed(table, count, rng_seed, src)
.await
.map(CommandOutcome::Insert),
.map(CommandOutcome::Seed),
Command::Update {
table,
assignments,