feat(standards): codify codegen, ship generic Tier-B infra, add get_app_template + prompts; fix docs:// regressions
P0: fix doc:// -> docs:// across standards src/server/registry and regenerate stale mongo-ops bundle. P1: build recipe + spec-first routing now document the openapi-first codegen fast path (models/routes with --inject-request/--package). P4: CRUD template documents the model-vs-document id rule (BaseDocument owns id). P5: authless guidance (omit security keys). P6: template gains generic infra (http_cache, keyed SSE bus, KV port+in-memory+Redis), interfaces/openapi.py + .dockerignore + generic build test registered as components, and a get_app_template tool; genericity matrix marks LLM pool + human-in-loop as reference-app patterns. P7: intake/build/start_app/trial prompts. P8: template ships tests/integration/test_openapi_app_builds.py. Rebuilt standards + openapi-first bundles and re-collected.
This commit is contained in:
@@ -2,91 +2,49 @@
|
||||
"module": "mongo_ops.transactions",
|
||||
"content": {
|
||||
"path": "mongo_ops.transactions",
|
||||
"docstring": "Transaction management helpers for MongoDB.",
|
||||
"docstring": "# Summary\n\nTransaction management helpers for MongoDB.",
|
||||
"objects": {
|
||||
"Awaitable": {
|
||||
"name": "Awaitable",
|
||||
"kind": "alias",
|
||||
"path": "mongo_ops.transactions.Awaitable",
|
||||
"signature": "<bound method Alias.signature of Alias('Awaitable', 'collections.abc.Awaitable')>",
|
||||
"docstring": null
|
||||
},
|
||||
"asynccontextmanager": {
|
||||
"name": "asynccontextmanager",
|
||||
"kind": "alias",
|
||||
"path": "mongo_ops.transactions.asynccontextmanager",
|
||||
"signature": "<bound method Alias.signature of Alias('asynccontextmanager', 'contextlib.asynccontextmanager')>",
|
||||
"docstring": null
|
||||
},
|
||||
"Any": {
|
||||
"name": "Any",
|
||||
"kind": "alias",
|
||||
"path": "mongo_ops.transactions.Any",
|
||||
"signature": "<bound method Alias.signature of Alias('Any', 'typing.Any')>",
|
||||
"docstring": null
|
||||
},
|
||||
"Callable": {
|
||||
"name": "Callable",
|
||||
"kind": "alias",
|
||||
"path": "mongo_ops.transactions.Callable",
|
||||
"signature": "<bound method Alias.signature of Alias('Callable', 'typing.Callable')>",
|
||||
"docstring": null
|
||||
},
|
||||
"List": {
|
||||
"name": "List",
|
||||
"kind": "alias",
|
||||
"path": "mongo_ops.transactions.List",
|
||||
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||||
"docstring": null
|
||||
},
|
||||
"AsyncIOMotorClientSession": {
|
||||
"name": "AsyncIOMotorClientSession",
|
||||
"kind": "alias",
|
||||
"path": "mongo_ops.transactions.AsyncIOMotorClientSession",
|
||||
"signature": "<bound method Alias.signature of Alias('AsyncIOMotorClientSession', 'motor.motor_asyncio.AsyncIOMotorClientSession')>",
|
||||
"docstring": null
|
||||
},
|
||||
"MongoConnectionManager": {
|
||||
"name": "MongoConnectionManager",
|
||||
"kind": "class",
|
||||
"path": "mongo_ops.transactions.MongoConnectionManager",
|
||||
"signature": "<bound method Alias.signature of Alias('MongoConnectionManager', 'mongo_ops.connection.MongoConnectionManager')>",
|
||||
"docstring": "Manages MongoDB connections with async lifecycle.\n\nThis class provides a singleton-like manager for the MongoDB client and \ndatabase instances, ensuring they are properly initialized and closed \nacross the application lifecycle.",
|
||||
"signature": null,
|
||||
"docstring": "Manages MongoDB connections with async lifecycle.\n\nThis class provides a singleton-like manager for the MongoDB client and\ndatabase instances, ensuring they are properly initialized and closed\nacross the application lifecycle.",
|
||||
"members": {
|
||||
"connect": {
|
||||
"name": "connect",
|
||||
"kind": "function",
|
||||
"path": "mongo_ops.transactions.MongoConnectionManager.connect",
|
||||
"signature": "<bound method Alias.signature of Alias('connect', 'mongo_ops.connection.MongoConnectionManager.connect')>",
|
||||
"docstring": "Connect to MongoDB and initialize the shared client.\n\nArgs:\n uri: MongoDB connection URI (e.g., \"mongodb://localhost:27017\").\n db_name: Name of the database to use.\n **kwargs: Additional Motor client options (e.g., maxPoolSize).\n\nReturns:\n AsyncIOMotorDatabase: The initialized database instance."
|
||||
"signature": "connect(uri: str, db_name: str, **kwargs: Any)",
|
||||
"docstring": "Connect to MongoDB and initialize the shared client.\n\nArgs:\n uri (str): MongoDB connection URI (e.g., \"mongodb://localhost:27017\").\n db_name (str): Name of the database to use.\n **kwargs: Additional Motor client options (e.g., maxPoolSize).\n\nReturns:\n AsyncIOMotorDatabase: The initialized database instance."
|
||||
},
|
||||
"disconnect": {
|
||||
"name": "disconnect",
|
||||
"kind": "function",
|
||||
"path": "mongo_ops.transactions.MongoConnectionManager.disconnect",
|
||||
"signature": "<bound method Alias.signature of Alias('disconnect', 'mongo_ops.connection.MongoConnectionManager.disconnect')>",
|
||||
"signature": "disconnect()",
|
||||
"docstring": "Close the active MongoDB connection and cleanup resources."
|
||||
},
|
||||
"get_database": {
|
||||
"name": "get_database",
|
||||
"kind": "function",
|
||||
"path": "mongo_ops.transactions.MongoConnectionManager.get_database",
|
||||
"signature": "<bound method Alias.signature of Alias('get_database', 'mongo_ops.connection.MongoConnectionManager.get_database')>",
|
||||
"signature": "get_database()",
|
||||
"docstring": "Retrieve the current database instance.\n\nReturns:\n AsyncIOMotorDatabase: The active database instance.\n\nRaises:\n RuntimeError: If connect() has not been called yet."
|
||||
},
|
||||
"get_client": {
|
||||
"name": "get_client",
|
||||
"kind": "function",
|
||||
"path": "mongo_ops.transactions.MongoConnectionManager.get_client",
|
||||
"signature": "<bound method Alias.signature of Alias('get_client', 'mongo_ops.connection.MongoConnectionManager.get_client')>",
|
||||
"signature": "get_client()",
|
||||
"docstring": "Retrieve the current client instance.\n\nReturns:\n AsyncIOMotorClient: The active Motor client instance.\n\nRaises:\n RuntimeError: If connect() has not been called yet."
|
||||
},
|
||||
"lifespan": {
|
||||
"name": "lifespan",
|
||||
"kind": "function",
|
||||
"path": "mongo_ops.transactions.MongoConnectionManager.lifespan",
|
||||
"signature": "<bound method Alias.signature of Alias('lifespan', 'mongo_ops.connection.MongoConnectionManager.lifespan')>",
|
||||
"docstring": "Async context manager for managing connection lifecycle.\n\nDesigned for use with FastAPI or other frameworks supporting \nlifespan management.\n\nArgs:\n uri: MongoDB connection URI.\n db_name: Name of the database.\n **kwargs: Additional Motor client options.\n\nYields:\n AsyncIOMotorDatabase: The active database instance.\n\nUsage:\n @asynccontextmanager\n async def lifespan(app: FastAPI):\n async with MongoConnectionManager.lifespan(uri, db_name):\n yield"
|
||||
"signature": "lifespan(uri: str, db_name: str, **kwargs: Any)",
|
||||
"docstring": "Async context manager for managing connection lifecycle.\n\nDesigned for use with FastAPI or other frameworks supporting\nlifespan management.\n\nNotes:\n Connects to MongoDB on entry, yields the active database instance\n to the context body, and disconnects on exit.\n\nUsage:\n @asynccontextmanager\n async def lifespan(app: FastAPI):\n async with MongoConnectionManager.lifespan(uri, db_name):\n yield"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -94,22 +52,22 @@
|
||||
"name": "TransactionManager",
|
||||
"kind": "class",
|
||||
"path": "mongo_ops.transactions.TransactionManager",
|
||||
"signature": "<bound method Class.signature of Class('TransactionManager', 11, 69)>",
|
||||
"docstring": "Simplified multi-document transaction handling.\n\nThis class provides helpers for executing operations within a MongoDB \ntransaction, ensuring ACID compliance for multi-document updates.",
|
||||
"signature": null,
|
||||
"docstring": "Simplified multi-document transaction handling.\n\nThis class provides helpers for executing operations within a MongoDB\ntransaction, ensuring ACID compliance for multi-document updates.",
|
||||
"members": {
|
||||
"start_session": {
|
||||
"name": "start_session",
|
||||
"kind": "function",
|
||||
"path": "mongo_ops.transactions.TransactionManager.start_session",
|
||||
"signature": "<bound method Function.signature of Function('start_session', 19, 39)>",
|
||||
"docstring": "Start a transaction session as an async context manager.\n\nArgs:\n **kwargs: Transaction options (e.g., read_concern, write_concern).\n\nYields:\n AsyncIOMotorClientSession: The active session with a started transaction.\n\nUsage:\n async with TransactionManager.start_session() as session:\n await collection.insert_one(doc, session=session)\n await other_collection.update_one(filter, update, session=session)"
|
||||
"signature": "start_session(**kwargs: Any) -> AbstractAsyncContextManager[AsyncIOMotorClientSession]",
|
||||
"docstring": "Start a transaction session as an async context manager.\n\nNotes:\n Yields the active session with a started transaction; callers\n run their operations against the session inside the with-block.\n\nUsage:\n async with TransactionManager.start_session() as session:\n await collection.insert_one(doc, session=session)\n await other_collection.update_one(filter, update, session=session)"
|
||||
},
|
||||
"execute_transaction": {
|
||||
"name": "execute_transaction",
|
||||
"kind": "function",
|
||||
"path": "mongo_ops.transactions.TransactionManager.execute_transaction",
|
||||
"signature": "<bound method Function.signature of Function('execute_transaction', 41, 69)>",
|
||||
"docstring": "Execute multiple operations within a single transaction.\n\nArgs:\n operations: A list of async callables that accept a session \n parameter and return a result.\n **kwargs: Transaction options.\n\nReturns:\n List[Any]: A list containing the results of each operation.\n\nUsage:\n results = await TransactionManager.execute_transaction([\n lambda s: repo1.create(data1, session=s),\n lambda s: repo2.update(id, data2, session=s),\n ])"
|
||||
"signature": "execute_transaction(operations: list[Callable[[AsyncIOMotorClientSession], Awaitable[Any]]], **kwargs: Any) -> list[Any]",
|
||||
"docstring": "Execute multiple operations within a single transaction.\n\nArgs:\n operations (List[Callable[[AsyncIOMotorClientSession], Awaitable[Any]]]): A list of async\n callables that accept a session parameter and return a result.\n **kwargs: Transaction options.\n\nReturns:\n List[Any]: A list containing the results of each operation.\n\nExample:\n results = await TransactionManager.execute_transaction([\n lambda s: repo1.create(data1, session=s),\n lambda s: repo2.update(id, data2, session=s),\n ])"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user