Skip to content

feat(network): 802.1Qcw YANG/NETCONF export of synthesized GCL (REQ-TSN-EXPORT-YANG-001)#293

Merged
avrabe merged 1 commit into
mainfrom
feat/tsn-export-yang
Jun 16, 2026
Merged

feat(network): 802.1Qcw YANG/NETCONF export of synthesized GCL (REQ-TSN-EXPORT-YANG-001)#293
avrabe merged 1 commit into
mainfrom
feat/tsn-export-yang

Conversation

@avrabe

@avrabe avrabe commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What

Adds GateSchedule::to_qcw_yang(port_name) -> String — serializes a synthesized 802.1Qbv gate schedule (the output of synthesize_gcl, REQ-TSN-SYNTH-QBV-BASE-001) as an ieee802-dot1q-sched (802.1Qcw) YANG instance document in NETCONF XML. This is the deployable artifact a TSN switch consumes via edit-config — completing the ingest → synthesize → export story a real TSN tool sells (tsnkit/Slate/RTaW/PEGASE emit configs, not just bounds).

Each GateWindow → one <gate-control-entry> (operation-name=set-gate-states, time-interval-value = duration ns, gate-states-value = allowed-CoS bitmask; closed guard emits mask 0). Cycle → admin-cycle-time = cycle_ps / 1e12 s. Hand-emitted XML, no new dependency (the to_gcl_blob precedent); xml_escape guards the port name.

Scope honesty

Node structure cross-checked against the published ieee802-dot1q-sched module text (no sgs-params wrapper, no admin-control-list-length leaf, gate-states-value a sibling of operation-name). The document is deliberately simplified and not yet schema-validgate-parameter-table sits directly under interfaces/interface rather than the 802.1Qcw bridge-port mount, and operation-name uses a bare set-gate-states identityref. No YANG validator was run. Concrete follow-ups (not claimed here): the bridge-port mount + prefixed identityref to pass pyang/yanglint, and a CQF/Qch export path.

The kill-gate ("premature if no synthesis target consumes the export") is cleared by the v0.20.0 GateSchedule producer.

Oracle (5 tests)

Pinned golden snapshot · one entry per window · Σ time-interval-value == cycle · mask fidelity incl. the closed guard · round-trip from a real synthesize_gcl output · port-name escaping. 139 spar-network lib tests pass; cargo mutants on the new code: 4/4 caught, 0 survivors. fmt + clippy clean.

Traceability

  • REQ-TSN-EXPORT-YANG-001: proposed → implemented, pulled forward v0.21.0 → v0.20.0.
  • TEST-TSN-EXPORT-YANG added (satisfies).

Falsification

If to_qcw_yang emitted a document whose entry count, interval sum, or per-window masks diverged from the source GateSchedule, or drifted from the pinned golden snapshot, the oracle tests fail.

🤖 Generated with Claude Code

…SN-EXPORT-YANG-001)

Add GateSchedule::to_qcw_yang(port_name) — serialize a synthesized
802.1Qbv gate schedule (the output of synthesize_gcl,
REQ-TSN-SYNTH-QBV-BASE-001) as an ieee802-dot1q-sched (802.1Qcw) YANG
instance document in NETCONF XML. This is the deployable artifact a TSN
switch consumes via edit-config — completing the ingest→synthesize→EXPORT
story a real TSN tool sells, not just a network-calculus bound.

Each GateWindow maps to one <gate-control-entry>
(operation-name=set-gate-states, time-interval-value = duration in ns,
gate-states-value = the allowed-CoS bitmask, closed guard emits mask 0);
the cycle maps to admin-cycle-time = cycle_ps/1e12 s. Hand-emitted XML,
NO new dependency (the to_gcl_blob precedent); xml_escape guards the port
name.

Node structure follows the ieee802-dot1q-sched module (cross-checked
against the published module text: no sgs-params wrapper, no
admin-control-list-length leaf, gate-states-value a sibling of
operation-name). The document is DELIBERATELY SIMPLIFIED and not yet
schema-valid — the gate-parameter-table sits directly under
interfaces/interface rather than the 802.1Qcw bridge-port mount, and
operation-name uses a bare set-gate-states identityref with no
module-prefixed value. No YANG validator was run; full pyang/yanglint
validation (bridge-port mount + prefixed identityref) and a CQF/Qch
export path are noted follow-ups, not claimed here.

Self-certifying oracle (5 tests): pinned golden snapshot, one entry per
window, Σ time-interval-value == cycle, mask fidelity incl. the closed
guard, round-trip from a real synthesize_gcl output, and port-name
escaping. 139 spar-network lib tests pass; mutants on the new code 4/4
caught. The kill-gate (premature without a synthesis target) is cleared
by the v0.20.0 GateSchedule producer.

REQ-TSN-EXPORT-YANG-001: proposed→implemented, pulled forward v0.21.0→v0.20.0.

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 3b5c17b into main Jun 16, 2026
18 checks passed
@avrabe avrabe deleted the feat/tsn-export-yang branch June 16, 2026 19:47
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