Forward-port the #2048 forgejo-lib/heal fix onto dev-factory main (conflicts the #188/#203 rework; gates #1684) #2049

Open
opened 2026-10-16 13:25:24 +00:00 by matou-build-agent · 2 comments

The #2048 harness fix (bounded forgejo_get GET retry in forgejo-lib.sh; runner-unit detection + pool-locality honesty in heal.sh) landed in idss via the dev-factory cheap-backport branch backport/idss-2048 (SHA 7d40af3, authored off the pinned FACTORY_REF 1aba93c), then re-vendored. It is NOT yet on dev-factory main.

The forgejo-lib.sh half cherry-picks onto dev-factory main cleanly (that file is byte-identical pin→main). The heal.sh half conflicts: main's heal rework (#188 collect_job_logs, #203 healer bound) diverged the file by ~281 lines and tests/heal-test.sh by ~404, so the helper placement and the appended AC3/AC4 scenarios need manual interleaving. The actual code hunks (the journalctl unit line and the pool-locality block) are byte-identical pin→main and apply cleanly — only the surrounding insertions conflict.

dev-factory is now LANDING=pr (its own commit 9930a2c), so this must land by a reviewed PR against dev-factory main, not a direct push. Doing it from this headless session — resolving a 385-line test conflict against a file not yet audited and pushing it unreviewed to a shared repo other products consume — was judged outside a two-way-door session's safe remit (ADR 0174).

Why it matters: idss's eventual adoption of dev-factory main HEAD is the watched, human-gated #1684. If the fix is not on main by then, that adoption silently regresses all three gaps. Land this before (or as part of) #1684.

Filed as a follow-up of #2048 by the standing session (ADR 0174).

The #2048 harness fix (bounded `forgejo_get` GET retry in `forgejo-lib.sh`; runner-unit detection + pool-locality honesty in `heal.sh`) landed in idss via the dev-factory cheap-backport branch `backport/idss-2048` (SHA `7d40af3`, authored off the pinned `FACTORY_REF` `1aba93c`), then re-vendored. It is NOT yet on dev-factory `main`. The `forgejo-lib.sh` half cherry-picks onto dev-factory `main` cleanly (that file is byte-identical pin→main). The `heal.sh` half conflicts: `main`'s heal rework (#188 collect_job_logs, #203 healer bound) diverged the file by ~281 lines and `tests/heal-test.sh` by ~404, so the helper placement and the appended AC3/AC4 scenarios need manual interleaving. The actual code hunks (the journalctl unit line and the pool-locality block) are byte-identical pin→main and apply cleanly — only the surrounding insertions conflict. dev-factory is now `LANDING=pr` (its own commit `9930a2c`), so this must land by a reviewed PR against dev-factory `main`, not a direct push. Doing it from this headless session — resolving a 385-line test conflict against a file not yet audited and pushing it unreviewed to a shared repo other products consume — was judged outside a two-way-door session's safe remit (ADR 0174). Why it matters: idss's eventual adoption of dev-factory `main` HEAD is the watched, human-gated #1684. If the fix is not on `main` by then, that adoption silently regresses all three gaps. Land this before (or as part of) #1684. Filed as a follow-up of #2048 by the standing session (ADR 0174).
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: category bug, state ready-for-session (not ready-for-human, not ready-for-agent).

Why a two-way door. Forward-porting the #2048 fix onto dev-factory main is 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. It is revertible by a later commit (git revert on dev-factory) and provable by an existing probe (tests/heal-test.sh, carrying the appended AC3/AC4 scenarios). So it is a two-way door.

Why ready-for-session and not ready-for-agent. This is cross-repo work on dev-factory, needing that repo's push standing and a judgment-heavy manual interleaving of a ~385-line heal.sh/heal-test.sh conflict against the #188/#203 rework — live-repo standing a swarm worker lacks (list-ready-tasks.sh reads only ready-for-agent). Consistent with the parent #2048, also ready-for-session.

Why not ready-for-human. The standing session's judgment in the body — "pushing it unreviewed to a shared repo" — is resolved by dev-factory's own LANDING=pr: an interactive session resolves the conflict and opens the PR; the sole human residue is the routine PR merge approval, which is the standing landing mechanism, not a triage-assigned one-way door.

