Remaining slice of WF-0154 (#267). Undo/redo already submits Echo replacement edits (spec-proven); this slice makes them named so :why and history surfaces explain reversals instead of showing anonymous replacements.
Verified seam map (from WF-0154 investigation)
u/ctrl+r detection: isNormalModeHistoryKey (src/app/workspace/viewer-key.ts:397); the history plan funnels through queueProductionTextPlan(..., WorkspaceTextPendingCommandKinds.Vim) — undo is currently tagged as a generic Vim pending command.
WorkspaceTextPendingCommandKinds (src/app/workspace/workspace-text-authority.ts:61) has only Vim; five viewer-key.ts signatures annotate the param as typeof WorkspaceTextPendingCommandKinds.Vim and need widening to WorkspaceTextPendingCommandKind.
- Provenance events are only created for vim-chord edits:
plannedCommandEventForQueuedEdit (viewer-key.ts:~450) requires editor.lastVimEdit, and createJeditCommandEvent parses chord syntax — u is not a chord, so undo produces no event.
- The event union is strictly
'vim' | 'rejected' (src/app/workspace/command-provenance.ts:59,77); lastCommandEvent: JeditCommandEvent threads through workspace-text-authority.ts:108,139,260 and jedit-command-event-observation.ts:32. Adding an 'undo'/'redo' event kind touches all of these.
- command-provenance.ts is at 492/500 lines — the quality gate forces a file split as part of this slice.
- Settlement naming:
settlementPayload (src/app/workspace/workspace-text-wsc-settlement.ts:33) records commandKind: request.kind (insert/replace/delete). Add an additive provenanceKind field ('undo' | 'redo') threaded from the pending command kind; keep the existing kind vocabulary valid (restart round-trip spec guards recovery).
Acceptance (from docs/design/0154-e-brake-absurdity-fixes.md)
- RED-first: provenance spec proves an undo settlement is named with a reference to the reversed transition, and
:why explains it; redo likewise.
- History listing JSON exposes the naming (agent-facing surface).
- Existing envelope consumers stay compatible (additive fields only).
Remaining slice of WF-0154 (#267). Undo/redo already submits Echo replacement edits (spec-proven); this slice makes them named so
:whyand history surfaces explain reversals instead of showing anonymous replacements.Verified seam map (from WF-0154 investigation)
u/ctrl+rdetection:isNormalModeHistoryKey(src/app/workspace/viewer-key.ts:397); the history plan funnels throughqueueProductionTextPlan(..., WorkspaceTextPendingCommandKinds.Vim)— undo is currently tagged as a generic Vim pending command.WorkspaceTextPendingCommandKinds(src/app/workspace/workspace-text-authority.ts:61) has onlyVim; fiveviewer-key.tssignatures annotate the param astypeof WorkspaceTextPendingCommandKinds.Vimand need widening toWorkspaceTextPendingCommandKind.plannedCommandEventForQueuedEdit(viewer-key.ts:~450) requireseditor.lastVimEdit, andcreateJeditCommandEventparses chord syntax —uis not a chord, so undo produces no event.'vim' | 'rejected'(src/app/workspace/command-provenance.ts:59,77);lastCommandEvent: JeditCommandEventthreads throughworkspace-text-authority.ts:108,139,260andjedit-command-event-observation.ts:32. Adding an'undo'/'redo'event kind touches all of these.settlementPayload(src/app/workspace/workspace-text-wsc-settlement.ts:33) recordscommandKind: request.kind(insert/replace/delete). Add an additiveprovenanceKindfield ('undo' | 'redo') threaded from the pending command kind; keep the existing kind vocabulary valid (restart round-trip spec guards recovery).Acceptance (from docs/design/0154-e-brake-absurdity-fixes.md)
:whyexplains it; redo likewise.