Add content-hash plugin asset URL segments #226
Labels
No labels
abandoned
active
audit
blocked
data-safety
difficulty:easy
difficulty:hard
difficulty:high
difficulty:medium
docs
done
duplicate
notebook-v0
open
priority:high
ready
release-critical
safe-mode
spec
spec-backlog
subsystem:api
subsystem:backlog
subsystem:bases
subsystem:ci
subsystem:command
subsystem:configuration
subsystem:consolidate
subsystem:dependencies
subsystem:desktop-electron
subsystem:diffmerge
subsystem:docker
subsystem:docs
subsystem:fuzzy
subsystem:graph
subsystem:hotkeys
subsystem:lapis
subsystem:maint
subsystem:maintenance
subsystem:markdown
subsystem:markdown-lint
subsystem:md018
subsystem:notebook
subsystem:notifications
subsystem:opfs
subsystem:package
subsystem:plugin-markdown
subsystem:plugin-tasks
subsystem:plugins
subsystem:registry
subsystem:release
subsystem:renovate
subsystem:restore
subsystem:scripts
subsystem:search
subsystem:settings
subsystem:spec
subsystem:tasks
subsystem:testing
subsystem:ui
subsystem:web
subsystem:workspace
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lapis-notes/lapis#226
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The original dual ESM/CJS loader plan and the current plugin runtime spec require
renderer ESM asset URLs to include both the installed plugin version and a
verified content hash. The implemented asset URL helpers currently encode only
the vault id, plugin id, version, and asset path, so browser/Electron asset URLs
do not provide the hash-based cache-busting and integrity signal described by
the milestone.
Goal
Make plugin asset URL generation and resolution comply with the planned
/<version-or-content-hash>/...behavior and the current runtime spec'sversion-plus-hash URL contract.
Scope
renderer ESM chunks and related plugin assets.
bundle asset hash, or another manifest-backed hash, then document that exact
source of truth.
silently serve the wrong asset.
Non-goals
needed for asset URL validation.
module semantics.
Acceptance Criteria
path, and the API asset server validates that segment before serving content.
lapis-plugin://URLs include the same cache-busting/integritysegment and reject malformed, missing, or mismatched hashes consistently with
the web asset server.
successfully in browser and desktop contexts.
mismatched-hash rejection path for web and Electron URL helpers.
URL contract.
Implementation Notes
packages/api/src/lib/plugin-asset-server.ts,packages/web/src/plugin-asset-server.ts, and any desktop protocol adapterbefore choosing the hash source.
packages/api/src/lib/__tests__/plugin-asset-server.test.tsandpackages/web/src/plugin-asset-server.test.ts.and asset paths.
Suggested Files or Specs To Inspect
spec/src/30-cross-package-contracts/plugin-runtime.mdpackages/api/src/lib/plugin-asset-server.tspackages/web/src/plugin-asset-server.tspackages/api/src/lib/__tests__/plugin-asset-server.test.tspackages/web/src/plugin-asset-server.test.tsfrom the API helper
Validation Commands
pnpm --filter @lapis-notes/api exec vitest run src/lib/__tests__/plugin-asset-server.test.tspnpm --filter @lapis-notes/web exec vitest run src/plugin-asset-server.test.tspnpm --filter @lapis-notes/api check:allpnpm --filter @lapis-notes/web check:allmake spec-lintmdbook build specRelated Issues
Follow-up Tasks
Implementation Summary
Added content-hash segments to web and Electron plugin asset URLs, validated URL hashes against installed asset metadata before serving, updated host integrations, tests, and specs.