What proves it. The two actual code hunks (the journalctl runner-unit line and the pool-locality block) are byte-identical pin→main and apply cleanly; forgejo-lib.sh cherry-picks clean; tests/heal-test.sh green after the manual interleave verifies the AC3/AC4 behaviour. Revert on dev-factory main if wrong.

Brief for the session. Land before (or as part of) the human-gated #1684. (1) Cherry-pick the clean forgejo-lib.sh half (byte-identical pin→main). (2) Manually interleave the heal.sh helper placement and the appended AC3/AC4 scenarios in tests/heal-test.sh around the #188 collect_job_logs / #203 healer-bound divergence; the code hunks apply clean, only the surrounding insertions conflict. (3) Open a reviewed PR against dev-factory main (dev-factory is LANDING=pr); human approves the merge. Source: idss backport/idss-2048 SHA 7d40af3, authored off pinned FACTORY_REF 1aba93c.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Ruling:** category `bug`, state `ready-for-session` (not `ready-for-human`, not `ready-for-agent`). **Why a two-way door.** Forward-porting the #2048 fix onto dev-factory `main` is 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. It is revertible by a later commit (`git revert` on dev-factory) and provable by an existing probe (`tests/heal-test.sh`, carrying the appended AC3/AC4 scenarios). So it is a two-way door. **Why `ready-for-session` and not `ready-for-agent`.** This is cross-repo work on dev-factory, needing that repo's push standing and a judgment-heavy manual interleaving of a ~385-line `heal.sh`/`heal-test.sh` conflict against the #188/#203 rework — live-repo standing a swarm worker lacks (`list-ready-tasks.sh` reads only `ready-for-agent`). Consistent with the parent #2048, also `ready-for-session`. **Why not `ready-for-human`.** The standing session's judgment in the body — "pushing it *unreviewed* to a shared repo" — is resolved by dev-factory's own `LANDING=pr`: an interactive session resolves the conflict and opens the PR; the sole human residue is the routine PR merge approval, which is the standing landing mechanism, not a triage-assigned one-way door. **What proves it.** The two actual code hunks (the journalctl runner-unit line and the pool-locality block) are byte-identical pin→main and apply cleanly; `forgejo-lib.sh` cherry-picks clean; `tests/heal-test.sh` green after the manual interleave verifies the AC3/AC4 behaviour. Revert on dev-factory `main` if wrong. **Brief for the session.** Land before (or as part of) the human-gated #1684. (1) Cherry-pick the clean `forgejo-lib.sh` half (byte-identical pin→main). (2) Manually interleave the `heal.sh` helper placement and the appended AC3/AC4 scenarios in `tests/heal-test.sh` around the #188 `collect_job_logs` / #203 healer-bound divergence; the code hunks apply clean, only the surrounding insertions conflict. (3) Open a reviewed PR against dev-factory `main` (dev-factory is `LANDING=pr`); human approves the merge. Source: idss `backport/idss-2048` SHA `7d40af3`, authored off pinned `FACTORY_REF` `1aba93c`.
Author
Member

Ruled by agent under ADR 0174 — veto anytime.

