Skip to content

fix(provenance): require textual identity locators - #287

Open
altrudev wants to merge 2 commits into
agentrust-io:mainfrom
altrudev:fix/provenance-identity-locator-types-285
Open

fix(provenance): require textual identity locators#287
altrudev wants to merge 2 commits into
agentrust-io:mainfrom
altrudev:fix/provenance-identity-locator-types-285

Conversation

@altrudev

@altrudev altrudev commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Closes #285.

What

spec/server-provenance-v1.md defines identity.artifact.package as a Package URL and identity.endpoint.url as 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 by build_record() and verify_record().

Regression coverage

For both producer and verifier paths, the tests refuse:

  • true;
  • integer 1;
  • array [1];
  • object {\"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. altrudev reviewed the bounded claim and remains responsible for the contribution.

@altrudev
altrudev requested a review from a team as a code owner September 4, 2026 14:50
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🔴 Contributor Check: HIGH

Check Result
Profile HIGH
Credential LOW
Overall HIGH

Automated check by AgenTrust Contributor Check.

@github-actions github-actions Bot added the needs-review:HIGH Contributor check flagged HIGH risk label Sep 4, 2026

@lywinged lywinged left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review:HIGH Contributor check flagged HIGH risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

provenance: identity locator fields accept truthy non-string values

2 participants