Skip to content

WF-0154 Slice 1: name undo/redo settlements as reversals in provenance #269

Description

@flyingrobots

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).

Activity

  1. coderabbitai commented on Jul 13, 2026

    @coderabbitai
    🔗 Related PRs

    #120 - Feat: add Vim normal state machine [closed]
    #122 - Add Vim power move execution [closed]
    #193 - docs: lock Jim roadmap evidence slices [merged]
    #195 - Add honest why observation coordinates [merged]
    #198 - Fix rapid typing and save sequencing regressions [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added
    causal-ropeCausal rope text authority roadmap
    enhancementNew feature or request
    sliceImplementable roadmap slice
    text-authorityText authority and storage invariants
    on Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    causal-ropeCausal rope text authority roadmapenhancementNew feature or requestsliceImplementable roadmap slicetext-authorityText authority and storage invariantswork-in-progressCycle or PR is intentionally in progress and not ready to merge

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions