Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
6d8843f
feat(tools): allow legalize-only DreamPlace for Timing Opt
Emin017 Aug 31, 2026
9bc2047
feat(tools): legalize Sizer output inside Timing Opt
Emin017 Aug 31, 2026
400cd73
fix(tools): fail closed when ECC design load is invalid
Emin017 Aug 31, 2026
a2fc89b
fix(tools): drop stale Sizer staging and partial outputs
Emin017 Aug 31, 2026
e8d4078
fix(tools): fail closed on Sizer cleanup and reset subflow
Emin017 Aug 31, 2026
2b68a6b
fix(tools): map Timing Opt configs and split sizer tests
Emin017 Aug 31, 2026
9904e7c
refactor(tools): keep create_db_engine on step input
Emin017 Sep 1, 2026
8bbdc3f
fix(tools): invalidate legacy Timing Opt success on subflow rewrite
Emin017 Sep 1, 2026
b994d3d
feat(flow): run Timing Opt after post-CTS legalization
Emin017 Sep 1, 2026
93b6a2a
ci: install Sizer from ecc-sizer CI artifacts
Emin017 Sep 1, 2026
9a3e44c
fix(tools): keep Sizer errors in the Timing Opt step log
Emin017 Sep 1, 2026
2fd2327
feat(tools): emit Timing Opt QoR from the legalized DB
Emin017 Sep 1, 2026
edccecb
feat: add asynchronous candidate rerun operations
YihangQiu Aug 22, 2026
afa871c
feat: default runtime workspaces to harden flow
YihangQiu Aug 22, 2026
d29c664
fix: align agent reruns with harden flow
YihangQiu Aug 22, 2026
5508a54
fix: protect stdio rpc from background output
YihangQiu Aug 22, 2026
d7d4b78
feat: preserve candidate config snapshots
YihangQiu Aug 22, 2026
1ba2aa2
fix: isolate candidate rerun workspaces
YihangQiu Aug 22, 2026
4b66905
fix: inherit incumbent candidate workspace
YihangQiu Aug 24, 2026
c058cd5
fix: support floorplan candidate reruns
YihangQiu Aug 26, 2026
a367115
feat: add native parameter application receipt producer
YihangQiu Aug 27, 2026
26cc8e1
feat: return native parameter receipt from candidate rerun
YihangQiu Aug 27, 2026
60a9438
feat: record native placement parameter runtime report
YihangQiu Aug 27, 2026
53349e8
fix: bind native receipts to reviewed tool identities
YihangQiu Aug 27, 2026
03ecac4
feat: record floorplan parameter runtime evidence
YihangQiu Aug 27, 2026
c6e09e9
feat: persist candidate parameter evidence artifacts
YihangQiu Aug 27, 2026
938c11f
feat: bind candidate manifest execution context
YihangQiu Aug 27, 2026
0ede388
feat: record floorplan geometry evidence
YihangQiu Aug 27, 2026
66f1b9f
fix: gate DreamPlace parameter activation on engine success
YihangQiu Aug 27, 2026
09b900b
test: cover DreamPlace activation failure state
YihangQiu Aug 27, 2026
20adff6
fix: require native runtime activation evidence
YihangQiu Aug 27, 2026
632d6b4
fix: preserve surface value for padding receipts
YihangQiu Aug 27, 2026
61d7591
fix: align fanout receipt units
YihangQiu Aug 27, 2026
cd01b67
fix: align runtime parameter units
YihangQiu Aug 27, 2026
b5928e0
test: cover density weight runtime unit
YihangQiu Aug 27, 2026
441ec60
fix: reject no-op candidate materialization
YihangQiu Aug 27, 2026
eb64372
fix: bind native candidate state and parameters
YihangQiu Aug 27, 2026
cad82fb
fix: preserve materialized candidate receipts
YihangQiu Aug 27, 2026
5e1ef39
fix: preserve candidate materialization snapshots
YihangQiu Aug 27, 2026
b829227
fix: materialize candidate before step workspaces
YihangQiu Aug 27, 2026
4e0d1de
fix: require native parameter runtime evidence
YihangQiu Aug 27, 2026
c209e50
fix: materialize candidates before step setup
YihangQiu Aug 27, 2026
cc45020
fix: preserve candidate configs during step setup
YihangQiu Aug 27, 2026
4a43be7
fix: strengthen dreamplace runtime evidence
YihangQiu Aug 28, 2026
b6057e1
fix: bind candidate materialization evidence
YihangQiu Aug 28, 2026
2d0bbc7
fix: complete native parameter runtime evidence
YihangQiu Aug 28, 2026
4d61381
chore: ignore generated checklist output
YihangQiu Aug 29, 2026
e56f0fa
fix: strengthen parameter evidence binding
YihangQiu Aug 29, 2026
86e0845
fix: enforce parameter execution evidence
YihangQiu Aug 29, 2026
851bee5
fix: resume materialized candidates from failed step
YihangQiu Sep 2, 2026
f95a39d
fix: report cell padding in dbu
YihangQiu Sep 2, 2026
61296f5
revert: defer cell padding evidence hash update
YihangQiu Sep 2, 2026
5eca311
fix: align flow agent with cts fanout
YihangQiu Sep 2, 2026
4760585
test: remove retired fanout fixture
YihangQiu Sep 2, 2026
7fe0e07
chore: merge timing opt updates into flow agent
YihangQiu Sep 2, 2026
def1945
fix: resolve Sizer from runtime root
YihangQiu Sep 2, 2026
68ec999
fix: isolate Sizer loader environment
YihangQiu Sep 2, 2026
2933742
fix: fingerprint runtime workspace inputs
YihangQiu Sep 3, 2026
e9d029c
fix: bind candidate receipts to parameter cards
YihangQiu Sep 3, 2026
c04e641
chore: merge main into flow agent v2
YihangQiu Sep 3, 2026
de792e9
chore: merge latest main into flow agent v2
YihangQiu Sep 3, 2026
03e5594
fix: bind candidate snapshots to persisted configs
YihangQiu Sep 3, 2026
217997c
refactor: isolate ECC parameter runtime reports
YihangQiu Sep 4, 2026
7d5fc85
refactor: isolate DreamPlace runtime reporting
YihangQiu Sep 4, 2026
4f293cb
feat: observe parameter runtime from agent
YihangQiu Sep 4, 2026
1c46c55
refactor: isolate agent runtime behavior
YihangQiu Sep 5, 2026
4384f35
fix: preserve candidate result when evidence is missing
YihangQiu Sep 5, 2026
f95253b
chore: merge latest main into flow agent v2
YihangQiu Sep 5, 2026
0ad60b3
refactor: isolate agent RPC entrypoint
YihangQiu Sep 5, 2026
020af49
perf: share packaged ECC executable
YihangQiu Sep 5, 2026
3adb5d0
fix: route agent full flows through agent engine
YihangQiu Sep 5, 2026
a2c6790
perf: reduce agent candidate rerun overhead
YihangQiu Sep 5, 2026
5a48fcf
perf: preflight agent sizer candidates
YihangQiu Sep 6, 2026
254d74c
fix: skip lec for agent candidate inputs
YihangQiu Sep 6, 2026
4feb984
fix: bind agent receipts to loaded pdk
YihangQiu Sep 6, 2026
5cf42f8
perf: skip agent display plots in headless runs
YihangQiu Sep 6, 2026
5a52d21
fix: preflight agent runtimes before candidate execution
YihangQiu Sep 6, 2026
b532d75
perf: parallelize controlled candidate STA corners
YihangQiu Sep 7, 2026
a4b3d02
feat: add isolated floorplan mode switching
YihangQiu Sep 7, 2026
f3d88b0
refactor: simplify seven-knob runtime parameter status
YihangQiu Sep 7, 2026
fa13d64
fix: delete experimental docs
YihangQiu Sep 8, 2026
5b7a25e
chore: merge latest main into flow agent v2
YihangQiu Sep 8, 2026
c0fab41
docs: explain ecc agent rpc entrypoint
YihangQiu Sep 8, 2026
54d0536
feat: give isolated candidates their own concurrent execution lifecycle
YihangQiu Sep 8, 2026
9f8e999
Merge remote-tracking branch 'origin/main' into yhqiu/flow-agent-v2
YihangQiu Sep 9, 2026
111d215
fix: adopt the canonical rtl2gds flow after the main sync
YihangQiu Sep 9, 2026
b7d36aa
feat: run candidate step execution in an isolated worker process
YihangQiu Sep 9, 2026
51ebeec
fix: report target_density effective once the density operator consum…
YihangQiu Sep 9, 2026
a59b2b6
fix: keep public wire names in lec normalize for equiv_make cut-points
YihangQiu Sep 10, 2026
9467b6f
Merge remote-tracking branch 'origin/main' into yhqiu/flow-agent-v2
YihangQiu Sep 11, 2026
3a0c96c
fix: address review feedback in receipt context and test import
Copilot Sep 9, 2026
6b5f295
Merge remote-tracking branch 'origin/yhqiu/flow-agent-v2' into yhqiu/…
YihangQiu Sep 11, 2026
1361af2
feat: enable full-corner parallel STA for every workspace sta step
YihangQiu Sep 13, 2026
5ec5608
chore: fast-forward tool submodules to pair with upstream macro place…
YihangQiu Sep 15, 2026
a4ac15e
Merge branch 'main' of openecos-projects/ecc into yhqiu/flow-agent-v2
YihangQiu Sep 15, 2026
ccdd83b
fix: align candidate rerun bindings with the split floorplan topology
YihangQiu Sep 15, 2026
5c685c2
fix: make Floorplan candidate overrides effective in die_util mode
YihangQiu Sep 15, 2026
2e82cd5
Merge remote-tracking branch 'origin/main' into yhqiu/flow-agent-v2
YihangQiu Sep 16, 2026
5d4cad7
docs: add agent runtime README
YihangQiu Sep 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/build-pyinstaller-bundle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ runs:
"$SMOKE_DIR/ecc" --help
"$SMOKE_DIR/ecc" --version
"$SMOKE_DIR/ecc" version --json
test -x "$SMOKE_DIR/ecc-agent-rpc"
test "$SMOKE_DIR/ecc" -ef "$SMOKE_DIR/ecc-agent-rpc"
payload='{"jsonrpc":"2.0","method":"rpc.hello","id":1,"params":{"version":1}}'
response="$(printf 'Content-Length: %s\r\n\r\n%s' "${#payload}" "$payload" | "$SMOKE_DIR/ecc-agent-rpc")"
grep -q 'candidate.rerun' <<<"$response"
"$SMOKE_DIR/ecc" doc config --plain > /dev/null
"$SMOKE_DIR/ecc" doc ug --lang cn --plain > /dev/null
test -x "$SMOKE_DIR/_internal/torch/bin/torch_shm_manager"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ result

# Generated from uv.lock, not committed
requirements_lock.txt
/checklist.json

chipcompiler/tools/ecc_dreamplace/dreamplace

Expand Down
63 changes: 63 additions & 0 deletions agent/README.cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# `ecc-agent-rpc` 入口说明

`pyproject.toml` 中的如下声明会在安装 ECC 时生成独立可执行文件:

```toml
scripts.ecc-agent-rpc = "agent.rpc_server:main"
```

它是 ECOS Agent 专用的 ECC JSON-RPC 边车进程入口。桌面端或 Agent
运行时启动该进程,通过标准输入发送请求,并从标准输出读取结果;它不是
供交互式使用的 `ecc` CLI,也不替代通用的 `ecc rpc serve --stdio`。

## `main()` 做什么

入口实现位于 [`rpc_server.py`](rpc_server.py)。`main()` 保持很小,只完成
三个启动职责:

1. 调用 `multiprocessing.freeze_support()`,使打包后的 Windows 进程可以安全
创建子进程;
2. 创建 `AgentRuntimeServer`,在通用 ECC runtime 方法之上注册 Agent 方法;
3. 将二进制 `stdin`/`stdout` 和该 server 交给
`chipcompiler.runtime.stdio_server.run_stdio_server()`。

这样,入口不复制 transport、JSON-RPC 分发或业务执行逻辑。传输层统一处理
请求帧、响应串行写出、`runtime.event` 通知和 `rpc.shutdown`;Agent 行为由
`AgentRuntimeServer`、`FlowAgentRuntimeApi` 及其受控 workspace API 实现。

## 协议与能力

该进程使用带 `Content-Length` 头的 JSON-RPC 2.0 stdio 协议。标准输出只可写入
协议帧,诊断和工具输出应写入标准错误或 workspace 日志,避免破坏客户端解码。

`rpc.hello` 返回的 capabilities 包含通用 runtime 方法,以及 Agent 专用方法:

- `agent.runtime_preflight`:检查 Agent 候选执行所需运行时;
- `workspace.extract_foundation`:提取已完成 workspace 的 foundation 数据;
- `candidate.export_capabilities`、`candidate.bind_input`、
`candidate.materialize`:查询或准备受控候选;
- `candidate.rerun`、`candidate.resume`:启动或恢复受控候选执行。

方法名、请求模型和处理函数的权威定义在 [`methods.py`](methods.py)。入口收到
请求后会将 camelCase 字段归一化为请求模型字段;无效字段或重复字段返回
`invalid_request`,不会转化为任意命令执行。

## 运行边界

`ecc-agent-rpc` 仅暴露已注册的 typed RPC 方法。它不接收自然语言计划、不选择
优化参数,也不执行调用方提供的任意 shell 命令。候选操作仍由 Agent runtime 的
参数校验、workspace 边界和执行回执约束。

启动 `AgentRuntimeServer` 时会调用 [`runtime_env.py`](runtime_env.py) 处理可选的
打包 Sizer 运行时路径;这只准备运行环境,不代表一次 physical-design flow 已
执行成功。实际客户端应先使用 `rpc.hello` 协商能力,并保留 operation 事件与
workspace 产物作为执行证据。

## 维护约定

- 新增 Agent RPC 方法时,同时更新 `methods.py` 的 `AGENT_RUNTIME_METHODS`、
请求模型、workspace API 和对应测试;`rpc_server.py` 通常无需修改。
- 修改 stdio framing 或通用 runtime 行为时,应修改 `chipcompiler/runtime/` 并
评估 `ecc rpc serve --stdio` 与 `ecc-agent-rpc` 两个入口。
- 直接调试可运行 `python -m agent.rpc_server`,但输入必须是合法的
`Content-Length` JSON-RPC 帧;普通命令行参数不会被解析为 RPC 请求。
152 changes: 152 additions & 0 deletions agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# ECC Agent Runtime(`agent/`)

`agent/` 是 ECC 的 **Flow Agent 运行时**:在 `chipcompiler` 标准 runtime 之上构建的
受控、可审计的流程代理执行层。它以独立 sidecar 进程(可执行入口
`ecc-agent-rpc`)运行,通过 JSON-RPC 2.0 over stdio 对外提供服务,供
ECOS Studio 的 GUI 前端与 `ecos_agent` 受控优化后端驱动。

它只做确定性的执行与证据记录:**决策不在这里**。`agent/` 不包含任何 LLM
代码,不解析自由文本指令,也不直接执行 shell 命令;流程决策由上层
`ecos_agent`(见 ECOS Studio 仓库)完成,每个动作以显式 schema 的 RPC 方法
抵达本层,经参数校验与允许列表检查后执行,并留下可复核的产物与回执。

## 职责总览

- **Agent 流程适配**:为 Agent 场景定制流程引擎行为(DRC 阶段注入、观察者
事件流、渲染门控、内存监控、无头运行下的绘图抑制)。
- **隔离候选执行**:为参数候选创建隔离 workspace,配置固化(materialize)、
上游输入绑定、独立 worker 进程重跑与断点续跑(resume),产出 hash 绑定的
配置/检查点回执。
- **参数运行时观测**:对五个受控 DREAMPlace 参数与两个受控 Floorplan 参数
进行运行时观测,生成 hash 绑定的参数应用回执,供上层做效果归因。
- **基础数据提取(foundation data)**:从已有 workspace 的 LEF/DEF/STA/DRC/
布线证据中提取带表结构契约的可审计数据表,供离线分析与建模使用。
- **全角 STA 并行**:以隔离的原生进程并行执行全角 STA,并提供调度基准测试。

## 设计原则

1. **受控执行**:每个 RPC 方法都有 frozen dataclass 请求模型与显式校验;
客户端按方法允许列表访问;写入 workspace 的路径一律校验不得越界。
2. **可审计**:候选配置、输入绑定、Floorplan 模式覆盖、参数回执均以
canonical JSON + SHA-256 摘要落盘,配置与检查点回执必须配对一致
(candidate contract),否则拒绝执行。
3. **可复现**:候选 workspace 从父 workspace 克隆,重跑集合、输入绑定与
配置覆盖全部持久化,resume 复用原候选记录且不改变历史语义。
4. **进程隔离**:DREAMPlace 与 sizer 存在进程全局状态(配置单例、原生日志
重定向),同进程并发候选会互相覆写;候选的阶段循环在独立 worker 进程
中执行,全角 STA 同样使用隔离原生进程。
5. **不反向依赖**:`agent/` 依赖 `chipcompiler` 的公开 runtime 接口并继承
扩展,不修改其行为;除观测回执的结构化输入外,不依赖 `ecos_agent`。

## 代码结构

```text
agent/
├── rpc_server.py # 进程入口:stdin/stdout 上启动 stdio JSON-RPC 服务
├── server.py # AgentRuntimeServer:扩展基础 RuntimeServer 与能力协商
├── methods.py # Agent RPC 方法表(RuntimeMethodSpec 声明)
├── requests.py # RPC 请求模型(frozen dataclass + 校验)
├── workspace_api.py # AgentWorkspaceRuntimeApi / FlowAgentRuntimeApi:RPC 处理层
├── engine.py # AgentEngineFlow:流程引擎覆盖(观察者、渲染门控、监控)
├── tools.py # Agent 侧步骤执行适配(固化重放、模式覆盖、STA 分发)
├── plot.py # 无头运行下抑制显示绘图的绘图适配
├── runtime_env.py # sizer 运行时预检与隔离加载环境
├── floorplan_mode.py # 隔离候选的 Floorplan 模式(die_util/die_size)覆盖
├── candidate_clone.py # 候选 workspace 克隆的忽略规则
├── candidate_worker.py # 隔离 worker 进程中执行候选阶段循环
├── candidate_resume.py # 失败候选在原 workspace 上的断点续跑
├── sta_parallel.py # 全角 STA 并行调度(隔离原生进程)
├── sta_benchmark.py # STA 调度基准测试(隔离副本上比较方案)
└── data/ # 候选与观测的数据模型、注册表和落盘产物
├── candidate_registry.py # 受控 knob 与后端需求的静态注册表
├── candidate_capabilities.py # 稳定的候选能力元数据导出
├── candidate_materialization.py # 可重放的配置固化与回执校验
├── candidate_input_binding.py # 受控上游输入绑定(阶段间数据边)
├── candidate_contract.py # 配置/检查点回执的配对一致性检查
├── candidate_artifacts.py # canonical JSON、SHA-256、原子写盘工具
├── parameter_runtime_observer.py # DREAMPlace 五参数运行时观测
├── floorplan_parameter_observer.py # Floorplan 两参数运行时观测
├── parameter_application_receipt.py # hash 绑定的参数应用回执生成
├── observed_callable.py # 保持原属性的观测包装
└── foundation/ # workspace 证据提取子包
├── extractor.py # 提取流水线(profile: iccd_full_v1)
├── schema.py # ExtractionResult
├── parsers/ # LEF/DEF/STA/DRC/布线日志等解析器
├── grid/ # GCell 网格规范化
├── table_contract.py # 数据表结构契约与写出
└── writers.py # JSON/JSONL 写出
```

分层关系:`rpc_server` → `server`(方法分发、错误码映射)→ `methods`/`requests`
(schema)→ `workspace_api`(Agent RPC 处理器)→ `engine`/`tools`/`candidate_*`
(执行基础设施)→ `data/*`(注册表、固化与回执落盘)。

## RPC 方法面

`AgentRuntimeServer` 继承基础 runtime 的全部方法(workspace 生命周期、配置
读写、`flow.run`/`flow.run_step`、operation 状态与取消、快照等,完整清单见
`chipcompiler/runtime/methods.py` 与 `docs/rpc-guide.md`),并在能力协商
(`rpc.hello`)中追加声明以下 Agent 方法:

| 方法 | 作用 |
| --- | --- |
| `agent.runtime_preflight` | Agent 运行时预检(如 sizer 可执行文件) |
| `workspace.extract_foundation` | 从 workspace 证据提取 foundation 数据表 |
| `candidate.export_capabilities` | 导出候选能力元数据(受控 knob、后端需求) |
| `candidate.bind_input` | 绑定候选的上游输入(阶段间检查点) |
| `candidate.materialize` | 将候选参数补丁固化为可重放配置 |
| `candidate.rerun` | 克隆候选 workspace 并在隔离 worker 中重跑目标阶段 |
| `candidate.resume` | 在原候选 workspace 上断点续跑失败的候选 |

传输与分帧协议与基础 runtime 一致(`Content-Length` 分帧的 JSON-RPC 2.0),
详见 `docs/rpc-guide.md`。

## 候选重跑生命周期

一次受控候选评估的典型调用序列:

1. **预检**:`agent.runtime_preflight` 确认运行时可用。
2. **能力导出**:`candidate.export_capabilities` 返回目标阶段允许的受控
knob 集合与后端需求,上层只能在该集合内提参数。
3. **绑定与固化**:`candidate.bind_input` 固定上游输入边;
`candidate.materialize` 将参数补丁写入候选配置并生成回执,二者与
检查点回执通过 candidate contract 校验配对。
4. **隔离重跑**:`candidate.rerun` 克隆父 workspace(按忽略规则裁剪产物),
在独立 worker 进程中按目标阶段重跑,事件经观察者流式回传,结果与
状态摘要落盘。
5. **续跑**:失败的候选可用 `candidate.resume` 在原 workspace 上继续,
保留原候选记录与 Floorplan 模式,不改变历史语义。

Floorplan 模式覆盖(`die_util`/`die_size`)只作用于隔离候选:随请求显式
给出、持久化到候选 workspace 的 `analysis/floorplan_mode.v1.json`,不影响
源 workspace 与普通 ECC 流程。

## 客户端与联合契约

本运行时有两个独立实现的客户端,遵守同一契约:

- **Electron 前端**(GUI 流程执行):
`ecos/gui/apps/desktop-electron/electron/services/eccRpc/`
- **Agent 后端**(受控自动优化):
`ecos/agent/src/ecos_agent/optimization/ecc/rpc_client.py`

传输、超时、错误恢复与可执行文件解析的共同契约见 ECOS Studio 仓库的
`ecos/agent/docs/ecc-agent-rpc.md`;修改本层的 RPC 表面或事件语义时,须
同步该文档与两侧客户端。

## 开发与测试

```bash
# 启动 stdio RPC 服务(等价于 ecc-agent-rpc 入口)
uv run python -m agent.rpc_server

# 运行本目录测试(与 chipcompiler 的 test/ 互相独立)
uv run pytest agent/test

# Lint 与格式
uv run ruff check agent/
uv run ruff format agent/
```

测试按被测模块就近放置于 `agent/test/`;foundation 提取器相关的基线数据
与其表格契约测试同样位于该目录。
36 changes: 36 additions & 0 deletions agent/candidate_clone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import json
from pathlib import Path

from chipcompiler.runtime.workspace_api import RuntimeApiError

_ARTIFACT_DIR_NAMES = frozenset({"output", "data", "feature", "analysis", "report", "log"})


def candidate_clone_ignore(source_root: Path, target_step: str | None):
skipped_step_roots: set[Path] = set()
if target_step is not None:
try:
flow = json.loads((source_root / "home" / "flow.json").read_text(encoding="utf-8"))
except (OSError, ValueError) as exc:
raise RuntimeApiError("command_failed", "candidate flow state is invalid") from exc
if not isinstance(flow, dict) or not isinstance(flow.get("steps"), list):
raise RuntimeApiError("command_failed", "candidate flow state is invalid")
rerun = False
for step in flow.get("steps", []):
if not isinstance(step, dict):
continue
name, tool = step.get("name"), step.get("tool")
rerun = rerun or name == target_step
if rerun and isinstance(name, str) and isinstance(tool, str):
skipped_step_roots.add(source_root / f"{name}_{tool}")
skipped_step_roots.add(source_root / f"{'_'.join(name.split()).lower()}_{tool}")

def ignore(directory, names):
current = Path(directory).resolve()
if current == source_root:
return {".agent"}.intersection(names)
if current in skipped_step_roots:
return _ARTIFACT_DIR_NAMES.intersection(names)
return set()

return ignore
Loading
Loading