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:
2026-10-13 03:26:51 +05:30
parent ef951a1913
commit fced40af59
109 changed files with 4082 additions and 5885 deletions

View File

@@ -2,84 +2,70 @@
"module": "mongo_ops.cache.redis_backend",
"content": {
"path": "mongo_ops.cache.redis_backend",
"docstring": null,
"docstring": "# Summary\n\nRedis cache backend with key prefixing and pub/sub invalidation.",
"objects": {
"json": {
"name": "json",
"kind": "alias",
"path": "mongo_ops.cache.redis_backend.json",
"signature": "<bound method Alias.signature of Alias('json', 'json')>",
"docstring": null
},
"Optional": {
"name": "Optional",
"kind": "alias",
"path": "mongo_ops.cache.redis_backend.Optional",
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
"docstring": null
},
"CacheBackend": {
"name": "CacheBackend",
"kind": "class",
"path": "mongo_ops.cache.redis_backend.CacheBackend",
"signature": "<bound method Alias.signature of Alias('CacheBackend', 'mongo_ops.cache.backend.CacheBackend')>",
"docstring": null,
"signature": null,
"docstring": "Abstract interface for cache backends.\n\nImplementations store byte-encoded values keyed by string, track usage\nstatistics, and manage their own lifecycle. The in-memory and Redis\nbackends both implement this contract.",
"members": {
"get": {
"name": "get",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.CacheBackend.get",
"signature": "<bound method Alias.signature of Alias('get', 'mongo_ops.cache.backend.CacheBackend.get')>",
"docstring": null
"signature": "get(key: str)",
"docstring": "Fetch a value from the cache.\n\nArgs:\n key (str):\n The cache key.\n\nReturns:\n Optional[bytes]: The cached bytes, or None on a miss."
},
"set": {
"name": "set",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.CacheBackend.set",
"signature": "<bound method Alias.signature of Alias('set', 'mongo_ops.cache.backend.CacheBackend.set')>",
"docstring": null
"signature": "set(key: str, value: bytes, ttl: int | None = None)",
"docstring": "Store a value in the cache.\n\nArgs:\n key (str):\n The cache key.\n value (bytes):\n The byte-encoded value to store.\n ttl (Optional[int]):\n Time-to-live in seconds. When None, the backend default\n applies."
},
"delete": {
"name": "delete",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.CacheBackend.delete",
"signature": "<bound method Alias.signature of Alias('delete', 'mongo_ops.cache.backend.CacheBackend.delete')>",
"docstring": null
"signature": "delete(key: str)",
"docstring": "Remove a key from the cache.\n\nArgs:\n key (str):\n The cache key."
},
"exists": {
"name": "exists",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.CacheBackend.exists",
"signature": "<bound method Alias.signature of Alias('exists', 'mongo_ops.cache.backend.CacheBackend.exists')>",
"docstring": null
"signature": "exists(key: str)",
"docstring": "Check whether a key is present.\n\nArgs:\n key (str):\n The cache key.\n\nReturns:\n bool: True if the key exists, False otherwise."
},
"clear_pattern": {
"name": "clear_pattern",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.CacheBackend.clear_pattern",
"signature": "<bound method Alias.signature of Alias('clear_pattern', 'mongo_ops.cache.backend.CacheBackend.clear_pattern')>",
"docstring": null
"signature": "clear_pattern(pattern: str)",
"docstring": "Remove all keys matching a glob pattern.\n\nArgs:\n pattern (str):\n Glob-style pattern; a trailing `*` matches prefixes."
},
"get_stats": {
"name": "get_stats",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.CacheBackend.get_stats",
"signature": "<bound method Alias.signature of Alias('get_stats', 'mongo_ops.cache.backend.CacheBackend.get_stats')>",
"docstring": null
"signature": "get_stats()",
"docstring": "Return a snapshot of cache statistics.\n\nReturns:\n CacheStats: A copy of the current stats counters."
},
"initialize": {
"name": "initialize",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.CacheBackend.initialize",
"signature": "<bound method Alias.signature of Alias('initialize', 'mongo_ops.cache.backend.CacheBackend.initialize')>",
"docstring": null
"signature": "initialize()",
"docstring": "Start background resources owned by the backend.\n\nShould be called once during application startup, after the\nrepositories are connected."
},
"shutdown": {
"name": "shutdown",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.CacheBackend.shutdown",
"signature": "<bound method Alias.signature of Alias('shutdown', 'mongo_ops.cache.backend.CacheBackend.shutdown')>",
"docstring": null
"signature": "shutdown()",
"docstring": "Stop and release background resources.\n\nShould be called once during application shutdown."
}
}
},
@@ -87,129 +73,122 @@
"name": "CacheStats",
"kind": "class",
"path": "mongo_ops.cache.redis_backend.CacheStats",
"signature": "<bound method Alias.signature of Alias('CacheStats', 'mongo_ops.cache.backend.CacheStats')>",
"docstring": null,
"signature": "CacheStats(hits: int = 0, misses: int = 0, sets: int = 0, deletes: int = 0, current_size: int = 0, max_size: int = 0)",
"docstring": "Snapshot of cache usage and activity counters.\n\nAttributes:\n hits (int):\n Number of get() calls that found a value.\n misses (int):\n Number of get() calls that returned None.\n sets (int):\n Number of values written to the cache.\n deletes (int):\n Number of keys removed.\n current_size (int):\n Number of entries currently held.\n max_size (int):\n Maximum number of entries the cache allows (0 = unbounded).",
"members": {
"hits": {
"name": "hits",
"kind": "attribute",
"path": "mongo_ops.cache.redis_backend.CacheStats.hits",
"signature": "<bound method Alias.signature of Alias('hits', 'mongo_ops.cache.backend.CacheStats.hits')>",
"signature": null,
"docstring": null
},
"misses": {
"name": "misses",
"kind": "attribute",
"path": "mongo_ops.cache.redis_backend.CacheStats.misses",
"signature": "<bound method Alias.signature of Alias('misses', 'mongo_ops.cache.backend.CacheStats.misses')>",
"signature": null,
"docstring": null
},
"sets": {
"name": "sets",
"kind": "attribute",
"path": "mongo_ops.cache.redis_backend.CacheStats.sets",
"signature": "<bound method Alias.signature of Alias('sets', 'mongo_ops.cache.backend.CacheStats.sets')>",
"signature": null,
"docstring": null
},
"deletes": {
"name": "deletes",
"kind": "attribute",
"path": "mongo_ops.cache.redis_backend.CacheStats.deletes",
"signature": "<bound method Alias.signature of Alias('deletes', 'mongo_ops.cache.backend.CacheStats.deletes')>",
"signature": null,
"docstring": null
},
"current_size": {
"name": "current_size",
"kind": "attribute",
"path": "mongo_ops.cache.redis_backend.CacheStats.current_size",
"signature": "<bound method Alias.signature of Alias('current_size', 'mongo_ops.cache.backend.CacheStats.current_size')>",
"signature": null,
"docstring": null
},
"max_size": {
"name": "max_size",
"kind": "attribute",
"path": "mongo_ops.cache.redis_backend.CacheStats.max_size",
"signature": "<bound method Alias.signature of Alias('max_size', 'mongo_ops.cache.backend.CacheStats.max_size')>",
"signature": null,
"docstring": null
}
}
},
"Redis": {
"name": "Redis",
"kind": "alias",
"path": "mongo_ops.cache.redis_backend.Redis",
"signature": "<bound method Alias.signature of Alias('Redis', 'redis.asyncio.Redis')>",
"docstring": null
},
"RedisCacheBackend": {
"name": "RedisCacheBackend",
"kind": "class",
"path": "mongo_ops.cache.redis_backend.RedisCacheBackend",
"signature": "<bound method Class.signature of Class('RedisCacheBackend', 12, 93)>",
"docstring": null,
"signature": "RedisCacheBackend(redis_client: Redis, key_prefix: str = '', default_ttl: int = 300)",
"docstring": "Cache backend backed by Redis with key prefixing.\n\nValues are stored with a configurable key prefix, and deletions publish\non a shared invalidation channel so other processes can react.\n\nNotes:\n **Lifecycle:**\n\n Requires ``pip install mongo-ops[redis]`` and a live Redis\n connection supplied by the caller.",
"members": {
"initialize": {
"name": "initialize",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.RedisCacheBackend.initialize",
"signature": "<bound method Function.signature of Function('initialize', 28, 29)>",
"docstring": null
"signature": "initialize() -> None",
"docstring": "Open the pub/sub subscription used for invalidation."
},
"shutdown": {
"name": "shutdown",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.RedisCacheBackend.shutdown",
"signature": "<bound method Function.signature of Function('shutdown', 31, 34)>",
"docstring": null
"signature": "shutdown() -> None",
"docstring": "Close the pub/sub subscription."
},
"get": {
"name": "get",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.RedisCacheBackend.get",
"signature": "<bound method Function.signature of Function('get', 39, 46)>",
"docstring": null
"signature": "get(key: str) -> bytes | None",
"docstring": "Fetch a value from the cache.\n\nArgs:\n key (str):\n The cache key.\n\nReturns:\n Optional[bytes]: The cached bytes, or None on a miss."
},
"set": {
"name": "set",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.RedisCacheBackend.set",
"signature": "<bound method Function.signature of Function('set', 48, 52)>",
"docstring": null
"signature": "set(key: str, value: bytes, ttl: int | None = None) -> None",
"docstring": "Store a value in the cache.\n\nArgs:\n key (str):\n The cache key.\n value (bytes):\n The byte-encoded value to store.\n ttl (Optional[int]):\n Time-to-live in seconds; defaults to the backend default."
},
"delete": {
"name": "delete",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.RedisCacheBackend.delete",
"signature": "<bound method Function.signature of Function('delete', 54, 59)>",
"docstring": null
"signature": "delete(key: str) -> None",
"docstring": "Remove a key and publish an invalidation notice.\n\nArgs:\n key (str):\n The cache key."
},
"exists": {
"name": "exists",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.RedisCacheBackend.exists",
"signature": "<bound method Function.signature of Function('exists', 61, 63)>",
"docstring": null
"signature": "exists(key: str) -> bool",
"docstring": "Check whether a key is present.\n\nArgs:\n key (str):\n The cache key.\n\nReturns:\n bool: True if the key exists, False otherwise."
},
"clear_pattern": {
"name": "clear_pattern",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.RedisCacheBackend.clear_pattern",
"signature": "<bound method Function.signature of Function('clear_pattern', 65, 79)>",
"docstring": null
"signature": "clear_pattern(pattern: str) -> None",
"docstring": "Remove all keys matching a glob pattern via SCAN/DEL.\n\nArgs:\n pattern (str):\n Glob-style pattern; a trailing `*` matches prefixes."
},
"get_stats": {
"name": "get_stats",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.RedisCacheBackend.get_stats",
"signature": "<bound method Function.signature of Function('get_stats', 81, 90)>",
"docstring": null
"signature": "get_stats() -> CacheStats",
"docstring": "Return a snapshot of cache statistics.\n\nReturns:\n CacheStats: Stats with current_size taken from Redis dbsize."
},
"publish_invalidate": {
"name": "publish_invalidate",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.RedisCacheBackend.publish_invalidate",
"signature": "<bound method Function.signature of Function('publish_invalidate', 92, 93)>",
"docstring": null
"signature": "publish_invalidate(key: str) -> None",
"docstring": "Publish an invalidation notice for a key.\n\nArgs:\n key (str):\n The cache key to broadcast."
}
}
},
@@ -217,15 +196,15 @@
"name": "encode_value",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.encode_value",
"signature": "<bound method Function.signature of Function('encode_value', 99, 100)>",
"docstring": null
"signature": "encode_value(value: dict) -> bytes",
"docstring": "Encode a dict into cache-ready bytes.\n\nNon-serializable values (e.g., ObjectId) are coerced with str().\n\nArgs:\n value (dict):\n The dictionary to encode.\n\nReturns:\n bytes: UTF-8 JSON bytes."
},
"decode_value": {
"name": "decode_value",
"kind": "function",
"path": "mongo_ops.cache.redis_backend.decode_value",
"signature": "<bound method Function.signature of Function('decode_value', 103, 104)>",
"docstring": null
"signature": "decode_value(data: bytes) -> dict",
"docstring": "Decode cache bytes back into a dict.\n\nArgs:\n data (bytes):\n UTF-8 JSON bytes produced by encode_value().\n\nReturns:\n dict: The decoded dictionary."
}
}
}