Commit Graph
18 Commits
Author SHA1 Message Date
Antigravity AI aeb3aaec95 chore: worktree .planning isolation tooling (per-worktree real dir model)
Update the worktree/planning tooling to the per-worktree isolated .planning model (replaces the dormant shared-.planning-branch model that could not isolate simultaneous sessions):

- worktree-bootstrap: new Step 5 creates a REAL isolated .planning (phases/debug/surveys + WORKSPACE.md/STATE.md/SHARED-DOCS.md + config.json), never a junction; Step 6 wires WWV_SHARED_PLANNING; rewrote the '.planning branch convention' section as '.planning Isolation (per-worktree)'; teardown now routes through /branch-cleanup.
- planning-sync.sh: repurposed from git-branch checkout to a non-destructive isolation CHECK that warns when a worktree's .planning is not isolated (no WORKSPACE.md). Deliberately does not auto-mutate the filesystem from a SessionStart hook.
- branch-cleanup: .planning is now a real isolated dir to ARCHIVE before removal (Phase 3e -> shared archive), not a junction to skip; updated classification + quick-ref; fixed pre-existing em dashes.
- .env.example: document WWV_SHARED_PLANNING (shared cross-feature docs pointer).

No app code touched; no semver bump (infra-only chore). Ecosystem C:/dev/wwv/CLAUDE.md updated separately (outside this repo).
2026-05-29 13:19:01 +12:00
b5f8c9ff32 feat(globe): add weather radar overlay with OpenWeatherMap tile proxy (#153)
* feat(globe): add weather radar overlay with OpenWeatherMap tile proxy

Adds a complete weather overlay system: server-side tile proxy that
hides the OWM API key, Cesium imagery layer integration at 60% opacity,
and a dropdown in Graphics settings to toggle between clouds,
precipitation, temperature, wind, and pressure layers.

Closes #10.

* fix(weather): address PR #153 review feedback

- Remove console.error from tile proxy catch block
- Validate tile x/y against zoom-level upper bound (2^z) and cap zoom at 18
- Fix useEffect race condition in weather overlay with cancelled flag
- Replace stale enableFxaa/msaaSamples in DEFAULT_GRAPHICS with antiAliasing
- Extract shared WEATHER_LAYERS constant into src/lib/weatherLayers.ts
- Normalize indentation in GraphicsSettings.tsx

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix(globe): consolidate weather overlay cleanup into return function

Remove eager top-of-body removal of weatherLayerRef that created a
double-removal pattern. The cleanup function already handled removal
via a local layer variable with a ref guard; the eager removal was
redundant and fragile under React 18 concurrent scheduling.

Also drop the unused cancelled flag (UrlTemplateImageryProvider is
synchronous, so the flag could never flip true inside the effect body).

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Antigravity AI <[email protected]>
2026-05-29 10:34:14 +12:00
Silvertakana 08308f2588 fix(gc): narrow mdc-ref detector to eliminate false positives (#199)
* feat(marketplace): pass from_instance origin when opening marketplace

BrowseLink in PluginsTab now appends ?from_instance=<origin> so the
marketplace can silently capture the instance URL into localStorage,
skipping the manual InstanceConfig modal for users arriving from the app.

* test(e2e): add marketplace instance auto-discovery E2E tests

- playwright.marketplace.config.ts: standalone config that starts only
  the marketplace on port 3002, no Docker/Postgres required
- tests/marketplace-from-instance.spec.ts: 4 marketplace-side tests
  (capture valid URL, reject javascript: protocol, reject self-origin,
  skip when no param) + 1 full-flow test (worldwideview -> marketplace,
  auto-skipped when running under marketplace-only config)
- NEXT_PUBLIC_MARKETPLACE_URL env var in BrowseLink lets tests point
  to localhost:3002 instead of the production marketplace
- data-testid="browse-plugins-btn" for stable Playwright selector
- playwright.config.ts updated with both webServers for full E2E

Run marketplace tests (no Docker): pnpm exec playwright test --config=playwright.marketplace.config.ts
Run full E2E (Docker required):    pnpm test:e2e

* feat: implement Phase 2 install auth gate (ADR-003 closeout)

Closes the three foundational auth gaps that blocked a proper install gate:

2A - SSR session persistence:
- Add @supabase/ssr; create src/lib/supabase/{cookieOptions,server,client}.ts
  mirroring the marketplace recipe so both repos issue the same cookie type
- Migrate login/actions.ts from @supabase/supabase-js to createServerClient
  (previously the Supabase session was discarded; no cookie was ever set)
- Fix getSafeRedirect to allow trusted subdomain callbacks via
  NEXT_PUBLIC_WWV_COOKIE_DOMAIN so marketplace ?callbackUrl= round-trips work
- Add NEXT_PUBLIC_WWV_COOKIE_DOMAIN and NEXT_PUBLIC_AUTH_HOST_URL to .env.example

2B - Signup route at auth host:
- Add /signup page and server action (supabase.auth.signUp with emailRedirectTo)
- Add /auth/callback route to handle Supabase PKCE email verification exchange
- Add "Sign up" link to login page preserving ?callbackUrl=

2C - Install auth gate:
- Swap NextAuth auth() for Supabase getSupabaseUser() in install-redirect route
  (local/demo edition still uses NextAuth)

2D - Sweep:
- httpOnly: true added to buildCookieOptions()
- cloud-auth-architecture.md superseded section collapsed to forward-pointer
- ADR-003 status updated to Accepted with implementation notes

* chore: exclude .planning from git (moved to private repo)

* chore(05-01): add Playwright config and E2E specs for worldwideview-web auth UI

- playwright.web.config.ts: targets https://wwv.local:3001 with ignoreHTTPSErrors
- tests/web-auth.spec.ts: 4 describe groups covering reset-password form, /accounts redirect, /auth/verify no-code error, /auth/reset-password/confirm no-hash timeout
- bump version 2.20.0 -> 2.20.1

* fix(gc): narrow mdc-ref detector to eliminate false positives

Pattern now requires a quoted string context (['\"].*\.mdc['\"]) and
only scans .ts/.tsx files, excluding scripts/. Prevents the scanner
from flagging its own source code and rule documentation that explain
the anti-pattern rather than violating it.
2026-05-28 11:27:21 +12:00
SilvertakanaandClaude Opus 4.7 26568429bc feat(auth): ADR-001 Workstream C — ticket auth, SSRF protection, and pre-flight audit (#171)
* feat(auth): implement ADR-001 Workstream C — ticket auth, SSRF, and pre-flight audit

C1: Boot-time ENCRYPTION_MASTER_KEY / AUTH_SECRET validation (instrumentation.ts);
    remove silent fallback in encryption.ts; guard marketplace token from data-plane misuse.
C2: SSRF host-allowlist (PROXY_HOST_ALLOWLIST) in ssrf.ts; route iframe proxy through safeFetch.
C3: ticketClient.ts — exchanges long-lived API key for 5-min EdDSA ticket from Marketplace;
    audience fixed to ENGINE_AUDIENCE='wwv-data-engine'; cache keyed by engine not plugin.
C4: WsClient.ts first-message auth — sends {type:'auth',v:1,token} on open; queues subscribes
    until {type:'welcome'}; gated by ticketAuthEnabledForPlugin.
C5: edition.ts — ticketAuthEnabledForPlugin reads NEXT_PUBLIC_WWV_TICKET_AUTH_PLUGINS flag.
Step 0: docs/deploys/2026-05-21-adr-001-preflight.md + docs/feature-flags.md audit artifacts.
Tests: ticketClient.spec, WsClient.spec, ssrf.spec updated (342 passing).

Co-Authored-By: Claude Opus 4.7 <[email protected]>

* fix(ci): resolve three PR #171 type-check and startup failures

- auth-contracts.spec.ts: assert WebSocketAuthMessage.token as PluginTicket
  (not SensitiveString — distinct branded types fail toEqualTypeOf equality)
- pkce.spec.ts: replace function(){return this} mock with arrow fn to fix
  TS2683 implicit-this error in strict mode
- test-local-dev.yml: add ENCRYPTION_MASTER_KEY so instrumentation.ts boot
  validation doesn't crash the startup test in CI

Co-Authored-By: Claude Opus 4.7 <[email protected]>

* fix(ci): fix pkce mock constructor and env injection for startup test

- pkce.spec.ts: use function(this: object) instead of arrow fn so the
  mock can be called with `new Configuration(...)` (arrow functions are
  not constructors)
- test-local-dev.yml: sed-replace ENCRYPTION_MASTER_KEY in .env after
  cp .env.example so Next.js instrumentation boot check passes in CI

Co-Authored-By: Claude Opus 4.7 <[email protected]>

* fix(ci): also sed-replace AUTH_SECRET in .env for startup test

.env.example has AUTH_SECRET= (empty), which Next.js loads and overrides
the system env var, causing the same boot crash as ENCRYPTION_MASTER_KEY.

Co-Authored-By: Claude Opus 4.7 <[email protected]>

* fix(setup): auto-generate ENCRYPTION_MASTER_KEY in setup.mjs

The Playwright CI workflow uses `pnpm run setup` which previously only
generated AUTH_SECRET. ENCRYPTION_MASTER_KEY remained empty from
.env.example, causing instrumentation.ts boot validation to crash.

This fix also improves the new-developer onboarding experience — both
required secrets are now generated in a single setup step.

Co-Authored-By: Claude Opus 4.7 <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
2026-05-21 17:00:24 +12:00
Silvertakana 594f85afb2 feat(dx): implement worktree DB orchestration and graceful dev teardown (#132)
* 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
2026-05-15 11:20:29 +12:00
Antigravity AI 5fb36069ac fix(core): migrate changes and resolve cors issues [Patch]
- fix marketplace CORS by allowing x-marketplace-ping header [Patch]

- update setup page and docker entrypoint for legacy migrations [Patch]
2026-05-09 23:30:18 +12:00
SilvertakanaandAntigravity AI 67ca2abdbc feat: configure demo defaults via env vars (#26)
* feat(core): configure default demo plugins via env vars [Minor]

- parse NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS in AppShell [Minor]

- inject defaultEnabled in layersSlice initLayer [Patch]

- document demo defaults in .env.example [Patch]

* fix(core): enable plugin polling on boot and fix gps ID string [Patch]

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-16 01:20:05 +12:00
Antigravity AI e1910011aa fix(data-engine): update ACLED seeder to use OAuth flow and bump version to 1.1.4 [Patch]
* Replaced ACLED_API_KEY with ACLED_PASSWORD in .env.example
* Refactored fetchAllACLEDEvents to request OAuth tokens since API keys are deprecated
* Updated ACLED base URL to the latest endpoint
2026-04-09 23:05:44 +12:00
Antigravity AI aee5154eaf feat(civil-unrest): add ACLED API env vars to .env.example 2026-04-09 22:36:38 +12:00
silvertakana 3bc3b3461f feat(plugins): implement cyber attacks plugin and seeder 2026-04-03 17:36:14 +13:00
silvertakana 867e495353 fix: pass AUTH_SECRET to Docker and always run migrations on startup
- docker-compose.yml: inject AUTH_SECRET (fail-fast), WWV_DEMO_ADMIN_SECRET,
  and WWV_BRIDGE_TOKEN from host environment so JWT sessions survive restarts
- docker-entrypoint.sh: always run prisma migrate deploy (idempotent) instead
  of skipping when the DB file already exists; removes dead DB_PATH variable
- .env: document AUTH_SECRET as required for Docker deployments
- .env.example: add AUTH_SECRET field with generation instructions
2026-03-26 17:20:10 +13:00
silvertakana a56e2b6340 feat: allow operator plugin management on demo via admin secret header 2026-03-18 22:02:42 +13:00
silvertakana efa886ad3e feat: signal pending state for unverified plugin installs
install-redirect returns ?pending=pluginId for unverified plugins
instead of ?installed, so the marketplace can show correct status.
2026-03-18 18:26:24 +13:00
silvertakana 51b7fe01d5 feat: add marketplace bridge API for one-click install
- POST /api/marketplace/install  record plugin install in Prisma DB
- GET /api/marketplace/status  list installed marketplace plugins
- POST /api/marketplace/uninstall  remove installed plugin record
- Token-based auth via WWV_BRIDGE_TOKEN env var
- Repository with full unit test coverage
2026-03-13 21:34:32 +13:00
silvertakana 0d795bf5e8 feat: add Prisma ORM with SQLite for local database
- Add Prisma 7 with better-sqlite3 adapter
- Define schema: AviationHistory, InstalledPlugin, Setting
- Create data access layer (repository pattern)
- Migrate aviation history queries from Supabase to Prisma
- Auto-migrate on npm run dev via predev script
- Database auto-creates at data/wwv.db on first run
2026-03-13 21:04:14 +13:00
silvertakana 665893ef80 feat: add military flight tracking plugin via adsb.fi 2026-03-13 11:28:51 +13:00
silvertakana 522e976739 feat: multi-account OpenSky credential rotation
- New credentials.ts: pool manager that parses OPENSKY_CREDENTIALS env
  var (comma-separated clientId:clientSecret pairs), tracks per-credential
  tokens and credits, auto-rotates when credits drop below threshold or
  on 429 responses. Falls back to legacy OPENSKY_CLIENTID/CLIENTSECRET.
- Simplified auth.ts to thin wrapper over credential pool
- Removed single-credential fields from state.ts (now per-credential)
- rate-limit.ts stores credits per-credential via pool
- polling.ts rotates credentials on 429
- Updated .env.example with OPENSKY_CREDENTIALS documentation
- Added credentials.test.ts (8 tests) and updated rate-limit.test.ts
2026-03-09 15:42:54 +13:00
silvertakana 35050d150e docs: add .env.example template and update setup guide 2026-03-07 09:41:03 +13:00