Repository navigation
Forwarding trusts only a person's edits, not a GitHub App with an instructor's login - #83
Merged
Merged
Conversation
…re refused Red against the old code: the activity query test (no __typename on editor), the body edit by an App test (bodyEdit forwarded), and the comment edited by an App test (comment kept). Issue: #75
…h an instructor's login ACTIVITY_QUERY asks for __typename on every editor. activitySince and checkEdits judge editors with isHumanInstructor, so a GitHub App whose login matches an instructor no longer passes when it edits the body or a comment. REST comment authorship is unchanged. Issue: #75
…tor cases The query assertion now names the top-level editor field, a comment whose App last editor sits above a cut-off history is dropped as edited-by-other, and a body whose last editor is an App is refused even when the history looks like a person's. Tests for behavior that already holds; no red phase. Issue: #75
rawphp
marked this pull request as ready for review
October 16, 2026 23:13
Author
|
Factory gate: passed (attempt 1, run by the factory in a fresh checkout of the pull request's head
|
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.
Closes #75
Contract
ACTIVITY_QUERYasks for__typenameoneditorand on everyuserContentEditseditor;activitySincetrusts a body edit only when the last editor and every edit aftersincepassisHumanInstructor(a non-Usereditor gives no body edit);checkEditsusesisHumanInstructorfor the last editor and every history entry, so an App-edited comment is dropped once with reasonedited-by-other; forwarding fixtures carry__typename: "User"on human editors; new tests cover aBotbody edit and aBotcomment edit whose login matches an instructor; REST comment authorship (user.loginviaisInstructor) is unchanged.cd apps/server && vp test run src/factory/tracker/github.test.ts src/factory/tracker/approvalHistory.test.ts→ pass (277 tests)Acceptance criteria
ACTIVITY_QUERYasks for__typenameoneditorand on everyuserContentEditseditor — test "the activity query asks only for the body edit" (github.test.ts), which names the top-levelbody lastEditedAt editor { __typename login }and theuserContentEditseditor separatelyactivitySincechecks body edits withisHumanInstructor: the last editor and every edit aftersince; a non-Usereditor gives no body edit — test "a body edit by an App with an instructor's login is not forwarded": App last, App in between, editor with no__typename, App last above a person-looking history; a person's edit still forwardedcheckEditsusesisHumanInstructorfor the last editor and every history entry; an App-edited comment is dropped once withedited-by-other— test "a comment edited by an App with an instructor's login is dropped once": App last, App in between, App last above a cut-off history__typename: "User"on human editors —actorOf,bodyReplyRaw,editorReplyRawand the two inline real-shape fixtures ingithub.test.tsuser.login) is unchanged —github.tsactivitySincestill filters REST rows withisInstructor(c.user, …); test "activity keeps only instructors, case-insensitively" unchangedGate
factory/scripts/check.sh→ exit 0 (seams, 41 factory test files / 1654 tests, server and web typecheck)Models
modelsblock in.dw/config.yml; Tom's default roster used.Review
test:commit; the 3 survivors (login-onlylastOther, login-only last-editor guard,__typenamedropped from the top-leveleditor) were re-run against the new tip and all die. 7/7 killed, 0 unreached.edited-by-other; App last editor above a person-looking history gives no body edit.Lessons
src refspec t3/13995e6d does not match any. Cause: the session's git status snapshot named the worktree directory's id as the branch, but the factory had checked outt3/factory-issue-75. Default: at Isolate rungit branch --show-currentand use that name for every push and PR command.Notes
origin/mainat Isolate (214c0e092, clean); fast-forwarded to5df529b18before provisioning.factory:*labels already existed; none created.test:commit, 3 tests fail (266 run); at thefix:commit, all green.Commits
132a19aa1test(factory): forwarding fixtures carry __typename and Bot editors are refused— Make slice (red)d73925caafix(factory): forwarding trusts only a person's edits, not an App with an instructor's login— Make slice (green)0ca275b1atest(factory): pin the top-level editor typename and the App-last-editor cases— Check cycle 1 (tests only, no red phase)Files
apps/server/src/factory/tracker/github.ts—ACTIVITY_QUERYasks for__typename; editor schemas useActor;checkEditsandactivitySincejudge editors withisHumanInstructorapps/server/src/factory/tracker/github.test.ts— fixtures carry the typename,botOfhelper, Bot body-edit and Bot comment-edit tests, anchored query assertion