session-runner: re-check landing_mode_for at push time so a landing-pr ticket can't reach main via a stale push (idss #2181) #344
Open
matou-build-agent
wants to merge 1 commit from
session-runner-land-mode-recheck-2181 into main
pull from: session-runner-land-mode-recheck-2181
merge into: Matou:main
Matou:main
Matou:sandcastle/rescue-20261120-212246
Matou:sandcastle/rescue-20261120-202650
Matou:sandcastle/rescue-20261120-202316
Matou:sandcastle/worker/20261120192753-1909682
Matou:sandcastle/rescue-20261120-191443
Matou:sandcastle/rescue-20261120-195103
Matou:sandcastle/rescue-20261120-201254
Matou:sandcastle/rescue-20261120-201438
Matou:sandcastle/rescue-20261120-144756
Matou:sandcastle/rescue-20261120-184843
Matou:sandcastle/rescue-20261120-190817
Matou:sandcastle/rescue-20261120-045815
Matou:sandcastle/rescue-20261120-143144
Matou:sandcastle/rescue-20261120-144025
Matou:sandcastle/worker/20261120032838-3834852
Matou:sandcastle/worker/20261120034547-1076409
Matou:sandcastle/rescue-20261120-031041
Matou:sandcastle/rescue-20261120-035031
Matou:sandcastle/rescue-20261120-041046
Matou:sandcastle/rescue-20261120-041556
Matou:sandcastle/rescue-20261120-042712
Matou:sandcastle/rescue-20261120-044145
Matou:sandcastle/rescue-20261120-044401
Matou:sandcastle/worker/20261120020735-3225234
Matou:sandcastle/rescue-20261120-025017
Matou:sandcastle/worker/20261120012937-3577764
Matou:sandcastle/rescue-20261120-024432
Matou:sandcastle/rescue-20261120-012510
Matou:sandcastle/rescue-20261120-020027
Matou:sandcastle/rescue-20261120-022005
Matou:sandcastle/rescue-20261120-023040
Matou:sandcastle/rescue-20261120-023059
Matou:sandcastle/rescue-20261120-023617
Matou:sandcastle/rescue-20261120-023726
Matou:sandcastle/rescue-20261120-024624
Matou:sandcastle/rescue-20261120-030108
Matou:sandcastle/rescue-20261120-011059
Matou:sandcastle/rescue-20261119-235227
Matou:sandcastle/rescue-20261119-220002
Matou:sandcastle/rescue-20261119-234418
Matou:sandcastle/worker/20261119210537-2901903
Matou:sandcastle/rescue-20261119-215319
Matou:sandcastle/worker/20261119210832-2140478
Matou:sandcastle/rescue-20261119-205729
Matou:sandcastle/worker/20261119195637-2051281
Matou:sandcastle/rescue-20261119-203604
Matou:sandcastle/rescue-20261119-212545
Matou:sandcastle/rescue-20261119-213258
Matou:sandcastle/rescue-20261119-214233
Matou:sandcastle/rescue-20261119-215039
Matou:sandcastle/rescue-20261119-200052
Matou:sandcastle/rescue-20261119-202558
Matou:sandcastle/rescue-20261119-202859
Matou:sandcastle/rescue-20261119-204522
Matou:sandcastle/rescue-20261119-202901
Matou:sandcastle/worker/20261119192821-2242548
Matou:sandcastle/rescue-20261119-201432
Matou:sandcastle/worker/20261119185826-1049892
Matou:sandcastle/rescue-20261119-192442
Matou:sandcastle/rescue-20261119-194543
Matou:sandcastle/rescue-20261119-195715
Matou:sandcastle/rescue-20261119-195042
Matou:sandcastle/rescue-20261119-194153
Matou:sandcastle/rescue-20261119-193223
Matou:sandcastle/rescue-20261119-181821
Matou:sandcastle/rescue-20261119-182031
Matou:sandcastle/rescue-20261119-191400
Matou:sandcastle/rescue-20261119-184524
Matou:sandcastle/rescue-20261119-185251
Matou:sandcastle/rescue-20261119-190111
Matou:sandcastle/rescue-20261119-171507
Matou:sandcastle/rescue-20261119-172406
Matou:sandcastle/rescue-20261119-180227
Matou:sandcastle/rescue-20261119-181611
Matou:sandcastle/rescue-20261119-183926
Matou:sandcastle/rescue-20261119-165410
Matou:sandcastle/rescue-20261119-181300
Matou:sandcastle/worker/20261119152654-1251003
Matou:sandcastle/rescue-20261119-175608
Matou:sandcastle/rescue-20261119-153212
Matou:sandcastle/rescue-20261119-155612
Matou:sandcastle/rescue-20261119-161612
Matou:sandcastle/rescue-20261119-162645
Matou:sandcastle/rescue-20261119-151259
Matou:sandcastle/worker/20261119-091545-699963
Matou:sandcastle/rescue-20261119-152400
Matou:sandcastle/rescue-20261119-150650
Matou:sandcastle/rescue-20261119-151018
Matou:sandcastle/rescue-20261119-145753
Matou:sandcastle/rescue-20261119-144640
Matou:sandcastle/worker/20261119-141805-b375a7
Matou:sandcastle/rescue-20261119-143616
Matou:sandcastle/rescue-20261119-142315
Matou:sandcastle/rescue-20261119-143536
Matou:sandcastle/rescue-20261119-144907
Matou:sandcastle/rescue-20261119-150929
Matou:sandcastle/rescue-20261119-140252
Matou:sandcastle/rescue-20261119-132837
Matou:sandcastle/rescue-20261119-140917
Matou:sandcastle/rescue-20261118-232015
Matou:sandcastle/rescue-20261118-224358
Matou:sandcastle/rescue-20261118-231012
Matou:sandcastle/rescue-20261118-221954
Matou:sandcastle/rescue-20261118-223235
Matou:sandcastle/rescue-20261118-215029
Matou:sandcastle/rescue-20261118-220457
Matou:sandcastle/rescue-20261118-213647
Matou:sandcastle/rescue-20261118-213651
Matou:sandcastle/rescue-20261118-203142
Matou:sandcastle/rescue-20261118-201242
Matou:sandcastle/rescue-20261118-160449
Matou:sandcastle/worker/20261118-151037-fa1423
Matou:sandcastle/rescue-20261118-141033
Matou:sandcastle/rescue-20261118-153435
Matou:sandcastle/rescue-20261118-155226
Matou:sandcastle/rescue-20261118-140135
Matou:sandcastle/rescue-20261118-072336
Matou:sandcastle/rescue-20261118-071306
Matou:sandcastle/rescue-20261118-065902
Matou:sandcastle/rescue-20261118-070925
Matou:sandcastle/rescue-20261118-064628
Matou:sandcastle/rescue-20261118-060611
Matou:sandcastle/rescue-20261118-063652
Matou:sandcastle/rescue-20261118-065117
Matou:sandcastle/rescue-20261118-065556
Matou:sandcastle/rescue-20261118-055026
Matou:sandcastle/worker/20261118-000033-5f0b74
Matou:sandcastle/rescue-20261118-054929
Matou:sandcastle/rescue-20261118-053613
Matou:sandcastle/worker/20261118-050837-870db6
Matou:sandcastle/rescue-20261118-051315
Matou:sandcastle/rescue-20261118-052156
Matou:sandcastle/rescue-20261118-053056
Matou:sandcastle/rescue-20261118-042651
Matou:sandcastle/rescue-20261118-050517
Matou:sandcastle/rescue-20261118-052017
Matou:sandcastle/rescue-20261118-052046
Matou:sandcastle/rescue-20261118-053617
Matou:sandcastle/rescue-20261118-040341
Matou:sandcastle/rescue-20261118-035452
Matou:sandcastle/rescue-20261117-180034
Matou:sandcastle/worker/20261117-173516-cca624
Matou:backport/idss-2068-2111-2114
Matou:sandcastle/rescue-20261117-123242
Matou:sandcastle/rescue-20261117-124231
Matou:backport/idss-2057
Matou:sandcastle/rescue-20261116-154411
Matou:sandcastle/rescue-20261117-175037
Matou:sandcastle/rescue-20261116-153352
Matou:sandcastle/rescue-20261107-062749
Matou:sandcastle/rescue-20261107-061316
Matou:fp/idss-2180
Matou:sandcastle/rescue-20261107-060212
Matou:forward-port/provision-disk-guard
Matou:sandcastle/rescue-20261107-060021
Matou:sandcastle/rescue-20261107-054649
Matou:sandcastle/worker/20261107-043349-cf0d7e
Matou:backport/idss-2177
Matou:sandcastle/rescue-20261116-175301
Matou:sandcastle/rescue-20261116-175950
Matou:backport/idss-2176
Matou:sandcastle/rescue-20261106-135208
Matou:sandcastle/rescue-20261107-045600
Matou:sandcastle/rescue-20261107-051315
Matou:sandcastle/rescue-20261107-053423
Matou:sandcastle/worker/20261106-111451-8c1ff0
Matou:sandcastle/rescue-20261106-023514
Matou:sandcastle/rescue-20261106-113455
Matou:sandcastle/rescue-20261106-115043
Matou:sandcastle/rescue-20261106-121303
Matou:sandcastle/rescue-20261106-134211
Matou:sandcastle/worker/20261106-013937-c15abc
Matou:fix/336-job-locality-runner-uuid
Matou:sandcastle/rescue-20261106-000320
Matou:sandcastle/rescue-20261105-113317
Matou:sandcastle/rescue-20261105-235352
Matou:sandcastle/rescue-20261106-020541
Matou:sandcastle/rescue-20261106-022516
Matou:sandcastle/rescue-20261106-024735
Matou:sandcastle/rescue-20261106-024744
Matou:sandcastle/rescue-20261106-024751
Matou:sandcastle/worker/20261105-104416-4319e1
Matou:sandcastle/rescue-20261105-111401
Matou:sandcastle/worker/20261105-054650-133b83
Matou:sandcastle/rescue-20261105-104304
Matou:sandcastle/rescue-20261105-110432
Matou:sandcastle/rescue-20261105-110637
Matou:sandcastle/rescue-20261105-112240
Matou:sandcastle/rescue-20261105-102818
Matou:sandcastle/worker/20261105-090131-e38a52
Matou:sandcastle/rescue-20261105-101105
Matou:sandcastle/rescue-20261105-094209
Matou:sandcastle/rescue-20261105-095705
Matou:sandcastle/rescue-20261105-091351
Matou:sandcastle/rescue-20261105-092126
Matou:sandcastle/rescue-20261105-093755
Matou:sandcastle/rescue-20261105-095339
Matou:sandcastle/rescue-20261105-101509
Matou:sandcastle/worker/20261105-033507-997386
Matou:sandcastle/worker/20261105-072852-43a339
Matou:sandcastle/rescue-20261105-085215
Matou:sandcastle/rescue-20261105-090546
Matou:sandcastle/rescue-20261105-090731
Matou:sandcastle/rescue-20261105-091600
Matou:sandcastle/worker/20261105-073544-9e3e7b
Matou:sandcastle/rescue-20261105-085541
Matou:sandcastle/worker/20261105-030149-b06fe6
Matou:sandcastle/rescue-20261105-075223
Matou:sandcastle/rescue-20261105-080157
Matou:sandcastle/rescue-20261105-081231
Matou:sandcastle/rescue-20261105-081252
Matou:sandcastle/rescue-20261105-081916
Matou:sandcastle/rescue-20261105-082029
Matou:sandcastle/rescue-20261105-082600
Matou:sandcastle/rescue-20261105-082859
Matou:sandcastle/rescue-20261105-083557
Matou:sandcastle/rescue-20261105-084327
Matou:sandcastle/rescue-20261105-090802
Matou:sandcastle/rescue-20261105-092213
Matou:sandcastle/worker/20261105-004228-d59980
Matou:sandcastle/worker/20261104-200255-c897e8
Matou:sandcastle/rescue-20261105-021604
Matou:sandcastle/rescue-20261105-062428
Matou:sandcastle/rescue-20261105-064420
Matou:sandcastle/worker/20261104-185608-12e745
Matou:sandcastle/rescue-20261105-011719
Matou:sandcastle/rescue-20261104-221030
Matou:sandcastle/rescue-20261105-003304
Matou:sandcastle/rescue-20261105-005511
Matou:sandcastle/rescue-20261105-013351
Matou:sandcastle/rescue-20261105-015246
Matou:sandcastle/worker/20261104-204335-4df59d
Matou:sandcastle/worker/20261104-144451-39719f
Matou:sandcastle/rescue-20261104-210849
Matou:sandcastle/rescue-20261104-211127
Matou:sandcastle/rescue-20261104-212722
Matou:sandcastle/worker/20261104-194113-a58f71
Matou:sandcastle/rescue-20261104-193329
Matou:sandcastle/rescue-20261104-200835
Matou:sandcastle/rescue-20261104-201057
Matou:sandcastle/rescue-20261104-202237
Matou:sandcastle/rescue-20261104-204239
Matou:sandcastle/rescue-20261104-185105
Matou:sandcastle/rescue-20261104-185510
Matou:sandcastle/rescue-20261104-192703
Matou:sandcastle/rescue-20261104-184907
Matou:sandcastle/rescue-20261104-183301
Matou:sandcastle/rescue-20261104-183354
Matou:backport/idss-2161
Matou:backport/idss-2155
Matou:fp/idss-2147
Matou:backport/idss-2145
Matou:backport/idss-2134
Matou:backport/idss-2119
Matou:sandcastle/worker/20261030-141035-c3d689
Matou:sandcastle/worker/20261030-125730-11b08b
Matou:sandcastle/worker/20261030-172321-20db0e
Matou:backport/idss-2114
Matou:backport/idss-2112
Matou:forward-port/idss-2111
Matou:forward-port/idss-2068
Matou:backport/idss-2111
Matou:backport/idss-2110
Matou:backport/idss-2106
Matou:backport/idss-2068
Matou:backport/idss-2104
Matou:sandcastle/rescue-20261030-110900
Matou:sandcastle/worker/20261029-055633-763b74
Matou:sandcastle/worker/20261029-000831-e4c652
Matou:sandcastle/worker/20261028-162655-0e8071
Matou:sandcastle/rescue-20261030-110112
Matou:sandcastle/rescue-20261030-110131
Matou:sandcastle/rescue-20261030-110135
Matou:sandcastle/rescue-20261030-110153
Matou:sandcastle/rescue-20261030-110156
Matou:sandcastle/rescue-20261030-110200
Matou:sandcastle/rescue-20261030-110220
Matou:backport/idss-1913
Matou:agent/issue-306
Matou:runner-busy-not-stalled
Matou:sandcastle/worker/20261024-045639-da1b9a
Matou:sandcastle/worker/20261023-060833-778cbe
Matou:fleet-queue-watcher-301-proposal
Matou:floor-vue
Matou:sandcastle/worker/20261021-191646-b93327
Matou:sandcastle/worker/20261021-233637-f21837
Matou:sandcastle/worker/20261021-233255-c766f7
Matou:sandcastle/worker/20261021-040000-b7a28d
Matou:backport/idss-2050
Matou:backport/idss-2050-session-pr-landing
Matou:sandcastle/worker/20261020-221737-cc96f3
Matou:backport/idss-2052
Matou:agent/issue-289
Matou:backstop-waiting-runs
Matou:sandcastle/worker/20261017-204619-942ae4
Matou:sandcastle/worker/20261017-204620-aa17c2
Matou:sandcastle/worker/20261017-144914-3ec608
Matou:sandcastle/worker/20261017-063336-7f5d31
Matou:sandcastle/rescue-20261017-062529
Matou:sandcastle/worker/20261017-010124-c49097
Matou:sandcastle/worker/20261017-003840-0c4ab1
Matou:sandcastle/rescue-20261017-054742
Matou:sandcastle/worker/20261017-053155-61c4c7
Matou:sandcastle/worker/20261017-050606-f20d66
Matou:sandcastle/rescue-20261017-052443
Matou:sandcastle/worker/20261017-050839-ec5b54
Matou:sandcastle/rescue-20261017-052212
Matou:sandcastle/worker/20261017-050442-495e4b
Matou:sandcastle/rescue-20261017-051857
Matou:sandcastle/worker/20261017-000426-34fa18
Matou:agent/issue-272
Matou:agent/issue-273
Matou:agent/issue-244
Matou:agent/issue-269
Matou:sandcastle/rescue-20261016-184726
Matou:sandcastle/rescue-20261016-184906
Matou:sandcastle/rescue-20261016-185533
Matou:sandcastle/rescue-20261016-191907
Matou:sandcastle/rescue-20261016-192219
Matou:sandcastle/worker/20261016-155725-c51ed1
Matou:agent/issue-195
Matou:agent/issue-196
Matou:agent/issue-197
Matou:agent/issue-198
Matou:agent/issue-200
Matou:agent/issue-203
Matou:agent/issue-205
Matou:agent/issue-206
Matou:agent/issue-207
Matou:agent/issue-209
Matou:agent/issue-213
Matou:agent/issue-216
Matou:agent/issue-217
Matou:agent/issue-218
Matou:agent/issue-222
Matou:agent/issue-238
Matou:agent/issue-208
Matou:sandcastle/worker/20261016-155833-1b8f77
Matou:agent/issue-241
Matou:agent/issue-230
Matou:agent/issue-239
Matou:land/issue-193
Matou:forward-port/idss-2048
Matou:backport/idss-2048
Matou:agent/issue-237
Matou:agent/issue-225
Matou:agent/issue-193
Matou:agent/issue-176
Matou:backport/1717-unclaimed-commit-gate
Matou:backport/1733-drive-yield-runlog
Matou:fix/159-rehearsal-report-token-leak
Matou:fix/157-ready-list-standdown
Matou:fix/154-verdict-no-match-trap
Matou:factory-floor-visual-rework
Matou:landing-shell-guard
No reviewers
Labels
Clear labels
agent-blocked
Sandcastle hit a blocker — human resolves it, then re-adds ready-for-agent
agent-working
Claimed by a live swarm run — other hosts skip it
bug
Something is broken
deferred
Ruled defer-with-criteria: parked until a revisit criterion in the issue body fires
enhancement
New feature or improvement
landing-pr
Additive: this ticket lands ONLY by a PR with screenshots (or a waiver) that a human merges — ADR 0265. Only a human removes it.
model-haiku
Per-ticket model override (additive): run this ticket on the cheap/fast model
model-opus
Per-ticket model override (additive): run this ticket on the top-tier model
model-sonnet
Per-ticket model override (additive): run this ticket on the mid-tier model
needs-info
Waiting on reporter for more information
needs-triage
Maintainer needs to evaluate this issue
no-triage
Escape hatch: triage automation must skip this issue
priority
Additive urgency marker — the swarm queue works these first
ready-for-agent
Fully specified, ready for an AFK agent
ready-for-human
Needs the human's hands, eyes, or a one-way-door ruling (ADR 0174)
ready-for-session
Needs an interactive agent session (host creds/protected paths/live doors), not the human (ADR 0174)
wontfix
Will not be actioned
No labels
agent-blocked
agent-working
bug
deferred
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-info
needs-triage
no-triage
priority
ready-for-agent
ready-for-human
ready-for-session
wontfix
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
Matou/dev-factory!344
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "session-runner-land-mode-recheck-2181"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Re-check
landing_mode_forat push time (idss #2181 / #2177, ADR 0267)The hazard
A standing
session-runnersession resolves a ticket's landing mode(
landing_mode_for) at pick time and injects it into the prompt asLanding mode for this ticket (resolved by the runner): push|pr. The sessionthen runs for up to
SESSION_RUNNER_TIMEOUT(2h). If alanding-prlabel isadded to the ticket during that window — an app-report descendant must land
by a human-merged PR, never a push to
main(ADR 0267) — the injected line is astale
push, and a push-mode session pushes external-origin work straight tomain.This is exactly what idss #2177 hit: the session pushed the fix to
main(
6454feb4) before detecting the marker, then reverted (43ee3181) and re-landedvia PR #2179. No net harm that time, but the window is real. idss #2181 asks that
the session re-check
landing_mode_forat land time rather than trust thepick-time snapshot.
The fix — close the window at the last revertible moment (the push)
git-hooks/pre-push— Gate 0. WhenSESSION_RUNNER_LAND_TICKETis set(exported by
session-runner.shfor the session subprocess; unset forswarm reconcile and human pushes, so a no-op there) and the push targets
refs/heads/main, re-resolvelanding_mode_forand block only on aCONFIRMED
prverdict, pointing atland-pr.sh. Fail-OPEN on anyresolution error (unreadable tracker / missing libs): the ticket was picked
push-mode, so under a forge blip the likeliest truth is still push, and a
fail-CLOSED gate here would wedge every push-mode session on a transient
fault — the inverse, larger hazard.
session-runner.sh. ExportSESSION_RUNNER_LAND_TICKET=$pickbefore theclaude call so the hook (and the
git pushthe session runs in that checkout,where
core.hooksPathis already wired to.sandcastle/git-hooks) can see theticket.
prompts/session-runner-prompt.md. Tell the push-branch session tore-check
landing_mode_forbefore pushing, so it lands cleanly as a PRinstead of hitting the hook wall.
Why a hard hook guard (design note for review)
idss #2181 offered two options: (a) the session re-checks at land time, or (b)
the runner resolves the line later. (b) alone can't close the window — the runner
hands off to a 2h claude session and can't resolve later than prompt-build. (a)
via prompt text alone is soft (relies on the LLM complying). The pre-push hook is
already wired into the session checkout and runs on the session's push to
main,so it is the natural hard enforcement point: it realises (a) without trusting
the model. The prompt change is kept as the cooperative path. Happy to drop
either half if you'd prefer a lighter touch.
Tests
tests/prepush-land-mode-gate-test.shdrives realgit pushes to a local bareremote with a stubbed
landing-lib:mainallowed (today's behaviour);prticket → push tomainblocked, naming #2181 +land-pr.sh;SESSION_RUNNER_LAND_TICKET— swarm/human) → allowed;prlanding's ownagent/issue-<N>push → allowed (onlymainis gated);The full offline suite was run; the only failure is the pre-existing
gate-lib-test.shgofmt-version mismatch on the runner host, reproducible on anunmodified checkout and untouched by this change.
Landing into consumers
This is factory-vendored machinery (ADR 0180); consumers pick it up by bumping
FACTORY_REFand re-vendoring.git-hooks/pre-push,session-runner.shandprompts/**are already in the vendor manifest; the new test ridestests/**.Context: idss #2181 (this ask), idss #2177 / PR #2179 (the incident), ADR 0267
(
landing-pr). Filed by the idss standing session-runner working #2181.🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.