GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw · Issue #1307 · developing-today/code

id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw #1307

New issue
Copy link
New issue
Copy link
Closed
#4613
Closed
id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw#1307
#4613
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 27, 2026
Issue body actions

id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw

Summary

Opening a plain-text (.txt) file in id and saving it — even with no
edits — rewrites the file: the final newline is always removed, and
CRLF line endings are converted to LF. Raw mode round-trips
byte-exactly; Plain mode does not.

Evidence

  • Load: pkgs/id/src/web/markdown.rs:1825 plain_text_to_prosemirror
    splits with str::lines(), which yields no element for a single
    trailing newline and strips the \r of CRLF endings.
  • Save: pkgs/id/src/web/routes.rs:2009 extract_plain_text joins
    paragraphs with "\n" and appends nothing at the end — so the
    trailing newline the load discarded can never come back.
  • Verified this run on origin/main 90f7ea0 with a probe crate running
    the real load function plus the verbatim save function (log:
    hidden_files/probe-2026-10-26-2352/out3.log):
    • "alpha\nbeta\n" → "alpha\nbeta" (final newline lost)
    • "alpha\n" → "alpha"; "\n" → ""; "alpha\n\n" → "alpha\n"
    • "alpha\r\nbeta\r\n" → "alpha\nbeta" (CRLF rewritten to LF)
    • Controls that round-trip exactly: "alpha\nbeta" (no trailing
      newline) and "".
  • Contrast: Raw mode (raw_text_to_prosemirror /
    extract_raw_text) keeps the whole file in one code block and
    round-trips byte-exactly, including the trailing newline.

Why it matters

Every POSIX text file ends in a newline; a no-op open→save in id
produces a spurious diff (\ No newline at end of file), breaks
tools that require a terminating newline, and silently converts
CRLF files (common for notes shared with Windows editors) to LF.
Fidelity loss in the mode whose entire job is plain bytes.

Acceptance criteria

  • A documented, tested policy makes no-edit open→save of a .txt
    file byte-stable for the common shapes: trailing newline present
    or absent, and CRLF endings (either preserved, or — if LF
    normalization is the deliberate choice — called out in the mode's
    docs and pinned by a test, not accidental).
  • Regression tests cover at least: "a\nb\n", "a\nb", "a\n",
    "", and a CRLF sample, through the real load→save pair.
  • Markdown and Raw save/load behavior unchanged.

Notes

The information loss happens at load (lines() cannot distinguish
"a" from "a\n"), so a fix likely needs the load side to carry the
trailing-newline fact (e.g. a trailing empty paragraph, mirroring how
"a\n\n" already loads) or the save side to adopt an
always-terminate policy — triage should pick and pin one.

Activity

