fix(resolver): require structured trust evidence#379
Conversation
Greptile SummaryThis PR tightens trust-evidence validation in the Confidence Score: 5/5Safe to merge — logic is localized, well-tested, and previously-raised review concerns have been addressed. No P0 or P1 findings. The is_provenance fix correctly closes the bare-prefix bypass raised in the prior thread (requires a digit after /v). The attestation-bundle caveat is re-added to all relevant docs. Tests cover all malformed shapes and the new structured happy-paths. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "test(resolver): use structured provenanc..." | Re-trigger Greptile |
Summary
idpredicateTypeWhy
The trust downgrade policy previously treated arbitrary truthy registry values as trust evidence. That matched pnpm-style boolean checks, but it meant malformed or hostile packument metadata such as
{}or"oidc"could satisfy aube's trust policy. This keeps the existing metadata-based policy but narrows the accepted shapes to the structured metadata npm emits after registry-side checks.Validation
cargo run -p aube-settings --bin generate-settings-docscargo fmt --checkcargo test -p aube-resolver trust::testscargo test -p aube-registry provenancecargo clippy -p aube-resolver -p aube-registry --all-targets -- -D warningsThis pull request was generated by Codex.
Note
Medium Risk
Changes security enforcement logic for installs, which could newly reject packages with malformed/nonstandard registry metadata or alter downgrade decisions; behavior is well-covered by updated tests and docs.
Overview
Tightens trust-policy evidence detection so
_npmUser.trustedPublisheronly counts when it is an object with a non-emptyid, anddist.attestations.provenanceonly counts when it is an object whosepredicateTypematches an SLSA provenance URI (e.g.https://slsa.dev/provenance/v1).Updates resolver/unit tests and documentation/settings text to reflect the new structured-shape requirements and clarify that this is metadata validation (not cryptographic attestation verification).
Reviewed by Cursor Bugbot for commit e4a5bb0. Bugbot is set up for automated code reviews on this repo. Configure here.