fix(network,analysis): guard YANG whole-ns precondition + correct cqf_synth Period doc#295
Merged
Merged
Conversation
…_synth Period doc Two pre-tag hygiene fixes surfaced by the v0.20.0 clean-room self-verify (independent fresh-context review of the merged TSN-synthesis scope). 1. to_qcw_yang (REQ-TSN-EXPORT-YANG-001): the serializer truncates each duration_ps/1000 to integer nanoseconds but emits admin-cycle-time from cycle_ps directly, so a non-whole-nanosecond GateSchedule would emit a gate-control-list whose intervals no longer sum to the advertised cycle — an internally inconsistent document, with no test exercising it. The whole-ns precondition was only enforced by the two producers (GateSchedule::parse, synthesize_gcl), never at the serializer boundary. Add a debug_assert upholding it, document the precondition explicitly, and add qcw_yang_intervals_sum_to_admin_cycle_time asserting Σ time-interval-value == admin-cycle-time on a real synthesize_gcl output. No behavior change for any producible schedule. 2. cqf_synth (REQ-TSN-SYNTH-CQF-BRIDGE-001): the module/inline docs claimed the deadline accessor "falls back to Period." It does not — get_timing_property(props, "Deadline") looks up only Deadline (its internal fallback is typed-vs-string for the SAME property), so a Period-only flow is correctly SKIPPED, not synthesized against its period. The skip behavior is right and unchanged; only the inaccurate comment is corrected. spar-network: 140 lib tests pass (6 yang incl. the new consistency test); mutants on the YANG code 4/4 caught. spar-analysis: cqf_synth tests pass. fmt + clippy clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rivet verification gate✅ 20/20 passed
Filter: Failed artifacts(none) Updated automatically by |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
avrabe
added a commit
that referenced
this pull request
Jun 16, 2026
Workspace version 0.19.0 → 0.20.0 (Cargo.toml, Cargo.lock, vscode-spar). v0.20.0 ships the TSN synthesis track end to end — a coherent ingest → synthesize → bridge → export story (5 implemented requirements): - REQ-INGEST-DBC-FLOWS-001 CAN/DBC message flows as AADL ports + bus connections - REQ-TSN-SYNTH-QBV-BASE-001 802.1Qbv GCL synthesis baseline (exact TAS round-trip) - REQ-TSN-SYNTH-CQF-BASE-001 standard CQF synthesis baseline (single cycle) - REQ-TSN-SYNTH-CQF-BRIDGE-001 AADL SystemInstance → CqfFlow → synthesize_cqf bridge - REQ-TSN-EXPORT-YANG-001 802.1Qcw ieee802-dot1q-sched YANG/NETCONF config export Scope cut (deliberate, logged): the 16 requirements still carrying release: v0.20.0 that are not yet implemented (6 planned architecture/ solver backlog + 10 proposed, several gated — ARXML behind a kill-gate + autosar-data dep, NC-PLP-002 on cyclic panco fixtures, MILP-001 on the TAS-composition soundness experiment) are bumped to v0.21.0 so the v0.20.0 scope honestly reflects what shipped. No requirement is dropped; shipped reqs terminate at `implemented` per established project convention (no release in this repo uses `verified`). Pre-tag clean-room self-verify (independent fresh-context review of the merged scope) returned GO: every shipped req is V-closed by a passing verification artifact, and prior tags v0.16–v0.19 each carry a genuine success CI run. Two gaps it surfaced were fixed first (PR #295). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Two pre-tag hygiene fixes surfaced by the v0.20.0 clean-room self-verify — independent fresh-context review of the merged TSN-synthesis scope. Neither falsifies a shipped claim; both close a gap the per-feature mutation testing structurally couldn't (it only exercises whole-ns golden inputs).
1. YANG serializer — unguarded whole-ns precondition
GateSchedule::to_qcw_yangtruncates eachduration_ps / 1000to integer ns but emitsadmin-cycle-timefromcycle_psindependently. So a non-whole-nanosecondGateSchedulewould emit a gate-control-list whose intervals don't sum to the advertised cycle — an internally inconsistent document, untested. The precondition was enforced only by the two producers (parse,synthesize_gcl), never at the serializer boundary.debug_assertupholding whole-ns windows + cycle.Σ time-interval-value == admin-cycle-timeconsequence.qcw_yang_intervals_sum_to_admin_cycle_timeon a realsynthesize_gcloutput.2.
cqf_synth— inaccurate Period-fallback docThe module + inline comments claimed the deadline accessor "falls back to Period." It does not —
get_timing_property(props, "Deadline")looks up onlyDeadline(its internal fallback is typed-vs-string for the same property). A Period-only flow is correctly skipped, not synthesized against its period. Skip behavior is right and unchanged; only the misleading comment is corrected.Verification
cargo mutantson YANG code 4/4 caught.cqf_synthtests pass. fmt + clippy clean.🤖 Generated with Claude Code