Skip to content

Rewrite handlers.llm module - #694

Open
eb8680 wants to merge 276 commits into
masterfrom
eb-doctest-synthesis
Open

Rewrite handlers.llm module#694
eb8680 wants to merge 276 commits into
masterfrom
eb-doctest-synthesis

Conversation

@eb8680

@eb8680 eb8680 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

datvo06 added a commit that referenced this pull request Jul 19, 2026
- mypy: annotate _INSPECTION_DUNDERS as tuple[str, ...] (the += widened a
  fixed-length tuple type); drop a now-unused type: ignore in test_effects.
- ruff: import Callable from collections.abc (UP035); use favorite_city in the
  reader test so it is not an unused local (F841); ruff format the two touched
  test/impl files. Also scrub a stale branch/#694 line from the test docstring.
mypy + ruff check + ruff format --diff all clean; 20 tests pass.
datvo06 added a commit to datvo06/effectful that referenced this pull request Jul 19, 2026
…(no LLM)

Off-by-default handler on Template.__apply__: when a template declares
Uses[tool, ...] on its return type, a per-call handler intersects the lexical
tools reaching call_assistant with the allow-list, so the LLM is offered ONLY the
declared tools (the in-scope but unlisted tools are withheld). No Uses -> unrestricted
(backward-compatible). Sound by construction: an unlisted tool is never offered and
the decode boundary rejects a call to an unoffered tool, so the model cannot invoke it.
This is the plan's L1 on BasisResearch#694's call_system/tool_types model (not a .tools mutation),
using eb8680's per-call-handler pattern; handler-injected tool_types are left untouched.
Two law-based tests (allow-list enforced; unrestricted unchanged), captured at the
call_assistant seam with no model request. 8 governance + effects pass, BasisResearch#694 template
suite 112 pass, mypy+ruff clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment