mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-25 10:42:11 +00:00
下一轮第 2 波的契约骨架:用户加 kind(服务账号)、剖析任务加上传表格的快照 id、工件按种类的索引;新模型文件 models_sources、models_eval(整模块导入);评测、访问密钥的路由模块和口径账本按运行读的路由先登记好权限(评测只给搭建者,访问密钥登录即可,账本按运行读的和证据同一道门)
This commit is contained in:
@@ -245,6 +245,9 @@ _COLUMN_MIGRATIONS: list[tuple[str, str, str]] = [
|
||||
("schedules", "target_kind", "VARCHAR(20) DEFAULT 'workflow'"),
|
||||
("schedules", "target_id", "VARCHAR(32)"),
|
||||
("schedule_fires", "eval_run_id", "VARCHAR(32)"),
|
||||
# 第 2 波:服务账号(users.kind);剖析上传表格源时的快照
|
||||
("users", "kind", "VARCHAR(20) DEFAULT 'person'"),
|
||||
("catalog_profile_tasks", "snapshot_id", "VARCHAR(32)"),
|
||||
]
|
||||
|
||||
#: 迁移补上的列要建的索引:(索引名, 表, 列或多列)。create_all 不碰已有的表,表上新列的索引也就不会建。
|
||||
@@ -259,6 +262,8 @@ _INDEX_MIGRATIONS: list[tuple[str, str, str | tuple[str, ...]]] = [
|
||||
("ix_runs_wf_ver_status", "runs", ("workflow_id", "version", "status")),
|
||||
("ix_conversations_app_id", "conversations", "app_id"),
|
||||
("ix_conversations_created_by", "conversations", "created_by"),
|
||||
# 口径账本按种类反查工件(kind=caliber_match,next-round 02 做法 2)
|
||||
("ix_artifacts_kind", "artifacts", "kind"),
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -521,6 +521,8 @@ class CatalogProfileTask(Base):
|
||||
version: Mapped[int] = mapped_column(Integer, default=0)
|
||||
# 整张表的原因:表结构里没有、视图、空表、没有可剖析的项、写入一直冲突、停止 / 中断 / 止损
|
||||
error: Mapped[str | None] = mapped_column(Text, default=None)
|
||||
# 剖析上传表格源时那一刻的快照(数据库源为空):上传表格换了版本之后,旧版本的剖析事实不再交给 look(next-round 遗留 e)
|
||||
snapshot_id: Mapped[str | None] = mapped_column(String(32), default=None)
|
||||
started_at: Mapped[datetime | None] = mapped_column(UTCDateTime, default=None)
|
||||
finished_at: Mapped[datetime | None] = mapped_column(UTCDateTime, default=None)
|
||||
|
||||
@@ -1081,3 +1083,6 @@ from app.db.models_process import ( # noqa: E402,F401
|
||||
from app.db.models_blueprints import ( # noqa: E402,F401
|
||||
Blueprint, BlueprintEvent, PublishPlan, RecordsTable, StoredFile,
|
||||
)
|
||||
# 下一轮第 2 波(docs/design/next-round):数据源对象索引与后台探查(models_sources)、评测(models_eval)。整模块导入,
|
||||
# 各自的模型类由那两个文件自己登记,这里不逐个列名
|
||||
from app.db import models_eval, models_sources # noqa: E402,F401
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
"""评测:题集、题目、评测、结果(docs/design/next-round/01-效果度量与回归评测.md 做法 7)。
|
||||
|
||||
第 2 波 W2-c 填。由 app/db/models.py 末尾整模块导入,create_all 建表。
|
||||
"""
|
||||
from __future__ import annotations
|
||||
@@ -28,6 +28,8 @@ class User(Base, TimestampMixin):
|
||||
display_name: Mapped[str] = mapped_column(String(100), default="")
|
||||
email: Mapped[str | None] = mapped_column(String(200), default=None)
|
||||
role: Mapped[str] = mapped_column(String(20), default="user")
|
||||
# person 人;service 服务账号(next-round 04 A1):管理员建,没有口令、不能登录,只持有访问密钥
|
||||
kind: Mapped[str] = mapped_column(String(20), default="person")
|
||||
# local 模式:hashlib.scrypt 的结果(含盐和参数);OIDC 用户为空
|
||||
password_hash: Mapped[str | None] = mapped_column(Text, default=None)
|
||||
oidc_issuer: Mapped[str | None] = mapped_column(String(300), default=None)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
"""数据源的对象索引、探查范围、后台探查任务(docs/design/next-round/03-数据接入与目录维护.md A1)。
|
||||
|
||||
第 2 波 W2-a 填。由 app/db/models.py 末尾整模块导入,create_all 建表。
|
||||
"""
|
||||
from __future__ import annotations
|
||||
Reference in New Issue
Block a user