- Add missing ALTER TABLE migration for sessionVersion column; fresh
self-hosted installs were failing with "column users.sessionVersion
does not exist" because the column was in schema.prisma but had no
migration file, so prisma migrate deploy never created it
- loginAction now catches all errors instead of re-throwing non-AuthError
exceptions, preventing raw server errors reaching the client
- LoginForm wraps loginAction in try/catch so the loading state always
resets and an error message is shown even on unexpected server failures
(previously the button froze on "Signing in..." with no feedback)
Adds scripts/ci-plugin-smoke/smoke.mjs — a Node.js smoke test that loads
a plugin bundle and validates its WorldPlugin contract without a browser,
network, or Docker image.
Tier 2: verifies the bundle loads and the default export has all required
fields (id, name, description, category, version) and methods (initialize,
destroy, fetch, getPollingInterval, getLayerConfig, renderEntity).
Tier 3: calls the pure synchronous methods — getLayerConfig(), renderEntity(),
getPollingInterval() — and validates their return shapes. Also exercises
mapWebsocketPayload() when present, checking it returns a GeoEntity[].
Bundles expose externals via globalThis.__WWV_HOST__ (per wwvPluginGlobals()
Vite plugin), so no Node.js module hooks are needed — the mock host is set
up in a single assignment before import().
wwv-lib-aviation and wwv-lib-incidents declared the SDK peer dep as
"^1.4.10" (registry version), causing pnpm to install 1.5.0 nested
inside each lib's node_modules. TypeScript resolved PluginContext from
the nested 1.5.0 (which lacked getEngineUrl), not the workspace version,
breaking CI type-checks for aviation and conflict-events plugins.
Also includes docs: add property tag helper examples to local-plugins/README.md.
* fix(libs): add repository field so npm provenance validates on publish
Publishing wwv-lib-incidents/aviation with --provenance failed E422: the
sigstore bundle requires package.json repository.url to match the building repo,
and these two libs had none. Added the same repository block the SDK already
uses (which published fine). The SDK (1.7.1) is already live; this unblocks the
two libs.
* fix(sdk): export dtProp, urlProp, imageProp, videoProp from virtual module
The wwvPluginGlobals virtual module for @worldwideview/wwv-plugin-sdk only
destructured the original four exports (WorldPlugin, PluginManifest,
createSvgIconUrl, DEFAULT_ICON_SIZE). Plugins importing the newer prop
utility helpers (dtProp, urlProp, imageProp, videoProp) got a Rolldown
[MISSING_EXPORT] error at build time, failing CI for civil-unrest,
cyber-attacks, earthquakes, wildfire, and iranwarlive.
All four helpers are already present on globalThis.__WWV_HOST__.WWVPluginSDK
(the host does import * as WWVPluginSDK) so no host changes are needed.
Publishing wwv-lib-incidents/aviation with --provenance failed E422: the
sigstore bundle requires package.json repository.url to match the building repo,
and these two libs had none. Added the same repository block the SDK already
uses (which published fine). The SDK (1.7.1) is already live; this unblocks the
two libs.
npm parsed the bare path 'packages/wwv-plugin-sdk' as a GitHub <user>/<repo>
shorthand and tried 'git ls-remote github.com/packages/wwv-plugin-sdk' instead
of publishing the local folder (exit 128). Verified via npm publish --dry-run:
bare path reproduces the git error; ./packages/... packs and publishes.
* ci: auto-publish SDK/libs on version bump; retire stale plugin publisher
Adds publish-packages.yml which triggers on merge to main and uses OIDC
trusted publishing (no npm token) to publish all three monorepo packages.
Each step checks npm for the exact local version first and skips if already
published, making the workflow idempotent on re-runs.
wwv-lib-incidents and wwv-lib-aviation are source-only packages (no build
script) so their publish steps skip the build phase. wwv-plugin-sdk has a
tsc build and is compiled before publishing.
Removes publish-plugin.yml: it targeted packages/<plugin> paths that no
longer exist (community plugins moved to local-plugins/), and it used npm
workspace flags that are incompatible with this pnpm monorepo.
* ci: harden publish-packages workflow per review
- scope id-token:write to the job (least privilege, per the .github rule)
- add concurrency guard so fast-follow merges can't race to publish (npm 403)
- --silent on npm view to keep version-equality check immune to stdout notices
(kept equality semantics, not exit-code, so an unpublished new version of an
existing package still publishes correctly)
- pnpm/action-setup@v6 (repo's dominant pin) reading packageManager
- comment: npm publish is intentional for OIDC; switch to pnpm publish only if a
workspace:* dep is ever added. Kept actions @v6 (verified valid + in use repo-wide).
* ci: use single org NPM_TOKEN for publish auth (keep provenance)
Switch from per-package OIDC trusted publishing to a single org-level NPM_TOKEN
secret scoped to @worldwideview/*, so no per-package setup is needed across the
~36 packages (libs + plugins). Keep id-token:write + --provenance for signed
build attestation (works with token auth, needs no per-package config).
* docs(rules): add seeder authoring contract to data-engine-architecture rule
Adds section 8 documenting how to write a seeder: the auto-discovery model,
the three module shapes (interval+fetch, cron+fn, init), the { redis }-only
ctx, and publishing via @worldwideview/seeder-sdk. Includes good/bad examples
contrasting the ctx.setLiveSnapshot trap (which caused a silent CI failure)
against the two correct shapes. This rule auto-loads on local-seeders/** edits.
* docs(rules): add close-context-gaps AI meta-directive to AGENTS.md
When missing/wrong/undocumented context causes an error, a long struggle, or
slow understanding, agents must fix the doc/context (or add a guardrail) at its
source, or ask the user to; in autonomous mode, log the gap to revisit. Codifies
the lesson from the seeder ctx.setLiveSnapshot incident for all contributors.
Companion to wwv-data-engine fix/ci-stub-interval-fetch. The source-of-truth
stub (docker/ci/stub-seeder) used cron+fn and called ctx.setLiveSnapshot,
which the seeder ctx ({ redis }) does not expose — the snapshot never landed.
Switch to interval+fetch (return the array; scheduler auto-wraps + stores it).
Also remove the plugin-CI compose's ./stub-seeder volume mount and the stale
'Known foundation gap (deferred)' comment: the stub is now baked into the :ci
image at /app/seeders/stub, so the compose needs no host path and a consumer
repo can run it with only this YAML.
* feat: CI smoke-test foundation (probe + docker compose + rule updates)
Phase 1 of multi-repo CI initiative for catching plugin/seeder integration
failures (ADR-0002 id drift, missing mapWebsocketPayload, namespace
collisions, BOM in package.json) that current CI misses.
- packages/wwv-ci-probe: shared CLI with `seeder`, `ws`, `id-contract`
subcommands. README documents why no `plugin` subcommand (Playwright belongs
in wwv-plugins, not coupled to this probe). `files` + `prepublishOnly`
configured for clean npm publish.
- docker/ci/: reusable docker-compose stacks for plugin-CI and seeder-CI,
plus mock-upstream HTTP fixture server and CI-only stub-seeder. Compose
comments document scope boundary (consumer workflow owns user/plugin-row
injection via Playwright globalSetup pattern) and the deferred stub-seeder
bake-in for wwv-data-engine.
- .github/workflows/docker-publish.yml: adds `:ci` tag alias for downstream
consumers (one-line edit).
- .agents/rules/*: rename worldwideview-plugins → wwv-plugins (4 files) to
reflect repo rename + clarify it lives at local-plugins/ as its own git
working tree.
Bump 2.15.16 → 2.16.0 (Minor — new ci-probe package + new docker/ci
infrastructure are net-new features for the CI ecosystem).
Foundation has NOT been booted end-to-end yet — ghcr.io/silvertakana/
worldwideview:ci doesn't exist until this lands on main and the workflow
publishes. Next session: validate via real compose-up, then mirror the :ci
tag in wwv-data-engine repo and wire consumer workflows in wwv-plugins.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
* refactor(ci-probe): extract shared payload-shape validator with contract tests
* fix(ci): add /__health route to mock-upstream and gate engine on service_healthy
* chore: bump version to 2.48.18 for CI foundation landing
* chore: bump to 2.48.19 and reconcile lockfile after merging main (validateManifest fix)
---------
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
- ts-ignore/ts-nocheck detector now only flags real suppression directives
(token immediately after the // or /* comment opener), not prose mentions
- outdated-dep detector now parses pnpm's Unicode box-drawing table, skipping
header/separator rows; surfaces real outdated deps instead of one garbage row
Guard the resize pointermove handler with an isDraggingRef flag instead of
hasPointerCapture(), which behaves inconsistently across webkit versions in
CI for repeated drag sequences. setPointerCapture still delivers move/up
events when the pointer leaves the handle bounds.
Salvaged from the retired feat/phase-2-auth-gate branch (orig d91cc429); the
setPointerCapture work it built on is already on main.
- User.sessionVersion + jwt-callback revalidation rejects deleted-user,
cross-database, and stale-version tokens (fixes cross-worktree stay-logged-in)
- POST /api/auth/revoke ("sign out everywhere") bumps sessionVersion
- proxy: deny-by-default /api with public allowlist + CORS preflight passthrough;
anchored static-asset allowlist closes the path.includes(".") bypass
- harden session cookie options (httpOnly/sameSite/secure) and cut maxAge to 7 days
- unify https/secure-context detection in isHttpsDeployment() so the cookie
writer (auth) and edge reader (proxy) never disagree on the __Secure- prefix
- augment next-auth User/Session/JWT types
Verified: 1009/1009 tests, build exit 0, live HTTP reproduction of all gates.
A 'pnpm install --lockfile-only' re-resolved local-plugins/wwv-plugin-nz-traffic-cameras
back to the vulnerable [email protected] (GHSA-5xrq-8626-4rwp), undoing #219's pin and
failing the Dependency Audit. Pin it durably via a pnpm override so any future
regen stays clean (closes the recurrence behind #97).
Verified: [email protected] gone from lockfile, frozen-lockfile exit 0,
pnpm audit --audit-level high exit 0 (7 moderate, 0 high/critical).
The main merge resolved package.json with --ours, dropping the two
workspace deps that main's #220 (per-plugin bundling) added. Restore them
and regenerate the lockfile so 'pnpm install --frozen-lockfile' (CI) passes.
Verified: frozen-lockfile install exits 0.
The quickstart was cloud-only: it told self-hosters MCP is a 'cloud-edition
feature', pointed them at worldmonitor.app, and used the cloud endpoint -
actively wrong for the local edition that actually ships MCP today.
- lead with the local self-host flow: pnpm install/setup/dev(:all) -> sign in
at localhost:3000 -> generate key -> paste localhost:3000/api/mcp -> open tab
- document pnpm dev vs pnpm dev:all (Redis + engine needed for command tools,
geocoding, and live data); clarify which tools need which
- add update_favorite + fly_to to the tier tables; localhost-ize troubleshooting
- preserve cloud guidance under 'Cloud edition (coming soon)' for the future
hosted launch (not deleted)
The migration history only contained 20260509061229_init (6 tables), but
schema.prisma declares UserApiKey (user_api_keys) and MarketplaceCredential
(marketplace_credentials). Those tables existed only via the dev-only
'prisma db push' hook, so a fresh production 'prisma migrate deploy' built a
DB missing user_api_keys -> all MCP API-key auth threw 'relation does not
exist' (DOA in production).
- add 20260510000000_add_marketplace_credentials_and_api_keys (slots between
init and add_favorite_notes); columns/constraints/indexes/FK mirror schema
- track the previously-untracked 20260531214034_add_favorite_notes migration
Verified: 'migrate deploy' on a fresh DB yields all 8 tables, zero drift
(prisma migrate diff: No difference detected). Dev DB baselined via
'migrate resolve --applied'; prisma validate + generate + tsc clean.
Phase 35 of v1.5 MCP Public-Launch Hardening (DEPLOY-01..04):
- DEPLOY-01: production and cloud compose now provision a co-located Redis
(password-protected via REDIS_PASSWORD, internal-only) and wire REDIS_URL,
so sessions, command queue, geocode cache, and rate limiters work in prod.
- DEPLOY-02: set WWV_DATA_ENGINE_URL to the engine REST base (not the
NEXT_PUBLIC_.../stream WS URL) so MCP data tools reach /manifest.
- DEPLOY-03: a single global 1 req/s Nominatim throttle (peek/commit sliding
window with a queued-waiter cap and an in-process fallback) protects the
shared geocoder; the 24h cache is checked before the throttle.
- DEPLOY-04: deploy/INFRA-CHECKLIST.md documents the operator actions
(managed Redis rediss://, WWV_DATA_ENGINE_URL, distinct API_KEY_HMAC_SECRET,
AUTH_SECRET, WWV_TRUSTED_IP_HEADER for multi-proxy, health semantics).
Security hardening from review: require AUTH_SECRET (no weak committed
fallback), password the co-located Redis, bind cloud Postgres to loopback,
de-duplicate the geocode result normaliser. Patch.
Phase 34 of v1.5 MCP Public-Launch Hardening (OBS-01):
- /api/health now probes Redis (ping), the database (SELECT 1), the data
engine (manifest reachable), and HMAC config in parallel with 2s timeouts,
returning {status, checks, edition, timestamp}.
- HTTP 503 when the DB is down or the HMAC secret is misconfigured
(cloud/demo); HTTP 200 'degraded' when Redis or the engine is down so a
serving-but-degraded container is not killed.
- Extract isSigningKeyValid() (src/lib/signingKeyConfig.ts) as the single
source of truth for the SEC-01 rule, reused by getSigningKey and the health
config probe (closes the Phase 32 deferred 'surface misconfig at deploy').
- Add ping() to the RedisClient interface; reuse getEngineUrl() so the probe
and data layer resolve the same engine URL.
Patch: turns the always-healthy stub into real dependency observability.
Phase 33 of v1.5 MCP Public-Launch Hardening (TOOL-01..05):
- TOOL-01: data-query tools never report no_session_active; they return
the true reason (no_data_matches / engine_unreachable / no_active_plugins).
Verified live: an empty region query with no browser session now returns
no_data_matches.
- TOOL-02: toggle_layer / set_filter validate the id against the live plugin
set and warn instead of returning success for an unrecognized id;
focus_entity resolves entityId+pluginId to coordinates server-side and
returns an honest error when it cannot.
- TOOL-03: get_entities_in_region returns count + truncated + totalMatched and
tightens radiusKmToBbox (cos(lat), clamped to a full-globe span).
- TOOL-04: investigate_area and get_plugin_data cap output (200) with a
truncated flag so a single response cannot blow client context.
- TOOL-05: MCP_SERVER_INSTRUCTIONS match the real response shapes;
list_available_plugins distinguishes engine_unreachable from
no_active_plugins and surfaces local sources distinctly.
Patch: corrects misleading tool behavior, no API removal.
Phase 32 of v1.5 MCP Public-Launch Hardening (SEC-01..04):
- SEC-01: require a dedicated API_KEY_HMAC_SECRET in cloud/demo editions;
getSigningKey fails closed if it is unset or equal to AUTH_SECRET.
Local dev keeps the AUTH_SECRET fallback.
- SEC-02: Redis-backed per-key sliding-window rate limit (120/60s) applied
after auth, returns JSON-RPC -32000 / HTTP 429, fails open on Redis outage
behind the existing per-IP pre-auth gate.
- SEC-03: derive client IP from the trusted-proxy (rightmost X-Forwarded-For)
hop with an optional WWV_TRUSTED_IP_HEADER override, defeating spoofing.
- SEC-04: length + charset bounds on entityId/pluginId/layerId/name/notes
(shared identifierSchemas) and in isValidGlobeCommand; favorites capped at
500 per user.
Consolidates id schemas, extracts MCP response helpers, accurate Retry-After,
unique sliding-window members. Minor semver bump: adds new guardrails.
Phase 31 of v1.5 MCP Public-Launch Hardening (TRANS-01..04):
- Wrap the MCP route handler in a top-level try/catch returning a
well-formed JSON-RPC -32603 (id:null, 500) instead of bare HTTP 500s
when auth/Redis/transport throws.
- authenticateApiKey now returns null (clean 401) on a DB outage instead
of rejecting; logs only the error class name (no connection strings).
- Add explicit maxDuration=30 on the MCP route, above the 10s relay blpop.
- Stop advertising tools.listChanged (stateless server cannot push);
document the re-call tools/list contract in server instructions.
Sanitize the catch-all log so a Redis/Prisma error message cannot leak
credentials to server logs. Patch: behavior-hardening, no API change.
The toggle_layer MCP command only flipped the Zustand UI switch via the
command bridge and never started the plugin data lifecycle, so an
agent-enabled layer showed as toggled but rendered no data.
Extract the shared setLayerActive() helper (src/core/plugins/layerActivation.ts)
that drives pluginManager.enablePlugin/disablePlugin plus store state, and
route both the UI click (LayerPanel) and the agent command bridge
(useGlobeCommandBridge) through it so agent toggles trigger the identical
data fetch/stream path. Verified live: an MCP toggle_layer(camera) loads
2,376 camera entities with no browser interaction.
Patch: behavior fix, no API change.
- service.ts: getEngineUrl() now reads WWV_DATA_ENGINE_URL (server-side HTTP URL)
instead of NEXT_PUBLIC_WWV_PLUGIN_DATA_ENGINE_URL (a wss:// WebSocket URL).
Fallback changed from localhost:5000 to localhost:5001 (data engine dev port).
This unblocks all MCP data-query tools from reaching the data engine locally.
- tools.ts: get_entity_details empty path no longer calls toolError(JSON.stringify(...))
which double-encoded emptyReason inside an error string. Now returns the standard
success envelope { success: true, data: null, emptyReason } matching search_entities
and get_entities_in_region contracts (Phase 28 emptyReason discrimination).
- Register update_favorite(favoriteId, {name?, notes?}) tool keyed on (userId, entityId)
- Partial updates: name-only changes label, notes-only changes notes, both changes both
- Neither field supplied returns 'nothing to update' without DB write
- P2025 not-found returns 'update_favorite: favorite not found'
- list_favorites description updated to document notes field in output shape
- userId scoped via ctx only (SAFE-02 pattern, T-28-06 mitigated)
- Add notes String? field to Favorite model in prisma/schema.prisma
- Applied to live DB via prisma db push (schema drift from prior db push workflow)
- Regenerated Prisma client (v7.8.0)
- Cover plugin_not_streaming when snapshot null
- Cover no_data_matches when streaming but zero matches
- Cover no_session_active session-first precedence overriding plugin reason
- Cover non-empty result has no emptyReason key in envelope
- Add EmptyReason union type and QueryResult/SingleResult generics to types.ts
- Refactor searchEntities/getEntitiesInRegion to return QueryResult with plugin_not_streaming vs no_data_matches
- Refactor getEntityDetails/getPluginData to return SingleResult discriminating null causes
- Add registerDataQueryTools(server, { userId }) signature; thread resolveActiveSessionId for no_session_active precedence
- Pass emptyReason through all four MCP tool response envelopes (only on empty results)
- Wire registerDataQueryTools with userId in route.ts registration seam
- Update all callers (REST routes, favoritesTools) and fix existing tests for new return shapes
- geocode_location/fly_to/save_favorite/list_favorites/remove_favorite/set_filter/clear_filter/get_plugin_filters now document inputs, output shape, and a usage example
- bump 2.46.1 -> 2.46.2
- Drop trailing export { readSessionCatalog } from catalog/route.ts (Next.js App Router rejects non-route-handler exports -> TS2344 in generated route types)
- Trim now-unused readSessionCatalog import (only existed to support the re-export)
- All consumers already import readSessionCatalog from @/lib/mcpSessionCatalog
- Bump 2.45.0 -> 2.45.1
- collectCatalog gathers getFilterDefinitions() from each loaded plugin (D-05)
- filter-only plugins now publish (early-return guards on tools AND filterDefinitions empty)
- catalog route validates and forwards optional filterDefinitions, identity still from auth only
- gives get_plugin_filters a data source
- searchEntities applies filters on full GeoEntity.properties via matchFilterValue before SearchResult conversion (D-07/D-08)
- limit counts only matching entities; missing property key fails filter
- search_entities MCP tool exposes optional filters inputSchema via filterValueSchema
- SearchOptions type gains optional filters field
- 4 new filters tests GREEN, no regression