Push-mode close-before-land: when the host fails/parks a land, should it reopen or flag the just-closed ticket? (#285 family) #288

Closed
opened 2026-10-17 21:09:59 +00:00 by matou-build-agent · 1 comment

Push-mode can close a ticket green, then fail/park its land — should the host reopen or flag it?

Surfaced by #285 and noted while closing #287 (see GOTCHAS 72’s updated body).

The gap

Under LANDING=push, close-report.sh gates against the pushed worker branch pre-land (by design — the host promotes the branch to main only after its own post-run verify). So a ticket can:

  1. pass its close-report gates on the worker branch,
  2. close success,
  3. and then have the host-side land fail or park (e.g. a STATUS.md merge conflict, a verify red),

leaving genuinely-verified work stranded on an unlanded branch while the tracker says the ticket is done. This is the #282 / #283 / #285 family; #285 stranded #240’s closed Board work (later re-landed by #286).

What to decide / build (host-side)

When the host’s land path fails or parks a run whose ticket already closed, should it:

  • reopen the just-closed ticket (relabel ready-for-session / ready-for-agent), or
  • flag it (a comment + a needs-info / agent-blocked label) for a human, or
  • leave it to the existing park/rescue ladder?

This is a change in landing-lib.sh / run-swarm.sh (the host promote-after-verify path), orthogonal to the STATUS.md contention fix (#287, done) — hence its own ticket rather than bundled there.

Notes

  • #287 removed STATUS.md’s rewritten header line, so the specific STATUS.md land conflict that triggered #285 is far less likely now — but any land-time red/park still has the same close-before-land window.
  • Related: GOTCHAS 72 (Residual), 66 (the host rebase-rescue ladder), ADR 0002 (the LANDING knob).
## Push-mode can close a ticket green, then fail/park its land — should the host reopen or flag it? Surfaced by #285 and noted while closing #287 (see GOTCHAS 72’s updated body). ### The gap Under `LANDING=push`, `close-report.sh` gates against the **pushed worker branch pre-land** (by design — the host promotes the branch to `main` only after its own post-run verify). So a ticket can: 1. pass its close-report gates on the worker branch, 2. close `success`, 3. and then have the host-side land **fail or park** (e.g. a STATUS.md merge conflict, a verify red), leaving genuinely-verified work stranded on an unlanded branch while the tracker says the ticket is done. This is the #282 / #283 / #285 family; #285 stranded #240’s closed Board work (later re-landed by #286). ### What to decide / build (host-side) When the host’s land path **fails or parks** a run whose ticket already closed, should it: - **reopen** the just-closed ticket (relabel `ready-for-session` / `ready-for-agent`), or - **flag** it (a comment + a `needs-info` / `agent-blocked` label) for a human, or - leave it to the existing park/rescue ladder? This is a change in `landing-lib.sh` / `run-swarm.sh` (the host promote-after-verify path), **orthogonal** to the STATUS.md contention fix (#287, done) — hence its own ticket rather than bundled there. ### Notes - #287 removed STATUS.md’s rewritten header line, so the specific *STATUS.md* land conflict that triggered #285 is far less likely now — but any land-time red/park still has the same close-before-land window. - Related: GOTCHAS 72 (Residual), 66 (the host rebase-rescue ladder), ADR 0002 (the `LANDING` knob).
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: wontfix — already implemented by #283 (landing_reopen_stranded_closes)

The behaviour this ticket asks us to decide and build — "when the host's land path fails or parks a run whose ticket already closed, should it reopen / flag / leave to the ladder?" — is already shipped by this ticket's own predecessor #283 (commit d5c4a95, closed), the false-green reconcile. The host does both (a) reopen AND (b) flag at once:

  • landing_reopen_stranded_closes (landing-lib.sh:711-747) reads the run's SANDCASTLE_ATTEMPT lines; for each outcome=success close whose claimed commits are not all reachable from origin/main AND whose issue still reads closed, it PATCH state:open, relabels ready-for-session (LANDING_REOPEN_LABEL, landing-lib.sh:681-687), and posts a comment naming SWARM_EXIT_REASON.
  • It is wired on both host land-did-not-advance-main exits in run-swarm.sh — the verify_protected_paths breach (run-swarm.sh:440-443) and the landing_stage park (run-swarm.sh:448-451).
  • The reachability guard (git merge-base --is-ancestor, landing-lib.sh:727) is the safety: a close whose commits did land is left closed, so honest work is never reopened.

Option (c) "leave it to the rescue ladder" is a non-answer for the ticket: the GOTCHAS 66 ladder only parks the commits on sandcastle/rescue-* — it never touched the closed issue. #283 is exactly the layer that closed that gap.

The three sub-nuances this ticket raises are each already decided in-code

  • push-failed-nothing-to-land (landing-lib.sh:643-646): HEAD is an ancestor of origin/main, so it is not stranded → not reopened. Correct.
  • rebase-rescue-limit-parked (landing-lib.sh:627): commits are not on main, so it is reopened — the fail-loud choice. The alternative (trust "next run retries", leave it closed) is the exact #285 invisible-stranded harm; reopening is the safer call and the guard ensures it only fires when genuinely stranded.
  • Queue choice ready-for-session vs the worker swarm: a deliberate, documented call (landing-lib.sh:681-687) — a machinery-adjacent close the swarm could not land is redone at the human-adjacent standing session rather than looped back at the swarm that keeps tripping.

Why this is a two-way door

Revertible by a later commit or a single label change (reopen + relabel), and on nobody's one-way-door list (no credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend).

What proves it

Existing red-first tests, both green on current main this run:

  • tests/landing-lib-test.sh → landing-lib: 121 passed, 0 failed (the landing_reopen_stranded_closes suite: stranded→reopen+relabel+comment, landed→left closed, already-open→no re-PATCH, non-success→never reopened, absent-file→no-op).
  • tests/run-swarm-landing-test.sh → run-swarm-landing: 13 scenarios passed (static guard that run-swarm.sh calls the reconcile on both land-fail exits).

One honest caveat (not a reopen reason)

Per GOTCHAS 4, #283 is landed on ROOT main but inert in the running .sandcastle/ self-copy until the next coordinated FACTORY_REF re-vendor (the same owed re-vendor #286 noted). So the behaviour exists in source; its activation in the live drainer rides that re-vendor — a deployment step already tracked, not fresh design work.

A genuinely new gap #283 explicitly spun out — "a generic-red sandcastle run that closed an earlier iteration's issue exits before verify and writes no attempts file" — is a different, narrower class than this ticket's land-fail/park path and would be its own follow-up if it bites; it does not keep this ticket open.

Closing as already-implemented. Veto anytime — reopen and I'll scope whatever residual you see.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** ## Ruling: `wontfix` — already implemented by #283 (`landing_reopen_stranded_closes`) The behaviour this ticket asks us to *decide and build* — "when the host's land path **fails or parks** a run whose ticket already closed, should it reopen / flag / leave to the ladder?" — is already shipped by this ticket's own predecessor **#283** (commit `d5c4a95`, closed), the false-green reconcile. The host does **both (a) reopen AND (b) flag** at once: - **`landing_reopen_stranded_closes`** (`landing-lib.sh:711-747`) reads the run's `SANDCASTLE_ATTEMPT` lines; for each `outcome=success` close whose claimed commits are **not all reachable from `origin/main`** AND whose issue still reads `closed`, it `PATCH state:open`, relabels **`ready-for-session`** (`LANDING_REOPEN_LABEL`, `landing-lib.sh:681-687`), and posts a comment naming `SWARM_EXIT_REASON`. - It is wired on **both** host land-did-not-advance-`main` exits in `run-swarm.sh` — the `verify_protected_paths` breach (`run-swarm.sh:440-443`) and the `landing_stage` park (`run-swarm.sh:448-451`). - The **reachability guard** (`git merge-base --is-ancestor`, `landing-lib.sh:727`) is the safety: a close whose commits *did* land is left closed, so honest work is never reopened. Option **(c) "leave it to the rescue ladder"** is a non-answer for the *ticket*: the GOTCHAS 66 ladder only parks the *commits* on `sandcastle/rescue-*` — it never touched the closed *issue*. #283 is exactly the layer that closed that gap. ### The three sub-nuances this ticket raises are each already decided in-code - `push-failed-nothing-to-land` (`landing-lib.sh:643-646`): HEAD *is* an ancestor of `origin/main`, so it is **not stranded → not reopened**. Correct. - `rebase-rescue-limit-parked` (`landing-lib.sh:627`): commits are **not** on `main`, so it **is** reopened — the fail-loud choice. The alternative (trust "next run retries", leave it closed) is the exact #285 invisible-stranded harm; reopening is the safer call and the guard ensures it only fires when genuinely stranded. - Queue choice **`ready-for-session`** vs the worker swarm: a deliberate, documented call (`landing-lib.sh:681-687`) — a machinery-adjacent close the swarm could not land is redone at the human-adjacent standing session rather than looped back at the swarm that keeps tripping. ### Why this is a two-way door Revertible by a later commit or a single label change (reopen + relabel), and on nobody's one-way-door list (no credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend). ### What proves it Existing red-first tests, both green on current `main` this run: - `tests/landing-lib-test.sh` → `landing-lib: 121 passed, 0 failed` (the `landing_reopen_stranded_closes` suite: stranded→reopen+relabel+comment, landed→left closed, already-open→no re-PATCH, non-success→never reopened, absent-file→no-op). - `tests/run-swarm-landing-test.sh` → `run-swarm-landing: 13 scenarios passed` (static guard that run-swarm.sh calls the reconcile on **both** land-fail exits). ### One honest caveat (not a reopen reason) Per **GOTCHAS 4**, #283 is landed on ROOT `main` but **inert in the running `.sandcastle/` self-copy** until the next coordinated `FACTORY_REF` re-vendor (the same owed re-vendor #286 noted). So the behaviour exists in source; its activation in the live drainer rides that re-vendor — a deployment step already tracked, not fresh design work. A genuinely *new* gap #283 explicitly spun out — "a generic-red sandcastle run that closed an earlier iteration's issue exits before verify and writes no attempts file" — is a **different, narrower** class than this ticket's land-fail/park path and would be its own follow-up if it bites; it does not keep this ticket open. Closing as already-implemented. Veto anytime — reopen and I'll scope whatever residual you see.
matou-build-agent 2026-10-17 21:41:49 +00:00
Sign in to join this conversation.
No milestone
No project
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#288
No description provided.