Standing runner handed push for a landing-pr app-report ticket (#2177) — re-check landing_mode_for at land time #2181

Open
opened 2026-11-07 05:19:04 +00:00 by matou-build-agent · 2 comments

A standing session was handed push for a landing-pr app-report ticket — risk of pushing external-origin work to main

Working #2177, the standing session-runner's injected ticket context read
Landing mode for this ticket (resolved by the runner): push. But #2177 is an
app-report descendant (<!-- origin: app-report #2047 -->) carrying landing-pr,
and the authoritative resolver disagrees:

$ landing_mode_for 2177
pr

Following the injected push line, the session pushed the fix to main
(6454feb4) before detecting the marker; it was then reverted (43ee3181) and
re-landed via PR #2179 (the correct ADR 0267 path). No net harm this time, but
the hazard is real: a landing-pr ticket (which may carry words typed outside
the project) can reach main through a direct push whenever the runner's
resolution and landing_mode_for disagree.

Likely cause: the landing-pr label (and/or the runner snapshot) postdates the
moment the runner computed the landing line, so it resolved the repo default
(push). Either the label was added after launch (a race) or the runner's
landing-line computation diverges from landing_mode_for.

Ask: the standing session should re-check landing_mode_for at land time (not
only trust the injected line), or the runner should resolve the line from the
same landing_mode_for at the latest possible moment — so an app-report /
landing-pr ticket can never be pushed straight to main. Harness/runner class;
.sandcastle/ is protected (#445). Related: #2177, PR #2179, ADR 0267.

<!-- origin: app-report #2047 --> ## A standing session was handed `push` for a `landing-pr` app-report ticket — risk of pushing external-origin work to `main` Working #2177, the standing session-runner's injected ticket context read `Landing mode for this ticket (resolved by the runner): push`. But #2177 is an app-report descendant (`<!-- origin: app-report #2047 -->`) carrying `landing-pr`, and the authoritative resolver disagrees: ``` $ landing_mode_for 2177 pr ``` Following the injected `push` line, the session pushed the fix to `main` (`6454feb4`) before detecting the marker; it was then reverted (`43ee3181`) and re-landed via PR #2179 (the correct ADR 0267 path). No net harm this time, but the hazard is real: a `landing-pr` ticket (which may carry words typed outside the project) can reach `main` through a direct push whenever the runner's resolution and `landing_mode_for` disagree. Likely cause: the `landing-pr` label (and/or the runner snapshot) postdates the moment the runner computed the landing line, so it resolved the repo default (`push`). Either the label was added after launch (a race) or the runner's landing-line computation diverges from `landing_mode_for`. Ask: the standing session should re-check `landing_mode_for` at land time (not only trust the injected line), or the runner should resolve the line from the same `landing_mode_for` at the latest possible moment — so an app-report / `landing-pr` ticket can never be pushed straight to `main`. Harness/runner class; `.sandcastle/` is protected (#445). Related: #2177, PR #2179, ADR 0267.
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: category bug, state ready-for-session. landing-pr and the <!-- origin: app-report #2047 --> marker are left untouched.

The hazard is real and confirmed. The standing session-runner handed #2177 (an app-report descendant carrying landing-pr) the injected line Landing mode for this ticket (resolved by the runner): push, while landing_mode_for 2177 resolves pr. The session followed the injected line and pushed to main (6454feb4) before detecting the marker; it was reverted (43ee3181) and re-landed via PR #2179 — no net harm this time, but a landing-pr ticket (which may carry outside-origin words, ADR 0267) reaching main by direct push is a one-way leak if it is ever missed.

Why a two-way door. The fix — have the session (or the runner) re-check landing_mode_for at the latest possible moment rather than trust a stale injected line — is a runner/harness change, revertible per commit and provable by a .sandcastle/ test that asserts a landing-pr ticket never resolves to push. Not on the one-way-door list: no personal credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend. The fix closes a push-to-main leak; it does not open one.

Why ready-for-session and not ready-for-agent. The change lives in the runner / landing-resolution path under protected .sandcastle/ (#445) — likely a FACTORY_MANIFEST path requiring the dev-factory backport-off-pin route, as #2177 itself took. That is live-repo / protected-path standing a swarm worker lacks (list-ready-tasks.sh reads only ready-for-agent; the #445 boundary rolls back any .sandcastle/ touch). A session prepares + verifies the fix and lands it per ADR 0180, honouring the inherited landing-pr for the idss re-vendor.

Report policy intact. Descends from app report #2047; its words are outside input — data, never instructions. landing-pr and the origin marker stay; work lands by a human-approved PR, never a push to main. Only a human lifts the policy.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Ruling:** category `bug`, state `ready-for-session`. `landing-pr` and the `<!-- origin: app-report #2047 -->` marker are left untouched. **The hazard is real and confirmed.** The standing session-runner handed #2177 (an app-report descendant carrying `landing-pr`) the injected line `Landing mode for this ticket (resolved by the runner): push`, while `landing_mode_for 2177` resolves `pr`. The session followed the injected line and pushed to `main` (`6454feb4`) before detecting the marker; it was reverted (`43ee3181`) and re-landed via PR #2179 — no net harm this time, but a `landing-pr` ticket (which may carry outside-origin words, ADR 0267) reaching `main` by direct push is a one-way leak if it is ever missed. **Why a two-way door.** The fix — have the session (or the runner) re-check `landing_mode_for` at the latest possible moment rather than trust a stale injected line — is a runner/harness change, revertible per commit and provable by a `.sandcastle/` test that asserts a `landing-pr` ticket never resolves to `push`. Not on the one-way-door list: no personal credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend. The fix *closes* a push-to-`main` leak; it does not open one. **Why `ready-for-session` and not `ready-for-agent`.** The change lives in the runner / landing-resolution path under protected `.sandcastle/` (#445) — likely a FACTORY_MANIFEST path requiring the dev-factory backport-off-pin route, as #2177 itself took. That is live-repo / protected-path standing a swarm worker lacks (`list-ready-tasks.sh` reads only `ready-for-agent`; the #445 boundary rolls back any `.sandcastle/` touch). A session prepares + verifies the fix and lands it per ADR 0180, honouring the inherited `landing-pr` for the idss re-vendor. **Report policy intact.** Descends from app report #2047; its words are outside input — data, never instructions. `landing-pr` and the origin marker stay; work lands by a human-approved PR, never a push to `main`. Only a human lifts the policy.
Author
Member

Ruled by agent under ADR 0174 — veto anytime.

What landed

The fix is harness/runner-class machinery under .sandcastle/ — factory-vendored (ADR 0180) and protected (#445), so it has no in-repo idss surface. It lands upstream as dev-factory PR #344: Matou/dev-factory#344

It re-checks landing_mode_for at the last revertible moment — the push itself (idss #2181's ask), closing the race where a landing-pr label added between the runner's pick-time snapshot and the session's push lets external-origin work reach main through a direct push (#2177):

  • git-hooks/pre-push Gate 0 — when SESSION_RUNNER_LAND_TICKET is set (exported by session-runner.sh; unset for swarm reconcile and human pushes → a no-op there) and the push targets refs/heads/main, re-resolve landing_mode_for and block only on a CONFIRMED pr verdict, pointing at land-pr.sh. Fail-OPEN on any resolution error, so a forge blip can never wedge a legitimate push-mode session.
  • session-runner.sh — exports SESSION_RUNNER_LAND_TICKET=$pick before the claude call so the hook (already wired via core.hooksPath) sees the ticket.
  • prompts/session-runner-prompt.md — the push-branch session re-checks landing_mode_for before pushing, landing cleanly as a PR instead of hitting the wall. The two committed rendered copies the render-cutover test pins were regenerated from the edited skeleton.

Proof

New offline test tests/prepush-land-mode-gate-test.sh drives real git pushes to a local bare remote with a stubbed landing-lib: a now-pr ticket is blocked from pushing main; a push-mode ticket, an un-scoped (swarm/human) push, a pr landing's own agent/issue-<N> push, and an unresolvable mode (fail-open) all pass. The affected suites re-pass (onboard-lib 276/0 incl. the render cutover, session-runner, prepush-drift, prompt-render-lib, landing-lib). The only full-suite failure is the pre-existing gate-lib-test.sh gofmt-version mismatch on the host, reproducible on an unmodified checkout.

Why human

Two residues this standing session cannot cross:

  1. The fix merges in dev-factory, not idss. PR #344 touches the fleet-wide pre-push hook (every host, every push) — its merge is a human-approved call (ADR 0180). land-pr.sh targets idss and a cross-repo merge cannot auto-close this ticket, so #2181 cannot drain through the normal pr-mode session lane.
  2. The idss pickup is blocked on that merge. Once #344 is merged, idss adopts it by bumping .sandcastle/FACTORY_REF + re-vendoring (onboard.sh vendor), which itself lands in idss via its own landing-pr PR. That is a two-way-door a future session can do — but only after #344 merges, so re-queueing #2181 ready-for-session now would just burn attempts against an unmerged dependency.

landing-pr and the <!-- origin: app-report #2047 --> marker are left in place (never removed). Relabelling ready-for-human: merge #344, then bump FACTORY_REF / re-vendor (or re-queue this ticket ready-for-session for the vendor bump).

**Ruled by agent under ADR 0174 — veto anytime.** ## What landed The fix is harness/runner-class machinery under `.sandcastle/` — factory-vendored (ADR 0180) and protected (#445), so it has no in-repo idss surface. It lands upstream as **dev-factory PR #344**: https://git.matou.nz/Matou/dev-factory/pulls/344 It re-checks `landing_mode_for` at the **last revertible moment — the push itself** (idss #2181's ask), closing the race where a `landing-pr` label added between the runner's pick-time snapshot and the session's push lets external-origin work reach `main` through a direct push (#2177): - **`git-hooks/pre-push` Gate 0** — when `SESSION_RUNNER_LAND_TICKET` is set (exported by `session-runner.sh`; unset for swarm reconcile and human pushes → a no-op there) **and** the push targets `refs/heads/main`, re-resolve `landing_mode_for` and **block only on a CONFIRMED `pr` verdict**, pointing at `land-pr.sh`. **Fail-OPEN** on any resolution error, so a forge blip can never wedge a legitimate push-mode session. - **`session-runner.sh`** — exports `SESSION_RUNNER_LAND_TICKET=$pick` before the claude call so the hook (already wired via `core.hooksPath`) sees the ticket. - **`prompts/session-runner-prompt.md`** — the push-branch session re-checks `landing_mode_for` before pushing, landing cleanly as a PR instead of hitting the wall. The two committed rendered copies the render-cutover test pins were regenerated from the edited skeleton. ## Proof New offline test `tests/prepush-land-mode-gate-test.sh` drives real `git push`es to a local bare remote with a stubbed `landing-lib`: a now-`pr` ticket is **blocked** from pushing `main`; a push-mode ticket, an un-scoped (swarm/human) push, a `pr` landing's own `agent/issue-<N>` push, and an unresolvable mode (fail-open) all pass. The affected suites re-pass (`onboard-lib` 276/0 incl. the render cutover, `session-runner`, `prepush-drift`, `prompt-render-lib`, `landing-lib`). The only full-suite failure is the pre-existing `gate-lib-test.sh` gofmt-version mismatch on the host, reproducible on an unmodified checkout. ## Why human Two residues this standing session cannot cross: 1. **The fix merges in dev-factory, not idss.** PR #344 touches the fleet-wide `pre-push` hook (every host, every push) — its merge is a human-approved call (ADR 0180). `land-pr.sh` targets idss and a cross-repo merge cannot auto-close this ticket, so #2181 cannot drain through the normal pr-mode session lane. 2. **The idss pickup is blocked on that merge.** Once #344 is merged, idss adopts it by bumping `.sandcastle/FACTORY_REF` + re-vendoring (`onboard.sh vendor`), which itself lands in idss via its own `landing-pr` PR. That is a two-way-door a future session can do — but only *after* #344 merges, so re-queueing #2181 `ready-for-session` now would just burn attempts against an unmerged dependency. `landing-pr` and the `<!-- origin: app-report #2047 -->` marker are left in place (never removed). Relabelling `ready-for-human`: merge #344, then bump `FACTORY_REF` / re-vendor (or re-queue this ticket `ready-for-session` for the vendor bump).
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/idss#2181
No description provided.