The two-way-door half of this forward-port is done and proven; the one remaining step — a reviewed merge into shared dev-factory main — is the human residue (see ## Why human below).

What landed

A forward-port PR against dev-factory main: Matou/dev-factory #243 (branch forward-port/idss-2048, commit bbc2d6d).

  • forgejo-lib.sh + tests/forgejo-lib-test.sh cherry-picked cleanly (byte-identical pin→main) — verified git diff 7d40af3 is empty for both.
  • heal.sh + tests/heal-test.sh interleaved by hand against main's #188 (collect_job_logs) / #203 (healer bound) rework. The three actual code hunks applied unchanged; only the surrounding insertions conflicted:
    • heal.sh: HEAL_WORKDIR_LOCK + job_ran_here now sit alongside main's collect_job_logs (both independent helpers after api()); the runner-unit-detection hunk and the pool-locality msg branch applied clean.
    • tests/heal-test.sh: top hermetic-env exports + the capture-agent runner-journal.txt copy applied clean; the #2048 AC3 + AC4 scenarios appended after main's scenarios; final count 30 → 32.

Proof (the branch, offline — the repo's own suites)

  • tests/forgejo-lib-test.sh → 64 passed, 0 failed
  • tests/heal-test.sh → 32 scenarios passed
  • bash -n clean across every script (the CI static job's first half)
  • Diff scope is exactly the 4 expected files; shellcheck was unavailable in this session, so CI's shellcheck on the PR is the remaining gate (the resolution is a pure union of two individually-clean changesets, each of which already passed static in its own context).

Why this was a two-way door (not the push the #2048 session refused)

The #2048 session refused resolving the conflict and pushing it unreviewed to a shared repo. Opening a reviewed PR is the opposite path: the branch push is inert for consumers (they pin FACTORY_REF to a SHA on main; a branch changes nothing they see), the resolution is proven by dev-factory's own test suites, and it is revertible (close PR / delete branch). The actual landing on main stays gated.

Why human

dev-factory is LANDING=pr; merging an unaudited change into shared main that all three products consume is a human-reviewed step (my host token has push but not admin/merge, and ADR 0174 keeps a shared-repo merge off a headless session regardless). The residue is: review + merge dev-factory PR #243. Once merged, idss's own adoption (bump FACTORY_REF to the merged SHA + re-vendor) rides the human-gated #1684 — no idss commit is made by this session, so STATUS.md is unchanged (it already records this as OWED under the #2048 entry).

Routing ready-for-session → ready-for-human.

**Ruled by agent under ADR 0174 — veto anytime.** The two-way-door half of this forward-port is **done and proven**; the one remaining step — a reviewed merge into shared dev-factory `main` — is the human residue (see `## Why human` below). ## What landed A forward-port PR against dev-factory `main`: **[Matou/dev-factory #243](https://git.matou.nz/Matou/dev-factory/pulls/243)** (branch `forward-port/idss-2048`, commit `bbc2d6d`). - **`forgejo-lib.sh` + `tests/forgejo-lib-test.sh`** cherry-picked cleanly (byte-identical pin→main) — verified `git diff 7d40af3` is empty for both. - **`heal.sh` + `tests/heal-test.sh`** interleaved by hand against main's #188 (`collect_job_logs`) / #203 (healer bound) rework. The three actual code hunks applied unchanged; only the surrounding insertions conflicted: - `heal.sh`: `HEAL_WORKDIR_LOCK` + `job_ran_here` now sit alongside main's `collect_job_logs` (both independent helpers after `api()`); the runner-unit-detection hunk and the pool-locality `msg` branch applied clean. - `tests/heal-test.sh`: top hermetic-env exports + the capture-agent `runner-journal.txt` copy applied clean; the #2048 **AC3** + **AC4** scenarios appended after main's scenarios; final count 30 → 32. ## Proof (the branch, offline — the repo's own suites) - `tests/forgejo-lib-test.sh` → **64 passed, 0 failed** - `tests/heal-test.sh` → **32 scenarios passed** - `bash -n` clean across every script (the CI `static` job's first half) - Diff scope is exactly the 4 expected files; `shellcheck` was unavailable in this session, so CI's shellcheck on the PR is the remaining gate (the resolution is a pure union of two individually-clean changesets, each of which already passed `static` in its own context). ## Why this was a two-way door (not the push the #2048 session refused) The #2048 session refused *resolving the conflict and pushing it **unreviewed** to a shared repo*. Opening a **reviewed PR** is the opposite path: the branch push is inert for consumers (they pin `FACTORY_REF` to a SHA on `main`; a branch changes nothing they see), the resolution is proven by dev-factory's own test suites, and it is revertible (close PR / delete branch). The actual landing on `main` stays gated. ## Why human dev-factory is `LANDING=pr`; merging an unaudited change into shared `main` that all three products consume is a human-reviewed step (my host token has `push` but not `admin`/merge, and ADR 0174 keeps a shared-repo merge off a headless session regardless). **The residue is: review + merge dev-factory PR #243.** Once merged, idss's own adoption (bump `FACTORY_REF` to the merged SHA + re-vendor) rides the human-gated #1684 — no idss commit is made by this session, so `STATUS.md` is unchanged (it already records this as OWED under the #2048 entry). Routing `ready-for-session` → `ready-for-human`.
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#2049
No description provided.