Skip to content

fix(network,analysis): guard YANG whole-ns precondition + correct cqf_synth Period doc#295

Merged
avrabe merged 1 commit into
mainfrom
fix/clean-room-yang-cqf-followups
Jun 16, 2026
Merged

fix(network,analysis): guard YANG whole-ns precondition + correct cqf_synth Period doc#295
avrabe merged 1 commit into
mainfrom
fix/clean-room-yang-cqf-followups

Conversation

@avrabe

@avrabe avrabe commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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_yang truncates each duration_ps / 1000 to integer ns but emits admin-cycle-time from cycle_ps independently. So a non-whole-nanosecond GateSchedule would 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.

  • Add a debug_assert upholding whole-ns windows + cycle.
  • Document the precondition and its Σ time-interval-value == admin-cycle-time consequence.
  • Add qcw_yang_intervals_sum_to_admin_cycle_time on a real synthesize_gcl output.
  • No behavior change for any producible schedule.

2. cqf_synth — inaccurate Period-fallback doc

The module + inline comments 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). 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

  • spar-network: 140 lib tests pass (6 yang incl. new consistency test); cargo mutants on YANG code 4/4 caught.
  • spar-analysis: cqf_synth tests pass. fmt + clippy clean.

🤖 Generated with Claude Code

…_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>
@github-actions

Copy link
Copy Markdown

Rivet verification gate

20/20 passed

count
Passed 20
Failed 0
Skipped (no steps) 0

Filter: (and (= type "feature") (or (has-tag "v093") (has-tag "v0100")))

Failed artifacts

(none)

Updated automatically by tools/post_verification_comment.py. Source of truth: artifacts/verification.yaml.

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@avrabe avrabe merged commit b4d4863 into main Jun 16, 2026
18 checks passed
@avrabe avrabe deleted the fix/clean-room-yang-cqf-followups branch June 16, 2026 20:53
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>
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.

1 participant