internal/resolve/spdxnorm.go had an alias table that fabricated SPDX ids, breaking the package's core "never guess" invariant. This fix makes ambiguous and non-curated aliases resolve to unresolved with a reason instead of inventing an id.
[HIGH] Fabricated ids removed
"bsd" / "bsd license" -> previously BSD-2-Clause, inventing a clause count (could be 2/3/4-clause). Now unresolved.
"gnu lesser general public license" -> previously LGPL-3.0-or-later, inventing BOTH a version (2.1 vs 3.0) and the grant (only vs or-later). Now unresolved.
These guesses flowed into deny/allow verdicts and the incompatibility table, where -only vs -or-later and clause counts are decisive.
Alias re-validation now uses spdx.Lookup (curated rendering set) instead of spdx.Validate (full index). The Eclipse Public License aliases (EPL-2.0 / EPL-1.0) passed Validate but are outside the curated set, so policy.Classify returned Unknown while the dependency was still marked resolved. They are now left unresolved, and any future alias whose target is valid-but-uncurated is structurally rejected by the Lookup gate.
Aliases kept (unambiguous + curated)
Apache-2.0 spellings, MIT spellings, explicit 3-clause BSD spellings, isc license, the unlicense, mozilla public license 2.0, and the explicit gnu affero general public license v3.0 or later.
Behavior change
Dependencies whose declared license was a bare BSD/BSD License, a bare LGPL name, or an EPL spelling now flip from resolved to unresolved with a reason (e.g. "declared license not recognized as SPDX: BSD"). This is the correct, honest behavior: those names cannot be pinned to a single SPDX id without guessing.
Tests (TDD, red-green)
normalizeSPDX now yields unresolved for "BSD", "BSD License", "GNU Lesser General Public License", "Eclipse Public License 2.0", "Eclipse Public License 1.0".
New TestSPDXAliasesAreCuratedAndClassifiable asserts every remaining alias maps to a curated id with policy.Classify != Unknown.
## Summary
`internal/resolve/spdxnorm.go` had an alias table that fabricated SPDX ids, breaking the package's core "never guess" invariant. This fix makes ambiguous and non-curated aliases resolve to **unresolved with a reason** instead of inventing an id.
### [HIGH] Fabricated ids removed
- `"bsd"` / `"bsd license"` -> previously `BSD-2-Clause`, inventing a clause count (could be 2/3/4-clause). Now unresolved.
- `"gnu lesser general public license"` -> previously `LGPL-3.0-or-later`, inventing BOTH a version (2.1 vs 3.0) and the grant (`only` vs `or-later`). Now unresolved.
These guesses flowed into deny/allow verdicts and the incompatibility table, where `-only` vs `-or-later` and clause counts are decisive.
### [MED] Resolved-but-unclassifiable contradiction fixed
Alias re-validation now uses `spdx.Lookup` (curated rendering set) instead of `spdx.Validate` (full index). The Eclipse Public License aliases (`EPL-2.0` / `EPL-1.0`) passed `Validate` but are outside the curated set, so `policy.Classify` returned `Unknown` while the dependency was still marked resolved. They are now left unresolved, and any future alias whose target is valid-but-uncurated is structurally rejected by the `Lookup` gate.
### Aliases kept (unambiguous + curated)
Apache-2.0 spellings, MIT spellings, explicit 3-clause BSD spellings, `isc license`, `the unlicense`, `mozilla public license 2.0`, and the explicit `gnu affero general public license v3.0 or later`.
## Behavior change
Dependencies whose declared license was a bare `BSD`/`BSD License`, a bare LGPL name, or an EPL spelling now flip from resolved to **unresolved with a reason** (e.g. "declared license not recognized as SPDX: BSD"). This is the correct, honest behavior: those names cannot be pinned to a single SPDX id without guessing.
## Tests (TDD, red-green)
- `normalizeSPDX` now yields unresolved for `"BSD"`, `"BSD License"`, `"GNU Lesser General Public License"`, `"Eclipse Public License 2.0"`, `"Eclipse Public License 1.0"`.
- New `TestSPDXAliasesAreCuratedAndClassifiable` asserts every remaining alias maps to a curated id with `policy.Classify != Unknown`.
## Gate
- `gofmt -l .` clean
- `go vet ./...` clean
- `go test ./... -race` pass
- coverage 100% (2087/2087)
- `golangci-lint run` 0 issues
Closes #31
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
internal/resolve/spdxnorm.gohad an alias table that fabricated SPDX ids, breaking the package's core "never guess" invariant. This fix makes ambiguous and non-curated aliases resolve to unresolved with a reason instead of inventing an id.[HIGH] Fabricated ids removed
"bsd"/"bsd license"-> previouslyBSD-2-Clause, inventing a clause count (could be 2/3/4-clause). Now unresolved."gnu lesser general public license"-> previouslyLGPL-3.0-or-later, inventing BOTH a version (2.1 vs 3.0) and the grant (onlyvsor-later). Now unresolved.These guesses flowed into deny/allow verdicts and the incompatibility table, where
-onlyvs-or-laterand clause counts are decisive.[MED] Resolved-but-unclassifiable contradiction fixed
Alias re-validation now uses
spdx.Lookup(curated rendering set) instead ofspdx.Validate(full index). The Eclipse Public License aliases (EPL-2.0/EPL-1.0) passedValidatebut are outside the curated set, sopolicy.ClassifyreturnedUnknownwhile the dependency was still marked resolved. They are now left unresolved, and any future alias whose target is valid-but-uncurated is structurally rejected by theLookupgate.Aliases kept (unambiguous + curated)
Apache-2.0 spellings, MIT spellings, explicit 3-clause BSD spellings,
isc license,the unlicense,mozilla public license 2.0, and the explicitgnu affero general public license v3.0 or later.Behavior change
Dependencies whose declared license was a bare
BSD/BSD License, a bare LGPL name, or an EPL spelling now flip from resolved to unresolved with a reason (e.g. "declared license not recognized as SPDX: BSD"). This is the correct, honest behavior: those names cannot be pinned to a single SPDX id without guessing.Tests (TDD, red-green)
normalizeSPDXnow yields unresolved for"BSD","BSD License","GNU Lesser General Public License","Eclipse Public License 2.0","Eclipse Public License 1.0".TestSPDXAliasesAreCuratedAndClassifiableasserts every remaining alias maps to a curated id withpolicy.Classify != Unknown.Gate
gofmt -l .cleango vet ./...cleango test ./... -racepassgolangci-lint run0 issuesCloses #31