Skip to content

feat: /check from Telegram to look for a new commit now - #13

Merged
groupsky merged 3 commits into
mainfrom
feat/check-command
Nov 12, 2026
Merged

groupsky merged 3 commits into
mainfrom
feat/check-command

Conversation

@groupsky

@groupsky groupsky commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #8.

The owner can send /check or /check NAME to the bot. The host then fetches now and asks the usual Apply question when there is a new commit.

Design

  • The listener writes a fixed file spool/NAME/check/request (content check\n, nothing from the message). pullgate apply never reads it.
  • pullgate-check@NAME.path starts the same pullgate-run@NAME.service as the timer: same sandbox, lock and rules. No new code path applies anything.
  • Root checks the file like an approval (regular file, listener owner, O_NOFOLLOW, size, exact content) and removes it.
  • Root keeps the rate limit (one requested run per minute, in its own state). The listener also waits 10 s per instance; root does not trust that.
  • Paused or off: a reply, no fetch. mode = "auto": allowed, and it applies at once, as the timer would (DESIGN section 13, README, THREAT-MODEL).
  • The listener takes message updates only from the owner in the chat, unedited, exact /check or /check NAME; any @ is refused; replayed update IDs are ignored; message text is never logged.

Tests

spool: TestCheckRequestRoundTrip, TestBadCheckRequests. gate: TestCheckRequestStartsANormalRun, TestCheckRequestNeverAppliesWithoutTap, TestCheckRateLimitByRoot, TestCheckBadRequestFiles, TestCheckPausedAndOff, TestCheckWaitsForTheLock, TestCheckAutoModeApplies, TestCheckReplyForRefusedTip, TestCheckLimitReplySentOnce. listener: TestCheckCommandWritesRequests, TestCheckCommandsThatDoNotCount, TestReplayedUpdateIsIgnored, TestCheckGapInTheListener, TestCheckRequestWriteFailsSaysSo, TestListenerAsksForMessages. e2e: /check from another user does nothing; the owner's /check runs and replies.

Progress

  • Code, docs (DESIGN 3, 8, 9, 13; THREAT-MODEL T1, T2, T9, T12, new T18; README), unit
  • Security review (subagent, two passes): 8 findings fixed
  • Correctness review: fixed: the path unit starts only on check/request (a planted dotfile no longer loops runs); a run that waited for the lock and finds no request stops; install.sh names pullgate-check@NAME.path

Findings not fixed

  • New fields in state.json and the listener state: an older pullgate cannot read them (both readers refuse unknown fields). Only matters for a downgrade.
  • A taken-over listener can hit the path unit's trigger limit and so stop /check until the owner resets the unit. This only denies. T18 and README say how to reset it.
  • A /check that finds a cut-off apply gets the cut-off warning, not a check reply (low).
  • The "wrong owner" test is at the spool level only (the gate tests cannot make files of another user without root).

🤖 Generated with Claude Code

groupsky and others added 2 commits November 12, 2026 20:20
Refs #8

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The path unit starts only on check/request; a run that waited for the
lock and finds no request stops; install.sh names the check path unit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@groupsky
groupsky marked this pull request as ready for review November 12, 2026 18:22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@groupsky
groupsky merged commit fbd8782 into main Nov 12, 2026
8 checks passed
@groupsky
groupsky deleted the feat/check-command branch November 12, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: /check from Telegram to look for a new commit now

1 participant