fix(provenance): require textual identity locators - #287
Open
altrudev wants to merge 2 commits into
Open
Conversation
Contributor
|
🔴 Contributor Check: HIGH
Automated check by AgenTrust Contributor Check. |
lywinged
approved these changes
Sep 4, 2026
lywinged
left a comment
Collaborator
There was a problem hiding this comment.
Approved on c943434 over fc38496. Reproduced on main: _check_structure() tests artifact.package and endpoint.url by truthiness, so true, 1, [1] and {"x": 1} satisfy the presence check. On this head each is refused through both build_record() and verify_record() and textual locators pass; the PR's own test file has 16 of 17 cases failing against main and none here. Suite 1,184 passed, 1 skipped; ruff, mypy and the dash check clean.
Tool-assisted: the runs and this write-up.
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.
Closes #285.
What
spec/server-provenance-v1.mddefinesidentity.artifact.packageas a Package URL andidentity.endpoint.urlas a URL. The shared producer/consumer structural check previously used truthiness only, so truthy non-string JSON values could satisfy both locator-presence checks.This change adds one small non-empty-string boundary and applies it to both locator fields from
_check_structure(), which is shared bybuild_record()andverify_record().Regression coverage
For both producer and verifier paths, the tests refuse:
true;1;[1];{\"x\": 1}.Positive controls keep ordinary textual Package URL and HTTPS locator values working.
Scope
This is intentionally only the primitive/type boundary. It does not add full Package URL parsing or broader URL syntax policy.
AI-assistance disclosure: ChatGPT assisted with source triage, adversarial-case design, implementation drafting, and diff review.
altrudevreviewed the bounded claim and remains responsible for the contribution.