Files
any-hub/specs/006-module-hook-refactor/contracts/README.md
2025-11-17 15:39:44 +08:00

17 lines
718 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Contracts: Module Hook Refactor
## `/ - /modules` Diagnostics
- **Purpose**: 列出所有模块的 metadata 与 Hook 注册状态SRE 可检查模块是否迁移到 Hook 模式。
- **Response Additions**:
- `hook_status`: `registered | legacy-only | missing`
- `handler_status`: `ok | missing | panic`
- **Usage**: SRE 通过 `curl http://host:port/-/modules` 观察所有模块状态;缺失 Hook 或 handler 时需在日志与响应中同步体现。
## Error Responses
- `module_handler_missing`: 500 JSON `{ "error": "module_handler_missing" }`
- `module_handler_panic`: 500 JSON `{ "error": "module_handler_panic" }`
这些错误需出现在日志中并附带 `hub/domain/module_key/request_id`