feat: ADR-0034 — history journal records err + replay parses/filters the journal
Replay (§3): run_replay parses <ts>|<status>|<source> journal records — runs ok, skips non-ok — while still accepting bare .commands scripts (prefix-detected so a | inside a bare command isn't misread). Fixes replay history.log, which died on line 1. Journal failures (§1/§2): failed commands are recorded err via a new Action::JournalFailure, emitted by the pure-sync App for both parse failures and worker-execution failures (runtime appends best-effort, never fatal). Hydration reads all records so typo'd/rejected commands are recallable across sessions. Amendment 1 — replay filters app-lifecycle commands: a working replay history.log exposed that the journal also records save as/load/new/export/import/rebuild/mode (which would panic the worker dispatch or abort replay). Replay now re-applies only schema/data writes and skips every app-lifecycle command + nested replay, classified by entry word so modal/incomplete forms (save as, bare mode) and quit skip uniformly rather than aborting. All skips continue (reversing the nested-replay refusal); import and nested replay warn. replay.error_nested removed; replay.skipped_import/_replay added; ReplayCompleted carries warnings. requirements.md U3/U4 updated; app-command runtime-failure journalling tracked as a follow-up. 1659 passing / 0 failing / 0 skipped / 1 ignored. Clippy clean.
This commit is contained in:
+6
-4
@@ -81,9 +81,11 @@ fn simple_mode_select_yields_sql_hint_and_does_not_dispatch() {
|
||||
assert_eq!(app.mode, Mode::Simple);
|
||||
type_str(&mut app, "select * from anywhere");
|
||||
let actions = submit(&mut app);
|
||||
// The failed simple-mode submission is journalled `err`
|
||||
// (ADR-0034) but dispatches no command.
|
||||
assert!(
|
||||
actions.is_empty(),
|
||||
"simple-mode `select` must not produce a dispatch action; got {actions:?}",
|
||||
matches!(actions.as_slice(), [Action::JournalFailure { .. }]),
|
||||
"simple-mode `select` must not dispatch (only journal err); got {actions:?}",
|
||||
);
|
||||
// The error output spans multiple lines (the message and a
|
||||
// caret pointer). The hint catalog key
|
||||
@@ -135,8 +137,8 @@ fn advanced_mode_select_from_internal_table_is_rejected() {
|
||||
type_str(&mut app, "select * from __rdbms_playground_columns");
|
||||
let actions = submit(&mut app);
|
||||
assert!(
|
||||
actions.is_empty(),
|
||||
"internal-table reference must not dispatch; got {actions:?}",
|
||||
matches!(actions.as_slice(), [Action::JournalFailure { .. }]),
|
||||
"internal-table reference must not dispatch (only journal err); got {actions:?}",
|
||||
);
|
||||
let error_text: String = app
|
||||
.output
|
||||
|
||||
Reference in New Issue
Block a user