Before submitting
Problem or opportunity
The set of verified Pi hosts is currently known in three places and nothing keeps them in sync:
lib/vim-editor-adapter.ts holds it privately for the identity gate (SUPPORTED_VERSIONS);
extensions/gentle-shell.ts repeats it inside resolveVimRuntime() in the bundled-graph branch;
- and repeats it again in the installed-pair branch.
After #1582 narrowed the list to {"0.99.1"}, an edit that touches only one or two of those sites changes behaviour silently: a host can be admitted by the gate while one resolver path refuses to certify it, or the reverse. The failure mode is quiet — the adapter is designed to fail closed, so a mismatch degrades Vim to ordinary editing instead of reporting the inconsistency.
@dnlrsls suggested this as a smaller follow-up on the superseded #1572 ("the single-source-of-truth refactor for SUPPORTED_VERSIONS, which could go in a smaller follow-up").
Proposed outcome
Export the verified-host list from lib/vim-editor-adapter.ts as the single source of truth, and have both resolveVimRuntime() branches read it instead of restating the versions. No behaviour change: the admitted set stays {"0.99.1"} and every identity proof is untouched (host package name, matching CustomEditor/Editor classes, prototype chain, bundled VERSION).
A unit assertion that the gate and both resolver branches consult the same list would keep the invariant enforced rather than merely documented.
Alternatives considered
- Leaving the three sites duplicated and relying on review. That is the current state, and the drift is silent by design (fail-closed), which is why the inconsistency is worth removing rather than documenting.
- Moving
resolveVimRuntime() into the adapter module. Bigger than needed: the resolver depends on the extension's CustomEditor subclass identity, so it belongs where it is.
Additional context
The change shipped as one part of #1572, which was closed as superseded by #1582 and #1594; this refactor is the piece the maintainer flagged as still worth carrying, and it is independent of the peer-dependency work. Happy to open the small PR once the issue is approved.
Before submitting
status:approvedProblem or opportunity
The set of verified Pi hosts is currently known in three places and nothing keeps them in sync:
lib/vim-editor-adapter.tsholds it privately for the identity gate (SUPPORTED_VERSIONS);extensions/gentle-shell.tsrepeats it insideresolveVimRuntime()in the bundled-graph branch;After #1582 narrowed the list to
{"0.99.1"}, an edit that touches only one or two of those sites changes behaviour silently: a host can be admitted by the gate while one resolver path refuses to certify it, or the reverse. The failure mode is quiet — the adapter is designed to fail closed, so a mismatch degrades Vim to ordinary editing instead of reporting the inconsistency.@dnlrsls suggested this as a smaller follow-up on the superseded #1572 ("the single-source-of-truth refactor for
SUPPORTED_VERSIONS, which could go in a smaller follow-up").Proposed outcome
Export the verified-host list from
lib/vim-editor-adapter.tsas the single source of truth, and have bothresolveVimRuntime()branches read it instead of restating the versions. No behaviour change: the admitted set stays{"0.99.1"}and every identity proof is untouched (host package name, matchingCustomEditor/Editorclasses, prototype chain, bundledVERSION).A unit assertion that the gate and both resolver branches consult the same list would keep the invariant enforced rather than merely documented.
Alternatives considered
resolveVimRuntime()into the adapter module. Bigger than needed: the resolver depends on the extension'sCustomEditorsubclass identity, so it belongs where it is.Additional context
The change shipped as one part of #1572, which was closed as superseded by #1582 and #1594; this refactor is the piece the maintainer flagged as still worth carrying, and it is independent of the peer-dependency work. Happy to open the small PR once the issue is approved.