feat(trace-topology): GptpOutOfBudget reconciliation check (v0.11.0)#241
Merged
Conversation
Second of the five v1 deterministic checks (design §4.4). Extends the engine module with check_gptp_out_of_budget plus the declared sync-budget surface on DeclaredModel. The check reads `Spar_TSN::Sync_Error` (in picoseconds, via the existing spar-network::tsn::get_sync_error_ps accessor's unit conversion — `1000 ns` materialises as 1_000_000 ps) off every component of an instantiated AADL SystemInstance. If exactly one component (bus or processor) declares the budget, every observed gPTP port's worst-case sync error is checked against it; otherwise the check is a no-op. Single-budget-only is the honest scope: multi-budget systems need port→bus ownership, which lives on the same connection-property surface deferred elsewhere in this module. Choosing the most-strict budget would mis-attribute the finding's `bus_or_processor` field. 8 unit tests + 3 instantiated-AADL integration tests, each probing one falsifiable claim independently. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Carries the new dependency edge in Cargo.lock so the workspace lock file stays in sync with Cargo.toml. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Rivet verification gate✅ 20/20 passed
Filter: Failed artifacts(none) Updated automatically by |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
Second of the five v1 deterministic checks — extends the v0.11.0
reconciliation engine (design
docs/designs/v0.10.0-trace-topology.md§4.4; contract
docs/contracts/spar-trace-topology-v1.md).DeclaredModelwithdeclared_sync_budgets_ps— thedeclared
Spar_TSN::Sync_Errorbudget per component (FQN keyed),populated from a
SystemInstancevia the existingspar-network::tsn::get_sync_error_psaccessor's unit conversion(
1000 ns→1_000_000ps).check_gptp_out_of_budget— flags the owning bus / processorwhen any observed gPTP port's worst-case sync error exceeds the
budget. Emits a single finding per owner carrying the max observed
across over-budget ports, matching design §4.4's "worst-case
observed error" wording.
Multi-budget needs the feature-level
LLDP_Port_Idsurface thatremains deferred; emitting findings under a guessed-strict owner
would mis-attribute, so the check is a no-op in that case.
Adds
spar-networkas a workspace dep ofspar-trace-topology(single source of truth for the
Spar_TSN::*accessors — no cycle:spar-networkdoesn't depend onspar-trace-topology).Falsifiable claims, each test-pinned
Sync_Error => 1000 nsmaterialises as1_000_000psfrom_instance_reads_sync_error_with_unit_conversiongptp_flags_port_over_budget,observed_above_budget_raises_gptp_out_of_budgetgptp_clean_when_all_ports_below_budget,observed_below_budget_reconciles_cleangptp_no_finding_when_no_budget_declaredgptp_deferred_when_multiple_components_declare_budgetobserved_ps= max over all violating portsgptp_reports_max_across_all_violating_portsgptp_uses_worst_sample_per_portobserved == budgetis pass (≤)gptp_observed_equal_to_budget_is_passgptp_port_with_no_samples_does_not_flagArtifacts:
REQ-TRACE-TOPOLOGY-009+TEST-TRACE-TOPOLOGY-GPTP-OUT-OF-BUDGET.Test plan
cargo test -p spar-trace-topology --lib -- engine::tests::gptp_— 8 unit testscargo test -p spar-trace-topology --test gptp_out_of_budget— 3 integration testscargo clippy -p spar-trace-topology --all-targets— cleancargo fmt --check— cleanrivet validate— 0 broken cross-refs; totals byte-identical to baseline🤖 Generated with Claude Code