rcom/openspec/changes/archive/2026-12-05-add-file-actions-and-editor/tasks.md
2026-12-05 23:30:06 +03:00

8.9 KiB
Raw Blame History

Tasks

1. Обобщённая модель и test-support

  • 1.1 Ввести WorkPlan с общими identity/source/destination/totals/epochs и вариантами CopyMove/Create/Rename/Trash/Delete/Undo/EditUpload; адаптировать TaskManager без ослабления single-writer/cancel guarantees и прогнать существующие operation tests.
  • 1.2 Реализовать EntryMutationPlan, immutable editor/trash records и property tests имени как одного normal non-empty OsString component; связать named tests в docs/spec-matrix.md.
  • 1.3 Добавить TrashPolicy, ExternalEditor ports и fault-injection doubles для create/mkdir/rename/remove/trash/download/upload/editor process с журналом Location/SessionEpoch; проверить отсутствие реальных mutations и сети в обычном CI.
  • 1.4 Добавить production shell-words и tempfile dependencies с минимальными features; обновить docs/testing.md о fresh sandbox, injected trash root и owned editor fixtures, проверив documented commands.

2. Create и rename

  • 2.1 Реализовать Local/SFTP create-new regular file и mkdir с typed endpoint checks; добавить TempDir/fake tests успеха, existing path, traversal, symlink parent и отсутствия overwrite.
  • 2.2 Реализовать create planner/prompts для a и A/F7, confirmation и refresh после commit; named tests доказывают отсутствие .part/mutations до Enter и cancel по умолчанию.
  • 2.3 Реализовать rename planner/executor для одного hovered элемента внутри parent/endpoint с no-follow collision, confirmed source fingerprint и SessionEpoch; проверить file/directory success, conflict, stale source и mixed endpoint rejection.
  • 2.4 Подключить create/rename к WorkPlan queue, per-item outcomes, cancellation и Tasks diagnostics; controlled tests запрещают mutations после cancel acknowledgement и automatic retry.

3. Trash и permanent delete

  • 3.1 Реализовать endpoint-local TrashPolicy с unique UUID files/info records и create-new metadata; проверить Local/SSH paths, percent encoding, injected sandbox root и отказ production root во время acceptance.
  • 3.2 Реализовать trash executor через safe rename и prepared cross-device copy-then-delete с restore metadata; tests покрывают success, open/info/rename/write/delete failures, source preservation и отсутствие операций вне root.
  • 3.3 Реализовать permanent-delete planner/executor по зафиксированному no-follow tree в post-order без remove_dir_all; tests покрывают files/dirs/symlink, changed fingerprint и внешний новый файл.
  • 3.4 Реализовать hovered/selected trash/delete intents, различие d и D/F8, явное not-undoable confirmation с cancel default; reducer/UI tests подтверждают cancel и отсутствие удаления до Enter.
  • 3.5 Интегрировать trash/delete с cancellation, SessionEpoch, per-item partial/unknown и Tasks details; fault tests на каждом mutation stage не обещают rollback и не повторяют mutations.

4. Undo journal

  • 4.1 Реализовать bounded LIFO UndoJournal на 128 записей, создающий записи только из полностью успешных create/rename/move/trash; property tests проверяют порядок, eviction warning и исключение copy/permanent delete/edit/partial.
  • 4.2 Реализовать undo create с unchanged fingerprint и empty-directory check; tests доказывают удаление только созданного элемента и отказ при любом внешнем изменении.
  • 4.3 Реализовать inverse rename/move и trash restore с typed paths, collision checks и независимыми source/destination epochs; добавить Local/fake-SSH success tests.
  • 4.4 Реализовать undo confirmation, consume-on-success и retained failed/unknown entry без automatic retry; tests покрывают stale fingerprints, missing path, conflict, cancellation, restart-empty journal и double confirmation.
  • 4.5 Подключить u/Ctrl-z, empty-journal state, Undo summary и Tasks details; обновить Help и docs/spec-matrix.md фактическими named tests.

5. Внешний редактор

  • 5.1 Реализовать EditorCommand::from_env через shell-words и direct tokio::process::Command без shell; tests покрывают VISUAL/EDITOR priority, quoted args, empty/invalid command, typed path и redaction ошибок.
  • 5.2 Реализовать TerminalGuard::suspend/resume под единым event-loop boundary; PTY tests проверяют success/nonzero/editor error, отсутствие draw/event read во время editor и сохранение panes/selection/tasks.
  • 5.3 Реализовать Local regular-file editing через e/F4 с refresh после выхода; tests проверяют unsupported types, сохранение typed path и отсутствие delete/rollback при editor failure.
  • 5.4 Реализовать SSH download в owned restrictive TempDir через 64 KiB streaming с сохранением source fingerprint/SessionEpoch; tests доказывают bounded reads, отсутствие remote mutations до confirmation и owned-only cleanup.
  • 5.5 Реализовать temporary-file change detection и upload confirmation с source/destination summary; tests покрывают unchanged=no upload, cancel, changed source и stale plan до любого write.
  • 5.6 Реализовать SSH upload через новый .part, flush/close, size/collision recheck и один commit; fault tests покрывают read/write/close/rename timeout, Unknown, .part diagnostics и source preservation.
  • 5.7 Интегрировать editor sessions с single-writer queue/cancellation/Tasks и задокументировать Local/SSH behavior в README/docs; прогнать fake editor matrix без запуска реального редактора в CI.

6. Интеграция интерфейса

  • 6.1 Подключить все новые клавиши и text prompts с capture до global aliases, suppression Repeat/Release и независимостью панелей; table-driven input/reducer tests проверяют обе keymaps одновременно.
  • 6.2 Обновить Tasks/Help/hints/adaptive overlays для общего WorkPlan, source paths, per-item outcomes, undoability и .part; добавить NO_COLOR/small-terminal snapshots.
  • 6.3 Добавить headless E2E create→rename→trash→undo→move→undo и fake SSH edit flow с double-start regression; проверить отсутствие скрытой смены панели.
  • 6.4 Добавить PTY smoke create prompt/cancel, permanent-delete confirmation и editor suspend/resume; проверить восстановление терминала при handled error.
  • 6.5 Обновить README, docs/spec-matrix.md и docs/acceptance.md только фактически реализованными сценариями; проверить согласованность proposal/design/specs без преждевременных PASS.

7. Сквозная приёмка

  • 7.1 Прогнать полную Local/SSH mutation matrix с multi-select, failures, cancellation, collisions, stale epochs, undo и editor; обновить docs/spec-matrix.md фактическими named tests.
  • 7.2 Выполнить opt-in write acceptance на hermesVM только внутри новой /tmp/rcom-acceptance-<uuid> с injected trash/editor roots: create/rename/trash/undo/delete/edit, faults и cleanup только owned fixtures; доказать отсутствие operations вне sandbox и отказ от предсуществующего пути.
  • 7.3 Повторить strict OpenSpec, fmt, Clippy, все tests/doc/PTY и security review; зафиксировать итоги в docs/acceptance.md и получить независимый verdict перед archive.

Workflow follow-up

  • После успешного verify выполнить openspec archive add-file-actions-and-editor и проверить archived result/main specs.
  • Следующими отдельными changes рассмотреть search/filter, tabs, archive/image preview, themes и plugin API.