Repository navigation
Description
Summary
In the id REPL, the - content placeholder is only substituted when it appears mid-line (" - "). The end-of-line case was meant to be handled by a second replace, .replace(" -$", ...), but Rust's str::replace is a literal string replace — -$ is not a regex end anchor — so that pattern can only match the two literal characters -$, which never occur. The end-of-line substitution is dead code at all three sites, and content addressed to a trailing - is silently lost or misrouted.
Evidence (main 5a34fa70, verified this run)
Dead-pattern sites:
pkgs/id/src/repl/input.rs— here-string branch:.replace(" - ", ...)then.replace(" -$", ...)pkgs/id/src/repl/input.rs— pipe branch:.replace(" - ", ...),.replace(" -\n", ...),.replace(" -$", ...)(all literal)pkgs/id/src/repl/runner.rs:140-141— heredoc completion: same" - "/" -$"pair
Laptop probe (verbatim copies of preprocess_repl_line/shell_capture from input.rs and the heredoc-completion replace chain from runner.rs, only error plumbing adapted; probe at ~/git/fleet/probe-2026-10-29-laneA-replinput/ on the laptop):
CTRL herestring mid: Ready("put __STDIN_CONTENT__:payload name")
CTRL pipe mid: Ready("put __STDIN_CONTENT__:hi name")
CTRL heredoc mid: "put __STDIN_CONTENT__:BODY name"
A1 herestring dash-last: Ready("put name -") <- 'payload' silently dropped
A2 pipe dash-last: Ready("put name - __STDIN_CONTENT__:hi") <- marker appended AFTER the '-'
A3 heredoc dash-last: "put name -" <- heredoc body silently discarded
PROOF replace: "put name -".replace(" -$", " X") == "put name -" (unchanged)
Downstream consequences, from repl/runner.rs:
- Here-string (
A1): the line executes asput name -— the here-string content never reaches the store; the-is treated as an ordinary argument. - Pipe (
A2): the marker lands after the-, sohandle_stdin_content(runner.rs:446) computesbefore == "put name -", which is not"put", and printsunknown command with content: put name -— the piped content is dropped with a misleading message. - Heredoc (
A3): after the user types the whole heredoc body, completion leaves the line asput name -; the body is discarded and the command runs as a plain file put.
Why it matters
The REPL documents - as the content placeholder for put (module docs in input.rs), and users reasonably put it last (put name - <<< '...', ... |> put name -, put name - <<EOF). In each form the failure is silent data loss: the command appears to run, but the content the user supplied is not what gets stored — or nothing is stored and the error message points at the wrong cause. The dead " -$" pattern also misleads future readers into believing the end-of-line case is handled.
Acceptance criteria
- A trailing
-placeholder is substituted in all three paths (here-string, pipe, heredoc completion), or the trailing form is rejected with a clear error naming the placeholder position — one consistent behavior, pinned in the issue/PR. - No literal
" -$"(or" -\n") replace patterns remain; the substitution logic is shared or identically tested at all sites it is needed. - Regression tests in
pkgs/id/src/repl/input.rs/runner.rscovering: here-string with-last, pipe with-last, heredoc completion with-last, plus the existing mid-line controls. - Existing REPL preprocessing tests still pass.
Dedup / related
- id(repl): find/search/show/peek parsers silently swallow unknown and mistyped flags — a typo'd flag vanishes and its value becomes a query #2274 covers the find/search/show/peek argument parsers swallowing unknown flags — different code path (argument parsing, not content-placeholder substitution).
- id(repl): the preprocessor's heredoc and $(...) scans are quote-blind — a quoted ')' errors the line and a quoted '<<' drops the REPL into heredoc mode with a garbage delimiter #1585 covers quote-blind heredoc/
$(...)scans of the original line — different mechanism. - Searched open + recently closed issues for
here-string,heredoc,STDIN_CONTENT,preprocessbefore filing; no existing issue covers the trailing-placeholder substitution.
Activity
developing-today commentedon Oct 29, 2026
CODE-1139
dezren39 commentedon Oct 29, 2026
🤖 Agent note · filed
-content placeholder is never substituted because.replace(" -$", ...)is a literal pattern, not an end anchor — here-string content addressed to a trailing-is silently dropped, the pipe form no-ops with a misleading "unknown command with content" message, and a heredoc body is discarded on completion.-is substituted (or loudly rejected) consistently across here-string, pipe and heredoc completion, the dead literal patterns are gone, and regression tests cover the dash-last forms.98 remaining items
dezren39 commentedon Nov 1, 2026
🤖 Agent note · handed off
queuedwith no live lease, while this issue still carriedqueue/claimed+work/assigned. Labels reset to the truth (queue/queued+status/needs-triage). Checkpoint stage at evaporation:awaiting_ci— PR fix(id/repl): reject trailing "-" content placeholders (#2280) #3096 is open for this issue. NOTE: task 4322 is also DEAD in queue (attempts 2/2 = max_attempts, unclaimable) — it needs an operator cap raise before a lane can shepherd PR fix(id/repl): reject trailing "-" content placeholders (#2280) #3096.Merge pull request #3096 from developing-today/queue/4322-2280-repl-t…
dezren39 commentedon Nov 1, 2026
🤖 Agent note · done