v0.3.1-alpha.1: Stabilization + Oracle B-O1/B-O2 + Full Medium/High completion - #11
Merged
Conversation
- Remove 5 exception-swallowing try/with blocks in Dbc.fs that silently returned defaults on parse failures, risking incorrect C code generation - Add GenerateError DU to preserve error type info through the pipeline (ParseError/ValidationError/CodeGenError no longer flattened to string) - Update Api.fs, Library.fs facade, and CLI to match GenerateError variants - Add Core test project with 13 tests (10 Dbc + 3 Api error propagation) - Fix Windows test compatibility: use mingw32-make and .exe extension - All 29 tests pass (16 Generator + 13 Core), 0 failures
- ConfigTests: 16 tests for Config.validate and Config.loadFromYaml - CodegenTests: 8 tests for Codegen.generate with inline IR - EdgeCaseTests: 4 tests for empty DBC, Motorola LSB, signed, 64-bit signals Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
- FacadeTests: 4 tests verifying exception type mapping - ApiTests: 1 E2E happy-path test with examples/sample.dbc - fsproj: add compile items and Signal.CANdy project reference Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
- Mark H-1c~H-1g, H-3a~H-3c as complete in ROADMAP - Add session report for 34 new tests (63 total, 0 failures) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Remove 8 duplicated .fs files from Generator (~1100 lines), replacing them with an 83-line Compat.fs backward-compatibility bridge that re-exports Core types under the Generator namespace. Generator.fsproj now references Core directly and carries zero package dependencies of its own. Key changes: - Generator.fsproj: remove 7 Compile items + 5 PackageReferences, add Core ref - Compat.fs: bridge modules for Ir, Config, Dbc, Codegen, Result (active pattern) - Program.fs: rewritten to use Core API (Config/Dbc/Codegen/Errors) directly - Core Dbc.fs: add missing validateMuxStructure (was in legacy Generator only) All 63 tests pass (47 Core + 16 Generator), E2E roundtrip verified.
…le (M-2, M-3, M-4)
- Fix get_bits_le/set_bits_le: replace hardcoded 8-byte loop with dynamic n_bytes - Fix 64-bit mask UB: use UINT64_MAX when length==64 - Fix memset: use message.Length instead of hardcoded 8 - Add 6 F# tests (codegen + edge cases) for CAN FD payloads up to 64 bytes - Add canfd_test.dbc (DLC=64, 3 signals) and E2E test_fd_roundtrip in main.c - Update README: supported features + limitations reflect CAN FD support - get_bits_be/set_bits_be already use dynamic bit-by-bit loops, no change needed
…ode (L-4c) - Add canfd_dlc_to_len() / canfd_len_to_dlc() to generated utils (ISO 11898-1) - Fix signed signal decode: cast uint64_t to int64_t before float conversion to prevent negative values from being interpreted as huge positive numbers
- Add comprehensive_test.dbc with 18 signals covering LE/BE, signed, packed, non-aligned, and scale/offset configurations - Add 7 C E2E test functions verifying byte-level encode/decode correctness - Add 5 F# unit tests for DLC mapping codegen and signal pattern generation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
…orward Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Sisyphus: 🪨⬆️ (OpenCode)
Sisyphus: 🪨⬆️ (OpenCode)
Sisyphus: 🪨⬆️ (OpenCode)
Sisyphus: 🪨⬆️ (OpenCode)
Sisyphus: 🪨⬆️ (OpenCode)
…ript) - Add .config/dotnet-tools.json with ReportGenerator 5.4.5 local tool manifest - Add run-coverage.ps1 PowerShell script for HTML coverage report generation - Add TestResults/ and coverage_report/ to .gitignore Sisyphus: 🪨⬆️ (OpenCode)
…ated vectors - Add TRACE printf lines to test_roundtrip and test_fixed_roundtrip for visual verification - Expand motorola_lsb_suite.dbc from 1 to 4 signals (3 unsigned + 1 signed, byte-aligned) - Add test_moto_lsb_comprehensive with mathematically derived known_data byte arrays Sisyphus: 🪨⬆️ (OpenCode)
- Add runCGeneratorWithDbc helper to support arbitrary DBC file paths - Add 11 new [Fact] integration tests covering LE/BE/signed/nonalign/packed/scale, CAN FD, multiplex, value table, and Motorola LSB byte-level verification - Generator test count: 16 -> 27, total: 74 -> 85 Sisyphus: 🪨⬆️ (OpenCode)
Sisyphus: 🪨⬆️ (OpenCode)
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
…orts Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
…Reports Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
…orts Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
…ation Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <[email protected]>
There was a problem hiding this comment.
Pull request overview
Stabilization checkpoint for v0.3.1-alpha.1, adding a full oracle-based cross-validation pipeline (cantools ↔ generated C), hardening core parsing/codegen for corpus edge cases (mux, byte order, CAN FD, range sentinels), and updating versioning + project documentation/history.
Changes:
- Added a Python oracle harness (CLI + matrix + corpus runners), oracle C harness template, and pytest coverage to validate generated C encode/decode against cantools.
- Hardened F# DBC parsing and codegen (byte-order fallback, Motorola LSB start-bit conversion, CAN FD LE bit helpers, raw-range sentinel heuristic), plus expanded F# integration tests.
- Bumped library/package versions to
0.3.1-alpha.1and updated ROADMAP/Reports/tooling to reflect completion status and evidence.
Reviewed changes
Copilot reviewed 88 out of 105 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/oracle/vendor_dbc/toyota_prius_2010_pt.dbc | Adds curated vendor DBC for oracle corpus coverage. |
| tests/oracle/vendor_dbc/mercedes_benz_e350_2010.dbc | Adds curated vendor DBC for oracle corpus coverage. |
| tests/oracle/vendor_dbc/gm_global_a_chassis.dbc | Adds minimal DBC for oracle smoke coverage. |
| tests/oracle/vendor_dbc/ford_fusion_2018_pt.dbc | Adds curated vendor DBC for oracle corpus coverage. |
| tests/oracle/vendor_dbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc | Adds curated vendor DBC for oracle corpus coverage. |
| tests/oracle/vendor_dbc/acura_ilx_2016_nidec.dbc | Adds curated vendor DBC for oracle corpus coverage. |
| tests/oracle/vendor_dbc/README.md | Documents vendor DBC provenance and license compliance. |
| tests/oracle/vendor_dbc/.gitkeep | Keeps vendor corpus directory present in VCS. |
| tests/oracle/tests/test_vector_gen.py | Unit tests for oracle vector generation (incl. mux branches). |
| tests/oracle/tests/test_tolerance.py | Unit tests for oracle tolerance/byte-compare behavior. |
| tests/oracle/tests/test_mux_assumptions.py | Integration assertions documenting cantools mux semantics relied upon by oracle. |
| tests/oracle/tests/test_metadata.py | Tests metadata extraction/comparison scaffolding. |
| tests/oracle/tests/test_harness.py | Tests harness code generation + compile/run JSON protocol. |
| tests/oracle/tests/test_engine.py | Integration tests for oracle pipeline and mux vector behavior. |
| tests/oracle/tests/conftest.py | Pytest fixtures and markers for oracle test suite. |
| tests/oracle/tests/init.py | Ensures oracle test package path setup. |
| tests/oracle/templates/oracle_harness.c | C harness template implementing JSON command protocol for encode/decode. |
| tests/oracle/templates/.gitkeep | Keeps templates directory present in VCS. |
| tests/oracle/run_oracle.py | CLI runner for single-DBC oracle execution and JSON reporting. |
| tests/oracle/run_matrix.py | Runner for sweeping config matrix permutations against a DBC. |
| tests/oracle/run_corpus.py | Runner for batch oracle validation across curated/vendor corpus (and optional opendbc clone). |
| tests/oracle/requirements.txt | Python dependencies for oracle runner and tests. |
| tests/oracle/pyproject.toml | Python project metadata + pytest discovery configuration. |
| tests/oracle/oracle/vector_gen.py | Oracle test vector generation, incl. adversarial and mux-per-branch support. |
| tests/oracle/oracle/tolerance.py | Implements tolerance computation and byte-level comparison. |
| tests/oracle/oracle/report.py | Placeholder report helpers (currently unused). |
| tests/oracle/oracle/metadata_compare.py | Metadata extraction + divergence reporting structures. |
| tests/oracle/oracle/harness.py | Generates/compiles/runs the oracle C harness and parses JSON responses. |
| tests/oracle/oracle/init.py | Oracle package initialization. |
| tests/oracle/init.py | Oracle package/module docstring. |
| tests/oracle/ORACLE_RESULTS.md | Captures oracle corpus/matrix outcomes and reproduction commands. |
| tests/oracle/CATEGORY_C_EXCEPTIONS.md | Defines and documents acceptable “Category C” exception criteria and evidence. |
| tests/Signal.CANdy.Core.Tests/DbcTests.fs | Adds tests/probes for DbcParserLib ByteOrder mapping and BE fallback behavior. |
| tests/Generator.Tests/CodegenTests.fs | Adds integration tests for comprehensive byte-level cases, CAN FD, mux, and Motorola LSB. |
| templates/utils.c.scriban | Updates LE bit helpers (n_bytes computation, 64-bit mask handling). |
| src/Signal.CANdy/Signal.CANdy.fsproj | Version bump to 0.3.1-alpha.1. |
| src/Signal.CANdy.Core/Signal.CANdy.Core.fsproj | Version bump to 0.3.1-alpha.1. |
| src/Signal.CANdy.Core/Dbc.fs | Fixes byte-order inference fallback using DbcParserLib byte-order info. |
| src/Signal.CANdy.Core/Codegen.fs | Removes LE n_bytes clamp, fixes Motorola LSB conversion step, adds raw-range sentinel heuristic, adjusts range-check emission. |
| src/Signal.CANdy.Core/Api.fs | Updates version() string to 0.3.1-alpha.1. |
| run-coverage.ps1 | Adds local coverage generation script (coverlet + reportgenerator). |
| examples/motorola_lsb_suite.dbc | Expands Motorola LSB example DBC with additional signals. |
| examples/main.c | Adds Motorola LSB comprehensive test and extra trace output in example runner. |
| Reports/20260312_1800_B-O2_Oracle_Multiplex_Mode.md | Session report: oracle mux mode completion evidence. |
| Reports/20260312_1705_Oracle_mux_assumptions_validation.md | Session report: cantools mux assumptions validation. |
| Reports/20260312-1447_Oracle_tracking_source_of_truth_sync.md | Session report: tracking/evidence hierarchy sync. |
| Reports/20260312-1235_Oracle_Overflow_Guardrails.md | Session report: overflow guardrails rationale and verification. |
| Reports/20260312-1235_Oracle_DBC_Parse_Triage.md | Session report: cantools parse incompatibility triage evidence. |
| Reports/20260312-1235_DbcParserLib_Type_Probe_Test.md | Session report: ByteOrder/IsSigned probe evidence. |
| Reports/20260312-1235_Bug4_ZeroRange_Sentinel_Fix.md | Session report: zero-range sentinel fix details. |
| Reports/20260312-1235_Bug2_LE_Clamp_Fix.md | Session report: LE clamp removal/CAN FD fix evidence. |
| Reports/20260312-1235_Bug1_ByteOrder_Fallback_Fix.md | Session report: byte-order fallback fix evidence. |
| Reports/20260312-1118_Active_Boulder_AGENTS_Audit.md | Session report: plan/audit status writeup. |
| Reports/20260213_1952_Oracle_Integration_Result_Report.md | Prior integration results report retained under Reports/. |
| Reports/20260213_1848_Oracle_Tolerance_Metadata_Comparison.md | Prior tolerance/metadata work report retained under Reports/. |
| Reports/20260213_0730_Git_Workflow_Setup.md | Prior repo workflow report retained under Reports/. |
| Reports/20260213_0000_Morning_Briefing.md | Prior status briefing retained under Reports/. |
| Reports/20260212_1615_main_c_comprehensive_bitpattern_tests.md | Prior C test work report retained under Reports/. |
| ROADMAP.md | Updates tracking sections (Oracle O-* and backlog B-O*), and references Reports/ as source-of-truth. |
| AGENTS.md | Adds evidence/source-of-truth guidance and updates Reports/ path conventions. |
| .sisyphus/boulder.json | Records plan completion metadata for the agent workflow. |
| .gitignore | Adds Python cache ignores and coverage output directories. |
| .config/dotnet-tools.json | Adds reportgenerator dotnet tool pinning for coverage report generation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR merges 80 commits from
devintomain, representing the stabilization pause checkpoint for version0.3.1-alpha.1. It completes all Critical, High, Medium, and select Low ROADMAP items, plus two Oracle hardening milestones (B-O1, B-O2).Scope: This is an internal alpha pre-release. The actual
v0.3.1release tag will be applied tomainafter PR review and merge.Highlights by Category
🔮 Oracle Hardening (B-O1, B-O2)
engine.py; added mux-specific unit tests; catalogued 1,778 Category-C exceptions inCATEGORY_C_EXCEPTIONS.mddbparameter from_generate_mux_vectors(); added B-O3 TODO🏗️ Core F# Library
📦 Version Bump
Signal.CANdy.Core.fsproj,Signal.CANdy.fsproj,Api.fsall updated to0.3.1-alpha.10.3.0(alpha not exposed to end users)📚 Documentation & History
Reports/(append-only historical record)ORACLE_RESULTS.mdandCATEGORY_C_EXCEPTIONS.mdmaintained as immutable evidenceOracle Corpus Results
Category-C failures are documented exceptions (edge cases in DBC files, not generator bugs) — see
tests/oracle/CATEGORY_C_EXCEPTIONS.md.Test Status
dotnet test (Release)
Python pytest (Oracle — local only, not in CI)
dotnet build
CI (GitHub Actions — build-test job)
lintjob fails on Fantomas — this is a pre-existing issue inCodegen.fs,Dbc.fs,CodegenTests.fs,DbcTests.fsthat predates this PR. Our changed file (Api.fs) passes Fantomas cleanly.Version Note
0.3.1-alpha.1— an internal alpha for validation before the actualv0.3.1releasev0.3.1tag onmainfor the real NuGet releaseRemaining Backlog (out of scope for this PR)
Codegen.fs,Dbc.fs,CodegenTests.fs,DbcTests.fsCommit Count
80 commits ahead of
main. Seegit log --oneline origin/main..HEADfor full history.