Skip to content

Remote file reads: close remaining test, guard and wording gaps #1738

Backlog

Description

@smart-ssh-planner

Goal

Close the remaining test and wording gaps from the bounded remote file read work.

Context

Follow-up of #1714 (PR #1728): the review listed small leftovers.

Requirements

  • Test: a failing write of the empty backup of an empty source file leaves no partial backup.
  • Test: a source whose reported size is exactly 256 KiB (one chunk) but which yields more: partial copy, probe byte, backup removed, write fails.
  • Guard test crates/app-logic/tests/no_unbounded_read_file.rs:43 also matches ::read_file( (UFCS calls); the existing allowed file stays allowed.
  • Spec 0086 §1: say precisely that at most the limit plus one byte is read, also when the size query fails or understates (A1.2 is already correct).
  • A confirmed AI write to a pseudo file whose stat size is 0 but which has content (e.g. under /proc) fails at the backup step with the message "larger than its reported size; backup aborted". Make that message clear for users (text via the locale mechanism if it reaches the UI; see docs/recipes/README.md).

Acceptance Criteria

  • Both new tests exist and fail when the corresponding cleanup/bound is removed.
  • The guard test fails on a planted Trait::read_file( call in production code of app-logic/app-shell.
  • Spec 0086 §1 matches A1.2.
  • The pseudo-file failure shows a message that names the cause and that the file was not changed.
  • Relevant automated tests pass

Technical Notes

Test and docs work; only the last requirement changes a (failure) text. Spec 0020 mention optional.

Files: crates/app-logic/src/orchestration/action_exec/tests_activity.rs, crates/app-logic/tests/no_unbounded_read_file.rs, crates/app-logic/src/orchestration/remote_files.rs, docs/specs/0086-sftp-limits-and-session-pairing.md

Spec impact: update 0086

Open questions

  • Refactor of write_via_sudo_fallback/write_via_sftp_with_backup (old_size: Option<u64> instead of existed + old_size, rename created): optional, only if it stays small.

Related Work

Activity

  1. added
    tests
    on Dec 4, 2026
  2. added
    follow-up
    on Dec 4, 2026
  3. smart-ssh-coder commented on Dec 4, 2026

    @smart-ssh-coder
    Contributor

    Needs maintainer: The issue waits for #1733, but "blocked by" could not be set. Set it on the issue (Relationships), then remove needs-maintainer: The code this issue extends (bounded remote file reads from #1728, incl. crates/app-logic/tests/no_unbounded_read_file.rs) is only on release/0.8.0; it is not on develop yet. Waiting for the back-merge of release/0.8.0 into develop (#1733).

  4. added
    needs-maintainer
    question-triage
    and removed
    question-triage
    needs-maintainer
    on Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upsshtests

    Type

    Fields

    Priority

    P3 - Low

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions