Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

vim: provide the full ncurses-backed editor - #36

Merged
brandonpayton merged 1 commit into
mainfrom
migrate/vim-cli
Jul 17, 2026
Merged

vim: provide the full ncurses-backed editor#36
brandonpayton merged 1 commit into
mainfrom
migrate/vim-cli

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 11, 2026

Copy link
Copy Markdown
Member

Why

Kandelo users need a full-screen editor from the normal Homebrew path, including terminal handling, timers, dynamic loading, shell commands, the familiar vi entry point, and xxd. Without a first-class Vim Formula, VFS images and in-guest installs still have to rely on the older Kandelo package path.

A reduced editor binary would not prove the Ncurses, process, timer, and dynamic-module behavior that real Vim uses. This Formula keeps the complete supported editor surface and tests those boundaries directly.

What changed

  • Build Vim 9.2.0750 for wasm32 with normal features, multibyte, channel, terminal, terminfo, POSIX search timeouts, and functional +libcall.
  • Link the declared Ncurses target dependency through its exact installed keg while compiling stable guest opt identities.
  • Link the SDK's functional -ldl glue instead of musl's weak dlfcn stubs; the Formula test builds, loads, and calls a real Wasm side module.
  • Require configure to select HAVE_TIMER_CREATE, HAVE_DLOPEN, and HAVE_DLSYM.
  • Install the full Vim runtime and documentation, canonical vi aliases, manpages, and the separately linked xxd executable.
  • Stage Dash only as the guest /bin/sh used by the shell-escape test.
  • Apply complete fork instrumentation to Vim and verify xxd is correctly fork-free.
  • Reject ABI mismatch, legacy Asyncify, incomplete fork exports, host paths, and guest Cellar identities.

The shell-escape test requires exactly one successful Dash descendant. This catches both missing process creation and accidental double-spawn behavior.

This PR contains no bottle block, archive, sidecar, receipt, provenance metadata, generated Wasm artifact, platform change, or Kandelo ABI change.

Exact source state

  • Tap base: d48935cc15909439b6542c1cb737b8ce4da0ca6c
  • Exact PR head: 25f6db6093d77f810306f4f51700e548b39aa6d5
  • Exact PR tree: e48e1873c7a3e6a5bc328cb7c9f34801673f3351
  • Formula blob: 82641ca56483f8f05fb552ee16609a44e7831958
  • Formula SHA-256: 8c7ee87ab9a4a06b6945ebd469c344d605582447ef9843eaa16e730b46719327
  • Formula-only stable patch ID: c9860cdfa1119d00a0511c7fa5c07a7515936d79
  • Direct target dependency: Ncurses
  • Transitive target dependency: Libcxx
  • Dash is test-only; Binaryen and WABT are build/test tools.

The branch was restacked after the publisher trust rollout. git range-diff proves the single Vim patch is identical to accepted head a6b4a7e6...; only its parent and commit identity changed. Authorship remains Brandon Payton's.

Evidence

Fresh checks on this exact restacked head passed:

  • Ruby syntax for Formula/vim.rb
  • tap trust parser and wrapper
  • canonical Formula source-closure validation through scripts/dev-shell.sh
  • direct runtime closure: Ncurses only
  • full runtime closure: Libcxx and Ncurses
  • git diff --check
  • exact git range-diff against the pre-restack head

The byte-identical Formula patch had already passed Homebrew style, 48 Formula-support tests / 380 assertions, and 15 TypeScript runner-support tests. The independent content review accepted its one-descendant shell assertion and dependency classification. An independent exact-head restack review accepted this head, including patch equivalence, authorship, dependency closure, process-count semantics, timer claim scope, and exact metadata.

The merged Kandelo timer fixture covers callback delivery on the platform path. This Formula's own timer checks cover Vim's configure selection plus timer creation, arming, and disarming; it does not misrepresent those checks as a separate callback-delivery proof.

The old ABI 18 Vim build is diagnostic recipe evidence only. No current ABI 41 Vim build, bottle, stock Homebrew pour, VFS image, Node.js run, or Chromium run is claimed here.

Remaining publication gates

The source Formula can merge independently. Publication must then proceed in dependency order: Libcxx, Ncurses, and Vim. Each bottle needs public GHCR readback and stock Homebrew pour evidence before it is used in a VFS image.

The trusted d26c2f69... publisher is active. The current ABI 41 pilot bottle run is validating zlib, bzip2, xz, and sqlite first; Vim remains a later leaf package and must not distract from that integration gate.

@brandonpayton
brandonpayton force-pushed the migrate/ncurses-dependency-root branch from a6e58d2 to 23f0533 Compare July 11, 2026 21:35
@brandonpayton
brandonpayton force-pushed the migrate/ncurses-dependency-root branch from 23f0533 to 93567f2 Compare July 11, 2026 22:55
@brandonpayton
brandonpayton force-pushed the migrate/vim-cli branch 2 times, most recently from b3d49f4 to 9c06150 Compare July 12, 2026 00:25
@brandonpayton
brandonpayton changed the base branch from migrate/ncurses-dependency-root to main July 12, 2026 00:26
@brandonpayton
brandonpayton force-pushed the migrate/vim-cli branch 2 times, most recently from 9cc9749 to 1552539 Compare July 12, 2026 08:55
@brandonpayton

