Repository navigation
Stop work on issues edited by untrusted accounts after ready-for-agent - #843
Merged
Merged
Conversation
A body edit (userContentEdits) or title edit (RenamedTitleEvent) by an account that is not a Trusted account, made after the most recent ready-for-agent labelling, makes an issue not Ready. A Spec run checks each Ticket against the later of the Ticket's and its Spec's last labelling by a Trusted account. Before each session of a Run, a Resume included, the issue is checked again for untrusted edits made since the Run started, and the Run fails instead of starting the session. Closes #668 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Address review findings: an untrusted edit found before the Security review session failed it into a generic incomplete hold, letting the Run go on; it now fails the Run. Count edits from a few minutes before the Run started, covering the gap since the trust check and clock lag. Share the GraphQL paging loop, rename Edit to IssueText, and add a test helper for fake edits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macOS date has no -d, so the edit's date came out empty there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Summary
The Trusted account check stays the one from #667. Untrusted edits now fail the Run before a Security review instead of becoming a Security hold. Trusted edits never count. A Trusted account applying
ready-for-agentagain resets the comparison point, and the existing settle wait still applies. Comments are out of scope.Closes #668
Evidence
Each regression failed before its code and passes after:
no-mergeexits 0These pass alongside the regressions: a Trusted edit or a Trusted relabel keeps the issue Ready, a Trusted edit mid-Run lets Repairs run, and a Ticket edited before its Spec's Trusted labelling starts.
Validation:
cargo test --no-fail-fast -- --test-threads=4on 5480234 (before mergingmain): 2004 passed, 0 failed, 2 ignored across 52 result groups.main:cargo clippy --all-targets -- -D warningspassed, plus the unit tests,merge_run,security_reviewandpackaging.Test seam: the thirdshift CLI with real Git repositories and fake
gh/Harness executables. The fakeghgains aneditsstate key andgh fake edits.Review against
main: Standards found 10 judgement calls and Spec found 3 findings. P1 and P2 failed when their tests were run as written; both are fixed and their tests are kept. Both axes read all 11 files changed at review time, through their diffs at least. Changed files left unread:src/github.rs(changed after the review, by the S1 extraction) andtests/security_review.rs(P1's test, added after the review). The rename toGLOSSARY.mdcame from mergingmain; the reviewedCONTEXT.mdhunk carries over unchanged, apart from P2's wording.Merge Danger
Door: two-way
Reverting restores #667's selection rule. Nothing persisted changes.
Blast Radius: dispatch
Every session of a Run now makes two extra GraphQL reads first, plus membership checks for any editor who isn't the owner. A failed GitHub read fails the Run before the session, after the existing transient retries. Direct
thirdshift <Issue URL>runs still only warn at start, but an untrusted edit made during the Run now fails them too.Unaddressed findings
Standards
(IssueText, query, field)table (src/github/trust.rs,untrusted_edit). Declined. The table is the only place the triple appears; methods on the enum would spread one two-row table across three functions.Sessions::within→checked_withinMiddle Man. Declined. The reviewer called it acceptable: the check must sit inSessions::startto cover Resumes, and the no-opwithinserves the Architect, Security and Pass sessions, which have no issue to check.no_untrusted_edit_sincecreatesGitHub::new()(src/delivery.rs). Declined. This matches the idiom ofsrc/spec_run.rs:273andInWorktree::issue_is_open, and the CLI-level tests intests/merge_run.rsandtests/security_review.rsexercise it.created_atfixture churn. Partly addressed: the fake'strust_eventsdoc now says events carrycreated_at. Declined the helper: the fixtures are JSON literals, and their explicit times are what the new ordering tests read.issue_trust,trusted_ready_at). Declined. Each makes at most one membership call per labelling actor, and the owner short-circuits with no call. This is not a behaviour issue.paged_nodes,IssueText,time_at,no_untrusted_edit_since,edits_issue_7).Spec
🤖 Generated with Claude Code
Built with claude · claude-opus-5-5 · medium
Security review outcome
No unaddressed introduced findings.