Skip to content

fix: all text from the repo is shown only as code, and SHAs are short - #37

Merged
groupsky merged 1 commit into
mainfrom
fix/repo-text-as-code
Nov 17, 2026
Merged

groupsky merged 1 commit into
mainfrom
fix/repo-text-as-code

Conversation

@groupsky

Copy link
Copy Markdown
Contributor

Fixes #29
Fixes #23
Fixes #30

What changes

  • One way in for repo text. Paths, commit subjects, symlink targets, submodule paths, the output of summary and check, and errors that may hold any of them reach a message only through message.Code (one line in <code>) or message.Output (lines in <pre>). The old message.Esc and message.Clean are no longer exported. Telegram makes no link, mention, hashtag or command of text inside <code>/<pre>, so README.md and login.example.com are plain text now (fix: file names in the question become Telegram links (README.md → https://README.md) #23).
  • Link previews were already off in the client; the fake Telegram server now records link_preview_options, and a test checks it for every send and edit.
  • Short SHAs (feat: short SHAs in Telegram messages, the full one once per question #30). Every message shows a SHA as 12 characters in <code>. The question shows the full SHA once, on its last line (Full: <code>…</code>); Fit keeps that line after a cut. Logs, state and pullgate status keep the full SHA. Root applies the full SHA from its own state.
  • DESIGN.md section 12, THREAT-MODEL.md T3 (hostile text shown as a link; a short SHA that looks right) and the README updated.

Tests

  • TestRepoTextIsOnlyInsideCode (message): hostile values (a URL, domain-like names, README.md, HTML <a href>, @username, #tag, /command, a right-to-left mark, very long text) in every field of the question, with and without a cut and with a failed summary. Each must be only inside <code>/<pre>, and the text under the Telegram limit.
  • TestHostileCommitTextIsOnlyCode (gate): hostile file names, subjects and command output through a failed check notice, a question and a failed apply. TestHostileSymlinkRefusalIsOnlyCode: the refused notice.
  • TestGateBuildsNoRepoTextItself: the gate code builds no <code>/<pre> or escape of its own.
  • TestLinkPreviewsAreOff (listener): question, reply, notice, expired note and edit, checked on the request body.
  • TestShortSHAsAndOneFullSHA (message) and TestNoticesShowShortSHAs (gate): short SHAs, one full SHA on the last line, and the apply installs the full SHA.
  • Existing tests and the e2e test updated to the short form.

Reviews

Security review: no critical, high or medium findings. Fixed: Clean is unexported too, DESIGN wording about the last line, and a THREAT-MODEL note on short SHAs. Not changed: the "Applied" report keeps the short SHA (#30 asks for short SHAs in notices; pullgate status shows the full one).
Correctness review: added hostile apply output and the hostile symlink refusal to the tests, a wider source scan, and clearer wording. Its "notices have no length cap" finding does not hold: message.Code cleans the text, which cuts it to 200 characters.

🤖 Generated with Claude Code

Text from the repo, the commit, or a command that ran on it (paths,
subjects, symlink targets, submodules, summary and check output, errors)
reaches a message only through message.Code (<code>) or message.Output
(<pre>). The escape function is no longer exported. Telegram makes no
link, mention, hashtag or command of text inside <code>, so README.md
or login.example.com is no longer a link. Link previews stay off, and
a test now checks the request body.

Messages show 12-character SHAs. The question shows the full SHA once,
on its last line ("Full:"), which stays after a cut. Root still applies
the full SHA from its own state.

Fixes #29
Fixes #23
Fixes #30

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant