feat(nomad): add residency and tax compliance cockpit template - #2454
Closed
paprikaf wants to merge 8 commits into
Closed
feat(nomad): add residency and tax compliance cockpit template#2454paprikaf wants to merge 8 commits into
paprikaf wants to merge 8 commits into
Conversation
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).
This comment has been minimized.
This comment has been minimized.
Contributor
Visual recap — skippedThe visual recap job did not run for this pull request. This is informational only and does not block the PR. Recap skipped for |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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 errorspnpm test(shared/compliance.spec.ts) — 24/24 passingpnpm build— production build succeedsguard-no-unscoped-queries,guard-no-localhost-fallback,guard-no-env-mutation,guard-no-env-credentials,guard-no-unscoped-credentials) — all passpnpm action db-check-scoping— all app tables scoped