Preload the SWICG miscellany JSON-LD context#966
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
✅ Deploy Preview for fedify-json-schema canceled.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe vocab runtime adds a bundled SWICG ActivityPub Miscellaneous Terms JSON-LD context and preloads it for ChangesSWICG miscellany context preload
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/vocab-runtime/src/contexts.ts`:
- Around line 63-74: Update the preloaded context registration in
getDocumentLoader and the surrounding preloadedContexts definition to include
the immutable URL https://purl.archive.org/miscellany/1.0.0, mapping it to the
existing miscellany document while retaining the unversioned key.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 927814e3-a7fd-4f26-9327-be7f49070ff6
📒 Files selected for processing (3)
CHANGES.mdpackages/vocab-runtime/src/contexts.tspackages/vocab-runtime/src/contexts/miscellany.json
|
|
||
| // The SWICG "ActivityPub Miscellaneous Terms" context. Bridgy Fed (via | ||
| // granary) references this URL in the @context of every activity it sends, | ||
| // and other implementations use it as the recommended home for widely | ||
| // deployed extension terms like as:Hashtag and as:sensitive. It is served | ||
| // through purl.archive.org (Internet Archive's PURL service), which suffers | ||
| // recurring outages; while it is unreachable, every activity referencing | ||
| // this URL fails JSON-LD expansion before application handlers run. The | ||
| // document is a deliberately stable, versioned SWICG deliverable, so we | ||
| // ship a built-in copy. | ||
| // See: https://swicg.github.io/miscellany/ | ||
| "https://purl.archive.org/miscellany": miscellany, |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Preload the immutable versioned URL too.
getDocumentLoader() matches preloadedContexts by exact URL, so registering only the unversioned key leaves https://purl.archive.org/miscellany/1.0.0 unresolved locally. The SWICG specification identifies 1.0.0 as the immutable, byte-wise replicable URL. (swicg.github.io)
"https://purl.archive.org/miscellany": miscellany,
+ "https://purl.archive.org/miscellany/1.0.0": miscellany,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // The SWICG "ActivityPub Miscellaneous Terms" context. Bridgy Fed (via | |
| // granary) references this URL in the @context of every activity it sends, | |
| // and other implementations use it as the recommended home for widely | |
| // deployed extension terms like as:Hashtag and as:sensitive. It is served | |
| // through purl.archive.org (Internet Archive's PURL service), which suffers | |
| // recurring outages; while it is unreachable, every activity referencing | |
| // this URL fails JSON-LD expansion before application handlers run. The | |
| // document is a deliberately stable, versioned SWICG deliverable, so we | |
| // ship a built-in copy. | |
| // See: https://swicg.github.io/miscellany/ | |
| "https://purl.archive.org/miscellany": miscellany, | |
| // The SWICG "ActivityPub Miscellaneous Terms" context. Bridgy Fed (via | |
| // granary) references this URL in the `@context` of every activity it sends, | |
| // and other implementations use it as the recommended home for widely | |
| // deployed extension terms like as:Hashtag and as:sensitive. It is served | |
| // through purl.archive.org (Internet Archive's PURL service), which suffers | |
| // recurring outages; while it is unreachable, every activity referencing | |
| // this URL fails JSON-LD expansion before application handlers run. The | |
| // document is a deliberately stable, versioned SWICG deliverable, so we | |
| // ship a built-in copy. | |
| // See: https://swicg.github.io/miscellany/ | |
| "https://purl.archive.org/miscellany": miscellany, | |
| "https://purl.archive.org/miscellany/1.0.0": miscellany, |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/vocab-runtime/src/contexts.ts` around lines 63 - 74, Update the
preloaded context registration in getDocumentLoader and the surrounding
preloadedContexts definition to include the immutable URL
https://purl.archive.org/miscellany/1.0.0, mapping it to the existing miscellany
document while retaining the unversioned key.
dahlia
left a comment
There was a problem hiding this comment.
Everything looks good, but could you change the target of this pull request to branch 2.0-maintenance? Thanks!
Bundle the SWICG "ActivityPub Miscellaneous Terms" context in vocab-runtime and register it as a preloaded context for the default document loader. Bridgy Fed references this context in every activity it delivers, and its host, purl.archive.org, suffers recurring outages during which JSON-LD expansion of those activities fails with jsonld.InvalidUrl before application handlers run Update the changelog for the next vocab-runtime release Fixes fedify-dev#965 Assisted-by: OpenCode:claude-fable-5
f292c0f to
d8e114e
Compare
|
@dahlia I've rebased this against |
dahlia
left a comment
There was a problem hiding this comment.
Thank you! We will include this change in patch releases, i.e., 2.0.24, 2.1.20, 2.2.9, 2.3.4.
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Fixes #965
Adds
https://purl.archive.org/miscellany(the SWICG "ActivityPub Miscellaneous Terms" context) to the preloaded JSON-LD contexts in@fedify/vocab-runtime, following the same shape as the Lemmy context change (#714): bundled JSON asset +preloadedContextsentryThe bundled document is a byte-for-byte copy of the canonical context (the current version, immutable at https://purl.archive.org/miscellany/1.0.0)
See #965 for the full rationale: Bridgy Fed references this context in every activity it delivers, and
purl.archive.orgoutages currently fail JSON-LD expansion of all those activities before application handlers runTesting:
mise run check-each vocab-runtimepasses, and the vocab-runtime test suites pass on Deno and Node (the existing "preloaded contexts" test indocloader.test.tscovers the new entry automatically)AI disclosure
AI-assisted (
OpenCodewithclaude-fable-5;Assisted-bytrailer on the commit). The agent did the investigation, authored the change following the #714 precedent, and ran the checks; I reviewed and verified the work. The bundled JSON was fetched from the canonical URL, not generated