What this run demonstrated
source_token in crates/dependable/src/output/list.rs ends in _ => "unknown". PackageSource is #[non_exhaustive], so a variant added without a matching arm compiles, passes every test, and ships "source": "unknown" in list --format json with nothing failing.
That is not hypothetical. Two open pull requests each added a variant to that enum without knowing about the other:
They sit on the same stack. A merge resolution that kept one side's arm and dropped the other would have produced exactly the silent outcome above. The merge was resolved correctly and both arms survive today — but nothing in the repository would have caught it if they had not.
Why the existing guards do not cover it
ALL_KINDS's guard in crates/dependable-core/src/manifest.rs is the nearest analogue, and #124 records that it has the same class of gap: a guard that iterates a hand-maintained list cannot detect an omission from that list.
An exhaustive match in the defining crate would catch it, but source_token lives in the binary crate, where #[non_exhaustive] forces a wildcard arm and exhaustiveness is unavailable.
Direction
A test that enumerates every PackageSource variant and asserts source_token returns something other than "unknown" for each. The enumeration is the part that must not be hand-maintained, or the test inherits the same defect it is meant to close — the same objection #124 raises against ALL_KINDS.
The same argument applies to annotation() in that file, though less sharply: there, falling through is sometimes the intended answer (Locked deliberately has no arm and is documented as such), so the assertion has to be "the variant was considered", not "the variant renders".
Worth deciding at the same time: whether "unknown" should exist as a token at all, or whether an unmapped variant should be a panic in debug builds so it cannot reach a user.
Context
Raised while propagating repaired bases down the #95 → #97 → #103 → #115 stack, where the two variants met. A full audit of all 19 sites discriminating on PackageSource was done as part of that merge and every site is correct today; this issue is about the absence of anything that keeps them correct.
What this run demonstrated
source_tokenincrates/dependable/src/output/list.rsends in_ => "unknown".PackageSourceis#[non_exhaustive], so a variant added without a matching arm compiles, passes every test, and ships"source": "unknown"inlist --format jsonwith nothing failing.That is not hypothetical. Two open pull requests each added a variant to that enum without knowing about the other:
PackageSource::Lockedand a"locked"arm.PackageSource::Unidentifiedand an"unidentified"arm.They sit on the same stack. A merge resolution that kept one side's arm and dropped the other would have produced exactly the silent outcome above. The merge was resolved correctly and both arms survive today — but nothing in the repository would have caught it if they had not.
Why the existing guards do not cover it
ALL_KINDS's guard incrates/dependable-core/src/manifest.rsis the nearest analogue, and #124 records that it has the same class of gap: a guard that iterates a hand-maintained list cannot detect an omission from that list.An exhaustive
matchin the defining crate would catch it, butsource_tokenlives in the binary crate, where#[non_exhaustive]forces a wildcard arm and exhaustiveness is unavailable.Direction
A test that enumerates every
PackageSourcevariant and assertssource_tokenreturns something other than"unknown"for each. The enumeration is the part that must not be hand-maintained, or the test inherits the same defect it is meant to close — the same objection #124 raises againstALL_KINDS.The same argument applies to
annotation()in that file, though less sharply: there, falling through is sometimes the intended answer (Lockeddeliberately has no arm and is documented as such), so the assertion has to be "the variant was considered", not "the variant renders".Worth deciding at the same time: whether
"unknown"should exist as a token at all, or whether an unmapped variant should be a panic in debug builds so it cannot reach a user.Context
Raised while propagating repaired bases down the #95 → #97 → #103 → #115 stack, where the two variants met. A full audit of all 19 sites discriminating on
PackageSourcewas done as part of that merge and every site is correct today; this issue is about the absence of anything that keeps them correct.