Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4fa88b6
feat(run): add offline signal processing pipelines
Scaxlibur Sep 4, 2026
6cd7471
docs(run): document signal processing pipelines
Scaxlibur Sep 4, 2026
889ebf3
docs: allow signal processing cutoff terminology
Scaxlibur Sep 4, 2026
584b87b
feat(run): add FIR pipeline filters
Scaxlibur Sep 4, 2026
9be5d18
docs(run): document FIR pipeline filters
Scaxlibur Sep 4, 2026
35a6613
feat(run): add SOS IIR pipeline filters
Scaxlibur Sep 5, 2026
49e320e
feat(run): add explicit Welch PSD pipelines
Scaxlibur Sep 5, 2026
6844a33
feat(analysis): run standalone recipes on historical captures
Scaxlibur Sep 5, 2026
2671c99
feat(report): plot and compare persisted signal analysis exports
Scaxlibur Sep 5, 2026
9da5511
fix(report): protect capture directories with damaged manifests
Scaxlibur Sep 5, 2026
c317913
feat(analysis): measure named PSD bands with expectations
Scaxlibur Sep 5, 2026
be5654c
feat(analysis): detect named peaks and render peak tables
Scaxlibur Sep 5, 2026
ff8a11d
feat(analysis): add explicit moving average and Savitzky-Golay smoothing
Scaxlibur Sep 5, 2026
25b1ea9
feat(analysis): resample with explicit polyphase FIR and updated time…
Scaxlibur Sep 5, 2026
7aee2ca
docs(plans): showcase the complete signal processing pipeline
Scaxlibur Sep 5, 2026
5baf27f
docs: clarify workflow authorization and validation scope
Scaxlibur Sep 8, 2026
aa4cb15
feat(analysis): add resource budgets and bounded file I/O
Scaxlibur Sep 8, 2026
83a5fcb
docs(analysis): document resource limits and execution profiles
Scaxlibur Sep 8, 2026
945590b
perf(analysis): stream Welch mean and causal filter stages
Scaxlibur Sep 8, 2026
0bd7604
feat(analysis): supervise offline workers with platform memory limits
Scaxlibur Sep 8, 2026
de745d8
docs(analysis): describe supervised execution and platform validation
Scaxlibur Sep 8, 2026
71e4cec
feat(analysis): add spectral quality, resumable batches and evidence-…
Scaxlibur Sep 8, 2026
9c9554d
docs(analysis): document advanced measurements and synthetic pair exa…
Scaxlibur Sep 8, 2026
625658d
feat(scope): support driver-proven synchronized pair capture
Scaxlibur Sep 8, 2026
7cd0a61
docs(scope): describe real synchronized capture and restoration limits
Scaxlibur Sep 8, 2026
411898b
docs(analysis): summarize completed scope and pending validation
Scaxlibur Sep 8, 2026
e0e0728
docs(analysis): document pipeline usage and keep status internal
Scaxlibur Sep 8, 2026
3488c97
fix(source): declare and verify snapshot-based restoration
Scaxlibur Sep 8, 2026
387c9fc
fix(analysis): preserve Windows file identity and lock compatibility
Scaxlibur Sep 8, 2026
faee8dc
test: wait for asynchronous completion on Windows CI
Scaxlibur Sep 8, 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
11 changes: 9 additions & 2 deletions .agents/skills/wavebench-docs/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ operation under the `wavebench` safety workflow.
## Start from repository facts

1. Work from the Git repository root and inspect `git status --short --branch`.
2. Read `README.md`, `pyproject.toml`, `CHANGELOG.md`, the relevant documentation
indexes, and the pages directly in scope.
2. Read the pages directly in scope and their navigation entries. Use `README.md`
to orient a first visit; read `pyproject.toml` or `CHANGELOG.md` only when the
task depends on package or release facts.
3. Resolve changing claims from implementation, executable help/schema, tests,
descriptors, and release tags. Existing prose is evidence to audit, not proof
of current behavior.
Expand All @@ -53,6 +54,12 @@ lifecycle, or user journeys. This is the single normative source for those rules

## Choose one mode

A request to explain, diagnose, audit, or review does not by itself authorize
edits. When the user also requests implementation, finish the authorized edits
and relevant checks after any stated prerequisite is satisfied. Mode selection
is a workflow choice, not an extra approval step. Ask only for material missing
information or work outside the existing authorization.

| Mode | Use when | Load |
| --- | --- | --- |
| `audit` | Assess a documentation set without broad edits | [audit.md](references/audit.md) |
Expand Down
32 changes: 20 additions & 12 deletions .agents/skills/wavebench/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ description: >-
Safely diagnose, configure, test, and extend the WaveBench Python measurement
bench. Use for WaveBench CLI, run plans, capture packages, reports, TUI,
instrument discovery, oscilloscope capture, signal-generator control,
programmable-power-supply or digital-multimeter measurements, and WaveBench
instrument plugins. Do not use for general electronics theory or unrelated
VISA/SCPI projects.
programmable-power-supply or digital-multimeter measurements, Core development,
and runtime plugin management. Production development in the plugin monorepo
uses wavebench-plugin-development; add this skill for Core changes or live
operations. Do not use for documentation-led work, general electronics theory,
or unrelated VISA/SCPI projects.
license: MIT
compatibility: >-
Codex or a compatible Agent Skills host; Python 3.11+; Linux, WSL, and
Expand All @@ -26,16 +28,21 @@ metadata:

在不意外改变真实硬件的前提下,完成 WaveBench 的诊断、配置、测量、测试和扩展。优先使用能证明结果的最小操作,先做离线或只读检查,为每次实时写入保留可复核证据。

## Start every task
## Start within the requested scope

1. 用 `git rev-parse --show-toplevel` 定位仓库根目录,并从根目录工作。
2. 先读取 `README.md`、`pyproject.toml` 和与任务直接相关的 `docs/project/` 文档。
2. 初次进入项目时用 `README.md` 定位入口;涉及依赖或版本时读取 `pyproject.toml`,
其余只读取当前任务的实现、契约和相关文档,不预加载全部项目说明。
当前 CLI 事实源依次为实现、`--help`、`run schema`、`run template --list` 和
`wavebench.example.toml`;技能正文与旧记忆不能覆盖这些事实源。
3. 执行 `git status --short --branch`,保留无关用户改动;禁止 reset、强制覆盖或隐式清理。
4. 将任务归类为离线说明/评审、离线代码或配置、实时只读诊断、受控写入或采集。
5. 在安装依赖、编辑配置或连接硬件前,说明计划、影响范围、预期结果和恢复边界。

解释、诊断和评审默认只读,不自动修复。明确要求实施时,完成已授权修改和相关验证;
说明计划不是重复确认节点。复合请求按已授权阶段继续,只在关键信息缺失或下一步越界时询问。
已有实时授权仍需核实当前接线、资源和状态,不能用过去的实验状态代替写前检查。

## Risk classes

| 类别 | 典型操作 | 默认处理 |
Expand All @@ -48,7 +55,7 @@ metadata:

## Non-negotiable safety gates

进行任何 setter、输出切换、采集、扫频或验收脚本前:
实际连接仪器执行 setter、输出切换、采集、扫频或验收脚本前(离线 fake 测试不适用)

1. 确认明确的实时写入授权、当前接线和目标资源。
2. 查询并记录 IDN、相关初始状态、输出状态、保护设置和耦合/负载上下文。
Expand Down Expand Up @@ -97,7 +104,7 @@ Reference 只从本入口直接链接,保持一层目录;详细命令和型

## Discover actual capabilities

不要仅凭型号或 README 推断能力。先确认已启用的驱动、来源、版本和 capability:
当任务依赖当前安装或硬件能力时,不要仅凭型号或 README 推断能力;按需确认已启用的驱动、来源、版本和 capability。纯文档或数值代码修改不需要加载插件

```bash
.venv/bin/wavebench plugin list --load
Expand All @@ -111,25 +118,26 @@ Reference 只从本入口直接链接,保持一层目录;详细命令和型

## Standard workflows

离线或只读预检优先使用
按阶段选择预检,不把以下命令作为每个任务的固定清单

```bash
.venv/bin/python -m pip check
.venv/bin/wavebench run check --plan plans/<plan>.toml --config wavebench.toml
.venv/bin/wavebench run verify --plan plans/<plan>.toml --config wavebench.toml
```

真实计划必须遵循 `run check → run verify → run plan → run report`,并同时检查步骤状态、质量门、期望指标、产物和最终设备状态。TUI 界面开发使用 `tui --fake`。
`pip check` 用于依赖变化或环境诊断;`run check` 是离线检查;`run verify` 会连接仪器,只有已授权实时预检时执行。
已授权执行的真实计划遵循 `run check → run verify → run plan → run report`,并同时检查步骤状态、质量门、期望指标、产物和最终设备状态。仅检查计划的请求到离线检查结果即完成。TUI 界面开发使用 `tui --fake`。

## External research

只有用户明确要求厂商资料、标准或最新外部信息时才联网检索。优先官方文档,记录来源和日期,不发送本地配置、序列号、网络地址或实验数据。`tavily_hikari` 等搜索 MCP 为可选能力;不可用时说明限制并使用仓库事实源或已能访问的官方页面,不伪造工具调用。
仓库实现问题优先使用本地事实源。用户要求外部资料,或关键结论需要核实厂商资料、标准或时效信息时,按宿主联网规则检索;遵守用户明确的离线限制,无法核实时说明缺口。优先官方文档,记录来源和日期,不发送本地配置、序列号、网络地址或实验数据。`tavily_hikari` 等搜索 MCP 为可选能力;不可用时说明限制并使用仓库事实源或已能访问的官方页面,不伪造工具调用。

## Code, docs, and handoff

代码改动遵循外科手术式修改:先读实现、契约和聚焦测试,再改最小范围并补测试。公开中文 Markdown 使用项目文档规范,保留代码字面量、路径、URL 和配置键的原样格式。

验证强度按风险匹配:
验证强度按风险匹配,以下是候选命令,不要求每轮全部执行;具体条件见 `development-validation.md`

```bash
.venv/bin/python -m pytest -q tests/<focused-test>.py
Expand All @@ -138,4 +146,4 @@ Reference 只从本入口直接链接,保持一层目录;详细命令和型
git diff --check
```

交接先给结论,再列检查结果、产物路径、最终状态、未恢复设置、剩余能力缺口,以及是否改动跟踪文件、本地配置、虚拟环境或真实仪器。不得用笼统成功描述掩盖跳过、失败、部分产物或恢复错误。
交接先给结论,再列与任务相关的检查结果和限制;产物路径、最终设备状态、未恢复设置只在实际涉及时报告。不得用笼统成功描述掩盖跳过、失败、部分产物或恢复错误。
14 changes: 9 additions & 5 deletions .agents/skills/wavebench/references/development-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
2. 只修改满足需求的最小范围,避免顺手重构。
3. 为行为变化补充聚焦测试;保持公开 CLI、TUI、报告和发行文案的既有语言约定。
4. 不把本地配置、真实资源、私有协作路径或内部交接规则写入公开文件。
5. 不自动推送、打标签、发布版本或覆盖 `wavebench.toml`。
5. 推送、打标签、发布版本和覆盖 `wavebench.toml` 须有对应授权,不能从代码修改或测试通过推定

## 验证分层

Expand All @@ -25,7 +25,11 @@
git diff --check
```

涉及 run plan 时增加 `run check`;涉及插件时增加包检查、安装 dry-run、插件自身测试和 `plugin doctor --load`;涉及真实仪器时必须增加有边界的验收产物和写后状态回读。
- 局部行为修改先运行聚焦测试和相关静态检查;跨模块、公共安全合同或合并评估再运行全量测试。
- 仅修改文档或 Skill 时运行相关文案、链接或 Skill 校验,不自动运行全量 Python 测试;CI 仍执行仓库既有门禁。
- 修改 plan 示例或校验语义时增加离线 `run check`;仅解释 plan 不自动执行实时步骤。
- 插件 metadata、打包、安装或发现行为改变时,按受影响合同选择包检查、安装 dry-run 和加载检查;插件生产开发以插件仓 Skill 为主,不能因为涉及插件一词就安装或加载第三方代码。
- 实际涉及真实仪器写入时,必须保留有边界的验收产物和写后状态回读;fake 测试不需要实机验收。

技能维护增加:

Expand All @@ -48,12 +52,12 @@ git diff --check

```bash
python "${CODEX_HOME:-$HOME/.codex}/skills/tech-doc-style-chinese/scripts/lint_copy_rules.py" \
.agents/skills/wavebench
--term-allowlist docs/tech-doc-term-allowlist.json <changed-markdown-paths>
```

## 交接格式

先给结论,再列
先给结论,以下字段只报告与本次任务相关的项目;实际接触硬件时不得省略最终状态和未恢复项

- 检查或改动的范围;
- 精确的验证命令和结果;
Expand All @@ -67,4 +71,4 @@ python "${CODEX_HOME:-$HOME/.codex}/skills/tech-doc-style-chinese/scripts/lint_c

## 外部资料

只有用户明确要求最新厂商资料、标准或外部建议时才使用网络搜索。优先官方来源,记录 URL 和访问日期;不发送本地配置、设备序列号、资源地址或实验数据。搜索 MCP 不可用时说明降级路径,不伪造工具结果
外部检索的适用条件与隐私边界以 Skill 入口的 `External research` 为准,不在开发流程增加另一套联网门槛
8 changes: 8 additions & 0 deletions .agents/skills/wavebench/references/eval-prompts.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@

## 评估方法

维护授权与验证规则时增加以下案例:

- 「只解释这份 plan 的问题」:完成离线诊断,不自动改文件、不执行 `run verify` 或 `run plan`。
- 「检查并修复 run plan 校验问题」:完成已授权修复和相关测试,不停在计划或 findings,不自行发布。
- 「只修改 Skill 的一句验证说明」:做 Skill 与相关文案检查,不加载插件、不运行全量业务测试。
- 「修复插件仓某个 driver parser」:以插件仓生产开发 Skill 为主;没有 Core 改动或实时操作时不叠加本 Skill 的完整工作流。
- 「执行已确认接线和限值的采集任务」:沿用有效授权并核实当前状态;只有关键条件缺失或变化才询问,不把新一轮对话当作授权失效。

使用全新上下文逐条提交提示词,观察:

1. 是否仅加载入口和必要 reference;
Expand Down
9 changes: 2 additions & 7 deletions docs/development/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@ WaveBench 的代码、文档、schema 和测试在同一仓库中维护。提交
2. 对硬件相关改动先确认 access policy、capability、恢复边界和测试策略。
3. 不在普通测试或文档验证中连接真实仪器、修改 `wavebench.toml` 或提交实验数据。

## 提交前
## 提交与合并前

```bash
python -m ruff check .
python -m pytest -q
python .agents/skills/wavebench-docs/scripts/audit_docs.py --quiet-warnings
git diff --check
```
按[测试说明](testing.md)选择检查:局部修改先做聚焦验证,文档或 Skill 修改检查相关内容,跨模块或合并评估执行集成检查。远端 CI 仍按仓库 workflow 执行,不要求每个编辑步骤重跑全量测试。

新增或修改用户可见行为时,更新唯一 canonical Reference,并用[文档工作流](documentation.md)进行 scoped review。插件专用流程见[插件开发](plugin-development.md)。
2 changes: 2 additions & 0 deletions docs/development/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ WaveBench 文档采用 docs-as-code:文档和代码一起版本控制、review

中文页面在结构、事实和边界确定后,再应用 `tech-doc-style-chinese`。该写作层不负责决定页面类别或信息架构。

WaveBench 的受控术语豁免记录在 `docs/tech-doc-term-allowlist.json`。运行文案检查器时必须通过 `--term-allowlist docs/tech-doc-term-allowlist.json` 显式传入;检查器不会自动发现该文件。每个条目使用完整字面术语作为键,并附非空理由,不接受正则表达式或无理由豁免。

## 机械检查

