test: regression projection markdown + commit git automatique

This commit is contained in:
2026-07-30 08:36:34 +00:00
parent 733511fdd7
commit af02d5de02
+28
View File
@@ -0,0 +1,28 @@
import asyncio, sqlite3
from mcp.client.sse import sse_client
from mcp import ClientSession
def get_key(agent):
con = sqlite3.connect("data/context_hub.db")
cur = con.cursor()
cur.execute("SELECT api_key FROM api_keys WHERE agent_name=?", (agent,))
return cur.fetchone()[0]
async def call_as(agent, tool, args):
key = get_key(agent)
async with sse_client("http://localhost:8000/mcp", headers={"X-API-Key": key}) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
return await session.call_tool(tool, args)
async def main():
print("=== record_lesson avec push git ===")
r = await call_as("CLAUDE", "record_lesson", {
"scope": "coding", "type": "best-practice",
"title": "Test phase 4 - a supprimer",
"body": "Validation generation markdown + commit Git automatique.",
"project": "context-hub", "tags": ["test", "phase4"]
})
print(r.content[0].text)
asyncio.run(main())