Skip to content

Carry saved arrow preferences for the P917 keyboard repair - #3584

Merged
trissim merged 3 commits into
mainfrom
work/toad-keymap--P917--agent-comms
Oct 29, 2026
Merged

trissim merged 3 commits into
mainfrom
work/toad-keymap--P917--agent-comms

Conversation

@trissim

@trissim trissim commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

AI-generated by toad-keymap (OpenAI Codex). Core companion for the SAME P917 keyboard issue: OpenHCSDev/toad#1318 and OpenHCSDev/textual#207. This does not move P917's primary repository.

  • 2 Core commits,2files,+133/-8 against main at head1013b069222de401b9da72380e301181f74a2d65. The correction replaces partial per-member conversion with one complete in-memory conversion.
  • 10 retired saved invocation identities become4native arrow declarations. Equal ordered choices collapse once; conflicting choices refuse before any file write.
  • 2 saved-settings carries share1confined read/validate/AtomicFile implementation. No runtime compatibility reader or application keymap copy.

Before / after ownership

Before: ToadKeyMode(Carry) directly owned saved-settings file access, retired Vim-boolean rewriting, complete target validation and publication. New native arrow IDs made old per-widget rows undecodable. Its no-change branch also tried decoding complete settings before a later arrow carry could rewrite them.

After:

Carry
└── ToadSettingsCarry (abstract confined read / validate / AtomicFile write)
    ├── ToadKeyMode (existing retired Vim-boolean input)
    └── ToadArrowKeys (retired per-control arrow identities)

ToadSettingsCarry.carry derives every concrete settings rewrite from ToadSettingsCarry.members_with(ToadSettingsCarry), applies those existing methods to ONE in-memory document, then decodes COMPLETE ToadSettings once before the single AtomicFile write. Both historical Carry identities remain. Either member's first call completes both transformations; later member calls report zero changes. There is no handwritten rewrite roster, intermediate file write or ordering assumption. SavedSettings.resources(self.files), files.location(resource) and require_confined select and confine the actual live/practice resource; there is no guessed configuration path.

Retired input declarations

PreviousArrow derives replacement membership from its declared subclasses. Each subclass declares its old input identities and the actual current NavigationKey class; the new ID derives from current().key_identity(). No current widget roster or hand-written new ID strings.

Previous identities Current declaration
TextArea.action_cursor_up; CursorUpAction textual.keys.UpKey
TextArea.action_cursor_down; CursorDownAction textual.keys.DownKey
TextArea.action_cursor_left; Input.action_cursor_left; CursorLeftAction textual.keys.LeftKey
TextArea.action_cursor_right; Input.action_cursor_right; CursorRightAction textual.keys.RightKey

TextArea/Input prefixes are textual.widgets._text_area.TextArea and textual.widgets._input.Input; CursorAction prefix is toad.widget_actions. Input's two horizontal declarations also changed identity; omitting them would strand valid saved settings. MaskedInput inherits the Input declaration. Shift-selection and unrelated invocations retain their identities.

Preservation and refusal

PreviousInvocationId is accepted only by this retired-input decoder. Current KeyInvocationId admission still uses the real current catalog. Key order, modes, unrelated override rows and all unrelated JSON are preserved. First arrow occurrence retains its row position; later identical arrow+mode choices collapse. Different ordered key tuples refuse with the arrow/mode and both choices, before publication. Existing current arrow IDs participate in the same collision check.

No retired settings input means0changes; a second successful pass is therefore0changes and performs no write. Missing settings file is also unchanged. Explicit empty keys remain an explicit unbinding, not Reset. No user config was edited by the author.

Source evidence / actual remaining proof

Retained refactor-audit map:588Core production modules+19cutover modules+308ToAD+256Textual,8203classes,4321relevant syntactic sites,0parse omissions. Native map baseline ise7a48c59; changed native53af source is separately compiled/imported, not pretended to be that old snapshot. Dynamic discovery/order and real filesystem behavior are not established by AST.

Author source checks compiled both changed carry modules and imported the actual paired source: exactly10old→4new identities, writer_owned=(SavedSettings,), exactly2concrete settings rewrite members derived from the registry, no arrow-before-mode prerequisite. Logs: /home/ts/.cache/agent-scratch/toad-keymap/p917-arrow-carry-source.log (first head) and p917-arrow-carry-both-source.log (correction). No automated tests, per-head ratchets, migration execution, controller, fake app or provider input by author.

Root's first actual confined-copy proof passed dry run/no write, apply, second-pass zero, conflict refusal with original bytes intact, and exact unrelated-field/ordered-row preservation on Tristan's current config. It exposed the mixed older input: retired arrow IDs plus ui.vim-keys and no key-mode. The first head validated before the second transformation; complete conversion now precedes validation. Root's diagnostic is retained as p917-carry-proof-diagnostic.log, with the original settings hash unchanged.

Root owns rerunning the actual copy proof on the corrected head, including both retired inputs, before installation. Tristan owns actual live keyboard acceptance. Textual#207 must be available to the target runtime before this new carry is imported.

Assumed: previous editable-keymap files use the ten actual retired IDs listed above, with current mode encoding; invalid/unknown unrelated settings refuse complete target decoding instead of being discarded. Both supported retired input forms are converted together; this is not an exemption from full target validation.

arrow conversion finishes
Vim conversion hasn't happened
validate final format anyway
stupid ordering requirement deleted: finish the document, then judge it

Copilot AI balanced review requested due to automatic review settings October 29, 2026 05:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

debt-tools at 2ac5760, every finding:

grew BannedVocabulary:tools/cutover/carry_toad_arrow_keys.py +1
::warning file=tools/cutover/carry_toad_arrow_keys.py::LintFindings +2 (warns, never blocks)
grew NoneAbsence:tools/cutover/carry_toad_arrow_keys.py +1
::warning file=tools/cutover/carry_toad_arrow_keys.py::Unformatted +1 (warns, never blocks)
found BannedVocabulary:tools/cutover/carry_toad_arrow_keys.py at tools/cutover/carry_toad_arrow_keys.py:24
found NoneAbsence:tools/cutover/carry_toad_arrow_keys.py at tools/cutover/carry_toad_arrow_keys.py:98
introduced BannedVocabulary:tools/cutover/carry_toad_arrow_keys.py at lines [24]
introduced NoneAbsence:tools/cutover/carry_toad_arrow_keys.py at lines [98]

@trissim
trissim enabled auto-merge October 29, 2026 05:50
@trissim
trissim added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 782ed77 Oct 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants