refactor(gateway): extract interrupt helpers from run.py (slice 19 of #54962) - #77722
Open
andrexibiza wants to merge 1 commit into
Open
andrexibiza wants to merge 1 commit into
andrexibiza wants to merge 1 commit into
Conversation
…ousResearch#54962) Signed-off-by: andrexibiza <84248988+andrexibiza@users.noreply.github.com>
andrexibiza
force-pushed
the
fix/gateway-interrupt-helpers
branch
from
August 3, 2026 14:29
6617c1e to
b20be81
Compare
This was referenced Aug 5, 2026
Contributor
Author
|
At exact head For refactor(gateway): extract interrupt helpers from run.py (slice 19 of #54962), GitHub reports check rollup SUCCESS on exact 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.
Related #54962 #55138 #77433
What / Why
Slice 19 of the god-file extraction campaign (#54962): pulls the interrupt-marker helpers out of the 26,823-line
gateway/run.pygod file into a focusedgateway/interrupt_helpers.pymodule.Moved (pure move, byte-verbatim, zero behavior change):
_stamp_hygiene_compression_provenance— best-effort activity provenance stamp for hygiene compression transitions (timeout / cooldown).Kept in
gateway/run.py(documented, not moved):_is_fresh_gateway_interruption— depends on_coerce_gateway_timestamp, which is claimed by open PR refactor(gateway): extract display/resolution helpers out of run.py (first slice of #54962) #77433 (display helpers extraction) and may not be moved by this slice. Once refactor(gateway): extract display/resolution helpers out of run.py (first slice of #54962) #77433 lands, the freshness check and its exclusive constant_AUTO_CONTINUE_FRESHNESS_SECS_DEFAULTcan follow into this module._AUTO_CONTINUE_FRESHNESS_SECS_DEFAULT— only consumer is_is_fresh_gateway_interruption, which stays.gateway/run.pyre-exports the moved function via a module-attribute import, sogateway.run._stamp_hygiene_compression_provenancekeeps resolving with identical object identity (log records also keep thegateway.runlogger name).How to test
python -c "import gateway.run" python -m pytest tests/gateway/test_restart_resume_pending.py -q --no-header -p no:cacheproviderVerified in this PR:
import gateway.runsucceeds from the worktree;gateway.run._stamp_hygiene_compression_provenance is gateway.interrupt_helpers._stamp_hygiene_compression_provenance(identity asserted).tests/gateway/test_restart_resume_pending.py: 31 passed (the only test file referencing the interrupt cluster).git diff --check: clean.scripts/check-windows-footguns.py: no footguns found.HEAD:gateway/run.py(diff-checked).Shrink
gateway/run.py: 26,823 → 26,811 lines (−12). New module:gateway/interrupt_helpers.py(+27). Net line movement is the smallest clean extraction: one function + its private imports; the dependent member stays with its claimed dependency rather than forcing the cluster.Platforms tested
Part of #54962
Part of #55138
Part of #78647