Skip to content

Align default Core URI validation with RFC 3986 component grammar #297

Closed

Description

@kikashy

Problem and reproduction

The default Core format: "uri" predicate combines a broad character allow-list with net/url.Parse, which disagrees with the RFC 3986 component grammar. Policy candidate review in #296 exposed this existing behavior. The candidate now opts into a scoped correct assertion; default Core/prototype behavior was deliberately kept outside that PR's compatibility scope.

Confirmed using exact source 55a23b884f0ce67fe6a9141b04e081a518fd5d61 and jpack spec validate - --through structural --format json, changing only a valid example Pack's root id:

ID Default Runtime RFC 3986 URI grammar
urn:test:[x] valid, exit 0 invalid raw brackets
https://example.invalid/[x] valid, exit 0 invalid raw brackets in path
https://%65xample.invalid/a invalid, exit 1 valid percent-encoded reg-name
foo://[v1.a]/ invalid, exit 1 valid IPvFuture authority

Refusals currently use JPS-STRUCTURE-FORMAT-URI at /id. Query/fragment raw brackets are affected too. See RFC 3986 Appendix A. This is generic URI syntax, not network reachability, DNS, scheme-specific validation or trust.

Scope and acceptance

  • Review and correct the shared Core assertion across all ordinary CLI/MCP/evaluation validation entry points, preserving exact input bytes and existing finite diagnostics.
  • Reuse one RFC3986 implementation after the compatibility decision, rather than permanently maintaining a Policy-only fork. Preserve positive percent-encoded, IPv6, IPvFuture (v and V), query/fragment and generic port cases.
  • Record the acceptance change explicitly: some previously accepted malformed IDs will be refused; some previously rejected valid IDs will be accepted. Do not rewrite stored artifact IDs or silently migrate jobs.
  • Add targeted positive/negative cases and cross-reader comparisons. Do not emulate the Python dependency's known final-LF/uppercase-IPvFuture/IPv4-tail bugs; the candidate Spec correction is Correct candidate URI checks across Policy and consuming Pack judgment-pack-spec#217.
  • Preserve default prototype compatibility through an explicit reviewed choice; do not accidentally change frozen embedded bytes, canonical identity or authority semantics.
  • Required platform CI and a recorded material review/disposition before merge.

Related #173 is a deliberately test-only contributor task for existing refusal branches; this issue concerns a production grammar correction and must not silently expand that task's scope. Related #293/#296 cover experimental Policy support, not this default Core change.

Activity

  1. self-assigned this
    on Oct 18, 2026
  2. added this to the v0.36.0 milestone on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions