Skip to content

Inspect pinned inert documents offline (#844) - #856

Merged
jimhoyd merged 1 commit into
mainfrom
claude/inspect-inert-documents
Sep 28, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
claude/inspect-inert-documents

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Delivers #844 operation 1, "inspect pinned inert documents", following #853, which added independent provider packages.

What changes

  • Artifact descriptors list their documents.
    • Format: documents: [{path, mediaType}], at most 32.
    • Media types are a closed set: OpenAPI YAML/JSON, JSON Schema, Markdown, JSON, YAML.
    • Paths must be relative, with no .. or hidden segments.
    • Extension descriptors may not carry documents.
    • store-schema lists its schema, its example and its README.
  • General inert-file rule. The fixed artifact layout is replaced by one rule: package.json, root notices, and JSON/YAML/Markdown under plain paths. JSON must parse, and YAML must parse under the runtime profile, which refuses anchors, aliases and tags. package-audit uses the same rule.
  • Independent artifact packages.
    • urlcode artifacts add <spec|tarball> installs with --ignore-scripts --save-exact.
    • The lock entry must declare no dependencies or install script.
    • list and remove handle these packages, and get_extension_artifacts finds artifacts by descriptor.
    • When the lock resolves to a local tarball, the tarball is re-hashed against the lock sha512. list --strict and inspect refuse a stale or missing tarball.
  • urlcode artifacts inspect <name> [--json] [--strict] and the MCP tool inspect_extension_artifact share one core function, inspectInstalledArtifact. A test asserts the two return identical output.
    • It reads offline, from a pin-verified package only.
    • For each document it reports:
      • kind and version (OpenAPI version or $schema dialect)
      • sha256 and size
      • origin (package, version, integrity)
      • resolved local $refs (same-document pointers and relative files inside the package)
    • Diagnostics:
      • warnings: remote ref (listed, never fetched), plain-anchor ref, cycle
      • errors: unresolved ref, path escape, symlink, invalid document, limit
    • It never imports code, runs scripts, fetches anything or creates grants. Content is labelled as untrusted data, and parse errors never echo document text.
    • Limits: 1 MiB per file, 64 files, 8 MiB total, 1024 refs, reference depth 32, nesting 256.
  • Docs:
    • EXTENSIONS: artifact documents, independent artifact packages, and inspection.
    • TOOLING: read tools go from 29 to 30.
    • AI-AUTHORING, llms and the skills are updated.
    • RUNTIME-IMPLEMENTATION gets a new RIM-ARTIFACT-INSPECT-001 card, and the stale "only install catalog" wording in RIM-ADDON-001 is fixed.

Evidence (macOS, Node 26)

  • npm run verify on the branch rebased onto main passes: 1107 root tests, every workspace suite, test:addons 6/6 and test:proof 12/12.
  • npm run test:package passes. Core packs to about 869 KB, within its budget.
  • New test/artifact-inspect.test.ts (11 tests) with the @example/urlcode-petstore-docs fixture: an OpenAPI 3.1 YAML with a file $ref to a JSON Schema, plus a standalone schema.
  • The packed-consumer test covers:
    • a tarball with lifecycle scripts is refused and its marker never appears
    • the real tarball installs, and list --strict and inspect --strict pass
    • digests match the installed files
    • a swapped tarball is refused

Not in this PR

The gaps found along the way are filed as follow-up issues.

🤖 Generated with Claude Code

Artifact descriptors list the standard documents they ship (OpenAPI, JSON
Schema, Markdown, JSON, YAML). `urlcode artifacts inspect` and the MCP
`inspect_extension_artifact` tool share one core function that reads them
offline from a pin-verified package: kind and version, sha256, size, origin,
resolved local $refs, and bounded diagnostics for remote refs (never fetched),
cycles, escapes and limits. Independent artifact packages install by spec or
tarball like independent extensions; a local tarball is re-hashed against the
lock. The fixed artifact file layout becomes a general inert-file rule.

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