Commit Graph
16 Commits
Author SHA1 Message Date
Mao Nakamoto d84b880da9 feat(activity): unify digests history decisions 2026-06-09 18:42:34 +02:00
Mao Nakamoto 04fb546c91 test(smoke): cover digests route 2026-06-09 18:17:08 +02:00
g-butandCursor ec6f423b0f feat(infra): Postgres portability, Oracle cutover scripts, and DB kill-switch essay
Vendor-neutral DATABASE_URL helpers, dump/restore/sync tooling, and one-command
Oracle migration after a single console VM step. Publishes the studio-stack
thoughts article and hardens build (dynamic layout, resilient sitemap).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-23 11:24:20 +02:00
g-butandCursor f8c7a97533 fix(smoke): treat /api/crons as auth-gated like the route itself
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 19:14:51 +02:00
g-butandClaude Sonnet 4.6 5b00bd5595 test(smoke): add dynamic /api/projects/<id> coverage
GET /api/projects/[id] is the most-called endpoint in the app — every
project drawer open hits it. The static smoke test had no coverage for
it because the ID is runtime-derived. Reuses the same jq+curl pattern
used for /api/people/<id>: fetches the first entity project ID from
/api/user-projects, then hits the detail route and verifies it returns
2xx (or 401 without a session).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 03:17:30 +02:00
g-butandClaude Sonnet 4.6 e841c9a42f test(smoke): guard invitation middleware exclusion with regression check
Adds a smoke route check for /api/invitations/<bogus-token> that must return
404, not 401. If it returns 401 it means the middleware exclusion (api/invitations/)
regressed and new users can no longer accept team invitations. The check fails
loudly on 401, passing only on the expected 404 for an invalid token.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 03:00:51 +02:00
g-butandClaude Sonnet 4.6 b1033a5eb7 fix(beacon): remove ThemeToggle from popup; expand smoke to 39 routes
Transient popup windows should not control app-wide theme — removing
ThemeToggle from the beacon header prevents the next session from
waking up in light mode when the user clicked the toggle there.

Smoke test gains /api/orgs, /api/agent-tokens, /api/agent/register
(all three new multi-tenancy + agent-token endpoints).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 21:34:08 +02:00
g-butandClaude Sonnet 4.6 f6cb0dc681 fix: remove duplicate auth check in stripe portal, drop stale date, expand smoke to 36
- stripe/portal: remove copy-paste duplicate if (!userId) guard (dead code)
- money page: remove hardcoded Apr 2026 verification date that was already
  stale and would keep rotting; label remains without the date
- smoke.sh: add /api/setup (public), /api/checkout/personal, and
  /api/stripe/portal (accepts 401 + 503 when Stripe not configured);
  extend check_route with extra_ok_code param for integration-gated routes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 16:04:35 +02:00
g-butandClaude Sonnet 4.6 260f33250d test(smoke): expand coverage from 28 to 33 routes
Added /api/health (public), /api/control/agent, /api/control/commands,
/api/captures, and /api/beacon-settings to smoke coverage. All return
expected status codes (200 for public, 401 for auth-required routes).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 12:19:15 +02:00
g-butandClaude Sonnet 4.6 1416315bc9 fix(smoke): add missing nav routes and API endpoints to coverage
PAGE_ROUTES was missing /history, /thoughts, /settings (all in
NAV_ITEMS per the comment's own rule) and /whitepaper (public page).
Routes match navigation.ts NAV_ITEMS order for easier diffing.

AUTH_API_ROUTES grows from 5 to 10 — adds /api/me, /api/user-projects,
/api/invitations, /api/sessions, /api/prompts/agent. Each confirmed to
have a GET handler before adding. /api/subscriptions omitted (POST-only).

All 28 routes verified green against the running dev server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 10:53:49 +02:00
g-butandClaude Sonnet 4.6 6c32560377 fix(smoke): accept 401 for auth-protected API routes, add COCKPIT_SESSION_TOKEN support
smoke.sh was always exiting 1 because auth-required API routes correctly
return 401 without a session — but the script treated anything ≥400 as a
failure. Splits routes into PUBLIC_API_ROUTES (must 2xx) and AUTH_API_ROUTES
(200 or 401 both pass), so the check meaningfully detects 500s without
requiring a live session. When COCKPIT_SESSION_TOKEN is set, all requests
are authenticated and the full DB/query layer is exercised (20/20 routes).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 22:26:55 +02:00
g-butandClaude Sonnet 4.6 d47cc7a8cd perf(api): make /api/control non-blocking with async git queries
Replace 76 sequential execSync calls (19 projects × 4 git commands)
with Promise.all — all projects and the pgrep check now run in parallel.
Event loop no longer blocks on each request; response time drops from
~40s to ~2s.

Also: add /control and /api/control to smoke.sh route lists; bump
reachability probe timeout from 5s to 20s for dev-mode compilation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 18:51:54 +02:00
g-butandClaude Opus 4.7 2df42d77e3 chore(smoke): also fail when error.tsx boundary renders inside a 200
Status-only smoke missed a real failure mode: when a Server Component
throws, Next.js renders src/app/error.tsx ("Something went wrong")
INSIDE a 200 response. The page is broken from the user's perspective,
but smoke would mark it ok.

Refactor into a check_route helper that pages call with body-content
checking enabled. Greps the response body for the error-boundary
marker; failing-when-found means the run page doubles as a sanity
check on every server component, not just the route resolver.

API routes skip the body check (the marker is HTML-only and an API
that returned the literal string would be unusual).

Verified: all 18 routes still pass; the grep would catch a fake
error response if one were served.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 20:53:04 +02:00
g-butandClaude Opus 4.7 8d22c160e4 chore(smoke): add dynamic /api/people/<id> coverage via id discovery
Static-list smoke caught compile + db breakage but missed regressions
specific to [id] route handlers — readIdParam errors, per-row drizzle
queries, the parameter-handling lifecycle, etc.

Discover the first person id from /api/people (already smoked), then
GET /api/people/<id> and assert 2xx/3xx. Skipped silently if jq isn't
installed or the list is empty, so the script stays portable.

Other dynamic GETs (/api/projects/<id>) aren't smoked because no list
endpoint exists to derive an id without an extra DB roundtrip.

18 routes total now pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 10:43:11 +02:00
g-butandClaude Opus 4.7 b2cbe5adb7 chore(scripts): smoke also hits the 6 DB-backed GET API endpoints
Page-only smoke caught compile-time route breakage but missed
server-side regressions: a broken Drizzle query would render every
page as "Error" yet still return 200. Add the DB-backed API GETs:

  /api/goals, /api/habits, /api/people, /api/events, /api/crons,
  /api/system

Tool-dependent endpoints (/api/calendar, /api/weather, /api/github)
stay out of the default run because they need the local Ivy gateway
and would flake on machines that don't have it.

Verified: all 17 routes (11 pages + 6 APIs) return 200 against the
running dev server.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 18:32:46 +02:00
g-butandClaude Opus 4.7 b9aa7e657c chore(scripts): add npm run smoke — route-level regression check
Until now the codebase had zero automated coverage; every refactor
relied on a manual curl loop. scripts/smoke.sh runs that loop in one
command: probe BASE/, then GET every page route and assert 2xx/3xx.

- Routes match config/navigation.ts NAV_ITEMS plus the / redirect
- BASE env var override for prod smoke (defaults to localhost:3000)
- Fast-fails with a clear "start the dev server first" message if
  the base is unreachable, instead of dribbling 11 curl errors
- No new dependencies — bash + curl only

Verified: all 11 routes return 200 against the running dev server.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 18:30:20 +02:00