Skip to content

bug(workflows): valid replacement characters block worktree handoff #588

Description

@ooiuuii

Problem

Worktree handoff capture rejects valid UTF-8 text containing the literal replacement character (U+FFFD). boundedGit currently decodes stdout to a string and rejects any occurrence of that character; nulPaths repeats the same heuristic.

Main f6b49ae59605b1276b8267f2886d22c03f01533c, Node 22.22.3 / Git 2.54 on Windows. All reproduction data is synthetic.

Reproduction

  1. Create a normal temporary Git repository and a child worktree via createWorktree.
  2. Change a tracked text line to contain a literal U+FFFD, or create an untracked/ignored filename containing it.
  3. Call the real prepareWorktreeHandoff owner.

Actual: valid text is reported as invalid UTF-8 and no handoff is captured. Both patch-content and file-inventory cases fail on main. This does not demonstrate data deletion: existing fail-closed handling preserves the checkout.

Expected: validate the raw Git output bytes with a strict decoder. Preserve valid U+FFFD content and names exactly; continue refusing genuinely malformed byte sequences before publishing the artifact.

Scope: byte validation in this handoff owner only; no cleanup policy, patch format, inventory semantics, arbitrary binary-text support or configuration changes.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions