Skip to content

fix(measure): preserve reanalysis storage paths on current main - #21

Merged
mingtaojin merged 6 commits into
mainfrom
fix/measure-reanalysis-storage-main-4a40
Nov 20, 2026
Merged

mingtaojin merged 6 commits into
mainfrom
fix/measure-reanalysis-storage-main-4a40

Conversation

@mingtaojin

@mingtaojin mingtaojin commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Why

Historical reanalysis children can write WAV indexes and result files under paths that the host cannot read after the child record is saved. The focused verifier reproduced 17 failures and 5 errors before this fix.

What changed

  • Preserve the source WAV index timing and frame fields when the executor copies child shards.

  • Write child indexes beside the copied WAV shard and keep output registrations relative to the shared storage root.

  • Add path contract coverage for dashboard and flow historical reads, WAV indexes, and multi-shard files.

  • Keep the handoff file removed as required by current main; the historical handoff is not reintroduced.

  • Merge the latest main at 4731cb5.

  • Make desktop native-library fixtures use the current platform and stub Windows in the mocked signing tests.

Verification

Local validation on macOS with Node.js 24.16.0, pnpm 10.6.5, and Java 21.

  • pnpm build:sdk and pnpm typecheck:tests passed.
  • pnpm test:run passed 15,202 frontend tests and 479 desktop tests. The suite skipped 63 frontend tests and 2 desktop tests.
  • mvn -B --no-transfer-progress --fail-at-end -Dskip.crowdin.download=true -f apps/backend/pom.xml test passed 8,785 tests, with 57 skipped, 0 failures, and 0 errors.
  • pnpm check:boundaries and the staged docs policy check passed.

@mingtaojin
mingtaojin requested a review from a team November 15, 2026 16:30

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI 代码审查(claude-opus-5-5)

本次修复方向正确:子执行的 CRYBIN 登记改为相对存储根目录的路径,WAV 分片复制后在旁边写入子执行自己的索引。新增测试覆盖了仪表盘和 Flow 两个历史读取出口、多分片以及损坏索引的拒绝路径。主要问题如下:

  1. 新索引仍写绝对路径:这与本 PR“登记相对存储根目录”的目标不一致。存储根迁移后,新索引会再次失效。
  2. 索引文件名推导逻辑重复:写入端用正则复制了读取端(ProjectDashboardComponent.resolveWavIndexRelativePath)的规则,两处可能逐渐不一致。
  3. 兼容性与校验:读取旧索引时,编码和列数一致性的处理偏严或偏松。

其他意见:

  • MeasureReanalysisOutputs.finish() 返回的 fileUrl 从绝对路径改为相对路径。请确认它的所有调用方(包括执行失败或取消时按 fileUrl 清理文件的逻辑)都已改为基于存储根解析。否则相对路径会按进程工作目录解析,导致清理失效或误操作。diff 中看不到这部分代码,无法确认。
  • 新的契约测试大量通过 ReflectionTestUtils.invokeMethod 调用私有方法(applyRenderDataFile、buildRenderData、resolveWavIndexRelativePath)。这类测试在私有方法改名或改签名时会在运行期才失败,建议后续把被测契约提取为包可见或公开的方法。
  • 缺少以下测试:取消发生在写索引阶段;原索引使用相对路径条目;原索引混用两列和三列。
  • 按 CONTRIBUTING,PR 描述应使用 Refs #<编号> 关联对应缺陷,当前描述中没有。

由 AI 自动生成,仅供参考,不作为合并依据。审查提交:eb953fb。维护者可评论 /review 重新审查。

JohnWuY pushed a commit that referenced this pull request Nov 19, 2026
## Why

Bring PR22 in line with the current `main` baseline and remove
deterministic Windows and frontend CI failures. This PR is broader than
the earlier `ChannelCursor` and FileSelect-only description. It includes
the baseline repairs already present on the branch and the runtime
changes they require.

## Current refs

- Base: `main@b50ac07`
- Head: `fix/main-ci-baseline-20261116@a9f30cf`

## Backend runtime changes

