按 docs/v2/05-implementation-plan.md §1 候选迁移表与 claude_use/T00 白名单, 从 55e2cdb 抽取 224 个文件(2.48 MB)到独立目录 F:/mini-OpenClaw-v2。 - 排除:凭据(.env/server-deploy.conf/旧DELIVERY.md)、运行数据(xingbang_data 等 4 个 SQLite)、依赖(venv/node_modules 符号链接)、归档(_backup*/test-evidence/ ori_file)、Office 临时文件 - 目标目录独立 git 仓库,初始恢复点;Gitea 远程与分支待 OQ-06 Q2 定案 - 未部署、未启动服务、未调用模型 Co-Authored-By: Claude Code <noreply@anthropic.com>
70 lines
2.1 KiB
Python
70 lines
2.1 KiB
Python
"""Stable, serialisable contracts for project-scoped business runs."""
|
|
|
|
from typing import Any, Literal
|
|
|
|
from pydantic import BaseModel, Field, ConfigDict
|
|
|
|
|
|
class Evidence(BaseModel):
|
|
model_config = ConfigDict(extra="allow")
|
|
id: str
|
|
project_id: str
|
|
source: str
|
|
locator: str
|
|
field: str
|
|
value: Any = None
|
|
snapshot_id: str
|
|
|
|
|
|
class CheckOutcome(BaseModel):
|
|
model_config = ConfigDict(extra="allow")
|
|
code: str = Field(min_length=1, max_length=250)
|
|
title: str
|
|
result: Literal["pass", "issue", "unknown", "not_applicable", "error"]
|
|
severity: Literal["info", "attention", "warning"] = "attention"
|
|
fields: list[str] = Field(default_factory=list)
|
|
evidence_ids: list[str] = Field(default_factory=list)
|
|
basis_ids: list[str] = Field(default_factory=list)
|
|
suggested_action: str = ""
|
|
|
|
|
|
class Finding(BaseModel):
|
|
id: str
|
|
code: str
|
|
project_id: str
|
|
title: str
|
|
result: Literal["pass", "issue", "unknown", "not_applicable", "error"]
|
|
severity: Literal["info", "attention", "warning"] = "attention"
|
|
status: Literal["待处理", "待补件", "待复核", "已解决", "不适用"] = "待处理"
|
|
evidence_ids: list[str] = Field(default_factory=list)
|
|
basis_ids: list[str] = Field(default_factory=list)
|
|
suggested_action: str = ""
|
|
first_seen_run_id: str
|
|
last_seen_run_id: str
|
|
|
|
|
|
class ProjectSnapshot(BaseModel):
|
|
model_config = ConfigDict(extra="allow")
|
|
schema_version: int = 1
|
|
id: str
|
|
project_id: str
|
|
data_domain: Literal["demo", "production"]
|
|
revision: int
|
|
created_at: str
|
|
facts: dict[str, Any]
|
|
documents: list[dict[str, Any]] = Field(default_factory=list)
|
|
|
|
|
|
class SkillResult(BaseModel):
|
|
model_config = ConfigDict(extra="allow")
|
|
schema_version: int = 1
|
|
run_id: str
|
|
step_id: str
|
|
skill: dict[str, str]
|
|
status: Literal["completed", "partial", "failed", "skipped"]
|
|
input_snapshot_id: str
|
|
outputs: dict[str, Any] = Field(default_factory=dict)
|
|
findings: list[CheckOutcome] = Field(default_factory=list)
|
|
missing_inputs: list[str] = Field(default_factory=list)
|
|
errors: list[dict[str, Any]] = Field(default_factory=list)
|