claude@clouddev1
437b2f2e91
walker: flag LIKE on a numeric column (ADR-0027 Amendment 1)
...
LIKE is a text-pattern match; against a numeric column (int,
real, decimal, serial) it runs but is almost never intended.
predicate_warnings now emits a WARNING for it, spanned at the
target column. New Type::is_numeric; catalog key
diagnostic.like_numeric; ADR-0027 gains "Amendment 1" and the
adr/README index line is updated per the index-upkeep rule.
bool and the text-/blob-backed types are deliberately not
flagged — see the amendment for the rationale.
3 walker tests (int, decimal NOT LIKE, text-column clean).
1108 passing, clippy clean.
2026-05-19 09:28:43 +00:00
claude@clouddev1
1e06490572
round-5 follow-up: completion + i18n sweep
...
Four user-reported gaps from the round-4 testing pass:
1. Empty-prompt hint reworded from "(no active hint)" to
"Type a command — press Tab for options, `help` for a
list" (6 snapshots updated to reflect 80-col truncation).
2. App-lifecycle commands (quit/q, help, rebuild, save/save as,
new, load, export, import, mode, messages) now flow through
the DSL parser:
- 15 new keywords + catalog token entries
- new Command::App(AppCommand) AST with 11 variants
- parse-first dispatch in submit() (app commands work in
both simple and advanced modes)
- pre-chumsky source-slice for `export <path>` /
`import <zip> [as <target>]` mirrors the replay precedent
- UsageEntry registry entries so parse errors surface
relevant usage templates
- `mode <bad>` / `messages <bad>` use try_map for the
friendly "unknown mode/messages" wording
3. DSL completion gaps:
- `1:n` surfaces as a composite candidate at `add `
- --all-rows / --create-fk / --force-conversion /
--dont-convert surface as new CandidateKind::Flag
candidates (coloured with tok_flag in hint panel)
- filter_clause .labelled() wrap removed so chumsky's
expected-set surfaces the constituent options
4. Hardcoded user-facing strings migrated to catalog:
- 4 parser custom errors (incl. the known "tables need at
least one column" wart)
- UnknownType Display now via parse.custom.unknown_type
- UI panel titles + mode labels (Output / Hint / SIMPLE /
ADVANCED / Advanced:)
- app.rs cascade rendering (action labels + summary)
- runtime --resume CLI stderr
- db.rs change-column diagnostic tables (7 headers + 3
wrapper summaries + force-conversion hint)
Tests: 765 → 769 passing, 0 failed, 1 ignored (same doctest
as before). Clippy clean with -D warnings.
Deferred:
- ~25 thiserror #[error] attributes still hand-rolled
(DbError, ArgsError, ArchiveError, PersistenceError,
LockError). Tracked separately.
- DSL/SQL relationship in advanced mode — clarified
implicitly via parse-first dispatch; broader ADR
amendment to follow.
- Post-complete-parse completion gap (e.g. `save ` Tab
can't offer `as` because `save` parses bare; same shape
as `--create-fk` after a complete `add relationship`).
2026-05-13 15:58:29 +00:00
claude@clouddev1
c1e52920eb
DSL parser, async DB worker, types, history, metadata, polish
...
Track 1 implementation plus polish round.
Parser (chumsky):
- Grammar-based DSL producing a typed Command AST.
- create table X with pk [name:type[,name:type...]] supports
arbitrary names, any user type, compound PKs natively. Bare
form errors with a friendly hint pointing at `with pk`.
- add column to table X: Name (type); drop table X.
- Required clauses use keyword grammar; -- reserved for opt-in
flags (ADR-0009). Custom Rich reasons preferred when surfacing
chumsky errors so unknown-type messages list valid alternatives.
Database (ADR-0010, ADR-0012):
- rusqlite + STRICT tables + foreign_keys=ON.
- Dedicated worker thread; mpsc Request inbox, oneshot replies.
- Typed DbError with friendly_message() hook for H1.
- Internal __rdbms_playground_columns metadata table preserves
user-facing types across schema reads, atomically maintained
alongside DDL via Connection transactions. list_tables hides
it via the new __rdbms_ internal-table convention.
Types (ADR-0005, ADR-0011):
- All ten user-facing types: text, int, real, decimal, bool,
date, datetime, blob, serial, shortid.
- Type::fk_target_type() for FK-side column-type rule
(Serial->Int, ShortId->Text, others identity) -- foundation
for the FK iteration.
App / Runtime / UI:
- update() stays pure-sync; runtime dispatches DSL via spawned
tasks, results post back as AppEvent::Dsl*.
- Items panel renders live tables list; output panel shows the
user-facing structure of the current table after each DDL.
- In-memory command history (Up/Down, draft preservation,
consecutive-duplicate dedup) -- I2 partial.
- Mouse capture removed; terminal native text selection
restored (toggle approach revisited when scroll/click
features land).
Docs:
- ADRs 0009 (DSL syntax conventions), 0010 (DB worker),
0011 (FK type compat), 0012 (internal metadata table).
- requirements.md progress notes; new V4 entry for the
scrollable session-log + inline rich rendering + Markdown
export direction.
Tests: 103 passing (91 lib + 12 integration), 0 skipped.
Clippy clean with nursery enabled.
2026-05-07 13:32:19 +00:00