healer: design a pr-mode healer that OPENS a PR for its harness-infra fix (pr-default repos) — #167 follow-up #168

Open
opened 2026-09-22 21:17:29 +00:00 by matou-build-agent · 2 comments

Follow-up from #167 (which gave the swarm healer a landing-mode gate: in a pr-DEFAULT repo heal.sh now tells its investigation to DIAGNOSE + ESCALATE and bars the direct-to-main repair push, rather than land unreviewed).

#167 chose the safe degrade — the strongest lever heal.sh owns without redesigning the healer's execution model, since it cannot mechanically intercept a git push inside the agent's own claude -p session without also killing the (read-only, valuable) diagnosis. That closes the safety gap: a future pr-default consumer's healer can no longer bypass the PR rail.

The richer behaviour it deliberately did NOT build: a pr-mode healer that OPENS a PR for its own harness-infra fix (so the healer still LANDS work in a pr-default repo, just reviewed). That is genuine design work, not a two-way mechanical edit, because a heal has no ticket number:

  • Branch naming — there is no agent/issue-<N> (no ticket); a heal PR needs its own convention (e.g. sandcastle/heal-<sig> or heal/<sig>), and landing-lib.sh's whole seam set is keyed on an issue number.
  • PR body — closes #N doesn't apply; what does the heal PR reference, and how is it deduped against a recurring fault's earlier PR?
  • Merge authority — does MERGE_AUTHORITY=agent-after-green extend to a heal PR, or is a human always required for an unattended harness-infra change?
  • Evidence gate — landing_evidence_gate (screenshots-or-waiver) is product-surface shaped; a harness-infra heal has none.
  • The reconcile/idle-sweep machinery (landing_open_agent_issues, landing_sweep_orphans) is all agent/issue-branch-scoped and would need a parallel heal-PR path.

Deferred, not urgent: factory + idss are both push repos today, so neither the safety gap nor this enhancement bites any current consumer — it matters only when a pr-default consumer also runs the healer AND wants the healer to keep landing (vs. escalating). Until then #167's diagnose-and-escalate degrade is the correct, safe default.

Suggest tackling this alongside (or after) the render ticket that wires a multi-issue-per-run pr flow (referenced in landing-lib.sh's landing_reconcile note), since both need per-branch push semantics decoupled from a single claimed ticket.

Filed by the standing session that ruled #167 (ADR 0174).

Follow-up from #167 (which gave the swarm healer a landing-mode gate: in a pr-DEFAULT repo `heal.sh` now tells its investigation to DIAGNOSE + ESCALATE and bars the direct-to-`main` repair push, rather than land unreviewed). #167 chose the **safe degrade** — the strongest lever `heal.sh` owns without redesigning the healer's execution model, since it cannot mechanically intercept a `git push` inside the agent's own `claude -p` session without also killing the (read-only, valuable) diagnosis. That closes the *safety* gap: a future pr-default consumer's healer can no longer bypass the PR rail. The **richer** behaviour it deliberately did NOT build: a pr-mode healer that OPENS a PR for its own harness-infra fix (so the healer still LANDS work in a pr-default repo, just reviewed). That is genuine design work, not a two-way mechanical edit, because a heal has no ticket number: - **Branch naming** — there is no `agent/issue-<N>` (no ticket); a heal PR needs its own convention (e.g. `sandcastle/heal-<sig>` or `heal/<sig>`), and `landing-lib.sh`'s whole seam set is keyed on an issue number. - **PR body** — `closes #N` doesn't apply; what does the heal PR reference, and how is it deduped against a recurring fault's earlier PR? - **Merge authority** — does `MERGE_AUTHORITY=agent-after-green` extend to a heal PR, or is a human always required for an unattended harness-infra change? - **Evidence gate** — `landing_evidence_gate` (screenshots-or-waiver) is product-surface shaped; a harness-infra heal has none. - **The reconcile/idle-sweep machinery** (`landing_open_agent_issues`, `landing_sweep_orphans`) is all agent/issue-branch-scoped and would need a parallel heal-PR path. Deferred, not urgent: factory + idss are both **push** repos today, so neither the safety gap nor this enhancement bites any current consumer — it matters only when a pr-default consumer also runs the healer AND wants the healer to keep landing (vs. escalating). Until then #167's diagnose-and-escalate degrade is the correct, safe default. Suggest tackling this alongside (or after) the render ticket that wires a multi-issue-per-run pr flow (referenced in `landing-lib.sh`'s `landing_reconcile` note), since both need per-branch push semantics decoupled from a single claimed ticket. Filed by the standing session that ruled #167 (ADR 0174).
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: DEFERRED (category enhancement)

Parked with revisit criteria, not worked now. This ticket is the richer design residual that #167 deliberately did not build — a healer that OPENS a reviewed PR for its own harness-infra fix in a pr-default repo, instead of #167's diagnose-and-escalate degrade.

Why this is a two-way door (not a ready-for-human one-way door): the decision here is whether to build now vs. park — fully reversible by a later label change (remove deferred, re-label for the pipeline). It touches no personal credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend. When the design work itself is picked up, its individual choices (branch convention, dedup, evidence gate) are likewise revertible; the one genuinely load-bearing sub-decision — whether MERGE_AUTHORITY=agent-after-green may extend to an unattended harness-infra heal PR, or a human must always merge — is a trust call that the future design session surfaces as its own ready-for-human residue at that time. Nothing forces that call today.

What proves it's safe to park: #167 already shipped the safety half — heal.sh's HEAL_NO_LAND gate bars a direct-to-main repair in a pr-default repo and hands the incident to diagnose+ESCALATE — and that behaviour is proven by tests/heal-test.sh (the pr-default scenario: the no-land directive is present and a non-ticket repair is not marked repaired; a push repo keeps the repair path). So no consumer's healer can bypass the PR rail today; this enhancement is purely additive richer behaviour (keep landing, just reviewed), never a safety requirement.

Revisit criteria

Lift deferred and re-label for the pipeline when both hold:

  1. A pr-default consumer (LANDING=pr) actually runs the swarm healer (healer.yml), and
  2. its operators want that healer to auto-land its own harness-infra fix through a reviewed PR rather than accept #167's diagnose-and-escalate default (a human opens the PR).

Note: pregnancy-navigator is already LANDING=pr and runs the healer, but #167's escalate degrade is the correct, safe default for it today — criterion 2 (wanting the healer to keep landing vs. escalate) is the trigger, and it is an operator preference, not yet expressed.

Co-schedule: tackle alongside the multi-issue-per-run pr-flow render ticket referenced in landing-lib.sh's landing_reconcile note — both need per-branch push semantics decoupled from a single claimed ticket (a heal has no ticket number; landing-lib.sh's whole seam set is keyed on #N).

Ruled 2026-09-22 by the headless triage agent under ADR 0174 (two-way-door doctrine, inherited via ADR 0001). Ben's veto is asynchronous and non-blocking — remove deferred to re-open for the pipeline.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** ## Ruling: DEFERRED (category `enhancement`) Parked with revisit criteria, not worked now. This ticket is the richer design residual that #167 deliberately did **not** build — a healer that OPENS a reviewed PR for its own harness-infra fix in a pr-default repo, instead of #167's diagnose-and-escalate degrade. **Why this is a two-way door (not a `ready-for-human` one-way door):** the decision here is *whether to build now vs. park* — fully reversible by a later label change (remove `deferred`, re-label for the pipeline). It touches no personal credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend. When the design work itself is picked up, its individual choices (branch convention, dedup, evidence gate) are likewise revertible; the one genuinely load-bearing sub-decision — whether `MERGE_AUTHORITY=agent-after-green` may extend to an *unattended* harness-infra heal PR, or a human must always merge — is a trust call that the future design session surfaces as its own `ready-for-human` residue at that time. Nothing forces that call today. **What proves it's safe to park:** #167 already shipped the *safety* half — `heal.sh`'s `HEAL_NO_LAND` gate bars a direct-to-`main` repair in a pr-default repo and hands the incident to diagnose+ESCALATE — and that behaviour is proven by `tests/heal-test.sh` (the pr-default scenario: the no-land directive is present and a non-ticket repair is not marked `repaired`; a push repo keeps the repair path). So no consumer's healer can bypass the PR rail today; this enhancement is purely *additive richer behaviour* (keep landing, just reviewed), never a safety requirement. ## Revisit criteria Lift `deferred` and re-label for the pipeline when **both** hold: 1. A **pr-default** consumer (`LANDING=pr`) actually **runs the swarm healer** (`healer.yml`), **and** 2. its operators want that healer to **auto-land its own harness-infra fix through a reviewed PR** rather than accept #167's diagnose-and-escalate default (a human opens the PR). Note: pregnancy-navigator is already `LANDING=pr` and runs the healer, but #167's escalate degrade is the correct, safe default for it today — criterion 2 (wanting the healer to *keep landing* vs. escalate) is the trigger, and it is an operator preference, not yet expressed. **Co-schedule:** tackle alongside the multi-issue-per-run pr-flow render ticket referenced in `landing-lib.sh`'s `landing_reconcile` note — both need per-branch push semantics decoupled from a single claimed ticket (a heal has no ticket number; `landing-lib.sh`'s whole seam set is keyed on `#N`). _Ruled 2026-09-22 by the headless triage agent under ADR 0174 (two-way-door doctrine, inherited via ADR 0001). Ben's veto is asynchronous and non-blocking — remove `deferred` to re-open for the pipeline._
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

  • Ruling: keep deferred (no state role applied). This is a conscious, well-documented park and its revisit criteria are still unmet.
  • Why this is a two-way door: the park is reversible by a later label change; the one load-bearing sub-decision (whether MERGE_AUTHORITY=agent-after-green may extend to an unattended harness-infra heal PR) is correctly flagged to surface as its own ready-for-human residue when the design is picked up — not now.
  • What proves the park is still safe: #167's safety degrade is live and tested — heal.sh sets HEAL_NO_LAND=1 under LANDING=pr and emits the no-land/escalate directive, and tests/heal-test.sh proves the pr-default path carries that directive and marks no repair. No consumer's healer can bypass the PR rail today, so parking this richer behaviour costs no consumer.

Triage disposition: remains deferred — a legitimate, reasoned park, not an untriaged ticket.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** - **Ruling:** keep `deferred` (no state role applied). This is a conscious, well-documented park and its revisit criteria are still unmet. - **Why this is a two-way door:** the park is reversible by a later label change; the one load-bearing sub-decision (whether `MERGE_AUTHORITY=agent-after-green` may extend to an unattended harness-infra heal PR) is correctly flagged to surface as its own `ready-for-human` residue *when* the design is picked up — not now. - **What proves the park is still safe:** #167's safety degrade is live and tested — `heal.sh` sets `HEAL_NO_LAND=1` under `LANDING=pr` and emits the no-land/escalate directive, and `tests/heal-test.sh` proves the pr-default path carries that directive and marks no repair. No consumer's healer can bypass the PR rail today, so parking this richer behaviour costs no consumer. _Triage disposition: remains `deferred` — a legitimate, reasoned park, not an untriaged ticket._
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#168
No description provided.