* fix(delegation): correct the delegate_task text the model reads
Text the model reads described behaviour the code does not have:
- The tool description sent durable work to
terminal(background=True, notify=True). A background process ends
with its session unless it is started with persist_on_release=True,
so the advice now names that flag.
- The steer `message` parameter and the note a steer returns said the
text is appended to the child's next tool result. It is delivered as
a user message after the child's current tool calls.
- The note on a delegation that ran inside the call named
background=true, a parameter delegate_task accepts and ignores.
The prompt-surface snapshot is regenerated: tools/delegate_task.json
and the tool token counts in surfaces.json.
* docs(delegation): config comments and example match the code
- delegation.api_key: an empty value means the parent's key, or the
named provider's own. The comments said it falls back to
OPENAI_API_KEY.
- delegation.orchestrator_enabled: false makes every child a leaf. The
comments described it as a switch for role="orchestrator", a
parameter delegate_task ignores.
- delegation.max_spawn_depth has a floor of 1 and no ceiling. The
config example gave a range of 1-3.
- The bundled hermes-agent skill's concurrency reference gave a default
of 3. It is 10, and the env var is read only when no config value is
loaded.
* docs(delegation): name the provider branch in the api_key comment
With delegation.provider set, an empty delegation.api_key is not the
parent's key: the named provider resolves its own, and the spawn is
refused when it has none. The comment in config_defaults.py already says
so; this one now matches it.
Co-authored-by: Bear Huddleston <196404565+BearHuddleston@users.noreply.github.com>
* docs(delegation): steer_subagent docstring says how a steer arrives
The docstring said AIAgent.steer() appends the text to the child's last
tool result. The child receives it as a user message after its current
tool calls, as the note this function's caller returns now says.
Co-authored-by: Bear Huddleston <196404565+BearHuddleston@users.noreply.github.com>
* docs(skills): delegation facts in the hermes-agent background reference
The reference gave max_concurrent_children a default of 3, described
delegate_task(background=true) and a per-call leaf or orchestrator role,
and sent work that must outlive the process to terminal(background=True,
notify_on_complete=True).
The default is 10, top-level calls run in the background where the
session can receive a later message, nesting follows depth, and a
terminal job started with persist_on_release survives the session ending
but not a gateway or host shutdown.
Co-authored-by: Bear Huddleston <196404565+BearHuddleston@users.noreply.github.com>
* docs(agents): delegation defaults and dispatch in tools/AGENTS.md
The Delegation section said the parent waits unless background=true,
gave max_concurrent_children a default of 3 and max_spawn_depth a
default of 2, and sent work that must survive a restart to
terminal(background=True, notify_on_complete=True).
A top-level model call is backgrounded by the runtime where the session
can receive the result, the defaults are 10 and 1, and cronjob is the
tool for work that must survive a restart.
Co-authored-by: Bear Huddleston <196404565+BearHuddleston@users.noreply.github.com>
* docs(delegation): max_spawn_depth default in a gateway comment
The comment on the delegate-chain walk bound gave
delegation.max_spawn_depth a default of 2. It is 1 (config_defaults.py).
---------
Co-authored-by: Bear Huddleston <196404565+BearHuddleston@users.noreply.github.com>
The delegate_tool_* siblings imported names back from tools.delegate_tool
inside functions only so tests could patch `tools.delegate_tool.<name>`
(routes said so: "the facade is the patch seam"). That kept a facade <->
sibling import cycle and a function-level import at each read.
- child_run owns the heartbeat/stale-grace constants (only it reads them)
and imports _get_child_timeout, _get_subagent_approval_callback,
_get_worktree_isolation, _resolve_workspace_hint and terminal_tool's
set_approval_callback at module top.
- config drops `_cfg()` (a loop back to its own `_load_config`) and the
loop back for `_get_max_concurrent_children`, defined in the same file.
- routes, dispatch and continue import their config getters at module top.
- `_load_config` is read through `delegate_tool_config._load_config` by the
facade, continue, results and process_registry_notifications, so one
patch target reaches every reader, as the facade target did before.
- cronjob_tools, process_registry_notifications and subagent_lifecycle read
these names from their owner; the facade stops importing the names its
body never used, so a stale facade patch now fails instead of silently
doing nothing.
Tests move their patches to the module whose code reads the name. Two
worktree tests that patched `_resolve_workspace_hint` on the facade relied
on it reaching both the facade's prompt build and child_run's worktree
setup, so they now patch both readers. Every delegate_tool* module imports
cleanly as the first import in a fresh interpreter.
- An automatic attempt cancelled or failed closed before its run started is not an outcome: its entry carries
unstarted_auto, so the completion is silent in the queue and the ledger. A cancel then reports nothing ever;
a failed start stays owed and the next attempt (or its give-up) is the one report.
- _give_up's atomic UPDATE requires the record still owed (OWED_SQL): a cancel landing after the tick read an
expired candidate wins and no failure is delivered.
- Expired-row retention treats a record without auto_promised as not owed (NOT COALESCE(..., 0)), so legacy
rows are deleted again as on main.
Review of 6cf0425 reproduced four delivery defects:
- A grouped unit's give-up reused the batch's delegation_id and overwrote its durable completion, so a second
child's report was claimed against an already-delivered row and suppressed. Each give-up now has its own
ledger row, <unit>:auto:<subagent_id>, claimed and acked on its own.
- _give_up committed auto_gave_up before persisting the failure, and a tick skips gave-up records: a crash in
between lost the only report. The mark and the pending completion row now commit in one transaction; the
in-memory copy is queued after, and restart replay / the orphan sweep cover a lost copy.
- tick() returned early on a full pool or a spawn pause, so a deadline never settled while the pool stayed full.
Capacity and the pause now gate only new starts.
- A detached batch's early per-task failure notice fired for a child promised an automatic resume. Skipped now;
that child reports once, later.
completion_event() is split out of _push_completion_event so the give-up builds the same event shape.
The scheduler has no turn to join a result into: where the parent
session cannot receive a detached result, or the background pool is
full, the continue is refused (attempt refunded) instead of running the
child inline inside the scheduler tick.
Review finding: split-completion recovery omits continuation ids. Children stored the call-wide delegation
id while independent-completion ledger rows are keyed by unit id (<call>-k), so boot recovery joined unequal
keys. Each child now records the unit id its ledger row runs under, and recovery keys on it.
BearHuddleston's review of #154163:
- In-process continue ignored the durable claim's refusal: a second continue that
fell through to the row (or one from another process) could run the same child
too. The durable claim is now the single gate; a refused caller hands its
in-process spec back.
- A continue that raised before record_start() (credential lease, heartbeat,
registration, or a never-started queued child) left its row `claimed` by a live
pid. The continued child carries its claim and every such exit releases it.
- claim() never reclaimed a dead owner's running/claimed row after boot recovery.
It now runs the owner-liveness check and finishes the row the way boot recovery
does, re-checking the same dead owner inside one BEGIN IMMEDIATE transaction.
- Boot recovery ran the pin git probes inside its open write transaction. The
dead rows and their pin paths are planned first, lock-free; the write re-checks
each row is still that owner's before finishing it.
- The durable session_id was never refreshed (compression.in_place: false moves a
child to a new segment). record_stop stores the segment it stopped in, and a
continue resolves the child's newest owned segment (stored_child_session), which
also covers a crash before record_stop.
- The cross-profile pin scan applied the caller's max_resumable to every profile.
Each profile's cap is now read under its own scope.
Also pins the should-fix finding (resumable isolated child's worktree pruned by its
own finalize), already fixed in f8923f30, with the reviewer's test for the
usage-limit (AUTO_AT) and provider-failure (ON_FIX) causes.
Addresses review on #145331:
- Synchronous and fallback result entries carry the child's subagent_id, so a waited-for child can be continued.
- The retained record is "stopping" until the worker has exited and its close, kernel and Relay cleanup ran; continue
refuses it with a retryable message. Ownership is checked outside the registry lock; the state check and claim are
atomic under it.
- Retained records keep the trusted ancestor owner set (parent-ref chain, max 8 hops), merged across continuations, so
a root can continue a finished grandchild and the original spawner keeps access. Foreign callers are still refused.
Every delegate card ran its own fuzzy pass over the session's live
subagents (goal text, then task order), so two delegations sharing a
goal string re-adopted each other's workers: a settled card repainted
with a newer call's running child, and the transcript filled with
copies of the same task (#136532).
Native children already stamp the call's delegation id, and the
background dispatch handle already returns it; only the settled
combined result lacked it. Add it there, and make the card prefer the
exact (delegation id, task index) join. A row that knows its
delegation id no longer falls back to the fuzzy joins — an unmatched
live child is another call's worker, and a fuzzy join would only
misfile it. Old results without the id keep the previous behavior.
(cherry picked from commit dc4743cf8c26639ede247e9b5f3022a156e42899)
Review findings "Background batches lose siblings on a foreground interrupt" and
"A sibling skipped by the gate is never detached or closed":
- _run_gated now takes honor_parent_interrupt and passes parent=None for a
detached (background) unit, so stopping the parent's foreground turn no
longer cancels siblings still waiting on the prompt-cache warm-up.
- A child the gate skips never reaches _run_single_child's finally, so it is
detached from parent._active_children and closed before its entry is built.
The same teardown runs for futures the parent-interrupt path cancels while
they were still queued behind max_concurrent_children (never started).
- Document that the leader is always task 0 (docs + code comment).
Sibling subagents in one tasks batch send byte-identical tools[] and system
prompt scaffold; only the goal (their first user turn) differs, plus the system
prompt tail when tasks carry different context. Started together, every
child's first request misses the provider prompt cache and pays the full prefix.
delegation.prefix_stagger_seconds (default 0 = off) now holds the siblings on
the first child's route until that child's first response starts streaming
(its request has written the cache), it finishes, or the cap elapses (max 60 s).
The wait ends as soon as the cache is readable, so opting in costs about one
time-to-first-token instead of a fixed (N-1)*S ramp. Routes Hermes does not
prompt-cache and siblings on a different model start without waiting, and a
sibling stopped during the wait is reported interrupted without starting.
Rebuilt on the split delegate_tool_* layout: the gate is its own sibling
(tools/delegate_tool_prefix_gate.py); dispatch only wraps run_child.
The gateway /bg fix above covered messaging chats only. The shared-owner
/bg (prompt.background, used by the CLI, TUI and Desktop) and the classic
local CLI /bg run the same detached bg_* side agent, and on main a
background delegate_task there also leaves a completed ledger row pending
forever: nothing wakes or drains a bg_* session. Their side agents now
declare the channel stateless, so the batch runs inline and the result is
in the one answer /bg reports. The sync-fallback note names /bg.
Refs #140569.
Co-authored-by: milnerrad <302432023+milnerrad@users.noreply.github.com>
On a messaging chat with display.interim_assistant_messages off, a top-level
delegate_task still produced two messages: a "checks are running, I don't have
the findings yet" reply and, later, the real answer. Top-level model
delegations always run in the background (ea8a8b4af8), and the tool text tells
the model to "give a one-line status and END YOUR TURN" (c89f3b8800). That
status is the turn's final answer, not interim text, so no display setting
held it back.
New key delegation.gateway_mode: auto | inline | background (alias async).
auto (default) joins the children inside the turn on a messaging chat whose
resolved interim setting is off (global, display.platforms.<p> override or
platform default). The parent waits in the tool call, gets the results there
and sends one answer. API, local and webhook surfaces keep the background
path under auto. Chats with interim messages on are unchanged: same schema
bytes, same async dispatch.
How it works:
- The gateway resolves the mode from the turn's own profile-scoped config
when it builds a session's agent (gateway/session_execution.py), and the
agent's first tool build freezes it (like the one-shot pin).
- An inline session carries the joined delegate_task variant the one-shot
path already uses: "results return in this tool call", no live-control
parameters, no END YOUR TURN.
- Dispatch follows the delegate_task schema the session carries
(session_joins_delegation), so schema and behaviour cannot disagree. The
schema rides the session's tools[] pin: a config change applies from the
next session (/new), as delegation.backend does, and a cache eviction or
restart never flips a running chat.
- Inline children run on the existing synchronous path: attached to the
parent, so /stop and an interrupting follow-up stop them; the per-child
heartbeat keeps the parent's activity fresh for the inactivity watchdog;
the async completion registry is not used. Nested and one-shot delegation
are unchanged.
Refs #95522.
A `hermes chat -q` session resumed interactively keeps its pinned one-shot
delegate_task schema (children "are joined and return in this tool call", no
list/steer/stop) because tools[] must stay byte-stable, but dispatch decided
per admission and detached the children on the finite=False turn. Dispatch now
reads the agent's frozen one-shot pin (agent_is_oneshot) and joins inline.
Follow-up to #144177 (independent review D1).
A configured delegation.backend that is not installed or reports unavailable no
longer runs children on the default route: delegate_task returns a tool error
naming the backend and the fix. Within a batch, a task its backend cannot route
(enum miss, DelegationRouteError, unknown reasoning_effort, unoffered tier,
unresolvable credentials or profile) is refused alone: no child is built, its
result entry carries the error and route.refused, and its siblings run; the call
is a tool error only when every task is refused. A non-profile backend route
without its own fallback_providers inherits delegation.fallback_providers. Every
backend-routed result's route names the backend, and fallback_activated shows
when a fallback provider took over.
With delegation.model blank (children inherit the parent model), the
completion header read creds["model"] (None) and printed "Model: ?".
Fall back to the model the built children actually run on.
45 conflicts, all from #135177 (lefthook + `ruff check --fix` over 2,366 files). No other main commit
touches a conflicted file. Resolution: the branch side of each file, then main's exact autofix
(ruff 0.15.10, `--config ./ruff.strict.toml --fix`) on it — rewrites only (typing generics, noqa
drops, import forms), no import removed. tests/cron/test_bot_chat_cli_home.py stays deleted
(1cc9cb9199 retired its lane).
Review follow-ups on the profile-home pinning (#91996):
- extract _parent_live_home() and log a WARNING when the parent exposes
no _session_db: the ambient fallback is exactly the #91996 failure
mode, so the skipped pin must be diagnosable instead of silent
- prune_stale_live_dirs now accepts the root and create_live_transcripts
passes the same resolved root it writes to — previously retention
always swept the ambient root, so stale dirs under a pinned home were
never cleaned by its own dispatches
- module docstring documents the per-root retention scope
- new tests: no-_session_db parent warns and returns None, db-path
parent pins, and a pinned-home dispatch prunes its own stale dir
while leaving the ambient root alone
- memory tool: one row per operation (a batch counts each op); gate/validation
refusals are "rejected", store-level non-application "failed". Memory provider
tools are counted in MemoryManager.handle_tool_call with the op read from the
action arg or tool-name verb.
- curator: run_curator_review records one row per pass (dry run = skipped) with
the before/after diff bucketed; a scheduled pass whose claim is held by another
process counts as skipped. The home is captured before the review thread starts.
- delegate_task: _run_batch opens the call, each joined unit folds its results in,
and the last unit emits the call's single row, so group-split background calls
are not counted per unit.
- terminal / execute_code / browser: counted per call that reached the backend;
the backend is resolved from the owning profile at call time (terminal plan
env_type, code local/remote, browser CDP > Camofox > cloud provider > engine, or
"extension" when the extension controller served the call). Guard refusals and
Hermes' own _host_local commands are not counted.
Tests read rows back from the real store; each call-site group is red with its
source reverted.
`recover_abandoned_delegations` only replays recorded children of a unit, and only
the >1-child join path ever called `record_unit_child` (c5594ec4b3 wired it into
`_run_children_parallel`). The single-child branch of `_execute_and_aggregate` ran
the child with no durable record at all, so a background `delegate_task` with one
goal — the default shape, and every ungrouped unit under `independent_completions` —
lost a finished child whenever the owner died between the child's return and the
durable completion write (OOM-kill on Linux, orphaning elsewhere, and everything
after the child returns is owner-lifetime: host-owned finalize, transcripts, manifest,
then the write). The parent got the bare "outcome unknown" and the work was gone (#116000).
`_record_finished_child` is now the one place that decides to durably record a finished
child of a detached unit; the join loop and the one-child branch both call it.
No new rows, no new consumer shape.
Tests: tests/tools/test_async_delegation.py::test_one_child_unit_keeps_its_finished_child_when_the_owner_dies
_run_children_parallel polled futures and fabricated interrupted entries
for pending children, but the executor's with exit then joined every
worker - a child parked in an uninterruptible call held the parent
thread forever, defeating the interrupt fast-path. Switch to an explicit
DaemonThreadPoolExecutor and shutdown(wait=not interrupted,
cancel_futures=interrupted) in a finally, matching the moa_loop shape;
abandoned children unwind on their own heartbeat and deferred-close
transport drain, and cancelled queued children never start.
Squashed integration of the user-facing message audit for this surface set.
Full per-finding receipts: /tmp/ux-audit/lanes/*-receipt.md (campaign artifacts).
When a child's final answer still missed its output_schema after the one
bounded retry, the result entry flipped to status=failed with the error
"Final answer does not satisfy the declared output_schema" — the completion
line printed ✗ and orchestrators read a finished audit as a failure. Five
audits of 413-4103 s were lost this way in the Sep 10-14 retrospective and
the parent had to mine the live transcripts; in four of them the "violation"
was a ```json fence around a valid array, which the candidate extractor
sliced to its first..last object.
Now: status stays completed, `summary` is the child's raw final text,
`schema_valid: false` + `schema_errors` carry the verdict and a `schema_note`
says the text is unvalidated; the sync completion line shows ⚠ with the
reason. The extractor tries the earliest-opening bracket span and keeps the
first that parses (fenced arrays validate). The OUTPUT CONTRACT the child
sees now says "ONLY the JSON value — no prose, no code fence" and what a miss
costs. One bounded retry is unchanged.
_attach_child now mirrors a pending parent stop with the same split
interrupt() uses for its own fan-out (hard -> hard_interrupt, soft ->
interrupt), so a redirect is not turned into a cancel on a child that was
attached late. _restore_parent_cancellation collapses to re-attaching the
rejected unit's children: the replay is the attach step's job now.
Test fixture: _Batch gained origin_session_history_delivery on main after
the salvaged PR was written.
Co-authored-by: illidan <noequal666@gmail.com>
Rebuilt against the post-refactor owners: the chat-completions route now
lives in gateway/platforms/api_server_openai_routes.py, the wake gate in
tools/delegate_tool_dispatch.py, and session_context.py was reshaped —
the original patch aimed at code main no longer has.
Header-less OpenAI-compatible clients get a fingerprint-derived session
id bound as the api_server chat_id. delegate_task's background gate
treated ANY bound session id as wake-capable and dispatched detached
subagents, but for derived ids the wake self-post lands in a session
whose history the client never reloads — the result is undeliverable by
construction.
Bind a wake_capable provenance flag at session-bind time, DEFAULT-DENY
at the central boundary (set_session_vars and _bind_api_server_session
both treat an omitted declaration as denied; a binder that says nothing
grants no wake authority): "1" only from audited producers whose client
can address the id again (explicit X-Hermes-Session-Id — 403-gated on
API_SERVER_KEY — native /api/sessions/{id} routes, /v1/runs); "" for
fingerprint-derived ids. The delegate gate requires the flag (fail-closed,
captured pre-child-construction alongside origin_wake_sid) and keeps the
forced-sync fallback with its honest note.
Reported-and-investigated-by: shojikumaru (Sho + Alpha) via #98619
Stress run with a real orchestrator subagent showed the per-task keys buried in results[] were not relayed
upward; the same prose lines now sit at the top of the sync delegate_task result. evals/subagent_process_handoff/
stress_handoff_live.py runs 12 real parent+child scenarios (handoff, orphan, unread, clean read, cap, exited refusal,
mixed fan-out, parent controlling the inherited process, sibling theft incl. adversarial, nested orchestrator,
5-way burst) and scores them against runtime accounting, never model prose.
Three orchestrator failures traced through the Sep 7 gpt-6-astra campaign sessions:
1. delegation.independent_completions (new, default false). #104299 made every
ungrouped task its own completion message, so a 15-task call woke the
orchestrator up to 15 times; one chain received 132 notices and answered
130 of them with "already incorporated". A multi-task call now returns as
ONE consolidated message unless the flag is on; `group` is inert until then.
2. Queued units were killed before they started. Units of one call share a
pool slot but the executor was still sized by slots, so with 15 units live
a new unit queued behind a full pool; the stale monitor's clock ran from
dispatch, interrupted it at 450 s, and the child exited `interrupted 0.02s`
when its thread finally came up (13 such lanes in one session). The
executor now grows to the number of live units and the stall clock arms
when the runner actually starts.
3. The tool text said "do not wait or poll — just continue" without saying
that completions are delivered only BETWEEN turns. A model that never ends
its turn (one 203-minute turn, 717 API calls) never received 40 finished
results. Tool description, dispatch note and completion header now say to
finish independent work, give a one-line status, and end the turn.
Since #104299 a background delegate_task call is split into completion units
(one per `group`, one per ungrouped task). A multi-child unit still joined on
all its children before anything was written durably, so an owner crash
between the first and last child lost the finished work and replayed the whole
unit as "outcome unknown" — the restart-granularity gap that #104233 (Xipong's
#76228/#76229 direction) solved with a second row per child.
Each finished child of a detached unit is now recorded on the unit's OWN row
(`record_unit_child` → result_json {results, partial}) as its future lands;
the real result overwrites it at finalize. `recover_abandoned_delegations`
replays recorded children with their real summaries and marks only the
unfinished ones unknown, naming the count. No new rows, no new consumer shape.
`task_indexes` is persisted so recovery knows a split unit's members.
A background delegate_task call used to be ONE async unit: the runner joined on
every child and a single consolidated message re-entered the conversation when
the SLOWEST finished. Fifteen independent PR reviews therefore waited on the
fifteenth before the parent could act on the first.
Each task now carries an optional `group`. `_units_of` partitions the call's
children into units — one per distinct group, one per ungrouped task — and each
unit is dispatched to the async registry on its own, so its results re-enter the
conversation as soon as THAT unit is done. Tasks that must be compared or merged
share a group and still return together.
Capacity is unchanged: every unit of one call joins the first unit's pool slot
(`slot_key` in `async_delegation._dispatch`), so splitting never consumes more of
`delegation.max_concurrent_children` than the call did. Unit ids suffix the
call's id (`deleg_xxxx-1`, `-2`, …) so live transcripts stay under one dir; the
completion block names the group and notes that sibling units report separately;
`active_task_count` counts a unit's own tasks.
`format_batch_tag` handed out `set N` ordinals from one process-wide table,
so every conversation on a shared backend and every child's nested fan-out
advanced the same counter. A user's second wave of 15 lanes rendered as
`[set 20 · 13/15]`, which reads like 20 batches were spawned.
Scope the ordinal table by the parent conversation (`parent_agent.session_id`)
and thread the parent through the three render sites (batch header,
completion lines, child tree-line prefix via the shared session_ref). The
first fan-out in a conversation is `set 1`, the next `set 2`; sibling
conversations and nested child batches no longer inflate it.
Invariant test proven red on origin/main, green with the fix.
Batches join on the slowest sibling before ONE consolidated block re-enters
(the design: one results block per fan-out). Failure is the case that
should not wait. In the 1,393-agent refactor run every wave-1 child died in
the 08:29 401 storm; the parent learned of it at 09:36, when the batch's
"unknown outcome" block finally arrived: 66 minutes of a dead wave with
nothing running, the single largest idle gap of the run.
_run_children_parallel, for DETACHED batches only (the sync path prints a
completion line the parent is already watching), pushes ONE
type="async_delegation" event with task_failure_notice=True and a
single-entry results list when a child ends in a failure status while
siblings are still pending. Same event shape and routing fields as the
batch result, so every drain/ownership/format path treats it identically;
the batch record is not finalized and its consolidated result still
arrives unchanged. The formatter renders
"[ASYNC DELEGATION TASK FAILED — <id>, task i/n]" with the task, status,
error and live transcript path, and says the batch result is still coming.
The TUI dedup key distinguishes a notice from the final result and from a
sibling's notice.
Live through the real detached dispatch (3 children, one fails at 0.1 s,
two succeed at 8 s): notice drained at t+0.3 s, batch final at t+8.4 s. On
main the parent hears nothing until t+8.4 s.
Tests (2): the notice reaches the queue with the record's routing fields
while the record stays running, and formats as an early warning; no notice
for a finished batch; dedup key differs from the final result.
Delegation/registry/notification suites (129 files) 1,344 passed.
tools/approval.py no longer re-exports sibling names (approval_context/prompt/floors/detection/
human_wait/smart/gateway_wait); it imports only what it uses. Siblings reference sibling-defined
names directly (module-attribute reads on tools.approval_context so patching the defining module
still works); only facade-owned state (_lock, _gateway_queues, _permanent_approved, _denied,
_denial_breaker_addendum, _gateway_notify_cb) is still read back through tools.approval.
approval_detection calls its own _command_detection_variants instead of late-binding through the facade.
For each issue anchor present in BASE 63279301bc non-test .py and absent on HEAD, the BASE comment/docstring block was re-attached at the HEAD location of the code it explained (matched by the distinctive code line / enclosing def). Sentences already covered by an existing HEAD comment were deduped; the issue number always survives. Insert-only: no code lines changed.