Skip to content

feat(nomad): add residency and tax compliance cockpit template - #2454

Closed
paprikaf wants to merge 8 commits into
mainfrom
feat/nomad-template
Closed

feat(nomad): add residency and tax compliance cockpit template#2454
paprikaf wants to merge 8 commits into
mainfrom
feat/nomad-template

Conversation

@paprikaf

@paprikaf paprikaf commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Nomad is an agent-native app for people who are always on the move — it tracks your travels and keeps you on top of your physical residency, visas, and expiry dates, then tells you where you can safely be next.

Features:

  • A presence cockpit with a world map showing your status in every country you're tracking, at a glance
  • Automatic day counting for visa windows, tax-residency thresholds, and permanent residency / citizenship requirements
  • Visa and permit tracking, with expiry dates that factor directly into how long you can stay
  • A detail view for each country showing every rule that applies to you and what to do about it
  • A guided setup flow for your home country, citizenship, and travel destinations
  • An agent that knows your travel history and can answer questions about where you can go next
  • Support for 11 languages
  • A demo mode for showing off the app without exposing your real data

Example use case

Someone holding a long-stay visa in one region, working toward permanent residency in another, can open the app and immediately see how many visa days they have left, whether they're on track to keep their residency status, and get warned before the visa expires — with suggestions for where else they could safely go instead.

Test plan

  • pnpm typecheck — 0 errors
  • pnpm test (shared/compliance.spec.ts) — 24/24 passing
  • pnpm build — production build succeeds
  • Security guards (guard-no-unscoped-queries, guard-no-localhost-fallback, guard-no-env-mutation, guard-no-env-credentials, guard-no-unscoped-credentials) — all pass
  • pnpm action db-check-scoping — all app tables scoped
  • Manual per-user isolation check: a second account sees zero stays/rules/visas
  • Browser-verified: cockpit map, country detail pages, onboarding wizard, demo mode toggle, map "Ask agent" popover
  • Reviewer: confirm template registry entry / dev port (8106) doesn't collide with any in-flight template additions

Adds Nomad, a new agent-native template for digital nomads to track
Schengen 90/180 rolling windows, calendar-year tax-residency thresholds,
PR/citizenship presence minimums, and visa validity windows, then get
guidance on where they can safely be.

- Pure, unit-tested compliance engine (rolling-window day-aging
  simulation, calendar-year caps and minimums with feasibility math,
  visa-expiry capping) with 24 passing tests
- Cockpit dashboard: a real, clickable world map (world-atlas + d3-geo)
  with traffic-light country statuses, a visa-aware countdown, trip
  timeline, and severity-ranked alerts
- Country detail pages with multi-dimension rule/visa summaries and
  zone-aware recommendations
- Onboarding wizard built on error-proofing/pacing principles: every
  country searchable, every step skippable, live rule-arming preview
- 16 actions giving the agent full parity with the UI, including a
  one-tap "Ask agent" map action that attaches live compliance context
- Per-user data isolation (owner_email scoping + per-user profile
  settings key) verified against the repo's data-scoping guards
- Demo mode support, full i18n across 11 locales, and a changelog

Registers the template in the shared app config as hidden pending
public release (see accompanying changeset).
@netlify

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Visual recap — skipped

The visual recap job did not run for this pull request. This is informational only and does not block the PR.

Recap skipped for 8ffcbda: draft PR.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

1 similar comment
@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

paprikaf added 6 commits July 28, 2026 13:46
ensurePresetRules scoped its existing-rule check to the caller's owner but
inserted rows keyed by the global rules.id primary key (the preset slug),
so a real user's onboarding could collide with the demo seed's rows and
crash with a UNIQUE constraint error. Add a presetSlug column with a
per-owner unique index, seed rule ids with nanoid(), and dedupe against
presetSlug instead of id.

Also swap the app's navy/sky palette for the neutral black/zinc base used
by the other templates, keeping the safe/warn/danger traffic-light tokens
and a small blue --info accent for status text.
Demo mode previously only redacted identifying text (city names, passport)
while leaving the cockpit as empty as the real account behind it, defeating
its purpose for screenshots/presentations. It now fully substitutes a
fabricated, internally-consistent scenario at render time: fabricated
stays/rules/visas are run through the real computeSnapshot engine so day
counts, severities, and alerts stay correct, then swapped in ahead of the
real data via a wrapper around the compliance-status query.

Every control that would mutate a fabricated (non-existent) row — scan,
add trip, confirm/discard, map quick actions, track, add visa — is disabled
with a tooltip while demo data is showing; CSV export stays enabled since
exporting fabricated data is harmless.
@paprikaf paprikaf closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant