Skip to content

Artifact inspection: $id bases, $ref in data, documents in the release catalog (#857) - #864

Merged
jimhoyd merged 1 commit into
mainfrom
claude/artifact-inspect-followups
Sep 28, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
claude/artifact-inspect-followups

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Fixes items 1, 3, 5 and 7 of #857. Items 2, 4 and 6 need a design decision; the options are posted on the issue.

Changes

  • $id bases (item 1). In JSON Schema documents and OpenAPI 3.1+ Schema Objects, a schema's $id now sets the base for the relative $refs inside it.
    • A relative $id resolves inside the package. If it would leave the package, every ref under it is reported as path-escape.
    • An absolute $id makes the refs under it remote: they get a warning and are never fetched.
    • Same-file resources and fragment pointers resolve against the nearest enclosing $id. A plain-name $id (#x) is an anchor and sets no base.
    • Swagger 2.0 and OpenAPI 3.0 ignore $id.
  • $ref inside data (item 3). The ref walk now follows a small grammar of places where references can appear. $ref inside const, enum, default, example and examples, and inside Example Object values, is data. Properties or components that are merely named like those keywords are still walked.
  • Documents in the release catalog (item 5). addon-catalog.json carries each artifact's documents (path and media type only, never contents). They are validated with the descriptor rules: at most 32, relative paths, the closed media-type set, artifacts only.
  • Duplicate providers (item 7). A duplicate is reported once, in the list for the set-aside package's kind. Static validate reports only extension-kind provider problems.
  • Docs: EXTENSIONS (catalog, $id bases, what counts as data, the duplicate rule), RUNTIME-IMPLEMENTATION (RIM-ARTIFACT-INSPECT-001, RIM-ADDON-001), TOOLING. Regenerated outputs are included.

Evidence (macOS, Node 26)

  • npm run verify passes.
  • npm test: 1120/1120.
  • npm run test:addons: 6/6.
  • npm run test:package passes; core packs to 878,324 bytes.
  • 5 new tests: relative, escaping and anchor $id; a remote $id that is never fetched; $ref in data across JSON Schema, OpenAPI 3.1 and Swagger 2.0; one report per duplicate; the catalog documents round-trip and are refused when invalid.

Limits

  • The OpenAPI grammar is deliberately small.
  • $id lookup covers same-file resources only.
  • Not measured against a real-world corpus.

🤖 Generated with Claude Code

… the catalog (#857)

Artifact inspection follow-ups from #857, items 1, 3, 5 and 7:

- $id bases: a schema's $id (JSON Schema and OpenAPI 3.1 Schema Objects)
  sets the base for relative $refs inside it. A relative $id stays in the
  package (an escaping one turns its relative refs into path-escape); an
  absolute remote $id makes them remote, reported and never fetched. A ref
  to a resource the same file identifies resolves to that subschema.
- $ref in data: references are read only in reference positions, so a
  $ref or $id inside const, enum, default, example(s), an Example Object
  value or a Swagger 2.0 response examples map is data.
- The release addon-catalog.json carries each artifact's documents (path
  and media type only, bounded, never contents), so
  get_release_addon_catalog lists them before installation.
- A duplicate provider is reported once, by the list of the set-aside
  package's kind, instead of by both extensions and artifacts list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant