feat(web): surface per-identity provenance in the mapping editor - #231
Merged
Conversation
Schema v3 publishes an `identities` array per package and the browser loader already validates it, but nothing rendered it. Add an "Identity provenance" section to the mapping editor that lists every published identity with its role, provenance source, confidence, the evidence the pipeline used, and — for primaries — its own review state. The package-level mapping status and an identity review status are different facts, so the section keeps them apart: 682 packages in the current corpus carry a reviewer-blessed mapping whose primary PURL is still an unreviewed automatic guess, and those get an explicit callout instead of an automatic identity dressed up as human-verified. Payloads without identities (v2-era) and identities the payload records no provenance for render as absent rather than as defaults.
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.
Why
Schema v3 (#224) publishes an
identitiesarray for every package, and the browser loader already validates all of it — role, provenance source, confidence, the evidence the pipeline used, and the primary's review block. None of it reaches the screen. A reviewer opening a package sees one status pill and has no way to tell whether the primary PURL was set by a person or guessed by the pipeline.The distinction is the point. The package-level mapping
statusand a primary identity'sreview.statusare different facts: a human-blessed mapping routinely contains an automatically derived, individually unreviewed primary. In the current corpus that is 682 packages withstatus: verifiedwhose primary PURL isauto/auto-unverified, plus 2 more where it isauto-verified. Rendering either as a stand-in for the other tells reviewers something untrue about who vouched for what.What changes
web/src/data/identityProvenance.ts) that turns published identities into display descriptors, so the rules are testable without a DOM and the component stays presentational.identitiesrender no section at all, and identities the payload marks provenance-unavailable (bare alternatives, CPEs) say "no provenance recorded" rather than showing a default confidence or review state.Display only — no change to the payload, the loader, or the contribution flow.
Testing
npm testinweb/: 8 new tests alongside the existing loader suite, covering a manual verified primary (names its reviewer), an auto-unverified primary (shows confidence, renders no reviewer and no human-verified wording), a recipe-source alternative (provenance without a review state), the verified-mapping / auto-primary divergence, absent and provenance-less identities, and the stale-draft label. They render the real component through Vite's SSR loader, the same way the existing loader tests load modules.npm run build(tsc --noEmit+vite build) clean.aardvark-dns(verified mapping, auto-unverified primary — divergence callout),a2a-sdk(manual verified primary plus a provenance-less alternative),21cmfast(auto-verified primary with evidence sources),pikepdf(verified mapping, auto-verified primary),automake(CPE-only),7za(no identities — section hidden). No generated payload files are committed.One pre-existing failure in
web/src/data/loader.test.mjsis untouched by this PR: the checked-in snapshot test asserts a 33,287-package count whileweb/public/mappings-index.jsonon main now holds 33,726, so it fails on main as well. No CI workflow currently runs the web test suite.🤖 Generated with Claude Code