Synthesis LLM path (opt-in) + llm facade + mcp realize backend - #17
Merged
Conversation
- llm.py: provider-agnostic facade. resolve_llm() accepts a callable, an aw StepConfig (reuses its resolve_llm), a model name, or None->ambient skill.ai.chat; returns None (never raises) when nothing is available. structured(prompt, schema) does instruct-JSON + parse + one retry. - synthesis.py: synthesize_persona gains an optional llm that DRAFTS the identity paragraph; invariants + the return contract stay deterministic so the machine-facing contract is never at the mercy of generation. Drafting fires ONLY when an llm is explicitly injected — the mechanical path stays offline even when an ambient API key is present (DECISIONS D10). - complete(): optional llm= threaded through (non-breaking); LLM failure falls back to template. - realize.py: 'mcp' backend reads the source skill's coact: mcp block and delegates to py2mcp.mk_mcp_from_refs (coact writes no MCP plumbing). Companion py2mcp PR i2mint/py2mcp#2 added mk_mcp_from_refs + import_object. 55 tests + 28 doctests + ruff green; mechanical path verified offline. Refs #9 #10 #13
This was referenced Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR D of the roadmap (#13). The two hard "extras" get an optional LLM, and the third realization backend lands.
What's here
llm.py— provider-agnostic facade (DECISIONS D10).resolve_llm()accepts acallable(str)->str, anawStepConfig(reuses itsresolve_llm), a model-name string, orNone→ambientskill.ai.chat; returnsNone(never raises) when nothing is available.structured(prompt, schema)does instruct-JSON + parse + one retry. No hard provider dependency.synthesis.py—synthesize_personagains an optionalllmthat drafts the identity paragraph; the operating invariants and the return contract stay deterministic, so the machine-facing contract is never at the mercy of generation. Drafting fires only when anllmis explicitly injected — the mechanical path stays offline even when an ambientANTHROPIC_API_KEYis present (this was caught and fixed: an earlier version auto-discovered the ambient provider and made a real network call on the no-LLM path).complete()— optionalllm=threaded through (non-breaking); an LLM failure falls back to the template.realize.py—mcpbackend reads the source skill'scoact: mcp:block (module+functions) and delegates topy2mcp.mk_mcp_from_refs. coact writes no MCP plumbing.Companion (merged)
py2mcpPR Add mk_mcp_from_refs(['module:function', ...]) + public import_object i2mint/py2mcp#2 addedmk_mcp_from_refs+import_object.Verified
55 tests + 28 doctests +
ruffgreen; the mechanical path is verified offline (fast); the mcp backend builds a real FastMCP server exposing a skill's declared tools.Closes #9, #10.