Repository navigation
fix(auto-reply): refuse to clear the send flag and to send without a queue row - #55
Merged
Merged
Conversation
reply_jobs.ax_mutation_authorized records that Return may have been pressed for a job. The triggers only ever set it, but a direct UPDATE can still put it back to 0, and nothing rejects a sending row that lacks it. These tests pin three things on both a created queue and one migrated from v2: an UPDATE that clears a set flag fails, a sending row without the flag fails validation, and a v3 queue whose schema could clear the flag is not adopted. The Rust stopped-clean validator gets the same two cases. All fail today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The insert and status triggers set reply_jobs.ax_mutation_authorized and never clear it, but any direct UPDATE could. A cleared flag on a job whose Return may have fired lets recovery reschedule it and post it twice. A BEFORE UPDATE OF ax_mutation_authorized trigger now aborts any update from 1 to 0. Both validators expect the trigger in an exact v3 queue and reject a sending row whose flag is 0. The Rust stopped-clean check already refused every sending row as nonterminal, so for it this only names the broken invariant. The trigger joins schema v3 instead of starting a v4. The v3 layout exists only on the unmerged stability stack. No baked runtime or installed CLI on this host has the v3 column code, and every queue on disk is at v0 or v2. The supervisor's one-transaction v0/v2 to v3 step now also creates the trigger. A queue in the earlier v3 shape fails closed on open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three tests called send_reply with no queue connection or event_id, so local-send ran without the job ever being committed to sending. The worker never sends that way; its only caller passes both. Each test now holds its event as a processing row in a real queue, the way process_job does, and keeps checking what it checked before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e row send_reply commits the job to sending, which sets its send authority, before local-send can press Return. When the caller passes no queue connection or no event_id, it skips that commit and still runs local-send, so a reply can reach the room with no durable record that it may have. The pin calls the send boundary without each in turn and expects no command and an unchanged processing row, then a normal call that sends once. It fails today: both calls send. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
send_reply committed the job to sending only when it had both a queue connection and an event_id. Without either it skipped the commit and still ran local-send, so Return could post a reply that no row marked as possibly sent. Recovery would then treat the job as never attempted. send_reply now returns False before any command when either is missing, next to the existing refusal for a missing event. The sending commit no longer has a branch around it. The only caller, _deliver_scheduled_reply, always passes both, so the worker sends exactly as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The four eprintln! lines become one SERVER_LOGIN_WARNING const so a test can read what the warning tells the user. stderr is byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ax-read needs safety.allow_ax_send because opening a chat that is not already open presses Return in KakaoTalk. Its help still calls it a plain read, and the server-login warning recommends it with no mention of the gate. The pin reads the rendered ax-read help and the warning text. It fails today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ax-read has required safety.allow_ax_send since 0d818f2, because opening a chat that is not already open presses Return in KakaoTalk. Its help now says so, and the server-login warning adds that local-send and ax-read both need the gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GeekNewsReadbackTests sat after the __main__ guard, so running the file directly ran 19 of its 21 tests, and naming that class failed with "module '__main__' has no attribute". The guard now ends the file. The -m unittest runs in CI already loaded the class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 2026-09-22 entry describes the operator send as local-send to the --chat name with a local-search readback. The code now binds the room through the room catalog entry for the --queue directory and reads back with local-read on that chat_id. A dated sub-bullet records this and leaves the historical entry as written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
auto-reply-host --tick spawns the pinned command with /bin/sh to avoid the Gatekeeper and Automation prompts that opening it in Terminal caused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Independent verifiers of the stability stack listed follow-ups that make the send-once guarantee hold even against hand edits and misuse, plus three doc and help fixes. An auto-reply must never post twice, and every later change should be caught by a check rather than by memory.
What changed
reply_jobs.ax_mutation_authorizedonce set, and both validators (Python and Rust) require that trigger and reject asendingrow whose flag is 0. Folded into schema v3: no baked runtime or live queue carries v3 yet (journal copies, 405 baked binaries and 23 queue files checked read-only).send_replyrefuses to send when it has no queue connection or event id, instead of sending without asendingcommit.ax-readhelp says it needssafety.allow_ax_send; the misplaced unittest guard moved to the end of its file; a dated correction note inunit5-live-proofs.md; AGENTS.md says the host tick starts the session command with/bin/sh, not Terminal.Scope
INSERT OR REPLACEorDELETE. Nothing usesINSERT OR REPLACEonreply_jobs; the onlyDELETEis the retention archive, which removessentandskippedrows after recording their tombstones.Blast Radius
Queue files are created and validated with the new trigger, so a queue made by this branch's intermediate v3 shape fails closed. No such queue exists outside tests.
Verification
cargo test1,169 passed; CI Python list ran 1,366 tests, OK with 9 skipped, under a sandbox with an emptyHOME.🤖 Generated with Claude Code