Conversation
Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/3064f93b-a433-4244-be07-a6af9cc4d7ec Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add timestamp comparison for stale endorsement reactions
Guard: ignore stale maintainer reactions when content is edited after endorsement
Apr 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub DIFC Rust guard’s reaction-based integrity promotion/demotion so maintainer reactions are ignored when the underlying issue/PR/comment has been updated after the reaction was created, preventing post-endorsement content mutation from retaining approved integrity.
Changes:
- Add “stale reaction” filtering to
has_maintainer_reaction_with_callback()by comparing itemupdatedAt/updated_atwith reactioncreatedAt/created_at. - Add debug logging when a reaction is skipped as stale.
- Add unit tests covering fresh vs stale reactions and missing timestamp behavior.
Show a summary per file
| File | Description |
|---|---|
| guards/github-guard/rust-guard/src/labels/helpers.rs | Implements timestamp-based stale reaction skipping, adds debug logs, and introduces targeted unit tests for the new behavior. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
guards/github-guard/rust-guard/src/labels/helpers.rs:476
nodes.iter().take(MAX_REACTIONS_TO_CHECK)now caps the scan before filtering out stale reactions. With this change, a long list of stale endorsements in the first 20 nodes can cause a fresh endorsement later in the list to be missed (false negative), even though skipping stale reactions doesn't incur backend permission lookups. Consider scanning all reaction nodes but only counting/enriching up toMAX_REACTIONS_TO_CHECKnon-stale + matching reactions (or apply the cap after filtering).
for node in nodes.iter().take(MAX_REACTIONS_TO_CHECK) {
let content = match node.get("content").and_then(|v| v.as_str()) {
- Files reviewed: 1/1 changed files
- Comments generated: 1
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced Apr 21, 2026
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.
Maintainer reactions were treated as evergreen endorsements, even if an issue/PR/comment was edited after the reaction was added. This allowed post-endorsement content mutation to retain
approvedintegrity.Stale endorsement detection in reaction evaluation
has_maintainer_reaction_with_callback()to compare item and reaction timestamps.item.updatedAt/updated_atis newer than reactioncreatedAt/created_at, that reaction is ignored for integrity promotion/demotion.Observability for skipped reactions
Coverage for timestamp edge cases
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
example.com/tmp/go-build4228467833/b509/launcher.test /tmp/go-build4228467833/b509/launcher.test -test.testlogfile=/tmp/go-build4228467833/b509/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 1.0.9/bool.go 1.0.9/bool_func.go x_amd64/vet --gdwarf-5 ut-2993393641.c -o x_amd64/vet 1043�� g_.a -trimpath x_amd64/vet -p go-sdk/internal/-atomic -lang=go1.24 x_amd64/vet(dns block)/tmp/go-build3552295474/b513/launcher.test /tmp/go-build3552295474/b513/launcher.test -test.testlogfile=/tmp/go-build3552295474/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s(dns block)invalid-host-that-does-not-exist-12345.com/tmp/go-build4228467833/b491/config.test /tmp/go-build4228467833/b491/config.test -test.testlogfile=/tmp/go-build4228467833/b491/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true @v1.1.3/cpu/arm/arm.go 1043343/b166/ x_amd64/vet --gdwarf-5 backoff -o x_amd64/vet 1043�� g_.a 1043343/b166/ x_amd64/vet -p 64 -lang=go1.24 x_amd64/vet(dns block)/tmp/go-build3552295474/b495/config.test /tmp/go-build3552295474/b495/config.test -test.testlogfile=/tmp/go-build3552295474/b495/testlog.txt -test.paniconexit0 -test.timeout=10m0s 1043�� /tmp/go-build212/home/REDACTED/work/gh-aw-mcpg/gh-aw-mcpg/guards/github-guard/rust-guard/target/degit -goversion bin/rustc -c=4 -nolocalimports -importcfg bin/rustc /tmp�� /home/REDACTED/go//home/REDACTED/work/gh-aw-mcpg/gh-aw-mcpg/guards/github-guard/rust-guard/target/de/opt/hostedtoolcache/go/1.25.9/x64/pkg/tool/linux_amd64/vet /home/REDACTED/go//home/REDACTED/work/gh-aw-mcpg/gh-aw-mcpg/guards/github-guard/rust-guard/target/de/tmp/go-build4250267068/b498/vet.cfg .cfg /endpointshardingit 777.build_scriptpush 777.dq1kj865068v-v -guard/target/deorigin(dns block)nonexistent.local/tmp/go-build4228467833/b509/launcher.test /tmp/go-build4228467833/b509/launcher.test -test.testlogfile=/tmp/go-build4228467833/b509/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 1.0.9/bool.go 1.0.9/bool_func.go x_amd64/vet --gdwarf-5 ut-2993393641.c -o x_amd64/vet 1043�� g_.a -trimpath x_amd64/vet -p go-sdk/internal/-atomic -lang=go1.24 x_amd64/vet(dns block)/tmp/go-build3552295474/b513/launcher.test /tmp/go-build3552295474/b513/launcher.test -test.testlogfile=/tmp/go-build3552295474/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s(dns block)slow.example.com/tmp/go-build4228467833/b509/launcher.test /tmp/go-build4228467833/b509/launcher.test -test.testlogfile=/tmp/go-build4228467833/b509/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 1.0.9/bool.go 1.0.9/bool_func.go x_amd64/vet --gdwarf-5 ut-2993393641.c -o x_amd64/vet 1043�� g_.a -trimpath x_amd64/vet -p go-sdk/internal/-atomic -lang=go1.24 x_amd64/vet(dns block)/tmp/go-build3552295474/b513/launcher.test /tmp/go-build3552295474/b513/launcher.test -test.testlogfile=/tmp/go-build3552295474/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s(dns block)this-host-does-not-exist-12345.com/tmp/go-build4228467833/b518/mcp.test /tmp/go-build4228467833/b518/mcp.test -test.testlogfile=/tmp/go-build4228467833/b518/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true om/tetratelabs/w-errorsas om/tetratelabs/w-ifaceassert x_amd64/vet . --gdwarf2 --64 x_amd64/vet .cfg�� 1043343/b261/_pkg_.a /tmp/go-build2121043343/b298/ x_amd64/vet . telabs/wazero/in/usr/bin/runc --64 x_amd64/vet(dns block)/tmp/go-build3552295474/b522/mcp.test /tmp/go-build3552295474/b522/mcp.test -test.testlogfile=/tmp/go-build3552295474/b522/testlog.txt -test.paniconexit0 -test.timeout=10m0s lib/�� lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libobject-926daa94a00ee327.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libmemchr-48d5b0db80402653.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libaddr2line-3367f26bd486b29d.rlib lib/rustlib/x86_bash lib/rustlib/x86_/usr/bin/runc lib/rustlib/x86_--version 05ed-cgu.00.rcgu.o 05ed�� 05ed-cgu.02.rcgu.o 05ed-cgu.03.rcgu.o 05ed-cgu.04.rcgu.o 05ed-cgu.05.rcgubash 05ed-cgu.06.rcgu/usr/bin/runc 05ed-cgu.07.rcgu--version 05ed-cgu.08.rcgu.o(dns block)If you need me to access, download, or install something from one of these locations, you can either: