rewrite: replace Python with Rust and Ratatui - #45
Conversation
|
Important Review skippedToo many files! This PR contains 780 files, which is 680 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (20)
📒 Files selected for processing (780)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Progress checkpoint — PR #44 intake
The next update will record the selected paths, validation results, and import commit. |
|
Progress checkpoint — first PR #44 batch imported Imported commit: Contents:
Validation:
PR #44 is now paused at |
|
Checkpoint 2026-08-12 (JS dependency fix pass)
PR #44 remains pinned at paused head |
|
PR #44 import checkpoint Imported one additional independently green test-only batch from paused head
Only the final file blob was imported. PR #44 deletions, global gates, and unfinished red contracts remain isolated on the integration branch. |
|
Checkpoint 2026-08-12 (mirror fix + reviewed PR #44 slices) Parity fix:
Reviewed imports from paused PR #44 head
Four reviewed PR #44 waves now contribute 82 executable tests plus 6 completeness manifests on this branch. The full unfinished snapshot remains isolated on |
|
Implementation checkpoint 2026-08-12 Four additional parity-fix clusters landed, primarily implemented and verified by delegated agents:
Explicit The earlier benchmark timeout is not currently reproducible: 126 exact, parallel, and complete-binary reruns all passed. Source history also rules out the recent imports/fixes. Evidence points to a scheduler-sensitive PR #44 remains safe to continue from |
|
Data-safety checkpoint
Explicit |
|
Checkpoint 2026-08-12 (continued handoff work + PR #44 sync) Production parity fixes since the previous checkpoint:
Reviewed PR #44 imports:
Explicit |
|
Checkpoint 2026-08-12 (JS dependency + responsive closure)
Next cluster is the add-time unknown prompt-runner refusal (3 exact contracts), already audited red against the v0.4 oracle and delegated for TDD implementation. |
|
Checkpoint add-time prompt runner parity:
The full local workspace aggregate is being rerun with isolated state. The first two failures were environment-only: the managed sandbox made the default state directory read-only and forbade a loopback TcpListener; exact product tests pass when those capabilities are available. |
|
Checkpoint:
PR #44 test-only integration also advanced: |
|
Checkpoint:
PR #44 PowerShell classification is intentionally not imported yet: application 1/1 and manifest 2/2 pass, but form is 18/19. The red contract shows a real production gap: an unknown static PowerShell type degrades to free text but loses its boolean default. The proposed replacement also duplicates many existing language-layer exact names, so it needs product repair plus honest global deduplication before mainline import. |
|
Checkpoint:
|
|
PowerShell reviewed import is now complete without duplicate test inflation:
Explicit implementation |
|
Checkpoint:
|
|
PR #44 integration checkpoint:
|
|
Checkpoint |
|
Checkpoint |
|
PR #44 sync checkpoint: pinned |
|
Checkpoint |
|
Checkpoint |
|
Checkpoint |
|
Checkpoint |
|
Reviewed PR #44 JS-injection import |
|
Checkpoint |
|
Checkpoint |
|
Checkpoint |
…eview The review panel now prints a guidance line under the dependency and Python fields, which costs two rows. The panel scrolls, so every control stays reachable, but this owner reads one drawn screen and its last assertions sat below the fold at 24 rows. The terminal is 32 rows now, so the owner keeps asserting that the panel draws its controls.
The confirmation stage read its draft from a candidate the confirm action moved out, so the stage outlived the data that describes it. A frontend that draws while the host performs the delete reached a confirmation with no draft to name, and the screen fell back to "Remove this entry:" — the entry-removal modal's sentence, which is wrong for a kept draft twice over: a draft is a file, and that wording never says the copy is the only one. The candidate now ends exactly when its stage ends: the confirm action clones it, and the outcome that returns to the source stage clears it. The screen therefore always has a draft to name, so the fallback arm is gone and the confirmation rows move into their own builder beside the other stage builders. The catalog row stays: the entry-removal modal still owns that sentence.
Six genuine string absences of forty, two of them real defects, the tiers confirmed against the oracle's CSS, a colour owner that now reads style state instead of bytes, and a reducer invariant the coverage gate exposed through an unreachable fallback.
Six of forty packaged strings were genuine absences, and two of those were real defects: a draft confirmation that called a file an entry, and a dependency fence that rendered its Python requirement as an empty list. Record the disproved package, the tiers matching exactly, and the freeze the mutation matrix needs.
A terminal reports Shift for an upper-case letter but not for a shifted symbol. The exact modifier comparison made the advertised ? Help key dead. A character binding now ignores the Shift flag at the one shared matching seam. The positive keyboard tests now drive every character case through both terminal shapes, and a spec-derived test holds the rule for every context.
Version 0.4 clips a half-scrolled widget row by row inside the Textual scroll compositor. The settings screen instead drew a complete fresh bordered control into the viewport remnant, so a false top border appeared and the value row vanished while it was on screen. A cut control now draws at full height into a scratch buffer and keeps only the visible band, with hit regions and the cursor mapped through the same band. The line-input and textarea painters gain buffer-level cores so the scratch path and the frame path share one body.
The recorded walkthrough saw the initial selection flip between two runs. A 200-iteration probe against a seeded library shows the surface build and the reducer are pure functions of their inputs, in the tie case too: activity descending, ties keep the ascending slug order, and the cursor starts on the first row — the exact stable-sort semantics of version 0.4 (src/skit/tui.py:394, src/skit/store.py:860). The flip was input noise in the recording stack, not product state. This test holds the contract.
Version 0.4 deletes the highlighted draft with no activation step (OptionList.highlighted, src/skit/tui_add.py:481-490). The port armed the ask only after a draft was activated, so Ctrl+D and the chip did nothing on a row the keyboard had merely focused. A focus landing on a draft row now reports a HighlightDraft action, which marks the row without touching the source path. Activation keeps its extra step of pointing the source path at the draft.
The zh add receipts drifted from the oracle .po: the verb (已加入, not
已添加/已新增), the ASCII colon and parentheses, 描述 for Description,
管理中的参数 for Managed parameters, and the 的 in the secrets note.
Both locales now carry the oracle strings verbatim, a catalog test
holds the whole receipt block against the .po, and the unused
'Added: {} ({})' row is gone.
Version 0.4 renders the discard ask as one question inside an untitled border (src/skit/tui_settings.py:42-65). The panel repeated the question as its title; the title is gone and the screen header keeps naming the surface. The modal strings also drifted from the oracle .po: Discard is the bare verb (放弃/放棄) and the question has no 要…吗 wrapper. A catalog test holds the set.
The clipped-cursor branch now has a tiny-viewport owner: a two-row viewport cuts the focused three-row input and the cursor must land on the visible content row. The options truncation guard is gone — both render paths size the rect from control_height, so the guard was dead after the scratch-buffer change. The draft-chord test asserts the event by equality instead of a never-taken panic arm.
…eeds cargo-mutants 27.1.0 calibrates the automatic timeout from a baseline that tests only the shard's mutated package, while test_workspace = true makes every mutant run the full workspace suite. The derived 20 s budget then times out honest 95 s runs: 5,719 of the 9,877 mutants in run 32655362435 were never adjudicated. An explicit --timeout 300 replaces the automatic calibration, a contract rejects the return of the automatic knobs, and the matrix grows to 64 shards so the slowest shard class keeps a 31% margin under the 6 h job ceiling.
…mplete-20260808-codex # Conflicts: # HANDOFF.md
The walkthrough tapes were written in a throwaway harness. They now live beside demo.tape and shots.tape, with docs/assets/demo/record_walkthrough.sh to record them across en, zh-CN, and zh-TW. A new pep723.py demo fixture declares an empty PEP 723 dependency list, so the add review reads that block instead of guessing from the imports. Three tapes changed because the behaviour they record changed. Help is now a real scene: `?` opens the overlay, Esc closes it, and `q` does nothing while it is open, so the tape closes the overlay before it quits. The drafts tape no longer activates a draft row before Ctrl+D, because the delete arms from keyboard focus. The `Up 4` comments no longer claim the library order is unstable, because it is sorted by activity and then by slug. settings-clip.tape replaces the harness bug tape and now records the fix rather than the defect. The frames are deliberately NOT tracked. Two runs of one tape do not agree, and the disagreement is in the capture stack rather than in skit: an earlier round measured 8 unstable frames of 19, this round measured 9 of 20, and the two unstable sets are not the same frames. A screenshot can raster a neighbouring beat, a torn composite of two beats, or a blank inter-frame, while the emulator text grid and the mp4 are correct at every beat. A committed frame would therefore fail for a reason that has nothing to do with the product. What carries the guarantee instead is the Wait pattern on every transition: it reads the text grid, and a Wait that fails prints the screen and stops the tape. The tracked baseline is unchanged: the 12 docs/assets/tui-*.png files that shots.tape produces and the READMEs reference.
All 21 matrix rows are complete at the release head. Full mutation adjudication moves to issue #47 by owner decision: the pipeline fix ships here, and the follow-up runs the 64-shard matrix to zero survivors. HANDOFF.md was the agent working document, not product documentation, so it leaves the tree with the work finished.
What this PR does
Replaces the Python implementation of skit with a complete Rust + Ratatui rewrite. The Python source is gone; a Maturin binary wheel keeps
uv tool install skit-cliand PyPI upgrades working. Version 0.4 user data stays authoritative: reads never migrate, unknown fields and source bytes survive round trips, and a v0.4.0 library upgrades in place without corruption.Architecture
Workspace crates with dependency direction toward the domain:
skit-domain,skit-application(use cases, ports, typed errors),skit-language(parser-backed analysis/injection/normalization),skit-form,skit-store(TOML, locking, atomic mutation),skit-runtime(process plans, uv bootstrap, spawn),skit-ui(serializable state + reducer — the future Tauri seam),skit-tui(Ratatui/Crossterm),skit-cli(Clap + composition root),skit-i18n(complete en/zh-CN/zh-TW catalog). Every TUI capability is reachable from the CLI with--json, deterministic exit codes,--no-input, and dynamic completion.Behavior fidelity
The Python v0.4 test suite was ported as the behavioral oracle (81 modules; per-module record in
docs/design/python-test-port-ledger.md). The release contract isdocs/design/rust-contract-matrix.md: all 21 rows complete, with every accepted divergence listed under "Recorded deviations". zh strings are byte-for-byte copies from the v0.4 gettext catalogs.Evidence at the release head
cargo llvm-cov+ fail-closed gate)docs/assets/demo/replay the full keyboard surface in three locales; the 12 tracked frames are byte-verified against the release binaryDeferred by owner decision