Commit Graph
3 Commits
Author SHA1 Message Date
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
Silvertakana bc6f087efb feat: add Garbage Collector agent — daily Haiku-powered codebase hygiene (#175)
Adds a daily GitHub Actions cron that runs a zero-cost deterministic scan
(gc-scan.mjs) then hands findings to a Haiku subagent for triage:
- Tier A findings (stale TODOs, console.log, @ts-ignore, .mdc refs) → draft PRs
- Tier B findings (oversized files, orphaned rule refs, outdated deps) → Issues
- Max 3 PRs + 5 Issues per run, 150 LOC cap per PR, full idempotency via gc-bot label
- Defaults to dry-run mode for safe initial validation
2026-05-23 00:23:55 +12:00
Silvertakana f5802cf34a feat(gc): add Garbage Collector scan script
This script scans the repository for stale branches, old comments, orphaned packages, and outdated Prisma migrations, generating a JSON report.
2026-05-22 23:58:33 +12:00