Commit Graph
12 Commits
Author SHA1 Message Date
aiongg 20061c88d9 Apply async codemod: node scripts/codemod-async.ts over the program 2026-11-21 17:00:38 +00:00
aiongg 1421dc4c5b Comment commands: a PR head without a check suite is unknown and the command is tried again; a failure storing a command never fails the delivery's re-read 2026-11-20 13:57:31 +00:00
aiongg 36c4bcd1d6 Comment commands: app permission read, comment-time head pin, comment re-read, quiet and silent cases
- The commenter's write permission is read through the app installation (appPermission), which writes repo_permissions, so a
  maintainer's pre-approval stays alive under refreshSettlers; an access GitHub cannot read is retried, and a command that
  expires that way is answered once ("could not check your access; comment again").
- The comment's creation time is stored. A PR is pre-approved only at the head it had then: a force push, a later commit date or
  a later first check suite on the head refuses it ("the PR changed after your comment; comment again"), and preapproveMerge
  takes the pinned head. On an issue, the closing PR is queued only when it is older than the comment and unchanged since.
- A comment older than 5 minutes at delivery queues nothing; before acting the comment is read again by id and must exist, have
  the same author and still hold the same command.
- A login never bound, a viewer, and a non-operator on a quiet PR get no answer; nothing is answered on a quiet PR. Unexpected
  errors are answered with a fixed text; only an answer to someone the queue rule lets queue skips the comment approval.
- github_commands gets an index on (state, reply) and the runner prunes settled rows after 30 days; parseCommand skips indented
  code and HTML comments across lines.
2026-11-20 13:54:08 +00:00
David MannandClaude Opus 5.5 a85d1cfa3a A command reads the commenter's role and binding again after the permission read and passes that role to queueAdd, so a login demoted or bound to another account meanwhile queues nothing; the early check stays, so an unknown commenter costs no GitHub call
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 14:12:33 +01:00
David MannandClaude Opus 5.5 14e2d89e0c Commands never tried go before retries in a drain, and retries by their last try, so due retries cannot fill the limit drain after drain; a retry's tried_at is the time after its permission read
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 14:11:23 +01:00
David MannandClaude Opus 5.5 1243b8533a A command exactly an hour old has expired (the deadline is inclusive)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 14:09:50 +01:00
David MannandClaude Opus 5.5 491d49160d A command whose hour ran out while GitHub answered the permission read expires instead of being queued, and its outcome is recorded at the time after that read
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 14:06:57 +01:00
David MannandClaude Opus 5.5 ffb76a0826 A command checks its items' read times again after the permission read, right before queueAdd with no I/O wait between the check and the pre-approval, so an older snapshot written meanwhile (a reconcile that started before the comment) makes it wait instead of queuing that head
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:47:35 +01:00
David MannandClaude Opus 5.5 10f60b0497 A command counts only a read strictly after the comment (a read stamped at its instant may have started before it), and on an issue it also waits for a fresh read of every open PR that closes it, since queueAdd pre-approves the sole one at its mirrored head
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:43:09 +01:00
David MannandClaude Opus 5.5 7365123cd7 A command with no read of its item since the comment, and none queued, queues a re-read itself (at most once a minute), so a failed re-read or one in the comment's own second does not leave it waiting until it expires
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:40:10 +01:00
David MannandClaude Opus 5.5 8f9b4c05bc Commands in comments, after review: a fence closes only as CommonMark closes it; a command waits until the item was read from GitHub after the comment (item_reads), since a gone sync request also follows a failed re-read; rows waiting for a read or a permission retry (tried_at, a minute) no longer fill the drain's limit, which now counts GitHub calls only
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:27:03 +01:00
David MannandClaude Opus 5.5 a8ab84a50c Merge queue from GitHub comments: @<app-slug> merge queue [weight] on a PR or issue queues it as a line of Queue items, as the commenter, under the same rule (settleRefusal); the webhook keeps only the comment id, item, weight and commenter in github_commands (never the text), the runner carries it out after the item's re-read with the commenter's write permission read from GitHub, and the app answers in the thread through write.ts; commenters without an AutoCraft login, or with another GitHub id than the bound one, get no answer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:10:42 +01:00