Copy link
Copy Markdown
Member Author

Independent devil review at exact head 1cb47a846bc0480e865a8a515810a64ca2463b75: ACCEPT for source merge after #882.

The correction loads shared support from the installed tap and replaces the pre-#70 hand-written shell guard with kandelo_validate_wasm_artifact(..., fork: :required) on the exact src/vim bytes that upstream installation receives. The shared validator requires the real kernel_fork import and complete continuation exports, rejects legacy Asyncify and ABI ambiguity, and adds staging/host-path rejection. Binaryen and WABT remain explicit build dependencies.

Fresh evidence through scripts/dev-shell.sh: Ruby syntax passed; Homebrew style found no offenses; shared Formula support passed 30 runs / 221 assertions; git diff --check passed. Formula SHA-256 is c7616bd27891e600b8cb5c5f4953bd83b7588eaa17216e52d4259e83d7edce38 and the worktree is clean.

No exact-head source build, runtime suite, bottle, or pour is claimed. #882 and the documented platform/publication gates remain binding.

@brandonpayton

Copy link
Copy Markdown
Member Author

Independent corrected-head review: ACCEPT for 76b8c49cbcfdbf7b38da177e3ef50e5d345b5ec6.

The review verified current tap-main ancestry, generic-before-exact prefix-map ordering, separate fail-closed validation of xxd, ABI 18 and fork/Asyncify policy for both installed executables, two-build byte reproducibility, the complete 2,061-file runtime surface, raw rejection of host and guest Cellar paths, full installed-keg tests, strict audit, style, and tap-wide readall. No blocking findings remain in the source candidate. Bottle publication remains gated as described in the PR body.

@brandonpayton

Copy link
Copy Markdown
Member Author

Exact-head devil's-advocate review: ACCEPT

  • head: cc7a063420cb3101b12ed6aced7533546f945f29
  • tree: 88b2cd938afee927a02da0791256a6706c35c635
  • base: c5705667a90b05754d2244a362f3f7fc95d2f9c3
  • Formula SHA-256: d804c229ed725225172e7d2870f88d2598d7743212ee28d4feff07bba2d95aa8

The audit found and corrected two fail-open paths in the prior ABI 18 source
evidence. Vim advertised +libcall while resolving dlfcn calls to musl's weak
stub_dlopen/stub_dlsym; the Formula now links Vim-only EXTRA_LIBS=-ldl
and its test loads and calls a real Wasm side module. Vim's cross configure
probe also assumed SIGEV_THREAD timer creation; the Formula now binds that
cache fact to exact HAVE_TIMER_CREATE output and executes the nonmatching
search(..., timeout) path that creates and disarms the POSIX timer. Exact
guards also require HAVE_DLOPEN and HAVE_DLSYM, and Binaryen is declared
for the test-side compile closure.

Focused evidence run for this head:

  • git diff --check
  • scripts/dev-shell.sh /usr/bin/ruby -c Formula/vim.rb
  • test side-module compile through sdk/bin/wasm32posix-cc -shared -fPIC
  • wasm-objdump -x inspection of dylink.0, bounded imports, and the intended
    kandelo_vim_libcall export
  • source/archive/license and dependency/runtime-closure audit

The dedicated timer fixture in Automattic/kandelo#907 is present at ABI 39
commit bcb02e93817ba757cac3bb4a1666aa46e195193f and is byte-identical to the
standalone timer-fix fixture. Registry Vim staging is not evidence for this
Formula because the registry recipe disables timer_create.

This is not a merge or bottle approval. No current-head ABI 39 source build,
Node Formula run, Chromium run, bottle build, or stock Homebrew pour is
claimed. Keep the PR open until the body-listed platform/publisher gates and
exact ncurses bottle land, then rebuild and validate those paths.

@brandonpayton brandonpayton changed the title vim: add the ncurses-backed editor leaf formula vim: provide the full ncurses-backed editor Jul 17, 2026
Kandelo needs its default tap to own the real editor leaf before VFS images and guest Homebrew installs can stop relying on registry archives.

Add the reviewed Vim source recipe with explicit ncurses, timer, dynamic-loading, fork-instrumentation, runtime, shell-escape, and xxd checks. Document the Formula in the tap inventory.
@brandonpayton

Copy link
Copy Markdown
Member Author

Independent exact-head audit: ACCEPT 25f6db6093d77f810306f4f51700e548b39aa6d5.

The base, tree, Formula blob/SHA, and stable patch ID match the PR description. git range-diff and the aggregate raw diff prove the patch is byte-identical to accepted pre-restack head a6b4a7e6...; Brandon authorship and author date are preserved. Canonical source closure passes, the direct closure is exactly Ncurses, and the full closure is exactly Libcxx plus Ncurses. Both live trust checks are green.

The one-descendant shell assertion matches Vim fork -> Dash exec with builtin printf, and the timer wording correctly limits Formula evidence to configure selection plus create/arm/disarm rather than claiming callback delivery.

@brandonpayton
brandonpayton merged commit 9286977 into main Jul 17, 2026
2 checks passed
@brandonpayton
brandonpayton deleted the migrate/vim-cli branch July 17, 2026 05:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant