Skip to content

feat(backends): LocalFileBinding implements verbs (PEFT/aLoRA path) + from_catalog() (Epic #929 Phase 2) - #1454

Merged
planetf1 merged 19 commits into
generative-computing:mainfrom
planetf1:worktree-issue-1141
Aug 17, 2026
Merged

planetf1 merged 19 commits into
generative-computing:mainfrom
planetf1:worktree-issue-1141

Conversation

@planetf1

@planetf1 planetf1 commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Issue

Fixes #1141

Summary

LocalFileBinding — the weights binding for locally-downloaded LoRA/aLoRA adapters — was four NotImplementedError stubs. This PR makes it real: working prepare/activate/deactivate/release verbs, a from_catalog() constructor, and AdapterMixin.adapter_scope() wired to actually activate/deactivate weights and fire metric hooks, instead of being a Phase 1 no-op.

Two smaller, independent bugs came along for the ride because they blocked writing correct tests for the above: IntrinsicAdapter was silently resolving revision="main" instead of forwarding the catalogue's pinned SHA, and LocalFileBinding's own revision default did the same thing.

Spans and the production generation cutover are explicitly not in this PR — see "Where this fits" below for exactly where they land instead.

Where this fits — Epic #929, Phase 2

This is #1141. Two things are deliberately not here, each with its own issue and acceptance criteria — don't file findings against their absence:

Also referenced, narrower in scope:

What changed

Area Change
LocalFileBinding prepare/activate/deactivate/release implemented; from_catalog(name) constructor; release() is enforced-terminal (bind_backend/prepare raise if called after release()); prepare() retries only the failed step after a load failure instead of silently no-op'ing forever; prepare()/release() now hold the backend's exclusivity lock around the PEFT load/unload calls, matching activate/deactivate
AdapterMixin New verbs activate_peft_adapter/deactivate_peft_adapter (extracted from _generate_with_adapter_lock's inline PEFT calls — behaviour-preserving); _adapter_activation_lock() for the exclusivity these verbs document as required
AdapterMixin.adapter_scope() Real activate → yield → deactivate, with metric hooks (ADAPTER_FUNCTION_PHASE_COMPLETE, ADAPTER_FUNCTION_INVOCATION_COMPLETE) instead of a no-op; a hook-dispatch failure can never strand the adapter active or mask the real outcome (including the invocation-complete hook itself); revision in telemetry is the resolved catalogue pin, not the raw unresolved None
Telemetry Metric hooks only — see "Telemetry" below
IntrinsicAdapter Forwards the catalogue's pinned revision to obtain_io_yaml/obtain_lora instead of implicitly resolving "main"
mellea/helpers/event_loop_helper.py _run_async_in_thread's shared coroutine-close handling covers all 13 real call sites instead of 3, including its own internal wrapper coroutine (not just the caller's); narrowed to except Exception (not BaseException) to avoid a cross-thread race on KeyboardInterrupt

Telemetry: what changed and why

The original branch called start_adapter_function_span(...) directly from mellea/backends/adapters/. Wrong mechanism — since #1181, span production belongs to plugins subscribing to hooks, and library code never opens a span itself. The mechanism was more wrong than the diff made it look:

So: all inline span code is removed (mellea/telemetry/tracing.py is back to its upstream/main state), metric hooks are the only telemetry here, the doc now states the hook/plugin rule and says plainly there's no span coverage of this lifecycle until #1466, and tests assert hooks/payloads rather than span names.

Deviations from the literal issue spec

Testing

uv run pytest test/ -m "not qualitative" — 3931 passed, 21 skipped (hardware-gated), 0 failures. ruff format/ruff check/mypy clean. test/backends/test_adapters/test_local_file_e2e.py (GPU-gated) passes against a real model, including through the lock changes in this PR.

Pre-existing failures unrelated to this diff: test/package/test_dependency_isolation.py's test_hooks/test_telemetry/test_telemetry_plugins_register reproduce identically on a clean upstream/main checkout.

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code was added
  • Ensure existing tests and github automation passes

Attribution

  • AI coding assistants used

Adding a new component, requirement, sampling strategy, or tool?

If your PR adds or modifies one of the types below, check the matching box. A checklist of type-specific review items will be posted as a comment.

  • Component
  • Requirement
  • Sampling Strategy
  • Tool

NOTE: Please ensure you have an issue that has been acknowledged by a core contributor and routed you to open a pull request against this repository. Otherwise, please open an issue before continuing with this pull request.

@github-actions github-actions Bot added the enhancement New feature or request label Jul 28, 2026
@planetf1
planetf1 marked this pull request as ready for review July 28, 2026 15:20
@planetf1
planetf1 requested a review from a team as a code owner July 28, 2026 15:20
@planetf1
planetf1 requested review from AngeloDanducci, ajbozarth and jakelorocco and removed request for AngeloDanducci and ajbozarth July 28, 2026 15:20
Comment thread mellea/backends/adapters/_core.py Resolved
Comment thread mellea/backends/adapters/adapter.py Resolved
Comment thread mellea/backends/huggingface.py Resolved
Comment thread mellea/backends/huggingface.py Resolved
Comment thread mellea/backends/adapters/_core.py Resolved
Comment thread mellea/backends/adapters/_core.py Resolved
Comment thread mellea/backends/adapters/adapter.py Resolved

@AngeloDanducci AngeloDanducci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few non-blocking notes on top of @jakelorocco's threads, which already cover the main design questions plus the adapter.py:373 guard and double-backticks nits. I've replied on the 373 thread with a related second site, and left two inline notes below: a contradictory adapter_type between identity and binding in the two new tests, and a prepare() idempotency edge. For context, the diff looks correct relative to #1141, the scope boundary (production hot path deferred to 4.1) is documented honestly, and the revision-forwarding fix has good regression coverage.

Comment thread mellea/backends/adapters/_core.py Resolved

@ajbozarth ajbozarth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean scoping, the 4.1 boundary is well-documented, and the revision-forwarding fix is a good catch with regression coverage. One blocking item on the span telemetry — two equally-fine ways to resolve it below — plus two small independent notes.

Blocker: adapter-function spans are emitted inline instead of through the tracing-plugin pattern

Spans here are opened/closed by direct start_*_span/finish_*_span calls in adapter_scope/_run_adapter_phase/prepare/release. Everywhere else in Mellea, spans are emitted by a *TracingPlugin in mellea/telemetry/tracing_plugins.py subscribing to lifecycle hooks, and core code never imports the span helpers. Inline emission is only used where code is synchronous and can't fire paired hooks (the session lifecycle spans); adapter_scope is async-capable (the e2e test awaits generate_from_context inside it), so it falls under the plugin pattern.

The underlying reason it had to be inline: the ADAPTER_FUNCTION_*_COMPLETE hooks are completion-only. This is the one hook family in HookType without a pre/start sibling — every other family (generation, component, tool, streaming, sampling, validation, session) has paired members. A span needs an opener to anchor on, so completion-only hooks can feed a metric but can't drive span open/close, which forced the inline workaround. (The metrics half of this PR is fine — it consumes those hooks correctly, the same as the other *MetricsPlugins.)

Two ways to resolve, both fine by me:

Option A — do it here, properly. Add pre/post (or start/end) hook points to the adapter-function contract and move span emission into an AdapterFunctionTracingPlugin. Metrics then read the post payload (which already carries duration/outcome) instead of a separate *_COMPLETE event. Two gaps to close while you're in there:

  • The phase enum advertises generate and parse, but nothing fires them (no span, no hook, no call site). Their real production sites are the model call in _generate_from_intrinsic (huggingface.py:575) and action.parse(result) (huggingface.py:1776) — place the hook sites there so the contract doesn't ship dead phases.
  • adapter_scope's phase and invocation hooks are currently unasserted (only prepare's is tested) — the new plugin + paired hooks should get coverage like the existing pairs have.

Option B — pull span telemetry out, follow up separately. Keep the LocalFileBinding lifecycle, from_catalog, verb extraction, and the revision fix (all self-standing), drop the inline spans, and open a follow-up issue to add adapter-function tracing through the plugin pattern. Reasonable if the hook-contract redesign is more than you want in this PR — and it lines up naturally with the 4.1 cutover, which is what would fire generate/parse anyway. Whether the metrics half stays or goes with it is your call.

Small note (file not in the diff, so can't inline it)

mellea/telemetry/metrics_plugins.py — the AdapterFunctionMetricsPlugin docstring still says "No production call site fires these hooks yet." This PR adds them; please update or remove it, depending on which option above you take.

Comment thread mellea/backends/huggingface.py Resolved
@planetf1

planetf1 commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor Author

@ajbozarth thanks — you're right, and the mechanism is more wrong than the diff makes it look.

Summary

The spans in this PR are produced the wrong way — inline in mellea/backends/
rather than from a tracing plugin. I'm removing them here instead of fixing them
in place, keeping the metric hooks, and fixing the LocalFileBinding defaults,
which is the real blocker. The root cause predates this PR, so I've filed #1464,
#1465 and #1466 under #929.

How we got here

Until #1181 in June, calling the span helpers directly from library code was
the pattern here — all five backends had a bare span = start_generate_span(...),
with the machinery in mellea/telemetry/backend_instrumentation.py. #1181 moved
that onto hooks and plugins, correctly, and deleted the module.

What it didn't do was write the new rule down. docs/docs/observability/tracing.md
still contains no mention of "plugin" — it lists which spans exist, never how one
gets produced — and there's no import contract, so restoring the old pattern is
invisible to CI. The one in-code template you'll find is mellea/stdlib/session.py,
which imports the helpers directly and is a deliberate exception. Six weeks later
docs/dev/adapter_observability.md was written describing the pre-#1181 approach,
pointing at start_backend_span / start_action_span as the model to mirror. I
followed it.

The bit I'd most like fixed: even knowing the plugin rule, I couldn't have
complied. ADAPTER_FUNCTION_INVOCATION_COMPLETE and
ADAPTER_FUNCTION_PHASE_COMPLETE are the only hook family with no pre/start
sibling, so there's no event at which a plugin could open these spans. The doc
wasn't just stale — it described the only approach the current hooks allow.

In this PR

Follow-ups under #929

One correction before anyone builds on it: the parse site you pointed at,
huggingface.py:1776, is in _generate_from_raw, not the adapter path.
_generate_from_intrinsic has no action.parse call — it goes via the
IOContract. Your generate site is right.

Shout if you'd sequence any of this differently.

@planetf1

planetf1 commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the comments so far. Will wait to see if the proposed approach is in the right direction on otel (@ajbozarth ) - i read this first, and more generally on the abstraction (@jakelorocco ) - thread - (since this is more than a in-pr review comment to be handled) before addressing the various other detailed comments which need changes & closing off conversation threads etc.

@planetf1

ghost commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Moved to draft pending the outcome of some design discussions — see #1486.

@planetf1

ghost commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Progress here stalled on the API-shape question in #1486 — I've posted a summary there of
where it's got to.

@ajbozarth — none of your review depends on that outcome, so I'll work through your points
in parallel rather than waiting on it.

@planetf1
planetf1 force-pushed the worktree-issue-1141 branch from 1a51900 to a3e0d36 Compare August 11, 2026 08:29
@planetf1 planetf1 changed the title feat(backends): LocalFileBinding implements verbs (PEFT/aLoRA path) + from_catalog() + OTel spans (Epic #929 Phase 2) feat(backends): LocalFileBinding implements verbs (PEFT/aLoRA path) + from_catalog() (Epic #929 Phase 2) Aug 11, 2026
@planetf1

ghost commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Unblocked and ready for review. #1486 is closed as resolved, which was what this was
waiting on, and the review points are worked through.

What changed since you last looked

  • Rebased onto current main (was 27 commits behind).
  • Spans removed — around 320 lines. mellea/telemetry/tracing.py is back to its
    upstream/main state, the helpers are unimported from _core.py and adapter.py, and
    test/telemetry/test_tracing_adapter_function.py is deleted. Metric hooks stay and are
    now the only telemetry here. docs/dev/adapter_observability.md is corrected to stop
    teaching the pre-refactor(telemetry)!: move backend tracing onto plugin/hook pattern #1181 pattern and to say plainly that there's no span coverage of this
    lifecycle until feat(telemetry): add complete adapter-function lifecycle observability #1466. Tests assert the fired hook payloads instead of span names and
    span status.
  • LocalFileBinding.revision default fixed — was "main", so all ten bare
    LocalFileBinding() in mellea/ silently opted into tracking-latest, defeating fix(intrinsics): pin catalogue entries to HF revision SHAs + deduplicate requirement_check entries (Epic #929 Phase 0) #1135's
    pinning. Now None, meaning "use the catalogue's pinned revision", resolved lazily so
    it survives a re-pin.
  • Review fixes: both hook-fire sites guarded, the two contradictory adapter_type
    test identities aligned, prepare() now fails loudly when add_adapter refuses
    registration instead of leaving a half-prepared binding, TODO(#1465) at the lock, and
    the four PR-introduced double-backtick sites swept.
  • PR body and commit message rewritten to match the branch — the previous ones
    described the spans as a shipped feature, which stopped being true on 2026-07-29 and was
    never corrected.

One thing I tried and backed out, flagged rather than buried: the Adapter.__post_init__
cross-check from #1486 that would have caught @AngeloDanducci's adapter_type bug at
construction. It broke collection of eight test modules — the ten module-level Adapter
constants in rag.py/guardian.py pair an alora identity with a deliberately
unconfigured LocalFileBinding() defaulting to LoRA, and since every catalogue entry
supports both types those are placeholders, not conflicts. The check was firing on "not
configured yet". Recorded on #1516 with a NOTE(#1516) at the site; the invariant is
right, the timing isn't.

Verification — all run on the rebased head:

uv run pytest test/ -m "not qualitative"   3909 passed, 21 skipped, 4 xpassed
uv run mypy .                              Success: no issues found in 709 source files
uv run ruff format . / ruff check .        clean
pre-commit (via commit -s)                 all hooks passed

Four threads left open on purpose, all @jakelorocco's: the lock-duplication question
(both sites), the reality-specific-verbs question, and the adapter_type-duplication
question. I answered those rather than changing code, so they're yours to close or push
back on — I didn't want to resolve my own answers.

Sequencing note: #1465 is the follow-up that routes generation through adapter_scope,
and it carries @ajbozarth's lock-reentrancy point as a named constraint. It is not
"4.1" — that's #1144 (shim removal plus docs rewrite), whose scope never mentioned
generation or locking, so this would have fallen through the gap between the two.

@planetf1
planetf1 marked this pull request as ready for review August 11, 2026 08:32
@planetf1

ghost commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor Author

@ajbozarth — apologies, I answered your inline threads and never replied to this review
body. I'd been reading the PR through the thread list, so your summary and its two asks
sat unaddressed for a fortnight. Both are done now.

Your blocker — I took Option B. Inline spans are gone: mellea/telemetry/tracing.py
is back to byte-identical with main (the 112 added lines removed), the five helpers are
unimported from _core.py and adapter.py, and test/telemetry/test_tracing_adapter_function.py
is deleted. The LocalFileBinding lifecycle, from_catalog, verb extraction and the
revision fix stay, as you suggested. The metrics half stays too — it consumes the
completion-only hooks correctly, and it's the only observability this PR now has.

Your diagnosis of why it had to be inline was the useful part, and I've written it into
the follow-ups rather than leaving it in a review thread: the ADAPTER_FUNCTION_* family
being the one HookType family without a pre/start sibling is recorded on #1466 as
the root cause and its first work item, not a footnote. #1464 covers the rule itself —
documenting it in docs/docs/observability/tracing.md (which today contains no occurrence
of the word "plugin") and enforcing it in CI so the next occurrence fails a check instead
of needing you to catch it. #1464 blocks #1466 for exactly the reason you'd expect: the
rewritten guidance is what #1466 should be built from.

Your small note — done. AdapterFunctionMetricsPlugin's docstring no longer claims
"No production call site fires these hooks yet". It now says which phases fire and which
don't, and is explicit about a distinction I think matters: prepare, activate and
deactivate have real firing sites, but no internal Mellea path reaches them either —
they're on the public Adapter/LocalFileBinding surface, so today they fire only for a
caller driving that surface directly. generate/parse need #1465.

Two of your Option A points landed anyway, since they weren't really Option-specific:

While tracing the same "contract ships something dead" pattern I found a third instance and
fixed it here, because unlike the others it's reachable today: adapter_scope declared
outcome: Literal["success", "error"], so it could never emit "schema_error" — and
mellea.adapter_function.parse_failures increments only on schema_error. That counter
was structurally dead. adapter_scope now classifies AdapterSchemaMismatchError
separately, which matters now rather than after #1465: adapter_scope is public, so a
caller can already parse inside the scope. #1141's parse_failures criterion was otherwise
unmeetable.

One correction to the review, for the record: the parse site you pointed at
(huggingface.py:1776) is in _generate_from_raw, not the adapter path —
_generate_from_intrinsic has no action.parse call, it goes via the IOContract. Your
generate site was right.

Verification on the current head (5ee47240):

uv run pytest test/ -m "not qualitative"   3911 passed, 21 skipped, 4 xpassed
uv run mypy .                              Success: no issues found in 709 source files
uv run ruff format . / ruff check .        clean
pre-commit                                 all hooks passed

Pushed as a separate commit on top rather than a force-push, so you can diff exactly
what moved since your review.

Nigel Jones added 7 commits August 17, 2026 11:35
…ve_adapter()

LocalFileBinding and IntrinsicAdapter share the same qualified-name key
space (f"{name}_{type}") in a backend's _added_adapters registry. If a
LocalFileBinding is registered for a capability, a later
resolve_adapter() call for the same name silently fails: add_adapter's
duplicate-key guard refuses the new IntrinsicAdapter, and _find_adapter
can't see the LocalFileBinding either (not an _AdapterCore), so the
caller got a bare "Adapter 'x' not found after registration" with no
hint of the cause.

Name the occupying type in both failure points: add_adapter's warning
log, and a new check in resolve_adapter's KeyError path. Doesn't change
the underlying collision -- nothing in the codebase mixes the two
registration paths for the same name today -- just makes the failure
self-diagnosing instead of opaque. Verified the new resolve_adapter test
against the pre-fix code (fails with the old bare message) before
confirming it passes on the fix.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <[email protected]>
adapter_scope() moved from an unconditional no-op (Phase 1) to calling
adapter.weights.activate(), which raises NotImplementedError for the
_ShimWeightsBinding every IntrinsicAdapter/LocalHFAdapter returned by
resolve_adapter() still carries. Nothing in the codebase calls
adapter_scope() with a resolved adapter today, so nothing breaks in
practice, but this was an undocumented, unpinned behaviour change on a
public method. Add a test asserting the new raise and a note in
docs/dev/adapter_observability.md pointing at generative-computing#1465, the tracked cutover
that has to reconcile shim/unprepared bindings with real activation
before production wires generation through this path.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <[email protected]>
…lure, guard the invocation-complete hook, and report resolved revision

Three fixes from independently verifying two external reviews (codex,
deepseek) of this PR:

- event_loop_helper.py: closing `co` on a scheduling failure wasn't
  enough -- `_wrapped()`'s own coroutine object is created before
  `run_coroutine_threadsafe` is called, so a scheduling failure left it
  unstarted and unclosed, leaking a second "coroutine was never awaited"
  warning distinct from `co`'s. Reproduced empirically before fixing.

- adapter_scope: `_fire_invocation_complete` ran unguarded in the outer
  `finally`, so a hook-dispatch failure there could turn a clean `with`
  block into a thrown error, or replace a genuine body exception with a
  telemetry one. Wrap it in try/except that logs and swallows -- the
  activate-phase hook already got this treatment, the invocation hook
  hadn't.

- adapter_scope: revision was read from the raw `.revision` attribute,
  which is `None` for a lazily-resolved LocalFileBinding even though it
  downloaded and ran against a concrete catalogue pin. Use
  `resolved_revision()` when available so telemetry doesn't mislabel an
  effectively-pinned invocation as unpinned.

Every regression guard was run against the pre-fix code and confirmed to
fail there before confirming it passes on the fix.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <[email protected]>
… release() as terminal

Two fixes from independently verifying two external reviews of this PR:

- LocalFileBinding.prepare(): add_adapter() sets .backend before
  load_peft_adapter() runs. If the load raised (e.g. a transient
  download/load failure), .backend was already non-None, so the
  idempotency guard (`if self.backend is not None: return`) made every
  retry a silent no-op -- the caller got no error and no working
  adapter, forever. Track the load's own success separately (`_loaded`)
  so a retry redoes only the failed step instead of re-registering (which
  would hit the backend's own duplicate-registration guard) or silently
  doing nothing. activate()/deactivate() now also check `_loaded`, since
  "registered but not loaded" is a newly-reachable, distinct state.

- LocalFileBinding.release(): the docstring already said "terminal ...
  bind_backend() + prepare() will not revive it", but the code let
  release() clear .backend back to None, so a subsequent bind_backend()
  + prepare() on a fresh backend silently succeeded anyway. Add a
  `_released` flag; bind_backend() and prepare() now raise RuntimeError
  if called after release(), matching the contract the docstring already
  claimed.

Every regression guard was run against the pre-fix code and confirmed to
fail there before confirming it passes on the fix.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <[email protected]>
… adapter_scope's non-atomicity

prepare()/release() call load_peft_adapter()/unload_peft_adapter(), which
mutate the same shared PEFT model state activate_peft_adapter/
deactivate_peft_adapter document "must be called while holding
_generation_lock" for -- but neither prepare() nor release() took any
lock. Wrap both in _adapter_activation_lock(), matching the other two
verb pairs.

Also attempted, then reverted, widening _adapter_activation_lock to span
adapter_scope's whole activate/body/deactivate duration (to fix
concurrent-scope interleaving, a real gap independently found in two
external reviews) using a reentrant lock. That deadlocks the moment the
body does real async generation: the actual generation work runs on
mellea's shared event-loop thread, not the calling thread, so a
same-thread RLock doesn't provide the needed exclusivity across threads
-- confirmed by running test_local_file_e2e.py, which hung. Reverted
that change; documented the non-atomicity as a known, tracked limitation
on adapter_scope's docstring instead, with a test pinning today's actual
(non-atomic) behavior so it isn't silently "fixed" back to interleaving
or silently made worse. generative-computing#1465 (wiring real generation through this
scope) has to solve the atomicity and the threading interaction
together.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <[email protected]>
Assisted-by: Codex
Signed-off-by: Nigel Jones <[email protected]>
Assisted-by: Codex
Signed-off-by: Nigel Jones <[email protected]>
@planetf1
planetf1 force-pushed the worktree-issue-1141 branch from c6747dc to 94b2b7c Compare August 17, 2026 11:24
Nigel Jones added 3 commits August 17, 2026 12:48
Assisted-by: Codex
Signed-off-by: Nigel Jones <[email protected]>
Assisted-by: Codex
Signed-off-by: Nigel Jones <[email protected]>
Assisted-by: Codex
Signed-off-by: Nigel Jones <[email protected]>
@planetf1

ghost commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

Hi @jakelorocco and @ajbozarth — the earlier approvals predate a small set of lifecycle hardening changes. These isolate phase-hook failures, clarify retry/error behaviour, reject invalid binding transitions, and serialise binding prepare/release to prevent a race. The changes are covered by focused regression tests and the full non-qualitative suite. Would you mind taking a quick fresh look at the updated lifecycle code before merge?

ghost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some feedback from Claude

LGTM. Verified locally: 276 adapter/event-loop/hf unit tests pass, ruff + mypy clean, and every behavioral claim in the description has a matching test (terminal release, retryable prepare, the non-atomic-scope limitation via a real two-thread test). Lock ordering (_lifecycle_lock → _generation_lock) is consistent with no reverse acquisition, and the except Exception narrowing in event_loop_helper is correctly reasoned.

One optional nit inline. Non-blocking.

Comment thread mellea/backends/adapters/adapter.py Resolved

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(backends): LocalFileBinding implements verbs (PEFT/aLoRA path) + from_catalog() (Epic #929 Phase 2)

5 participants