```bash
Expand Down
30 changes: 30 additions & 0 deletions docs/development/plugin-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,36 @@ descriptor 导入不得进行仪器 I/O、端口扫描、文件写入或全局
4. 每新增一个写 capability,都补充前置条件、写后 readback、失败语义和离线测试。
5. 构建 wheel,执行包检查、临时 venv 安装/加载/卸载验证,再单独申请实机验收。

## 声明基础源恢复接口

自 Core `0.8.27` 起,source 插件可通过 `InstrumentDescriptor.source_restore` 声明 `wavebench.instruments.source_restore.SourceRestoreProfile`。这是独立于 Source V2 波形配置接口的可选合同,不自动替代其它 V2 写入路径。

| 字段 | 约束 |
| --- | --- |
| `supported` | 严格布尔值;是否实现下述基础恢复方法 |
| `operations` | 唯一的 source capability 名称元组,列出能够恢复基础状态的操作;必须已在 descriptor 声明 |
| `fields` | 唯一的 `SourceStatus` 字段名元组;支持时至少包含 output、function、frequency_hz、amplitude、amplitude_unit、square_duty_cycle_percent |
| `excluded_fields` | 未覆盖的状态名称元组,例如 arbitrary_payload;不得与 fields 重叠 |

`supported=True` 必须同时声明 `source.restore_state` capability,并实现公开 Protocol `SourceBasicRestoreDriver` 的两个方法:

```python
def snapshot_basic_state(self, channel: int) -> SourceStatus: ...
def restore_basic_state(self, snapshot: SourceStatus) -> SourceStatus: ...
```

`snapshot_basic_state` 只读取状态,必须在返回前证明该快照可由当前驱动恢复;未知函数、不可读单位、未支持模式或非有限数值应抛出错误。Core 在执行任何实验步骤前收集全部快照,并保存 driver ID 与仪器身份。驱动不得返回 USER/任意波选择后便假定原内容仍可恢复。

`restore_basic_state` 使用传入的原快照,不通过普通 setter 重新要求当前状态可作为基线。驱动须校验目标、身份及会话状态,先关闭输出,逐项恢复并回读覆盖字段;只有参数验证完成后才能按目标恢复输出 ON。返回值必须是实际回读的 `SourceStatus`,Core 还会按声明字段比较;浮点容差为 `rtol=1e-6, atol=1e-6`。数值匹配不替代驱动侧对错误队列及物理模式的检查。

安全门可把恢复目标的 output 改为 OFF,原始快照继续保留。失败必须抛出错误并保留不确定性,禁止盲目重放、在损坏会话继续写入或把 OFF 当作全部恢复成功。未覆盖状态列入产物与报告。`source.restore_snapshot` 和 `source.restore_state` 两个 Core operation 分别使用 stateful_read 与 write 访问策略;后者需要写权限。

明确不支持时设置 `supported=False`,operations/fields 必须为空,不能声明恢复 capability。此时 RunPlan 请求基础恢复会在写入前拒绝。未提供 profile 的旧插件保持原基础恢复路径,但 `source.arb_load` 与基础恢复组合必须有显式支持声明。没有恢复要求的操作可以执行,产物仍记录未覆盖范围。

Core 内置 DG 回退驱动也提供该接口;内置版本随 Core 发布,外置 DG distribution 独立版本。两侧基础恢复逻辑同步时须保留 Core 现有的 NO_REPLAY 和结构化会话错误处理,不能以复制整个厂商文件覆盖这些约束。

采用新接口的插件可将依赖和 `wavebench_min_version` 提升到 `0.8.27`;若需兼容旧 Core,须在公共模块不可用时同时省略新 profile 字段和 capability,保留旧表面,不能只保留方法声明。声明会进入 execution intent 的恢复合同摘要;能力变化后须重新生成 intent。未声明插件不增加这些字段,保持旧摘要。插件作者应覆盖初态拒绝、不同当前波形、ON/OFF 顺序、读回不符、写入不确定、锁停和 Core Service 集成测试;不能以离线通过宣称新入口已经实机验收。

## 验证

```bash
Expand Down
8 changes: 8 additions & 0 deletions docs/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ WaveBench 的默认验证必须离线、可重复且不依赖真实仪器。driv

## 本地检查

按改动影响选择验证集合:

- 局部行为修改:先运行 `python -m pytest -q tests/<focused-test>.py`、相关 Ruff 检查和 `git diff --check`。
- 文档或 Skill 修改:检查变更页面、直接导航、文案与 Skill 格式;不自动运行全量 Python 测试。涉及生成来源或文档工具时增加生成漂移与对应工具测试。
- 跨模块行为、公共安全合同或合并评估:运行下列集成检查;涉及文档站点的变更再做生成 Reference 检查和 `mkdocs build --strict`。

```bash
python -m ruff check .
python -m pytest -q
Expand All @@ -12,3 +18,5 @@ git diff --check
```

修改 CLI、run schema、配置、artifact、capability、安全语义或插件 API 时,补充对应的聚焦测试,并在文档 review 中核对 canonical Reference。不要用成功的实机记录替代可重复的离线测试。

`.github/workflows/ci.yml` 和 `docs.yml` 定义远端合并检查;本地单个平台通过不能替代 Python/操作系统矩阵。已通过的检查只在新改动、失败或未解决风险需要时重跑,不能把 CI 清单当作每轮编辑的固定流程。
Loading
Loading