Repository navigation
feat(can): integrate device signals, raw diagnostics and recorder history - #34
Conversation
There was a problem hiding this comment.
AI 代码审查(claude-opus-5-5)
整体来看,本 PR 把 CAN 接收、工程信号、原始帧录制和 Recorder 历史一并接入宿主。核心数据结构(MeasurementResultFileMetadata.Source、CanRecordingSectionDto)的约束比较严密,新增的单元测试也覆盖了不规则 X 轴和单位冻结等边界。主要问题集中在 HTTP 接口:设备 CAN 控制接口和原始录制接口缺少本地权限注解,与同 PR 中工程通道接口的做法不一致。此外,默认语言资源和多语言回退也有问题。
不能定位到具体行的意见:
- ADR 编号重复:描述中新增的
docs/adr/0046-host-owned-shared-can-reception*.md与已有的0046-calibration-module-is-a-default-business-plugin.md编号相同。CONTEXT.md 允许保留历史上的重复编号,但新增 ADR 应使用下一个可用编号,避免今后的引用产生歧义。 ChannelSourceEnum.CAN = 2的影响面:存量代码中有用!isMath(source)推断“物理通道”的写法。这类分支现在会把 CAN 通道当作物理通道处理。本次未提供相关文件(如BoxChannelService、InputSamplingSnapshotService),无法逐一确认,建议全局检索isMath(和channelSource的判断点,统一改为isPhysical/isCan。ErrorCode.CAN_RECORDER_UNAVAILABLE的文案:文案为“CAN 录制与历史功能暂不可用”,但本 PR 已实现 CAN Recorder 历史。请确认该错误码仅用于 JNI 缺少finishAndDrainCanSignalSubscriptionV1等降级场景,并按实际场景调整文案,否则用户会看到与功能相矛盾的提示。- 对外部组件的依赖:
finishAndDrainCanSignalSubscriptionV1依赖配套的 JNI PR(OpenTest-NativeDriver#2)。本 PR 不包含更新后的预编译二进制。请在合并顺序或发布说明中明确:在旧版 JNI 下,Recorder 收尾路径必须可控地降级,不能让UnsatisfiedLinkError逃逸。 - 验收状态:描述显示验收为 64/76 条、7/9 个工作包,强制断链(transport-loss)验收仍未完成。合入
main后会进入日常包,建议在 Issue 中明确剩余门禁,或评估是否需要功能开关。
因篇幅限制未审查 199 个文件:
apps/backend/crydaq-server/src/test/java/com/opentest/controller/CanControllerTest.java、apps/backend/crydaq-server/src/test/java/com/opentest/controller/CanRawFramesControllerTest.java、apps/backend/crydaq-server/src/test/java/com/opentest/controller/CanRawRecordingControllerTest.java、apps/backend/crydaq-server/src/test/java/com/opentest/migration/MathSampleSchemaRepairMigrationTest.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/BoxChannelService.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/DashboardConfigService.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/ProjectService.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/can/CanConfigurationStore.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/can/CanDbcService.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/can/CanNativeGateway.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/can/CanOperationException.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/can/CanProjectChannelFacts.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/can/CanProjectChannelService.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/can/CanRawRecordingStore.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/can/CanService.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/can/CanStoredUnitConversion.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/can/JniCanNativeGateway.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/component/dashboard/AbstractDashboardExecuteStrategy.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/component/dashboard/DashboardHistoricalResultArtifactResolver.java、apps/backend/crydaq-service/src/main/java/com/opentest/service/dashboard/framework/BoundMeasurementInputs.java
由 AI 自动生成,仅供参考,不作为合并依据。审查提交:
d4490a5。维护者可评论/review重新审查。
Behavior
Adds shared CAN reception, device configuration/manual reception, manual and DBC project signals, Raw Frames history/CSV, Monitor values/curves, and CAN-only or mixed Recorder history. Consumers release their own subscriptions; recordings freeze definitions, units, event timing, loss gaps and completion facts for offline playback and project migration.
Based on main
17f7574f9764a5a18c1f04adf85eaa932f7edae9; feature head2eb78c33e55c28e31945dab69a0a45e5a30ff9b4synchronizes the current main changes. Temporary installed mock plugins, local acceptance artifacts and native build outputs are excluded. Scope and contracts are documented underdocs/can-integration*and ADR 0046. Companion JNI change: https://github.com/crysound/OpenTest-NativeDriver/pull/2.Validation
7049c3deallows an explicitly CAN-only group to inherit empty physical clocks while retaining scope and ordinary-input validation. The regression reproduces the original exception before the fix; all 65 related tests pass after it. This commit is installed as Windows release20261116T123049Z-ba0e7376; actual loaded test-library hashes were verified. On November 17, this installed release passed two CAN-only Repeat rounds and two real SonoDAQ Ch1 + CAN6–9 Repeat rounds. Disk, HTTP and read-only SQLite snapshots agree. Each mixed round contains one 2-second, mono 48kHz WAV (96000 samples), 28 Crybin files and one CAN event file; native finish reports drained/complete with zero recorded loss.Application evidence and remaining gates
Windows release
20261117T061811Z-3d19ce05tested head2eb78c33e55c28e31945dab69a0a45e5a30ff9b4with the rebuilt x64 CAN JNI (13f99746…) and matching 2.5.0 test DLL/DAT from the internal plugin repository. Loaded-module hashes, test-signed target certificate and 9 ready plugins were verified. This test overlay is not included in the PR's production binaries.On that release, pure CAN Repeat and real SonoDAQ Ch1 plus controlled CAN recording completed, with event files matched across disk/HTTP/persisted snapshots and source-idle playback. The real ordinary waveform contained 192000 samples at 48kHz. Decoded video clips cover pure CAN initial placeholders, valid values and history playback; they do not cover the later mixed/Repeat runs. CAN input is a test fixture, not physical-bus certification.
Acceptance is now 64/76 clauses and 7/9 work packages, combining scoped archived and current evidence. Pure and mixed short Repeat, All Inputs growth and explicit-subset freezing are covered on deployed head
2eb78c33e55c28e31945dab69a0a45e5a30ff9b4in release20261117T061811Z-3d19ce05. The separate automatic Monitor cleanup check restored idle ports and original configuration. The new-head Repeat runs also ended with both CAN ports idle and the original dashboard configuration restored. The formal navigator Refresh entry confirms aborting the Recorder and actually reloads the document while preserving the existing manual receiveId. This passed for CAN-only and real Ch1 + CAN6–9 recordings; the mixed run retained its initial cleanup error and passed a separate recovery check. Forced transport-loss acceptance remains open.Ordinary signal-trigger preparation was diagnosed with an actual JVM Flight Recording:
dashboard-startthrewUnsatisfiedLinkErrorforcreateBkTriggerTask; the loaded DLL exportscreateSignalTriggerTask. The error escapedcatch (Exception)and appeared later astask timeout. A generated-header audit found 34 missing algorithm JNI exports before synchronization. Current main PR #29 already contains the Java adapters; syncing main brings the mismatch to 0 across 148 algorithm declarations. The current feature passed 39 JNI/bridge tests, 43 CAN/trigger tests and 181 Monitor tests. A matching Windows Electron native runtime was rebuilt on the Mac. The exact head is now deployed and application acceptance passed ordinary SIGNAL trigger request2122586283422519296(status2, WAV + CAN6 event, dependency rejection and CAN-source exclusion), two pure CAN Repeat rounds (2122586895526662144,2122586876694237184) and two mixed real Ch1 + CAN6–9 Repeat rounds (2122588219890733056,2122588211103666176).The pre-acquisition detail timeout left PENDING request
2122537553168285696without a recording-start stream or resource use; its failed report is retained. Earlier ordinary audio overrun13101013remains unresolved. Neither is counted as passing. Remaining trigger behavior, frozen playback processing, mixed source-failure/loss handling, storage and migration combinations remain open.Current-head CI run
44026488806has backend and frontend failures; backend evidence includes provider test-fixture compilation, installed-content path handling and CommonProto descriptor expectations. Docs-policy run44026488837passed. Prior base comparisons do not make this run pass. Keep this PR Draft until checks, application acceptance and review are complete.Refs #31