Files
AgentLab/backend/app/data/catalog_job_runtime.py
ThearchyHelios 3565227748 后台任务运行时上移到 core/job_runtime.py(总方案 X5):评测、后台探查都要用它,从 data 包里导入一个「数据目录的」运行时说不通
- data/catalog_job_runtime.py 只留一个老路径:sys.modules 指向 core.job_runtime,同一个模块对象、同一条队,起草、剖析和测试里的 import 一个字不用改
- 同源队里的事做成开放的:运行时不再认具体几种,各模块 register_lane_kind 登记(起草这边 draft / sync_draft / import,剖析 profile),进队只核对登记过;第 2 波的后台探查登记一行就排进同一条队,拼错的 kind 当场报错
- JobRun 多一个 lane_of 钩子(缺省 job.source_id):以后不占源的任务(评测)返回 None 就不进队,现有起草、剖析行为不变
- 新增 tests/test_job_runtime.py
2026-10-16 09:59:44 +08:00

14 lines
625 B
Python
Raw Permalink 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.
"""后台任务运行时的老路径:已上移到 app/core/job_runtime.py(docs/design/next-round/00-总方案.md X5)。
这里把那个模块原样放在老名字下(sys.modules 指向同一个模块对象):起草、剖析和别处的 `from app.data import
catalog_job_runtime as runtime`、`from app.data.catalog_job_runtime import …` 拿到的是同一批名字、同一条队(lanes),
测试里改它的属性也就是改那个模块。新代码从 app.core.job_runtime 导入。
"""
from __future__ import annotations
import sys
from app.core import job_runtime
sys.modules[__name__] = job_runtime