docs(README): 更新项目说明文档,完善架构与启动指南
- 调整 CLAUDE.md 内容,增加使用指导和架构概览 - 补充微服务启动说明及单服务启动命令 - 明确 Gateway 服务器四阶段启动流程和职责划分 - 细化后端目录结构说明,补充主要文件职责描述 - 新增系统分层结构图,优化整体架构理解 - 更新 .gitignore,添加 runs 目录忽略规则 - 同步 .omc 相关状态文件,更新项目状态跟踪信息
This commit is contained in:
@@ -41,6 +41,8 @@ class SkillsManager:
|
||||
)
|
||||
self.runs_root = self.project_root / "runs"
|
||||
self._lock = Lock()
|
||||
# Instance-level pending skill changes (thread-safe via self._lock)
|
||||
self._pending_skill_changes: Dict[str, Set[Path]] = {}
|
||||
|
||||
def get_active_root(self, config_name: str) -> Path:
|
||||
return self.runs_root / config_name / "skills" / "active"
|
||||
@@ -739,7 +741,7 @@ class SkillsManager:
|
||||
if local_root.exists():
|
||||
watched_paths.append(local_root)
|
||||
|
||||
handler = _SkillsChangeHandler(watched_paths, callback, self._lock)
|
||||
handler = _SkillsChangeHandler(watched_paths, self._pending_skill_changes, callback, self._lock)
|
||||
observer = Observer()
|
||||
for path in watched_paths:
|
||||
observer.schedule(handler, str(path), recursive=True)
|
||||
@@ -773,6 +775,7 @@ class SkillsManager:
|
||||
# -------------------------------------------------------------------------
|
||||
# Internal change-tracking state (populated by _SkillsChangeHandler)
|
||||
# -------------------------------------------------------------------------
|
||||
# Legacy class-level reference kept for migration compatibility
|
||||
_pending_skill_changes: Dict[str, Set[Path]] = {}
|
||||
|
||||
def _resolve_disabled_skill_names(
|
||||
@@ -824,11 +827,13 @@ class _SkillsChangeHandler(FileSystemEventHandler):
|
||||
def __init__(
|
||||
self,
|
||||
watched_paths: List[Path],
|
||||
pending_changes: Dict[str, Set[Path]],
|
||||
callback: Optional[Any] = None,
|
||||
lock: Optional[Lock] = None,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self._watched_paths = watched_paths
|
||||
self._pending_changes = pending_changes
|
||||
self._callback = callback
|
||||
self._lock = lock
|
||||
|
||||
@@ -841,13 +846,9 @@ class _SkillsChangeHandler(FileSystemEventHandler):
|
||||
run_id = self._run_id_from_path(src_path)
|
||||
if self._lock:
|
||||
with self._lock:
|
||||
SkillsManager._pending_skill_changes.setdefault(
|
||||
run_id, set()
|
||||
).add(src_path)
|
||||
self._pending_changes.setdefault(run_id, set()).add(src_path)
|
||||
else:
|
||||
SkillsManager._pending_skill_changes.setdefault(
|
||||
run_id, set()
|
||||
).add(src_path)
|
||||
self._pending_changes.setdefault(run_id, set()).add(src_path)
|
||||
if self._callback:
|
||||
self._callback([src_path])
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user