How it's built
Engineering
strop is written in Rust. The closer a piece of code is to the edit itself, the harder it is checked: the innermost part is proved, the keys are compared against Neovim, and the rest is tested as behaviour you can see. This page is the short, honest version of each.
The edit kernel is proved in Lean
One small crate, strop-kernel, decides how positions move when text changes: where a cursor, a mark or a selection ends up after an edit, and which batches of edits are safe to apply together. It has no dependencies and does no input or output.
That crate is translated to Lean 4 by Charon and Aeneas, and the theorems are proved about the translation of the code that ships, not about a model written by hand. In plain words they say:
- a position mapped through an edit stays inside the text and lands where the definition says it should;
- two positions keep their order through an edit, so a selection never turns inside out;
- mapping through a batch of edits is the same as mapping through each edit in turn;
- a batch the validator accepts really is sorted and non-overlapping;
- the counters that tell a stale handle from a live one advance as specified.
The required theorems, read from proofs/Audit.lean at v0.80.0:
- admission_resource_exact
- admission_stamp_exact
- admission_origin_exact
- admission_authorized_producer
- admit_live_answer
- refresh_settles_only_captured
- deepest_boundary
- candidate_hints_only_prioritize
- settle_certifies_verified_walk
- workspace_all_and_loose
- vacant_spec
- holds_spec
- find_spec
- retire_spec
- find_after_retire
- touch_spec
- selects_spec
- victim_spec
- place_spec
- total_cost_le
- placed_bounded
- placed_entries
- find_after_place
- place_evicts_oldest
- map_position_spec
- mapSpec_monotone
- mapSpec_in_bounds
- validate_batch_spec
- map_through_edits_spec
- map_through_edits_monotone
- map_through_edits_composition
- consecutive_of_batchOk
- map_span_spec
- map_span_keeps_order
- keep_disjoint_spec
- admits_spec
- source_edit_spec
- toSource_in_span
- source_edit_commutes
- next_generation_spec
- index_for_len_spec
- project_spec
- cover_spec
- uncover_spec
- replace_window_spec
- clip_spec
- minimum_spec
- total_spec
- share_spec
- tile_spec
- tile_in_bounds
- tile_exact
- tile_minimum
- tile_fair
- tile_fair_leaves
- runs_spec
- runs_coherent
- coherent_spec
- span_spec
- old_line_spec
- new_line_spec
- old_span_spec
- kept_respects_regions
- Viewport
- Viewport
- Viewport
- Viewport
- Viewport
- Viewport
- Viewport
- Rank
- Rank
- Rank
- merge_sorted
- merge_covers
- merge_apart
- merge_primary
- merge_fixed
- merge_batch
- offsets_spec
- offsets_agrees
- offsets_landing
- piece_own
- piece_whole
- innermost_holds
- innermost_least
- innermost_none
- Tabline
- Tabline
- map_span_closed_spec
- map_span_closed_keeps_order
- sign_row_spec
- Viewport
- Viewport
- Viewport
- Viewport
- Viewport
- Viewport
- Viewport
- Viewport
- Indent
- Indent
- Indent
- Indent
- Indent
- Indent
- Indent
- Indent
- Indent
- Indent
- Indent
- Indent
Two things keep the proofs from being decoration. Each theorem has a mutant: a deliberately broken copy of the code that must make its proof fail, or the gate fails. And an audit lists the axioms every theorem depends on and accepts only Lean's standard three.
What this does not cover. Everything outside that crate: the Vim grammar, rendering, files, git, language servers, SSH. A proved kernel means cursors and marks do not drift or go out of bounds when text changes. It does not mean the editor has no bugs.
The proofs · The kernel crate · The foundation RFC
The keys are compared against Neovim
Whether d2aw does the right thing is not a matter of opinion: Neovim already answers it. A test harness types the same keys into strop and into Neovim started with no configuration, then compares the final text, cursor, mode and registers.
As of 0.59 the corpus is about 4,000 sequences. Most are generated: every operator with every motion and text object, with and without a count, in Normal, in Visual and repeated with .. The rest are written by hand, including every case somebody once got wrong and the : commands.
A difference is a bug until it has a written reason. There are 18 such cases today, in four groups: keys that are missing, keys strop uses for something else, smart-case search, and one inherited edge case. A listed case that starts agreeing again fails the run until it is taken off the list. The lists are on Coming from Neovim.
What this does not cover. Only what a headless Neovim can be asked: editing commands on a buffer. Screen drawing, the finder, search, git and language servers have no Neovim answer to compare with.
The rest is tested as behaviour
- Screens. The cells of each surface are recorded and compared in tests, so a change to how something looks shows up as a diff.
- Remote editing. The SSH tests run against a real
sshd, not a stand-in. - Concurrent parts. Property tests, and Loom where ordering between threads matters.
- Speed. A keystroke never waits for the disk, git or a language server: those run in the background and report back.
strop benchtimes the finder and project search on a 100,000-file tree, and a result over budget fails. The fuzzy matcher was chosen by measurement; the measurements are in the original decision record.
A test stays in the repository only if it is a proof about shipped code, a test of something a user can see, or a checker that has caught a real bug.
Release gates
A release is done when it is publicly installable, not when a tag is pushed. Every gate blocks; one that could fail without stopping a release is deleted instead.
- Qualification. On a clean checkout of the exact commit: tests, the comparison against Neovim, the model checks and the Lean proofs all pass, and the static binary is built and smoke-tested.
- Publication. That same artifact, not a rebuild, goes to GitHub with its checksum.
- Installation.
install.shis run against the public download into an empty directory, and the installedstrop --versionmust report the new version. - This site. It is rebuilt from the released source, and the frames on the front page are captured again from the released binary.
The working rules · RFC tracking issues · Release milestones · Changelog