feat(evolution): __init__.py public API + ARCHITECTURE.md Protocol update
This commit is contained in:
@@ -0,0 +1,45 @@
|
|||||||
|
"""core/evolution/ — 自进化循环决策内核。
|
||||||
|
|
||||||
|
诊断、进化、门控、补丁的纯决策逻辑。
|
||||||
|
只依赖 Protocol 接口和标准库,可搬到无 adapters 的环境用假实现原样运行。
|
||||||
|
"""
|
||||||
|
|
||||||
|
from core.evolution.diagnose import run_diagnosis
|
||||||
|
from core.evolution.evolve import (
|
||||||
|
edit_budget_at,
|
||||||
|
evolve_single_skill,
|
||||||
|
evolve_single_tool,
|
||||||
|
evolve_system_prompt,
|
||||||
|
resolve_skill_file,
|
||||||
|
)
|
||||||
|
from core.evolution.gate import compute_e_value, gate_decision, probation_verdict
|
||||||
|
from core.evolution.patch import (
|
||||||
|
append_to_appendix,
|
||||||
|
apply_patch_with_report,
|
||||||
|
extract_appendix_notes,
|
||||||
|
momentum_inner,
|
||||||
|
replace_appendix_notes,
|
||||||
|
replace_momentum,
|
||||||
|
)
|
||||||
|
from core.evolution.validate import classify_quadrants, compute_accuracy, pair_block
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"append_to_appendix",
|
||||||
|
"apply_patch_with_report",
|
||||||
|
"classify_quadrants",
|
||||||
|
"compute_accuracy",
|
||||||
|
"compute_e_value",
|
||||||
|
"edit_budget_at",
|
||||||
|
"evolve_single_skill",
|
||||||
|
"evolve_single_tool",
|
||||||
|
"evolve_system_prompt",
|
||||||
|
"extract_appendix_notes",
|
||||||
|
"gate_decision",
|
||||||
|
"momentum_inner",
|
||||||
|
"pair_block",
|
||||||
|
"probation_verdict",
|
||||||
|
"replace_appendix_notes",
|
||||||
|
"replace_momentum",
|
||||||
|
"resolve_skill_file",
|
||||||
|
"run_diagnosis",
|
||||||
|
]
|
||||||
|
|||||||
@@ -213,11 +213,13 @@ project_root/
|
|||||||
|
|
||||||
**Evolution 专属端口(`core/evolution/protocols.py`):**
|
**Evolution 专属端口(`core/evolution/protocols.py`):**
|
||||||
|
|
||||||
|
core/ 侧 Protocol 只读——core/ 返回结果 dataclass,写入由 app/harness/ 编排层执行。写方法保留在 app/ 侧的实现类中。
|
||||||
|
|
||||||
| Protocol | 关键方法 | 职责 |
|
| Protocol | 关键方法 | 职责 |
|
||||||
|----------|---------|------|
|
|----------|---------|------|
|
||||||
| `SkillStore` | `read_skill()`, `write_skill()`, `list_versions()` | 版本化技能存储 |
|
| `SkillStore` | `read_skill()`, `list_skill_files()` | 版本化技能读取(只读) |
|
||||||
| `PromptStore` | `read_prompt()`, `write_prompt()` | 版本化提示词存储 |
|
| `PromptStore` | `read_prompt()`, `list_prompt_files()` | 版本化提示词读取(只读) |
|
||||||
| `RunLog` | `insert()`, `query()` | 实验日志 |
|
| `RunLog` | `get_predictions()`, `get_traces()` | 实验日志查询(只读) |
|
||||||
|
|
||||||
### 3.2 应用层端口(`app/ports.py`)
|
### 3.2 应用层端口(`app/ports.py`)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user