Skip to content

feat(can): integrate device signals, raw diagnostics and recorder history - #34

Merged
yangdekun2026 merged 8 commits into
mainfrom
feature/31-can-integration
Nov 17, 2026
Merged

yangdekun2026 merged 8 commits into
mainfrom
feature/31-can-integration

Conversation

@yangdekun2026

@yangdekun2026 yangdekun2026 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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 head 2eb78c33e55c28e31945dab69a0a45e5a30ff9b4 synchronizes the current main changes. Temporary installed mock plugins, local acceptance artifacts and native build outputs are excluded. Scope and contracts are documented under docs/can-integration* and ADR 0046. Companion JNI change: https://github.com/crysound/OpenTest-NativeDriver/pull/2.

Validation

  • Initial changed Java test selection: 448 tests in 45 suites pass. Frontend selection: 495 tests in 26 files pass; SDK build, boundaries, Vue checks and bilingual document policy pass. These are scoped local runs, not all repository tests.
  • Finish-time source-failure regression and related suites: 98 pass. Ordinary graphic admission fix: 313 tests, 0 failures/errors, 3 skips. Source-filter expectation fix: 23 pass.
  • Pure CAN Repeat failed in the actual application while preparing its next round: the host incorrectly required ordinary sampled inputs. Commit 7049c3de allows 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 release 20261116T123049Z-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-3d19ce05 tested head 2eb78c33e55c28e31945dab69a0a45e5a30ff9b4 with 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 2eb78c33e55c28e31945dab69a0a45e5a30ff9b4 in release 20261117T061811Z-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-start threw UnsatisfiedLinkError for createBkTriggerTask; the loaded DLL exports createSignalTriggerTask. The error escaped catch (Exception) and appeared later as task 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 request 2122586283422519296 (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 2122537553168285696 without a recording-start stream or resource use; its failed report is retained. Earlier ordinary audio overrun 13101013 remains 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 44026488806 has backend and frontend failures; backend evidence includes provider test-fixture compilation, installed-content path handling and CommonProto descriptor expectations. Docs-policy run 44026488837 passed. Prior base comparisons do not make this run pass. Keep this PR Draft until checks, application acceptance and review are complete.

Refs #31

xiaopingshao
xiaopingshao previously approved these changes Nov 16, 2026
@yangdekun2026
yangdekun2026 marked this pull request as ready for review November 17, 2026 10:06
@yangdekun2026
yangdekun2026 requested a review from a team November 17, 2026 10:06

@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)

整体来看,本 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 重新审查。

@yangdekun2026
yangdekun2026 merged commit 449289d into main Nov 17, 2026
13 of 15 checks passed
@yangdekun2026
yangdekun2026 deleted the feature/31-can-integration branch November 17, 2026 10:15
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.

4 participants