- `ChannelCursor` closes the first shard reader when constructor-time
validation or loading fails.
- `GraphicConfigService` validates retained provider members,
initializes axes when planning the first member, and opens unit-query
scopes for standalone projections. Monitor Math saves and unit refreshes
preserve independent binding rows.
- Monitor can replay audio-only recordings that lack the optional CAN
input service.
- `ProjectService` accepts omitted legacy result-limit lists during
import.
- `ReferenceTestProjectionContextResolver` and
`ReferenceTestExecutionPlanner` use active BK CPB shared-input
declarations and ignore dormant legacy snapshots.
- `BuiltInFftSignalAnalysisProvider` and
`BuiltInOctaveSignalAnalysisProvider` handle BK FRF and reference-test
result paths, including the single-channel cross-spectrum case. Mixed BK
FFT requests use shared calibrated inputs for ordinary results and the
stored unit plan for reference/test results.
- `DefaultBoxExecutionSession` avoids duplicate default unit metadata
when the prepared unit already matches the result unit.
- `FrozenHistoricalArtifactFactResolver` restores time-window identity
from frozen configuration when the persisted identity is incomplete.

## Frontend runtime changes

- `use-grpc-exec.ts` distinguishes the single-value time-history case by
the available value count before adding stamped points.
- `tr-TR.ts` applies the Turkish measurement supplement after the
English base messages so supplied Turkish strings take effect.

These are product behavior changes, not test-only changes. The locale
merge remains a shallow merge and requires the supplement namespaces to
be complete.

## CI and test changes

- Server test dependencies use Mockito 5.24.0 to fix handler lookup when
inline and subclass mocks share a test process.
- The Monitor HTTP and SQLite mutation suite runs in Maven Failsafe and
loads the built-in plugin from the packaged artifact. Monitor fixtures
preserve CAN catalog entries and supply the Math planner where the host
prepares and reads results.
- A SQLite regression test verifies that a failed project transaction
refreshes only device-confirmed channel changes.

- The frontend CI license variables are scoped to the unit-test step.
- Backend CI skips the external Crowdin download because the Windows
test runner does not provide the Crowdin CLI or credentials. The Maven
property is quoted for PowerShell so Maven receives the full property
name.
- Backend and frontend fixtures now match the current platform and
service contracts, including Windows paths, `file:` URIs, HDF5 reopen
behavior, schema fixtures, plugin failure isolation, reference-result
units, report navigation, numeric input event ordering, and locale
expectations.
- The report-navigation and numeric-input tests changed on this branch.
The PR no longer claims that those areas are frozen.
- The Standard Signal Chain test tracker now uses atomic lease
references because two pipeline branches can release the same pooled
array concurrently.
- `ConcurrentFileManager` retains the remove-result ownership rule and
the shutdown drain completes queued tasks exactly once. Existing latch
tests cover the worker-consumed and shutdown-drained races.
- The CAN editor tests wait up to five seconds for asynchronous DBC
parsing and port discovery under the full CI worker load.
- The Windows device protocol test now stubs the platform-native
active-library path.
- The HDF5 export test verifies the Unicode output bytes and reopens an
ASCII inspection copy because the Windows native HDF5 reader cannot
reliably reopen the Unicode path.
- The CAN startup failure test waits for the asynchronous failure stop
and asserts a failed stop rather than an elapsed-time success.
- Server tests resolve SQL, YAML, and migration fixtures from Maven's
module base directory instead of assuming the repository root is the
working directory.
- Tests that require an unavailable real Native license, external
business plugin, or unavailable internal plugin fixture were removed
from the server unit suite. Mocked Native boundary tests remain.

## Verification

- GitHub Actions passed frontend checks, CodeQL, and docs policy for the
previous PR head `e081498`.
- The Windows backend check on that head reported 17 server unit-test
failures. The follow-up changes target the Mockito and Monitor
class-loading causes.
- Java 21 on macOS passed the full Maven `verify` for `a9f30cf`. 8,825
tests passed, including all 55 packaged integration tests. Maven skipped
57 tests.
- GitHub Actions passed both frontend checks and Windows backend tests
for `a9f30cf`. See [CI run
44502956313](https://github.com/crysound/OpenTest/actions/runs/44502956313).
- The AI review workflow for `a9f30cf` returned HTTP 524. The second
attempt was canceled.

## Risk and review notes

This PR changes measurement execution, provider unit declarations,
historical result identity, BK FRF result production, locale merging,
and CI test authorization scope. Review those runtime changes separately
from the fixture-only updates. The branch contains focused regression
tests.

No merge or deployment has been performed.

Refs #21.
@mingtaojin
mingtaojin merged commit 69714f2 into main Nov 20, 2026
10 of 12 checks passed
@mingtaojin
mingtaojin deleted the fix/measure-reanalysis-storage-main-4a40 branch November 20, 2026 03:34
@mingtaojin mingtaojin linked an issue Nov 20, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[需求] 增加已采集信号修改参数重新分析功能

3 participants