Next
  1. developing-today commented on Oct 27, 2026

    @developing-today
    developing-todayBot
    on Oct 27, 2026 – with developing.today
    Contributor
    More actions

    CODE-425

  2. github-actions
    assigned
    dezren39
    on Oct 27, 2026
  3. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/lowNice to have; do when convenient
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 27, 2026
  4. dezren39 commented on Oct 27, 2026

    @dezren39
    dezren39
    on Oct 27, 2026
    MemberAuthor
    More actions

    🤖 Agent note · state: filed

    • Agent: new-issue-creator job
    • Session / ID: new-issue-creator run, 2026-10-27T05:34Z
    • Found via: filed this run
    • Task: Filed after verifying on origin/main 90f7ea0 that the .txt load→save pair (plain_text_to_prosemirror lines() + extract_plain_text join) always drops the final newline and rewrites CRLF to LF, while Raw mode round-trips byte-exactly.
    • Expectation: effort s — triage picks the fidelity policy (carry trailing-newline at load, or always-terminate at save; CRLF preserved or documented normalization), then a small fix with round-trip tests.
    • Links: probe log hidden_files/probe-2026-10-26-2352/out3.log; queue packet packet-1307.json (repo-health-code-pilot)
  5. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 2, 2026
  6. 16 remaining items

  7. dezren39
    added
    status/in-progressQueue worker lifecycle state
    on Nov 2, 2026
  8. dezren39
    added a commit that references this issue on Nov 2, 2026

    fix(id/web): preserve a lone trailing CR in plain mode — only newline…

    2548949
  9. dezren39
    closed this as completedin #4613on Nov 2, 2026
  10. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done — PR #4613 merged, issue #1307 fixed

    • Agent: queue worker (repo-worker-code), lane L shift
    • Session / ID: task 6492 (resumed at stage pr_opened from the prior lane's checkpoint)
    • Found via: queue claim
    • Task: plain-mode .txt trailing-newline fidelity for issue id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw #1307
    • What this shift did: verified PR fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613 at the checkpointed head, read the Codex review, and dispositioned its one P2 finding — a lone trailing CR (not part of CRLF) was stripped by the new split logic. Fixed in commit 2548949: only newline-terminated segments lose their CR; regression test test_plain_mode_roundtrip_preserves_lone_terminal_cr added and the disposition replied on the Codex thread.
    • Verification: cargo test -p id --lib --features web plain_mode on the laptop — 3/3 pass (trailing-newline, CRLF-normalization, lone-CR). Wider web:: set: the same 5 failures appear on the unmodified PR head (500 passed) — pre-existing/environmental, none in the touched functions.
    • Result: PR fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613 merged (merge commit 1155872); issue id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw #1307 closed by the merge.
    • Links: PR fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613 · task 6492
  11. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
  12. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done (triaged — already done) via MID-SHIFT FALLBACK

    • Agent: queue worker (repo-worker-code), lane code-v
    • Session / ID: task 12763 (repo-queue-worker-shift-v, 2026-11-08 run)
    • MID-SHIFT FALLBACK: backend failed at checkpoint/complete — broker returned "task 12763 is not claimed by repo-worker-code" (exit 5) minutes after fleet queue claim + fleet queue lane succeeded under the same worker (assigned_lane direct). Same 2026-11-08 double-claim race family seen by other lanes (task 12484 / task 10972). Outcome recorded here and via the GitHub fallback verbs per runbook §0b; the broker task is not left with an unrecorded outcome.
    • Task: task 12763 — triage PR fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613 (fix(id/web): plain mode trailing-newline fidelity) / issue id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw #1307.
    • Outcome: Triaged — already done, nothing remains. Fresh evidence this run:
      • PR fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613 MERGED 2026-11-02T23:17:55Z, merge commit 1155872.
      • Issue id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw #1307 CLOSED (closed by that merge; labels carry no queue/status in-flight markers).
      • The one Codex P2 finding on PR fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613 (lone trailing CR stripped by the new split logic) WAS dispositioned before merge: fixed in commit 2548949, disposition replied on the Codex thread 2026-11-02T23:17:19Z, regression test test_plain_mode_roundtrip_preserves_lone_terminal_cr added.
      • Verification of record (task 6492, lane L): cargo test -p id --lib --features web plain_mode — 3/3 pass (trailing-newline, CRLF normalization, lone-CR).
    • Structured result (for the queue record): outcome=already_done, issue_state=closed, pr=fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613 merged, merge_sha=1155872fe63e1423e24a3003b551e2bfb4e87c60, ci=pass, follow_up_task_ids=[].
    • Links: PR fix(id/web): plain mode carries the trailing newline (CRLF documented as LF normalization) #4613 · issue id(web): every .txt open→save drops the final newline (and rewrites CRLF to LF) — Plain mode is not byte-faithful unlike Raw #1307 · task 6492 (original fix) · task 12763
  13. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    Picked up by repo-worker-code-v — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-v posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  14. dezren39
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 8, 2026
  15. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    Progress from repo-worker-code-v: done: triage verdict already_done recorded, releasing

  16. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    Released by repo-worker-code-v (outcome: done). task 12763 triaged already_done: PR #4613 merged 1155872, issue #1307 closed, Codex P2 dispositioned+fixed 2548949, plain_mode tests 3/3 (task 6492 record). Broker complete failed not-claimed (double-claim race) — outcome recorded via this fallback release + agent note on #1307.

  17. dezren39
    removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.