Publish the ARD base context at /context/v1 - #17
Merged
Conversation
§4.1 says term IRIs come from a base context served at https://agenticresourcediscovery.org/context/v1, applied by a conformant consumer as the JSON-LD expandContext. That URL currently 404s, so the one normative reference an ARD entry makes to this site does not resolve. Follows the pattern spec_from_canonical.py already establishes: the context lives only in ards-project/ard-spec (spec/schemas/ard.context.jsonld) and is fetched at build time, so the site never holds a second copy that can drift. Publishes the same bytes at two paths. /context/v1 is the URL the spec names. /context/v1.jsonld is an alias, because static hosting assigns Content-Type from the file extension: GitHub Pages serves the extensionless path as application/octet-stream, and the JSON-LD 1.1 API requires a remote context to arrive as application/ld+json, application/json, or a +json type. The bare path resolves and reads correctly; a strict processor dereferencing it may still refuse it, and the alias gives those consumers something that works today. A fetch failure publishes nothing rather than a placeholder. A stand-in page is fine for prose a human reads; a partial or unparseable document at a context URL is worse than a 404, because a consumer would apply it and expand every term wrongly. The fetched document is parsed and checked for @context before it is published, so an HTML error body arriving with a 200 cannot be served as the context. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Problem
§4.1 of the spec says term IRIs come from a base context served at
https://agenticresourcediscovery.org/context/v1, which a conformant consumer applies as the JSON-LDexpandContext.That URL currently returns 404 (the docs-site HTML shell). It's the one normative reference an ARD entry makes back to this site, so anyone reviewing a published entry and clicking through hits a dead link.
The context file itself landed in the canonical repo with ards-project/ard-spec#70 — it just isn't served anywhere.
Approach
Follows the pattern
hooks/spec_from_canonical.pyalready establishes: the context lives only inards-project/ard-spec(spec/schemas/ard.context.jsonld) and is fetched at build time, so this repo never holds a second copy that can drift from canonical.Verified locally — the published file is byte-identical to canonical, parses, and works as an
expandContext:Two decisions worth reviewing
1. Content-Type — the bare path may not satisfy strict processors.
Static hosting assigns
Content-Typefrom the file extension, and GitHub Pages offers no way to set headers. An extensionless file is served asapplication/octet-stream, while the JSON-LD 1.1 API requires a remote context to arrive asapplication/ld+json,application/json, or a+jsontype — a strict processor rejects anything else.So
/context/v1resolves and reads correctly, but a strict consumer that dereferences it may still refuse it. This PR also publishes/context/v1.jsonldwith identical bytes, which gives those consumers a URL that works today.Making the bare path fully correct needs either a host that can set headers, or a spec that names the suffixed URL. Both are spec/infra decisions rather than build ones, so I've left them alone — happy to follow up whichever way you prefer.
2. A fetch failure publishes nothing.
spec_from_canonical.pyfalls back to a placeholder page, which is right for prose a human reads. It would be wrong here: a partial or unparseable document served at a context URL is worse than a 404, because a consumer would apply it and expand every term incorrectly. On failure this logs a warning and leaves the URL 404ing.The fetched document is also parsed and checked for
@contextbefore publishing, so an HTML error body arriving with a200can't be served as the context.🤖 Generated with Claude Code