* chore(merge): resolve conflicts, fix mockWs error, and apply refactor standards
* Potential fix for pull request finding 'CodeQL / Incomplete URL substring sanitization'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Potential fix for pull request finding 'CodeQL / Incomplete URL substring sanitization'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Potential fix for pull request finding 'CodeQL / Incomplete URL substring sanitization'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* fix(ci): Stabilize github actions and resolve test failures
- fix(tests): update WsClient mock to use standard function for Vitest constructor compatibility
- fix(db): correct PrismaClient import path to use generated output directory
- fix(e2e): add predev database boot step to playwright CI workflow
- chore: sync pnpm-lock.yaml after merge conflict resolution
* refactor(plugins): decouple GeoJSON plugin and implement data bus lifecycle
- feat(sdk): [Minor] Added dynamicPluginCreate, dynamicPluginRemove, and pluginUnregistered to DataBusEvents.
- feat(core): [Minor] Implemented unregisterPlugin in PluginManager.ts for automated IndexedDB caching cleanup and polling teardown.
- feat(core): [Minor] Added removeLayer to layersSlice.ts to support safe removal of plugin states.
- refactor(plugins): [Patch] Refactored useGeoJsonImport.ts and ImportedLayerList.tsx to decouple from direct manager imports, utilizing DataBus for lifecycle events.
- refactor(core): [Patch] Added pluginUnregistered listener to DataBusSubscriber.tsx to handle state and cache cleanup synchronously via event.
* fix(types): resolve PluginManager type errors
* refactor(core): decouple PluginManager and fix rendering invariants
- refactor(core): Replace Zustand mutations in PluginManager with DataBus events (Patch)
- refactor(sdk): Add layerLoadingChanged, pluginError, pluginUnregistered to DataBusEvents (Patch)
- refactor(ui): Subscribe to new DataBus events in DataBusSubscriber (Patch)
- fix(plugins): Remove size from BaseAviationPlugin to fix model rendering clipping (Patch)
- fix(plugins): Migrate BaseIncidentPlugin from size to iconScale to fix billboard clipping (Patch)
* chore: resolve lockfile conflict
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* feat(testing): add Playwright E2E infrastructure and stabilize test suite
- Add Playwright E2E configuration and ui-navigation / plugin-system tests
- Add GitHub Actions workflow for Playwright CI tests
- Add test helpers and fixtures (e2e-mock-plugin)
- fix(testing): resolve UnverifiedPluginBatchDialog UI blocking issue in E2E tests
- fix(testing): limit Playwright to 2 workers locally to avoid Next.js/Prisma exhaustion
- fix(api): replace deprecated processAuthCodeResponse with authorizationCodeGrant
- test(ui): add data-testid to PanelToggleArrows and AppShell
* Potential fix for pull request finding 'CodeQL / Workflow does not contain permissions'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* fix(ci): restrict GITHUB_TOKEN permissions to read contents
* docs(e2e): document Playwright infrastructure and mock plugin lifecycle
* fix(e2e): explicitly load .env in teardown and fix dev command pathing
* fix(ci): resolve playwright environment setup and database initialization
Changes:
- Patch: Added pnpm run setup step to .github/workflows/playwright.yml to generate .env in CI
- Patch: Added explicit loadEnv() helper to ests/global.setup.ts and ests/global.teardown.ts to ensure database credentials are fresh
- Patch: Hardened scripts/safe-db-push.mjs to detect missing DATABASE_URL and explicitly prompt for pnpm run setup rather than assuming production
- Patch: Updated scripts/dev.mjs to execute pnpm exec next dev instead of raw
ext dev to resolve pathing issues
- Patch: Bumped version in package.json to 2.14.4
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* feat(dx): implement worktree DB orchestration and graceful dev teardown
- feat(dx): [Minor] Implement deterministic port binding per git worktree
to mitigate Docker port conflicts during parallel development.
- feat(dx): [Minor] Implement graceful development environment teardown
using a custom node orchestrator (scripts/dev.mjs) replacing CLI concurrently,
enabling cross-platform tree-kill and optional DB stopping on exit.
- build(deps): Add tree-kill for process termination.
- fix(dx): Prevent rm -rf from orphaning Docker volumes by adding
a db:prune script and tying volume cleanup to git-wt remove.
* fix: update openid-client api usage to v6 and resolve db import
- Migrated processAuthCodeResponse to authorizationCodeGrant
- Updated db import to export prisma client correctly
- Updated unit tests with v6 openid-client mocks
- Bumped version to 2.13.1
* fix(ci): setup .env from example in local dev CI test
* refactor(docker): separate self-host Docker compose structure from development
test(ci): add github action to verify self-host scripts
* Potential fix for pull request finding 'CodeQL / Workflow does not contain permissions'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Previously the workflow only ran on `pull_request: branches: [main]`,
so any direct push to `main` (or any other branch) bypassed CI entirely.
Changes:
- Add `push: branches: [main]` to the trigger list so main-branch pushes
also run typecheck / test / build / audit.
- Add a new `audit` job that runs `pnpm audit --audit-level high` and
surfaces high/critical advisories in the CI output.
The audit job is intentionally non-blocking (`continue-on-error: true`)
on first introduction: the lockfile currently has 2 high + 1 critical
transitive advisories (sentry-webpack-plugin → webpack → schema-utils →
ajv → fast-uri chain) that need to be addressed before audit can become
a hard gate. A comment in the workflow notes that the flag should be
flipped to `false` once those are resolved.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Consolidates four overlapping test-infra PRs (#113, #114, #117, #118)
into a single coherent batch. Each contributing PR has redundancies
with one or more of the others; together they ship a real ~134-test
expansion of the unit suite plus mutation-testing infrastructure.
Same shape as #110 / #111: small, focused, behavior-pinning tests
against load-bearing systems. Each test answers one question — *what
specific regression does it catch that I'd otherwise find from a user
bug report?* Tests pin observable contracts (events emitted, cache
entries written, public-API state) rather than internal mechanics, so
they survive refactors during the longer-term migration toward the
six-interface architecture.
## What's in this PR
### Stryker mutation testing (new in this batch)
- `stryker.config.json` — hybrid config: `coverageAnalysis: "perTest"`
for the 5–10× speedup on a real codebase, `ignoreStatic: true` to
drop false-positive mutants in module-load code, and a `mutate`
scope of `src/core/**` + `src/lib/**` covering the logic-heavy
layers without dragging the React component surface into noise.
- `.github/workflows/mutation-testing.yml` — runs Stryker on a weekly
schedule (Sundays 22:00 US Eastern / 03:00 UTC Monday) plus
`workflow_dispatch` for on-demand validation. Per-PR triggering
would be too expensive (10–30 min per run even with `perTest`).
- `package.json` — adds `@stryker-mutator/core`, `@stryker-mutator/vitest-runner`,
and `fast-check` as devDependencies. New `test:mutate` script.
### New test files (22 added)
Plugin lifecycle and loaders:
- `src/core/plugins/PluginManager.test.ts` — orchestrator lifecycle:
register, enable, disable, data-flow contract, getAllEntities
filters by enabled, updateTimeRange, destroy, togglePlugin,
loadFromManifest. 11 tests.
- `src/core/plugins/loadPluginFromManifest.test.ts`
- `src/core/plugins/validateManifest.test.ts`
- `src/core/plugins/loaders/mapGeoJsonToEntities.test.ts`
- `src/core/plugins/loaders/mapJsonToEntities.test.ts`
Data layer:
- `src/core/data/DataUtils.test.ts`
- `src/core/data/WsClient.test.ts`
State (9 Zustand slices + the integration tests):
- `src/core/state/StateSlices.test.ts`
- `src/core/state/configSlice.test.ts`
- `src/core/state/dataSlice.test.ts`
- `src/core/state/favoritesSlice.test.ts`
- `src/core/state/filterSlice.test.ts`
- `src/core/state/geojsonSlice.test.ts`
- `src/core/state/globeSlice.test.ts`
- `src/core/state/layersSlice.test.ts`
- `src/core/state/timelineSlice.test.ts`
- `src/core/state/uiSlice.test.ts`
Filters:
- `src/core/filters/filterEngine.test.ts`
Library:
- `src/lib/AuthConfig.test.ts`
- `src/lib/analytics.test.ts`
- `src/lib/origin.test.ts`
### Test files extended (9 modified)
Property-based and edge-case additions to existing tests, drawn from
the upstream PRs:
- `src/core/plugins/loaders/getNestedValue.test.ts` (+46 lines)
- `src/lib/geojson/converter.test.ts` (+31)
- `src/lib/geojson/normalizer.test.ts` (+52)
- `src/lib/rateLimit.test.ts` (+44)
- `src/core/plugins/loaders/DeclarativePlugin.test.ts` (+147 — type
fixes for `DataSourceConfig.method`/`pollInterval`/`format`)
- `src/lib/marketplace/cors.test.ts` (+5)
- `src/lib/marketplace/marketplaceToken.test.ts` (+21)
- `src/core/filters/filterEngine.test.ts` (type-corrected — uses
`latitude`/`longitude` not `position.lat`/`lon`, nested
`range: { min, max, step }` config, etc.)
## What's *not* in this PR (intentionally)
- **Duplicate tests for code already on main.** #113 originally
included `.spec.ts` versions of `CacheLayer`, `DataBus`,
`PollingManager`, `cors`, `marketplaceToken`, `repository`,
`rateLimit`, `edition`, and `seedDefaultPlugins` — all of which are
already tested via `.test.ts` files on main from #110 + prior. Vitest
picks up both `.test.ts` and `.spec.ts`, so keeping both would double
the maintenance burden without adding signal. Dropped.
- **Tautological tests.** A few accessors-only tests from #113
(`getEntities` returning the cached array, `getAllPlugins().length`
equals N) were dropped per the test-writing bar set on #110/#111:
each test must catch a specific bug class that two different broken
implementations would fail differently on.
- **`version` bump in `package.json`.** Three of the contributing PRs
bumped the version line independently (2.9.5, 2.9.10, 2.9.10), each
conflicting with the others. Reserve version bumps for explicit
release commits — feature/test PRs should leave the version field
alone to avoid this conflict hairball.
- **A duplicate `stryker.conf.json`.** #114 used that filename; #117
used `stryker.config.json`. Stryker accepts both but only loads one
(alphabetical resolution). Picked `stryker.config.json` as the
canonical name.
## Verification
```
Test Files 38 passed (38)
Tests 271 passed (271)
```
137 tests on main before this PR; +134 from this consolidation, no
regressions. Type check clean (`pnpm exec tsc --noEmit`).
## Replaces
- PR #113 (test/improve-coverage) — most of its 18 truly-new files
are included here; the 9 duplicate-of-main entries are not.
- PR #114 (chore/stryker-setup) — its CI workflow shape is here with
the trigger changed to weekly+manual instead of per-PR.
- PR #117 (chore/stryker-and-fast-check) — its full deps and test
additions are here.
- PR #118 (test/improve-project-coverage) — the type-corrected
versions of its 6 test files are here, including the typefix commit
pushed to that branch earlier.
Each of those PRs should be closed once this lands, with a comment
referencing this PR for credit.
Co-Authored-By: silvertakana <[email protected]>
Introduces a baseline ESLint configuration and wires it into CI.
Config:
- `eslint.config.mjs` (flat config, ESLint 9). Extends
`eslint-config-next/core-web-vitals` and `eslint-config-next/typescript`
directly — both ship as native flat-config arrays in `eslint-config-next` 16+.
- Ignores cover `.next`, `out`, `src/generated`, `public/cesium`,
`packages/*/dist`, plus the gitignored sandboxes (`local-scripts`,
`local-plugins`, `local-seeders`, `.agents`, `.claude`, `.worktrees`).
Rule policy:
- All rules that the Next.js preset surfaces as errors are demoted to
`warn` on first introduction, so the lint job is runnable against
the current codebase without blocking on pre-existing debt. The
demoted set (react-hooks/* in React 19's stricter purity suite,
no-unescaped-entities, ban-ts-comment, no-assign-module-variable,
prefer-const) plus the originally-flagged `no-explicit-any` and
`no-console` are all documented in the config with a recommended
promotion order.
- Current state: 0 errors, 564 warnings.
Scripts:
- `pnpm lint` runs `eslint .`.
CI:
- New `lint` job in `.github/workflows/ci.yml`, parallel to typecheck /
test / audit. Blocking on errors only — warnings are visible in the
job log but don't fail the build.
Same incremental-introduction pattern as the audit job (#97): land the
infrastructure now, tighten policy via follow-up PRs as the backlog is
worked down.
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: Silvertakana <[email protected]>
The `Build and push Docker image` step has `push: true` unconditionally,
but PRs from forks don't have write access to this org's GHCR namespace
(or to the GHA cache backing it). Every fork PR's CI run currently fails
with:
ERROR: failed to push ghcr.io/silvertakana/worldwideview:pr-NN:
denied: installation not allowed to Write organization package
This is the standard GitHub fork-security policy — without it any PR
opener could publish arbitrary tagged images to your registry. The
workflow's other concerns (verifying the Dockerfile compiles, exercising
build-time NEXT_PUBLIC_* arg plumbing, surfacing build failures) don't
require a push to do their job, so we just gate the push step.
Gate the push step on:
github.event_name != 'pull_request' # push to main / workflow_dispatch
|| pull_request.head.repo.full_name == github.repository # internal PR
Same gate on `cache-to` since GHA cache writes have the same permission
profile. Cache reads remain available to fork builds, so build times
benefit from your warm cache.
After this:
- push to main / dispatch: build + push as today
- PR from a branch inside this repo: build + push as today
- PR from a fork: build (verifies image), skip push (no 403)
Co-authored-by: Sapphire <sapphire@tiktokcoach>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
* feat(cloud): implement Postgres DB adapter, fix static build crashes, and containerize NextAuth/Stripe integrations
* test(marketplace): fix mocks and assertions for multi-tenant Postgres architecture
* feat: rsa jwt license key verification and state integration
* feat: add internal workspace validation route for Edge Functions
* refactor: clean up hub routes and finalize db proxy/adapter for multi-tenant cloud deploy
* feat(cloud): finalize multi-tenant Prisma extensions and workspace routing
* fix(db): correct Prisma 7 better-sqlite3 adapter initialization [Patch]
- update better-sqlite3 adapter instantiation to use configuration object ({ url }) required by Prisma 7 instead of raw Database instance [Patch]
- fix PrismaClientConstructorValidationError by generating client with adapter support [Patch]
* fix(auth): support dynamic origins for local proxies and multi-tenant subdomains [Patch]
- prioritize forwarded headers and request host over hardcoded envOrigin in getRequestOrigin to support subdomain routing [Patch]
- allow ALLOWED_DEV_ORIGIN in marketplace install redirect checks to fix local network development login flows [Patch]
* fix(marketplace): enable dynamic CORS reflection for marketplace API [Patch]
- remove explicit origin array, replacing with origin header reflection to allow marketplace hosted on any domain or local IP [Patch]
- remove global wildcard CORS headers from next.config.ts to harden security against broader app injection [Patch]
* feat(db): create initial postgresql migration
* refactor(db): update remaining files for postgresql
* feat(db): unify database adapter to PostgreSQL-only [Minor]
- replace SQLite adapter with PostgreSQL PrismaPg [Minor]
- remove better-sqlite3 dependencies [Patch]
- finalize docs and implementation plan [Patch]
* fix: resolve prisma client generation and script execution issues with tsx and type module
* feat(db): port tenant isolation logic to new PostgreSQL adapter
* docs: add rule for transparent and narrated agent actions
* BREAKING CHANGE(core): migrate to PostgreSQL and add auto-migration pipeline [Major]
- unified database adapter to exclusively use PostgreSQL [Major]
- implement auto-migration pipeline to pipe legacy SQLite data to Postgres [Major]
- add sqlite to runner stage to support extraction pipeline [Patch]
* feat(core): migrate to Prisma 7 and unify PostgreSQL architecture [Minor]
- removed legacy Prisma SQLite driver and all Better-Sqlite dependencies [Minor]
- updated schema to utilize purely postgresql providers [Patch]
- modified migration scripts to seamlessly convert local sqlite DBs to PostgreSQL containers using keinos/sqlite3 [Minor]
- updated deployment scripts, Coolify pipelines, and Nginx proxy support [Patch]
- injected Prisma Client Extensions for multi-tenant Row Level Security isolation [Minor]
- stabilized PrismaClient initialization utilizing the official adapter-pg runtime pattern [Patch]
- bumped version to 2.1.0
* fix(core): resolve TypeScript compilation errors for CI [Patch]
- fixed NextResponse.json() 3-arg calls to use 2-arg ResponseInit form [Patch]
- replaced invalid 'developer' TrustTier with 'unverified' in parseWwvManifest and load-unpacked route [Patch]
- removed non-existent pluginManager.hotReload() call in DevModeSubscriber, replaced with disable/reload cycle [Patch]
- updated Stripe API version from '2024-04-10' to '2026-04-22.dahlia' to match installed SDK [Patch]
- excluded local-scripts/ from tsconfig to prevent debug scripts from breaking CI [Patch]
* fix(ci): resolve pnpm version conflict in GitHub Actions [Patch]
- removed explicit version: 9 from pnpm/action-setup@v4 — v4 auto-reads packageManager from package.json [Patch]
- updated build job DATABASE_URL from SQLite to PostgreSQL format [Patch]
* fix(docker): add explicit Prisma generator output path for Docker builds [Patch]
- Prisma 7 changed default output location, causing COPY --from=builder to fail
- added output = '../src/generated/prisma' to generator block for consistency
* fix(prisma): update client import path and resolve CI type errors [Patch]
- updated PrismaClient import in db.ts to point to custom generated output path
- resolved implicit 'any' error in marketplace check-updates route
- verified clean local build with tsc --noEmit
* chore(deps): sync Prisma versions to 7.6.0 [Patch]
- add npx prisma generate to CI action before type checks [Patch]
- fix missing globSync import in workspace type tests [Patch]
- fix GlobeView undefined indexing for entity rendering [Patch]
- fix OSMSearchPlugin zoom property to flyToBaseDistance [Patch]
- allow getSidebarComponent to accept an optional plugin prop [Patch]
- map categories for embassies and spaceports [Patch]
Co-authored-by: Antigravity AI <[email protected]>